{"version":3,"file":"processFlowCertificateDynamicInputsHandler-ad4f6ac3.js","sources":["../../../app/javascript/common/components/builders/header/builderHeader.vue","../../../app/javascript/common/components/builders/header/builderHeader.vue?vue&type=template&lang.js","../../../app/javascript/common/models/dynamicFields/handlers/dateDynamicFieldsHandler.ts","../../../app/javascript/common/models/dynamicFields/handlers/userDynamicFieldsHandler.ts","../../../app/javascript/common/helpers/processFlowHelper.ts","../../../app/javascript/common/models/dynamicFields/handlers/processFlows/processFlowFormDynamicFieldsHandler.ts","../../../app/javascript/common/models/dynamicFields/handlers/processFlows/processFlowObjectModelDynamicFieldsHandler.ts","../../../app/javascript/common/models/dynamicFields/options/processFlowVariableOptions.ts","../../../app/javascript/common/models/dynamicFields/handlers/processFlows/processFlowVariablesHandler.ts","../../../app/javascript/common/models/dynamicFields/handlers/processFlows/processFlowFormElementDynamicFieldsHandler.ts","../../../app/javascript/common/models/dynamicFields/handlers/processFlows/processFlowDynamicInputFieldsHandler.ts","../../../app/javascript/common/models/dynamicFields/handlers/processFlows/processFlowCertificateDynamicInputsHandler.ts"],"sourcesContent":["\n\n","\n
\n \n \n \n
\n","import {IDynamicDataConfig, IDynamicDataSectionConfig} from \"../../../interfaces/dynamicFieldsInterfaces\";\nimport {Constructor} from \"../../../../global/constructor\";\nimport {ModelType} from '~/enums/modelType'\n\nexport default function DateDynamicFieldsHandlerMixin(Base: TBase) {\n return class DateDynamicFieldsHandler extends Base {\n SECTIONS = ['dates'];\n dynamicMessage: string;\n showDynamicMessage: boolean;\n dateOptions: Readonly;\n\n dateSections(q: string): IDynamicDataSectionConfig[] {\n return this.dateOptions.filter(section => section.label.toLowerCase().match(q) !== null);\n }\n\n hasDateMatch(q: string): boolean {\n return this.dateSections(q).length > 0;\n }\n\n selectDate(section: IDynamicDataSectionConfig): IDynamicDataConfig {\n return {\n id: section.id,\n label: section.label,\n type: section.type,\n modelType: ModelType.DateTime,\n };\n }\n }\n}\n","import { Constructor } from '../../../../global/constructor'\nimport { DynamicReferenceType } from '../../../enums/dynamicReferenceType'\nimport { IDynamicReferencedThing, IUserDataSection } from '../../../interfaces/dynamicFieldsInterfaces'\nimport { ModelType } from '~/enums/modelType'\nimport WorkflowStep from '../../../../formability/form_builder/models/workflow/workflowStep'\nimport { FormElementType } from '../../../enums/formElementType'\nimport { InputFormatType } from '../../../../formability/form_builder/models/inputFormatType'\nimport { ReferencePathNode } from '~/models/referencePaths/referencePathNode'\nimport { ReferenceNodeType } from '~/enums/referenceNodeType'\n\nexport default function UserDynamicFieldsHandlerMixin(Base: TBase) {\n return class UserDynamicFieldsHandler extends Base {\n SECTIONS = ['userData'];\n dynamicMessage: string;\n showDynamicMessage: boolean;\n protected profileConfigs: Array;\n\n constructor(...args) {\n super(...args);\n this.profileConfigs = (args[0] && args[0].profileConfigs) || [];\n }\n\n get baseUserDataSections(): IUserDataSection[] {\n return [\n {\n header: 'Original Submitter',\n type: DynamicReferenceType.OriginalSubmitter,\n fields: [\n {modelType: ModelType.Text, id: 'first_name', label: 'First name'},\n {modelType: ModelType.Text, id: 'last_name', label: 'Last name'},\n {modelType: ModelType.User, id: 'email', label: 'Email'},\n ],\n isOpen: true,\n select: this.selectUserData,\n },\n {\n header: 'This step\\'s completer',\n type: DynamicReferenceType.StepCompleter,\n fields: [\n {modelType: ModelType.Text, id: 'first_name', label: 'First name'},\n {modelType: ModelType.Text, id: 'last_name', label: 'Last name'},\n {modelType: ModelType.Text, id: 'email', label: 'Email'},\n ],\n isOpen: true,\n select: this.selectUserData,\n },\n {\n header: 'Form User Data',\n type: DynamicReferenceType.FormMetaData,\n fields: [\n {modelType: ModelType.User, id: 'original_submitter', label: 'Original Submitter'},\n {modelType: ModelType.User, id: 'proxy_submitter', label: 'Proxy Submitter'},\n {modelType: ModelType.User, id: 'current_step_completer', label: 'Current Step Completer'},\n ],\n isOpen: true,\n select: this.selectUserData,\n },\n {\n header: \"Record Holder Data\",\n type: DynamicReferenceType.ObjectModelRecordMetadata,\n fields: [\n {modelType: ModelType.User, id: 'record_holder', label: 'Record Holder'},\n ],\n isOpen: true,\n select: this.selectUserData,\n },\n ];\n }\n\n userDataSections(q: string): IUserDataSection[] {\n const sections: IUserDataSection[] = this.baseUserDataSections.map(section => {\n let fields = section.fields.filter(field => field.label.toLowerCase().match(q) !== null);\n return this.buildUserDataSection(fields, section.header, section.type);\n });\n if (this.hasUserProfiles) sections.push(this.userProfileFields(q));\n return sections;\n }\n\n hasUserDataMatch(q: string): boolean {\n return this.userDataSections(q).some(section => {\n return section.fields && section.fields.length > 0 ||\n section.sections && section.sections.some(s => s.fields && s.fields.length > 0);\n });\n }\n\n userProfileFields(q: string): IUserDataSection {\n const profileConfigSections = this.profileConfigs.map(profileConfig => {\n const profileConfigFields = profileConfig.profile_config_fields.map(profileConfigField => {\n return {id: profileConfigField.id, label: profileConfigField.name}\n }).filter(field => field.label.toLowerCase().match(q) !== null);\n return this.buildUserDataSection(profileConfigFields, profileConfig.name, DynamicReferenceType.ProfileConfig);\n });\n return {\n header: 'Profiles',\n type: DynamicReferenceType.ProfileConfig,\n fields: [],\n sections: profileConfigSections,\n isOpen: true,\n select: this.selectUserData,\n };\n }\n\n private get hasUserProfiles(): boolean {\n return this.profileConfigs.length > 0;\n }\n\n protected selectUserData(field: IUserDataSection['fields'][0], type: DynamicReferenceType): IDynamicReferencedThing {\n return {\n type: type,\n id: field.id,\n label: field.label,\n modelType: field.modelType,\n };\n }\n\n private buildUserDataSection(fields: IUserDataSection['fields'], header: string, type: DynamicReferenceType): IUserDataSection {\n return {\n header: header,\n type: type,\n fields: fields,\n isOpen: fields.length > 0,\n select: this.selectUserData.bind(this),\n };\n }\n }\n}\n","import * as _ from 'lodash'\nimport { GenericType } from '~/interfaces/genericTypeInterfaces'\nimport { ModelTypeCompatibilityMap } from '~/enums/modelType'\n\nexport function CheckCompatibleGenericTypes(allowedGenericTypes: GenericType[], sourceGenericType: GenericType) {\n const compatibleTypes = _.flatten(allowedGenericTypes.map((t) => ModelTypeCompatibilityMap(t)))\n\n return compatibleTypes.includes(sourceGenericType)\n}","import { escape } from \"lodash\";\nimport { DynamicReferenceType } from \"~/enums/dynamicReferenceType\";\nimport { ModelType } from '~/enums/modelType'\nimport { CheckCompatibleGenericTypes } from '~/helpers/processFlowHelper'\nimport { ReferenceNodeType } from \"~/enums/referenceNodeType\";\nimport { BooleanHelper } from '~/helpers/booleanHelper';\nimport { DeterministicDynamicComponentType, IDeterministicDynamicFieldsHandler, IDynamicFieldsDestinationOptions, IFormSubmitterDynamicFieldsOptions } from \"~/interfaces/dynamicFieldsElementOptionsInterfaces\";\nimport {\n IDynamicDataConfig,\n IDynamicDataSectionConfig, IDynamicField,\n IDynamicReferencedThing,\n IDynamicTreeContext,\n IFormDataSection,\n IUserDataSection\n} from \"~/interfaces/dynamicFieldsInterfaces\";\nimport { Hash } from \"~/interfaces/hashInterfaces\";\nimport { IProcessFlowVariable } from '~/interfaces/processFlowInterfaces';\nimport DateDynamicFieldsHandlerMixin from \"~/models/dynamicFields/handlers/dateDynamicFieldsHandler\";\nimport FormElementDynamicFieldsHandler from \"~/models/dynamicFields/handlers/formElementDynamicFieldsHandler\";\nimport FormPaymentsDynamicFieldsHandlerMixin from \"~/models/dynamicFields/handlers/formPaymentsDynamicFieldsHandler\";\nimport UserDynamicFieldsHandlerMixin from \"~/models/dynamicFields/handlers/userDynamicFieldsHandler\";\nimport { assignProcessFlowDynamicFieldsCommonOptions } from '~/models/dynamicFields/helpers';\nimport { ReferencePathNode } from \"~/models/referencePaths/referencePathNode\";\nimport Form from \"../../../../../formability/form_builder/models/form\";\nimport ElementContainer from \"../../../../../formability/form_builder/models/formElements/elementContainer\";\nimport FormElement from \"../../../../../formability/form_builder/models/formElements/formElement\";\nimport { Capability } from \"../../../../../formability/form_builder/models/formElements/formElementCapability\";\nimport WorkflowStep from \"../../../../../formability/form_builder/models/workflow/workflowStep\";\nimport ProcessFlowDynamicFieldHandlerSelectMixin from '~/models/dynamicFields/handlers/mixins/processFlowDynamicFieldHandlerSelectMixin'\nimport { FormElementType } from '../../../../enums/formElementType'\nimport { InputFormatType } from '../../../../../formability/form_builder/models/inputFormatType'\nimport { GenericType } from '~/interfaces/genericTypeInterfaces'\n\ntype ItemTypes = Form | FormElement | IDynamicField\n\nexport class ProcessFlowFormDynamicFieldsHandler extends UserDynamicFieldsHandlerMixin(DateDynamicFieldsHandlerMixin(FormPaymentsDynamicFieldsHandlerMixin(FormElementDynamicFieldsHandler))) implements IDeterministicDynamicFieldsHandler, IDynamicFieldsDestinationOptions, IFormSubmitterDynamicFieldsOptions {\n COMPONENTS: Array = ['process-flow-form-dynamic-fields'];\n variable: IProcessFlowVariable\n // null means the destination is not important and so don't do operations in here based on this flag\n destinationIsCollection: boolean | null = null;\n form: Form;\n allowElementContainerSelection: boolean = true;\n allowUserSelection: boolean = true;\n userDataHeader?: string;\n restrictToTopLevelCollections: boolean | null = null\n restrictToRootModel: boolean | null = null\n usersOnly: boolean = false\n hideWorkflowStepData: boolean = null;\n allowedGenericTypes?: GenericType[] = null\n isSingleOnly: boolean = false\n\n constructor(options: IFormSubmitterDynamicFieldsOptions) {\n super(options);\n this.form = options.form;\n if (Array.isArray(options.COMPONENTS)) this.COMPONENTS = options.COMPONENTS;\n if (options.userDataHeader) this.userDataHeader = options.userDataHeader;\n if (BooleanHelper.isStrictBoolean(options.allowElementContainerSelection)) this.allowElementContainerSelection = options.allowElementContainerSelection;\n this.elementOptions.getElements = options.elementOptions?.getElements || this.getElements;\n if (BooleanHelper.isStrictBoolean(options.usersOnly)) this.usersOnly = options.usersOnly\n if (BooleanHelper.isStrictBoolean(options.hideWorkflowStepData)) this.hideWorkflowStepData = options.hideWorkflowStepData;\n if (BooleanHelper.isStrictBoolean(options.allowUserSelection)) this.allowUserSelection = options.allowUserSelection;\n if (BooleanHelper.isStrictBoolean(options.isSingleOnly)) this.isSingleOnly = options.isSingleOnly;\n assignProcessFlowDynamicFieldsCommonOptions(this, options)\n }\n\n formDataSection(q: string): IFormDataSection {\n if (this.form.title.toLowerCase().match(q) !== null) {\n return {\n form: this.form,\n isOpen: true,\n select: this.selectFormData.bind(this),\n }\n }\n return null;\n }\n\n get dateOptions(): IDynamicDataSectionConfig[] {\n return [\n {\n type: DynamicReferenceType.InitialSubmissionEnd,\n modelType: ModelType.DateTime,\n id: 'submitted_at',\n label: 'Date of Submission',\n select: this.selectDate.bind(this),\n },\n ];\n }\n\n get formSubmissionOptions(): IDynamicDataSectionConfig[] {\n return [\n {\n type: DynamicReferenceType.SubmissionId,\n modelType: ModelType.Text,\n id: null,\n label: 'Submission ID',\n select: this.selectSubmissionId.bind(this),\n },\n ];\n }\n\n userDataSections(q: string) {\n return super.userDataSections(q).filter(section => section.type === DynamicReferenceType.OriginalSubmitter);\n }\n\n formUserSections(q: string) {\n return super.userDataSections(q).filter(section => section.type === DynamicReferenceType.FormMetaData);\n }\n\n formSubmissionSections(q: string) {\n return this.formSubmissionOptions.filter(section => section.label.toLowerCase().match(q) !== null);\n }\n\n selectFormData(): IDynamicDataConfig {\n const config: Omit = {\n type: DynamicReferenceType.Form,\n label: escape(this.form.title),\n path: [\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.ProcessFlowVariable, reference_id: this.variable.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.Form, reference_id: this.form.id}),\n ],\n };\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(this.form, config);\n }\n\n selectDate(section: IDynamicDataSectionConfig): IDynamicDataConfig {\n const config: Omit = {\n ...super.selectDate(section),\n path: [\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.ProcessFlowVariable, reference_id: this.variable.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.Form, reference_id: this.form.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.FormSubmissionDate, reference_id: section.id}),\n ],\n };\n if ([DynamicReferenceType.StepStart, DynamicReferenceType.StepEnd].includes(section.type)) {\n let reference_type = section.type === 4 ? ReferenceNodeType.WorkflowStepStart : ReferenceNodeType.WorkflowStepEnd\n config.path.splice(2,1, (new ReferencePathNode(null, {reference_type: reference_type, reference_id: section.id})))\n }\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(section, config)\n }\n\n selectSubmissionId(section: IDynamicDataSectionConfig): IDynamicDataConfig {\n const config: Omit = {\n path: [\n new ReferencePathNode(null, { reference_type: ReferenceNodeType.ProcessFlowVariable, reference_id: this.variable.id }),\n new ReferencePathNode(null, { reference_type: ReferenceNodeType.Form, reference_id: this.form.id }),\n new ReferencePathNode(null, { reference_type: ReferenceNodeType.FormSubmissionID, reference_id: section.id }),\n ],\n type: DynamicReferenceType.SubmissionId,\n label: \"Submission ID\"\n };\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(section, config)\n }\n\n protected selectUserData(field: IUserDataSection['fields'][number], type: DynamicReferenceType): IDynamicReferencedThing {\n const config: Omit = {\n ...super.selectUserData(field, type),\n path: [\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.ProcessFlowVariable, reference_id: this.variable.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.Form, reference_id: this.form.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.OriginalSubmitter, reference_id: field.id}),\n ],\n };\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(field, config)\n }\n\n protected selectPaymentData(paymentData: IDynamicDataSectionConfig, type: DynamicReferenceType, workflowStep: WorkflowStep): IDynamicReferencedThing {\n const config: Omit = {\n ...super.selectPaymentData(paymentData, type, workflowStep),\n path: [\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.ProcessFlowVariable, reference_id: this.variable.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.Form, reference_id: this.form.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.WorkflowStep, reference_id: workflowStep.id}),\n new ReferencePathNode(null, {reference_type: this.paymentReferenceNodeType(type), reference_id: paymentData.id}),\n ],\n };\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(paymentData, config);\n }\n\n protected selectFormElement(element: FormElement, workflowStep: WorkflowStep, index?: number): IDynamicReferencedThing {\n const config: Omit = {\n type: DynamicReferenceType.FormElement,\n label: escape(element.referenceNameOrDefault),\n wsTitle: escape(workflowStep.titleOrDefault),\n pillColor: this.pillColor,\n path: [\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.ProcessFlowVariable, reference_id: this.variable.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.Form, reference_id: this.form.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.WorkflowStep, reference_id: element.workflowStep.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.FormElement, reference_id: element.id}),\n ],\n };\n\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(element, config)\n }\n\n isDisabled(item: ItemTypes, context: Partial> = {}): boolean {\n if (item['item']) {\n // this is a hack for user formWorkflowStepUserSection\n item = item['item']\n }\n\n if (this.isSingleOnly) {\n if (item instanceof FormElement && item.is_repeatable) return true\n }\n\n if (this.allowedGenericTypes && (item instanceof FormElement)) {\n if (!CheckCompatibleGenericTypes(this.allowedGenericTypes, item.genericType)) {\n return true\n }\n }\n\n if (BooleanHelper.isStrictBoolean(this.destinationIsCollection)) {\n if (!this.itemListTypeMatches(item)) return true\n }\n if (this.restrictToTopLevelCollections) {\n if (!this.isTopLevelCollection(item, context)) return true\n }\n if (this.restrictToRootModel) {\n if (!(item instanceof Form)) return true;\n }\n return false\n }\n\n protected getElements(elementContainer: ElementContainer, options: Hash = {}): FormElement[] {\n return elementContainer.formElementsArray.filter(element => element.can(Capability.referenceable) || element.can(Capability.layoutContainer) || element.can(Capability.signature));\n }\n\n protected itemIsCollection(item: ItemTypes): boolean {\n if (item instanceof Form) {\n return this.formIsCollection(item);\n } else if (item instanceof FormElement) {\n return this.formElementIsCollection(item);\n } else { // IDynamicDataSectionConfig\n return this.dynamicItemIsCollection(item);\n }\n }\n\n protected formIsCollection(item: Form): boolean {\n return !this.variable.is_single;\n }\n\n protected dynamicItemIsCollection(item: IDynamicField): boolean {\n return !this.variable.is_single\n }\n\n protected formElementIsCollection(item: FormElement): boolean {\n return !this.variable.is_single || item.isDataCollection || item.isInRepeatable\n }\n\n private paymentReferenceNodeType(type: DynamicReferenceType): ReferenceNodeType {\n switch (type) {\n case DynamicReferenceType.PaymentsTotalCost:\n return ReferenceNodeType.FormPaymentsTotalCost;\n case DynamicReferenceType.PaymentsType:\n return ReferenceNodeType.FormPaymentsType;\n case DynamicReferenceType.PaymentsDate:\n return ReferenceNodeType.FormPaymentsDate;\n case DynamicReferenceType.PaymentsLineItem:\n return ReferenceNodeType.FormPaymentsLineItem;\n }\n }\n\n private itemListTypeMatches(item: ItemTypes): boolean {\n return this.destinationIsCollection === this.itemIsCollection(item)\n }\n\n isTopLevelCollection(item: ItemTypes, context: Partial> = {}): boolean {\n // If top level is already assigned, exit early\n if (context.isTopLevelCollectionAssigned) return false\n\n if (item instanceof Form) {\n // variable is collection, then the form is top-level collection\n return !this.variable.is_single && this.variable.reference_id === item.id\n } else if (item instanceof FormElement) {\n return this.formElementIsCollection(item)\n } else {\n return false /* unclear what else could be a top-level collection */\n }\n }\n\n formUserSection() {\n return {\n fields: [\n {modelType: ModelType.User, id: 'all_completers', label: 'All Completers', isCollection: true},\n {modelType: ModelType.User, id: 'original_submitter', label: 'Original Submitter', isCollection: false},\n ],\n select: this.selectUser.bind(this)\n }\n }\n\n selectUser(field, type, workflowStep = null) {\n let path = [\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.ProcessFlowVariable, reference_id: this.variable.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.Form, reference_id: this.form.id}),\n ]\n\n if (workflowStep) {\n path.push(new ReferencePathNode(null, {reference_type: ReferenceNodeType.WorkflowStep, reference_id: workflowStep.id}))\n }\n\n let reference_type\n let reference_id\n switch (field.id) {\n case 'all_completers':\n reference_type = ReferenceNodeType.AllCompleters\n reference_id = field.id\n break\n case 'original_submitter':\n reference_type = ReferenceNodeType.OriginalSubmitter\n reference_id = field.id\n break\n case 'step_completer':\n reference_type = ReferenceNodeType.StepCompleter\n reference_id = field.id\n break\n default:\n if (field.modelType === ModelType.FormElement) {\n reference_type = ReferenceNodeType.FormElement\n reference_id = field.id\n } else {\n throw new Error('not implemented')\n }\n }\n\n path.push(new ReferencePathNode(null, {reference_type, reference_id}))\n\n return {\n type,\n id: field.id,\n label: field.label,\n modelType: field.modelType,\n path\n }\n }\n\n formWorkflowStepUserSection(workflowStep: WorkflowStep) {\n let fields: {modelType: ModelType, id: string, label: string, item?: FormElement}[] = [\n {modelType: ModelType.User, id: 'step_completer', label: 'Step Completer'},\n ]\n\n workflowStep.form_section.formElementsArrayDeep.forEach((fe) => {\n if (\n fe.elementType === FormElementType.textField &&\n fe.format_type === InputFormatType.Email\n ) {\n fields.push({\n modelType: ModelType.FormElement,\n id: fe.id,\n label: fe.label_title,\n item: fe\n })\n }\n })\n\n return {\n select: this.selectUser.bind(this),\n fields,\n }\n }\n}","import { escape } from 'lodash';\nimport DynamicFieldsHandler from \"../dynamicFieldsHandler\";\nimport ObjectModel from \"../../../objectModel\";\nimport ObjectModelProperty from \"../../../objectModelProperties/objectModelProperty\";\nimport ObjectModelPropertyOptions from \"../../options/objectModelPropertyOptions\";\nimport {ObjectModelPropertyRootType} from \"~/enums/objectModelPropertyType\";\nimport {EnumHelper} from \"~/helpers/enumHelper\";\nimport ObjectModelPropertyDefinition from \"../../../objectModelProperties/objectModelPropertyDefinition\";\nimport {\n IDynamicDataConfig, IDynamicField,\n IDynamicObjectModelPropertyConfig, IDynamicReferencedThing,\n IDynamicTreeContext,\n IObjectModelDataSection, IUserDataSection,\n IObjectModelLinkedFormsSection,\n} from \"~/interfaces/dynamicFieldsInterfaces\"\nimport {DynamicReferenceType} from \"~/enums/dynamicReferenceType\";\nimport ObjectModelBuiltInPropertyDecorator from \"~/models/decorators/objectModelBuiltinPropertyDecorator\";\nimport {ObjectHelper} from \"~/helpers/objectHelper\";\nimport ObjectModelRelation from \"~/models/objectModelRelations/objectModelRelation\";\nimport {ReferencePathNode} from \"~/models/referencePaths/referencePathNode\";\nimport {DeterministicDynamicComponentType, IDeterministicDynamicFieldsHandler, IObjectModelPropertyFieldsHandlerConfig, IObjectModelRelationHandlerConfig, TModes} from \"~/interfaces/dynamicFieldsElementOptionsInterfaces\"\nimport {assignProcessFlowDynamicFieldsCommonOptions} from '~/models/dynamicFields/helpers'\nimport {BooleanHelper} from '~/helpers/booleanHelper'\nimport {IProcessFlowVariable} from '~/interfaces/processFlowInterfaces'\nimport {Logger} from \"~/services/logger\";\nimport ProcessFlowDynamicFieldHandlerSelectMixin from '~/models/dynamicFields/handlers/mixins/processFlowDynamicFieldHandlerSelectMixin'\nimport UserDynamicFieldsHandlerMixin from \"~/models/dynamicFields/handlers/userDynamicFieldsHandler\";\nimport {ReferenceNodeType} from \"~/enums/referenceNodeType\";\nimport { GenericType } from '~/interfaces/genericTypeInterfaces'\nimport { CheckCompatibleGenericTypes } from '~/helpers/processFlowHelper'\nimport { ModelType } from '~/enums/modelType';\n\ntype ItemTypes = ObjectModel | ObjectModelProperty | ObjectModelRelation | Required\n\nexport default class ProcessFlowObjectModelDynamicFieldsHandler extends UserDynamicFieldsHandlerMixin(DynamicFieldsHandler) implements IDeterministicDynamicFieldsHandler, IObjectModelPropertyFieldsHandlerConfig, IObjectModelRelationHandlerConfig {\n COMPONENTS: Array = ['process-flow-object-model-dynamic-fields'];\n variable: IProcessFlowVariable\n dynamicMessage: string;\n showDynamicMessage: boolean;\n mode: TModes;\n objectModel: ObjectModel;\n allowObjectModelSelection: boolean = true;\n allowLinkSubmissions: boolean = null;\n allowUserSelection: boolean = true\n allowAccountRelationSelection: boolean = true\n traverseRelatedObjectModels: boolean = true\n header: string = 'Object Model Properties';\n rootHeader: string;\n elementOptions = new ObjectModelPropertyOptions();\n destinationIsCollection: boolean | null = null;\n restrictToTopLevelCollections: boolean | null = null\n restrictToRootModel: boolean | null = null\n hideRecordHolderData: boolean = null;\n allowedGenericTypes?: GenericType[] = null\n accountRelationMetadataShowEntity: boolean = true;\n\n /**\n *\n * @param options: { mode: 'flat' | 'type', objectModel?: ObjectModel }\n *\n * `'flat'` mode: displays flat list of all properties\n *\n * > Object Model Properties\n * - Property 1\n * - Property 2\n *\n * `'type'` mode: displays list of properties nested by type\n *\n * > Object Model Properties\n * > Short Text\n * - Property 1\n * > Long Text\n * - Property 2\n *\n */\n\n constructor(options: IObjectModelPropertyFieldsHandlerConfig & Partial) {\n super(options);\n this.mode = options.mode || 'flat';\n this.objectModel = options.objectModel;\n if (BooleanHelper.isStrictBoolean(options.allowObjectModelSelection)) this.allowObjectModelSelection = options.allowObjectModelSelection;\n if (BooleanHelper.isStrictBoolean(options.traverseRelatedObjectModels)) this.traverseRelatedObjectModels = options.traverseRelatedObjectModels;\n if (BooleanHelper.isStrictBoolean(options.allowUserSelection)) this.allowUserSelection = options.allowUserSelection;\n if (BooleanHelper.isStrictBoolean(options.allowAccountRelationSelection)) this.allowAccountRelationSelection = options.allowAccountRelationSelection;\n if (options.header) this.header = options.header;\n if (options.rootHeader) this.rootHeader = options.rootHeader;\n if (options.elementOptions) {\n this.elementOptions = options.elementOptions\n }\n if (BooleanHelper.isStrictBoolean(options.hideRecordHolderData)) this.hideRecordHolderData = options.hideRecordHolderData;\n assignProcessFlowDynamicFieldsCommonOptions(this, options)\n }\n\n // this is here because the Vue components are shared with ProcessFlowObjectModelSendNotificationDynamicFieldsHandler\n // and maybe others too.\n get usersOnly(): boolean {\n return false\n }\n\n objectModelDataSection(q: string, objectModel: ObjectModel): IObjectModelDataSection {\n if (objectModel.title.toLowerCase().match(q) !== null) {\n return {\n objectModel: objectModel,\n isOpen: true,\n select: this.selectObjectModelData.bind(this),\n }\n }\n return null;\n }\n\n linkedFormsSection(q: string, objectModel: ObjectModel): IObjectModelLinkedFormsSection {\n return {\n select: this.selectLinkedFormData.bind(this),\n fields: objectModel.object_model_linked_forms.reduce((fields, formData: { id: string, title: string }) => {\n if (this.qMatches(q, formData.title)) {\n fields.push({ id: formData.id, label: formData.title, modelType: ModelType.Form });\n }\n\n return fields;\n }, []),\n };\n }\n\n objectModelPropertiesSection(q: string, objectModel: ObjectModel): Pick {\n const section: Pick = {\n properties: [],\n select: this.selectObjectModelProperty.bind(this),\n };\n section.properties.push(\n ...this.elementOptions.getElements(objectModel).filter(prop => {\n return prop.labelTitleDisplay.toLowerCase().match(q) !== null;\n })\n );\n return section;\n }\n\n objectModelPropertySections(q: string, objectModel: ObjectModel): IDynamicObjectModelPropertyConfig[] {\n const sections = EnumHelper.toArray(ObjectModelPropertyRootType)\n .map(t => {\n return this.buildObjectModelPropertySection(t, []);\n });\n this.elementOptions.matchElements(objectModel, q).forEach(property => {\n const section = sections.find(s => s.propertyType === property.property_type);\n if (section) {\n section.properties.push(property);\n }\n });\n return sections;\n }\n\n hasObjectModelPropertyMatch(q: string, objectModel: ObjectModel): boolean {\n return this.objectModelPropertiesSection(q, objectModel).properties.length > 0;\n }\n\n hasObjectModelPropertySortedMatch(q: string, objectModel: ObjectModel): boolean {\n return this.objectModelPropertySections(q, objectModel).some(section => section.properties.length > 0);\n }\n\n selectObjectModelData(objectModel: ObjectModel, path: ReferencePathNode[]): IDynamicDataConfig {\n const config: Omit = {\n type: DynamicReferenceType.ObjectModel,\n label: escape(objectModel.title),\n path: path,\n };\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(objectModel, config);\n }\n\n protected selectLinkedFormData(formData: {id: string, title: string}, objectModel: ObjectModel, partialPath: ReferencePathNode[]): IDynamicDataConfig {\n const config: Omit = {\n label: escape(formData.title),\n path: [\n ...partialPath,\n new ReferencePathNode(null, { reference_type: ReferenceNodeType.ObjectModelLinkedForm, reference_id: formData.id }),\n ],\n };\n\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(formData, config);\n }\n\n protected selectUserData(field: IUserDataSection['fields'][number], type: DynamicReferenceType): IDynamicReferencedThing {\n const config: Omit = {\n ...super.selectUserData(field, type),\n path: [\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.ProcessFlowVariable, reference_id: this.variable.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.ObjectModel, reference_id: this.objectModel.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.RecordHolder, reference_id: field.id}),\n ],\n };\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(field, config)\n }\n\n userDataSections(q: string) {\n return super.userDataSections(q).filter(section => section.type === DynamicReferenceType.ObjectModelRecordMetadata);\n }\n\n /**\n * random guid is used as data id along with path in the dynamic data.\n * guid is saved in formula and the path is eventually saved outside of the formula\n * as an array of +ReferencePathNode+ embedded in a +ReferencePath+ that has the guid as its client_id\n * the formula can then find the right +ReferencePath+ to look up how to find the data for the pill\n *\n * @param property\n * @param objectModel\n * @param path\n * @private\n */\n private selectObjectModelProperty(property: ObjectModelProperty | ObjectModelBuiltInPropertyDecorator, objectModel: ObjectModel, path: ReferencePathNode[]): IDynamicDataConfig {\n const config: Omit = {\n type: DynamicReferenceType.ObjectModelProperty,\n rootId: objectModel.id,\n pillColor: this.pillColor,\n path: path,\n label: property.labelTitleDisplay,\n };\n\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(property, config);\n }\n\n private buildObjectModelPropertySection(propertyType: ObjectModelPropertyRootType, properties: ObjectModelProperty[]): IDynamicObjectModelPropertyConfig {\n return {\n propertyType: propertyType,\n propertyTypeName: ObjectModelPropertyDefinition.getDisplayName(propertyType),\n properties: properties,\n select: this.selectObjectModelProperty.bind(this),\n };\n }\n\n objectModelRelations(q: string, objectModel: ObjectModel): ObjectModelRelation[] {\n return ObjectHelper.toArray(objectModel.object_model_relations).filter(relation => {\n if (relation.isAccountRelationship) return false;\n return relation.friendlyDescription.match(q)\n });\n }\n\n inverseObjectModelRelations(q: string, objectModel: ObjectModel): ObjectModelRelation[] {\n return objectModel.inverse_object_model_relations.all.filter(relation => {\n if (relation.isAccountRelationship) return false;\n return relation.friendlyDescription.match(q)\n });\n }\n\n hasObjectModelRelationshipMatch(q: string, objectModel: ObjectModel): boolean {\n return this.objectModelRelations(q, objectModel).length > 0;\n }\n\n hasRelatedObjectModelMatch(q: string, relation: ObjectModelRelation): boolean {\n return relation.related_object_models.filter(om => om.title.toLowerCase().match(q)).length > 0\n }\n\n hasObjectModelDataMatch(q: string, objectModel: ObjectModel): boolean {\n return this.hasObjectModelPropertyMatch(q, objectModel) || this.hasObjectModelRelationshipMatch(q, objectModel);\n }\n\n selectAccountRelation(relation: ObjectModelRelation, path: ReferencePathNode[]): IDynamicDataConfig {\n const config: Omit = {\n type: DynamicReferenceType.ObjectModelRelation,\n label: escape(relation.label_title),\n path: path,\n };\n\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(relation, config);\n }\n\n objectModelAccountRelations(objectModel: ObjectModel): ObjectModelRelation[] {\n return objectModel.allAccountRelations();\n }\n\n isDisabled(item: ItemTypes, context: Partial> = {}): boolean {\n if (this.allowedGenericTypes) {\n if (!(item instanceof ObjectModelRelation)) {\n\n if (!CheckCompatibleGenericTypes(this.allowedGenericTypes, item.genericType)) {\n return true\n }\n }\n }\n\n if (item instanceof ObjectModelRelation && !item.isAccountRelationship) {\n return false // always enable so nested items can be seen\n }\n\n if (BooleanHelper.isStrictBoolean(this.destinationIsCollection)) {\n if (!this.itemListTypeMatches(item, context)) return true;\n }\n\n if (this.restrictToTopLevelCollections) {\n if (!this.isTopLevelCollection(item, context)) return true\n }\n\n if (this.restrictToRootModel) {\n if (!(item instanceof ObjectModel)) return true\n }\n\n return false\n }\n\n protected itemIsCollection(item: ItemTypes, context: Partial> = {}): boolean {\n if (!this.variable.is_single) return true;\n\n if (item instanceof ObjectModel) {\n return this.objectModelIsCollection(item, context);\n } else if (item instanceof ObjectModelProperty) {\n return this.propertyIsCollection(item, context);\n } else if (item instanceof ObjectModelRelation) {\n return item.relatesToManyFrom(context.inverse)\n }\n }\n\n protected objectModelIsCollection(item: ObjectModel, context: Partial> = {}): boolean {\n if (context.parent instanceof ObjectModelRelation) {\n return context.isTopLevelCollectionAssigned || context.parent.relatesToMany;\n } else if (this.variable.reference_id === item.id) {\n return !this.variable.is_single;\n }\n Logger.errorOnce('ProcessFlowObjectModelDynamicFieldsHandler#objectModelIsCollection', 'Expected either argument {parent: ObjectModelRelation} to exist or for argument item: Object Model to match variable reference id.');\n }\n\n protected propertyIsCollection(item: ObjectModelProperty, context: Partial> = {}): boolean {\n return context.isTopLevelCollectionAssigned || item.isDataCollection;\n }\n\n private itemListTypeMatches(item: ItemTypes, context: Partial> = {}) {\n if (item instanceof ObjectModel) {\n return true\n } else {\n return this.destinationIsCollection === this.itemIsCollection(item, context)\n }\n }\n\n isTopLevelCollection(item: ItemTypes, context: Partial> = {}): boolean {\n // If top level is already assigned, exit early\n if (context.isTopLevelCollectionAssigned) return false\n\n if (item instanceof ObjectModel) {\n // variable is collection, then the object model is top-level collection\n if (!this.variable.is_single && this.variable.reference_id === item.id) return true\n // If nested under \"Has Many\" && variable is single, then object model is top-level collection\n if (this.variable.is_single && this.itemIsCollection(context.parent, context)) return true\n } else if (item instanceof ObjectModelProperty) {\n // Single -> Never a collection: the object model must be the collection chosen\n // If its object model is not a collection, then the list property is top-level collection\n return this.itemIsCollection(item, context);\n } else if (item instanceof ObjectModelRelation) {\n // Relations themselves are not selectable as top-level collection but are used in making object model decisions\n return false\n } else {\n return false\n }\n return false\n }\n}","import DynamicFieldsElementOptions from \"./dynamicFieldsElementOptions\";\nimport {IDynamicFieldsElementOptions} from \"~/interfaces/dynamicFieldsElementOptionsInterfaces\";\nimport {IProcessFlow, IProcessFlowVariable} from \"~/interfaces/processFlowInterfaces\";\nimport {ModelType} from \"~/enums/modelType\";\n\ninterface IProcessFlowVariableOptions extends IDynamicFieldsElementOptions {\n}\n\nexport default class ProcessFlowVariableOptions extends DynamicFieldsElementOptions implements IProcessFlowVariableOptions {\n getElements: (elementContainer: IProcessFlow) => IProcessFlowVariable[];\n matcher: (element: IProcessFlowVariable) => boolean;\n\n constructor(config: Partial = {getElements: null, matcher: null}) {\n super(config);\n }\n\n getElementsDefault(container: IProcessFlow): IProcessFlowVariable[] {\n return [\n ...container.defaultVariablesArray,\n ...container.variablesArray.filter(v => !v.referenceRequired),\n ];\n };\n\n matcherDefault(element: IProcessFlowVariable): boolean {\n return true;\n };\n\n matchElements(container: IProcessFlow, q: string): IProcessFlowVariable[] {\n return this.getElements(container);\n }\n}","import DynamicFieldsHandler from \"../dynamicFieldsHandler\";\nimport ProcessFlowVariableOptions from \"~/models/dynamicFields/options/processFlowVariableOptions\";\nimport {IProcessFlow, IProcessFlowVariable, IProcessFlowVariableOptions} from \"~/interfaces/processFlowInterfaces\"\nimport {DynamicReferenceType} from \"~/enums/dynamicReferenceType\";\nimport {IDynamicDataConfig} from \"~/interfaces/dynamicFieldsInterfaces\";\nimport {ReferencePathNode} from \"~/models/referencePaths/referencePathNode\";\nimport {ReferenceNodeType} from \"~/enums/referenceNodeType\";\nimport {assignProcessFlowDynamicFieldsCommonOptions} from '~/models/dynamicFields/helpers'\nimport {DeterministicDynamicComponentType, IDeterministicDynamicFieldsHandler, IProcessFlowCommonHandlerConfig} from '~/interfaces/dynamicFieldsElementOptionsInterfaces'\nimport { CheckCompatibleGenericTypes } from '~/helpers/processFlowHelper'\nimport {BooleanHelper} from '~/helpers/booleanHelper'\nimport ProcessFlowDynamicFieldHandlerSelectMixin from '~/models/dynamicFields/handlers/mixins/processFlowDynamicFieldHandlerSelectMixin'\nimport { GenericType } from '~/interfaces/genericTypeInterfaces'\n\ntype ItemTypes = IProcessFlowVariable\n\nexport default class ProcessFlowVariablesHandler extends DynamicFieldsHandler implements IDeterministicDynamicFieldsHandler, IProcessFlowCommonHandlerConfig {\n SECTIONS = ['variables'];\n COMPONENTS: Array = ['process-flow-variables']\n variable: null // there is not an individual variable for this handler since it handles all of them\n dynamicMessage: string;\n showDynamicMessage: boolean;\n elementOptions: ProcessFlowVariableOptions = new ProcessFlowVariableOptions();\n processFlow: IProcessFlow;\n destinationIsCollection: boolean | null = null;\n restrictToTopLevelCollections: boolean | null = null\n restrictToRootModel: boolean | null = null\n allowedGenericTypes?: GenericType[] = null\n\n constructor(options: IProcessFlowVariableOptions & IProcessFlowCommonHandlerConfig) {\n super(options);\n this.processFlow = options.processFlow;\n if (options.elementOptions?.getElements) this.elementOptions.getElements = options.elementOptions.getElements;\n assignProcessFlowDynamicFieldsCommonOptions(this, options)\n }\n\n getElements() {\n return this.elementOptions.getElements(this.processFlow);\n }\n\n selectVariable(variable: ItemTypes): IDynamicDataConfig {\n const config: Omit = {\n type: DynamicReferenceType.ProcessFlowVariable,\n label: variable.name,\n path: [new ReferencePathNode(null, {reference_type: ReferenceNodeType.ProcessFlowVariable, reference_id: variable.id})],\n };\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(variable, config);\n }\n\n isDisabled(item: ItemTypes): boolean {\n if (this.allowedGenericTypes) {\n if (!CheckCompatibleGenericTypes(this.allowedGenericTypes, item.genericType)) {\n return true\n }\n }\n\n if (BooleanHelper.isStrictBoolean(this.destinationIsCollection)) {\n if (!this.itemListTypeMatches(item)) return true\n }\n\n if (this.restrictToTopLevelCollections) {\n if (!this.isTopLevelCollection(item)) return true\n }\n\n if (this.restrictToRootModel) return true;\n\n return false\n }\n\n private itemListTypeMatches(item: ItemTypes) {\n return this.destinationIsCollection === !item.is_single\n }\n\n isTopLevelCollection(item: ItemTypes): boolean {\n return !item.is_single\n }\n}","import { escape } from \"lodash\"\nimport { DynamicReferenceType } from \"~/enums/dynamicReferenceType\"\nimport { ModelType } from '~/enums/modelType'\nimport { ReferenceNodeType } from \"~/enums/referenceNodeType\"\nimport { BooleanHelper } from '~/helpers/booleanHelper'\nimport { DeterministicDynamicComponentType, IDeterministicDynamicFieldsHandler, IDynamicFieldsElementOptions, IProcessFlowFormElementDynamicFieldsOptions } from \"~/interfaces/dynamicFieldsElementOptionsInterfaces\"\nimport {IDynamicReferencedThing, IDynamicTreeContext, IFormElementDynamicFieldSection} from \"~/interfaces/dynamicFieldsInterfaces\"\nimport IFormElementOptions from '~/interfaces/formElementOptionsInterfaces'\nimport { Hash } from \"~/interfaces/hashInterfaces\"\nimport { IProcessFlowVariable } from '~/interfaces/processFlowInterfaces'\nimport DynamicFieldsHandler from '~/models/dynamicFields/handlers/dynamicFieldsHandler'\nimport { assignProcessFlowDynamicFieldsCommonOptions } from '~/models/dynamicFields/helpers'\nimport FormElementOptions from '~/models/dynamicFields/options/formElementOptions'\nimport { ReferencePathNode } from \"~/models/referencePaths/referencePathNode\"\nimport { Logger } from '~/services/logger'\nimport { IForm } from \"../../../../../formability/form_builder/models/form\"\nimport ElementContainer from \"../../../../../formability/form_builder/models/formElements/elementContainer\"\nimport FormElement, { IFormElement } from \"../../../../../formability/form_builder/models/formElements/formElement\"\nimport { Capability } from \"../../../../../formability/form_builder/models/formElements/formElementCapability\"\nimport WorkflowStep, { IWorkflowStep } from \"../../../../../formability/form_builder/models/workflow/workflowStep\"\nimport ProcessFlowDynamicFieldHandlerSelectMixin from '~/models/dynamicFields/handlers/mixins/processFlowDynamicFieldHandlerSelectMixin'\n\ntype ItemTypes = IFormElement\n\n/**\n * Handler used when form element is the \"main\" focus - meaning it can be slightly out of context from the form itself\n * Only element container elements should be allowed as the focus of this handler\n * @see {FormElementCapabilityManager.CONTAINER_CONTROLS}\n * @example Is this element a repeatable/collection?\n * This would typically depend on if the element is repeatable or is contained in a repeatable but in this context\n * since this form element is the \"top\" level node right under the process flow variable,\n * this determination is done by knowing if the variable itself is single or collection\n */\nexport class ProcessFlowFormElementDynamicFieldsHandler extends DynamicFieldsHandler implements IDeterministicDynamicFieldsHandler, IProcessFlowFormElementDynamicFieldsOptions {\n COMPONENTS: Array = ['process-flow-form-element-dynamic-fields']\n variable: IProcessFlowVariable\n // null means the destination is not important and so don't do operations in here based on this flag\n destinationIsCollection: boolean | null = null\n formElement: IFormElement\n restrictToTopLevelCollections: boolean | null = null\n elementOptions: IDynamicFieldsElementOptions = new FormElementOptions()\n rootHeader: string\n allowElementContainerSelection: boolean = true\n restrictToRootModel: boolean | null = null\n usersOnly: boolean = false\n\n constructor(options: IProcessFlowFormElementDynamicFieldsOptions) {\n super(options)\n this.formElement = options.formElement\n this.elementOptions.getElements = this.getElements\n assignProcessFlowDynamicFieldsCommonOptions(this, options)\n }\n\n get rootHeaderOrDefault(): string {\n return this.rootHeader || this.variable.name\n }\n\n get form(): IForm {\n return this.formElement.form\n }\n\n formElementSections(q: string): Array> {\n const filters: ((e: FormElement) => boolean)[] = [\n (element) => this.elementOptions.matcher(element),\n (element) => element.referenceNameOrDefault.toLowerCase().match(q) !== null,\n ]\n\n const matcher: IFormElementOptions['matcher'] = (element) => {\n return filters.every(filter => filter(element))\n }\n\n let elements = this.elementOptions.getElements(this.formElement).filter(matcher)\n return [this.buildFormElementSection(elements, this.formElement.workflowStep)]\n }\n\n hasFormElementMatch(q: string): boolean {\n return this.formElementSections(q).some(section => section.formElements.length > 0)\n }\n\n protected selectFormElement(element: IFormElement, workflowStep: WorkflowStep, index?: number): IDynamicReferencedThing {\n const config: Omit = {\n type: DynamicReferenceType.FormElement,\n label: escape(element.referenceNameOrDefault),\n wsTitle: escape(workflowStep.titleOrDefault),\n pillColor: this.pillColor,\n path: [\n new ReferencePathNode(null, {\n reference_type: ReferenceNodeType.ProcessFlowVariable,\n reference_id: this.variable.id,\n }),\n new ReferencePathNode(null, { reference_type: ReferenceNodeType.Form, reference_id: this.form.id }),\n new ReferencePathNode(null, { reference_type: ReferenceNodeType.WorkflowStep, reference_id: element.workflowStep.id }),\n new ReferencePathNode(null, { reference_type: ReferenceNodeType.FormElement, reference_id: element.id }),\n ],\n }\n\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(element, config)\n }\n\n isDisabled(item: ItemTypes, context: Partial> = {}): boolean {\n if (BooleanHelper.isStrictBoolean(this.destinationIsCollection)) {\n if (!this.itemListTypeMatches(item)) return true\n }\n if (this.restrictToTopLevelCollections) {\n if (!this.isTopLevelCollection(item, context)) return true\n }\n if (this.restrictToRootModel) return true;\n return false\n }\n\n protected getElements(elementContainer: ElementContainer, options: Hash = {}): FormElement[] {\n return elementContainer.formElementsArray.filter(element => element.can(Capability.referenceable) || element.can(Capability.layoutContainer) || element.can(Capability.signature))\n }\n\n protected itemIsCollection(item: ItemTypes): boolean {\n if (item instanceof FormElement) {\n return this.formElementIsCollection(item)\n }\n }\n\n /**\n * If the form element is the one of focus (the primary root node), then collection is determined by the process flow variable\n * If not, then collection is determined by:\n * 1. If the element itself is repeatable\n * 2. If the element is contained in more\n * @param item\n * @protected\n */\n protected formElementIsCollection(item: IFormElement): boolean {\n if (item === this.formElement) {\n return !this.variable.is_single\n } else {\n /**\n * isDataCollection isn't strictly correct because this is not checking if there is a repeatable\n * between the this.formElement and item which would inherently make item a collection\n * but this is only used for isTopLevelCollection which should short-circuit for any doubly-nested repeatable element\n */\n return item.isDataCollection || this.formElementIsCollection(this.formElement)\n }\n }\n\n private itemListTypeMatches(item: ItemTypes): boolean {\n return this.destinationIsCollection === this.itemIsCollection(item)\n }\n\n isTopLevelCollection(item: ItemTypes, context: Partial> = {}): boolean {\n Logger.debug('DynamicHandler#isTopLevelCollection', 'ProcessFlowFormElementDynamicFieldsHandler', 'item:', item.referenceNameOrDefault, 'context:', context)\n // If top level is already assigned, exit early\n if (context.isTopLevelCollectionAssigned) return false\n\n return this.itemIsCollection(item)\n }\n\n protected buildFormElementSection(elements: FormElement[], workflowStep: WorkflowStep): IFormElementDynamicFieldSection {\n return {\n formElement: this.formElement,\n workflowStep: workflowStep,\n formElements: elements,\n dateOptions: [],\n isOpen: elements.length > 0,\n select: this.selectFormElement.bind(this),\n }\n }\n}","import DynamicFieldsHandler from \"../dynamicFieldsHandler\";\nimport {\n IDynamicDataConfig,\n IDynamicInputsConfig,\n IDynamicTreeContext,\n} from '~/interfaces/dynamicFieldsInterfaces'\nimport {DynamicReferenceType} from \"~/enums/dynamicReferenceType\";\nimport {ReferencePathNode} from \"~/models/referencePaths/referencePathNode\";\nimport {\n DeterministicDynamicComponentType,\n IDynamicInputHandlerConfig,\n IDeterministicDynamicFieldsHandler,\n} from \"~/interfaces/dynamicFieldsElementOptionsInterfaces\"\nimport {IProcessFlowVariable} from '~/interfaces/processFlowInterfaces'\nimport ProcessFlowDynamicFieldHandlerSelectMixin from '~/models/dynamicFields/handlers/mixins/processFlowDynamicFieldHandlerSelectMixin'\nimport EndPoint from \"../../../../../formability/organization_settings/models/connections/endPoint\";\nimport DynamicInput from \"~/models/dynamicInput\";\nimport {\n CertificateDynamicInputType\n} from '../../../../../formability/certificateBuilder/enums/certificateDynamicInputType'\nimport { ReferenceNodeType } from \"~/enums/referenceNodeType\";\nimport CertificateDynamicInput from \"../../../../../formability/certificateBuilder/models/certificateDynamicInput\";\n\ntype ItemTypes = DynamicInput | CertificateDynamicInput\n\nexport default class ProcessFlowDynamicInputFieldsHandler extends DynamicFieldsHandler implements IDeterministicDynamicFieldsHandler, IDynamicInputHandlerConfig {\n COMPONENTS: Array = ['sub-object-fields'];\n variable: IProcessFlowVariable\n rootHeader: string;\n dynamicInput: ItemTypes;\n destinationIsCollection: boolean | null = null;\n restrictToTopLevelCollections: boolean | null = null\n restrictToRootModel: boolean | null = null\n allowDynamicInputSelection: boolean = true;\n\n constructor(options: IDynamicInputHandlerConfig) {\n super(options);\n this.variable = options.variable;\n this.dynamicInput = options.variable.dynamicInputFromVariable;\n }\n\n get rootHeaderOrDefault(): string {\n return this.variable.name\n }\n\n dynamicInputsSection(q: string, input: ItemTypes = this.dynamicInput): Pick {\n const section: Pick = {\n properties: [],\n objects: [],\n select: this.selectDynamicInput.bind(this),\n };\n\n input.certificateDynamicInputs.forEach((di) => {\n if (di.name.toLowerCase().match(q) === null) return\n\n if (di.type === CertificateDynamicInputType.Object) {\n section.objects.push(di)\n } else {\n section.properties.push(di)\n }\n })\n\n return section;\n }\n\n get basePath(): ReferencePathNode[] {\n return [\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.ProcessFlowVariable, reference_id: this.variable.id}),\n ...this.variable.reference_path.nodes\n ]\n }\n\n private selectDynamicInput(dynamicInput: ItemTypes, path: ReferencePathNode[]): IDynamicDataConfig {\n const config: Omit = {\n type: DynamicReferenceType.DynamicInput,\n pillColor: this.pillColor,\n path: path,\n label: dynamicInput.name,\n };\n\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(dynamicInput, config);\n }\n\n isDisabled(item: ItemTypes, context: Partial> = {}): boolean {\n if (item.type === CertificateDynamicInputType.Static && !this.staticVariableAllowed) return true\n\n if (this.restrictToRootModel) {\n if (!(item instanceof EndPoint)) return true\n }\n\n return false\n }\n\n get staticVariableAllowed(): boolean {\n return false\n }\n\n protected itemIsCollection(item: ItemTypes): boolean {\n return item === this.dynamicInput ? !this.variable.is_single : item.isDataCollection;\n }\n\n isTopLevelCollection(item: ItemTypes, context: Partial> = {}): boolean {\n // If top level is already assigned, exit early\n if (context.isTopLevelCollectionAssigned) return false\n\n return this.itemIsCollection(item);\n }\n\n hasMatch(q: string): boolean {\n return this.dynamicInputsSection(q).properties.length > 0;\n }\n}","import CertificateDynamicInput from \"../../../../../formability/certificateBuilder/models/certificateDynamicInput\";\nimport DynamicFieldsHandler from \"~/models/dynamicFields/handlers/dynamicFieldsHandler\";\nimport {DeterministicDynamicComponentType, IDeterministicDynamicFieldsHandler, ICertificateDynamicInputsHandlerOptions} from \"~/interfaces/dynamicFieldsElementOptionsInterfaces\";\nimport {IDynamicDataConfig, IDynamicInputsConfig, IDynamicTreeContext} from \"~/interfaces/dynamicFieldsInterfaces\";\nimport {IProcessFlowVariable} from \"~/interfaces/processFlowInterfaces\";\nimport {TCertificate} from \"../../../../../formability/certificateBuilder/models/certificate\";\nimport {ReferencePathNode} from \"~/models/referencePaths/referencePathNode\";\nimport {DynamicReferenceType} from \"~/enums/dynamicReferenceType\";\nimport ProcessFlowDynamicFieldHandlerSelectMixin from \"~/models/dynamicFields/handlers/mixins/processFlowDynamicFieldHandlerSelectMixin\";\nimport {ReferenceNodeType} from \"~/enums/referenceNodeType\";\nimport {CertificateDynamicInputType} from \"../../../../../formability/certificateBuilder/enums/certificateDynamicInputType\";\n\ntype ItemTypes = CertificateDynamicInput\n\n// NOTE: This handler's scope is all of a Certificate's inputs as a whole, not any individual input.\nexport default class ProcessFlowCertificateDynamicInputsHandler extends DynamicFieldsHandler implements IDeterministicDynamicFieldsHandler {\n COMPONENTS: Array = ['certificate-dynamic-inputs'];\n variable: IProcessFlowVariable;\n certificate: TCertificate;\n rootHeader: string;\n\n constructor(options: ICertificateDynamicInputsHandlerOptions) {\n super(options);\n this.variable = options.variable;\n this.certificate = options.certificate;\n this.rootHeader = options.rootHeader;\n }\n\n dynamicInputsSection(q: string, parent: TCertificate | CertificateDynamicInput): Pick {\n const properties = [];\n const objects = [];\n parent.certificateDynamicInputs.forEach(input =>{\n if (input.type === CertificateDynamicInputType.Object) {\n objects.push(input);\n } else {\n properties.push(input);\n }\n });\n\n return {\n properties,\n objects,\n select: this.selectDynamicInput.bind(this),\n };\n }\n\n private selectDynamicInput(input: CertificateDynamicInput, path: ReferencePathNode[]): IDynamicDataConfig {\n const config: Omit = {\n type: DynamicReferenceType.DynamicInput,\n path: [\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.ProcessFlowVariable, reference_id: this.variable.id}),\n new ReferencePathNode(null, {reference_type: ReferenceNodeType.Certificate, reference_id: this.certificate.id}),\n ...path\n ],\n label: input.name,\n };\n\n return new ProcessFlowDynamicFieldHandlerSelectMixin(this).select(input, config);\n }\n\n isDisabled(item: ItemTypes, context: Partial> = {}): boolean {\n return false;\n }\n\n itemIsCollection(item: ItemTypes): boolean {\n return item.isList;\n }\n\n isTopLevelCollection(item: ItemTypes, context: Partial>): boolean {\n // If top level is already assigned, exit early\n if (context.isTopLevelCollectionAssigned) return false;\n\n return this.itemIsCollection(item);\n }\n}"],"names":["__vue2_script","Vue","extend","data","_vm","this","_h","$createElement","_c","_self","staticClass","_t","DateDynamicFieldsHandlerMixin","Base","constructor","super","arguments","SECTIONS","dateSections","q","dateOptions","filter","section","label","toLowerCase","match","hasDateMatch","length","selectDate","id","type","modelType","ModelType","DateTime","UserDynamicFieldsHandlerMixin","args","profileConfigs","baseUserDataSections","header","DynamicReferenceType","OriginalSubmitter","fields","Text","User","isOpen","select","selectUserData","StepCompleter","FormMetaData","ObjectModelRecordMetadata","userDataSections","sections","map","field","buildUserDataSection","hasUserProfiles","push","userProfileFields","hasUserDataMatch","some","s","profileConfigSections","profileConfig","profileConfigFields","profile_config_fields","profileConfigField","name","ProfileConfig","bind","CheckCompatibleGenericTypes","allowedGenericTypes","sourceGenericType","_.flatten","t","ModelTypeCompatibilityMap","includes","ProcessFlowFormDynamicFieldsHandler","FormPaymentsDynamicFieldsHandlerMixin","FormElementDynamicFieldsHandler","options","COMPONENTS","destinationIsCollection","allowElementContainerSelection","allowUserSelection","restrictToTopLevelCollections","restrictToRootModel","usersOnly","hideWorkflowStepData","isSingleOnly","form","Array","isArray","userDataHeader","BooleanHelper","isStrictBoolean","elementOptions","getElements","_a","assignProcessFlowDynamicFieldsCommonOptions","formDataSection","title","selectFormData","InitialSubmissionEnd","formSubmissionOptions","SubmissionId","selectSubmissionId","formUserSections","formSubmissionSections","config","Form","escape","path","ReferencePathNode","reference_type","ReferenceNodeType","ProcessFlowVariable","reference_id","variable","ProcessFlowDynamicFieldHandlerSelectMixin","FormSubmissionDate","StepStart","StepEnd","WorkflowStepStart","WorkflowStepEnd","splice","FormSubmissionID","selectPaymentData","paymentData","workflowStep","WorkflowStep","paymentReferenceNodeType","selectFormElement","element","index","FormElement","referenceNameOrDefault","wsTitle","titleOrDefault","pillColor","isDisabled","item","context","is_repeatable","genericType","itemListTypeMatches","isTopLevelCollection","elementContainer","formElementsArray","can","Capability","referenceable","layoutContainer","signature","itemIsCollection","formIsCollection","formElementIsCollection","dynamicItemIsCollection","is_single","isDataCollection","isInRepeatable","PaymentsTotalCost","FormPaymentsTotalCost","PaymentsType","FormPaymentsType","PaymentsDate","FormPaymentsDate","PaymentsLineItem","FormPaymentsLineItem","isTopLevelCollectionAssigned","formUserSection","isCollection","selectUser","AllCompleters","Error","formWorkflowStepUserSection","form_section","formElementsArrayDeep","forEach","fe","elementType","FormElementType","textField","format_type","InputFormatType","Email","label_title","ProcessFlowObjectModelDynamicFieldsHandler","DynamicFieldsHandler","allowObjectModelSelection","allowLinkSubmissions","allowAccountRelationSelection","traverseRelatedObjectModels","ObjectModelPropertyOptions","hideRecordHolderData","accountRelationMetadataShowEntity","mode","objectModel","rootHeader","objectModelDataSection","selectObjectModelData","linkedFormsSection","selectLinkedFormData","object_model_linked_forms","reduce","formData","qMatches","objectModelPropertiesSection","properties","selectObjectModelProperty","prop","labelTitleDisplay","objectModelPropertySections","EnumHelper","toArray","ObjectModelPropertyRootType","buildObjectModelPropertySection","matchElements","property","find","propertyType","property_type","hasObjectModelPropertyMatch","hasObjectModelPropertySortedMatch","ObjectModel","partialPath","ObjectModelLinkedForm","RecordHolder","ObjectModelProperty","rootId","propertyTypeName","ObjectModelPropertyDefinition","getDisplayName","objectModelRelations","ObjectHelper","object_model_relations","relation","isAccountRelationship","friendlyDescription","inverseObjectModelRelations","inverse_object_model_relations","all","hasObjectModelRelationshipMatch","hasRelatedObjectModelMatch","related_object_models","om","hasObjectModelDataMatch","selectAccountRelation","ObjectModelRelation","objectModelAccountRelations","allAccountRelations","objectModelIsCollection","propertyIsCollection","relatesToManyFrom","inverse","parent","relatesToMany","Logger","errorOnce","ProcessFlowVariableOptions","DynamicFieldsElementOptions","matcher","getElementsDefault","container","defaultVariablesArray","variablesArray","v","referenceRequired","matcherDefault","ProcessFlowVariablesHandler","processFlow","selectVariable","ProcessFlowFormElementDynamicFieldsHandler","FormElementOptions","formElement","rootHeaderOrDefault","formElementSections","filters","elements","every","buildFormElementSection","hasFormElementMatch","formElements","debug","ProcessFlowDynamicInputFieldsHandler","allowDynamicInputSelection","dynamicInput","dynamicInputFromVariable","dynamicInputsSection","input","objects","selectDynamicInput","certificateDynamicInputs","di","CertificateDynamicInputType","Object","basePath","reference_path","nodes","DynamicInput","Static","staticVariableAllowed","EndPoint","hasMatch","ProcessFlowCertificateDynamicInputsHandler","certificate","Certificate","isList"],"mappings":"iXAWA,MAAAA,EAAAC,EAAAC,OAAA,CACAC,KAAA,WACA,MAAA,EACA,0BCda,WACX,IAAIC,EAAIC,KACJC,EAAGF,EAAIG,eACPC,EAAGJ,EAAIK,MAAMD,IAAIF,EAErB,OAAOE,EAAG,MAAO,CACfE,YAAa,+BACZ,CAACF,EAAG,MAAO,CAACJ,EAAIO,GAAG,YAAa,IAAK,EAC1C,GACsB,yGCLtB,SAAwBC,EAAyDC,GACxE,OAAA,cAAuCA,EAAvCC,cAAAC,SAAAC,WACLX,KAAAY,SAAW,CAAC,QAAO,CAKnBC,aAAaC,GACJ,OAAAd,KAAKe,YAAYC,QAAkBC,GAAyC,OAAzCA,EAAQC,MAAMC,cAAcC,MAAMN,IAC9E,CAEAO,aAAaP,GACX,OAAOd,KAAKa,aAAaC,GAAGQ,OAAS,CACvC,CAEAC,WAAWN,GACF,MAAA,CACLO,GAAIP,EAAQO,GACZN,MAAOD,EAAQC,MACfO,KAAMR,EAAQQ,KACdC,UAAWC,EAAUC,SAEzB,EAEJ,CClBA,SAAwBC,EAAyDrB,GACxE,OAAA,cAAuCA,EAM5CC,eAAeqB,GACbpB,SAASoB,GANX9B,KAAAY,SAAW,CAAC,YAOLZ,KAAA+B,eAAkBD,EAAK,IAAMA,EAAK,GAAGC,gBAAmB,EAC/D,CAEIC,2BACK,MAAA,CACL,CACEC,OAAQ,qBACRR,KAAMS,EAAqBC,kBAC3BC,OAAQ,CACN,CAACV,UAAWC,EAAUU,KAAMb,GAAI,aAAcN,MAAO,cACrD,CAACQ,UAAWC,EAAUU,KAAMb,GAAI,YAAaN,MAAO,aACpD,CAACQ,UAAWC,EAAUW,KAAMd,GAAI,QAASN,MAAO,UAElDqB,QAAQ,EACRC,OAAQxC,KAAKyC,gBAEf,CACER,OAAQ,wBACRR,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