/*-
 * ~~~~~~licensing~~~~~~
 * atlasmap-entaxy-ui
 * ==========
 * Copyright (C) 2020 - 2024 EmDev LLC
 * ==========
 * You may not use this file except in accordance with the License Terms of the Copyright
 * Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
 * rights to the Software and any copies are the property of the Copyright Holder. Unless
 * it is explicitly allowed the Copyright Holder, the User is prohibited from using the
 * Software for commercial purposes to provide services to third parties.
 * 
 * The Copyright Holder hereby declares that the Software is provided on an "AS IS".
 * Under no circumstances does the Copyright Holder guarantee or promise that the
 * Software provided by him will be suitable or not suitable for the specific purposes
 * of the User, that the Software will meet all commercial and personal subjective
 * expectations of the User, that the Software will work properly, without technical
 * errors, quickly and uninterruptedly.
 * 
 * Under no circumstances shall the Copyright Holder or its Affiliates is not liable
 * to the User for any direct or indirect losses of the User, his expenses or actual
 * damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
 * or damage to data, property, etc.
 * ~~~~~~/licensing~~~~~~
 */
(this["webpackJsonp@atlasmap/standalone"]=this["webpackJsonp@atlasmap/standalone"]||[]).push([[0],{359:function(e,t,n){e.exports=n(596)},360:function(e,t,n){},361:function(e,t,n){"use strict";var i=n(38);Object.defineProperty(t,"__esModule",{value:!0});var a,r,o,l,s,c,u,p,d=n(362),f=n(595),m=n(363),g=(a=n(364))&&"object"==i(a)&&"default"in a?a.default:a,v=n(365),h=n(333);(r=t.DataSourceType||(t.DataSourceType={})).SOURCE="SOURCE",r.TARGET="TARGET",(o=t.CollectionType||(t.CollectionType={})).ALL="ALL",o.ARRAY="ARRAY",o.LIST="LIST",o.MAP="MAP",o.NONE="NONE",(l=t.FieldStatus||(t.FieldStatus={})).SUPPORTED="SUPPORTED",l.UNSUPPORTED="UNSUPPORTED",l.CACHED="CACHED",l.ERROR="ERROR",l.NOT_FOUND="NOT_FOUND",l.EXCLUDED="EXCLUDED",(s=t.FieldType||(t.FieldType={})).ANY="ANY",s.ANY_DATE="ANY_DATE",s.BIG_INTEGER="BIG_INTEGER",s.BOOLEAN="BOOLEAN",s.BYTE="BYTE",s.BYTE_ARRAY="BYTE_ARRAY",s.CHAR="CHAR",s.COMPLEX="COMPLEX",s.DATE="DATE",s.DATE_TIME="DATE_TIME",s.DATE_TIME_TZ="DATE_TIME_TZ",s.DATE_TZ="DATE_TZ",s.DECIMAL="DECIMAL",s.DOUBLE="DOUBLE",s.FLOAT="FLOAT",s.INTEGER="INTEGER",s.LONG="LONG",s.NONE="NONE",s.NUMBER="NUMBER",s.SHORT="SHORT",s.STRING="STRING",s.TIME="TIME",s.TIME_TZ="TIME_TZ",s.UNSIGNED_BYTE="UNSIGNED_BYTE",s.UNSIGNED_INTEGER="UNSIGNED_INTEGER",s.UNSIGNED_LONG="UNSIGNED_LONG",s.UNSIGNED_SHORT="UNSIGNED_SHORT",s.UNSUPPORTED="UNSUPPORTED",(c=t.DocumentType||(t.DocumentType={})).JAVA="JAVA",c.XML="XML",c.XSD="XSD",c.JSON="JSON",c.CORE="Core",c.CSV="CSV",c.CONSTANT="Constants",c.PROPERTY="Property",(u=t.InspectionType||(t.InspectionType={})).JAVA_CLASS="JAVA_CLASS",u.SCHEMA="SCHEMA",u.INSTANCE="INSTANCE",u.UNKNOWN="UNKNOWN",(p=t.DocumentDefaultName||(t.DocumentDefaultName={})).CONSTANTS="Constants",p.PROPERTIES="Properties";var E,y,b,S,F,T,M=[[t.CollectionType[t.CollectionType.ARRAY],"Array"],[t.CollectionType[t.CollectionType.LIST],"List"],[t.CollectionType[t.CollectionType.MAP],"Map"],[t.CollectionType[t.CollectionType.NONE],"None"]],C=[["STRING","String"],["BOOLEAN","Boolean"],["BIG_INTEGER","Big Integer"],["BYTE","Byte"],["BYTE_ARRAY","ByteArray"],["CHAR","Char"],["COMPLEX","Complex"],["DECIMAL","Decimal"],["DOUBLE","Double"],["FLOAT","Float"],["INTEGER","Integer"],["LONG","Long"],["SHORT","Short"],["TIME","Time"],["DATE","Date"],["DATE_TIME","DateTime"],["DATE_TZ","DateTZ"],["TIME_TZ","TimeTZ"],["DATE_TIME_TZ","DateTimeTZ"],["UNSIGNED_BYTE","Unsigned Byte"],["UNSIGNED_INTEGER","Unsigned Integer"],["UNSIGNED_LONG","Unsigned Long"],["UNSIGNED_SHORT","Unsigned Short"]],O=[["STRING","String"],["ANY","Any"],["BOOLEAN","Boolean"],["BIG_INTEGER","Big Integer"],["BYTE","Byte"],["BYTE_ARRAY","ByteArray"],["CHAR","Char"],["COMPLEX","Complex"],["DECIMAL","Decimal"],["DOUBLE","Double"],["FLOAT","Float"],["INTEGER","Integer"],["LONG","Long"],["SHORT","Short"],["TIME","Time"],["DATE","Date"],["DATE_TIME","DateTime"],["DATE_TZ","DateTZ"],["TIME_TZ","TimeTZ"],["DATE_TIME_TZ","DateTimeTZ"],["UNSIGNED_BYTE","Unsigned Byte"],["UNSIGNED_INTEGER","Unsigned Integer"],["UNSIGNED_LONG","Unsigned Long"],["UNSIGNED_SHORT","Unsigned Short"]];function A(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function D(e,t,n){return t&&A(e.prototype,t),n&&A(e,n),e}function N(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function x(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return I(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(E=t.Modifier||(t.Modifier={})).ALL="ALL",E.ABSTRACT="ABSTRACT",E.FINAL="FINAL",E.INTERFACE="INTERFACE",E.NATIVE="NATIVE",E.PACKAGE_PRIVATE="Package Private",E.PUBLIC="PUBLIC",E.PROTECTED="PROTECTED",E.PRIVATE="PRIVATE",E.STATIC="STATIC",E.STRICT="STRICT",E.SYNCHRONIZED="SYNCHRONIZED",E.TRANSIENT="TRANSIENT",E.VOLATILE="VOLATILE",E.NONE="NONE",(y=t.Multiplicity||(t.Multiplicity={})).ONE_TO_ONE="ONE_TO_ONE",y.ONE_TO_MANY="ONE_TO_MANY",y.MANY_TO_ONE="MANY_TO_ONE",y.ZERO_TO_ONE="ZERO_TO_ONE",y.MANY_TO_MANY="MANY_TO_MANY",(b=t.MappingType||(t.MappingType={})).ALL="ALL",b.COLLECTION="COLLECTION",b.COMBINE="COMBINE",b.LOOKUP="LOOKUP",b.MAP="MAP",b.SEPARATE="SEPARATE",b.NONE="NONE",(S=t.ValidationScope||(t.ValidationScope={})).DATA_SOURCE="DATA_SOURCE",S.MAPPING="MAPPING",S.LOOKUP_TABLE="LOOKUP_TABLE",S.CONSTANT="CONSTANT",S.PROPERTY="PROPERTY",(F=t.ValidationStatus||(t.ValidationStatus={})).INFO="INFO",F.WARN="WARN",F.ERROR="ERROR",(T=t.AuditStatus||(t.AuditStatus={})).INFO="INFO",T.WARN="WARN",T.ERROR="ERROR";var P=function(){function e(){}return e.removeItemFromArray=function(e,t){if(null==e||null==t||0===t.length)return!1;for(var n=0,i=!1;n<t.length;)t[n]===e?(t.splice(n,1),i=!0):n++;return i},e.splitByString=function(e,t){var n=0,i=0,a=null,r=t.length,o=[];if(null===e||0===e.length||null===t||0===r)return[];for(;-1!==n;)n=e.indexOf(t),i=e.indexOf(t,n+1),a=e.substring(n,i),o.push(a),e=e.substring(i+r);return o},e.str2bytes=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},e.readFile=function(e,t){try{return Promise.resolve(new Promise((function(n){t.onload=function(){n(t.result)},t.readAsText(e)})))}catch(e){return Promise.reject(e)}},e.readBinaryFile=function(e,t){try{return Promise.resolve(new Promise((function(n){t.onload=function(){var e=new Int8Array(t.result);n(e)},t.readAsArrayBuffer(e)})))}catch(e){return Promise.reject(e)}},e.writeFile=function(e,t){try{return Promise.resolve(new Promise((function(n){d.saveAs(e,t),n(!0)})))}catch(e){return Promise.reject(e)}},e.toDisplayable=function(e){if(void 0===e||!e||e.indexOf(" ")>=0)return e;for(var t=e.charAt(0).toUpperCase(),n=1;n<e.length;n++){var i=e.charAt(n);i!==i.toLowerCase()&&(t+=" "),t+=i}return t},e.extractDisplayPath=function(e,t){var n=t-4;if(!e||n<=0)return"";if(e.length<=n)return e;var i=e.split("/"),a="/"+i[i.length-1];return a.length>=n?a.substr(0,n):e.substr(0,n-a.length)+"..."+a},e.sanitizeJSON=function(e){return JSON.stringify(e).replace(/[\u007F-\uFFFF]/g,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).substr(-4)}))},e.objectize=function(e){return"string"==typeof e?JSON.parse(e):e},e.urlWithParameters=function(e,t){var n=new URL(e),i=[];return n.searchParams.forEach((function(e,t){return i.push(t)})),i.forEach((function(e){return n.searchParams.delete(e)})),new URLSearchParams(t).forEach((function(e,t){return n.searchParams.append(t,e)})),n.toString()},e}(),w=function(){},R=function(){function e(){this.documentField={jsonType:""},this.partOfMapping=!1,this.partOfTransformation=!1,this.visibleInCurrentDocumentSearch=!0,this.enumeration=!1,this.enumValues=[],this.children=[],this.fieldDepth=0,this.collapsed=!0,this.hasUnmappedChildren=!1,this.isCollection=!1,this.isArray=!1,this.isAttribute=!1,this.isPrimitive=!1,this.userCreated=!1,this.uuid=e.uuidCounter.toString(),e.uuidCounter++}e.fieldHasUnmappedChild=function(t){if(null==t)return!1;if(t.isTerminal())return!1===t.partOfMapping;for(var n,i=x(t.children);!(n=i()).done;){var a=n.value;if(a.hasUnmappedChildren||e.fieldHasUnmappedChild(a))return!0}return!1},e.getFieldPaths=function(e){for(var t,n=[],i=x(e);!(t=i()).done;)n.push(t.value.path);return n},e.getFieldNames=function(e){for(var t,n=[],i=x(e);!(t=i()).done;)n.push(t.value.name);return n},e.getField=function(e,t){return t.find((function(t){return e===t.path}))},e.alphabetizeFields=function(e){for(var t,n={},i=[],a=x(e);!(t=a()).done;){var r=t.value,o=r.path;null==n[o]&&(n[o]=r,i.push(o))}i.sort(),e.length=0;for(var l=0,s=i;l<s.length;l++)e.push(n[s[l]]);for(var c,u=x(e);!(c=u()).done;){var p=c.value;p.children&&p.children.length&&this.alphabetizeFields(p.children)}};var n=e.prototype;return n.expandToRoot=function(){for(var e=this;null!=e;)e.collapsed=!1,e.isPropertyOrConstant()&&e.docDef&&(e.docDef.showFields=!0),e=e.parentField},n.getNameWithNamespace=function(){return this.namespaceAlias?this.namespaceAlias+":"+this.name:this.name},n.isParentField=function(){return!(!this.isCollection||this.isPrimitive)||"COMPLEX"===this.type},n.isStringField=function(){return"STRING"===this.type},n.isTerminal=function(){return!!this.enumeration||!(this.isCollection&&!this.isPrimitive)&&"COMPLEX"!==this.type},n.copy=function(){var t=new e;Object.assign(t,this),t.documentField=this.documentField,t.parentField=this.parentField,t.docDef=this.docDef,t.children=[];for(var n,i=x(this.children);!(n=i()).done;)t.children.push(n.value.copy());return t},n.copyFrom=function(e){Object.assign(this,e),this.documentField=e.documentField,this.parentField=e.parentField,this.docDef=e.docDef,this.children=[];for(var t,n=x(e.children);!(t=n()).done;)this.children.push(t.value.copy())},n.getCollectionParentField=function(){for(var e=this;null!=e;){if(e.isCollection)return e;e=e.parentField}},n.isInCollection=function(){return null!=this.getCollectionParentField()},n.getCollectionCount=function(){for(var e=0,t=this;null!=t;)t.isCollection&&e++,t=t.parentField;return e},n.isSource=function(){return null!=this.docDef&&this.docDef.isSource},n.getCollectionType=function(){return this.isCollection?this.isArray?"ARRAY":"LIST":null},n.getFieldLabel=function(e,t){var n="";if(t)n=this.path;else{var i=this.path.split("/");n=this.isAttribute&&i.length>0&&i[i.length-1].startsWith("@")?this.path.split("@")[1]:this.getNameWithNamespace()}return e&&this.type&&!this.isPropertyOrConstant()?n+=" ("+this.type+")":this.isProperty()&&null!=this.value&&(n+=" = "+this.value,e&&this.type&&(n+=" ("+this.type+")")),n||this.parentField||(n="< Document Root >"),n},n.isPropertyOrConstant=function(){return null!=this.docDef&&this.docDef.isPropertyOrConstant},n.isProperty=function(){return null!=this.docDef&&this.docDef.type===t.DocumentType.PROPERTY},n.isConstant=function(){return null!=this.docDef&&this.docDef.type===t.DocumentType.CONSTANT},e}();R.uuidCounter=0;var _,j,k,L=function(){function e(){this.createdByUser=!1,this.isTarget=!1}e.getUnqualifiedNamespace=function(){if(null==e.unqualifiedNamespace){var t=new e;t.alias="Unqualified",e.unqualifiedNamespace=t}return e.unqualifiedNamespace};var t=e.prototype;return t.getPrettyLabel=function(){return this===e.getUnqualifiedNamespace()?this.alias:(this.isTarget?"Target":this.alias)+" ["+(null==this.uri?"NO URI":this.uri)+"]"},t.copy=function(){var t=new e;return Object.assign(t,this),t},t.copyFrom=function(e){Object.assign(this,e)},e}(),U=function(e){function n(n){var i;return(i=e.call(this)||this)._isSource=n,i.name="<padding field>",i.classIdentifier="<padding field>",i.type=t.FieldType.NONE,i.displayName="<padding field>",i.path="",i}return N(n,e),n.prototype.isSource=function(){return this._isSource},n}(R),V=function(){function e(){this.LEFT_BRACKET="[",this.RIGHT_BRACKET="]",this.initialized=!1,this.errorOccurred=!1,this.fields=[],this.allFields=[],this.terminalFields=[],this.complexFieldsByClassIdentifier={},this.enumFieldsByClassIdentifier={},this.fieldsByPath={},this.fieldPaths=[],this.showFields=!0,this.visibleInCurrentDocumentSearch=!0,this.namespaces=[]}var n=e.prototype;return n.getComplexField=function(e){return this.complexFieldsByClassIdentifier[e]},n.getEnumField=function(e){return this.enumFieldsByClassIdentifier[e]},n.getAllFields=function(){return[].concat(this.allFields)},n.fieldExists=function(e,t){for(var n,i=x(this.getAllFields());!(n=i()).done;){var a=n.value;if(a.name===e.name&&a.docDef.type===t)return!0}return!1},n.isFieldsExist=function(e){if(null==e||0===e.length)return!0;var t=this.getFields(R.getFieldPaths(e));return null!=t&&e.length===t.length},n.getFields=function(e){for(var t,n=[],i=x(e);!(t=i()).done;){var a=this.getField(t.value);null!=a&&n.push(a)}return n},n.getName=function(e){var t=this.name;if(e&&!this.isPropertyOrConstant){var n=this.type;n&&(t+=" ("+n+")")}return t},n.getNamespaceForAlias=function(e){return this.namespaces.find((function(t){return e===t.alias}))},n.getField=function(e){if(!e)return null;var t=this.fieldsByPath[e],n=e;if(null!=n&&0===n.indexOf("/")&&(n=n.substring(1)),null==t&&-1!==n.indexOf("/")){for(var i="";-1!==n.indexOf("/");){var a=n.substr(0,n.indexOf("/")),r=this.fieldsByPath[i+="/"+a];if(null==r){if(-1!==n.indexOf("/")){n=n.substr(n.indexOf("/")+1);continue}break}this.populateChildren(r),-1!==n.indexOf("/")&&(n=n.substr(n.indexOf("/")+1))}t=this.fieldsByPath[e]}return t},n.getComplexFields=function(){return this.discoverAllComplexFields(this.fields)},n.getTerminalFields=function(){return[].concat(this.terminalFields)},n.initializeFromFields=function(){this.type===t.DocumentType.JAVA&&this.prepareComplexFields();for(var e,n=x(this.fields);!(e=n()).done;){var i=e.value;this.populateFieldData(i),this.allFields.push(i),this.populateChildren(i)}this.initialized=!0},n.updateField=function(e,t){null!=t&&t.length>0&&null!=this.fieldsByPath[t]?(delete this.fieldsByPath[t],P.removeItemFromArray(t,this.fieldPaths)):P.removeItemFromArray(e.path,this.fieldPaths),this.populateFieldData(e)},n.addField=function(e){!e.parentField||this.isPropertyOrConstant?this.fields.push(e):(this.populateChildren(e.parentField),e.parentField.children.push(e)),this.populateFieldData(e),this.allFields.push(e)},n.populateChildren=function(e){if(e.isTerminal()||e.children.length>0)return!0;var t=this.getComplexField(e.classIdentifier);if(null==t)return!1;for(var n,i=x((t=t.copy()).children);!(n=i()).done;){var a=n.value;(a=a.copy()).parentField=e,this.rewriteFieldPath(a),this.populateFieldData(a),e.children.push(a)}return e.children.length>0},n.rewriteFieldPath=function(e){var t=e.parentField,n=e.path.split("/");e.path=t.path+"/"+n.slice(-1)[0];for(var i,a=x(e.children);!(i=a()).done;)this.rewriteFieldPath(i.value)},n.clearFields=function(){this.initialized=!1,this.fields=[],this.allFields=[],this.terminalFields=[],this.fieldPaths=[],this.namespaces=[],this.fieldsByPath={},this.complexFieldsByClassIdentifier={},this.enumFieldsByClassIdentifier={}},n.getFieldIndex=function(e,t){for(var n=0;n<t.length;n++)if(t[n].path===e.path)return n;return-1},n.removeField=function(e){if(null!=e){var t=this.getFieldIndex(e,this.fields);t>-1&&this.fields.splice(t,1),(t=this.getFieldIndex(e,this.allFields))>-1&&this.allFields.splice(t,1),(t=this.getFieldIndex(e,this.terminalFields))>-1&&this.terminalFields.splice(t,1);var n=e.path;P.removeItemFromArray(n,this.fieldPaths),delete this.fieldsByPath[n],null!=e.parentField&&P.removeItemFromArray(e,e.parentField.children)}},n.updateFromMappings=function(e){if(null!==e){for(var t,n=x(this.allFields);!(t=n()).done;){var i=t.value;i.partOfMapping=!1,i.hasUnmappedChildren=!1,i.partOfTransformation=!1}for(var a,r=x(e.getAllMappings(!0));!(a=r()).done;)for(var o,l=a.value,s=x(l.getAllFields());!(o=s()).done;)for(var c=o.value,u=c,p=l.getMappedFieldForField(c).actions.length>0;null!=u;)u.partOfMapping=!0,u.partOfTransformation=u.partOfTransformation||p,u=u.parentField;for(var d,f=x(this.allFields);!(d=f()).done;){var m=d.value;m.hasUnmappedChildren=R.fieldHasUnmappedChild(m)}}},n.populateFieldData=function(e){e.docDef=this;var t=e.path;if(this.fieldPaths.push(t),this.fieldsByPath[t]=e,e.enumeration&&(this.enumFieldsByClassIdentifier[e.classIdentifier]=e),e.isTerminal())this.terminalFields.push(e);else for(var n,i=x(e.children);!(n=i()).done;){var a=n.value;this.populateFieldData(a),this.allFields.push(a)}},n.prepareComplexFields=function(){var e=this.fields;for(var t in this.discoverComplexFields(e),this.complexFieldsByClassIdentifier)if(this.complexFieldsByClassIdentifier.hasOwnProperty(t))for(var n,i=x(this.complexFieldsByClassIdentifier[t].children);!(n=i()).done;)n.value.children=[]},n.discoverAllComplexFields=function(e){for(var t,n=[],i=x(e);!(t=i()).done;){var a=t.value;"COMPLEX"!==a.type||"SUPPORTED"!==a.documentField.status&&"CACHED"!==a.documentField.status||n.push(a.copy()),a.children&&(n=n.concat(this.discoverAllComplexFields(a.children)))}return n},n.discoverComplexFields=function(e){for(var t,n=x(e);!(t=n()).done;){var i=t.value;"COMPLEX"===i.type&&("SUPPORTED"===i.documentField.status&&(this.complexFieldsByClassIdentifier[i.classIdentifier]=i.copy()),i.children&&this.discoverComplexFields(i.children))}},D(e,[{key:"type",get:function(){return this._type},set:function(e){this._type=e,this.isPropertyOrConstant=e===t.DocumentType.CONSTANT||e===t.DocumentType.PROPERTY}}]),e}(),z=function(){this.dataMapperVersion="",this.initialized=!1,this.loadingStatus="Loading.",this.admHttpTimeout=3e4,this.initializationErrorOccurred=!1,this.classPathFetchTimeoutInMilliseconds=3e4,this.fieldNameExclusions=[],this.classNameExclusions=[],this.disablePrivateOnlyFields=!1,this.disableProtectedOnlyFields=!1,this.disablePublicOnlyFields=!1,this.disablePublicGetterSetterFields=!1,this.disableMappingPreviewMode=!1,this.disableNavbar=!0,this.mappingInitialized=!1},B=function(){this.showFields=!0},J=function(){function e(){this.initCfg=new z,this.showMappingDetailTray=!1,this.showMappingTable=!1,this.showNamespaceTable=!1,this.showLinesAlways=!0,this.showTypes=!1,this.showMappedFields=!0,this.showUnmappedFields=!0,this._showMappingPreview=!1,this.currentDraggedField=null,this.sourceDocs=[],this.targetDocs=[],this.sourcePropertyDoc=new V,this.targetPropertyDoc=new V,this.constantDoc=new V,this.mappingFiles=[],this.mappingDefinitionId=0,this.mappings=null,this.preloadedMappingJson=null,this.setConstantPropertyDocs()}e.getConfig=function(){return e.cfg},e.setConfig=function(t){e.cfg=t};var n=e.prototype;return n.initializePropertyDoc=function(e,n){e.clearFields(),e.type=t.DocumentType.PROPERTY,e.name=t.DocumentDefaultName.PROPERTIES,e.id="DOC."+e.name+"."+Math.floor(1e6*Math.random()+1).toString(),e.isSource=n,e.showFields=!1,e.isPropertyOrConstant=!0},n.setConstantPropertyDocs=function(){this.initializePropertyDoc(this.sourcePropertyDoc,!0),this.initializePropertyDoc(this.targetPropertyDoc,!1),this.constantDoc.clearFields(),this.constantDoc.type=t.DocumentType.CONSTANT,this.constantDoc.name=t.DocumentDefaultName.CONSTANTS,this.constantDoc.id="DOC."+this.constantDoc.name+"."+Math.floor(1e6*Math.random()+1).toString(),this.constantDoc.isSource=!0,this.constantDoc.showFields=!1,this.constantDoc.isPropertyOrConstant=!0},n.addDocument=function(e){var n=new V;return n.initModel=e,n.id=e.id,n.type=e.type,n.name=e.name,n.description=e.description,n.isSource=e.isSource,n.showFields=e.showFields,n.inspectionType=e.inspectionType,n.inspectionSource=e.inspectionSource,n.inspectionResult=e.inspectionResult,n.inspectionParameters=e.inspectionParameters,n.selectedRoot=e.selectedRoot,n.type===t.DocumentType.XSD?n.uri="atlas:xml:"+n.id:n.type===t.DocumentType.JAVA?(n.uri="atlas:java:"+n.id+"?className="+n.inspectionSource,e.collectionType&&e.collectionType!==t.CollectionType.NONE&&(n.uri+="&collectionType="+e.collectionType,e.collectionClassName&&(n.uri+="&collectionClassName="+e.collectionClassName))):n.uri="atlas:"+n.type.toLowerCase()+":"+n.id,e.isSource?this.sourceDocs.push(n):this.targetDocs.push(n),n},n.addDocuments=function(e){for(var t,n=[],i=x(e);!(t=i()).done;)n.push(this.addDocument(t.value));return n},n.getDocsWithoutPropertyDoc=function(e){return[].concat(e?this.sourceDocs:this.targetDocs)},n.getDocs=function(e){var t=this.getDocsWithoutPropertyDoc(e);return e?[this.sourcePropertyDoc,this.constantDoc].concat(t):[this.targetPropertyDoc].concat(t)},n.clearDocs=function(){this.sourceDocs=[],this.targetDocs=[],this.sourcePropertyDoc.clearFields(),this.targetPropertyDoc.clearFields(),this.constantDoc.clearFields(),this.mappingFiles=[]},n.hasJavaDocuments=function(){for(var e,n=x(this.getAllDocs());!(e=n()).done;)if(e.value.type===t.DocumentType.JAVA)return!0;return!1},n.getDocForIdentifier=function(e,t){return this.getDocs(t).find((function(t){return t.id===e}))},n.getFirstXmlDoc=function(e){return this.getDocsWithoutPropertyDoc(e).find((function(e){return e.type===t.DocumentType.XML}))},n.getAllDocs=function(){return[this.sourcePropertyDoc,this.constantDoc].concat(this.sourceDocs).concat(this.targetPropertyDoc).concat(this.targetDocs)},n.documentsAreLoaded=function(){for(var e,t=x(this.getAllDocs());!(e=t()).done;)if(!e.value.initialized)return!1;return!0},D(e,[{key:"showMappingPreview",get:function(){return this._showMappingPreview},set:function(e){this._showMappingPreview=e}}]),e}();J.cfg=new J,(_=t.ErrorLevel||(t.ErrorLevel={})).DEBUG="DEBUG",_.INFO="INFO",_.WARN="WARN",_.ERROR="ERROR",(j=t.ErrorScope||(t.ErrorScope={})).APPLICATION="APPLICATION",j.DATA_SOURCE="DATA_SOURCE",j.LOOKUP_TABLE="LOOKUP_TABLE",j.MAPPING="MAPPING",j.FIELD="FIELD",j.FORM="FORM",j.CONSTANT="CONSTANT",j.PROPERTY="PROPERTY",(k=t.ErrorType||(t.ErrorType={})).INTERNAL="INTERNAL",k.USER="USER",k.VALIDATION="VALIDATION",k.PREVIEW="PREVIEW",k.FORM="FORM";var G=function(){function e(t){this._identifier=e.errorIdentifierCounter.toString(),e.errorIdentifierCounter++,Object.assign(this,t)}return D(e,[{key:"identifier",get:function(){return this._identifier}}]),e}();G.errorIdentifierCounter=0;var q=function(){};q.pom='\n    <project xmlns="http://maven.apache.org/POM/4.0.0"\n        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\n\n        <modelVersion>4.0.0</modelVersion>\n        <groupId>foo.bar</groupId>\n        <artifactId>test.model</artifactId>\n        <version>1.10.1</version>\n        <packaging>jar</packaging>\n        <name>Test :: Model</name>\n\n        <dependencies>\n            <dependency>\n                <groupId>com.fasterxml.jackson.core</groupId>\n                <artifactId>jackson-annotations</artifactId>\n                <version>2.8.5</version>\n            </dependency>\n            <dependency>\n                <groupId>com.fasterxml.jackson.core</groupId>\n                <artifactId>jackson-databind</artifactId>\n                <version>2.8.5</version>\n            </dependency>\n            <dependency>\n                <groupId>com.fasterxml.jackson.core</groupId>\n                <artifactId>jackson-core</artifactId>\n                <version>2.8.5</version>\n            </dependency>\n        </dependencies>\n    </project>\n  ';var H=function(e,t){this.node=e,this.offset=t},Y=function(){function e(t){this.uuid=t+e.sequence++}return e.prototype.getUuid=function(){return this.uuid},e}();Y.sequence=0;var X=function(e){function t(n){var i;return(i=e.call(this,t.PREFIX)||this).str=n,i}N(t,e);var n=t.prototype;return n.toText=function(){return this.str},n.toHTML=function(){return'<span id="'+this.uuid+'">'+this.str.replace(/ /g,"&nbsp;")+"</span>"},t}(Y);X.PREFIX="expression-text-";var W=function(e){function t(n,i,a,r,o){var l;if(void 0===r&&(r=0),(l=e.call(this,t.PREFIX)||this).mapping=n,l.mappedField=i,l.metaStr=a,l.collectionContextPath=o,!i){if(a){var s=a.split(":");l.mappedField=1===s.length?n.getMappedFieldByPath(o?o+s[0]:s[0],!0):n.getMappedFieldByPath(s[1],!0,s[0]),l.mappedField||(l.mappedField=n.getReferenceField(s[0],s[1]))}else{var c;l.mappedField=n.getMappedFieldForIndex(null===(c=r+1)||void 0===c?void 0:c.toString(),!0)}i=l.mappedField}return l}N(t,e);var n=t.prototype;return n.toText=function(){if(!this.mappedField||!this.mappedField.field)return"";if(this.mappedField.field.enumeration)return'"'+this.mappedField.field.enumValues[this.mappedField.field.enumIndexValue?this.mappedField.field.enumIndexValue:0].name+'"';var e,t="${";return this.mappedField.field.parentField&&this.mappedField.field.parentField===(null===(e=this.mapping.referenceFields[0])||void 0===e?void 0:e.field)?t+="/"+this.mappedField.field.name+"}":t+=this.mappedField.field.docDef.id+":"+this.mappedField.field.path+"}",t},n.toHTML=function(){if(this.mappedField&&this.mappedField.field){var e="",t=this.mappedField.field.name;return this.mappedField.field.enumeration&&(t+="."+this.mappedField.field.enumValues[this.mappedField.field.enumIndexValue?this.mappedField.field.enumIndexValue:0].name,e=":  Click to select an enumeration value."),'<span style="font-weight:bold" contenteditable="false" id="'+this.uuid+'" title="'+this.mappedField.field.docDef.name+":"+this.mappedField.field.path+e+'"\n        class="expressionFieldLabel label label-default">'+t+"</span>"}return'<span contenteditable="false" id="'+this.uuid+'"\n        title="Field index \''+(this.mapping.getIndexForMappedField(this.mappedField)-1)+'\' is not available"\n        class="expressionFieldLabel label label-danger">N/A</span>'},n.hasComplexField=function(){var e,t,n,i,a,r;return"COMPLEX"===(null===(e=this.mappedField)||void 0===e||null===(t=e.field)||void 0===t?void 0:t.documentField.fieldType)&&("SUPPORTED"===(null===(n=this.mappedField)||void 0===n||null===(i=n.field)||void 0===i?void 0:i.documentField.status)||"CACHED"===(null===(a=this.mappedField)||void 0===a||null===(r=a.field)||void 0===r?void 0:r.documentField.status))},t}(Y);W.PREFIX="expression-field-";var K,Z,$=function(){function e(e,t){this.mapping=e,this.cfg=t,this.expressionHTML="",this.expressionUpdatedSource=new f.Subject,this.expressionUpdated$=this.expressionUpdatedSource.asObservable(),this._nodes=[],this.textCache=""}var n=e.prototype;return n.generateInitialExpression=function(){var e=this;this.mapping.getUserMappedFields(!0).forEach((function(t){return e.appendFieldNode(t)}))},n.getLastNodeIndex=function(){return this._nodes.length-1},n.getLastNode=function(){return this._nodes[this.getLastNodeIndex()]},n.getNode=function(e){return e?this._nodes.find((function(t){return t.getUuid()===e})):this.getLastNode()},n.setConfigModel=function(e){this.cfg=e},n.clearText=function(e,t,n){var i=null;if(e){var a=this._nodes.find((function(t){return t.getUuid()===e}));if(!(a instanceof X&&n))return null;var r=(i=a).str.replace(i.str.substring(t,n),"");i.str=r}else{var o=this.getLastNode();if(!(o instanceof X))return null;var l=o.str.indexOf("@");-1!==l&&((i=o).str=i.str.substring(0,l))}return this.updateCache(),this.expressionUpdatedSource.next(),i},n.insertText=function(e,t,n){this.insertNodes(this.createNodesFromText(e),t,n)},n.insertNodes=function(e,t,n){if(!t){var i,a,r=this.getLastNode();if(r)if(r instanceof X&&e[0]instanceof X)r.str+=e[0].str,e.splice(0,1,r),(a=this._nodes).splice.apply(a,[this.getLastNodeIndex(),1].concat(e));else if(r instanceof W&&e[0]instanceof W){var o;(o=this._nodes).splice.apply(o,[this.getLastNodeIndex(),0,new X(" + ")].concat(e))}else{var l;(l=this._nodes).push.apply(l,e)}else(i=this._nodes).push.apply(i,e);return this.updateCache(),void this.expressionUpdatedSource.next()}var s=new H,c=this._nodes.find((function(e){return e.getUuid()===t})),u=this._nodes.indexOf(c);if(c instanceof X){var p;(null==n||n<0)&&(n=c.str.length);var d=c.str.substring(0,n),f=c.str.substring(n);if(d.length>0&&(e[0]instanceof X?(c.str=d+e[0].str,e.splice(0,1,c)):(c.str=d,e.splice(0,0,c))),f.length>0){var m,g=e.length-1;e[g]instanceof X?(d.length>0?(m=e[g]).str+=f:(m=c).str=e[g].str+f,e.splice(g,1,m)):d.length>0?e.push(new X(f)):(c.str=f,e.push(c))}(p=this._nodes).splice.apply(p,[u,1].concat(e));var v=u+e.length-1;if(this._nodes[v]instanceof W&&this.nodes[v+1]instanceof W){var h=new X(" + ");this._nodes.splice(v+1,0,h),s.node=h,s.offset=1}else this._nodes[v]instanceof W?(s.node=this._nodes[v+1],s.offset=0):(s.node=this._nodes[v],s.offset=this._nodes[v].str.length-f.length);return this.updateCache(),void this.expressionUpdatedSource.next(s)}0!==n&&e[0]instanceof W&&e.splice(0,0,new X(" + "));var E,y=0===n?u:u+1,b=this._nodes[y];if(b instanceof X&&e[e.length-1]instanceof X)s.offset=e[e.length-1].str.length,b.str=e[e.length-1].str+b.str,e.pop(),(E=this._nodes).splice.apply(E,[y,1].concat(e)),s.node=b;else if(b instanceof W&&e[e.length-1]instanceof W){var S,F=new X(" + ");(S=this._nodes).splice.apply(S,[y,0].concat(e,[F])),s.node=F,s.offset=1}else{var T;(T=this._nodes).splice.apply(T,[y,0].concat(e)),b instanceof X?(s.node=b,s.offset=0):(s.node=e[e.length-1],s.offset=e[e.length-1].str.length)}this.updateCache(),this.expressionUpdatedSource.next(s)},n.removeToken=function(e,t,n){if(!e){var i=this.getLastNode();if(!i)return;if(i instanceof W){var a=this._nodes.pop();this._nodes.find((function(e){return e instanceof W&&e.mappedField===a.mappedField}))||(this.mapping.removeField(a.mappedField.field),this.cfg.mappingService.updateMappedField(this.mapping))}else i instanceof X&&(i.str.length>0&&(i.str=i.str.substring(0,i.str.length-1)),0===i.str.length&&this._nodes.pop());return this.updateCache(),void this.expressionUpdatedSource.next()}var r=new H,o=this._nodes.find((function(t){return t.getUuid()===e})),l=this._nodes.indexOf(o);if(n&&(l++,o=this._nodes[l]),!o||-1===t){if(l<1)return;t=(o=this._nodes[--l])instanceof X?o.str.length:1}if(o instanceof W){var s=this._nodes.splice(l,1)[0];if(this._nodes.find((function(e){return e instanceof W&&e.mappedField===s.mappedField}))||(this.mapping.removeField(s.mappedField.field),this.cfg.mappingService.updateMappedField(this.mapping)),this._nodes.length>l)if(this._nodes[l-1]instanceof X&&this._nodes[l]instanceof X){var c=this._nodes[l-1].str.length;this._nodes[l-1].str+=this._nodes[l].str,this._nodes.splice(l,1),r.node=this._nodes[l-1],r.offset=c}else if(this._nodes[l-1]instanceof W&&this._nodes[l]instanceof W){var u=new X(" + ");this._nodes.splice(l,0,u),r.node=u,r.offset=3}else this._nodes[l-1]instanceof X?(r.node=this._nodes[l-1],r.offset=this._nodes[l-1].str.length):this._nodes[l]instanceof X&&(r.node=this._nodes[l],r.offset=0);else r=void 0}else{var p=o.str;1===p.length?this._nodes.splice(l,1):(o.str=0===t?p.substr(1):p.substring(0,t)+p.substring(t+1),r.node=o,r.offset=t)}this.updateCache(),this.expressionUpdatedSource.next(r)},n.clearToEnd=function(e){var t=this.getLastNode();t instanceof X&&(t.str=t.str.substring(0,e))},n.updateFieldReference=function(e,t,n){for(var i,a=this,r=e.getUserMappedFields(!0),o=e.getReferenceMappedFields(),l=this._nodes.filter((function(e){return e instanceof W})),s=x(l);!(i=s()).done;){var c=i.value;if(!(r.includes(c.mappedField)||o.includes(c.mappedField)||c.hasComplexField())){var u=this._nodes.indexOf(c);this._nodes.splice(u,1),this._nodes.length>u&&this._nodes[u-1]instanceof X&&this._nodes[u]instanceof X&&(this._nodes[u-1].str+=this._nodes[u].str,this._nodes.splice(u,1))}}l=this._nodes.filter((function(e){return e instanceof W}));for(var p,d=function(){var e=p.value;l.find((function(t){return t.mappedField===e}))||o.find((function(t){return t.field===e.field}))||(t?a.insertNodes([new W(a.mapping,e)],t,n):a.appendFieldNode(e))},f=x(r);!(p=f()).done;)d();this.updateCache(),this.expressionUpdatedSource.next()},n.clear=function(){this._nodes=[],this.updateCache(),this.expressionUpdatedSource.next()},n.toText=function(){return 0===this.textCache.length&&this.updateCache(),this.textCache},n.toHTML=function(){return 0===this.expressionHTML.length&&this.updateCache(),this.expressionHTML},n.addConditionalExpressionNode=function(e,t,n){this.insertNodes([new W(this.mapping,e)],t,n)},n.updateCache=function(){var e="";this._nodes.forEach((function(t){return e+=t.toText()})),this.textCache=e,e="",this._nodes.forEach((function(t){return e+=t.toHTML()})),this.expressionHTML=e},n.createNodesFromText=function(e){for(var n=[],i=-1,a=null;-1!==e.search(/\$\{[a-zA-Z0-9.:/<>[\]_-]+\}/);){0!==(i=e.search(/\$/))&&n.push(new X(e.substring(0,i)));var r,o,l=e.substring(i+2,e.indexOf("}")),s=null;if(isNaN(Number(l))){var c,u;s=a?new W(this.mapping,void 0,l,void 0,null===(c=a.mappedField)||void 0===c||null===(u=c.field)||void 0===u?void 0:u.path):new W(this.mapping,void 0,l)}else{var p=parseInt(l,10);s=new W(this.mapping,void 0,void 0,p)}s&&s.mappedField?(null!==(r=s.mappedField)&&void 0!==r&&null!==(o=r.field)&&void 0!==o&&o.isCollection&&(a=s),n.push(s)):this.cfg.errorService.addError(new G({message:"Unable to map expression element '"+l+"' to a field node.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.MAPPING,type:t.ErrorType.INTERNAL,mapping:this.mapping})),e=e.substring(e.indexOf("}")+1)}return e.length>0&&n.push(new X(e)),n},n.appendFieldNode=function(e){var t=this._nodes.pop();t instanceof W?this._nodes.push(t,new X(" + ")):t instanceof X&&this._nodes.push(0===t.str.length?new X(" + "):t),this._nodes.push(new W(this.mapping,e))},D(e,[{key:"hasComplexField",get:function(){return this._hasComplexField},set:function(e){this._hasComplexField=e}},{key:"nodes",get:function(){return this._nodes}}]),e}(),Q=function(){this.type=t.FieldType.STRING,this.values=null,this.serviceObject={}},ee=function(){},te=function(){function e(){this.arguments=[],this.sourceType=t.FieldType.NONE,this.targetType=t.FieldType.NONE,this.multiplicity=t.Multiplicity.ONE_TO_ONE,this.serviceObject={}}var n=e.prototype;return n.populateFieldAction=function(e){if(e.name=this.name,e.definition=this,null==e.argumentValues||0===e.argumentValues.length){e.argumentValues=[];for(var t,n=x(this.arguments);!(t=n()).done;){var i=t.value;-1!==["LONG","INTEGER","FLOAT","DOUBLE","SHORT","BYTE","DECIMAL","NUMBER"].indexOf(i.type.toUpperCase())?e.setArgumentValue(i.name,"0"):"BOOLEAN"===i.type.toUpperCase()?e.setArgumentValue(i.name,"false"):e.setArgumentValue(i.name,"")}}},n.getArgumentForName=function(e){return this.arguments.find((function(t){return t.name===e}))},e}(),ne=function(){function e(){this.argumentValues=[]}e.create=function(t){var n=new e;return n.definition=t,n.name=null==t?void 0:t.name,n};var t=e.prototype;return t.getArgumentValue=function(e){for(var t,n=x(this.argumentValues);!(t=n()).done;){var i=t.value;if(i.name===e)return i}var a=new ee;return a.name=e,a.value="0",this.argumentValues.push(a),a},t.setArgumentValue=function(e,t){this.getArgumentValue(e).value=t},e}(),ie=function(){function e(e,t){this.cfg=e,this.doc=t}return e.prototype.parseFieldFromDocument=function(e,n){if(null!=e&&"NOT_FOUND"===e.status)return this.cfg.errorService.addError(new G({message:"Ignoring unknown field: "+e.name+" ("+e.path+"), document: "+this.doc.name,level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER})),null;if(null!=e&&"EXCLUDED"===e.status)return null;var i=new R;return i.name=e.name,i.type=e.fieldType,i.path=e.path,i.isPrimitive="COMPLEX"!==e.fieldType,i.documentField=e,"LIST"!==e.collectionType&&"ARRAY"!==e.collectionType||(i.isCollection=!0,"ARRAY"===e.collectionType&&(i.isArray=!0)),null!=n?(i.parentField=n,n.children.push(i)):this.doc.fields.push(i),i},e}(),ae=function(e,t){this.cfg=e,this.doc=t},re=function(e,t){this.cfg=e,this.doc=t,this.headers={"Content-Type":"application/json"},this.searchParams={}},oe=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).request=new le(t.cfg,t.doc),t}N(n,e);var i=n.prototype;return i.isOnlineInspectionCapable=function(){return null!=this.cfg.initCfg.baseCSVInspectionServiceUrl||(this.cfg.errorService.addError(new G({message:"CSV inspection service is not configured. Document will not be loaded: "+this.doc.name,level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:this.doc})),!1)},i.parseResponse=function(e){if(void 0!==e.CsvInspectionResponse)this.extractCSVDocumentDefinitionFromInspectionResponse(e.CsvInspectionResponse);else{if(void 0===e.CsvDocument)throw new Error("Unknown CSV inspection result format: "+e);this.extractCSVDocumentDefinition(e.CsvDocument)}},i.extractCSVDocumentDefinitionFromInspectionResponse=function(e){if(e.errorMessage)throw this.doc.errorOccurred=!0,new Error("Could not load JSON document, error: "+e.errorMessage);this.extractCSVDocumentDefinition(e.csvDocument)},i.extractCSVDocumentDefinition=function(e){this.doc.description||(this.doc.description=this.doc.id),this.doc.name||(this.doc.name=this.doc.id),this.doc.inspectionParameters&&(this.doc.uri=P.urlWithParameters(this.doc.uri,this.doc.inspectionParameters));for(var t,n=x(e.fields.field);!(t=n()).done;)this.parseCSVFieldFromDocument(t.value,null)},i.parseCSVFieldFromDocument=function(e,n){var i,a,r=this.parseFieldFromDocument(e,n);if(null!=r&&(r.column=e.column,e.fieldType===t.FieldType.COMPLEX)&&null!==(i=e.csvFields)&&void 0!==i&&null!==(a=i.csvField)&&void 0!==a&&a.length)for(var o,l=x(e.csvFields.csvField);!(o=l()).done;)this.parseCSVFieldFromDocument(o.value,r)},n}(ie),le=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).url=t.cfg.initCfg.baseCSVInspectionServiceUrl+"inspect",t.options=new se(t.cfg,t.doc),t}return N(t,e),t}(ae),se=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).body=t.doc.inspectionSource,t.searchParams=t.doc.inspectionParameters,t}return N(t,e),t}(re),ce=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).request=new ue(t.cfg,t.doc),t}N(n,e);var i=n.prototype;return i.isOnlineInspectionCapable=function(){return null!=this.cfg.initCfg.baseJavaInspectionServiceUrl||(this.cfg.errorService.addError(new G({message:"Java inspection service is not configured. Document will not be loaded: "+this.doc.name,level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:this.doc})),!1)},i.parseResponse=function(e){var n;if(e.ClassInspectionResponse){if(e.errorMessage)throw this.doc.errorOccurred=!0,new Error("Could not load JSON document, error: "+e.errorMessage);n=e.ClassInspectionResponse.javaClass}else n=e.JavaClass;var i=this.doc.id;if(!n||"NOT_FOUND"===n.status)throw this.doc.errorOccurred=!0,new Error("Could not load JAVA document. Document is not found: "+i);this.doc.description||(this.doc.description=n.className),this.doc.name||(this.doc.name=n.className,this.doc.name&&-1!==this.doc.name.indexOf(".")&&(this.doc.name=this.doc.name.substr(this.doc.name.lastIndexOf(".")+1))),!n.uri||this.doc.uri&&0!==this.doc.uri.length||(this.doc.uri=n.uri);var a=null;n.collectionType&&n.collectionType!==t.CollectionType.NONE.valueOf()&&(this.parseJavaFieldFromDocument(n,null),a=this.doc.fields[0]);for(var r,o=x(n.javaFields.javaField);!(r=o()).done;)this.parseJavaFieldFromDocument(r.value,a)},i.parseJavaFieldFromDocument=function(e,n){var i,a,r,o=this.parseFieldFromDocument(e,n);if(null!=o&&(e.className&&(o.classIdentifier=e.className),e.fieldType===t.FieldType.COMPLEX)){var l=e;if(o.enumeration=l.enumeration,l.enumeration&&null!==(i=l.javaEnumFields)&&void 0!==i&&i.javaEnumField)for(var s,c=x(l.javaEnumFields.javaEnumField);!(s=c()).done;){var u=s.value,p=new w;p.name=u.name,p.ordinal=u.ordinal,o.enumValues.push(p)}if(null!==(a=l.javaFields)&&void 0!==a&&null!==(r=a.javaField)&&void 0!==r&&r.length)for(var d,f=x(l.javaFields.javaField);!(d=f()).done;)this.parseJavaFieldFromDocument(d.value,o)}},n}(ie),ue=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).url=t.cfg.initCfg.baseJavaInspectionServiceUrl+"class",t.options=new pe(t.cfg,t.doc),t}return N(t,e),t}(ae),pe=function(e){function n(n,i){var a;(a=e.call(this,n,i)||this).cfg=n,a.doc=i;var r={ClassInspectionRequest:{jsonType:"io.atlasmap.java.v2.ClassInspectionRequest",className:a.doc.inspectionSource,disablePrivateOnlyFields:a.cfg.initCfg.disablePrivateOnlyFields,disableProtectedOnlyFields:a.cfg.initCfg.disableProtectedOnlyFields,disablePublicOnlyFields:a.cfg.initCfg.disablePublicOnlyFields,disablePublicGetterSetterFields:a.cfg.initCfg.disablePublicGetterSetterFields}};return a.json=r,a.doc.initModel.collectionType&&a.doc.initModel.collectionType!==t.CollectionType.NONE&&(r.ClassInspectionRequest.collectionType=a.doc.initModel.collectionType,a.doc.initModel.collectionClassName&&(r.ClassInspectionRequest.collectionClassName=a.doc.initModel.collectionClassName)),a.cfg.initCfg.fieldNameExclusions&&a.cfg.initCfg.fieldNameExclusions.length&&(r.ClassInspectionRequest.fieldNameExclusions={string:a.cfg.initCfg.fieldNameExclusions}),a.cfg.initCfg.classNameExclusions&&a.cfg.initCfg.classNameExclusions.length&&(r.ClassInspectionRequest.classNameExclusions={string:a.cfg.initCfg.classNameExclusions}),a}return N(n,e),n}(re),de=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).request=new fe(t.cfg,t.doc),t}N(n,e);var i=n.prototype;return i.isOnlineInspectionCapable=function(){return null!=this.cfg.initCfg.baseJSONInspectionServiceUrl||(this.cfg.errorService.addError(new G({message:"JSON inspection service is not configured. Document will not be loaded: "+this.doc.name,level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:this.doc})),!1)},i.parseResponse=function(e){if(void 0!==e.JsonInspectionResponse)this.extractJSONDocumentDefinitionFromInspectionResponse(e.JsonInspectionResponse);else{if(void 0===e.JsonDocument)throw new Error("Unknown JSON inspection result format: "+e);this.extractJSONDocumentDefinition(e.JsonDocument)}},i.extractJSONDocumentDefinitionFromInspectionResponse=function(e){if(e.errorMessage)throw this.doc.errorOccurred=!0,new Error("Could not load JSON document, error: "+e.errorMessage);this.extractJSONDocumentDefinition(e.jsonDocument)},i.extractJSONDocumentDefinition=function(e){this.doc.description||(this.doc.description=this.doc.id),this.doc.name||(this.doc.name=this.doc.id);for(var t,n=x(e.fields.field);!(t=n()).done;)this.parseJSONFieldFromDocument(t.value,null)},i.parseJSONFieldFromDocument=function(e,n){var i,a,r=this.parseFieldFromDocument(e,n);if(null!=r&&e.fieldType===t.FieldType.COMPLEX){var o=e;if(r.enumeration=o.enumeration,r.enumeration&&null!==(i=o.jsonEnumFields)&&void 0!==i&&i.jsonEnumField)for(var l,s=x(o.jsonEnumFields.jsonEnumField);!(l=s()).done;){var c=l.value,u=new w;u.name=c.name,u.ordinal=c.ordinal,r.enumValues.push(u)}if(null!==(a=o.jsonFields)&&void 0!==a&&a.jsonField.length)for(var p,d=x(o.jsonFields.jsonField);!(p=d()).done;)this.parseJSONFieldFromDocument(p.value,r)}},n}(ie),fe=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).url=t.cfg.initCfg.baseJSONInspectionServiceUrl+"inspect",t.options=new me(t.cfg,t.doc),t}return N(t,e),t}(ae),me=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).json={JsonInspectionRequest:{jsonType:"io.atlasmap.json.v2.JsonInspectionRequest",type:t.doc.inspectionType,jsonData:t.doc.inspectionSource}},t}return N(t,e),t}(re),ge=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).request=new ve(t.cfg,t.doc),t}N(n,e);var i=n.prototype;return i.isOnlineInspectionCapable=function(){return null!=this.cfg.initCfg.baseXMLInspectionServiceUrl||(this.cfg.errorService.addError(new G({message:"XML inspection service is not configured. Document will not be loaded: "+this.doc.name,level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:this.doc})),!1)},i.parseResponse=function(e){if(void 0!==e.XmlInspectionResponse)this.extractXMLDocumentDefinitionFromInspectionResponse(e.XmlInspectionResponse);else{if(void 0===e.XmlDocument)throw new Error("Unknown XML inspection result format: "+e);this.extractXMLDocumentDefinition(e.XmlDocument)}},i.extractXMLDocumentDefinitionFromInspectionResponse=function(e){if(e.errorMessage)throw this.doc.errorOccurred=!0,new Error("Could not load XML document, error: "+e.errorMessage);this.extractXMLDocumentDefinition(e.xmlDocument)},i.extractXMLDocumentDefinition=function(e){var t,n;if(this.doc.description||(this.doc.description=this.doc.id),this.doc.name||(this.doc.name=this.doc.id),null!=e&&null!==(t=e.xmlNamespaces)&&void 0!==t&&null!==(n=t.xmlNamespace)&&void 0!==n&&n.length)for(var i,a=x(e.xmlNamespaces.xmlNamespace);!(i=a()).done;){var r=i.value,o=new L;o.alias=r.alias,o.uri=r.uri,o.locationUri=r.locationUri,o.isTarget=r.targetNamespace,this.doc.namespaces.push(o)}for(var l,s=x(e.fields.field);!(l=s()).done;){var c=l.value;if(!this.doc.selectedRoot||this.isSelectedRootElement(c)){this.parseXMLFieldFromDocument(c,null);break}}},i.isSelectedRootElement=function(e){return!!(this.doc.selectedRoot||null!=e&&e.name)&&this.doc.selectedRoot===(-1!==e.name.indexOf(":")?e.name.split(":")[1]:e.name)},i.parseXMLFieldFromDocument=function(e,n){var i,a,r=this.parseFieldFromDocument(e,n);if(null!=r&&(-1!==e.name.indexOf(":")&&(r.namespaceAlias=e.name.split(":")[0],r.name=e.name.split(":")[1]),r.isAttribute=-1!==r.path.indexOf("@"),e.fieldType===t.FieldType.COMPLEX)){var o=e;if(r.enumeration=o.enumeration,r.enumeration&&null!==(i=o.xmlEnumFields)&&void 0!==i&&i.xmlEnumField)for(var l,s=x(o.xmlEnumFields.xmlEnumField);!(l=s()).done;){var c=l.value,u=new w;u.name=c.name,u.ordinal=c.ordinal,r.enumValues.push(u)}if(null!==(a=o.xmlFields)&&void 0!==a&&a.xmlField.length)for(var p,d=x(o.xmlFields.xmlField);!(p=d()).done;)this.parseXMLFieldFromDocument(p.value,r)}},n}(ie),ve=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).url=t.cfg.initCfg.baseXMLInspectionServiceUrl+"inspect",t.options=new he(t.cfg,t.doc),t}return N(t,e),t}(ae),he=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).json={XmlInspectionRequest:{jsonType:"io.atlasmap.xml.v2.XmlInspectionRequest",type:t.doc.inspectionType,xmlData:t.doc.inspectionSource}},t}return N(t,e),t}(re),Ee=function(){this.sourceType=t.FieldType.STRING,this.targetType=t.FieldType.STRING},ye=function(){function e(){this.lookupEntry=[],this.name=(new Date).getTime()+"-"+Math.floor(1e6*Math.random()).toString()}var t=e.prototype;return t.getInputOutputKey=function(){return this.sourceIdentifier+":"+this.targetIdentifier},t.getEntryForSource=function(e,t){for(var n,i=x(this.lookupEntry);!(n=i()).done;){var a=n.value;if(a.sourceValue===e)return a}if(t){var r=new Ee;return r.sourceValue=e,this.lookupEntry.push(r),r}return null},t.toString=function(){var e="Lookup Table, name: "+this.name+", entries: "+this.lookupEntry.length;e+="\nsourceIdentifier: "+this.sourceIdentifier,e+="\n\targetIdentifier: "+this.targetIdentifier;for(var t,n=0,i=x(this.lookupEntry);!(t=i()).done;){var a=t.value;e+="\n\tEntry #"+n+": "+a.sourceValue+" => "+a.targetValue,n+=1}return e},e}();(K=t.TransitionMode||(t.TransitionMode={})).ONE_TO_ONE="ONE_TO_ONE",K.ONE_TO_MANY="ONE_TO_MANY",K.ENUM="ENUM",K.MANY_TO_ONE="MANY_TO_ONE",K.FOR_EACH="FOR_EACH",K.EXPRESSION="EXPRESSION",(Z=t.TransitionDelimiter||(t.TransitionDelimiter={}))[Z.NONE=0]="NONE",Z[Z.AMPERSAND=1]="AMPERSAND",Z[Z.AT_SIGN=2]="AT_SIGN",Z[Z.BACKSLASH=3]="BACKSLASH",Z[Z.COLON=4]="COLON",Z[Z.COMMA=5]="COMMA",Z[Z.DASH=6]="DASH",Z[Z.EQUAL=7]="EQUAL",Z[Z.HASH=8]="HASH",Z[Z.PERIOD=9]="PERIOD",Z[Z.PIPE=10]="PIPE",Z[Z.SEMICOLON=11]="SEMICOLON",Z[Z.SLASH=12]="SLASH",Z[Z.SPACE=13]="SPACE",Z[Z.UNDERSCORE=14]="UNDERSCORE",Z[Z.USER_DEFINED=15]="USER_DEFINED";var be=function(e,n,i,a){this.delimiter=t.TransitionDelimiter.SPACE,this.serializedValue=null,this.prettyName=null,this.actualDelimiter="",this.delimiter=e,this.serializedValue=n,this.prettyName=i,this.actualDelimiter=a},Se=function(){function e(){this.mode=t.TransitionMode.ONE_TO_ONE,this.delimiter=t.TransitionDelimiter.SPACE,this.userDelimiter="",this.lookupTableName=null,this.enableExpression=!1,this.transitionFieldAction=null,e.initialize()}e.initialize=function(){if(0===e.delimiterModels.length){var n=[];n.push(new be(t.TransitionDelimiter.NONE,null,"[None]","")),n.push(new be(t.TransitionDelimiter.AMPERSAND,"Ampersand","Ampersand [&]","&")),n.push(new be(t.TransitionDelimiter.AT_SIGN,"AtSign","At Sign [@]","@")),n.push(new be(t.TransitionDelimiter.BACKSLASH,"Backslash","Backslash [\\]","\\")),n.push(new be(t.TransitionDelimiter.COLON,"Colon","Colon [:]",":")),n.push(new be(t.TransitionDelimiter.COMMA,"Comma","Comma [,]",",")),n.push(new be(t.TransitionDelimiter.DASH,"Dash","Dash [-]","-")),n.push(new be(t.TransitionDelimiter.EQUAL,"Equal","Equal [=]","=")),n.push(new be(t.TransitionDelimiter.HASH,"Hash","Hash [#]","#")),n.push(new be(t.TransitionDelimiter.PERIOD,"Period","Period [.]",".")),n.push(new be(t.TransitionDelimiter.PIPE,"Pipe","Pipe [|]","|")),n.push(new be(t.TransitionDelimiter.SEMICOLON,"Semicolon","Semicolon [;]",";")),n.push(new be(t.TransitionDelimiter.SLASH,"Slash","Slash [/]","/")),n.push(new be(t.TransitionDelimiter.SPACE,"Space","Space [ ]"," ")),n.push(new be(t.TransitionDelimiter.UNDERSCORE,"Underscore","Underscore [_]","_")),n.push(new be(t.TransitionDelimiter.USER_DEFINED,"User defined","User defined","\0")),e.delimiterModels=n}},e.delimiterToModel=function(t){return e.delimiterModels.filter((function(e){return e.actualDelimiter===t}))[0]},e.getMappingModeName=function(e){var n;switch(e){case t.TransitionMode.ONE_TO_ONE:n="One to One";break;case t.TransitionMode.MANY_TO_ONE:n="Many to One";break;case t.TransitionMode.ONE_TO_MANY:n="One to Many";break;case t.TransitionMode.ENUM:n="ENUM";break;case t.TransitionMode.FOR_EACH:n="For Each";break;case t.TransitionMode.EXPRESSION:n="Expression";break;default:n=""}return n};var n=e.prototype;return n.getPrettyName=function(){var n,i="";return this.transitionFieldAction&&(i=" ("+this.transitionFieldAction.name+")"),this.mode===t.TransitionMode.ONE_TO_MANY||this.mode===t.TransitionMode.MANY_TO_ONE?e.getMappingModeName(this.mode)+i:this.mode===t.TransitionMode.ENUM?"Enum (table: "+this.lookupTableName+")":this.mode===t.TransitionMode.EXPRESSION?"Expression ("+(null===(n=this.expression)||void 0===n?void 0:n.toText())+")":e.getMappingModeName(this.mode)},n.isOneToManyMode=function(){return this.mode===t.TransitionMode.ONE_TO_MANY},n.isOneToOneMode=function(){return this.mode===t.TransitionMode.ONE_TO_ONE},n.isManyToOneMode=function(){return this.mode===t.TransitionMode.MANY_TO_ONE},n.isForEachMode=function(){return this.mode===t.TransitionMode.FOR_EACH},n.isEnumerationMode=function(){return this.mode===t.TransitionMode.ENUM},n.isExpressionMode=function(){return this.mode===t.TransitionMode.EXPRESSION},e}();Se.delimiterModels=[];var Fe=function(){function e(){this.name=null,this.version=null,this.mappings=[],this.activeMapping=null,this.parsedDocs=[],this.templateText=null,this.tables=[],this.tablesBySourceTargetKey={},this.tablesByName={},this.name="UI.0"}var n=e.prototype;return n.templateExists=function(){return null!=this.templateText&&""!==this.templateText},n.addTable=function(e){this.tablesBySourceTargetKey[e.getInputOutputKey()]=e,this.tablesByName[e.name]=e,this.tables.push(e)},n.getTableByName=function(e){return this.tablesByName[e]},n.getTableBySourceTarget=function(e,t){return this.tablesBySourceTargetKey[e+":"+t]},n.getTables=function(){var e=[];for(var t in this.tablesByName)this.tablesByName.hasOwnProperty(t)&&e.push(this.tablesByName[t]);return e},n.removeTableByName=function(e){if(e){var t=this.tablesByName[e],n=t.getInputOutputKey();this.tablesByName[e]&&(delete this.tables[this.tables.indexOf(t)],delete this.tablesByName[e],delete this.tablesBySourceTargetKey[n])}},n.getAllMappings=function(e){var t=[].concat(this.mappings);if(e){if(null==this.activeMapping)return t;for(var n,i=x(t);!(n=i()).done;)if(n.value===this.activeMapping)return t;t.push(this.activeMapping)}return t},n.findMappingsForField=function(e){for(var t,n=[],i=x(this.mappings);!(t=i()).done;){var a=t.value;a.isFieldMapped(e)&&n.push(a)}return n},n.removeMapping=function(e){return e.transition.mode===t.TransitionMode.ENUM&&this.removeTableByName(e.transition.lookupTableName),P.removeItemFromArray(e,this.mappings)},e}(),Te=function(){function e(){this.actions=[]}e.sortMappedFieldsByPath=function(e){if(null==e||0===e.length)return[];for(var t,n={},i=[],a=x(e);!(t=a()).done;){var r=t.value;if(null!=r&&null!=r.field){var o=r.field.path;n[o]=r,i.push(o)}}i.sort();for(var l=[],s=0,c=i;s<c.length;s++)l.push(n[c[s]]);return l};var t=e.prototype;return t.isPadField=function(){return this.field instanceof U},t.isSource=function(){return!!this.field&&this.field.isSource()},t.removeAction=function(e){P.removeItemFromArray(e,this.actions)},e}(),Me=function(){function e(){this.sourceFields=[],this.targetFields=[],this.referenceFields=[],this.transition=new Se,this.uuid="mapping."+Math.floor(1e6*Math.random()+1).toString(),this.cfg=J.getConfig()}var n=e.prototype;return n.getFirstCollectionField=function(e){for(var t,n=x(e?this.sourceFields:this.targetFields);!(t=n()).done;){var i=t.value;if(i.field&&i.field.isInCollection())return i.field}return null},n.isLookupMode=function(){for(var e,t=x(this.sourceFields.concat(this.targetFields));!(e=t()).done;){var n=e.value;if(n.field&&n.field.enumeration)return!0}return!1},n.addField=function(e,t){var n=this.getMappedFields(e.isSource());if(1===n.length){var i=n[0];if(!i.field)return i.field=e,i}var a=new Te;return a.field=e,t?n.unshift(a):n.push(a),a},n.removeField=function(e){var t=this.getMappedFields(e.isSource());P.removeItemFromArray(t.find((function(t){return t.field===e})),t)},n.getUserFieldCount=function(e){for(var t,n=0,i=x(this.getMappedFields(e.isSource()));!(t=i()).done;)t.value.isPadField()||n++;return n},n.hasMappedField=function(e){return e?this.sourceFields.length>0:this.targetFields.length>0},n.isEmpty=function(){return 0===this.sourceFields.length&&0===this.targetFields.length},n.isFullyMapped=function(){return this.sourceFields.length>0&&this.targetFields.length>0},n.addMappedField=function(e,t){this.getMappedFields(t).push(e)},n.removeMappedField=function(e){e&&e.field&&(e.field.isCollection&&this.removeReferenceField(e),P.removeItemFromArray(e,this.getMappedFields(e.field.isSource())),this.cfg.mappingService.notifyMappingUpdated())},n.getMappedFieldForField=function(e){if(!e||!e.isSource)return null;for(var t,n=x(this.getMappedFields(e.isSource()));!(t=n()).done;){var i=t.value;if(i.field===e)return i}return null},n.getMappedFieldByPath=function(e,t,n){if(!e)return null;for(var i=this.getMappedFields(t),a=0;a<i.length;a++){var r;if((null===(r=i[a].field)||void 0===r?void 0:r.path)===e){var o;if(!n)return i[a];if(n&&(null===(o=i[a].field)||void 0===o?void 0:o.docDef.id)===n)return i[a]}}return null},n.getMappedFieldForIndex=function(e,t){if(!e||0===e.length)return null;var n=this.getMappedFields(t);return+e-1>n.length-1?null:n[+e-1]},n.getIndexForMappedField=function(e){return e&&e.field?this.getMappedFields(e.field.isSource()).indexOf(e)+1:null},n.getField=function(e,t){var n=this.cfg.getDocForIdentifier(e,!0);n||(n=this.cfg.getDocForIdentifier(e,!1));var i=null;return n&&(i=R.getField(t,n.getAllFields())),i},n.createReferenceField=function(e){var t,n,i,a=null;return e?(null!==(t=e.documentField)&&void 0!==t&&t.status&&"SUPPORTED"!==(null===(n=e.documentField)||void 0===n?void 0:n.status)&&"CACHED"!==(null===(i=e.documentField)||void 0===i?void 0:i.status)||((a=new Te).field=e,this.referenceFields.push(a)),a):null},n.removeReferenceField=function(e){e&&P.removeItemFromArray(e,this.referenceFields)},n.referenceFieldExists=function(e,t){if(!e||!t)return!1;for(var n,i=x(this.getReferenceMappedFields());!(n=i()).done;){var a=n.value;if(a.field&&a.field.docDef.id===e&&a.field.path===t)return!0}return!1},n.getReferenceField=function(e,n){if(!e||!n)return null;for(var i,a=x(this.getReferenceMappedFields());!(i=a()).done;){var r=i.value;if(r.field&&r.field.docDef.id===e&&r.field.path===n)return r}var o=this.getField(e,n);return(null==o?void 0:o.type)===t.FieldType.COMPLEX?(this.transition.expression.hasComplexField=!0,this.createReferenceField(o)):null},n.getUserMappedFields=function(e){for(var t,n=e?this.sourceFields:this.targetFields,i=[new Te],a=x(n);!(t=a()).done;){var r=t.value;r.isPadField()||i.push(r)}return i.shift(),i},n.getReferenceMappedFields=function(){return this.referenceFields},n.getMappedFields=function(e){return e?this.sourceFields:this.targetFields},n.getLastMappedField=function(e){var t=this.getMappedFields(e);return null!=t&&t.length>0?t[t.length-1]:null},n.getFields=function(e){for(var t,n=[],i=x(this.getMappedFields(e));!(t=i()).done;){var a=t.value;null!=a.field&&n.push(a.field)}return n},n.getFieldNames=function(e){for(var t,n=[],i=x(this.getFields(e));!(t=i()).done;)n.push(t.value.name);return n},n.getFieldPaths=function(e){for(var t,n=[],i=x(this.getFields(e));!(t=i()).done;)n.push(t.value.path);return n},n.hasFieldActions=function(){for(var e,t=x(this.getAllMappedFields());!(e=t()).done;)if(e.value.actions.length>0)return!0;return!1},n.getAllFields=function(){return this.getFields(!0).concat(this.getFields(!1))},n.getAllMappedFields=function(){return this.getMappedFields(!0).concat(this.getMappedFields(!1))},n.isFieldMapped=function(e){return null!=this.getMappedFieldForField(e)},n.hasTransformation=function(){for(var e,t=x(this.getAllMappedFields());!(e=t()).done;)if(e.value.actions.length>0)return!0;return!1},n.getMappedTarget=function(e){var t=this.cfg.mappings.mappings;if(e.isSource())return null;for(var n,i=x(t);!(n=i()).done;){var a=n.value;if(0!==a.targetFields.length)for(var r,o=x(a.targetFields);!(r=o()).done;){var l,s,c=r.value;if((null===(l=c.field)||void 0===l?void 0:l.docDef)===e.docDef&&c.field.path===e.path&&a.isFieldMapped(e))return null===(s=a.sourceFields[0])||void 0===s?void 0:s.field.name}}return null},e}(),Ce=function(){function e(){}return e.prototype.then=function(t,n){var i=new e,a=this.s;if(a){var r=1&a?t:n;if(r){try{Oe(i,1,r(this.v))}catch(e){Oe(i,2,e)}return i}return this}return this.o=function(e){try{var a=e.v;1&e.s?Oe(i,1,t?t(a):a):n?Oe(i,1,n(a)):Oe(i,2,a)}catch(e){Oe(i,2,e)}},i},e}();function Oe(e,t,n){if(!e.s){if(n instanceof Ce){if(!n.s)return void(n.o=Oe.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Oe.bind(null,e,t),Oe.bind(null,e,2));e.s=t,e.v=n;var i=e.o;i&&i(e)}}function Ae(e){return e instanceof Ce&&1&e.s}var De="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Ne(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var Ie,xe,Pe=function(){function e(){}return e.fromDocumentDefinition=function(e,n){switch(n.type){case t.DocumentType.JAVA:return new ce(e,n);case t.DocumentType.JSON:return new de(e,n);case t.DocumentType.XSD:case t.DocumentType.XML:return new ge(e,n);case t.DocumentType.CSV:return new oe(e,n);default:throw new Error("Document type '"+n.type+"' is not supported for inspection")}},e.fromJavaProperties=function(n,i,a,r,o){void 0===r&&(r=t.CollectionType.NONE);var l=new B;l.id=i;var s=i.split(".").pop();l.name=s||"",l.type=t.DocumentType.JAVA,l.inspectionType=t.InspectionType.JAVA_CLASS,l.inspectionSource=i,l.inspectionParameters={"":""},l.isSource=a,l.collectionType=r,l.collectionClassName=o,l.description="Java document class "+i,r&&r!==t.CollectionType.NONE&&(l.description+=" collection type: "+r,o&&(l.description+=" collection class name: "+o)),e.removeDocumentIfAlreadyExists(n,l.id,a);var c=n.addDocument(l);return new ce(n,c)},e.fromNonJavaProperties=function(t,n,i,a,r,o,l,s){var c=new B;c.name=i,c.id=n,c.type=a,c.inspectionType=r,c.inspectionSource=o,c.inspectionParameters=s||{"":""},c.isSource=l,c.description=l?"Source document ":"Target document ",c.description+=i+" type: "+a,e.removeDocumentIfAlreadyExists(t,c.id,l);var u=t.addDocument(c);return this.fromDocumentDefinition(t,u)},e.removeDocumentIfAlreadyExists=function(e,t,n){var i=e.getDocForIdentifier(t,n);i&&P.removeItemFromArray(i,n?e.sourceDocs:e.targetDocs)},e}(),we=function(){function e(){}return e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},e}(),Re=function(){},_e=function(){function e(){}return e.populateMappingLookupTable=function(e,n){if(n.transition.mode===t.TransitionMode.ENUM&&!n.transition.lookupTableName&&1===n.getFields(!0).length&&1===n.getFields(!1).length){var i,a,r=n.getFields(!0)[0];r&&(i=r.name+"-"+r.docDef.id);var o=n.getFields(!0)[0];if(o&&(a=o.name+"-"+o.docDef.id),i&&a){var l=e.getTableBySourceTarget(i,a);l||((l=new ye).sourceIdentifier=i,l.targetIdentifier=a,e.addTable(l)),n.transition.lookupTableName=l.name}}},e.updateLookupTables=function(t){for(var n,i=x(t.getTables());!(n=i()).done;){var a=n.value;if(!a.sourceIdentifier||!a.targetIdentifier){var r=e.getFirstMappingForLookupTable(t,a.name);if(r&&r.transition.lookupTableName){if(!a.sourceIdentifier){var o=r.getFields(!0)[0];o&&(a.sourceIdentifier=o.classIdentifier)}if(!a.targetIdentifier){var l=r.getFields(!1)[0];l&&(a.targetIdentifier=l.classIdentifier)}}}}for(var s,c=x(t.mappings);!(s=c()).done;)e.populateMappingLookupTable(t,s.value)},e.getFirstMappingForLookupTable=function(e,t){return e.mappings.find((function(e){return e.transition.lookupTableName===t}))},e.errorNoTable=function(e,n){var i;e.errorService.addError(new G({message:"Could not find enumeration lookup table "+(null===(i=n.transition)||void 0===i?void 0:i.lookupTableName)+" for mapping.",scope:t.ErrorScope.MAPPING,type:t.ErrorType.INTERNAL,mapping:n}))},e.getEnumerationValues=function(t,n){var i;if(!t||!t.mappings||!n)return[];var a=n.getFields(!1)[0],r=[];r.push("[ None ]");for(var o,l=x(a.enumValues);!(o=l()).done;)r.push(o.value.name);var s=t.mappings.getTableByName(null===(i=n.transition)||void 0===i?void 0:i.lookupTableName);if(!s)return e.errorNoTable(t,n),[];for(var c,u=[],p=x(n.getFields(!0)[0].enumValues);!(c=p()).done;){var d=c.value,f=new Re;f.sourceEnumValue=d.name,f.targetEnumValues=r;var m=s.getEntryForSource(f.sourceEnumValue,!1);f.selectedTargetEnumValue=null==m?"[ None ]":m.targetValue,u.push(f)}return u},e.updateEnumerationValues=function(t,n,i){var a;if(t&&t.mappings&&n){var r=t.mappings.getTableByName(null===(a=n.transition)||void 0===a?void 0:a.lookupTableName);if(r){r.lookupEntry=[];for(var o,l=x(i);!(o=l()).done;){var s=o.value;if("[ None ]"!==s.selectedTargetEnumValue){var c=new Ee;c.sourceValue=s.sourceEnumValue,c.targetValue=s.selectedTargetEnumValue,r.lookupEntry.push(c)}}}else e.errorNoTable(t,n)}},e}(),je=function(){function e(){}return e.generateMappingDigest=function(e,t){var n={exportMappings:{value:""},exportMeta:[],exportBlockData:[]},i=JSON.stringify(t);i&&(n.exportMappings.value=P.sanitizeJSON(i));for(var a,r=x(e.getAllDocs());!(a=r()).done;){var o=a.value;o.isPropertyOrConstant||(n.exportMeta.push({name:o.name,dataSourceType:o.type,id:o.id,inspectionType:o.inspectionType,inspectionParameters:o.inspectionParameters,isSource:o.isSource}),n.exportBlockData.push({value:o.inspectionSource}))}return n},e}(),ke=function(){function e(){}return e.updateMappingsFromDocuments=function(t){for(var n,i=x(t.mappings.mappings);!(n=i()).done;){var a=n.value;e.updateMappedFieldsFromDocuments(a,t,!0),e.updateMappedFieldsFromDocuments(a,t,!1)}for(var r,o=x(t.getAllDocs());!(r=o()).done;){var l=r.value;null==l.id&&(l.id="DOC."+l.name+"."+Math.floor(1e6*Math.random()+1).toString())}},e.updateMappedFieldsFromDocuments=function(n,i,a){for(var r,o=n.getMappedFields(a),l=-1,s=x(o);!(r=s()).done;){var c=r.value,u=null;if(l+=1,!(c.field instanceof U||void 0===c.mappingField)){if(e.isPropertyField(c.mappingField))u=a?i.sourcePropertyDoc:i.targetPropertyDoc,c.mappingField.docId&&(u.id=c.mappingField.docId);else if(e.isConstantField(c.mappingField))u=i.constantDoc,c.mappingField.docId&&(u.id=c.mappingField.docId);else{if(null==c.mappingField.docId){i.errorService.addError(new G({message:"Could not find doc ID for mapped field "+c.mappingField.name,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL}));continue}if(null==(u=i.getDocForIdentifier(c.mappingField.docId,a))){null!=c.mappingField.name&&i.errorService.addError(new G({message:"Could not find document for mapped field '"+c.mappingField.name+"' with ID "+c.mappingField.docId,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL}));continue}u.id=c.mappingField.docId}if(c.mappingField.path){if(c.field=u.getField(c.mappingField.path),null==c.field)if(c.mappingField.path.indexOf("<0>")>=0)c.field=u.getField(c.mappingField.path.replace("<0>","<>"));else if(e.isConstantField(c.mappingField)&&c.mappingField.value&&c.mappingField.fieldType){var p=i.constantDoc.getField(c.mappingField.value);p||(p=new R),p.value=c.mappingField.value,p.type=c.mappingField.fieldType,p.displayName=p.value,p.name=p.value,p.path=p.value,p.userCreated=!0,c.field=p,u.addField(p)}else{if(!(e.isPropertyField(c.mappingField)&&c.mappingField.fieldType&&c.mappingField.name&&c.mappingField.path))return void i.errorService.addError(new G({message:"Could not find field from document '"+u.name+"' for mapped field '"+c.mappingField.name+"'",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:{mappedField:c,doc:u}}));var d=c.mappingField,f=u.getField(d.path);f||(f=new R);var m=d.name;f.type=d.fieldType,d.scope&&(f.scope=d.scope),f.displayName=m,f.name=m,f.path=d.path,f.userCreated=!0,c.field=f,u.addField(f)}var g=+c.mappingField.index;o=n.getMappedFields(a),g<=l?o[l]=c:i.mappingService.addPlaceholders(g-l,n,l,a)}}}},e.removeStaleMappings=function(e){for(var t,n=0,i=[],a=x(e.getDocs(!0));!(t=a()).done;)i=i.concat(R.getFieldPaths(t.value.getAllFields()));for(var r,o=[],l=x(e.getDocs(!1));!(r=l()).done;)o=o.concat(R.getFieldPaths(r.value.getAllFields()));for(;n<e.mappings.mappings.length;)this.isMappingStale(e.mappings.mappings[n],i,o)?e.mappings.mappings.splice(n,1):n++},e.isMappingStale=function(e,t,n){for(var i,a=x(e.getFields(!0));!(i=a()).done;){var r=i.value;if(!(r instanceof U)&&-1===t.indexOf(r.path))return!0}for(var o,l=x(e.getFields(!1));!(o=l()).done;){var s=o.value;if(!(s instanceof U)&&-1===n.indexOf(s.path))return!0}return!1},e.updateDocumentNamespacesFromMappings=function(e){for(var n,i=e.getDocs(!1),a=x(e.mappings.parsedDocs);!(n=a()).done;){var r=n.value;if(r&&!r.isSource&&0!==r.namespaces.length){var o=this.getDocById(r.id,i);null!=o?o.namespaces=[].concat(r.namespaces):e.errorService.addError(new G({message:"Could not find document with identifier '"+r.id+"' for namespace override.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:{identifier:r.id,parsedDoc:r,docs:i}}))}}},e.getDocById=function(e,t){if(null==e||null==t||!t.length)return null;for(var n,i=x(t);!(n=i()).done;){var a=n.value;if(a.id===e)return a}return null},e.activeMapping=function(e){var t;return!(null==e||null===(t=e.mappings)||void 0===t||!t.activeMapping)},e.hasFieldAction=function(e){for(var t,n=x(e);!(t=n()).done;)if(t.value.actions.length>0)return!0;return!1},e.hasMappedCollection=function(e,t){var n=e.getMappedFields(t);return e.isFullyMapped()&&n[0].field&&n[0].field.isInCollection()},e.isPropertyField=function(e){return"io.atlasmap.v2.PropertyField"===(null==e?void 0:e.jsonType)},e.isConstantField=function(e){return"io.atlasmap.v2.ConstantField"===(null==e?void 0:e.jsonType)},e}(),Le=function(){function e(){}return e.serializeMappings=function(n,i){void 0===i&&(i=!0);for(var a,r=n.mappings,o=[],l=x(r.mappings.filter((function(e){return e.isFullyMapped()})));!(a=l()).done;){var s=a.value;try{var c=e.serializeFieldMapping(n,s,s.uuid,i);c&&(o=o.concat(c))}catch(e){n.errorService.addError(new G({message:"Caught exception while attempting to serialize mapping, skipping. ",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:{input:{mapping:s,"mapping def":r},error:e}}))}}var u=e.serializeLookupTables(n.mappings),p=e.serializeConstants(n.constantDoc),d=e.serializeProperties(n.sourcePropertyDoc),f=e.serializeProperties(n.targetPropertyDoc);return{AtlasMapping:{jsonType:"io.atlasmap.v2.AtlasMapping",dataSource:e.serializeDocuments(n.sourceDocs.concat(n.targetDocs),r),mappings:{mapping:this.sortMappings(n,o)},name:n.mappings.name?n.mappings.name:void 0,version:n.mappings.version,lookupTables:{lookupTable:u},constants:{constant:p},properties:{property:d.concat(f)}}}},e.sortMappings=function(e,t){var n=[];if(t.length>0)for(var i=0;i<e.targetDocs[0].fieldPaths.length&&n.length<t.length;i++)!function(){var a=e.targetDocs[0].fieldPaths[i],r=t.find((function(e){return e.outputField[0].path===a}));r&&n.push(r)}();return n},e.serializeFieldMapping=function(n,i,a,r){void 0===r&&(r=!0);var o,l=e.serializeFields(i,!0,n,r),s=e.serializeFields(i,!1,n,r),c=n.expressionService.getMappingExpressionStr(!1,i);if(i.transition.isManyToOneMode()||i.transition.isForEachMode()||i.transition.isExpressionMode()){var u=[];i.transition.transitionFieldAction&&(u[0]=this.serializeAction(i.transition.transitionFieldAction,n));var p={jsonType:"io.atlasmap.v2.FieldGroup",actions:u,field:l};o=c.length>0?{jsonType:"io.atlasmap.v2.Mapping",id:a,expression:c,inputFieldGroup:p,outputField:s}:{jsonType:"io.atlasmap.v2.Mapping",id:a,inputFieldGroup:p,outputField:s}}else{if(i.transition.isOneToManyMode()&&i.transition.transitionFieldAction){var d=this.serializeAction(i.transition.transitionFieldAction,n);l[0].actions||(l[0].actions=[]),d&&l[0].actions.unshift(d)}var f;if(c.length>0)if(null!==(f=l[0].jsonType)&&void 0!==f&&f.includes("FieldGroup")){for(var m=l[0],g=1;g<l.length;g++){var v;if(null!==(v=l[g].jsonType)&&void 0!==v&&v.includes("FieldGroup")){var h,E=l[0],y=l[g];y.field&&E.field&&y.field[0].path===E.field[0].path&&(null===(h=m.field)||void 0===h||h.push(y.field[0]))}}o={jsonType:"io.atlasmap.v2.Mapping",id:a,expression:c,inputFieldGroup:m,outputField:s}}else o={jsonType:"io.atlasmap.v2.Mapping",id:a,expression:c,inputField:l,outputField:s};else o={jsonType:"io.atlasmap.v2.Mapping",id:a,inputField:l,outputField:s}}return i.transition.isEnumerationMode()&&(o.mappingType=t.MappingType.LOOKUP,i.transition.lookupTableName&&(o.lookupTableName=i.transition.lookupTableName)),o},e.extractCheckVersion=function(e,n){var i=n.initializationService.getUIVersion(),a=this.deserializeAtlasMappingVersion(e),r=a.split("."),o=i.split(".");(a.length>0&&(o.length<2||r.length<2)||+o[0]<+r[0]||+o[1]<+r[1])&&n.errorService.addError(new G({message:"Mappings file version mismatch.  Expected "+i+", detected "+a,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER})),n.mappings.version=i},e.deserializeMappingServiceJSON=function(t,n){try{for(var i,a=x(e.deserializeConstants(t));!(i=a()).done;)n.constantDoc.addField(i.value);for(var r,o=x(e.deserializeProperties(n,t,!0));!(r=o()).done;)n.sourcePropertyDoc.addField(r.value);for(var l,s=x(e.deserializeProperties(n,t,!1));!(l=s()).done;)n.targetPropertyDoc.addField(l.value);n.mappings||(n.mappings=new Fe),n.mappings.name=this.deserializeAtlasMappingName(t),this.extractCheckVersion(t,n),n.mappings.parsedDocs=n.mappings.parsedDocs.concat(e.deserializeDocs(t,n.mappings)),n.mappings.mappings=n.mappings.mappings.concat(e.deserializeMappings(t,n));for(var c,u=x(e.deserializeLookupTables(t));!(c=u()).done;)n.mappings.addTable(c.value);return Promise.resolve()}catch(e){return Promise.reject(e)}},e.deserializeAtlasMappingName=function(e){var t;return null!=e&&null!==(t=e.AtlasMapping)&&void 0!==t&&t.name?e.AtlasMapping.name:""},e.deserializeAtlasMappingVersion=function(e){var t;return null!=e&&null!==(t=e.AtlasMapping)&&void 0!==t&&t.version?e.AtlasMapping.version:""},e.addInputFieldGroupFields=function(t,n,i){for(var a,r=x(t);!(a=r()).done;){var o=a.value;"COMPLEX"===o.fieldType?e.addInputFieldGroupFields(o.field,n,i):e.deserializeMappedField(n,o,!0,i)}},e.deserializeFieldMapping=function(n,i){var a=new Me;a.uuid=n.id,a.sourceFields=[],a.targetFields=[],a.referenceFields=[],a.transition.mode=t.TransitionMode.ONE_TO_ONE;var r="LOOKUP"===n.mappingType||null!=n.lookupTableName;if(n.mappingType&&n.mappingType!==t.MappingType.NONE)return this.deserializeFieldMappingFromType(a,n,i),a;if(n.inputFieldGroup)e.deserializeInputFieldGroup(n,a,i);else{var o,l=n.inputField;if(l)for(var s,c=x(l);!(s=c()).done;)e.deserializeMappedField(a,s.value,!0,i);null!==(o=n.outputField)&&void 0!==o&&o.length&&n.outputField.length>1&&(a.transition.mode=t.TransitionMode.ONE_TO_MANY),i.mappings&&ke.updateMappedFieldsFromDocuments(a,i,!0)}n.expression&&n.expression.length>0&&(a.transition.enableExpression=!0,a.transition.mode=t.TransitionMode.EXPRESSION,a.transition.expression=new $(a,i),a.transition.expression.insertText(n.expression));for(var u,p=x(n.outputField);!(u=p()).done;)e.deserializeMappedField(a,u.value,!1,i);return ke.updateMappedFieldsFromDocuments(a,i,!1),r&&(a.transition.lookupTableName=n.lookupTableName,a.transition.mode=t.TransitionMode.ENUM),a},e.deserializeInputFieldGroup=function(n,i,a){if(n.inputFieldGroup&&(n.expression&&n.inputFieldGroup.fieldType===t.FieldType.COMPLEX&&(i.transition.expression.hasComplexField=!0),i.transition.mode=t.TransitionMode.MANY_TO_ONE,e.addInputFieldGroupFields(n.inputFieldGroup.field,i,a),ke.updateMappedFieldsFromDocuments(i,a,!0),n.inputFieldGroup.actions)){var r,o,l;null!==(r=n.inputFieldGroup.actions[0])&&void 0!==r&&r.delimiter&&(i.transition.delimiter=null===(o=Se.delimiterToModel(null===(l=n.inputFieldGroup.actions[0])||void 0===l?void 0:l.delimiter))||void 0===o?void 0:o.delimiter);var s=n.inputFieldGroup.actions[0];if(s)if(s.Expression||"Expression"===s["@type"])i.transition.enableExpression=!0,i.transition.mode=t.TransitionMode.EXPRESSION,i.transition.expression=new $(i,a),i.transition.expression.insertText(s.Expression?s.Expression.expression:s.expression);else{i.transition.mode=t.TransitionMode.MANY_TO_ONE;var c=this.parseAction(s);c.definition=a.fieldActionService.getActionDefinitionForName(c.name,t.Multiplicity.MANY_TO_ONE),i.transition.transitionFieldAction=c}}},e.deserializeAudits=function(e,n){var i=[];if(null==e||!e.audit)return i;for(var a,r=x(e.audit);!(a=r()).done;){var o=a.value;i.push(new G({message:o.status+"["+o.path+"]: "+o.message,level:t.ErrorLevel[o.status],scope:t.ErrorScope.MAPPING,type:n,object:o.value}))}return i},e.createInputFieldGroup=function(e,n,i,a){var r={jsonType:"io.atlasmap.v2.FieldGroup",actions:[],docId:i,path:a,field:e};return n&&(r.fieldType=t.FieldType.COMPLEX),r},e.serializeDocuments=function(e,n){for(var i,a=[],r=x(e);!(i=r()).done;){var o=i.value,l={jsonType:"io.atlasmap.v2.DataSource",id:o.id,name:o.name,description:o.description,uri:o.uri,dataSourceType:o.isSource?t.DataSourceType.SOURCE:t.DataSourceType.TARGET};if(null!=o.characterEncoding&&(l.characterEncoding=o.characterEncoding),null!=o.locale&&(l.locale=o.locale),o.type===t.DocumentType.XML||o.type===t.DocumentType.XSD){var s=l;s.jsonType="io.atlasmap.xml.v2.XmlDataSource";for(var c,u=[],p=x(o.namespaces);!(c=p()).done;){var d=c.value;u.push({alias:d.alias,uri:d.uri,locationUri:d.locationUri,targetNamespace:d.isTarget})}!o.isSource&&n.templateText&&(s.template=n.templateText),s.xmlNamespaces={xmlNamespace:u}}else if(o.type===t.DocumentType.JSON){var f=l;!o.isSource&&n.templateText&&(f.template=n.templateText),f.jsonType="io.atlasmap.json.v2.JsonDataSource"}a.push(l)}return a},e.serializeConstants=function(e){for(var t,n=[],i=x(e.fields);!(t=i()).done;){var a=t.value;n.push({name:a.name,value:a.value,fieldType:a.type})}return n},e.serializeProperties=function(e){for(var n,i=[],a=x(e.fields);!(n=a()).done;){var r=n.value;i.push({name:r.name,fieldType:r.type,scope:r.scope,dataSourceType:e.isSource?t.DataSourceType.SOURCE:t.DataSourceType.TARGET})}return i},e.serializeLookupTables=function(e){var t=[],n=e.getTables();if(!n||!n.length)return t;for(var i,a=x(n);!(i=a()).done;){for(var r,o=i.value,l=[],s=x(o.lookupEntry);!(r=s()).done;){var c=r.value;l.push({sourceValue:c.sourceValue,sourceType:c.sourceType,targetValue:c.targetValue,targetType:c.targetType})}t.push({lookupEntry:l,name:o.name})}return t},e.processCollectionPreview=function(t,n,i){n.path=t.path.replace("<>","<0>");var a=e.createInputFieldGroup([n],!0,t.docDef.id,t.path);i.push(a)},e.processActionArguments=function(e,n){var i={};if(null===e)return i;for(var a,r=x(e.argumentValues);!(a=r()).done;){var o,l=a.value;if(null===(o=e.definition)||void 0===o||!o.isCustom||!["methodName","className","name"].includes(l.name)){i[l.name]=l.value;var s=e.definition.getArgumentForName(l.name);null!=s?"INTEGER"===s.type&&(i[l.name]=parseInt(l.value,10)):n.errorService.addError(new G({message:"Cannot find action argument "+l.name+": "+l.value,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:e}))}}return i},e.serializeFields=function(n,i,a,r){void 0===r&&(r=!1);for(var o,l=null,s=null,c=[],u=x(n.getMappedFields(i));!(o=u()).done;){var p,d=o.value;if(d.field&&!d.isPadField()){var f=d.field,m={jsonType:f.documentField.jsonType,name:f.name,path:f.path,fieldType:f.type,docId:f.docDef.id};null!==(p=f.documentField.jsonType)&&void 0!==p&&p.includes("io.atlasmap.xml.v2")&&(m.attribute=f.isAttribute),r&&!f.isConstant()||(m.value=f.value?f.value:""),f.docDef.type===t.DocumentType.XML||f.docDef.type===t.DocumentType.XSD?m.userCreated=f.userCreated:f.docDef.type!==t.DocumentType.JAVA||f.isPrimitive||(m.className=f.classIdentifier),f.isProperty()?(m.jsonType="io.atlasmap.v2.PropertyField",m.name=f.name,m.scope=f.scope,m.path=a.documentService.getPropertyPath(f.scope,f.name)):f.isConstant()?(m.jsonType="io.atlasmap.v2.ConstantField",m.name=f.name):f.enumeration&&(m.jsonType=f.docDef.type===t.DocumentType.JSON?"io.atlasmap.json.v2.JsonEnumField":f.docDef.type===t.DocumentType.XML||f.docDef.type===t.DocumentType.XSD?"io.atlasmap.xml.v2.XmlEnumField":"io.atlasmap.java.v2.JavaEnumField");var g=n.getMappedFields(i).length>1;if((g=g||n.transition.isExpressionMode()&&i)&&(m.index=n.getIndexForMappedField(d)-1),f.docDef.type===t.DocumentType.CSV&&(m.column=f.column),this.serializeActions(a,d,m),i&&f.isInCollection()){var v=f.getCollectionParentField();if(n.referenceFieldExists(v.docDef.id,v.path)){if(null!==s){s.field.push(m);continue}(s=e.createInputFieldGroup([m],!0,v.docDef.id,v.path)).fieldType=v.documentField.fieldType,r?c.push(s):(s.path=v.path.replace("<>","<0>"),null===l&&(l=e.createInputFieldGroup([s],!0,v.docDef.id,v.path),s.fieldType=v.documentField.fieldType,c.push(l)))}else r?(c.push(m),l=null):e.processCollectionPreview(f,m,c)}else c.push(m),l=null}}return c},e.serializeActions=function(e,t,n){if(t.actions.length){for(var i,a=[],r=x(t.actions);!(i=r()).done;){var o=this.serializeAction(i.value,e);o&&a.push(o)}a.length>0&&(n.actions=a)}},e.serializeAction=function(t,n){var i=e.processActionArguments(t,n);return i["@type"]=t.definition.name,i},e.deserializeDocs=function(e,t){var n=[];if(!e||!e.AtlasMapping||!e.AtlasMapping.dataSource)return null;for(var i,a=x(e.AtlasMapping.dataSource);!(i=a()).done;){var r=i.value,o=new V;o.isSource="SOURCE"===r.dataSourceType,o.uri=r.uri,o.id=r.id,o.name=r.name?r.name:"",o.description=r.description;var l=r;if(l.xmlNamespaces&&l.xmlNamespaces.xmlNamespace)for(var s,c=x(l.xmlNamespaces.xmlNamespace);!(s=c()).done;){var u=s.value,p=new L;p.alias=u.alias,p.uri=u.uri,p.locationUri=u.locationUri,p.isTarget=!!u.targetNamespace&&u.targetNamespace,p.createdByUser=!0,o.namespaces.push(p)}l.template&&(t.templateText=l.template),n.push(o)}return n},e.deserializeMappings=function(t,n){var i,a=[];if(null===(i=t.AtlasMapping.mappings)||void 0===i||!i.mapping)return a;for(var r,o=x(t.AtlasMapping.mappings.mapping);!(r=o()).done;){var l=r.value;if("io.atlasmap.v2.Collection"===l.jsonType)for(var s,c=x(l.mappings.mapping);!(s=c()).done;)a.push(e.deserializeFieldMapping(s.value,n));else a.push(e.deserializeFieldMapping(l,n))}return a},e.deserializeFieldMappingFromType=function(n,i,a){"SEPARATE"===i.mappingType?(n.transition.mode=t.TransitionMode.ONE_TO_MANY,n.transition.transitionFieldAction=ne.create(a.fieldActionService.getActionDefinitionForName("Split",t.Multiplicity.ONE_TO_MANY)),n.transition.transitionFieldAction.setArgumentValue("delimiter",i.delimiter)):"LOOKUP"===i.mappingType?(n.transition.mode=t.TransitionMode.ENUM,n.transition.lookupTableName=i.lookupTableName):"COMBINE"===i.mappingType?(n.transition.mode=t.TransitionMode.MANY_TO_ONE,n.transition.transitionFieldAction=ne.create(a.fieldActionService.getActionDefinitionForName("Concatenate",t.Multiplicity.MANY_TO_ONE)),n.transition.transitionFieldAction.setArgumentValue("delimiter",i.delimiter)):n.transition.mode=t.TransitionMode.ONE_TO_ONE;for(var r,o=x(i.inputField);!(r=o()).done;)e.deserializeMappedField(n,r.value,!0,a);for(var l,s=x(i.outputField);!(l=s()).done;)e.deserializeMappedField(n,l.value,!1,a);ke.updateMappedFieldsFromDocuments(n,a,!0)},e.deserializeConstants=function(e){var t,n,i=[];if(null==e||null===(t=e.AtlasMapping)||void 0===t||null===(n=t.constants)||void 0===n||!n.constant)return i;for(var a,r=x(e.AtlasMapping.constants.constant);!(a=r()).done;){var o=a.value,l=new R;l.name=o.name,l.path="/"+l.name,l.value=o.value,l.type=o.fieldType,l.userCreated=!0,l.isAttribute=!1,i.push(l)}return i},e.deserializeProperties=function(e,n,i){var a,r,o=[];if(null==n||null===(a=n.AtlasMapping)||void 0===a||null===(r=a.properties)||void 0===r||!r.property)return o;for(var l,s=x(n.AtlasMapping.properties.property);!(l=s()).done;){var c=l.value;if(!(i&&c.dataSourceType===t.DataSourceType.TARGET||!i&&c.dataSourceType!==t.DataSourceType.TARGET)){var u=new R;u.name=c.name,u.type=c.fieldType,u.scope=c.scope,u.path=e.documentService.getPropertyPath(u.scope,u.name),u.userCreated=!0,u.isAttribute=!1,o.push(u)}}return o},e.deserializeLookupTables=function(e){var t=[];if(!(e&&e.AtlasMapping&&e.AtlasMapping.lookupTables&&e.AtlasMapping.lookupTables.lookupTable))return t;for(var n,i=x(e.AtlasMapping.lookupTables.lookupTable);!(n=i()).done;){var a=n.value,r=new ye;r.name=a.name;for(var o,l=x(a.lookupEntry);!(o=l()).done;){var s=o.value,c=new Ee;c.sourceValue=s.sourceValue,c.sourceType=s.sourceType,c.targetValue=s.targetValue,c.targetType=s.targetType,r.lookupEntry.push(c)}t.push(r)}return t},e.deserializeFieldActions=function(e,n,i,a,r){if(e.actions)for(var o,l=x(e.actions);!(o=l()).done;){var s=o.value,c=this.parseAction(s);c.definition="CustomAction"===s.name?a.fieldActionService.getActionDefinitionForName(s.argumentValues[0].value,t.Multiplicity.ONE_TO_ONE):a.fieldActionService.getActionDefinitionForName(c.name),null!=c.definition?(c.definition.populateFieldAction(c),r&&(s.Expression||"Expression"===s["@type"])?(i.transition.enableExpression=!0,i.transition.expression=new $(i,a),i.transition.expression.insertText(s.Expression?s.Expression.expression:s.expression)):r&&c.definition&&[t.Multiplicity.ONE_TO_MANY,t.Multiplicity.MANY_TO_ONE].includes(c.definition.multiplicity)?(i.transition.transitionFieldAction&&a.logger.warn("Duplicated multiplicity transformations were detected:               "+i.transition.transitionFieldAction.name+" is being overwritten by "+c.name+" ..."),i.transition.transitionFieldAction=c):n.actions.push(c)):a.errorService.addError(new G({message:"Could not find field action definition for action '"+s.name+"'",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL}))}},e.deserializeMappedField=function(e,n,i,a){if(ke.isConstantField(n))n.docId?a.constantDoc.id=n.docId:n.docId=a.constantDoc.id;else if(ke.isPropertyField(n)){var r=i?a.sourcePropertyDoc:a.targetPropertyDoc;n.docId?r.id=n.docId:n.docId=r.id,n.path=a.documentService.getPropertyPath(n.scope,n.name)}else if(!n.docId)return a.errorService.addError(new G({message:"Parsed mapping field does not have document id, dropping.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:n})),null;var o=new Te;return o.mappingField=n,e.addMappedField(o,i),n.actions&&this.deserializeFieldActions(n,o,e,a,i),o},e.parseAction=function(t){return t["@type"]?e.parseNewAction(t):e.parseOldAction(t)},e.parseOldAction=function(e){for(var t=0,n=Object.keys(e);t<n.length;t++){var i=n[t];if(!e.hasOwnProperty(i))return null;var a=new ne;a.name=i;var r=e[i];if(r)for(var o=0,l=Object.keys(r);o<l.length;o++){var s=l[o];if(!r.hasOwnProperty(s))return null;var c=new ee;c.name=s;var u=r[s];u=null==u?null:u.toString(),c.value=u,a.argumentValues.push(c)}return a}return null},e.parseNewAction=function(e){var t=new ne;t.name=e["@type"];for(var n=0,i=Object.entries(e);n<i.length;n++){var a=i[n],r=a[0],o=a[1];if("@type"!==r){var l=new ee;l.name=r;var s=null==o?null:o.toString();l.value=s,t.argumentValues.push(l)}}return t},e}(),Ue=function(){function e(e){this.api=e,this.MAX_SEARCH_MATCH=1e4}var n=e.prototype;return n.initialize=function(){var e=this;this.mappingUpdatedSubscription=this.cfg.mappingService.mappingUpdated$.subscribe((function(){for(var t,n=x(e.cfg.getAllDocs());!(t=n()).done;){var i=t.value;i.initialized&&i.updateFromMappings(e.cfg.mappings)}}))},n.uninitialize=function(){this.mappingUpdatedSubscription.unsubscribe()},n.inspectDocuments=function(){var e=this;return new f.Observable((function(t){for(var n,i=function(){var i=n.value;if(i===e.cfg.sourcePropertyDoc||i===e.cfg.targetPropertyDoc||i===e.cfg.constantDoc)return i.initialized=!0,"continue";var a=Pe.fromDocumentDefinition(e.cfg,i);e.inspectDocument(a).then((function(){t.next(i)})).catch((function(e){t.error(e)}))},a=x(e.cfg.getAllDocs());!(n=a()).done;)i()}))},n.inspectDocument=function(e){var t=this;return new Promise((function(n,i){var a=e.doc;if(a.inspectionResult){var r=JSON.parse(a.inspectionResult);return e.parseResponse(r),a.initializeFromFields(),a.initialized=!0,void n(a)}if(!e.isOnlineInspectionCapable())return a.initialized=!0,a.errorOccurred=!0,void i(a);var o=e.request;t.cfg.logger.debug("Document Inspection Request: "+JSON.stringify(o.options.json)),t.api.post(o.url,o.options).json().then((function(i){t.cfg.logger.debug("Document Inspection Response: "+JSON.stringify(i)),e.parseResponse(i),a.initializeFromFields(),a.initialized=!0,n(a)})).catch((function(e){t.cfg.errorService.addBackendError("Failed to inspect Document: "+a.name+"("+a.id+")",e),a.errorOccurred=!0,i(e)}))}))},n.getLibraryClassNames=function(){var e=this;return new Promise((function(t,n){if(void 0!==e.cfg.initCfg.baseMappingServiceUrl){var i=e.cfg.initCfg.baseMappingServiceUrl+"library/list";e.cfg.logger.debug("Library Class List Service Request: "+i),e.api.get(i).json().then((function(n){e.cfg.logger.debug("Library Class List Service Response: "+JSON.stringify(n)),t(n.ArrayList)})).catch((function(i){204!==i.status?(e.cfg.errorService.addBackendError("Error occurred while accessing the user uploaded JARs from the runtime service.",i),n(i)):t([])}))}else t([])}))},n.importNonJavaDocument=function(e,n,i,a){var r=this;return new Promise((function(o){try{var l=!1,s=function(e){if(l)return e;var s=void 0;try{if(!(s=f))throw new Error(s)}catch(e){return r.handleError("Unrecognized document suffix ("+f+")"),void o(!1)}r.addNonJavaDocument(c,d+"-"+we.newGuid(),d,s,i?t.InspectionType.SCHEMA:t.InspectionType.INSTANCE,n,a).then((function(e){o(!!e)}))},c="",u=new FileReader;r.cfg.errorService.clearValidationErrors();var p=e.name.split("."),d=p.slice(0,-1).join("."),f=p[p.length-1].toUpperCase(),m=Ne((function(){return Promise.resolve(P.readFile(e,u)).then((function(e){c=e}))}),(function(e){r.cfg.errorService.addError(new G({message:"Unable to import the specified schema document.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER,object:e})),o(!1),l=!0}));return Promise.resolve(m&&m.then?m.then(s):s(m))}catch(e){return Promise.reject(e)}}))},n.importNonJavaDocumentFromEntaxyRegistry=function(e,n,i,a){var r=this;return new Promise((function(o){try{r.cfg.errorService.clearValidationErrors();var l=e.split("/").pop();if(!l)return r.cfg.errorService.addError(new G({message:"Invalid resource name.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER})),o(!1),Promise.resolve();var s=l.split("."),c=s.slice(0,-1).join("."),u=s[s.length-1].toUpperCase();return r.cfg.fileService.getFileContentFromRegistry(e).then((function(e){var l=void 0;try{if(!(l=u))throw new Error(l)}catch(e){return r.handleError("Unrecognized document suffix ("+u+")"),void o(!1)}r.addNonJavaDocument(e,c+"-"+we.newGuid(),c,l,i?t.InspectionType.SCHEMA:t.InspectionType.INSTANCE,n,a).then((function(e){o(!!e)}))})).catch((function(e){r.cfg.errorService.addError(new G({message:"Unable to import the specified schema document content from Entaxy registry.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER,object:e})),o(!1)})),Promise.resolve()}catch(e){return Promise.reject(e)}}))},n.importJavaDocument=function(e,n,i,a){return void 0===i&&(i=t.CollectionType.NONE),this.cfg.errorService.clearValidationErrors(),this.addJavaDocument(e,n,i,a)},n.addNonJavaDocument=function(e,t,n,i,a,r,o){var l=Pe.fromNonJavaProperties(this.cfg,t,n,i,a,e,r,o);return this.doAddDocument(l)},n.addJavaDocument=function(e,n,i,a){void 0===i&&(i=t.CollectionType.NONE);var r=Pe.fromJavaProperties(this.cfg,e,n,i,a);return this.doAddDocument(r)},n.addDocument=function(e,n,i,a,r,o,l){return a===t.DocumentType.JAVA?this.addJavaDocument(n,o):this.addNonJavaDocument(e,n,i,a,r,o,l)},n.doAddDocument=function(e){var t=this;return new Promise((function(n){try{var i=e.doc,a=i.isSource;return t.inspectDocument(e).then((function(e){try{return 0===e.fields.length&&P.removeItemFromArray(i,a?t.cfg.sourceDocs:t.cfg.targetDocs),i.updateFromMappings(t.cfg.mappings),n(!0),Promise.resolve()}catch(e){return Promise.reject(e)}})).catch((function(e){var a;null===(a=t.cfg.logger)||void 0===a||a.error("Failed to inspect Document "+i.name+"("+i.id+")",e),i.errorOccurred=!0,n(!1)})),Promise.resolve()}catch(e){return Promise.reject(e)}}))},n.handleError=function(e,n){this.cfg.errorService.addError(new G({message:e,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:n}))},n.filterDocumentFields=function(e,n){for(var i,a=J.getConfig(),r=void 0===e||""===e,o=r,l=x(a.getDocs(n));!(i=l()).done;){var s=i.value;s.visibleInCurrentDocumentSearch=o;for(var c,u=x(s.getAllFields());!(c=u()).done;)c.value.visibleInCurrentDocumentSearch=o;if(!r)for(var p,d=0,f=x(s.getAllFields());!(p=f()).done;){var m=p.value;if((!m.visibleInCurrentDocumentSearch||m.collapsed)&&(m.visibleInCurrentDocumentSearch=m.name.toLowerCase().includes(e.toLowerCase()),m.visibleInCurrentDocumentSearch)){s.visibleInCurrentDocumentSearch=!0;for(var g=m.parentField;null!=g&&!g.visibleInCurrentDocumentSearch;)g.visibleInCurrentDocumentSearch=!0,g.collapsed=!1,g=g.parentField,d++;try{this.markChildrenVisible(m)}catch(e){a.errorService.addError(new G({message:e.message,level:t.ErrorLevel.INFO,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER}));break}if(d++>=this.MAX_SEARCH_MATCH){a.errorService.addError(new G({message:"The maximum number of fields matching the specified search filter has beeen exceeded  Try using a longer field filter.",level:t.ErrorLevel.INFO,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER}));break}}}}a.mappingService.notifyLineRefresh()},n.markChildrenVisible=function(e){e.visibleInCurrentDocumentSearch=!0,e.collapsed=!1;for(var t,n=x(e.children);!(t=n()).done;)this.markChildrenVisible(t.value)},n.createConstant=function(e,n,i,a){var r=this.cfg.constantDoc.getField("/"+e);r||(r=new R),r.name=e,r.path="/"+e,r.value=n,r.type=t.FieldType[i],r.docDef=this.cfg.constantDoc,r.userCreated=!0,this.cfg.constantDoc.addField(r),a&&this.cfg.mappingService.addFieldToActiveMapping(r),this.cfg.mappingService.notifyMappingUpdated()},n.deleteConstant=function(e){var t,n,i=this.cfg.constantDoc.getField("/"+e);if(i){this.cfg.mappingService.removeFieldFromAllMappings(i),this.cfg.constantDoc.removeField(i);var a=null===(t=this.cfg.mappings)||void 0===t?void 0:t.activeMapping,r=null==a||null===(n=a.transition)||void 0===n?void 0:n.expression;a&&r&&r.updateFieldReference(a),this.cfg.mappingService.notifyMappingUpdated()}},n.editConstant=function(e,n,i,a){var r=this.cfg.constantDoc.getField("/"+(a||e));r&&(i.length>0&&(r.type=t.FieldType[i]),n.length>0&&(r.value=n),a&&a!==e&&(r.name=e,r.path="/"+e,this.cfg.constantDoc.updateField(r,"/"+e)),this.cfg.mappingService.notifyMappingUpdated())},n.getConstantType=function(e){var n=J.getConfig().constantDoc.getField("/"+e);return n?n.type:t.FieldType.NONE},n.getConstantTypeIndex=function(e){var t=J.getConfig().constantDoc.getField("/"+e);if(!t)return 0;for(var n=0;n<C.length;n++)if(C[n].includes(t.type))return n;return 0},n.createProperty=function(e,n,i,a,r){var o=J.getConfig(),l=this.getPropertyPath(i,e),s=a?o.sourcePropertyDoc.getField(l):o.targetPropertyDoc.getField(l);s||(s=new R),s.name=e,s.type=t.FieldType[n],s.scope=i,s.path=l,s.userCreated=!0,a?(s.docDef=o.sourcePropertyDoc,o.sourcePropertyDoc.addField(s)):(s.docDef=o.targetPropertyDoc,o.targetPropertyDoc.addField(s)),r&&this.cfg.mappingService.addFieldToActiveMapping(s),o.mappingService.notifyMappingUpdated()},n.deleteProperty=function(e,t,n){var i,a,r=this.getPropertyPath(t,e),o=n?this.cfg.sourcePropertyDoc.getField(r):this.cfg.targetPropertyDoc.getField(r);if(o){this.cfg.mappingService.removeFieldFromAllMappings(o),n?this.cfg.sourcePropertyDoc.removeField(o):this.cfg.targetPropertyDoc.removeField(o);var l=null===(i=this.cfg.mappings)||void 0===i?void 0:i.activeMapping,s=null==l||null===(a=l.transition)||void 0===a?void 0:a.expression;l&&s&&s.updateFieldReference(l),this.cfg.mappingService.notifyMappingUpdated()}},n.editProperty=function(e,n,i,a,r,o){var l=this.getPropertyPath(i,e),s=a?this.cfg.sourcePropertyDoc.getField(l):this.cfg.targetPropertyDoc.getField(l);s&&(r&&(s.name=r),o&&(s.scope=o),s.type=t.FieldType[n],s.path=this.getPropertyPath(s.scope,s.name),a?this.cfg.sourcePropertyDoc.updateField(s,l):this.cfg.targetPropertyDoc.updateField(s,l),this.cfg.mappingService.notifyMappingUpdated())},n.getPropertyType=function(e,n,i){var a=i?this.cfg.sourcePropertyDoc.getField(this.getPropertyPath(n,e)):this.cfg.targetPropertyDoc.getField(this.getPropertyPath(n,e));return a?a.type:t.FieldType.NONE},n.getPropertyTypeIndex=function(e,t,n){var i=n?this.cfg.sourcePropertyDoc.getField(this.getPropertyPath(t,e)):this.cfg.targetPropertyDoc.getField(this.getPropertyPath(t,e));if(!i)return 0;for(var a=0;a<O.length;a++)if(O[a].includes(i.type))return a;return 0},n.getPropertyPath=function(e,t){var n="/";return e&&e.length>0&&(n+=e+"/"),n+t},e}(),Ve=function(){function e(){this.errors=[],this.formErrors=[],this.errorUpdatedSource=new f.Subject}e.filterWith=function(e,t,n){return e&&0!==e.length?e.filter((function(e){return(!e.mapping||t&&e.mapping===t)&&(!n||!e.level||e.level===n)})):[]};var n=e.prototype;return n.addError=function(){for(var e=this,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];i.forEach((function(n){n.object&&n.object.message&&(n.message+="\n"+n.object.message);var i=t.ErrorScope.FORM===n.scope?e.formErrors:e.errors;i.find((function(e){return e.message===n.message}))&&n.level!==t.ErrorLevel.INFO||i.unshift(n)})),this.emitUpdatedEvent()},n.addBackendError=function(e,n){this.addError(new G(0===(null==n?void 0:n.status)?{message:"Fatal network error: Unable to connect to the AtlasMap design runtime service.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:n}:{message:e,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:n}))},n.getErrors=function(){return Object.assign([],this.errors)},n.removeError=function(e,n){n===t.ErrorScope.FORM&&this.formErrorUpdatedSource&&!this.formErrorUpdatedSource.closed?this.formErrors=this.excludeByIdentifier(this.formErrors,e):this.errors=this.excludeByIdentifier(this.errors,e),this.emitUpdatedEvent()},n.resetAll=function(){this.clearAllErrors(),this.formErrors=[],this.formErrorUpdatedSource&&!this.formErrorUpdatedSource.closed&&this.formErrorUpdatedSource.complete()},n.clearAllErrors=function(){this.errors=[],this.emitUpdatedEvent()},n.clearPreviewErrors=function(){this.errors=this.errors.filter((function(e){return e.type!==t.ErrorType.PREVIEW})),this.emitUpdatedEvent()},n.clearValidationErrors=function(e){this.errors=this.errors.filter((function(n){return!(n.type===t.ErrorType.VALIDATION||e&&n.mapping&&n.mapping===e)})),this.emitUpdatedEvent()},n.clearFieldErrors=function(){this.errors=this.errors.filter((function(e){return e.scope!==t.ErrorScope.FIELD})),this.emitUpdatedEvent()},n.clearFormErrors=function(){this.formErrors=[],this.emitUpdatedEvent(t.ErrorScope.FORM)},n.subscribe=function(e){return this.errorUpdatedSource.subscribe(e)},n.createFormErrorChannel=function(){var e=this;return this.formErrorUpdatedSource&&!this.formErrorUpdatedSource.closed&&this.formErrorUpdatedSource.complete(),this.formErrors=[],this.formErrorUpdatedSource=new f.Subject,this.formErrorUpdatedSource.subscribe({complete:function(){return e.formErrors=[]}}),this.formErrorUpdatedSource},n.isRequiredFieldValid=function(e,n){return null!=e&&""!==e||(this.addError(new G({message:n+" is required.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.FORM})),this.emitUpdatedEvent(t.ErrorScope.FORM),!1)},n.emitUpdatedEvent=function(e){t.ErrorScope.FORM===e?this.formErrorUpdatedSource&&!this.formErrorUpdatedSource.closed&&this.formErrorUpdatedSource.next(this.formErrors):this.errorUpdatedSource.next(this.errors)},n.excludeByIdentifier=function(e,t){return e.filter((function(e){return e.identifier!==t}))},e}(),ze=function(){function e(e){var n;this.api=e,this.cfg=J.getConfig(),this.actions=((n={})[t.Multiplicity.ONE_TO_ONE]=[],n[t.Multiplicity.ONE_TO_MANY]=[],n[t.Multiplicity.MANY_TO_ONE]=[],n[t.Multiplicity.ZERO_TO_ONE]=[],n[t.Multiplicity.MANY_TO_MANY]=[],n),this.isInitialized=!1,this.headers={"Content-Type":"applicaton/json; param1=application/octet-stream",Accept:"applicaton/json, application/octet-stream"}}var n=e.prototype;return n.fetchFieldActions=function(){try{var e=this;return Promise.resolve(new Promise((function(n){if(e.cfg.preloadedFieldActionMetadata){if(e.clearActionDefinitions(),e.cfg.preloadedFieldActionMetadata.ActionDetails)for(var i,a=x(e.cfg.preloadedFieldActionMetadata.ActionDetails.actionDetail);!(i=a()).done;){var r=e.extractFieldActionDefinition(i.value);r.multiplicity?"Expression"!==r.name&&e.actions[r.multiplicity].push(r):e.cfg.logger.info("Field action ("+r.name+") is missing multiplicity, ingoring")}return e.sortFieldActionDefinitions(),e.isInitialized=!0,void n(!0)}if(null==e.cfg.mappingService||null==e.cfg.initCfg.baseMappingServiceUrl)return e.cfg.errorService.addError(new G({message:"Mapping service URL is not provided. Field Actions will not be used.",level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL})),e.isInitialized=!0,void n(!1);e.doFetchFieldActions().then((function(t){1===t.length&&(e.cfg.logger.info("No field action was returned from backend"),n(!1)),e.clearActionDefinitions(),t.forEach((function(t){t.multiplicity?"Expression"!==t.name&&e.actions[t.multiplicity].push(t):e.cfg.logger.info("Field action  ("+t.name+") is missing multiplicity, ignoring")})),e.sortFieldActionDefinitions(),e.isInitialized=!0,n(!0)})).catch((function(t){e.cfg.errorService.addBackendError("Could not load field action configs: ("+t.message+")",t),n(!1)}))})))}catch(e){return Promise.reject(e)}},n.getActionDefinitionForName=function(e,t){if(!this.actions||!e)return null;var n=[];t?n=this.actions[t]:Object.values(this.actions).forEach((function(e){return n=n.concat(e)}));for(var i,a=x(n);!(i=a()).done;){var r=i.value;if(e===r.name)return r}return null},n.getActionsAppliesToField=function(e,n,i){var a=this;return void 0===n&&(n=!0),void 0===i&&(i=t.Multiplicity.ONE_TO_ONE),e&&this.actions?this.actions[i].filter((function(t){return a.appliesToField(t,e,n)})):[]},n.doFetchFieldActions=function(){var e=this;return new Promise((function(t,n){var i=[],a=e.cfg.initCfg.baseMappingServiceUrl+"fieldActions";e.cfg.logger.debug("Field Action Config Request"),e.api.get(a,{headers:e.headers}).json().then((function(n){var a,r;if(e.cfg.logger.debug("Field Action Config Response: "+JSON.stringify(n)),null!=n&&null!==(a=n.ActionDetails)&&void 0!==a&&null!==(r=a.actionDetail)&&void 0!==r&&r.length)for(var o,l=x(n.ActionDetails.actionDetail);!(o=l()).done;){var s=e.extractFieldActionDefinition(o.value);i.push(s)}t(i)})).catch((function(e){n(e)}))}))},n.extractFieldActionDefinition=function(e){this.cfg.logger.trace("Deserializing field action definition: "+JSON.stringify(e));var n=new te;if(n.name=e.name,n.isCustom=e.custom,n.sourceType=e.sourceType,n.targetType=e.targetType,n.method=e.method,n.multiplicity=e.multiplicity,n.serviceObject=e,e.actionSchema)for(var i=0,a=Object.keys(e.actionSchema.properties);i<a.length;i++){var r=a[i],o=e.actionSchema.properties[r];if("@type"!==r){var l=o.type.toUpperCase(),s=l?t.FieldType[l]:t.FieldType.STRING,c=new Q;c.name=r,c.type=s,o.enum&&(c.values=o.enum),c.serviceObject=o,n.arguments.push(c)}else n.name=o.const}return n},n.sortFieldActionDefinitions=function(){var e=this;Object.keys(this.actions).forEach((function(t){var n=e.actions[t],i=[];if(null!=n&&0!==n.length){for(var a,r={},o=[],l=x(n);!(a=l()).done;){var s=a.value,c=s.name,u=r[c];u||(u=[],o.push(c)),u.push(s),r[c]=u}o.sort();for(var p=0,d=o;p<d.length;p++)for(var f,m=x(r[d[p]]);!(f=m()).done;)i.push(f.value);e.actions[t]=i}}))},n.appliesToField=function(e,t,n){if(null==t)return!1;var i=this.getActualField(t,!0),a=this.getActualField(t,!1);return!(n&&null==i||!n&&null==a)&&(n?this.appliesToSourceField(e,t,i):this.appliesToTargetField(e,t,a))},n.getActualField=function(e,t){return e.getFields(t).find((function(e){return"<padding field>"!==e.name}))},n.appliesToSourceField=function(e,t,n){return!!this.matchesDate(e.sourceType,n.type)||!!this.matchesNumeric(e.sourceType,n.type)||"ANY"===e.sourceType||n.type===e.sourceType},n.appliesToTargetField=function(e,n,i){return!(null==i||e.multiplicity!==t.Multiplicity.ONE_TO_ONE||!(this.matchesDate(e.sourceType,i.type)&&this.matchesDate(e.targetType,i.type)||this.matchesNumeric(e.sourceType,i.type)&&this.matchesNumeric(e.targetType,i.type))&&("ANY"!==e.sourceType&&e.sourceType!==i.type||"ANY"!==e.targetType&&i.type!==e.targetType))},n.matchesDate=function(e,t){return"ANY"===e||"ANY_DATE"===e&&-1!==["DATE","DATE_TIME","DATE_TIME_TZ","TIME"].indexOf(t)},n.matchesNumeric=function(e,t){return"ANY"===e||"NUMBER"===e&&-1!==["LONG","INTEGER","FLOAT","DOUBLE","SHORT","BYTE","DECIMAL","NUMBER"].indexOf(t)},n.clearActionDefinitions=function(){var e=this;Object.keys(t.Multiplicity).forEach((function(t){return e.actions[t]=[]}))},e}();(Ie=t.FileName||(t.FileName={})).DIGEST="Mapping digest file",Ie.ADM="ADM archive file",Ie.JAR="Jar file",(xe=t.FileType||(t.FileType={})).DIGEST="GZ",xe.ADM="ZIP",xe.JAR="JAR";var Be=function(){function e(e){this.api=e}var n=e.prototype;return n.findMappingFiles=function(e){var t=this;return new Promise((function(n,i){var a=t.cfg.initCfg.baseMappingServiceUrl+"mappings"+(null==e?"":"?filter="+e);t.cfg.logger.debug("Mapping List Request"),t.api.get(a).json().then((function(e){t.cfg.logger.debug("Mapping List Response: "+JSON.stringify(e)),n(e.StringMap.stringMapEntry.map((function(e){return e.name})))})).catch((function(e){204!==e.status&&(t.cfg.errorService.addBackendError("Error occurred while accessing the current mapping files from the runtime service.",e),i(e))}))}))},n.getCurrentMappingDigest=function(){var e=this;return new Promise((function(n,i){e.getCurrentFile(t.FileName.DIGEST,t.FileType.DIGEST).then((function(e){if(e){var t=m.inflate(e),i=(new v.TextDecoder).decode(t),a=P.objectize(i);n(a)}else n(null)})).catch((function(e){i(e)}))}))},n.getCurrentADMArchive=function(){return this.getCurrentFile(t.FileName.ADM,t.FileType.ADM)},n.getCurrentFile=function(e,t){var n=this;return new Promise((function(i,a){var r=n.cfg.initCfg.baseMappingServiceUrl+"mapping/"+t+"/";n.cfg.logger.debug("Get Current "+e+" Request: "+r),n.api.get(r,{headers:{"Content-Type":"application/octet-stream",Accept:"application/octet-stream","Response-Type":"application/octet-stream"}}).arrayBuffer().then((function(t){n.cfg.logger.debug("Get Current "+e+" Response: "+JSON.stringify(t)),i(t.byteLength?new Uint8Array(t):null)})).catch((function(t){204!==t.status&&(n.cfg.errorService.addBackendError("Error occurred while accessing the "+e+" from the runtime service.",t),a(t))}))}))},n.putFileIntoRegistry=function(e,t){var n=this;return new Promise((function(i,a){var r=encodeURIComponent(e),o=n.cfg.initCfg.baseMappingServiceUrl+"mapping/ntxregistry/"+r;n.cfg.logger.debug("Put file into Entaxy registry, Request: "+o),n.api.put(o,{headers:{"Content-Type":"application/octet-stream",Accept:"application/json","Response-Type":"application/json"},body:t}).arrayBuffer().then((function(e){n.cfg.logger.debug("Put file into Entaxy registry, Response: "+JSON.stringify(e)),i(!0)})).catch((function(e){204!==e.status&&(n.cfg.errorService.addBackendError("Error occurred while putting file into Entaxy registry.",e),a(e))}))}))},n.resetMappings=function(){var e=this;return new Promise((function(t){var n=e.cfg.initCfg.baseMappingServiceUrl+"mapping/RESET";e.cfg.logger.debug("Reset Mappings Request"),e.api.delete(n).arrayBuffer().then((function(n){return e.cfg.logger.debug("Reset Mappings Response: "+JSON.stringify(n)),t(!0),n})).catch((function(n){e.cfg.errorService.addBackendError("Error occurred while resetting mappings.",n),t(!1)}))}))},n.resetLibs=function(){var e=this;return new Promise((function(t){var n=e.cfg.initCfg.baseMappingServiceUrl+"mapping/resetLibs";e.cfg.logger.debug("Reset Libs Request"),e.api.delete(n).arrayBuffer().then((function(n){return e.cfg.logger.debug("Reset Libs Response: "+JSON.stringify(n)),t(!0),n})).catch((function(n){e.cfg.errorService.addBackendError("Error occurred while resetting user-defined JAR libraries.",n),t(!1)}))}))},n.resetAll=function(){var e=this;return new Promise((function(t){e.cfg.errorService.resetAll(),e.cfg.fileService.resetMappings().then((function(){try{return e.cfg.mappings=null,e.cfg.clearDocs(),e.cfg.fileService.resetLibs().then((function(e){t(e)})).catch((function(n){e.cfg.errorService.addBackendError("Failed to remove jar files: "+n.message,n),t(!1)})),Promise.resolve()}catch(e){return Promise.reject(e)}})).catch((function(n){e.cfg.errorService.addBackendError("Failed to remove mappings: "+n.message,n),t(!1)}))}))},n.setMappingToService=function(e){var t=JSON.stringify(e);return this.setMappingStringToService(t)},n.setMappingStringToService=function(e){var t=this;return new Promise((function(n){var i=t.cfg.initCfg.baseMappingServiceUrl+"mapping/JSON";t.cfg.logger.debug("Set Mapping Request (set mapping): "+e),t.api.put(i,{headers:{"Content-Type":"application/json",Accept:"application/json","Response-Type":"application/json"},body:e}).arrayBuffer().then((function(e){t.cfg.logger.debug("Set Mapping Response: "+JSON.stringify(e)),n(!0)})).catch((function(e){t.cfg.errorService.addBackendError("Unable to update the mappings file to the AtlasMap design runtime service. "+e.status+" "+e.statusText,e),n(!1)}))}))},n.setMappingDigestToService=function(e){var n=this;return new Promise((function(i){var a,r=JSON.stringify(e),o=(new TextEncoder).encode(r);try{a=m.gzip(o)}catch(e){return n.cfg.errorService.addError(new G({message:"Unable to compress the current data mappings.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:e})),void i(!1)}var l=n.cfg.initCfg.baseMappingServiceUrl+"mapping/GZ/0",s=new Blob([a],{type:"application/octet-stream"});n.setBinaryFileToService(s,l,t.FileName.DIGEST).then((function(e){i(e)}))}))},n.setADMArchiveFileToService=function(e){var n=this.cfg.initCfg.baseMappingServiceUrl+"mapping/ZIP/",i=new Blob([e],{type:"application/octet-stream"});return this.setBinaryFileToService(i,n,t.FileName.ADM)},n.setBinaryFileToService=function(e,t,n){var i=this;return new Promise((function(a){i.cfg.logger.debug("Set "+n+" Request"),i.api.put(t,{body:e}).arrayBuffer().then((function(e){i.cfg.logger.debug("Set "+n+" Response: "+JSON.stringify(e)),a(!0)})).catch((function(e){i.cfg.errorService.addBackendError("Unable to update the "+n+" to the AtlasMap design runtime service.\n              "+e.status+" "+e.statusText,e),a(!1)}))}))},n.importJarFile=function(e){var n=this;return new Promise((function(i){try{var a=n.cfg.initCfg.baseMappingServiceUrl+"library",r=new Blob([e],{type:"application/octet-stream"});return Promise.resolve(n.setBinaryFileToService(r,a,t.FileName.JAR)).then((function(e){var t=function(){if(e&&n.cfg.mappingService)return n.cfg.mappingService.notifyMappingUpdated(),Promise.resolve(n.cfg.fieldActionService.fetchFieldActions()).then((function(){i(!0)}));i(!1)}();if(t&&t.then)return t.then((function(){}))}))}catch(e){return Promise.reject(e)}}))},n.updateDigestFile=function(){var e=this;return new Promise((function(n){try{var i=Ne((function(){function t(){var t=je.generateMappingDigest(e.cfg,i);e.setMappingDigestToService(t).then((function(e){n(e)}))}var i=void 0,a=function(){if(e.cfg.mappings)return Promise.resolve(e.getCurrentMappingJson()).then((function(e){i=e}))}();return a&&a.then?a.then(t):t()}),(function(i){e.cfg.errorService.addError(new G({message:"Unable to update mapping digest file.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:i})),n(!1)}));return Promise.resolve(i&&i.then?i.then((function(){})):void 0)}catch(e){return Promise.reject(e)}}))},n.exportADMArchive=function(e){var n=this;return new Promise((function(i){n.updateDigestFile().then((function(){n.getCurrentADMArchive().then((function(a){try{if(null===a)return i(!1),Promise.resolve();"adm"!==e.split(".").pop()&&(e=e.concat(".adm"));var r=new Blob([a],{type:"application/octet-stream"});return P.writeFile(r,e).then((function(e){i(e)})).catch((function(e){n.cfg.errorService.addError(new G({message:"Unable to save the current data mappings.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:e})),i(!1)})),Promise.resolve()}catch(e){return Promise.reject(e)}}))}))}))},n.exportADMArchiveIntoEntaxyRegistry=function(e,n){var i=this;return new Promise((function(a){i.updateDigestFile().then((function(){i.getCurrentADMArchive().then((function(r){try{if(null===r)return a(!1),Promise.resolve();"adm"!==e.split(".").pop()&&(e=e.concat(".adm"));var o=n+"/"+e,l=r.buffer.slice(r.byteOffset,r.byteLength+r.byteOffset);return i.putFileIntoRegistry(o,l).then((function(r){a(r),i.cfg.errorService.addError(new G({message:"Saving "+e+" to "+n+" is completed.",level:t.ErrorLevel.INFO,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER}))})).catch((function(e){i.cfg.errorService.addError(new G({message:"Unable to save the current data mappings.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:e})),a(!1)})),Promise.resolve()}catch(e){return Promise.reject(e)}}))}))}))},n.importADMArchive=function(e){var n=this;return new Promise((function(i){n.resetAll().then((function(){var a=new FileReader;P.readBinaryFile(e,a).then((function(e){n.setADMArchiveFileToService(e).then((function(e){i(e)}))})).catch((function(a){n.cfg.errorService.addError(new G({message:"Unable to import the specified ADM file '"+e.name+"'",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:a})),i(!1)}))}))}))},n.getFileContentFromRegistry=function(e){var t=this;return new Promise((function(n,i){var a=encodeURIComponent(e),r=t.cfg.initCfg.baseMappingServiceUrl+"mapping/ntxregistry/content/"+a;t.cfg.logger.debug("Get file content from Entaxy registry "+e+", Request: "+r),t.api.get(r,{headers:{"Content-Type":"application/json",Accept:"application/json","Response-Type":"application/json"}}).text().then((function(i){t.cfg.logger.debug("Get file from Entaxy registry "+e+", Response: "+i),n(i)})).catch((function(e){204!==e.status&&(t.cfg.errorService.addBackendError("Error occurred while getting file from Entaxy registry.",e),i(e))}))}))},n.getFileFromRegistry=function(e){var t=this;return new Promise((function(n,i){var a=encodeURIComponent(e),r=t.cfg.initCfg.baseMappingServiceUrl+"mapping/ntxregistry/"+a;t.cfg.logger.debug("Get file from Entaxy registry "+e+", Request: "+r),t.api.get(r,{headers:{"Content-Type":"application/octet-stream",Accept:"application/octet-stream","Response-Type":"application/octet-stream"}}).arrayBuffer().then((function(i){t.cfg.logger.debug("Get file from Entaxy registry "+e+", Response: "+JSON.stringify(i)),n(i.byteLength?new Uint8Array(i):null)})).catch((function(e){204!==e.status&&(t.cfg.errorService.addBackendError("Error occurred while getting file from Entaxy registry.",e),i(e))}))}))},n.importADMArchiveFromEntaxyRegistry=function(e){var n=this;return new Promise((function(i){n.resetAll().then((function(){n.getFileFromRegistry(e).then((function(e){null!==e?n.setADMArchiveFileToService(e).then((function(e){i(e)})):i(!1)})).catch((function(a){n.cfg.errorService.addError(new G({message:"Unable to import the ADM file from Entaxy registry location "+e,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:a})),i(!1)}))}))}))},n.getCurrentMappingJson=function(){var e=this;return new Promise((function(t,n){if(null!==e.cfg.mappings){e.cfg.mappingFiles[0]=e.cfg.mappings.name;var i=e.cfg.initCfg.baseMappingServiceUrl+"mapping/JSON/";e.cfg.logger.debug("Get Current Mapping Request"),e.api.get(i).json().then((function(n){e.cfg.logger.debug("Get Current Mapping Response: "+JSON.stringify(n)),t(n)})).catch((function(i){204!==i.status?(e.cfg.errorService.addBackendError("Error occurred while accessing the current mappings from the backend service.",i),n(i)):t(void 0)}))}else n()}))},D(e,[{key:"cfg",get:function(){return this._cfg},set:function(e){this._cfg=e,this._cfg.logger||(this._cfg.logger=g.getLogger("file-management"))}}]),e}(),Je=function(){function e(){}var n=e.prototype;return n.willClearOutSourceFieldsOnTogglingExpression=function(){var e,t;return!(null===(e=this.cfg.mappings)||void 0===e||null===(t=e.activeMapping)||void 0===t||!t.transition.enableExpression)&&null!=this.cfg.mappings.activeMapping.getFirstCollectionField(!0)},n.isExpressionEnabledForActiveMapping=function(){var e,t,n;return!(null===(e=this.cfg.mappings)||void 0===e||null===(t=e.activeMapping)||void 0===t||null===(n=t.transition)||void 0===n||!n.enableExpression)},n.toggleExpressionMode=function(){var e=this;if(this.cfg.mappings&&this.cfg.mappings.activeMapping&&this.cfg.mappings.activeMapping.transition){var n,i=this.cfg.mappings.activeMapping;i.transition.mode!==t.TransitionMode.ONE_TO_MANY?(this.willClearOutSourceFieldsOnTogglingExpression()&&i.sourceFields.splice(0,i.sourceFields.length),i.transition.enableExpression=!i.transition.enableExpression,i.transition.enableExpression?(i.transition.mode=t.TransitionMode.EXPRESSION,i.transition.transitionFieldAction=null,this.mappingUpdatedSubscription=this.cfg.mappingService.mappingUpdated$.subscribe((function(){e.cfg&&e.cfg.mappings&&e.cfg.mappings.activeMapping&&e.cfg.mappings.activeMapping.isFullyMapped()&&e.updateExpression(e.cfg.mappings.activeMapping)})),i.transition.expression&&this.cfg.mappings.activeMapping.transition.expression.expressionUpdatedSource.next()):(null===(n=this.mappingUpdatedSubscription)||void 0===n||n.unsubscribe(),i.transition.mode=t.TransitionMode.ONE_TO_ONE,this.cfg.mappingService.updateActiveMappingTransition())):this.cfg.errorService.addError(new G({message:"Cannot establish a conditional mapping expression when multiple target fields are selected.\n        Please select only one target field and try again.",level:t.ErrorLevel.WARN,scope:t.ErrorScope.MAPPING,type:t.ErrorType.USER,mapping:i}))}else this.cfg.errorService.addError(new G({message:"Please select a mapping first.",level:t.ErrorLevel.INFO,scope:t.ErrorScope.MAPPING,type:t.ErrorType.USER}))},n.updateExpression=function(e,t,n){var i;null===(i=e.transition.expression)||void 0===i||i.updateFieldReference(e,t,n)},n.addFieldToExpression=function(e,t,n,i,a,r){var o,l=e.getMappedFieldByPath(n,!0,t);if(!l&&!(l=e.getReferenceField(t,n))){var s=this.cfg.getDocForIdentifier(t,!0),c=R.getField(n,null==s?void 0:s.getAllFields());if(c&&(this.updateExpression(e,i.getUuid(),r?i.toText().length:a),this.cfg.mappingService.addFieldToActiveMapping(c)),!(l=e.getMappedFieldByPath(n,!0,t)))return}null===(o=e.transition.expression)||void 0===o||o.addConditionalExpressionNode(l,i.getUuid(),r?i.str.length:a)},n.executeFieldSearch=function(e,n,i){var a=e.mappings.activeMapping;if(!a)return[];for(var r,o=[],l=x(e.getDocs(i));!(r=l()).done;)for(var s,c=r.value,u="",p=-1,d=x(c.getTerminalFields().concat(c.getComplexFields()));!(s=d()).done;){var f=s.value,m=[""],g=null==f?"":f.getFieldLabel(e.showTypes,!0);if(null==n||""===n||-1!==g.toLowerCase().indexOf(n.toLowerCase())){if(!e.mappingService.isFieldSelectable(a,f)&&f.type!==t.FieldType.COMPLEX)continue;if(u!==f.docDef.name){if(0===p){o.pop();continue}var v=[""];v[0]=u=f.docDef.name,v[1]=f.docDef.id,p=0,o.push(v)}g=P.extractDisplayPath(f.path,100),m[0]=f.docDef.id,m[1]=f.path,p++,o.push(m)}if(o.length>500){var h=[""];h[0]="** Displayable field limit reached **",h[1]="",p++,o.push(h);break}}return o},n.getMappingExpressionStr=function(e,t){if(!t&&!ke.activeMapping(this.cfg))return"";var n;if(t||(t=null===(n=this.cfg.mappings)||void 0===n?void 0:n.activeMapping),!t.transition.expression){if(!t.transition.enableExpression||!ke.hasFieldAction(t.sourceFields))return"";this.createMappingExpression(t)}return t.transition.expression&&t.transition.enableExpression?e?t.transition.expression.expressionHTML:t.transition.expression.toText(!0):""},n.createMappingExpression=function(e){var n,i,a,r,o="",l=e.getMappedFields(!0),s=ke.hasMappedCollection(e,!0),c=e.getMappedFields(!1),u=ke.hasMappedCollection(e,!1);return l.length>1||s&&(null===(n=e.transition.transitionFieldAction)||void 0===n||null===(i=n.definition)||void 0===i?void 0:i.multiplicity)===t.Multiplicity.MANY_TO_ONE?(o="Concatenate (",o+=this.fieldActionsToExpression(e),o+=", '"+Se.delimiterModels[e.transition.delimiter].actualDelimiter+"')"):(c.length>1||u)&&(null===(a=e.transition.transitionFieldAction)||void 0===a||null===(r=a.definition)||void 0===r?void 0:r.multiplicity)===t.Multiplicity.ONE_TO_MANY?(o="Split (",o+=this.fieldActionsToExpression(e),o+=")"):o+=this.fieldActionsToExpression(e),e.transition.expression=new $(e,this.cfg),e.transition.expression.insertText(o),o},n.qualifiedExpressionRef=function(e){var t,n,i,a;return null!==(null===(t=e.field)||void 0===t?void 0:t.path)?"${"+(null===(n=e.field)||void 0===n||null===(i=n.docDef)||void 0===i?void 0:i.id)+":"+(null===(a=e.field)||void 0===a?void 0:a.path)+"}":"null"},n.fieldActionArgumentToExpression=function(e,t){return"string"===t?"'"+e.value+"'":e.value},n.fieldActionToExpression=function(e,t){var n=e.actions[t],i=n.name+" (";if(t<e.actions.length-1?(t++,i+=this.fieldActionToExpression(e,t)):i+=this.qualifiedExpressionRef(e),n.argumentValues.length>0)for(var a=0;a<n.argumentValues.length;a++)i+=", "+this.fieldActionArgumentToExpression(n.argumentValues[a],n.definition.arguments[a].type);return i+")"},n.fieldActionsToExpression=function(e){for(var t,n="",i=0;i<e.sourceFields.length;i++)(t=e.sourceFields[i]).actions.length>0?n+=this.fieldActionToExpression(t,0):n+=this.qualifiedExpressionRef(t),i!==e.sourceFields.length-1&&(n+=", ");return n},e}(),Ge=function(){function e(e){this.api=e,this.lineRefreshSource=new f.Subject,this.lineRefresh$=this.lineRefreshSource.asObservable(),this.mappingUpdatedSource=new f.Subject,this.mappingUpdated$=this.mappingUpdatedSource.asObservable(),this.mappingSelectionRequiredSource=new f.Subject,this.mappingSelectionRequired$=this.mappingSelectionRequiredSource.asObservable(),this.lastValidation=Date.now()}var n=e.prototype;return n.fetchMappings=function(e,t){var n=this;return new Promise((function(e){n.cfg.fileService.getCurrentMappingJson().then((function(i){try{return i?(n.cfg.mappings=t,Le.deserializeMappingServiceJSON(i,n.cfg),n.updateMappingsTransition(),e(!0),Promise.resolve()):(e(!1),Promise.resolve())}catch(e){return Promise.reject(e)}})).catch((function(t){n.cfg.errorService.addBackendError("Failed to load mapping definition from backend:",t),e(!1)}))}))},n.updateMappingsTransition=function(){var e=this;this.cfg.mappings.getAllMappings(!0).forEach((function(t){return e.updateTransition(t)}))},n.updateActiveMappingTransition=function(){var e,t;null!==(e=this.cfg.mappings)&&void 0!==e&&e.activeMapping&&this.updateTransition(null===(t=this.cfg.mappings)||void 0===t?void 0:t.activeMapping)},n.removeMapping=function(e){try{var t=this;return Promise.resolve(new Promise((function(n){try{var i=function(){n(!0)},a=t.cfg.mappings.removeMapping(e),r=function(){if(a)return t.deselectMapping(),Promise.resolve(t.notifyMappingUpdated()).then((function(){}));t.deselectMapping()}();return Promise.resolve(r&&r.then?r.then(i):i())}catch(e){return Promise.reject(e)}})))}catch(e){return Promise.reject(e)}},n.removeAllMappings=function(){try{var e=this;return Promise.resolve(new Promise((function(t){try{for(var n,i=x(e.cfg.mappings.getAllMappings(!0));!(n=i()).done;)e.cfg.mappings.removeMapping(n.value),e.deselectMapping();return Promise.resolve(e.notifyMappingUpdated()).then((function(){t(!0)}))}catch(e){return Promise.reject(e)}})))}catch(e){return Promise.reject(e)}},n.updateMappedField=function(e){try{var t=this;return Promise.resolve(new Promise((function(n){try{return e.isEmpty()?(t.cfg.mappings.removeMapping(e),t.deselectMapping()):t.updateTransition(e),Promise.resolve(t.notifyMappingUpdated()).then((function(){n(!0)}))}catch(e){return Promise.reject(e)}})))}catch(e){return Promise.reject(e)}},n.moveMappedFieldTo=function(e,t,n){if(e&&t){var i=e.getMappedFields(t.isSource());i.splice(e.getIndexForMappedField(t)-1,1),i.splice(n-1,0,t),this.clearExtraPaddingFields(i,!0),this.notifyMappingUpdated()}},n.addPlaceholders=function(e,t,n,i){for(var a=null,r=0;r<e;r++)(a=new Te).field=new U(i),i?t.sourceFields.splice(n+r,0,a):t.targetFields.splice(n+r,0,a)},n.addFieldToActiveMapping=function(e){var n=this.cfg.mappings.activeMapping;if(n){var i=this.getFieldSelectionExclusionReason(n,e);null==i?(n.addField(e,!1),this.updateTransition(n),(n.sourceFields.length>0||n.targetFields.length>0)&&this.notifyMappingUpdated()):this.cfg.errorService.addError(new G({message:"The field '"+e.name+"' cannot be selected, "+i+".",level:t.ErrorLevel.ERROR,mapping:n,scope:t.ErrorScope.MAPPING,type:t.ErrorType.USER}))}else this.cfg.errorService.addError(new G({message:"No mapping is selected to add a field '"+e.name+"'",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.MAPPING,type:t.ErrorType.USER}))},n.getFieldSelectionExclusionReason=function(e,t){if(!t.isTerminal())return"field is a parent field";if(0===e.getAllMappedFields().length)return null;var n=e.getMappedTarget(t);return null==n||t.isInCollection?e.isLookupMode()?t.enumeration?null:"only Enumeration fields are valid for this mapping":t.enumeration?"Enumeration fields are not valid for this mapping":e.transition.enableExpression&&!t.isSource()&&e.getMappedFields(!1).length>0?"cannot add multiple target fields when conditional mapping is enabled.":null:"it is already the target of another mapping ("+n+"). "},n.isFieldSelectable=function(e,t){return null==this.getFieldSelectionExclusionReason(e,t)},n.canAddToActiveMapping=function(e){var n,i=null===(n=this.cfg.mappings)||void 0===n?void 0:n.activeMapping;return!(!i||i.transition.mode===t.TransitionMode.ENUM&&i.sourceFields.length>0&&i.targetFields.length>0)&&(i.sourceFields.length<=1&&i.targetFields.length<=1||!(!e||!(i.targetFields.length<=1||0===i.sourceFields.length))||!e&&(i.sourceFields.length<=1||0===i.targetFields.length))},n.isFieldAddableToMapping=function(e,n){var i;return!(!e||!e.isTerminal()||e.type===t.FieldType.UNSUPPORTED||n&&n.transition.mode===t.TransitionMode.ENUM&&n.sourceFields.length>0&&n.targetFields.length>0)&&!!(e.isSource()||e.isCollection||e.isInCollection()||0===(null===(i=this.cfg.mappings)||void 0===i?void 0:i.findMappingsForField(e).length))&&(!n||(n.transition.mode===t.TransitionMode.EXPRESSION?e.isSource()||0===n.targetFields.length:!(e.isSource()&&n.sourceFields.find((function(t){return t.field===e}))||!e.isSource()&&n.targetFields.find((function(t){return t.field===e})))&&(e.isCollection||e.isInCollection()?e.isSource()?0===n.sourceFields.length:0===n.targetFields.length:e.isSource()?0===n.sourceFields.length||!n.sourceFields.find((function(e){var t,n;return(null===(t=e.field)||void 0===t?void 0:t.isCollection)||(null===(n=e.field)||void 0===n?void 0:n.isInCollection())}))&&n.targetFields.length<=1:0===n.targetFields.length||!n.targetFields.find((function(e){var t,n;return(null===(t=e.field)||void 0===t?void 0:t.isCollection)||(null===(n=e.field)||void 0===n?void 0:n.isInCollection())}))&&n.sourceFields.length<=1)))},n.isFieldAddableToActiveMapping=function(e){var t;return this.isFieldAddableToMapping(e,null===(t=this.cfg.mappings)||void 0===t?void 0:t.activeMapping)},n.isFieldDragAndDropAllowed=function(e,t){var n;if(!e||!t||e.isSource()&&t.isSource()||!e.isSource()&&!t.isSource())return!1;var i=e.isSource()?e:t,a=e.isSource()?t:e,r=null===(n=this.cfg.mappings)||void 0===n?void 0:n.activeMapping;if(r){if(r.isFieldMapped(i)&&r.isFieldMapped(a))return!1;if(r.isFieldMapped(i))return this.isFieldAddableToMapping(a,r);if(r.isFieldMapped(a))return this.isFieldAddableToMapping(i,r)}return this.isFieldAddableToMapping(i,null)&&this.isFieldAddableToMapping(a,null)},n.addNewMapping=function(e,t){t||this.deselectMapping();var n=new Me;null!=e?(n.addField(e,!1),this.updateTransition(n),this.selectMapping(n),this.notifyMappingUpdated()):this.selectMapping(n)},n.newMapping=function(){this.deselectMapping();var e=new Me;this.updateTransition(e),this.selectMapping(e),this.notifyMappingUpdated()},n.selectMapping=function(e){null!=e?(this.cfg.mappings.activeMapping=e,this.cfg.showMappingDetailTray=!0,this.mappingUpdatedSource.next()):this.deselectMapping()},n.deselectMapping=function(){this.cfg.showMappingDetailTray=!1,this.cfg.mappings.activeMapping=null,this.notifyMappingUpdated()},n.removeDocumentReferenceFromAllMappings=function(e){for(var t,n=x(this.cfg.mappings.getAllMappings(!0));!(t=n()).done;)for(var i,a=t.value,r=x(a.getAllFields());!(i=r()).done;){var o=i.value;o instanceof U||o.docDef.id!==e||(this.removeFieldFromAllMappings(o),0!==a.sourceFields.length&&0!==a.targetFields.length||(this.cfg.mappings.removeMapping(a),a===this.cfg.mappings.activeMapping&&this.cfg.mappingService.deselectMapping()))}},n.removeFieldFromAllMappings=function(e){for(var t,n=x(this.cfg.mappings.getAllMappings(!0));!(t=n()).done;){var i=t.value,a=i.getMappedFieldForField(e);null!=a&&(i.removeMappedField(a),i.isEmpty()&&this.cfg.mappings.removeMapping(i))}},n.validateMappings=function(e){try{var t=this;return Promise.resolve(new Promise((function(n){if(null!==t.cfg.initCfg.baseMappingServiceUrl&&null!==t.cfg.mappings){t.cfg.errorService.clearValidationErrors();var i=t.cfg.initCfg.baseMappingServiceUrl+"mapping/validate/"+t.cfg.mappingDefinitionId;t.cfg.logger.debug("Validation Service Request: "+JSON.stringify(e)+"\n");var a=Date.now();t.api.put(i,{json:e}).json().then((function(e){t.cfg.logger.debug("Validation Service Response: "+JSON.stringify(e)+"\n"),a>t.lastValidation?(t.lastValidation=a,t.processValidationResponse(e,n)):n(!1)})).catch((function(){t.cfg.logger.warn("Unable to fetch validation data."),n(!1)}))}else n(!1)})))}catch(e){return Promise.reject(e)}},n.processValidationResponse=function(e,n){var i,a=this;if(null!==this.cfg.mappings){var r=[];if(e&&e.Validations&&e.Validations.validation)for(var o,l=function(){var e=o.value,n=t.ErrorLevel[e.status?e.status:"ERROR"],i=t.ErrorScope[e.scope?e.scope:"MAPPING"],l=void 0;i&&i===t.ErrorScope.MAPPING&&e.id?(i=t.ErrorScope.MAPPING,a.cfg.mappings&&a.cfg.mappings.mappings&&(l=a.cfg.mappings.mappings.find((function(t){return t.uuid===e.id})))):i=t.ErrorScope.APPLICATION,r.push(new G({message:e.message,level:n,scope:i,mapping:l,type:t.ErrorType.VALIDATION}))},s=x(e.Validations.validation);!(o=s()).done;)l();(i=this.cfg.errorService).addError.apply(i,r),n(!0)}else n(!1)},n.notifyLineRefresh=function(){var e=this;setTimeout((function(){e.lineRefreshSource.next()}),1)},n.notifyMappingUpdated=function(){var e=this;return new Promise((function(t){try{var n=function(){e.mappingUpdatedSource.next(),e.notifyLineRefresh(),t(!0)},i=function(){if(e.cfg.mappings){var t=e.cfg.mappings.activeMapping;t&&-1===e.cfg.mappings.mappings.indexOf(t)&&e.cfg.mappings.mappings.push(t);var n=Le.serializeMappings(e.cfg);return Promise.resolve(e.validateMappings(n)).then((function(t){var i=function(){if(t)return Promise.resolve(e.cfg.fileService.setMappingToService(n)).then((function(){}))}();if(i&&i.then)return i.then((function(){}))}))}}();return Promise.resolve(i&&i.then?i.then(n):n())}catch(e){return Promise.reject(e)}}))},n.updateTransition=function(e){if(!e.transition.enableExpression){for(var n,i=x(e.getAllFields());!(n=i()).done;)if(n.value.enumeration)return e.transition.mode=t.TransitionMode.ENUM,void _e.populateMappingLookupTable(this.cfg.mappings,e);var a=e.getMappedFields(!0),r=ke.hasMappedCollection(e,!0),o=e.getMappedFields(!1),l=ke.hasMappedCollection(e,!1);if(r&&l)e.transition.mode=t.TransitionMode.FOR_EACH;else{if(a.length>1||r)return e.transition.mode=t.TransitionMode.MANY_TO_ONE,void(e.transition.transitionFieldAction&&e.transition.transitionFieldAction.definition&&e.transition.transitionFieldAction.definition.multiplicity===t.Multiplicity.MANY_TO_ONE||(e.transition.transitionFieldAction=ne.create(this.cfg.fieldActionService.getActionDefinitionForName("Concatenate",t.Multiplicity.MANY_TO_ONE)),e.transition.transitionFieldAction.setArgumentValue("delimiter"," "),e.transition.transitionFieldAction.setArgumentValue("delimitingEmptyValues","true")));var s;if(o.length>1||l)return e.transition.mode=t.TransitionMode.ONE_TO_MANY,void(e.transition.transitionFieldAction&&(null===(s=e.transition.transitionFieldAction.definition)||void 0===s?void 0:s.multiplicity)===t.Multiplicity.ONE_TO_MANY||(e.transition.transitionFieldAction=ne.create(this.cfg.fieldActionService.getActionDefinitionForName("Split",t.Multiplicity.ONE_TO_MANY)),e.transition.transitionFieldAction.setArgumentValue("delimiter"," "),e.transition.transitionFieldAction.setArgumentValue("collapseRepeatingDelimiters","false")));e.transition.mode=t.TransitionMode.ONE_TO_ONE,e.transition.transitionFieldAction=null}}},n.clearExtraPaddingFields=function(e,t){var n=0,i=null;for(n=e.length-1;n>=0;n--)if((i=e[n]).isPadField())P.removeItemFromArray(i,e);else if(t)break},n.getEnumerationValues=function(e,t){return _e.getEnumerationValues(e,t)},n.setEnumFieldValue=function(e,t){e.enumIndexValue=t},n.updateEnumerationValues=function(e,t,n){_e.updateEnumerationValues(e,t,n),this.notifyMappingUpdated()},n.isEnumerationMapping=function(e){return e.transition.mode===t.TransitionMode.ENUM},D(e,[{key:"cfg",get:function(){return this._cfg},set:function(e){var t=this;this._cfg=e,this._cfg.logger||(this._cfg.logger=g.getLogger("mapping-management")),this._cfg.logger.getLevel()<=this._cfg.logger.levels.DEBUG&&this.mappingUpdated$.subscribe((function(){t.cfg.mappings&&t.cfg.mappings&&t.cfg.mappings.activeMapping&&t.cfg.logger.info("mapping updated: "+JSON.stringify(Le.serializeMappings(t.cfg)))}))}}]),e}(),qe=function(){function e(e){this.api=e,this.mappingPreviewInputSource=new f.Subject,this.mappingPreviewInput$=this.mappingPreviewInputSource.asObservable(),this.mappingPreviewOutputSource=new f.Subject,this.mappingPreviewOutput$=this.mappingPreviewOutputSource.asObservable(),this.mappingPreviewErrorSource=new f.Subject,this.mappingPreviewError$=this.mappingPreviewErrorSource.asObservable()}var n=e.prototype;return n.enableMappingPreview=function(){null!=this.cfg.initCfg.baseMappingServiceUrl&&(this.cfg.showMappingPreview=!0,this.mappingPreviewInputSubscription=this.createMappingPreviewSubscription(),this.mappingUpdatedSubscription=this.createMappingUpdatedSubscription())},n.createMappingPreviewSubscription=function(){var e=this;return this.mappingPreviewInput$.subscribe((function(n){if(n&&n.isFullyMapped()){for(var i,a=!1,r=x(n.getFields(!0));!(i=r()).done;)if(i.value.value){a=!0;break}if(!a)for(var o,l=x(n.getFields(!1));!(o=l()).done;)if(o.value.value){a=!0;break}if(a){var s=e.createPreviewRequestBody(n);e.cfg.logger.debug("Process Mapping Preview Request: "+JSON.stringify(s)),e.api.put(e.cfg.initCfg.baseMappingServiceUrl+"mapping/process",{json:s}).json().then((function(t){e.cfg.logger.debug("Process Mapping Preview Response: "+JSON.stringify(t)),e.processPreviewResponse(n,t)})).catch((function(i){e.cfg.mappings&&e.cfg.mappings.activeMapping&&e.cfg.mappings.activeMapping===n&&e.cfg.errorService.addError(new G({message:i,level:t.ErrorLevel.ERROR,mapping:n,scope:t.ErrorScope.MAPPING,type:t.ErrorType.PREVIEW})),e.mappingPreviewErrorSource.next([new G({message:i,level:t.ErrorLevel.ERROR})])}))}}}))},n.createPreviewRequestBody=function(e){return{ProcessMappingRequest:{jsonType:"io.atlasmap.v2.ProcessMappingRequest",mapping:Le.serializeFieldMapping(this.cfg,e,"preview",!1)}}},n.processPreviewResponse=function(e,n){for(var i,a=Le.deserializeFieldMapping(n.ProcessMappingResponse.mapping,this.cfg),r=x(e.targetFields);!(i=r()).done;)for(var o,l=i.value,s=x(a.targetFields);!(o=s()).done;){var c,u,p,d,f,m=o.value;if((null===(c=l.field)||void 0===c||null===(u=c.docDef)||void 0===u?void 0:u.id)===(null===(p=m.field)||void 0===p?void 0:p.docDef.id)&&(null===(d=l.field)||void 0===d?void 0:d.path)===(null===(f=m.field)||void 0===f?void 0:f.path)){var g;l.field.value=null===(g=m.mappingField)||void 0===g?void 0:g.value;var v=a.targetFields.indexOf(m);if(-1!==v){a.targetFields.splice(v,1);break}}}this.mappingPreviewOutputSource.next(a);var h,E=Le.deserializeAudits(n.ProcessMappingResponse.audits,t.ErrorType.PREVIEW);this.cfg.mappings.activeMapping===e&&(E.forEach((function(t){return t.mapping=e})),(h=this.cfg.errorService).addError.apply(h,E)),this.mappingPreviewErrorSource.next(E)},n.createMappingUpdatedSubscription=function(){var e=this;return this.cfg.mappingService.mappingUpdated$.subscribe((function(){e.cfg&&e.cfg.mappings&&e.cfg.mappings.activeMapping&&e.cfg.mappings.activeMapping.isFullyMapped()&&e.mappingPreviewInputSource.next(e.cfg.mappings.activeMapping)}))},n.disableMappingPreview=function(){var e,t,n=!1;if(this.cfg.showMappingPreview=!1,null!==(e=this.cfg.mappings)&&void 0!==e&&null!==(t=e.activeMapping)&&void 0!==t&&t.isFullyMapped())for(var i,a=x(this.cfg.mappings.getAllMappings(!0));!(i=a()).done;)for(var r,o=x(i.value.getAllFields());!(r=o()).done;){var l,s=r.value;(null===(l=s.value)||void 0===l?void 0:l.length)>0&&!s.isConstant()&&(s.value="",n=!0)}n&&this.cfg.mappingService.notifyMappingUpdated(),this.mappingUpdatedSubscription&&(this.mappingUpdatedSubscription.unsubscribe(),this.mappingUpdatedSubscription=void 0),this.mappingPreviewInputSubscription&&(this.mappingPreviewInputSubscription.unsubscribe(),this.mappingPreviewInputSubscription=void 0)},n.toggleMappingPreview=function(e){return e?this.enableMappingPreview():this.disableMappingPreview(),e},e}();g.setDefaultLevel(g.levels.WARN);var He=function(){function e(e){this.api=e,this.cfg=J.getConfig(),this.systemInitializedSource=new f.Subject,this.systemInitialized$=this.systemInitializedSource.asObservable(),this.initializationStatusChangedSource=new f.Subject,this.initializationStatusChanged$=this.initializationStatusChangedSource.asObservable(),this.documentService=new Ue(this.api),this.mappingService=new Ge(this.api),this.errorService=new Ve,this.fieldActionService=new ze(this.api),this.fileService=new Be(this.api),this.previewService=new qe(this.api),this.expressionService=new Je,this.resetConfig(),this.documentService.initialize()}var n=e.prototype;return n.resetConfig=function(){this.cfg=new J,this.cfg.documentService=this.documentService,this.cfg.documentService.cfg=this.cfg,this.cfg.mappingService=this.mappingService,this.cfg.mappingService.cfg=this.cfg,this.cfg.errorService=this.errorService,this.cfg.fieldActionService=this.fieldActionService,this.cfg.fieldActionService.cfg=this.cfg,this.cfg.fileService=this.fileService,this.cfg.fileService.cfg=this.cfg,this.cfg.previewService=this.previewService,this.cfg.previewService.cfg=this.cfg,this.cfg.expressionService=this.expressionService,this.cfg.expressionService.cfg=this.cfg,this.cfg.initializationService=this,this.cfg.logger=g.getLogger("config"),J.setConfig(this.cfg)},n.initialize=function(){var e=this;return new Promise((function(n){try{var i=!1,a=function(t){if(i)return t;e.updateLoadingStatus("Loading source/target documents.");var a=e.cfg.getAllDocs(),r=a[a.length-1];e.cfg.documentService.inspectDocuments().pipe(h.first((function(e){return e===r}))).subscribe({next:function(){var t=e.cfg.preloadedMappingJson;e.updateStatus(),e.systemInitializedSource.pipe(h.first()).subscribe((function(){if(t){var n=JSON.stringify(Le.serializeMappings(e.cfg));t!==n&&e.cfg.mappingService.notifyMappingUpdated()}}))}}),e.initializeWithMappingDigest().finally((function(){e.updateStatus()})),n(!0)};if(e.cfg.setConstantPropertyDocs(),e.cfg.errorService.resetAll(),e.cfg.fieldActionService.isInitialized=!1,e.cfg.initCfg.initialized=!1,e.cfg.initCfg.mappingInitialized=!1,null==e.cfg.mappingService?e.cfg.errorService.addError(new G({message:"Mapping service is not configured, validation service will not be used.",level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL})):null==e.cfg.initCfg.baseMappingServiceUrl&&e.cfg.errorService.addError(new G({message:"Mapping service URL is not configured, validation service will not be used.",level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL})),!e.cfg.fieldActionService)return e.handleError("FieldActionService is not configured"),n(!1),Promise.resolve();var r=Ne((function(){return Promise.resolve(e.runtimeServiceActive()).then((function(t){t||(e.handleError("The AtlasMap runtime service is not available."),n(!1),i=!0)}))}),(function(){e.handleError("The AtlasMap runtime service is not available."),n(!1),i=!0}));return Promise.resolve(r&&r.then?r.then(a):a(r))}catch(e){return Promise.reject(e)}}))},n.runtimeServiceActive=function(){var e=this;return new Promise((function(t,n){var i=e.cfg.initCfg.baseMappingServiceUrl+"ping";e.cfg.logger.debug("Runtime Service Ping Request"),e.api.get(i).json().then((function(n){e.cfg.logger.debug("Runtime Service Ping Response: "+n.String),t("pong"===(null==n?void 0:n.String))})).catch((function(e){n(e)}))}))},n.getRuntimeVersion=function(){var e=this,t=this.cfg.initCfg.baseMappingServiceUrl+"version";return new Promise((function(n,i){e.api.get(t).json().then((function(t){e.cfg.logger.debug("Runtime Service Version Response: "+t.String),n(t.String)})).catch((function(e){i(e)}))}))},n.getUIVersion=function(){return this.cfg.initCfg.dataMapperVersion},n.setUIVersion=function(e){this.cfg.initCfg.dataMapperVersion=e},n.initializeWithMappingDigest=function(){var e=this;return new Promise((function(t){e.cfg.fileService.getCurrentMappingDigest().then((function(n){try{var i=!1,a=function(a){return i?a:Promise.resolve(e.addDocumentsFromMappingDigest(n)).then((function(){if(n&&n.exportMappings){var i=Le.deserializeAtlasMappingName(P.objectize(n.exportMappings.value));e.cfg.fileService.findMappingFiles("UI").then((function(a){try{return Promise.resolve(e.cfg.fileService.setMappingDigestToService(n)).then((function(){return Promise.resolve(e.cfg.fieldActionService.fetchFieldActions()).then((function(){function r(){return Promise.resolve(e.cfg.fieldActionService.fetchFieldActions()).then((function(){e.fetchMappings().then((function(e){t(e)}))}))}var o=function(){if(i!==a[0])return Promise.resolve(e.cfg.fileService.setMappingStringToService(n.exportMappings.value)).then((function(){}))}();return o&&o.then?o.then(r):r()}))}))}catch(e){return Promise.reject(e)}})).catch((function(){t(!1)}))}else t(!1)}))},r=function(){if(!n)return null===e.cfg.mappings&&(e.cfg.mappings=new Fe),Promise.resolve(e.cfg.fieldActionService.fetchFieldActions()).then((function(){e.updateStatus(),t(!0),i=!0}))}();return Promise.resolve(r&&r.then?r.then(a):a(r))}catch(e){return Promise.reject(e)}})).catch((function(){t(!1)}))}))},n.addDocumentsFromMappingDigest=function(e){var t=this;return new Promise((function(n){try{var i=function(){t.cfg.mappingService.notifyMappingUpdated(),n(!0)};t.cfg.errorService.resetAll();var a=0,r=function(e,t,n){if("function"==typeof e[De]){var i,a,r,o=e[De]();if(function e(n){try{for(;!(i=o.next()).done;)if((n=t(i.value))&&n.then){if(!Ae(n))return void n.then(e,r||(r=Oe.bind(null,a=new Ce,2)));n=n.v}a?Oe(a,1,n):a=n}catch(e){Oe(a||(a=new Ce),2,e)}}(),o.return){var l=function(e){try{i.done||o.return()}catch(e){}return e};if(a&&a.then)return a.then(l,(function(e){throw l(e)}));l()}return a}if(!("length"in e))throw new TypeError("Object is not iterable");for(var s=[],c=0;c<e.length;c++)s.push(e[c]);return function(e,t,n){var i,a,r=-1;return function n(o){try{for(;++r<e.length;)if((o=t(r))&&o.then){if(!Ae(o))return void o.then(n,a||(a=Oe.bind(null,i=new Ce,2)));o=o.v}i?Oe(i,1,o):i=o}catch(e){Oe(i||(i=new Ce),2,e)}}(),i}(s,(function(e){return t(s[e])}))}(e.exportMeta,(function(n){var i,r=e.exportBlockData[a].value,o=n.id?n.id:n.name,l=n.dataSourceType?n.dataSourceType.toUpperCase():null===(i=n.documentType)||void 0===i?void 0:i.toUpperCase(),s="string"==typeof n.isSource?"true"===n.isSource.toLowerCase():n.isSource;return Promise.resolve(t.cfg.documentService.addDocument(r,o,n.name,l,n.inspectionType,s,n.inspectionParameters)).then((function(){t.updateStatus(),a++}))}));return Promise.resolve(r&&r.then?r.then(i):i())}catch(e){return Promise.reject(e)}}))},n.fetchMappings=function(){var e=this;return new Promise((function(t){try{var n=function(){0===i.length&&t(!1),e.cfg.mappingService.fetchMappings(i,e.cfg.mappings).then((function(){e.cfg.initCfg.mappingInitialized=!0,e.updateStatus(),e.cfg.mappingService.notifyMappingUpdated().then((function(){return t(!0)}))}))};if(null!=e.cfg.mappings)return t(!0),Promise.resolve();e.cfg.mappings=new Fe;var i=e.cfg.mappingFiles,a=function(){if(!e.cfg.mappingFiles||0===e.cfg.mappingFiles.length)return Promise.resolve(e.cfg.fileService.findMappingFiles("UI")).then((function(e){i=e}))}();return Promise.resolve(a&&a.then?a.then(n):n())}catch(e){return Promise.reject(e)}}))},n.updateStatus=function(){for(var e,t=this.cfg.getAllDocs().length,n=0,i=x(this.cfg.getAllDocs());!(e=i()).done;){var a=e.value;(a.initialized||a.errorOccurred)&&n++}if(t===n&&this.cfg.fieldActionService.isInitialized){if(this.cfg.preloadedMappingJson&&(Le.deserializeMappingServiceJSON(JSON.parse(this.cfg.preloadedMappingJson),this.cfg),this.cfg.preloadedMappingJson=null),this.cfg.mappings){_e.updateLookupTables(this.cfg.mappings),ke.updateDocumentNamespacesFromMappings(this.cfg),ke.updateMappingsFromDocuments(this.cfg);for(var r,o=x(this.cfg.getAllDocs());!(r=o()).done;)r.value.updateFromMappings(this.cfg.mappings);ke.removeStaleMappings(this.cfg),this.cfg.mappingService.updateMappingsTransition()}this.updateInitComplete()}},n.handleError=function(e,n){this.cfg.errorService.addError(new G({message:e="Data Mapper UI Initialization Error: "+e,scope:t.ErrorScope.APPLICATION,level:t.ErrorLevel.ERROR,type:t.ErrorType.INTERNAL,object:n})),this.updateLoadingStatus(e),this.cfg.initCfg.initializationErrorOccurred=!0,this.cfg.initCfg.initialized=!0,this.systemInitializedSource.next()},n.updateInitComplete=function(){this.updateLoadingStatus("Initialization complete."),this.cfg.initCfg.initialized=!0,this.systemInitializedSource.next()},n.updateLoadingStatus=function(e){this.cfg.initCfg.loadingStatus=e,this.initializationStatusChangedSource.next()},n.initializeWithADMArchiveFile=function(e){var t=this;return new Promise((function(n){t.updateLoadingStatus("Importing ADM archive file"),t.cfg.fileService.importADMArchive(e).then((function(){t.initialize().then((function(e){n(e)}))}))}))},n.initializeWithADMArchiveFileFromEntaxyRegistry=function(e){var t=this;return new Promise((function(n){t.updateLoadingStatus("Importing ADM archive file from Entaxy registry"),t.cfg.fileService.importADMArchiveFromEntaxyRegistry(e).then((function(){t.initialize().then((function(e){n(e)}))}))}))},n.resetAtlasMap=function(){var e=this;return new Promise((function(t){e.cfg.fileService.resetAll().then((function(n){e.initialize().then((function(e){t(n&&e)}))}))}))},e}();t.ATLAS_MAPPING_JSON_TYPE="io.atlasmap.v2.AtlasMapping",t.COLLECTION_JSON_TYPE="io.atlasmap.v2.Collection",t.CONSTANT_FIELD_JSON_TYPE="io.atlasmap.v2.ConstantField",t.CommonUtil=P,t.ConfigModel=J,t.CsvInspectionModel=oe,t.CsvInspectionRequestModel=le,t.CsvInspectionRequestOptions=se,t.DATA_SOURCE_JSON_TYPE="io.atlasmap.v2.DataSource",t.DataMapperInitializationModel=z,t.DocumentDefinition=V,t.DocumentInitializationModel=B,t.DocumentInspectionModel=ie,t.DocumentInspectionRequestModel=ae,t.DocumentInspectionRequestOptions=re,t.DocumentInspectionUtil=Pe,t.DocumentManagementService=Ue,t.EnumValue=w,t.ErrorHandlerService=Ve,t.ErrorInfo=G,t.Examples=q,t.ExpressionModel=$,t.ExpressionNode=Y,t.ExpressionUpdatedEvent=H,t.FIELD_GROUP_JSON_TYPE="io.atlasmap.v2.FieldGroup",t.FIELD_PATH_SEPARATOR="/",t.Field=R,t.FieldAction=ne,t.FieldActionArgument=Q,t.FieldActionArgumentValue=ee,t.FieldActionDefinition=te,t.FieldActionService=ze,t.FieldNode=W,t.FileManagementService=Be,t.Guid=we,t.HTTP_STATUS_NO_CONTENT=204,t.HTTP_STATUS_OK=200,t.InitializationService=He,t.JAVA_CLASS_JSON_TYPE="io.atlasmap.java.v2.JavaClass",t.JAVA_ENUM_FIELD_JSON_TYPE="io.atlasmap.java.v2.JavaEnumField",t.JAVA_INSPECTION_REQUEST_JSON_TYPE="io.atlasmap.java.v2.ClassInspectionRequest",t.JAVA_MODEL_PACKAGE_PREFIX="io.atlasmap.java.v2",t.JSON_DATA_SOURCE_JSON_TYPE="io.atlasmap.json.v2.JsonDataSource",t.JSON_ENUM_FIELD_JSON_TYPE="io.atlasmap.json.v2.JsonEnumField",t.JSON_INSPECTION_REQUEST_JSON_TYPE="io.atlasmap.json.v2.JsonInspectionRequest",t.JSON_MODEL_PACKAGE_PREFIX="io.atlasmap.json.v2",t.JavaInspectionModel=ce,t.JavaInspectionRequestModel=ue,t.JavaInspectionRequestOptions=pe,t.JsonInspectionModel=de,t.JsonInspectionRequestModel=fe,t.JsonInspectionRequestOptions=me,t.LookupTable=ye,t.LookupTableData=Re,t.LookupTableEntry=Ee,t.LookupTableUtil=_e,t.MAPPING_JSON_TYPE="io.atlasmap.v2.Mapping",t.MODEL_PACKAGE_PREFIX="io.atlasmap.v2",t.MappedField=Te,t.MappingDefinition=Fe,t.MappingDigestUtil=je,t.MappingExpressionService=Je,t.MappingManagementService=Ge,t.MappingModel=Me,t.MappingSerializer=Le,t.MappingUtil=ke,t.NamespaceModel=L,t.PROCESS_MAPPING_REQUEST_JSON_TYPE="io.atlasmap.v2.ProcessMappingRequest",t.PROPERTY_FIELD_JSON_TYPE="io.atlasmap.v2.PropertyField",t.PaddingField=U,t.TextNode=X,t.TransitionDelimiterModel=be,t.TransitionModel=Se,t.XML_DATA_SOURCE_JSON_TYPE="io.atlasmap.xml.v2.XmlDataSource",t.XML_ENUM_FIELD_JSON_TYPE="io.atlasmap.xml.v2.XmlEnumField",t.XML_INSPECTION_REQUEST_JSON_TYPE="io.atlasmap.xml.v2.XmlInspectionRequest",t.XML_MODEL_PACKAGE_PREFIX="io.atlasmap.xml.v2",t.XmlInspectionModel=ge,t.XmlInspectionRequestModel=ve,t.XmlInspectionRequestOptions=he,t.collectionTypes=M,t.constantTypes=C,t.getCsvParameterOptions=function(){return[{name:"format",label:"CSV File Format",value:"Default",options:[{label:"Default",value:"Default"},{label:"Excel",value:"Excel"},{label:"InformixUnload",value:"InformixUnload"},{label:"InformixUnloadCsv",value:"InformixUnloadCsv"},{label:"MongoDBCsv",value:"MongoDBCsv"},{label:"MongoDBTsv",value:"MongoDBTsv"},{label:"MySQL",value:"MySQL"},{label:"Oracle",value:"Oracle"},{label:"PostgreSQLCsv",value:"PostgreSQLCsv"},{label:"PostgreSQLText",value:"PostgreSQLText"},{label:"RFC4180",value:"RFC4180"},{label:"TDF",value:"TDF"}],required:!0},{name:"allowDuplicateHeaderNames",label:"Allow Duplicate Header Names",value:"true",boolean:!0,required:!1},{name:"allowMissingColumnNames",label:"Allow Missing Column Names",value:"true",boolean:!0,required:!1},{name:"commentMarker",label:"Comment Marker",value:"",required:!1},{name:"delimiter",label:"Delimiter",value:"",required:!1},{name:"escape",label:"Escape",value:"",required:!1},{name:"firstRecordAsHeader",label:"First Record As Header",value:"true",boolean:!0,required:!1},{name:"headers",label:"Headers",value:"",required:!1},{name:"ignoreEmptyLines",label:"Ignore Empty Lines",value:"true",boolean:!0,required:!1},{name:"ignoreHeaderCase",label:"Ignore Header Case",value:"true",boolean:!0,required:!1},{name:"ignoreSurroundingSpaces",label:"Ignore Surrounding Spaces",value:"true",boolean:!0,required:!1},{name:"nullString",label:"Null String",value:"",required:!1},{name:"skipHeaderRecord",label:"Skip Header Record",value:"true",boolean:!0,required:!1}]},t.propertyTypes=O},596:function(e,t,n){"use strict";n.r(t);n(360),Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var i=n(705),a=n(686),r=n(15),o=n(9),l=n(350),s=n(0),c=n.n(s),u=n(687),p=n(341),d=n(1),f=n(185),m=n(623),g=n(695),v=n(625),h=n(75),E=n(630),y=n(631),b=n(632),S=n(624),F=n(701),T=n(109),M=n(692),C=n(633),O=n(702),A=n(108),D=n(124),N=n(173),I=n(689),x=n(24),P=n(634),w=n(635),R=n(636),_=n(345),j=n(638),k=n(639),L=n(640),U=n(641),V=n(642),z=(n(643),n(338)),B=n(221),J=n(647),G=n(648),q=n(649),H=n(356),Y=n(650),X=n(651),W=n(18),K=n(696),Z=n(655),$=n(656),Q=n(657),ee=n(658),te=n(703),ne=n(699),ie=n(700),ae=n(622),re=n(619),oe=n(29),le=n(671),se=n(672),ce=n(675),ue=n(676),pe=n(684),de=n(685),fe=n(704),me=n(626),ge=n(335),ve=n(637),he=n(226),Ee=n(145),ye=n(644),be=n(645),Se=n(652),Fe=n(653),Te=n(179),Me=n(654),Ce=n(266),Oe=n(659),Ae=n(660),De=n(661),Ne=n(662),Ie=n(663),xe=n(664),Pe=n(665),we=n(346),Re=n(666),_e=n(667),je=n(668),ke=n(669),Le=n(670),Ue=n(673),Ve=n(677),ze=n(678),Be=n(679),Je=n(680),Ge=n(681),qe=n(682),He=n(683),Ye=n(272),Xe=n(627),We=n(628),Ke=n(690),Ze=n(691),$e=n(351),Qe=n(330),et=n(352),tt=n(47),nt=n.n(tt),it=n(646),at=n(44),rt=n.n(at),ot=n(349),lt=n(268),st=n(688),ct=n(697),ut=n(693),pt=n(674),dt=n(280);function ft(){return(ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function mt(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,gt(e,t)}function gt(e,t){return(gt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vt(e,t){if(null==e)return{};var n,i,a={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(a[n]=e[n]);return a}function ht(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Et(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"===typeof e)return ht(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ht(e,t):void 0}}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var yt=function(e,t,n,i,a){try{return Promise.resolve(new Promise((function(r){try{return t.initCfg.initialized=!1,t.initializationService.updateLoadingStatus("Importing Document from Entaxy registry location "+e),t.documentService.importNonJavaDocumentFromEntaxyRegistry(e,n,i,a).then((function(){t.fileService.updateDigestFile().finally((function(){t.initializationService.updateStatus(),t.errorService.addError(new o.ErrorInfo({message:e+" import complete.",level:o.ErrorLevel.INFO,scope:o.ErrorScope.APPLICATION,type:o.ErrorType.USER})),r(!0)}))})),Promise.resolve()}catch(l){return Promise.reject(l)}})))}catch(r){return Promise.reject(r)}},bt=function(e,t,n,i,a){try{return Promise.resolve(new Promise((function(r){try{return t.initCfg.initialized=!1,t.initializationService.updateLoadingStatus("Importing Document "+e.name),t.documentService.importNonJavaDocument(e,n,i,a).then((function(){t.fileService.updateDigestFile().finally((function(){t.initializationService.updateStatus(),t.errorService.addError(new o.ErrorInfo({message:e.name+" import complete.",level:o.ErrorLevel.INFO,scope:o.ErrorScope.APPLICATION,type:o.ErrorType.USER})),r(!0)}))})),Promise.resolve()}catch(l){return Promise.reject(l)}})))}catch(r){return Promise.reject(r)}},St=function(e,t,n){try{var i=o.ConfigModel.getConfig();return Ct(e,i,n).name=t,Promise.resolve(i.mappingService.notifyMappingUpdated()).then((function(){return Promise.resolve(i.fileService.updateDigestFile()).then((function(){}))}))}catch(a){return Promise.reject(a)}};function Ft(e,t,n,i,a){var r=o.ConfigModel.getConfig(),l=Ot(e,r,!0),s={alias:t,uri:n,locationUri:i,createdByUser:!0,isTarget:a,getPrettyLabel:function(){return t+" ["+n+"]"},copy:function(){return Object.assign({},s)},copyFrom:function(e){return Object.assign(s,e)}};l.namespaces.push(s),r.mappingService.notifyMappingUpdated()}function Tt(e,t,n,i,a,r){var l=o.ConfigModel.getConfig(),s=Ot(e,l,!0).getNamespaceForAlias(t);s.alias=n,s.uri=i,s.locationUri=a,s.isTarget=r,l.mappingService.notifyMappingUpdated()}function Mt(e,t){var n=o.ConfigModel.getConfig(),i=Ot(e,n,!0);i.namespaces=i.namespaces.filter((function(e){return e.alias!==t})),n.mappingService.notifyMappingUpdated()}function Ct(e,t,n){for(var i,a=Et(t.getDocs(n));!(i=a()).done;){var r=i.value;if(r.id.match(e))return r}return null}function Ot(e,t,n){for(var i,a=Et(t.getDocs(n));!(i=a()).done;){var r=i.value;if((r.getName(!1)+"."+r.type.toLowerCase()).match(e))return r}return null}function At(e,t,n,i){return new Promise((function(a){e.initCfg.initialized=!1,e.initializationService.updateLoadingStatus("Importing Document "+t),e.documentService.importJavaDocument(t,i,n).then((function(){e.fileService.updateDigestFile().finally((function(){e.initializationService.updateStatus(),a(!0)}))}))}))}function Dt(e){for(var t,n=o.ConfigModel.getConfig(),i=[{label:"Current Message Header",value:"current"},{label:"Camel Exchange Property",value:"camelExchangeProperty"}],a=Et(e?n.sourceDocs:n.targetDocs);!(t=a()).done;){var r=t.value;i.push({value:r.id,label:r.name})}return i}function Nt(){var e,t=o.ConfigModel.getConfig();return!(null===t||void 0===t||null===(e=t.mappings)||void 0===e||!e.activeMapping)}var It=function(){function e(t){this.uuid=t+e.sequence++}return e.prototype.getUuid=function(){return this.uuid},e}();function xt(){var e,t,n,i=o.ConfigModel.getConfig();return Nt()&&(null!==(e=i.mappings)&&void 0!==e&&null!==(t=e.activeMapping)&&void 0!==t&&null!==(n=t.transition)&&void 0!==n&&n.expression||function(){var e,t=o.ConfigModel.getConfig();if(!Nt()||null===(e=t.mappings)||void 0===e||!e.activeMapping)return null;var n=t.mappings.activeMapping,i=n.transition.expression;return i?n.transition.expression&&n.transition.expression.setConfigModel(t):(n.transition.expression=new o.ExpressionModel(n,t),(i=n.transition.expression).generateInitialExpression(),i.updateFieldReference(n)),n.transition.expression}())&&i.mappings.activeMapping.transition.expression&&i.mappings.activeMapping.transition.enableExpression?i.mappings.activeMapping.transition.expression.toHTML():""}It.sequence=0,(function(e){function t(n){var i;return(i=e.call(this,t.PREFIX)||this).str=n,i}mt(t,e);var n=t.prototype;return n.toText=function(){return this.str},n.toHTML=function(){return'<span id="'+this.uuid+'">'+this.str.replace(/ /g,"&nbsp;")+"</span>"},t}(It)).PREFIX="expression-text-",(function(e){function t(n,i,a){var r;return(r=e.call(this,t.PREFIX)||this).mapping=n,r.mfield=i,!i&&a&&(r.field=n.getMappedFieldForIndex((a+1).toString(),!0)),r}mt(t,e);var n=t.prototype;return n.toText=function(){return this.mapping&&this.field?"${"+(this.mapping.getIndexForMappedField(this.field)-1)+"}":""},n.toHTML=function(){return this.field?this.field&&this.field.field?'<span contenteditable="false" id="'+this.uuid+'" title="'+this.field.field.docDef.name+":"+this.field.field.path+'"\n        class="expressionFieldLabel label label-default">'+this.field.field.name+"</span>":'<span contenteditable="false" id="'+this.uuid+'"\n        title="Field index \''+(this.mapping.getIndexForMappedField(this.field)-1)+'\' is not available"\n        class="expressionFieldLabel label label-danger">N/A</span>':""},t}(It)).PREFIX="expression-field-";var Pt=l.a.create({headers:{"ATLASMAP-XSRF-TOKEN":"awesome"}});var wt=new o.InitializationService(Pt),Rt=wt.cfg;function _t(e){var t,n=o.ConfigModel.getConfig(),i=e.partOfMapping;return(i?n.showMappedFields:n.showUnmappedFields&&e.visibleInCurrentDocumentSearch)?{id:(e.docDef.uri||e.docDef.type+"-"+e.scope)+":"+(e.docDef.isSource?"source":"target")+":"+e.path,name:e.getFieldLabel(!1,!1),type:e.type,path:e.path,scope:e.scope?e.scope:"",value:e.value,amField:e,mappings:(null===(t=n.mappings)||void 0===t?void 0:t.findMappingsForField(e).map(Gt).filter((function(e){return e})))||[],hasTransformations:e.partOfTransformation,isAttribute:e.isAttribute,isCollection:e.isCollection,isInCollection:e.isInCollection(),isConnected:i,isDisabled:"UNSUPPORTED"===e.type||"COMPLEX"===e.type&&!e.enumeration,enumeration:e.enumeration}:null}function jt(e){return e.children.length>0?function(e){var t=e.children.map(jt).filter((function(e){return e}));return t.length>0&&e.visibleInCurrentDocumentSearch?{id:(e.docDef.uri||e.docDef.type+"-"+e.scope)+":"+(e.docDef.isSource?"source":"target")+":"+e.path,name:e.name,type:e.type,isCollection:e.isCollection,isInCollection:e.isInCollection(),fields:t,amField:e}:null}(e):_t(e)}function kt(e){return{alias:e.alias,uri:e.uri,locationUri:e.locationUri,isTarget:e.isTarget}}function Lt(e){if(!e||!e.fields||0===e.fields.length)return null;var t=e.fields.map(jt).filter((function(e){return e})),n=e.namespaces.map(kt).filter((function(e){return e}));return e.visibleInCurrentDocumentSearch&&t.length>0?{id:e.id,fields:t,name:e.name,type:e.type,namespaces:n}:null}function Ut(e){var t;return e.field&&e.field.docDef?{id:(e.field.docDef.uri||e.field.docDef.type+"-"+e.field.scope)+":"+(e.field.docDef.isSource?"source":"target")+":"+e.field.path,name:e.field.getFieldLabel(!1,!1),type:e.field.type,path:e.field.path,scope:null!==(t=e.field)&&void 0!==t&&t.scope?e.field.scope:"",value:e.field.value,hasTransformations:!1,mappings:[],isAttribute:!1,isCollection:!1,isInCollection:!1,isConnected:!1,isDisabled:!1,enumeration:!1,amField:e.field,transformations:e.actions.map((function(t){return{name:t.name,options:en(e.isSource()).map((function(e){return{name:o.CommonUtil.toDisplayable(e.name),value:e.name}})),arguments:t.definition.arguments.map((function(e,n){var i,a;return{label:(null===(i=e.serviceObject)||void 0===i||null===(a=i.title)||void 0===a?void 0:a.length)>0?e.serviceObject.title:o.CommonUtil.toDisplayable(e.name),type:e.type,name:e.name,value:t.argumentValues[n].value,options:e.values?e.values.map((function(e){return{name:e,value:e}})):void 0}}))}}))}:null}function Vt(e){switch(e){case o.ErrorLevel.INFO:return"info";case o.ErrorLevel.WARN:return"warning";case o.ErrorLevel.ERROR:return"danger";default:return"default"}}function zt(e){switch(Object(r.a)(e)){case"string":return e;default:return(null===e||void 0===e?void 0:e.message)||JSON.stringify(e)}}function Bt(e){switch(e){case o.ErrorType.INTERNAL:return"Internal";case o.ErrorType.USER:return"User";case o.ErrorType.VALIDATION:return"Validation";case o.ErrorType.PREVIEW:return"Preview";case o.ErrorType.FORM:return"Form"}}function Jt(e){var t;return{variant:Vt(e.level),title:e.mapping&&e.type!==o.ErrorType.PREVIEW?Bt(e.type)+': "'+e.mapping.transition.getPrettyName()+'"':Bt(e.type),description:zt(e.message),id:e.identifier,mappingId:null===(t=e.mapping)||void 0===t?void 0:t.uuid}}function Gt(e){return e?{id:e.uuid,name:e.transition.getPrettyName(),sourceFields:e.getUserMappedFields(!0).map(Ut).filter((function(e){return e})),targetFields:e.getUserMappedFields(!1).map(Ut).filter((function(e){return e})),mapping:e}:null}function qt(e,t){return wt.cfg.expressionService.executeFieldSearch(wt.cfg,e,t)}function Ht(e,t,n,i,a){var r=wt.cfg.mappings.activeMapping;r&&e&&t&&(Rt.expressionService.addFieldToExpression(r,e,t,n,i,a),wt.cfg.mappingService.notifyMappingUpdated())}function Yt(){if(wt.cfg.mappings&&wt.cfg.mappings.activeMapping){var e=wt.cfg.mappings.activeMapping;e.getMappedFields(!0).filter((function(e){return e.isPadField()})).forEach((function(t){return e.removeMappedField(t)})),e.transition.expression?e.transition.expression.setConfigModel(wt.cfg):(e.transition.expression=new o.ExpressionModel(e,wt.cfg),e.transition.expression.generateInitialExpression()),e.transition.expression.updateFieldReference(e)}}function Xt(e,t,n){var i=wt.cfg.mappings.activeMapping.transition.expression.clearText(e,t,n);return wt.cfg.mappingService.notifyMappingUpdated(),i}function Wt(e,t,n){wt.cfg.mappings.activeMapping.transition.expression.insertText(e,t,n),wt.cfg.mappingService.notifyMappingUpdated()}function Kt(){var e,t,n;return null!==(e=wt.cfg.mappings)&&void 0!==e&&null!==(t=e.activeMapping)&&void 0!==t&&null!==(n=t.transition)&&void 0!==n&&n.expression?wt.cfg.mappings.activeMapping.transition.expression.expressionUpdated$:null}function Zt(e,t,n){wt.cfg.mappings.activeMapping.transition.expression.removeToken(e,t,n),wt.cfg.mappingService.notifyMappingUpdated()}function $t(e,t){e.amField.value=t,wt.cfg.mappingService.notifyMappingUpdated()}function Qt(){wt.cfg.expressionService.toggleExpressionMode(),wt.cfg.mappingService.notifyMappingUpdated()}function en(e){return wt.cfg.fieldActionService.getActionsAppliesToField(wt.cfg.mappings.activeMapping,e,o.Multiplicity.ONE_TO_ONE)}function tn(e){return e.transition.mode===o.TransitionMode.ONE_TO_MANY?wt.cfg.fieldActionService.getActionsAppliesToField(e,!0,o.Multiplicity.ONE_TO_MANY):e.transition.mode===o.TransitionMode.MANY_TO_ONE?wt.cfg.fieldActionService.getActionsAppliesToField(e,!0,o.Multiplicity.MANY_TO_ONE):[]}function nn(){return o.TransitionModel.delimiterModels}function an(e,t){if(e.argumentValues=[],t.populateFieldAction(e),e.argumentValues.values()&&e.argumentValues.length>0&&t.arguments[0]&&t.arguments[0].values&&t.arguments[0].values.length>0)for(var n=0;n<e.argumentValues.length;n++)e.argumentValues[n].value=t.arguments[n].values[n];wt.cfg.mappingService.notifyMappingUpdated()}function rn(e,t,n){var i,a=o.ConfigModel.getConfig(),r=null===(i=a.mappings)||void 0===i?void 0:i.activeMapping;if(r){var l=r.getMappedFieldForIndex(""+(t+1),e);if(l){var s=0;if("number"===typeof n){if(s=n,n<=0||!r)return;var c=r.getMappedFields(e),u=c.length;n>u&&a.mappingService.addPlaceholders(n-c.length,r,u,e)}else{var p=r.getMappedFieldForField(n);if(!p)return;s=r.getIndexForMappedField(p)}a.mappingService.moveMappedFieldTo(r,l,s)}}}function on(e,t){var n,i=o.ConfigModel.getConfig(),a=null===(n=i.mappings)||void 0===n?void 0:n.activeMapping;if(a){var r=a.getMappedFieldForIndex(""+(t+1),e);if(r){var l=new o.FieldAction;en(e)[0].populateFieldAction(l),r.actions.push(l),i.mappingService.notifyMappingUpdated()}}}function ln(e,t,n,i){var a,r=o.ConfigModel.getConfig(),l=null===(a=r.mappings)||void 0===a?void 0:a.activeMapping;if(l){var s=l.getMappedFieldForIndex(""+(t+1),e);if(s){var c=s.actions[n],u=en(e).find((function(e){return e.name===i}));if(c&&u){if(c.argumentValues=[],u.populateFieldAction(c),c.argumentValues.values()&&c.argumentValues.length>0&&u.arguments[0]&&u.arguments[0].values&&u.arguments[0].values.length>0)for(var p=0;p<c.argumentValues.length;p++)c.argumentValues[p].value=u.arguments[p].values[p];r.mappingService.notifyMappingUpdated()}}}}function sn(e,t,n,i,a){var r,l=o.ConfigModel.getConfig(),s=null===(r=l.mappings)||void 0===r?void 0:r.activeMapping;if(s){var c=s.getMappedFieldForIndex(""+(t+1),e);if(c){var u=c.actions[n];u&&(u.setArgumentValue(i,a),l.mappingService.notifyMappingUpdated())}}}function cn(e,t,n){var i,a=o.ConfigModel.getConfig(),r=null===(i=a.mappings)||void 0===i?void 0:i.activeMapping;if(r){var l=r.getMappedFieldForIndex(""+(t+1),e);if(l){var s=l.actions[n];s&&(o.CommonUtil.removeItemFromArray(s,l.actions),a.mappingService.notifyMappingUpdated())}}}function un(e,t){var n,i=null===(n=o.ConfigModel.getConfig().mappings)||void 0===n?void 0:n.activeMapping;if(i){var a=tn(i).find((function(e){return e.name===t}));if(e&&a){if(e.argumentValues=[],a.populateFieldAction(e),e.argumentValues.values()&&e.argumentValues.length>0&&a.arguments[0]&&a.arguments[0].values&&a.arguments[0].values.length>0)for(var r=0;r<e.argumentValues.length;r++)e.argumentValues[r].value=a.arguments[r].values[r];wt.cfg.mappingService.notifyMappingUpdated()}}}function pn(e,t,n){var i=o.ConfigModel.getConfig();e.setArgumentValue(t,n),i.mappingService.notifyMappingUpdated()}function dn(e){wt.cfg.mappingService.selectMapping(e.mapping)}function fn(){wt.cfg.mappingService.deselectMapping()}function mn(e,t,n,i){o.ConfigModel.getConfig().documentService.createConstant(e,t,n,i)}function gn(e){o.ConfigModel.getConfig().documentService.deleteConstant(e)}function vn(e,t,n,i){o.ConfigModel.getConfig().documentService.editConstant(e,t,n,i)}function hn(e,t,n,i,a){o.ConfigModel.getConfig().documentService.createProperty(e,t,n,i,a)}function En(e,t,n){o.ConfigModel.getConfig().documentService.deleteProperty(e,t,n)}function yn(e,t,n,i,a,r){o.ConfigModel.getConfig().documentService.editProperty(e,t,n,i,a,r)}function bn(e,t,n){return o.ConfigModel.getConfig().documentService.getPropertyType(e,t,n)}function Sn(e,t){var n,i=o.ConfigModel.getConfig(),a=wt.cfg.mappingService;if(t&&(e&&null!==(n=i.mappings)&&void 0!==n&&n.activeMapping&&(e.partOfMapping||t.partOfMapping))){var r,l,s,c=null;if(e.partOfMapping)c=a.getFieldSelectionExclusionReason(null===(r=i.mappings)||void 0===r?void 0:r.activeMapping,t);else c=a.getFieldSelectionExclusionReason(null===(l=i.mappings)||void 0===l?void 0:l.activeMapping,e);if(null!==c)return void i.errorService.addError(new o.ErrorInfo({message:"The field '"+t.name+"' cannot be selected, "+c+".",level:o.ErrorLevel.ERROR,mapping:null===(s=i.mappings)||void 0===s?void 0:s.activeMapping,scope:o.ErrorScope.MAPPING,type:o.ErrorType.USER}));if(t.partOfMapping&&i.mappings.activeMapping.targetFields[0].field.path===t.path)return void Mn(e);if(e.partOfMapping&&i.mappings.activeMapping.sourceFields[0].field.path===e.path)return void Mn(t)}e?i.mappingService.addNewMapping(e,!1):i.mappingService.newMapping(),t&&Mn(t)}function Fn(){o.ConfigModel.getConfig().mappingService.newMapping()}function Tn(e){o.ConfigModel.getConfig().mappingService.removeMapping(e)}function Mn(e){o.ConfigModel.getConfig().mappingService.addFieldToActiveMapping(e)}function Cn(e){var t,n=o.ConfigModel.getConfig(),i=null===(t=n.mappings)||void 0===t?void 0:t.activeMapping;if(i){var a=i.getMappedFieldForField(e);a&&(i.removeMappedField(a),n.mappingService.updateMappedField(i))}}function On(e){var t,n=o.ConfigModel.getConfig(),i=null===(t=n.mappings)||void 0===t?void 0:t.activeMapping;i&&e&&(i.removeMappedField(e),n.mappingService.updateMappedField(i))}function An(){var e,t=o.ConfigModel.getConfig(),n=null===(e=t.mappings)||void 0===e?void 0:e.activeMapping;return n?wt.cfg.mappingService.getEnumerationValues(t,n):[]}function Dn(e){var t,n=wt.cfg.mappings.activeMapping.transition.expression.getNode(e);return n&&null!==(t=n.mappedField)&&void 0!==t&&t.field.enumeration?n.mappedField.field.enumValues:[]}function Nn(e,t){var n,i=wt.cfg.mappings.activeMapping,a=i.transition.expression.getNode(e);a&&null!==(n=a.mappedField)&&void 0!==n&&n.field.enumeration&&(wt.cfg.mappingService.setEnumFieldValue(a.mappedField.field,t),i.transition.expression.updateFieldReference(i),wt.cfg.mappingService.notifyMappingUpdated())}function In(){var e,t=o.ConfigModel.getConfig();return wt.cfg.mappingService.isEnumerationMapping(null===(e=t.mappings)||void 0===e?void 0:e.activeMapping)}var xn=function(e,t){try{var n=o.ConfigModel.getConfig(),i=Ct(e,n,t);return Promise.resolve(function(e,t){try{return Promise.resolve(new Promise((function(n){try{return t.mappingService.removeDocumentReferenceFromAllMappings(e.id),e.isSource?o.CommonUtil.removeItemFromArray(e,t.sourceDocs):o.CommonUtil.removeItemFromArray(e,t.targetDocs),Promise.resolve(t.mappingService.notifyMappingUpdated()).then((function(){return Promise.resolve(t.fileService.updateDigestFile()).then((function(){n(!0)}))}))}catch(i){return Promise.reject(i)}})))}catch(n){return Promise.reject(n)}}(i,n)).then((function(){n.initializationService.updateInitComplete()}))}catch(a){return Promise.reject(a)}};function Pn(e,t){return!!Ot(e,o.ConfigModel.getConfig(),t)}function wn(e){return o.ConfigModel.getConfig().fileService.exportADMArchive(e)}function Rn(e,t){return o.ConfigModel.getConfig().fileService.exportADMArchiveIntoEntaxyRegistry(e,t)}function _n(){return o.ConfigModel.getConfig().initializationService.getRuntimeVersion()}function jn(){return"2.5.2"}function kn(e){return o.ConfigModel.getConfig().previewService.toggleMappingPreview(e)}function Ln(e){var t=o.ConfigModel.getConfig();return t.showMappedFields=e,t.initializationService.systemInitializedSource.next(),e}function Un(e){var t=o.ConfigModel.getConfig();return t.showUnmappedFields=e,t.initializationService.systemInitializedSource.next(),e}function Vn(e,t){var n=Object(s.useState)(e),i=n[0],a=n[1];Object(s.useEffect)((function(){return a(e)}),[e]);var r=Object(s.useCallback)((function(){try{var e=function(e){a(e)};return Promise.resolve(t?Promise.resolve(t(!i)).then(e):e(!i))}catch(n){return Promise.reject(n)}}),[t,i]),o=Object(s.useCallback)((function(){return a(!1)}),[]),l=Object(s.useCallback)((function(){return a(!0)}),[]);return{state:i,toggle:r,toggleOff:o,toggleOn:l,setToggle:a}}var zn=Object(s.createContext)(null),Bn=function(e){var t=e.children,n=e.allowPanning,i=void 0!==n&&n,a=e.initialWidth,r=void 0===a?0:a,o=e.initialHeight,l=void 0===o?0:o,u=e.initialZoom,d=void 0===u?1:u,f=e.initialPanX,m=void 0===f?0:f,g=e.initialPanY,v=void 0===g?0:g,h=Object(s.useState)({width:0,height:0,offsetLeft:0,offsetTop:0}),E=h[0],y=h[1],b=Object(s.useRef)([]),S=Object(s.useCallback)((function(e){b.current=b.current.filter((function(t){return t.id!==e}))}),[]),F=Object(s.useCallback)((function(e){S(e.id),b.current=[].concat(b.current,[e])}),[S]),T=Object(s.useCallback)((function(){return b.current}),[]),M=Object(s.useRef)([]),C=Object(s.useCallback)((function(e){M.current=[].concat(M.current,[e])}),[]),O=Object(s.useCallback)((function(e){M.current=M.current.filter((function(t){return t!==e}))}),[]);Object(s.useEffect)((function(){var e=requestAnimationFrame((function t(){e=requestAnimationFrame(t);for(var n=0,i=M.current.length;n<i;n++)M.current[n]()}));return function(){cancelAnimationFrame(e)}}),[]);var A=Object(s.useState)({x:m,y:v}),D=A[0],N=D.x,I=D.y,x=A[1],P=Object(s.useState)(d),w=P[0],R=P[1],_=Object(s.useCallback)((function(e){R((function(t){return Math.max(.2,Math.min(2,t+e))}))}),[R]),j=Object(s.useCallback)((function(){return R(1)}),[R]),k=Object(s.useCallback)((function(){return x({x:0,y:0})}),[x]),L=Object(s.useState)(!1),U=L[0],V=L[1],z=Object(p.a)({onDrag:function(e){var t=e.movement,n=t[0],i=t[1],a=e.first,r=e.last,o=e.memo,l=void 0===o?[N,I]:o;return a&&V(!0),r&&V(!1),x({x:n+l[0],y:i+l[1]}),l},onWheel:function(e){var t=e.delta;_(-.001*t[1])}},{drag:{delay:!0},enabled:i});return c.a.createElement(zn.Provider,{value:{initialWidth:r,initialHeight:l,dimensions:E,setDimension:y,panX:N,panY:I,addRedrawListener:C,removeRedrawListener:O,addRect:F,removeRect:S,getRects:T,zoom:w,updateZoom:_,resetZoom:j,pan:{x:N,y:I},setPan:x,resetPan:k,allowPanning:i,isPanning:U,bindCanvas:z}},t)};function Jn(){var e=Object(s.useContext)(zn);if(!e)throw new Error("A CanvasProvider wrapper is required to use this hook.");var t=e.dimensions,n=t.width,i=t.height,a=e.zoom;return ft({},e,{xDomain:Object(s.useMemo)((function(){return Object(u.a)().range([0,n]).domain([0,n*a])}),[n,a]),yDomain:Object(s.useMemo)((function(){return Object(u.a)().range([i,0]).domain([i*a,0])}),[i,a])})}var Gn=function(e){var t=e.children,n=Jn(),i=n.panX,a=n.panY,r=n.zoom;return c.a.createElement("g",{transform:"\n        translate("+i+" "+a+")\n        scale("+r+")\n      "},t)},qn="Canvas-module_canvasWrapper__2zUnn",Hn="Canvas-module_svg__21OUU",Yn="Canvas-module_panning__3mi51",Xn={width:0,height:0,top:0,left:0,x:0,y:0,right:0,bottom:0};function Wn(e){var t=(void 0===e?{}:e).liveMeasure,n=void 0===t||t,i=Object(s.useRef)(Xn),a=Object(s.useState)(Xn),r=a[0],o=a[1],l=Object(s.useRef)(null),c=Object(s.useCallback)((function(){if(l.current){var e=l.current.getBoundingClientRect();t=e,n=i.current,(t.width!==n.width||t.height!==n.height||t.top!==n.top||t.left!==n.left||t.x!==n.x||t.y!==n.y||t.right!==n.right||t.bottom!==n.bottom)&&(o(e),i.current=e)}var t,n}),[o]);return Object(s.useLayoutEffect)((function(){return c(),n&&(window.addEventListener("resize",c),window.addEventListener("scroll",c)),function(){n&&(window.removeEventListener("resize",c),window.removeEventListener("scroll",c))}}),[n,c]),[l,r,c]}var Kn=function(e){var t=e.children,n=e.className,i=e.style,a=e.isFilled,r=void 0===a||a,o=vt(e,["children","className","style","isFilled"]),l=Jn(),u=l.initialWidth,p=l.initialHeight,f=l.setDimension,m=l.addRedrawListener,g=l.removeRedrawListener,v=Wn(),h=v[0],E=v[1],y=v[2];Object(s.useEffect)((function(){f({width:E.width,height:E.height,offsetLeft:E.left,offsetTop:E.top})}),[E,f]),Object(s.useEffect)((function(){return m(y),function(){return g(y)}}),[m,y,g]);var b=Jn(),S=b.allowPanning,F=b.isPanning,T=b.zoom,M=b.bindCanvas,C=Object(s.useMemo)((function(){return ft({cursor:S?F?"grabbing":"grab":void 0,userSelect:S&&F?"none":"auto",backgroundSize:30*T+"px "+30*T+"px",width:u||"100%",height:p||"100%"},i)}),[S,p,u,F,i,T]);return c.a.createElement("div",{ref:h,className:Object(d.a)(r&&qn)},c.a.createElement("svg",Object.assign({},o,{className:Object(d.a)(Hn,S&&Yn,n),style:C},M()),c.a.createElement(Gn,null,t)))},Zn="HTMLObject-module_foreignObject__2v8cW",$n=Object(s.forwardRef)((function(e,t){var n=e.children,i=e.width,a=e.height,r=e.x,o=e.y,l=e.className,s=vt(e,["children","width","height","x","y","className"]);return c.a.createElement("foreignObject",Object.assign({width:i,height:a,x:r,y:o,className:Object(d.a)(Zn,l)},s,{ref:t}),n)})),Qn="Arc-module_clickable__25tnx",ei=function(e){var t=e.start,n=e.end,i=e.type,a=void 0===i?"horizontal":i,r=e.color,o=void 0===r?"grey":r,l=e.hoveredColor,u=void 0===l?o:l,p=e.strokeWidth,m=void 0===p?2:p,g=e.children,v=vt(e,["start","end","type","color","hoveredColor","strokeWidth","startSideSize","endSideSize","sideStrokeWidth","className","children"]),h=Vn(!1),E=h.state,y=h.toggleOn,b=h.toggleOff,S=m,F=E?u:o,T=Object(s.useMemo)((function(){return("horizontal"===a?f.a:f.c)().context(null).source((function(e){return e.start})).target((function(e){return e.end})).x((function(e){return e.x})).y((function(e){return e.y}))}),[a])({start:t,end:n});return T?c.a.createElement("g",{onMouseEnter:y,onMouseLeave:b,style:{pointerEvents:"all"}},c.a.createElement("path",{d:T,stroke:F,strokeWidth:S,fill:"none"}),c.a.createElement("path",Object.assign({d:T,stroke:"transparent",strokeWidth:20,fill:"none",className:Object(d.a)(v.onClick&&Qn)},v)),g):null};var ti=Object(s.createContext)(null),ni=function(e){var t=e.children,n=Object(s.useRef)({});return c.a.createElement(ti.Provider,{value:{nodes:n,setRef:function(e){for(var t=e.id,i=vt(e,["id"]),a=t+"-"+Date.now(),r=Array.isArray(t)?t:[t],o=0;o<r.length;o++){r[o]&&(n.current[r[o]]=ft({},i,{key:a}))}return a},unsetRef:function(e,t){for(var i=Array.isArray(e)?e:[e],a=0;a<i.length;a++){var r,o=i[a];o&&(null===(r=n.current[o])||void 0===r?void 0:r.key)===t&&delete n.current[o]}}}},t)};function ii(){var e=Object(s.useContext)(ti),t=function(){var e=Jn(),t=e.xDomain,n=e.yDomain,i=e.dimensions,a=i.offsetLeft,r=i.offsetTop,o=e.panX,l=e.panY,c=Object(s.useCallback)((function(e){return t(e-a-o)}),[a,o,t]),u=Object(s.useCallback)((function(e){return n(e-r-l)}),[r,l,n]),p=Object(s.useCallback)((function(e){return{x:c(e.x),y:u(e.y),width:t(e.width),height:n(e.height),top:u(e.top),right:c(e.right),bottom:u(e.bottom),left:c(e.left)}}),[c,u,t,n]);return{getBoundingCanvasRect:Object(s.useCallback)((function(e){var t=e.getBoundingClientRect();return p(t)}),[p]),convertDOMRectToCanvasRect:p,convertClientX:c,convertClientY:u}}().getBoundingCanvasRect,n=Object(s.useCallback)((function(i){if(!e)return null;var a=e.nodes.current[i],r=a?a.ref.current:void 0;if(r){var o,l=t(r);if(0===l.height&&a.parentId)return n(a.parentId);if(a.boundaryId&&(o=n(a.boundaryId))){var s=a.overrideWidth?n(a.overrideWidth):void 0,c=a.overrideHeight?n(a.overrideHeight):void 0,u=(null===s||void 0===s?void 0:s.width)||l.width,p=(null===c||void 0===c?void 0:c.height)||l.height,d=Math.min(Math.max((null===s||void 0===s?void 0:s.left)||l.left,o.left),o.width+o.left-l.width),f=d!==((null===s||void 0===s?void 0:s.x)||l.x),m=Math.min(Math.max((null===c||void 0===c?void 0:c.top)||l.top+l.height/2,o.top),o.height+o.top),g=m===o.top||m===o.height+o.top;return{width:u,height:p,x:d,y:m,left:d,top:m,right:d+u,bottom:m+p,toJSON:function(){return""},clipped:f||g}}return l}return null}),[e,t]);return n}var ai=Object(s.forwardRef)((function(e,t){var n=e.children,i=vt(e,["children"]),a=s.Children.only(n),r=Object(s.useRef)(null);!function(e){var t=Object(s.useContext)(ti);Object(s.useEffect)((function(){if(t&&e.id){var n=t.setRef,i=t.unsetRef,a=n(e);return function(){return i(e.id,a)}}}),[t,e])}(ft({},i,{ref:r}));return Object(s.isValidElement)(a)?Object(s.cloneElement)(a,{ref:function(e){t&&(t.current=e),r.current=e}}):null}));function ri(e){return{x:e.left,y:e.y}}function oi(e){return{x:e.right,y:e.y}}function li(e){return{x:e.x,y:e.bottom}}var si=function(e){var t=e.start,n=e.end,i=e.color,a=vt(e,["start","end","color"]),r=Jn(),o=r.addRedrawListener,l=r.removeRedrawListener,u=ii(),p=Object(s.useState)(null),d=p[0],f=p[1],m=Object(s.useState)("horizontal"),g=m[0],v=m[1],h=Object(s.useCallback)((function(){var e,i=u(t),a=u(n);if(i&&a){var r=i.width<a.width?[i,a]:[a,i],o=r[0],l=r[1];if(o.left>l.left&&o.left<l.right||o.right<l.right&&o.right>l.left){var s=i.top>a.top?[t,n]:[n,t],c=s[1],p=u(s[0]),d=u(c);p&&d?(f({start:(e=p,{x:e.x,y:e.top}),end:li(d),startSideSize:p.clipped?0:p.width,endSideSize:d.clipped?0:d.width}),v("vertical")):f(null)}else{var m=i.left>a.left?[t,n]:[n,t],g=m[1],h=u(m[0]),E=u(g);h&&E?(f({start:ri(h),end:oi(E),startSideSize:h.clipped?0:h.height,endSideSize:E.clipped?0:E.height}),v("horizontal")):f(null)}}else f(null)}),[n,t,u]);return Object(s.useEffect)((function(){return o(h),function(){l(h)}}),[o,l,h]),d?c.a.createElement(ei,Object.assign({start:d.start,end:d.end,type:g,startSideSize:d.startSideSize,endSideSize:d.endSideSize,color:i||(0===(d.startSideSize&&d.endSideSize)?"var(--pf-global--Color--light-300)":"var(--pf-global--Color--dark-200)")},a)):null},ci="Column-module_column__1sNi2",ui="Column-module_hidden__rsQTt",pi=function(e){var t=e.totalColumns,n=void 0===t?1:t,i=e.visible,a=void 0===i||i,r=e.children,o=vt(e,["totalColumns","visible","children"]),l=Object(s.useMemo)((function(){return{flex:"0 0 "+100/n+"%"}}),[n]);return c.a.createElement("div",Object.assign({className:Object(d.a)(ci,!a&&ui),style:l},o),r)},di="ColumnBody-module_body__2hALu",fi=Object(s.forwardRef)((function(e,t){var n=e.children;return c.a.createElement("div",{className:di,ref:t},n)})),mi="Actions-module_toolbar__TsQ-9",gi="Actions-module_toolbarItem__3_5IA",vi=function(e){var t=e.children;return c.a.createElement("div",{className:mi},s.Children.map(t,(function(e,t){return c.a.createElement("div",{className:gi,key:t},e)})))},hi="ColumnHeader-module_header__V1RS7",Ei="ColumnHeader-module_plain__2oPqT",yi="ColumnHeader-module_toolbar__30am1",bi="ColumnHeader-module_title__2ysEf",Si=function(e){var t=e.title,n=e.actions,i=e.variant,a=e.children;return c.a.createElement("div",{className:hi},c.a.createElement("div",{className:Object(d.a)(yi,"plain"===i&&Ei)},c.a.createElement("div",{className:bi},c.a.createElement(m.a,{headingLevel:"h2",size:"lg"},t)),c.a.createElement(vi,null,null===n||void 0===n?void 0:n.filter((function(e){return e})))),a)},Fi="ColumnMapper-module_canvas__MPzdp",Ti=function(e){var t=e.className,n=e.children,i=vt(e,["className","children"]);return c.a.createElement(Kn,Object.assign({},i,{className:Object(d.a)(Fi,t)}),n)},Mi="Columns-module_wrapper__3eMnz",Ci=function(e){var t=e.children,n=Jn().dimensions,i=n.width,a=n.height;return c.a.createElement($n,{width:i,height:a,x:0,y:0},c.a.createElement("div",{className:Mi},t))},Oi=function(e){var t=e.title,n=e.actions,i=void 0===n?[]:n,a=e.onSearch,r=Object(s.useRef)(null);return c.a.createElement(Si,{title:t,actions:[c.a.createElement("form",{onSubmit:function(e){return r.current&&a(r.current.value),e.preventDefault(),!1},key:"search-form"},c.a.createElement(g.a,null,c.a.createElement(v.a,{name:"search",id:"search-"+t,type:"search","aria-label":"Search fields",onChange:a,ref:r,"data-testid":"search-"+t+"-fields-input-field"}),c.a.createElement(h.a,{type:"submit","aria-label":"Search","data-testid":"run-search-"+t+"-button",variant:"control"},c.a.createElement(me.a,null))))].concat(i)})},Ai=window.matchMedia&&(window.matchMedia("(pointer: none)").matches||window.matchMedia("(pointer: coarse)").matches)&&window.matchMedia("(hover: none)").matches,Di=function(e){var t=e.children;return c.a.createElement(Xe.a,{backend:et.a,options:{enableMouseEvents:!0}},t)},Ni=function(e){var t=e.children;return c.a.createElement(Xe.a,{backend:$e.a},t)},Ii=Object(s.createContext)(null),xi=function(e){var t=e.children,n=Object(s.useRef)(null),i=Ai?Di:Ni;return c.a.createElement(i,null,c.a.createElement(Ii.Provider,{value:{getHoveredTarget:function(){return n.current},setHoveredTarget:function(e){return n.current=e}}},t))};function Pi(){var e=Object(s.useContext)(Ii);if(!e)throw new Error("A FieldsDndProvider wrapper is required to use this hook.");return e}var wi,Ri,_i,ji,ki,Li=function(e){var t=e.children,n=Pi().getHoveredTarget,i=Object(We.a)((function(e){return{draggedField:e.getItem(),currentOffset:e.getClientOffset(),isDragging:e.isDragging()}})),a=i.isDragging,r=i.draggedField;return t({isDragging:a,currentOffset:i.currentOffset,draggedField:r,getHoveredTarget:n})},Ui=Object(s.forwardRef)((function(e,t){var n=e.field,i=e.onDrop,a=e.as,r=void 0===a?"div":a,o=e.children,l=vt(e,["field","onDrop","as","children"]),u=Object(Ke.a)({type:n.type,item:n,collect:function(e){return{isDragging:e.isDragging()}},end:function(e,t){t.didDrop()&&i(n,t.getDropResult())}}),p=u[0].isDragging,d=u[1],f=u[2];Object(s.useEffect)((function(){f(Object(Qe.a)(),{captureDraggingState:!0})}),[f]);return c.a.createElement(r,Object.assign({ref:function(e){t&&(t.current=e),d(e)}},l),o({isDragging:p}))})),Vi=Object(s.forwardRef)((function(e,t){var n=e.accept,i=e.target,a=e.canDrop,r=e.as,o=void 0===r?"div":r,l=e.children,u=vt(e,["accept","target","canDrop","as","children"]),p=Pi().setHoveredTarget,d=Object(Ze.a)({accept:n,collect:function(e){return{isOver:e.isOver(),isDroppable:e.canDrop(),isTarget:e.isOver()&&e.canDrop(),field:e.getItem()}},canDrop:function(e,t){return a(t.getItem())},drop:function(){return i}}),f=d[0],m=f.isOver,g=f.isDroppable,v=f.isTarget,h=f.field,E=d[1],y=Object(s.useRef)(!1),b=Object(s.useRef)(!1);return Object(s.useEffect)((function(){m===y.current&&v===b.current||(v?p(i):m||p(null),y.current=m,b.current=v)}),[m,v,p,i]),c.a.createElement(o,Object.assign({ref:function(e){t&&(t.current=e),E(e)}},u),l({isDroppable:g,isOver:m,isTarget:v,field:h}))})),zi="FieldDragLayer-module_canvasObject__2cI4m",Bi="FieldDragLayer-module_canvasInner__3HxGR",Ji=function(){var e=Wn(),t=e[0],n=e[1],i=e[2];return Object(s.useEffect)(i),c.a.createElement(Li,null,(function(e){var i=e.isDragging,a=e.currentOffset,r=e.draggedField;return i&&a&&r?c.a.createElement("div",{style:{position:"absolute",zIndex:1e3,width:n.width,height:n.height,left:a.x-n.width/2,top:a.y-n.height},className:zi},c.a.createElement("div",{ref:t,className:Bi},c.a.createElement(E.a,null,r.name))):null}))},Gi="AddFieldTypeahead-module_select__2irTI",qi="AddFieldTypeahead-module_field__H5L5M",Hi=function(e){var t=e.fields,n=e.ariaLabelTypeAhead,i=e.placeholderText,a=e.isSource,r=Object(s.useCallback)((function(e,n){var i=e.split("\\"),a=t.find((function(e){return e.label===i[1]&&e.group===i[0]}));a&&a.onAdd()}),[t]),o={label:i,group:"",onAdd:function(){}};return c.a.createElement("div",null,c.a.createElement(S.a,{"aria-label":n,className:Gi,"data-testid":"mapping-details-add-field",id:n,onChange:r,placeholder:i},function(e,t){e.unshift(t);var n=e.reduce((function(t,n){var i=n.group+"\\"+n.label;return t[n.group]=[].concat(t[n.group]||[],[c.a.createElement(y.a,{isPlaceholder:0===n.group.length,isDisabled:!1,label:n.label,key:i+(a?"-source":"-target")+e.indexOf(n),value:i,"data-testid":"add-field-option-"+i,className:qi},n.label)]),t}),{});return Object.entries(n).map((function(e){var t=e[0],n=e[1];return c.a.createElement(b.a,{label:t,key:t},n)}))}(t,o)))},Yi=function(e){var t=e.toggle,n=vt(e,["toggle"]),i=Vn(!1),a=i.state,r=i.toggle;return c.a.createElement(F.a,Object.assign({},n,{isOpen:a,onSelect:r,toggle:t({isOpen:a,toggleOpen:r})}))},Xi="ExpressionEnumSelect-module_document__20xcs",Wi="ExpressionEnumSelect-module_field__iFvbJ",Ki="",Zi=function(e){var t=e.selectedNodeId,n=e.enumCandidates,i=e.clearEnumSelect,a=e.onEnumSelect,r="expr-enum-select-"+Ki,o=Vn(!0,p),l=o.state,s=o.toggle,u=o.toggleOff;function p(e){e||(n=[],i())}return c.a.createElement("div",{"aria-label":"Expression Enumeration",className:"enumSelectMenu","data-testid":"expression-enumeration-select"},c.a.createElement(M.a,{onToggle:s,isOpen:l,value:Ki,id:r,onSelect:function(e,n,i){Ki=n,a(t,e.currentTarget.id.split("-").pop()),p(!1),u()},"data-testid":r},n.map((function(e,t){return function(e,t){return 0===e[1].length?c.a.createElement(T.a,{isDisabled:!0,label:e,value:e,key:t,className:Xi}):c.a.createElement(T.a,{label:e,value:e,key:t,className:Wi})}(e.name,t)}))))},$i="ExpressionFieldSearch-module_document__LXQJd",Qi="ExpressionFieldSearch-module_field__2pam4",ea="ExpressionFieldSearch-module_searchMenu__ZA0PV",ta="",na=function(e){var t=e.clearSearchMode,n=e.insertSelectedField,i=e.mappedFieldCandidates;function a(e){e||(i=[],t(!0),r=null)}var r,o="expr-field-search-"+ta,l=Vn(!0,a),s=l.state,u=l.toggle,p=l.toggleOff;function d(e){e.srcElement&&(r=e.srcElement)}function f(e){r&&e&&(r.style.backgroundColor="white",e.focus(),(r=e).style.backgroundColor="lightblue")}function m(e,t,n){}return c.a.createElement("div",{"aria-label":"Expression Field Search",className:ea,"data-testid":"expression-field-search"},c.a.createElement(M.a,{onToggle:u,isOpen:s,value:ta,id:o,onKeyDown:function(e){"Enter"===e.key?e.preventDefault():"ArrowDown"===e.key?(e.preventDefault(),d(e),r&&f(r.nextElementSibling)):"ArrowUp"===e.key?(e.preventDefault(),d(e),r&&f(r.previousElementSibling)):"Tab"===e.key&&(!r&&e.srcElement?(r=e.srcElement.nextElementSibling.firstElementChild).style.backgroundColor="lightblue":r&&r.nextElementSibling&&(e.preventDefault(),f(r.nextElementSibling)))},onSelect:function(e,t,i){if(!i){var r=e.target.getAttribute("label");n(r,ta=t)}a(!1),p()},"data-testid":o},i.map((function(e,t){return function(e,t){return"/"!==e[1][0]?c.a.createElement(T.a,{label:e[0],value:e[0],key:t,index:t,className:$i,isPlaceholder:!0}):c.a.createElement(T.a,{label:e[0],value:e[1],key:t,keyHandler:m,index:t,className:Qi})}(e,t)}))))},ia=-1,aa=[],ra=null,oa=[],la=null,sa="",ca=!1,ua="",pa="",da="";function fa(e){if(la)if(e)la.innerHTML=pa;else{var t=_i();la.innerHTML=t+pa}}function ma(){if(la&&0!==da.length){var e,t=la.querySelector("#"+da);if(t)window.getSelection().rangeCount>0?e=window.getSelection().getRangeAt(0):(e=document.createRange(),window.getSelection().addRange(e)),e.selectNode(t.childNodes[0]),e.setStart(t.childNodes[0],0),e.collapse(!0)}}function ga(e){if(la&&e&&e.node){for(var t=0;t<la.childNodes.length;t++){var n=la.childNodes[t];if(n.id===e.node.uuid){var i=window.getSelection();if(i&&i.rangeCount){var a=i.getRangeAt(0),r=n.childNodes[0]?n.childNodes[0]:n;a.selectNode(r),e.offset<=r.length&&a.setStart(r,e.offset),a.collapse(!0)}return}}ma()}}function va(){ji();var e=ki();e&&(Ri=e.subscribe((function(e){ra=e}))),fa(),ra?(ga(ra),ra=null):ma()}var ha=function(e){var t,n,i,a,r,o=e.executeFieldSearch,l=e.getFieldEnums,u=e.mappingExpressionAddField,p=e.mappingExpressionClearText,f=e.isMappingExpressionEmpty,m=e.mappingExpressionInit,E=e.mappingExpressionInsertText,y=e.mappingExpressionObservable,b=e.mappingExpressionRemoveField,S=e.mappingExpression,F=e.trailerId,T=e.disabled,M=e.onToggle,D=e.setSelectedEnumValue,N=Vn(!1),I=N.state,x=N.toggleOn,P=N.toggleOff;function w(e){var t,n,i=window.getSelection();if(i&&la)if(i.rangeCount){n=!(e||!i.focusNode||i.focusNode.nodeType!==i.focusNode.TEXT_NODE||i.focusOffset!==(null===(t=i.focusNode.textContent)||void 0===t?void 0:t.length));var a=i.getRangeAt(0),r=a.startContainer,o=a.startOffset;if(r===la)return 0===o?void(e||f||b(_(),0)):void(e&&!f&&b());if(_(r)===da)return e&&b(),void ma();b(_(),e?o-1:o,n),_()===da&&ma()}else _()===da&&e&&(b(),ma())}function R(e){if(-1===ia)return null;var t=ia,i=t+sa.length+1;return e===da?n():n(e,t,i)}function _(e){var t,n,i=window.getSelection();if(!e){if(!i||0===i.rangeCount)return da;e=i.getRangeAt(0).startContainer}return e.nodeType===(null===i||void 0===i||null===(t=i.focusNode)||void 0===t?void 0:t.TEXT_NODE)?e.parentElement.getAttribute("id"):null===(n=e.firstChild)||void 0===n?void 0:n.getAttribute("id")}function j(e){e&&R(_(wi)),ia=-1,wi=void 0,ca=!1,sa="",oa=[]}function k(){0===sa.length?(oa=[],ca=!1):(sa=sa.substr(0,sa.length-1),oa=i(sa,!0))}function L(){ua="",aa=[],P()}var U=Object(s.useCallback)((function(){va()}),[]);t=u,n=p,i=o,a=l,r=D,_i=function(){return S||""},ji=m,ki=y,pa='<span id="'+(da=F)+'">&nbsp;</span>';return Object(s.useEffect)((function(){if(void 0!==S)return U(),function(){Ri&&Ri.unsubscribe()}}),[S,U]),c.a.createElement(c.a.Fragment,null,c.a.createElement(C.a,null,c.a.createElement(O.a,{fieldId:"expressionContent"},c.a.createElement(g.a,null,c.a.createElement(A.a,{content:"Enable/ Disable conditional mapping expression.",enableFlip:!0,entryDelay:750,exitDelay:100,position:"left"},c.a.createElement(h.a,{variant:"control","aria-label":"Enable/ Disable conditional mapping expression",tabIndex:-1,onClick:M,"data-testid":"enable-disable-conditional-mapping-expression-button",isDisabled:T},c.a.createElement("i",null,"f",c.a.createElement("small",{style:{position:"relative",bottom:-3}},"(x)")))),T||void 0===S?c.a.createElement(v.a,{isDisabled:!0,"aria-label":"Expression content"}):c.a.createElement(A.a,{content:"Enter text or '@' for source\xa0fields menu.",enableFlip:!0,entryDelay:750,exitDelay:100,position:"left"},c.a.createElement("div",{id:"expressionMarkup",key:"expressionMarkup-div","aria-label":"Expression Content",contentEditable:!0,className:Object(d.a)(nt.a.formControl,"ExpressionFieldSearch"),suppressContentEditableWarning:!0,onChange:function(e){f&&U(),Ri&&Ri.unsubscribe(),Ri=ki().subscribe((function(e){fa(),ga(e)})),fa()},onKeyDown:function(e){"Backspace"===e.key?(e.preventDefault(),w(!0),ca&&k()):"Delete"===e.key&&(e.preventDefault(),w(!1),ca&&k())},onKeyPress:function(e){e.ctrlKey||e.metaKey||e.altKey||e.key.length>1||(e.preventDefault(),f&&va(),ca?e.key.match(/[a-z0-9]/i)&&(sa+=e.key,oa=i(sa,!0)):(ca="@"===e.key)&&(wi=window.getSelection().getRangeAt(0).startContainer,ia=window.getSelection().getRangeAt(0).startOffset,oa=i(sa="",!0)),function(e){var t=window.getSelection().getRangeAt(0),n=t.startContainer,i=t.startOffset;if(la&&n===la)if(0===i){var a=n.childNodes[0];E(e,a.getAttribute("id"),0)}else E(e);else{var r=_();r===da?E(e):E(e,r,i)}}(e.key))},onPaste:function(e){if(e&&e.clipboardData){e.preventDefault();var t=e.clipboardData.getData("text/plain");E(t)}},onClick:function(e){ua=_(),(aa=a(ua)).length>0&&(e.preventDefault(),x())},ref:function(e){return la=e},tabIndex:-1,style:{paddingLeft:8}}))))),c.a.createElement("div",null,oa.length>0&&c.a.createElement("span",null,c.a.createElement(na,{clearSearchMode:j,insertSelectedField:function(e,n){var i=R(_(wi));if(null!==i){var a=_(wi)===da;t(e,n,i,ia,a),j(!1),la.focus()}},mappedFieldCandidates:oa})),I&&c.a.createElement("span",null,c.a.createElement(Zi,{selectedNodeId:ua,enumCandidates:aa,clearEnumSelect:L,onEnumSelect:function(e,t){r(e,t),L()}}))))},Ea="ConditionalExpressionInput-module_toolbarItem__1SRmf",ya=function(e){var t=e.executeFieldSearch,n=e.getFieldEnums,i=e.mappingExpressionAddField,a=e.mappingExpressionClearText,r=e.isMappingExpressionEmpty,o=e.mappingExpressionInit,l=e.mappingExpressionInsertText,s=e.mappingExpressionObservable,u=e.mappingExpressionRemoveField,p=e.mappingExpression,d=e.trailerId,f=e.disabled,m=e.onToggle,g=e.setSelectedEnumValue;return c.a.createElement(D.a,{variant:"filter-group",className:Ea,role:"form"},c.a.createElement(N.a,{className:Ea},c.a.createElement(ha,{disabled:f,executeFieldSearch:t,getFieldEnums:n,mappingExpressionAddField:i,mappingExpressionClearText:a,isMappingExpressionEmpty:r,mappingExpressionInit:o,mappingExpressionInsertText:l,mappingExpressionObservable:s,mappingExpressionRemoveField:u,mappingExpression:p,trailerId:d,onToggle:m,setSelectedEnumValue:g})))},ba=function(e){var t=e.title,n=e.onClose,i=e.isOpen,a=e.uiVersion,r=e.runtimeVersion;return c.a.createElement(I.a,{variant:"small",title:t,isOpen:i,onClose:n,actions:[c.a.createElement(h.a,{key:"close",variant:"primary",onClick:n,"aria-label":"Close","data-testid":"about-dialog-close-button",isDisabled:!n},"Close")]},c.a.createElement("div",null,"UI Version: ",a),c.a.createElement("div",null,"Runtime Version: ",r))},Sa=function(e){var t=e.title,n=e.description,i=e.dataTestid,a=e.onCancel,r=e.onConfirm,o=e.isOpen,l=e.children;return c.a.createElement(I.a,{variant:"small",title:t,description:n,"data-testid":i,isOpen:o,onClose:a,actions:[c.a.createElement(h.a,{key:"confirm",variant:"primary",onClick:r,"aria-label":"Confirm","data-testid":"confirmation-dialog-confirm-button",isDisabled:!r},"Confirm"),c.a.createElement(h.a,{key:"cancel",variant:"link",onClick:a,"aria-label":"Cancel","data-testid":"confirmation-dialog-cancel-button"},"Cancel")]},l)},Fa=function(e){var t=e.title,n=e.name,i=void 0===n?"":n,a=e.value,r=void 0===a?"":a,o=e.valueType,l=void 0===o?"":o,u=e.valueTypeOptions,p=e.isOpen,d=e.onCancel,f=e.onConfirm,m=e.onValidation,g=Object(s.useState)(i),h=g[0],E=g[1],b=Object(s.useState)(r),F=b[0],T=b[1],M=Object(s.useState)(l),D=M[0],N=M[1],I=Object(s.useState)(!0),P=I[0],w=I[1],R=Object(s.useState)(!1),_=R[0],j=R[1],k=Object(s.useState)(x.d.default),L=k[0],U=k[1],V=Object(s.useCallback)((function(){E(i),T(r),N(l),j(!1),U(x.d.default),w(!0)}),[i,r,l]),z=Object(s.useCallback)((function(){f({name:h,value:F,valueType:D}),V()}),[f,V,h,F,D]),B=Object(s.useCallback)((function(){d(),V()}),[d,V]);function J(e){G(e,F),E(e)}function G(e,t){if(!e||0===e.length)return U(x.d.default),j(!1),!1;if(!/^[a-zA-Z0-9_@-]+$/.test(e))return U(x.d.error),!1;U(x.d.success);var n=m(e,t);return j(t.length>0&&n),w(n),n}return Object(s.useEffect)(V,[V]),c.a.createElement(Sa,{title:t,onCancel:B,onConfirm:_?z:void 0,isOpen:p},c.a.createElement(C.a,null,c.a.createElement(O.a,{label:"Name",fieldId:"name",isRequired:!0},P?c.a.createElement(v.a,{value:h,onChange:J,id:"name",autoFocus:!0,isRequired:!0,"data-testid":"constant-name-text-input",validated:L}):c.a.createElement(A.a,{content:c.a.createElement("div",null,"A constant with this name already exists"),entryDelay:750,exitDelay:100},c.a.createElement(v.a,{value:h,onChange:J,id:"name",autoFocus:!0,isRequired:!0,"data-testid":"constant-name-text-input-tooltip",style:{color:"red"}}))),c.a.createElement(O.a,{label:"Value",fieldId:"constvalue",isRequired:!0},c.a.createElement(v.a,{value:F,onChange:function(e){G(h,e),T(e)},id:"constvalue",autoFocus:!0,isRequired:!0,"data-testid":"constant-value-text-input"})),c.a.createElement(O.a,{label:"Value type",fieldId:"valueType"},c.a.createElement(S.a,{value:D,"aria-label":"Select value type",onChange:N,"data-testid":"constant-type-form-select"},u.map((function(e,t){var n=e.label,i=e.value;return c.a.createElement(y.a,{key:t,value:i,label:n})}))))))},Ta=function(e){var t=e.title,n=e.customClassName,i=void 0===n?"":n,a=e.customClassNames,r=e.collectionType,o=void 0===r?"":r,l=e.collectionTypeOptions,u=e.isOpen,p=e.onCancel,d=e.onConfirm,f=Object(s.useState)(i),m=f[0],g=f[1],v=Object(s.useState)(o),h=v[0],E=v[1],b=Object(s.useCallback)((function(){g(i),E(o)}),[i,o]),F=Object(s.useCallback)((function(){d({customClassName:m,collectionType:h}),b()}),[d,b,m,h]),T=Object(s.useCallback)((function(){p(),b()}),[p,b]);return Object(s.useEffect)(b,[b]),c.a.createElement(Sa,{title:t,onCancel:T,onConfirm:m.length>0?F:void 0,isOpen:u},c.a.createElement(C.a,null,c.a.createElement(O.a,{label:"Custom class name",fieldId:"custom-class-name",isRequired:!0},c.a.createElement(S.a,{value:m,"aria-label":"Select class name",autoFocus:!0,onChange:g,"data-testid":"custom-class-name-form-select"},u&&a&&a.map((function(e,t){return c.a.createElement(y.a,{key:t,value:e,label:e})})))),c.a.createElement(O.a,{label:"Collection type",fieldId:"valueType"},c.a.createElement(S.a,{value:h,"aria-label":"Select value type",onChange:E,"data-testid":"collection-type-form-select"},l.map((function(e,t){var n=e.label,i=e.value;return c.a.createElement(y.a,{key:t,value:i,label:n})}))))))},Ma=function(e){var t=e.id,n=e.name,i=void 0===n?"":n,a=e.isSource,r=e.isOpen,o=e.onCancel,l=e.onConfirm,u=Object(s.useState)(i),p=u[0],d=u[1],f=Object(s.useCallback)((function(){d(i)}),[i]),m=Object(s.useCallback)((function(){t&&void 0!==a&&l({id:t,name:p,isSource:a}),f()}),[p,t,a,l,f]),g=Object(s.useCallback)((function(){o(),f()}),[o,f]);return Object(s.useEffect)(f,[f]),c.a.createElement(Sa,{title:"Change selected document name?",onCancel:g,onConfirm:m,isOpen:r},c.a.createElement(v.a,{value:p,onChange:function(e){d(e)},id:t,name:p,"data-testid":t+"-parameter-text-input"}))},Ca=function(e){var t=e.isOpen,n=e.onCancel,i=e.onConfirm,a=Object(s.useState)("atlasmap-mapping"),r=a[0],o=a[1],l=r.length>0?function(){return i(r)}:void 0;return c.a.createElement(Sa,{title:"Export Mappings and Documents.",onCancel:n,onConfirm:l,isOpen:t,dataTestid:"export-catalog-dialog"},c.a.createElement(C.a,null,c.a.createElement(O.a,{label:"Please enter a name for your exported catalog file",fieldId:"filename",isRequired:!0},c.a.createElement(g.a,null,c.a.createElement(v.a,{value:r,onChange:o,id:"filename",isRequired:!0,autoFocus:!0,"data-testid":"export-catalog-dialog-text-input"}),c.a.createElement(P.a,null,".adm")))))},Oa=function(e){var t=e.isOpen,n=e.onCancel,i=e.onConfirm,a=Object(s.useState)("atlasmap-mapping"),r=a[0],o=a[1],l=Object(s.useState)("schemas:"),u=l[0],p=l[1];window.onmessage=function(e){e.origin===window.origin&&p(e.data)};var d=r.length>0&&u.length>0?function(){return i(r,u)}:void 0;return c.a.createElement(Sa,{title:"Export Mappings and Documents.",onCancel:n,onConfirm:d,isOpen:t,dataTestid:"export-catalog-dialog"},c.a.createElement(C.a,null,c.a.createElement(O.a,{label:"Please enter a name for your exported catalog file",fieldId:"filename",isRequired:!0},c.a.createElement(g.a,null,c.a.createElement(v.a,{value:r,onChange:o,id:"filename",isRequired:!0,autoFocus:!0,"data-testid":"export-catalog-dialog-text-input"}),c.a.createElement(P.a,null,".adm"))),c.a.createElement(O.a,{label:"Please select a registry location for your exported catalog file",fieldId:"registryLocation",isRequired:!0},c.a.createElement(g.a,null,c.a.createElement(v.a,{value:u,onChange:p,id:"registryLocation",isRequired:!0}),c.a.createElement(h.a,{onClick:function(){window.top.postMessage("openRegistryViewerForExport",window.top.origin)}},"Select...")))))},Aa="LookupTableDialog-module_iGroup__HpFO3",Da="LookupTableDialog-module_iSelectBody__2sDE3",Na="LookupTableDialog-module_iSelectLabel__k9YCw",Ia=function(e){var t=e.enumerationValue,n=e.sourceKey,i=e.isOpen,a=Object(s.useState)(t.selectedTargetEnumValue),r=a[0],o=a[1];return c.a.createElement(C.a,null,c.a.createElement(O.a,{className:Aa,fieldId:"lookup-table-row"},c.a.createElement(E.a,{className:Na},t.sourceEnumValue),c.a.createElement(S.a,{className:Da,value:r,"aria-label":"enum-map",autoFocus:!0,onChange:function(e,n){o(e),t.selectedTargetEnumValue=e},"data-testid":"enum-map-select",key:r+"-"+n},i&&t.targetEnumValues&&t.targetEnumValues.map((function(e,t){return c.a.createElement(y.a,{key:"tgtenum-"+t,value:e,label:e})})))))},xa=function(e){var t=e.title,n=e.alias,i=void 0===n?"":n,a=e.uri,r=void 0===a?"":a,o=e.locationUri,l=void 0===o?"":o,u=e.targetNamespace,p=void 0!==u&&u,d=e.isOpen,f=e.onCancel,m=e.onConfirm,g=Object(s.useState)(i),h=g[0],E=g[1],y=Object(s.useState)(r),b=y[0],S=y[1],F=Object(s.useState)(l),T=F[0],M=F[1],A=Object(s.useState)(p),D=A[0],N=A[1],I=Object(s.useCallback)((function(){E(i),S(r),M(l),N(p)}),[i,l,p,r]),x=Object(s.useCallback)((function(){m({alias:h,uri:b,locationUri:T,targetNamespace:D}),I()}),[h,T,m,I,D,b]),P=Object(s.useCallback)((function(){f(),I()}),[f,I]);return Object(s.useEffect)(I,[I]),c.a.createElement(Sa,{title:t,onCancel:P,onConfirm:h.length>0?x:void 0,isOpen:d},c.a.createElement(C.a,null,c.a.createElement(O.a,{label:"Alias",fieldId:"alias",isRequired:!0},c.a.createElement(v.a,{value:h,onChange:E,id:"alias",autoFocus:!0,isRequired:!0})),c.a.createElement(O.a,{label:"URI",fieldId:"uri"},c.a.createElement(v.a,{value:b,onChange:S,id:"uri"})),c.a.createElement(O.a,{label:"Location URI",fieldId:"locationUri"},c.a.createElement(v.a,{value:T,onChange:M,id:"locationUri"})),c.a.createElement(O.a,{fieldId:"targetNamespace"},c.a.createElement(w.a,{isChecked:D,onChange:N,id:"targetNamespace",label:"Target namespace"}))))},Pa=function(e){var t=e.title,n=e.name,i=void 0===n?"":n,a=e.valueType,r=void 0===a?"":a,o=e.valueTypeOptions,l=e.scope,u=void 0===l?"":l,p=e.scopeOptions,d=e.isOpen,f=e.onCancel,m=e.onConfirm,g=e.onValidation,h=Object(s.useState)(i),E=h[0],b=h[1],F=Object(s.useState)(r),T=F[0],M=F[1],D=Object(s.useState)(u),N=D[0],I=D[1],P=Object(s.useState)(!1),w=P[0],R=P[1],_=Object(s.useState)(x.d.default),j=_[0],k=_[1],L=Object(s.useState)(!1),U=L[0],V=L[1],z=Object(s.useCallback)((function(){b(i),M(r),I(u),R(!1),k(x.d.default),V(!1)}),[i,r,u]),B=Object(s.useCallback)((function(){m({name:E,valueType:T,scope:N}),z()}),[E,m,z,T,N]),J=Object(s.useCallback)((function(){f(),z()}),[f,z]);function G(e){H(e,N),b(e)}function q(e){H(E,e)&&I(e)}function H(e,t){if(!e||0===e.length)return k(x.d.default),R(!1),!1;if(!/^[a-zA-Z0-9_@]+$/.test(e))return k(x.d.error),!1;k(x.d.success);var n=g(e,t);return V(n),R(e.length>0&&n),n}return Object(s.useEffect)(z,[z]),c.a.createElement(Sa,{title:t,onCancel:J,onConfirm:w?B:void 0,isOpen:d},c.a.createElement(C.a,null,c.a.createElement(O.a,{label:"Name",fieldId:"name",isRequired:!0},U?c.a.createElement(v.a,{value:E,onChange:G,id:"name",autoFocus:!0,isRequired:!0,"data-testid":"property-name-text-input",validated:j}):c.a.createElement(A.a,{content:c.a.createElement("div",null,"A property with this name and scope already exists"),entryDelay:750,exitDelay:100},c.a.createElement(v.a,{value:E,onChange:G,id:"name",autoFocus:!0,isRequired:!0,"data-testid":"property-name-text-input-tooltip",style:{color:"red"}}))),c.a.createElement(O.a,{label:"Value type",fieldId:"valueType"},c.a.createElement(S.a,{value:T,"aria-label":"Select value type",onChange:M,"data-testid":"property-type-form-select"},o.map((function(e,t){var n=e.label,i=e.value;return c.a.createElement(y.a,{key:t,value:i,label:n})})))),c.a.createElement(O.a,{label:"Scope",fieldId:"scope"},U?c.a.createElement(S.a,{value:N,"aria-label":"Select property scope",onChange:q,"data-testid":"property-scope-form-select"},p.map((function(e,t){var n=e.label,i=e.value;return c.a.createElement(y.a,{key:t,label:n,value:i})}))):c.a.createElement(A.a,{content:c.a.createElement("div",null,"A property with this name and scope already exists"),entryDelay:750,exitDelay:100},c.a.createElement(S.a,{value:N,"aria-label":"Select property scope",onChange:q,"data-testid":"property-scope-form-select",style:{color:"red"}},p.map((function(e,t){var n=e.label,i=e.value;return c.a.createElement(y.a,{key:t,label:n,value:i})})))))))},wa=function(e){var t=e.title,n=e.parameters,i=void 0===n?[]:n,a=e.initialParameters,r=e.isOpen,o=e.onCancel,l=e.onConfirm,u=Object(s.useState)([]),p=u[0],d=u[1],f=i.filter((function(e){return!p.map((function(e){return e.name})).includes(e.name)})),m=Object(s.useCallback)((function(){d(a||[])}),[a]),E=Object(s.useCallback)((function(){l(p)}),[p,l]),b=Object(s.useCallback)((function(){o(),m()}),[o,m]),F=Object(s.useCallback)((function(){d(p.concat(ft({},f[0])))}),[p,f]),T=Object(s.useCallback)((function(e){d(p.filter((function(t){return t!==e})))}),[p]),M=Object(s.useCallback)((function(e,t){var n=[].concat(p),i=ft({},n[e],{value:t});n[e]=i,d(n)}),[p]),A=Object(s.useCallback)((function(e,t){if(0!==t){var n=[].concat(p),i=ft({},f[t-1]);n[e]=i,d(n)}}),[p,f]),D={"--pf-c-form__label--FontSize":"large","--pf-c-form--m-horizontal--md__group--GridTemplateColumns":"140px 1fr",marginBottom:"1.0rem"},N={"--pf-c-form--m-horizontal__group-label--md--GridColumnWidth":"380px","--pf-c-form--m-horizontal__group-label--md--PaddingTop":"0rem"};return Object(s.useEffect)(m,[m]),c.a.createElement(Sa,{title:t,onCancel:b,onConfirm:(null===p||void 0===p?void 0:p.length)>0?E:void 0,isOpen:r},c.a.createElement(C.a,{isHorizontal:!0,style:{"--pf-c-form--m-horizontal--md__group--GridTemplateColumns":"340px 1fr","--pf-c-form--GridGap":"0.5rem"}},p.map((function(e,t){return c.a.createElement(O.a,{fieldId:t+"-parameter",key:t,style:e.required?D:N,label:e.required?c.a.createElement("span",null,e.label):c.a.createElement(S.a,{id:"selected-paramater",value:"0",label:e.label,style:{display:"flex",marginLeft:"auto"},onChange:function(e){return A(t,e)}},[e].concat(f).map((function(e,t){return c.a.createElement(y.a,{key:t,value:t,label:e.label})})))},c.a.createElement(g.a,null,e.boolean?c.a.createElement("span",{style:{paddingTop:5,display:"inline",marginLeft:"auto",float:"right"}},c.a.createElement(R.a,{id:e.name,name:e.name,isChecked:"true"===e.value,onChange:function(e){M(t,String(e))}})):e.options&&e.options.length>0?c.a.createElement(S.a,{value:e.value,onChange:function(e){return M(t,e)},id:e.name,name:e.name,"data-testid":e.name+"-parameter-form-select"},e.options.map((function(e,t){var n=e.label,i=e.value;return c.a.createElement(y.a,{key:t,value:i,label:n})}))):c.a.createElement(v.a,{value:e.value,onChange:function(e){return M(t,e)},id:e.name,name:e.name,"data-testid":e.name+"-parameter-text-input"}),!e.required&&c.a.createElement(h.a,{variant:"plain","aria-label":"Action",onClick:function(t){return T(e)},style:{display:"inline",marginLeft:"0",float:"right"}},c.a.createElement(ge.a,null))))})),c.a.createElement("span",null,c.a.createElement(h.a,{style:{display:"inline",float:"left",marginTop:"1.0rem",width:"40"},isDisabled:!f||0===f.length,onClick:F,variant:"link",icon:c.a.createElement(ve.a,null)},"Add parameter"))))},Ra=function(e){var t=e.value,n=e.delay,i=void 0===n?1e3:n,a=e.children,r=Object(s.useState)(t),o=r[0],l=r[1];return Object(s.useEffect)((function(){var e=setTimeout((function(){return l(t)}),i);return function(){return clearTimeout(e)}}),[i,t]),a(o)},_a="TruncatedString-module_fieldName__3A5S8",ja=function(e){var t=e.title,n=e.children;return c.a.createElement("span",{className:_a,"data-title":t||("string"===typeof n?n:void 0)},n)},ka="Document-module_card__RGn2a",La="Document-module_stacked__1U8tH",Ua="Document-module_head__2cUCh",Va="Document-module_header__K5DRL",za="Document-module_actions__TDpqD",Ba="Document-module_headerButton__3FK4r",Ja="Document-module_bodyNoPadding__1QmMP",Ga="Document-module_bodyWithPadding__6CL6F",qa="Document-module_hidden__3sH12",Ha="Document-module_noShadows__1O9rB",Ya="Document-module_dropTarget__3JRG3",Xa="Document-module_dropAccepted__2mBxm",Wa=Object(s.forwardRef)((function(e,t){var n=e.title,i=e.actions,a=e.footer,r=e.selected,o=void 0!==r&&r,l=e.dropTarget,u=void 0!==l&&l,p=e.dropAccepted,f=void 0!==p&&p,g=e.stacked,v=void 0===g||g,E=e.selectable,y=void 0!==E&&E,b=e.noPadding,S=void 0!==b&&b,F=e.noShadows,T=void 0!==F&&F,M=e.startExpanded,C=e.onSelect,O=e.onDeselect,A=e.children,D=vt(e,["id","title","actions","footer","selected","dropTarget","dropAccepted","stacked","selectable","scrollIntoView","noPadding","noShadows","startExpanded","onSelect","onDeselect","children"]),N=Vn(M),I=N.state,x=N.toggle,P=Object(s.useCallback)((function(e){e.stopPropagation(),C&&C()}),[C]),w=Object(s.useCallback)((function(e){switch(e.key){case"Enter":case"Space":C&&C();break;case"Escape":O&&O()}}),[O,C]),R=o||u||f;return c.a.createElement("div",Object.assign({className:Object(d.a)(v&&La),onClick:P,onKeyDown:w,ref:t},D),c.a.createElement(_.a,{isCompact:!0,className:Object(d.a)(ka,T&&Ha,f&&!u&&Xa,u&&Ya),isSelected:R,isSelectable:R||y,"aria-label":n},(n||i)&&c.a.createElement(j.a,{"data-codemods":"true",className:Object(d.a)(Ua)},c.a.createElement(k.a,{className:Object(d.a)(za)},null===i||void 0===i?void 0:i.filter((function(e){return e}))),n&&c.a.createElement(L.a,{className:Object(d.a)(Va)},c.a.createElement(h.a,{variant:"plain",onClick:x,"aria-label":"Expand/collapse this card","data-testid":"expand-collapse-"+n+"-button",className:Object(d.a)(Ba)},c.a.createElement(m.a,{size:"lg",headingLevel:"h2","aria-label":n},c.a.createElement(ja,{title:n},I?c.a.createElement(he.a,null):c.a.createElement(Ee.a,null)," ",n))))),c.a.createElement(U.a,{className:Object(d.a)(S?Ja:Ga,!I&&qa)},A),a))})),Ka="DocumentField-module_element__3UquT",Za="DocumentField-module_row__42UJ1",$a="DocumentField-module_nameWrapper__29uxt",Qa="DocumentField-module_nameIcon__1WpQQ",er="DocumentField-module_statusIcons__1beBv",tr="DocumentField-module_isDragging__bRkvB",nr="DocumentField-module_isSelected__228o4",ir="DocumentField-module_isDisabled__X2vKl",ar="DocumentField-module_actions__Y02bP",rr=Object(s.forwardRef)((function(e,t){var n=e.name,i=e.type,a=e.scope,r=e.icon,o=e.statusIcons,l=e.actions,s=e.showType,u=void 0!==s&&s,p=e.isDragging,f=void 0!==p&&p,m=e.isFocused,g=void 0!==m&&m,v=e.isSelected,h=void 0!==v&&v,E=e.isDisabled,y=void 0!==E&&E,b=e.children,S=Vn(!1),F=S.state,T=S.toggleOff,M=S.toggleOn;return c.a.createElement("div",{ref:t,className:Object(d.a)(Ka,f&&tr,h&&nr,y&&ir),onMouseEnter:y?void 0:M,onMouseLeave:y?void 0:T},c.a.createElement("div",{className:Za},r&&c.a.createElement("div",{className:Qa},r),c.a.createElement(A.a,{key:""+n,position:"auto",enableFlip:!0,content:a?n+" <"+a+">":""+n,entryDelay:750,exitDelay:100},c.a.createElement("div",{className:$a,"data-testid":"document-"+n+"-field"},c.a.createElement(ja,null,n),c.a.createElement("span",null,u&&" ("+i+")"),c.a.createElement("span",{className:er},o&&(null===o||void 0===o?void 0:o.filter((function(e){return e})))))),(F||g)&&l&&!y&&c.a.createElement("div",{className:ar},null===l||void 0===l?void 0:l.filter((function(e){return e})))),b)})),or="DocumentFieldPreview-module_form__MOqh2",lr=function(e){var t=e.id,n=e.value,i=e.onChange,a=Object(it.a)(i,200);return c.a.createElement(C.a,{className:or,onClick:function(e){return e.stopPropagation()}},c.a.createElement(O.a,{label:"Mapping preview",fieldId:t},c.a.createElement(v.a,{id:t,type:"text",onChange:a,defaultValue:n||"","aria-label":"Type sample data here",placeholder:"Type sample data here","data-testid":"input-document-mapping-preview-"+t+"-field"})))},sr="DocumentFieldPreviewResults-module_form__2yX2v",cr=function(e){var t=e.id,n=e.value;return c.a.createElement(C.a,{className:sr},c.a.createElement(O.a,{label:"Preview results",fieldId:t},c.a.createElement(v.a,{id:t,type:"text",value:void 0===n?"":n,"aria-label":"Mapping results preview",placeholder:"Results will be displayed here",isDisabled:!0,"data-testid":"results-document-mapping-preview-"+t+"-field"})))},ur="DocumentFooter-module_footer__2iOjg",pr=function(e){var t=e.children;return c.a.createElement(J.a,{className:ur},t)},dr="DocumentGroup-module_buttonContent__2XWy9",fr="DocumentGroup-module_buttonIcon__-gWtf",mr="DocumentGroup-module_icon__3vO1x",gr=Object(s.forwardRef)((function(e,t){var n=e.name,i=e.type,a=e.icon,r=e.iconTooltip,o=e.showType,l=void 0!==o&&o,u=e.expanded,p=Object(s.useRef)(null);return c.a.createElement("span",{className:dr,ref:function(e){p.current=e,t&&("function"===typeof t?t(e):t.current=e)},"data-testid":"field-group-"+n+"-expanded-"+u+"-field"},c.a.createElement("span",{className:fr},u?c.a.createElement(ye.a,null):c.a.createElement(be.a,null)),n,l&&" ("+i+")",a&&c.a.createElement(A.a,{enableFlip:!0,content:r},c.a.createElement("span",{className:mr},a)))})),vr=function(){return c.a.createElement(G.a,{variant:G.b.full},c.a.createElement(q.a,{variant:"container",component:H.a}),c.a.createElement(m.a,{headingLevel:"h2",size:"lg"},"Loading"))},hr="MappingTransformation-module_transArgs__1bfr5",Er={"--pf-c-form-control--FontSize":"small","--pf-c-form--GridGap":"0",marginTop:"0.4rem"},yr={"--pf-c-form-control--FontSize":"small",marginTop:"1.0rem"},br={"--pf-c-form-control--FontSize":"small",marginTop:"0rem"},Sr=function(e){var t=e.name,n=e.transformationsOptions,i=e.transformationsArguments,a=void 0===i?[]:i,r=e.disableTransformation,l=e.onTransformationArgumentChange,u=e.onTransformationChange,p=e.onRemoveTransformation,f="user-field-action-"+t;return c.a.createElement(c.a.Fragment,null,c.a.createElement(O.a,{fieldId:f+"-transformation"},c.a.createElement(g.a,{style:{background:"transparent"}},c.a.createElement(S.a,{value:t,id:f,isDisabled:r,onChange:u,"data-testid":f,style:Er},n.map((function(e,t){return c.a.createElement(y.a,{label:e.name,value:e.value,key:t})}))),p&&c.a.createElement(h.a,{variant:"plain",onClick:p,"data-testid":"close-transformation-"+t+"-button","aria-label":"Remove the transformation"},c.a.createElement(ge.a,null)))),a.map((function(e,t){var n=f+"-transformation-"+t;switch(e.type){case o.FieldType.BOOLEAN:return function(e,t){return c.a.createElement(w.a,{className:Object(d.a)(hr),id:e,"data-testid":e+"-checkbox",key:e,label:t.label,"aria-label":t.label,isChecked:"true"===t.value,onChange:function(e){return l(t.name,e.toString())}})}(n,e);default:return c.a.createElement(O.a,{className:Object(d.a)(hr),fieldId:n,label:e.label,key:t,style:yr},e.options?function(e,t,n,i){var a,r,o,l,u=function(e){return"User defined"===(null===e||void 0===e?void 0:e.name)},p=null===(a=t.options)||void 0===a?void 0:a.find((function(e){return u(e)})),d=null===(r=t.options)||void 0===r?void 0:r.find((function(e){return e.value===t.value}));d||(t.value?d=p:t.options&&(d=t.options[1],t.value=t.options[1].value));var f="";u(d)&&(f=t.value);var m=Object(s.useState)(!1),g=m[0],h=m[1],E=Object(s.useState)(d),y=E[0],b=E[1],S=Object(s.useState)(f),F=S[0],C=S[1];return(null===y||void 0===y?void 0:y.value)!==(null===(o=d)||void 0===o?void 0:o.value)&&b(d),c.a.createElement(Y.a,null,c.a.createElement(X.a,null,c.a.createElement(M.a,{variant:W.e.single,"aria-label":t.label,onSelect:function(e,n,a){h(!1);var r=t.options.find((function(e){return e.value===n}));r&&(b(r),t.value=u(r)?F||"":n.toString(),i(t.name,t.value))},selections:null===y||void 0===y?void 0:y.value,onToggle:function(e){h(e)},isOpen:g,placeholderText:"[None]",id:e,isDisabled:n,"data-testid":t.name,style:Er},null===(l=t.options)||void 0===l?void 0:l.map((function(e,t){return c.a.createElement(T.a,{value:e.value,key:t},e.name)})))),u(y)&&c.a.createElement(X.a,null,c.a.createElement(v.a,{id:"userDefined",type:"text",name:"userDefined",value:F,onChange:function(e){C(e),t.value=e,i(t.name,e)},style:br,"data-testid":"userDefined",autoFocus:!0})))}(n,e,r,l):function(e,t){return c.a.createElement(v.a,{id:e,type:"text",name:t.name,isDisabled:r,value:t.value,onChange:function(e){return l(t.name,e)},"data-testid":"insert-transformation-parameter-"+t.name+"-input-field",style:br})}(n,e))}})))},Fr="MappingField-module_field__U8VrI",Tr="MappingField-module_title__2hRMD",Mr="MappingField-module_fieldIndex__3Xgxl",Cr="MappingField-module_fieldName__17AfY",Or="MappingField-module_link__3EapV",Ar="MappingField-module_transformationsWrapper__14gGs",Dr="MappingField-module_transformations__iIDte",Nr={"--pf-c-form-control--FontSize":"small"},Ir=function(e){var t=e.field,n=e.name,i=e.info,a=e.index,r=e.canShowIndex,o=e.mappingExpressionEnabled,l=e.hasTransformations,u=e.onDelete,p=e.onIndexChange,f=e.onNewTransformation,E=e.children,y="mapping-field-"+n;return c.a.createElement(Vi,{key:t?t.id:n,target:{id:t.id,name:t.name,type:"mapping",payload:t},canDrop:function(){return!0},accept:["mapping"]},(function(e){var b=e.isTarget;return c.a.createElement(Ui,{field:{type:"mapping",id:t.id,name:t.name,payload:t},onDrop:function(e,t){p&&p(t.payload)}},(function(e){var S=e.isDragging;return c.a.createElement(ai,{id:[t.id,S?"dnd-start":void 0,b?"dnd-target-field":void 0]},c.a.createElement("div",{className:Fr,"aria-labelledby":y,"data-testid":y},c.a.createElement(Y.a,null,c.a.createElement(X.a,{isFilled:!0},c.a.createElement(m.a,{headingLevel:"h6",size:"md",id:y,className:Tr},r&&c.a.createElement(A.a,{position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:c.a.createElement("div",null,"Edit the index for this element by selecting the arrows or by dragging and dropping the element to the desired position. Placeholders may be automatically inserted to account for any gaps in the indexing.")},c.a.createElement(g.a,{className:Mr},c.a.createElement(P.a,null,"#"),c.a.createElement(v.a,{type:"number",value:a,id:"index",onChange:p,"data-testid":"change-"+n+"-input-index",isDisabled:!p,style:Nr}))),c.a.createElement(A.a,{position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:c.a.createElement("div",null,i)},c.a.createElement("div",{className:Cr},n," ",c.a.createElement(Se.a,null))))),!o&&f&&c.a.createElement(X.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:"Add a new transformation."},c.a.createElement(h.a,{variant:"plain",onClick:f,className:Or,"data-testid":"add-transformation-to-"+n+"-field-button"},c.a.createElement(Fe.a,null)))),c.a.createElement(X.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:"Delete this field from the mapping."},c.a.createElement(h.a,{variant:"plain",onClick:u,className:Or,"data-testid":"remove-"+n+"-from-mapping-button"},c.a.createElement(ge.a,null))))),!o&&l&&E&&s.Children.count(E)>0&&c.a.createElement("div",{className:Object(d.a)(Ar)},c.a.createElement(m.a,{headingLevel:"h6",size:"md"},"Transformations"),c.a.createElement("div",{className:Dr},E))))}))}))},xr="MappingFields-module_wrapper__1N9IY",Pr=function(e){var t=e.title,n=e.isSource,i=e.onCreateConstant,a=e.onCreateProperty,r=e.canAddToSelectedMapping,o=e.children,l=Vn(!0),s=l.state,u=l.toggle;return c.a.createElement("div",{className:xr},c.a.createElement(h.a,{key:"expandable",variant:"plain","aria-label":"Ok",onClick:u,"data-testid":"mapping-fields-detail-"+t+"-toggle",style:{display:"inline",marginLeft:"auto"}},s?c.a.createElement(Te.a,null):c.a.createElement(Me.a,null)),t,c.a.createElement(A.a,{position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create and map a property."),key:"create-property",entryDelay:750,exitDelay:100},c.a.createElement(h.a,{key:"create-prop",variant:"plain","aria-label":"Add Property",isDisabled:!r(n),onClick:function(){return a(n,null)},"data-testid":"mapping-details-add-property-button-test",style:{display:"inline",marginLeft:"auto",float:"right"}},c.a.createElement(Ce.a,null))),n&&c.a.createElement(A.a,{position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create and map a source constant."),key:"create-constant",entryDelay:750,exitDelay:100},c.a.createElement(h.a,{key:"create-const",variant:"plain","aria-label":"Add Constant",isDisabled:!r(n),onClick:i,"data-testid":"mapping-details-add-constant-button-test",style:{display:"inline",marginLeft:"auto",float:"right"}},c.a.createElement(ve.a,null))),s&&o)},wr=function(e){var t=e.variant,n=e.title,i=e.children,a=e.onTimeout,r=e.onClose,o=Object(s.useState)(8e3),l=o[0],u=o[1],p=Vn(!1),d=p.state,f=p.toggleOn,m=p.toggleOff;return Object(s.useEffect)((function(){var e=void 0;return l<=0?a():d||e?u(8e3):e=setInterval((function(){u((function(e){return e-100}))}),100),function(){return e&&clearTimeout(e)}}),[l,d,a]),c.a.createElement(K.a,{isLiveRegion:!0,variant:t,title:n,actionClose:c.a.createElement(Z.a,{title:n,variantLabel:t+" alert",onClose:r}),onMouseEnter:f,onMouseLeave:m},i)},Rr=Object(s.createContext)(null),_r=function(e){var t=e.children,n=Object(s.useState)(null),i=n[0],a=n[1];return c.a.createElement(Rr.Provider,{value:{focusedItem:i,setFocusedItem:a}},t)},jr=function(e){var t=e.ref,n=e.isExpandable,i=void 0!==n&&n,a=e.isExpanded,r=void 0!==a&&a,o=e.collapseTreeitem,l=e.expandTreeitem,c=Object(s.useContext)(Rr);if(!c)throw new Error("useTreeFocus can be used only inside a Tree component");var u=c.focusedItem,p=c.setFocusedItem,d=function(e){var t;return Array.from((null===(t=e.closest("[role=tree]"))||void 0===t?void 0:t.querySelectorAll("[role=treeitem]"))||[]).filter((function(e){var t,n=null===(t=e.parentElement)||void 0===t?void 0:t.closest("[aria-expanded]");return!n||"true"===n.getAttribute("aria-expanded")}))},f=function(e,t){t.forEach((function(e){return e.setAttribute("tabindex","-1")})),t[e].setAttribute("tabindex","0"),t[e].focus()},m=function(){if(t.current){var e=d(t.current),n=null===e||void 0===e?void 0:e.indexOf(t.current);n<e.length-1&&f(n+1,e)}};return{focused:u&&u===t.current,handlers:{onKeyDown:function(e){if(e.target===t.current&&!(e.altKey||e.ctrlKey||e.metaKey))switch(e.key){case" ":case"Enter":e.target===t.current&&(e.target.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0})),p(t.current));break;case"Escape":p(null),e.preventDefault();break;case"ArrowUp":!function(){if(t.current){var e=d(t.current),n=null===e||void 0===e?void 0:e.indexOf(t.current);n>0&&f(n-1,e)}}();break;case"ArrowDown":m();break;case"ArrowRight":i&&(r?m():l&&l());break;case"ArrowLeft":i&&r&&o&&o();break;case"Home":!function(){if(t.current){var e=d(t.current);f(0,e)}}();break;case"End":!function(){if(t.current){var e=d(t.current);f(e.length-1,e)}}()}},onClick:function(e){if(t.current)if(i&&r)e.stopPropagation();else{var n=d(t.current),a=null===n||void 0===n?void 0:n.indexOf(t.current);f(a,n),p(t.current)}},onBlur:function(e){var n,i;(null===(n=e.relatedTarget)||void 0===n?void 0:n.closest("[role=tree]"))!==(null===(i=t.current)||void 0===i?void 0:i.closest("[role=tree]"))&&p(null)}}}},kr="Tree-module_accordion__3FmHH",Lr=function(e){var t=e.children,n=Object(s.useRef)(null);return Object(s.useLayoutEffect)((function(){if(n.current&&!n.current.querySelector('[role=treeitem][tabindex="0"]')){var e=n.current.querySelector("[role=treeitem]");e&&e.setAttribute("tabindex","0")}})),c.a.createElement(_r,null,c.a.createElement("div",{ref:n},c.a.createElement($.a,{asDefinitionList:!1,className:kr,role:"tree"},t)))},Ur="TreeGroup-module_button__J0cG0",Vr="TreeGroup-module_content__36sz6",zr="TreeGroup-module_hiddenContent__35KLm",Br=Object(s.forwardRef)((function(e,t){var n=e.id,i=e.expanded,a=e.level,r=e.setSize,o=e.position,l=e.renderLabel,u=e.children,p=Object(s.useRef)(null),f=Object(s.useState)(!1),m=f[0],g=f[1],v=Object(s.useCallback)((function(){g(!m)}),[m]),h=Object(s.useCallback)((function(e){e.stopPropagation(),v()}),[v]),E=Object(s.useCallback)((function(){return g(!0)}),[]),y=Object(s.useCallback)((function(){return g(!1)}),[]);Object(s.useEffect)((function(){void 0!==i&&g(i)}),[i]);var b=jr({ref:p,isExpandable:!0,isExpanded:m,collapseTreeitem:y,expandTreeitem:E}),S=b.focused,F=b.handlers;return c.a.createElement("div",Object.assign({ref:function(e){p.current=e,t&&("function"===typeof t?t(e):t.current=e)},role:"treeitem","aria-level":a,"aria-setsize":r,"aria-posinset":o,"aria-expanded":m},F,{onClick:function(e){F.onClick(e),e.isPropagationStopped()||v()}}),c.a.createElement(Q.a,null,c.a.createElement(ee.a,{isExpanded:m,id:n+"-toggle","data-testid":n+"-toggle",className:Ur,tabIndex:-1,component:function(e){var t=e.children;return c.a.createElement("span",{role:"heading","aria-level":a+2},t)},onClick:h},l({expanded:m,focused:S||!1})),c.a.createElement(te.a,{isHidden:!m,className:Object(d.a)(Vr,!m&&zr),role:"group"},u({expanded:m,focused:S||!1}))))})),Jr=Object(s.forwardRef)((function(e,t){var n=e.level,i=e.setSize,a=e.position,r=e.children,o=vt(e,["level","setSize","position","children"]),l=Object(s.useRef)(null),u=jr({ref:l}),p=u.focused,d=u.handlers;return c.a.createElement("div",Object.assign({ref:function(e){l.current=e,t&&("function"===typeof t?t(e):t.current=e)},role:"treeitem","aria-level":n,"aria-setsize":i,"aria-posinset":a},d,o),r({focused:p||!1}))}));var Gr="Toolbar-module_toolbar__3-hXm",qr="Toolbar-module_toolbarContent__18Jxq",Hr=function(e){var t=e.children;return c.a.createElement(ne.a,{id:"data-toolbar",className:Object(d.a)(Gr),role:"complementary"},c.a.createElement(ie.a,{className:Object(d.a)(qr)},t))},Yr=function(e){var t=e.children;return c.a.createElement(ne.a,{className:Object(d.a)(Gr)},c.a.createElement(ie.a,{className:Object(d.a)(qr)},t))},Xr="MainContent-module_wrapper__1yI76",Wr=function(e){var t=e.children;return c.a.createElement("div",{className:Xr,role:"main"},t)},Kr="Sidebar-module_sidebar___WsR3",Zr=function(e){var t=e.show,n=e.children;return c.a.createElement(ot.a,{show:t,className:Kr},t&&n())},$r="MainLayout-module_view__1QIGw",Qr=Object(s.memo)((function(e){var t=e.loading,n=e.showSidebar,i=e.renderSidebar,a=e.contextToolbar,r=e.expressionToolbar,o=e.controlBar,l=e.children,s=c.a.createElement(Zr,{show:n},i),u="pf-topology-container"+(s?" pf-topology-container__with-sidebar":"")+(n?" pf-topology-container__with-sidebar--open":"");return t?c.a.createElement(vr,null):c.a.createElement(ae.a,{className:$r},a&&c.a.createElement(re.a,{isFilled:!1},a),r&&c.a.createElement(re.a,{isFilled:!1},r),c.a.createElement(re.a,{isFilled:!0,className:u},c.a.createElement("div",{className:"pf-topology-content"},l,o&&c.a.createElement("span",{className:"pf-topology-control-bar"},o)),s))})),eo="MappingDetailsSidebar-module_content__qShUk",to=function(e){var t=e.onDelete,n=e.onClose,i=e.onEditEnum,a=e.isEnumMapping,r=e.children;return c.a.createElement(ae.a,{"data-testid":"column-mapping-details-area"},c.a.createElement(re.a,null,c.a.createElement(Si,{title:"Mapping Details",variant:"plain",actions:[c.a.createElement(h.a,{onClick:n,variant:"plain","aria-label":"Close the mapping details panel","data-testid":"close-mapping-detail-button",key:"close"},c.a.createElement(Oe.a,null)),c.a.createElement(A.a,{key:"edit-enum",position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Edit the enumeration mappings"),entryDelay:750,exitDelay:100},c.a.createElement(h.a,{variant:"plain",onClick:i,"aria-label":"Edit the enumeration mappings","data-testid":"edit-enum-mapping-button",isDisabled:!a()},c.a.createElement(Ae.a,null))),c.a.createElement(A.a,{key:"remove",position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Remove the current mapping"),entryDelay:750,exitDelay:100},c.a.createElement(h.a,{variant:"plain",onClick:t,"aria-label":"Remove the current mapping","data-testid":"remove-current-mapping-button"},c.a.createElement(ge.a,null)))]})),c.a.createElement(re.a,{isFilled:!0,className:eo},r))},no=function(e){var t=e.id,n=e.onClick;return c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Capture Document ID to clipboard")},c.a.createElement(h.a,{variant:"plain",onClick:n,"aria-label":"Capture Document ID to clipboard","data-testid":"capture-"+t+"-name-button"},c.a.createElement(De.a,null)))},io=function(e){var t=e.id,n=e.onClick;return c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Change document name")},c.a.createElement(h.a,{variant:"plain",onClick:n,"aria-label":"Change document name","data-testid":"change-"+t+"-name-button"},c.a.createElement(Ae.a,null)))},ao=function(e){var t=e.id,n=e.onClick;return c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Remove instance or schema file")},c.a.createElement(h.a,{variant:"plain",onClick:n,"aria-label":"Remove instance or schema file","data-testid":"remove-"+t+"-instance-or-schema-file-button"},c.a.createElement(ge.a,null)))},ro=function(e){var t=e.id,n=e.onClick;return c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Modify CSV Parameters")},c.a.createElement(h.a,{variant:"plain",onClick:n,"aria-label":"Modify CSV parameters","data-testid":"modify-csv-params-"+t+"-button"},c.a.createElement(Ae.a,null)))},oo=function(e){var t=e.isSource,n=e.onImport,i=e.onImportFromEntaxyRegistry,a=Vn(!1),r=a.state,o=a.toggle,l=a.toggleOff,s=function(e){return function(){e.apply(void 0,arguments),l()}},u=t?oe.d.left:oe.d.right,p=[n&&c.a.createElement(lo,{onFile:s(n),key:"import-catalog"}),i&&c.a.createElement(so,{onRegistryLocation:s(i),key:"import-catalog"})].filter((function(e){return e}));return c.a.createElement(F.a,{position:u,toggle:c.a.createElement(V.a,{id:"atlasmap-toggle",onToggle:o,toggleIndicator:null},c.a.createElement(Ie.a,null)),isOpen:r,dropdownItems:p,isPlain:!0})},lo=function(e){var t=e.onFile,n=Object(lt.useFilePicker)({maxFileSize:1}),i=n.files,a=n.onClick,r=n.HiddenFileInput,o=Object(s.useRef)(null);return Object(s.useEffect)((function(){o.current!==i&&(o.current=i,1===(null===i||void 0===i?void 0:i.length)&&(o.current=null,t(i[0])))}),[i,t]),c.a.createElement(z.a,{onClick:a},"Import instance or schema file",c.a.createElement(r,{accept:".json, .xml, .xsd, .csv",multiple:!1}))},so=function(e){var t=e.onRegistryLocation;return window.onmessage=function(e){e.origin===window.origin&&e.data&&t(e.data)},c.a.createElement(z.a,{onClick:function(){window.top.postMessage("openRegistryViewerForImportInstanceOrSchemaFile",window.top.origin)}},"Open instance or schema file from Entaxy registry")},co=function(e){var t=e.fieldId,n=e.group,i=e.showTypes,a=e.boundaryId,r=e.overrideWidth,o=e.parentId,l=e.acceptDropType,s=e.draggableType,u=e.level,p=void 0===u?1:u,d=e.position,f=void 0===d?1:d,m=e.setSize,g=void 0===m?1:m,v=e.children;return c.a.createElement(Vi,{key:t,target:{id:n.id,name:n.name,type:s},canDrop:function(){return!1},accept:[l]},(function(e){var l=e.isOver;return c.a.createElement(Ra,{value:l},(function(e){return c.a.createElement(ai,{id:t,parentId:o,boundaryId:a,overrideWidth:r},c.a.createElement(Br,{id:t,level:p,position:f,setSize:g,expanded:!0===e||void 0,renderLabel:function(t){var a=t.expanded;return c.a.createElement(gr,{name:n.name,type:n.type,showType:i,icon:n.isCollection?c.a.createElement(xe.a,null):void 0,iconTooltip:n.isCollection?"This object is a collection":void 0,expanded:e||a})}},v))}))}))},uo=function(e){var t=e.fieldId,n=e.field,i=e.showTypes,a=e.boundaryId,r=e.overrideWidth,o=e.parentId,l=e.acceptDropType,s=e.draggableType,u=e.level,p=void 0===u?1:u,d=e.position,f=void 0===d?1:d,m=e.setSize,g=void 0===m?1:m,v=e.canDrop,E=e.onDrop,y=e.renderActions,b=void 0===y?function(){return[]}:y,S=e.renderPreview,F=S&&S(n);return c.a.createElement(Vi,{key:t,target:{id:n.id,name:n.name,type:s,payload:n},canDrop:function(e){return v(n,e)},accept:[l]},(function(e){var l=e.isDroppable,u=e.isTarget;return c.a.createElement(Ui,{field:{type:s,id:n.id,name:n.name,payload:n},onDrop:function(e,t){return E(n,t)}},(function(e){var s=e.isDragging;return c.a.createElement(ai,{id:[t,s?"dnd-start":void 0,u?"dnd-target-field":void 0],parentId:o,boundaryId:a,overrideWidth:r},c.a.createElement(Jr,{level:p,position:f,setSize:g},(function(e){var t=e.focused;return c.a.createElement(c.a.Fragment,null,c.a.createElement(rr,{name:n.name,icon:l||u?c.a.createElement(h.a,{variant:u?"link":"plain",tabIndex:-1,"aria-label":"Drop target",isDisabled:!l,"data-testid":"is-droppable-"+n.name+"-button"},c.a.createElement(Pe.a,{size:"sm"})):c.a.createElement(h.a,{variant:"plain",tabIndex:-1,"aria-hidden":!0,"data-testid":"grip-"+n.name+"-button"},c.a.createElement(we.a,null)),type:n.enumeration?"ENUM":n.type,scope:n.scope,showType:i,isDragging:s,isFocused:t,isSelected:!!F,isDisabled:n.isDisabled,statusIcons:[n.isConnected?c.a.createElement(A.a,{key:"connected",position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:c.a.createElement("div",null,"This field is connected")},c.a.createElement(Re.a,{label:"This field is connected",size:"sm",tabIndex:-1})):null,n.isCollection?c.a.createElement(A.a,{key:"collection",position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:c.a.createElement("div",null,"This field is a collection")},c.a.createElement(xe.a,{label:"This field is a collection",size:"sm",tabIndex:-1})):null,n.hasTransformations?c.a.createElement(A.a,{key:"transformations",position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:c.a.createElement("div",null,"This field has transformations")},c.a.createElement(Fe.a,{label:"This field has transformations",size:"sm",tabIndex:-1})):null,n.isAttribute?c.a.createElement(A.a,{key:"attribute",position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:c.a.createElement("div",null,"This field is an attribute")},c.a.createElement(_e.a,{label:"This field is an attribute",size:"sm",tabIndex:-1})):null],actions:b(n)},F))})))}))}))};function po(e,t){return e.reduce((function(e,n){return[].concat(e,[""+t+n.id],n.fields?po(n.fields,t):[])}),[])}var fo=function(e){var t=e.fields,n=e.idPrefix,i=e.isVisible,a=void 0===i||i,r=vt(e,["fields","idPrefix","isVisible"]);return a?c.a.createElement(c.a.Fragment,null,t.map((function(e,i){return c.a.createElement(mo,Object.assign({key:i,field:e,idPrefix:n,setSize:t.length,position:i+1,isVisible:a},r))}))):c.a.createElement(ai,{id:po(t,n),boundaryId:r.boundaryId,parentId:r.parentId},c.a.createElement("div",null,"\xa0"))},mo=function(e){var t=e.field,n=e.idPrefix,i=e.level,a=void 0===i?1:i,r=vt(e,["field","idPrefix","level"]),o=""+n+t.id,l=t,s=t;return l.fields?c.a.createElement(co,Object.assign({fieldId:o,group:l,level:a},r),(function(e){var t=e.expanded;return c.a.createElement(fo,Object.assign({},r,{fields:l.fields,parentId:o,level:a+1,idPrefix:n,isVisible:t}))})):c.a.createElement(uo,Object.assign({fieldId:o,field:s,level:a},r))};function go(e){var t=e.connectedMappings,n=e.onShowMappingDetails,i=e.canAddFieldToSelectedMapping,a=e.onAddToSelectedMapping,r=e.canRemoveFromSelectedMapping,o=e.onRemoveFromSelectedMapping,l=e.canStartMapping,s=e.onStartMapping;return[c.a.createElement(A.a,{key:"select-mapping",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Show mapping details")},t.length>1?c.a.createElement(Yi,{toggle:function(e){var t=e.toggleOpen;return c.a.createElement(V.a,{toggleIndicator:null,"aria-label":"Show mapping details",onToggle:t},c.a.createElement(Ne.a,null))},isPlain:!0,position:"right",dropdownItems:t.map((function(e){return c.a.createElement(z.a,{key:e.id,onClick:function(){return n(e)}},c.a.createElement(m.a,{headingLevel:"h2",size:"lg"},e.name),c.a.createElement(Y.a,{hasGutter:!0},c.a.createElement(X.a,null,c.a.createElement(m.a,{headingLevel:"h2",size:"md"},"Sources"),e.sourceFields.map((function(e){return c.a.createElement("div",{key:e.id},e.name)}))),c.a.createElement(X.a,null,c.a.createElement(m.a,{headingLevel:"h2",size:"md"},"Targets"),e.targetFields.map((function(e){return c.a.createElement("div",{key:e.id},e.name)})))))})),disabled:0===t.length}):c.a.createElement(h.a,{variant:"plain",onClick:function(){return n(t[0])},"aria-label":"Show mapping details",tabIndex:0,isDisabled:0===t.length,"data-testid":"show-mapping-details-button"},c.a.createElement(Ne.a,null))),r?c.a.createElement(A.a,{key:"quick-remove",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Disconnect from the selected mapping")},c.a.createElement(h.a,{variant:"plain",onClick:o,"aria-label":"Disconnect from the selected mapping","data-testid":"disconnect-from-the-selected-mapping-button",tabIndex:0},c.a.createElement(je.a,null))):c.a.createElement(A.a,{key:"quick-add",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Connect to the selected mapping")},c.a.createElement(h.a,{variant:"plain",onClick:a,"aria-label":"Connect to the selected mapping",tabIndex:0,isDisabled:!i,"data-testid":"connect-to-the-selected-mapping-button"},c.a.createElement(ke.a,null))),c.a.createElement(A.a,{key:"add",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create new mapping")},c.a.createElement(h.a,{variant:"plain",onClick:s,"aria-label":"Create new mapping",tabIndex:0,isDisabled:!l,"data-testid":"create-new-mapping-button"},c.a.createElement(Le.a,null)))]}var vo=function(e){var t=e.fields,n=e.onDrop,i=e.canDrop,a=e.onShowMappingDetails,r=e.canAddFieldToSelectedMapping,o=e.onAddToSelectedMapping,l=e.canRemoveFromSelectedMapping,s=e.onRemoveFromSelectedMapping,u=e.onEditConstant,p=e.onDeleteConstant,d=e.canStartMapping,f=e.onStartMapping,m=e.renderPreview;return c.a.createElement(Lr,null,c.a.createElement(fo,{fields:t,showTypes:!1,parentId:"sources-constants",boundaryId:"sources-height",overrideWidth:"sources-width",idPrefix:"sources-field-",acceptDropType:"target",draggableType:"source",onDrop:n,canDrop:i,renderActions:function(e){return[].concat(go({connectedMappings:e.mappings,onShowMappingDetails:a,canAddFieldToSelectedMapping:r(e),onAddToSelectedMapping:function(){return o(e)},canRemoveFromSelectedMapping:l(e),onRemoveFromSelectedMapping:function(){return s(e)},canStartMapping:d(e),onStartMapping:function(){return f(e)}}),[c.a.createElement(A.a,{key:"edit",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Edit constant"),entryDelay:750,exitDelay:100},c.a.createElement(h.a,{variant:"plain",onClick:function(){return u(e.name,e.value)},"aria-label":"Edit constant",tabIndex:0,"data-testid":"edit-constant-"+e.name+"-button"},c.a.createElement(Ae.a,null))),c.a.createElement(A.a,{key:"delete",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Remove constant"),entryDelay:750,exitDelay:100},c.a.createElement(h.a,{variant:"plain",onClick:function(){return p(e.name)},"aria-label":"Remove constant",tabIndex:0,"data-testid":"remove-constant-"+e.name+"-button"},c.a.createElement(ge.a,null)))])},renderPreview:m}))},ho=function(e){var t=e.acceptDropType,n=e.draggableType,i=e.isSource,a=e.fields,r=e.showTypes,o=e.onDrop,l=e.canDrop,s=e.onShowMappingDetails,u=e.canAddFieldToSelectedMapping,p=e.onAddToSelectedMapping,d=e.canRemoveFromSelectedMapping,f=e.onRemoveFromSelectedMapping,m=e.onEditProperty,g=e.onDeleteProperty,v=e.canStartMapping,E=e.onStartMapping,y=e.renderPreview;return c.a.createElement(Lr,null,c.a.createElement(fo,{fields:a,showTypes:r,parentId:i?"sources-properties":"targets-properties",boundaryId:i?"sources-height":"targets-height",overrideWidth:i?"sources-width":"targets-width",idPrefix:i?"sources-field-":"targets-field-",acceptDropType:t,draggableType:n,onDrop:o,canDrop:l,renderActions:function(e){return[].concat(go({connectedMappings:e.mappings,onShowMappingDetails:s,canAddFieldToSelectedMapping:u(e),onAddToSelectedMapping:function(){return p(e)},canRemoveFromSelectedMapping:d(e),onRemoveFromSelectedMapping:function(){return f(e)},canStartMapping:v(e),onStartMapping:function(){return E(e)}}),[c.a.createElement(A.a,{key:"edit",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Edit property"),entryDelay:750,exitDelay:100},c.a.createElement(h.a,{variant:"plain",onClick:function(){return m(e.name,e.scope,i)},"aria-label":"Edit property",tabIndex:0,"data-testid":"edit-property-"+e.name+"-button"},c.a.createElement(Ae.a,null))),c.a.createElement(A.a,{key:"delete",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Remove property"),entryDelay:750,exitDelay:100},c.a.createElement(h.a,{variant:"plain",onClick:function(){return g(e.name,e.scope,i)},"aria-label":"Remove property",tabIndex:0,"data-testid":"remove-property-"+e.name+"-button"},c.a.createElement(ge.a,null)))])},renderPreview:y}))},Eo=function(e){var t=e.acceptDropType,n=e.draggableType,i=e.isSource,a=e.onCreateConstant,r=e.onEditConstant,l=e.onDeleteConstant,u=e.onCreateProperty,p=e.onEditProperty,d=e.onDeleteProperty,f=e.onImportDocument,m=e.onImportDocumentFromEntaxyRegistry,g=e.onDeleteDocument,v=e.onCaptureDocumentID,E=e.onChangeDocumentName,y=e.onEditCSVParams,b=e.onSearch,S=e.canDrop,F=e.onDrop,T=e.onShowMappingDetails,M=e.canAddFieldToSelectedMapping,C=e.onAddToSelectedMapping,O=e.canRemoveFromSelectedMapping,D=e.onRemoveFromSelectedMapping,N=e.canStartMapping,I=e.onStartMapping,x=e.shouldShowMappingPreviewForField,P=e.onFieldPreviewChange,w=e.sourceProperties,R=e.constants,_=e.sources,j=e.showTypes,k=Object(s.useCallback)((function(e){return x(e)&&c.a.createElement(lr,{id:e.id,value:e.value,onChange:function(t){return P(e,t)}})}),[P,x]);return c.a.createElement(c.a.Fragment,null,c.a.createElement(Oi,{title:"Source",onSearch:b,actions:[f&&m&&c.a.createElement(oo,{isSource:!0,onImport:f,onImportFromEntaxyRegistry:m,key:"import"})]}),c.a.createElement(ai,{id:"sources-height"},c.a.createElement(fi,null,c.a.createElement(ai,{id:"sources-width"},c.a.createElement("div",null,c.a.createElement(ai,{id:"sources-properties",boundaryId:"sources-height",overrideWidth:"sources-width"},c.a.createElement(Wa,{title:"Properties",startExpanded:!!w,actions:[c.a.createElement(A.a,{position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create a source property for use in mapping"),key:"create-property",entryDelay:750,exitDelay:100},c.a.createElement(h.a,{onClick:function(){return u(i)},variant:"plain","aria-label":"Create a source property for use in mapping","data-testid":"create-source-property-button"},c.a.createElement(ve.a,null)))],noPadding:!!w},w?c.a.createElement(ho,{acceptDropType:t,draggableType:n,isSource:i,onEditProperty:p,onDeleteProperty:d,canDrop:S,onDrop:F,onShowMappingDetails:T,canAddFieldToSelectedMapping:M,onAddToSelectedMapping:C,canRemoveFromSelectedMapping:O,onRemoveFromSelectedMapping:D,canStartMapping:N,onStartMapping:I,fields:w.fields,showTypes:j,renderPreview:k}):"No source properties")),c.a.createElement(ai,{id:"sources-constants",boundaryId:"sources-height",overrideWidth:"sources-width"},c.a.createElement(Wa,{title:"Constants",startExpanded:!!R,actions:[c.a.createElement(A.a,{position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create a constant for use in mapping"),key:"create-constant",entryDelay:750,exitDelay:100},c.a.createElement(h.a,{onClick:a,variant:"plain","aria-label":"Create a constant for use in mapping","data-testid":"create-constant-button"},c.a.createElement(ve.a,null)))],noPadding:!!R},R?c.a.createElement(vo,{onEditConstant:r,onDeleteConstant:l,canDrop:S,onDrop:F,onShowMappingDetails:T,canAddFieldToSelectedMapping:M,onAddToSelectedMapping:C,canRemoveFromSelectedMapping:O,onRemoveFromSelectedMapping:D,canStartMapping:N,onStartMapping:I,fields:R.fields,renderPreview:k}):c.a.createElement("p",null,"No constants"))),_.map((function(e){var i="sources-document-"+e.id;return c.a.createElement(ai,{key:e.id,id:i,boundaryId:"sources-height",overrideWidth:"sources-width"},c.a.createElement(Wa,{title:e.name,startExpanded:!0,footer:j?c.a.createElement(pr,null,"Source document type: ",e.type):void 0,actions:e.type===o.DocumentType.CSV?[v&&c.a.createElement(no,{id:i,onClick:function(){return v(e.id)},key:"capture-document-id"}),y&&c.a.createElement(ro,{id:i,onClick:function(){return y(e.id,!0)},key:"on-edit-csv-params"}),g&&c.a.createElement(ao,{id:i,onClick:function(){return g(e.id)},key:"delete-document"})]:[v&&c.a.createElement(no,{id:i,onClick:function(){return v(e.id)},key:"capture-document-id"}),E&&c.a.createElement(io,{id:i,onClick:function(){return E(e.id,e.name)},key:"change-document-name"}),g&&c.a.createElement(ao,{id:i,onClick:function(){return g(e.id)},key:"delete-document"})],noPadding:!0},c.a.createElement(Lr,null,c.a.createElement(fo,{fields:e.fields,showTypes:j,boundaryId:"sources-height",overrideWidth:"sources-width",parentId:i,idPrefix:"sources-field-",acceptDropType:t,draggableType:n,onDrop:F,canDrop:S,renderActions:function(e){return go({connectedMappings:e.mappings,onShowMappingDetails:T,canAddFieldToSelectedMapping:M(e),onAddToSelectedMapping:function(){return C(e)},canRemoveFromSelectedMapping:O(e),onRemoveFromSelectedMapping:function(){return D(e)},canStartMapping:N(e),onStartMapping:function(){return I(e)}})},renderPreview:k}))))})))))))},yo=function(e){var t=e.acceptDropType,n=e.draggableType,i=e.isSource,a=e.onSearch,r=e.onImportDocument,l=e.onImportDocumentFromEntaxyRegistry,u=e.onDeleteDocument,p=e.onCaptureDocumentID,d=e.onChangeDocumentName,f=e.onCreateProperty,m=e.onEditCSVParams,g=e.onEditProperty,v=e.onDeleteProperty,E=e.onDrop,y=e.canDrop,b=e.onShowMappingDetails,S=e.canAddFieldToSelectedMapping,F=e.onAddToSelectedMapping,T=e.canRemoveFromSelectedMapping,M=e.onRemoveFromSelectedMapping,C=e.canStartMapping,O=e.onStartMapping,D=e.shouldShowMappingPreviewForField,N=e.targets,I=e.showTypes,x=e.targetProperties,P=Object(s.useCallback)((function(e){return D(e)&&c.a.createElement(cr,{id:e.id,value:e.value})}),[D]);return c.a.createElement(c.a.Fragment,null,c.a.createElement(Oi,{title:"Target",onSearch:a,actions:[r&&l&&c.a.createElement(oo,{isSource:!1,onImport:r,onImportFromEntaxyRegistry:l,key:"import"})]}),c.a.createElement(ai,{id:"targets-height"},c.a.createElement(fi,null,c.a.createElement(ai,{id:"targets-width"},c.a.createElement("div",null,c.a.createElement(ai,{id:"targets-properties",boundaryId:"targets-height",overrideWidth:"targets-width"},c.a.createElement(Wa,{title:"Properties",startExpanded:!!x,actions:[c.a.createElement(A.a,{position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create a target property for use in mapping"),key:"create-target-property",entryDelay:750,exitDelay:100},c.a.createElement(h.a,{onClick:function(){return f(i)},variant:"plain","aria-label":"Create a target property for use in mapping","data-testid":"create-target-property-button"},c.a.createElement(ve.a,null)))],noPadding:!!x},x?c.a.createElement(ho,{acceptDropType:t,draggableType:n,isSource:i,onEditProperty:g,onDeleteProperty:v,canDrop:y,onDrop:E,onShowMappingDetails:b,canAddFieldToSelectedMapping:S,onAddToSelectedMapping:F,canRemoveFromSelectedMapping:T,onRemoveFromSelectedMapping:M,canStartMapping:C,onStartMapping:O,fields:x.fields,showTypes:I,renderPreview:P}):"No target properties")),N.map((function(e){var i="targets-document-"+e.id;return c.a.createElement(ai,{key:e.id,id:i,boundaryId:"targets-height",overrideWidth:"targets-width"},c.a.createElement(Wa,{title:e.name,startExpanded:!0,footer:I?c.a.createElement(pr,null,"Target document type: ",e.type):void 0,actions:e.type===o.DocumentType.CSV?[p&&c.a.createElement(no,{id:i,onClick:function(){return p(e.id)},key:"capture-tgt-csv-document-id"}),m&&c.a.createElement(ro,{id:i,onClick:function(){return m(e.id,!1)},key:"on-edit-tgt-csv-params"}),u&&c.a.createElement(ao,{id:i,onClick:function(){return u(e.id)},key:"delete-tgt-csv-document"})]:[p&&c.a.createElement(no,{id:i,onClick:function(){return p(e.id)},key:"capture-tgt-document-id"}),d&&c.a.createElement(io,{id:i,onClick:function(){return d(e.id,e.name)},key:"change-tgt-document-name"}),u&&c.a.createElement(ao,{id:i,onClick:function(){return u(e.id)},key:"delete-tgt-documents"})],noPadding:!0},c.a.createElement(Lr,null,c.a.createElement(fo,{fields:e.fields,showTypes:I,boundaryId:"targets-height",overrideWidth:"targets-width",parentId:i,idPrefix:"targets-field-",acceptDropType:t,draggableType:n,onDrop:E,canDrop:y,renderActions:function(e){return go({connectedMappings:e.mappings,onShowMappingDetails:b,canAddFieldToSelectedMapping:S(e),onAddToSelectedMapping:function(){return F(e)},canRemoveFromSelectedMapping:T(e),onRemoveFromSelectedMapping:function(){return M(e)},canStartMapping:C(e),onStartMapping:function(){return O(e)}})},renderPreview:P}))))})))))))},bo="SourceTargetLinks-module_arc__2q0aJ",So=function(e){var t=e.mappings,n=e.selectedMappingId,i=e.onSelectMapping,a=Object(s.useMemo)((function(){return t.sort((function(e){return e.id===n?1:-1}))}),[t,n]);return c.a.createElement("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"}},a.map((function(e){return c.a.createElement(Fo,{mapping:e,onClick:function(){return i(e)},isSelected:e.id===n,key:e.id})})),c.a.createElement(si,{start:"dnd-start",end:"dnd-target-field",color:"var(--pf-global--active-color--400)"}))},Fo=function(e){var t=e.mapping,n=e.isSelected,i=e.onClick,a=Vn(!1),r=a.state,o=a.toggleOn,l=a.toggleOff,s=function(e){i(),e.stopPropagation()},u=n?"var(--pf-global--active-color--100)":void 0,p=n?void 0:"var(--pf-global--active-color--400)",d=t.sourceFields.reduce((function(e,n){var i=t.targetFields.map((function(e){return c.a.createElement(si,{key:""+n.id+e.id,start:"sources-field-"+n.id,end:"targets-field-"+e.id,color:r?p:u,onClick:s,onMouseEnter:o,onMouseLeave:l,className:bo})}));return[].concat(e,i)}),[]);return c.a.createElement("g",{className:"group"},d)},To=function(e){var t=e.notifications,n=e.sources,i=e.targets,a=e.addableSources,r=e.addableTargets,o=e.showSourcesIndex,l=e.showTargetsIndex,s=e.onClose,u=e.mappingExpressionEnabled,p=e.onRemoveMapping,d=e.onRemoveMappedField,f=e.onIndexChange,m=e.onNewTransformation,g=e.onTransformationChange,v=e.onTransformationArgumentChange,h=e.onRemoveTransformation,E=e.onAddFieldToMapping,y=e.onNotificationRead,b=e.onEditEnum,S=e.isEnumMapping,F=e.onCreateConstant,T=e.onCreateProperty,M=e.canAddToSelectedMapping,C=e.multiplicity,O={"--pf-c-form--GridGap":"0",marginTop:"1.0rem"},A=C&&c.a.createElement(Sr,{name:C.name,disableTransformation:u,transformationsOptions:C.transformationsOptions,transformationsArguments:C.transformationsArguments,onTransformationChange:C.onChange,onTransformationArgumentChange:C.onArgumentChange}),D={id:"",name:"Padding field",value:"",type:"",scope:"current",path:"",mappings:[],hasTransformations:!1,isAttribute:!1,isCollection:!1,isConnected:!1,isInCollection:!1,isDisabled:!1,amField:{},enumeration:!1},N=function(e,t,n,i){return n?c.a.createElement(Ir,{key:n.id,field:n,name:n.name,info:n.scope?n.path+" <"+n.scope+"> ("+n.type+")":n.path+" ("+n.type+")",mappingExpressionEnabled:u,hasTransformations:n.transformations.length>0,onDelete:function(){return d(e,i)},onIndexChange:function(t){return f(e,i,"string"===typeof t?parseInt(t,10):t.amField)},onNewTransformation:function(){return m(e,i)},index:i+1,canShowIndex:t},c.a.createElement("div",{className:"pf-c-form",style:O},n.transformations.map((function(t,n){return c.a.createElement(Sr,{key:n,name:t.name,transformationsOptions:t.options,transformationsArguments:t.arguments,disableTransformation:u,onTransformationChange:function(t){return g(e,i,n,t)},onTransformationArgumentChange:function(t,a){return v(e,i,n,t,a)},onRemoveTransformation:function(){h(e,i,n)}})})))):c.a.createElement(Ir,{field:D,key:i,name:"Padding field",info:"This padding field has been automatically added",mappingExpressionEnabled:u,hasTransformations:!1,onDelete:function(){return d(e,i)},index:i+1,canShowIndex:o})},I=t.filter((function(e){return"danger"===e.variant})),x=t.filter((function(e){return"warning"===e.variant})),P=t.filter((function(e){return"warning"!==e.variant&&"danger"!==e.variant}));return c.a.createElement(to,{onClose:s,onDelete:p,onEditEnum:b,isEnumMapping:S},I.length>0&&c.a.createElement(Mo,{notifications:I,title:"Errors",onNotificationRead:y}),x.length>0&&c.a.createElement(Mo,{notifications:x,title:"Warnings",onNotificationRead:y}),P.length>0&&c.a.createElement(Mo,{notifications:P,title:"Messages",onNotificationRead:y}),c.a.createElement("div",{className:"pf-c-form",style:O},A,c.a.createElement(Pr,{isSource:!0,title:"Sources",onCreateConstant:F,onCreateProperty:T,canAddToSelectedMapping:M},n.map((function(e,t){return N(!0,o,e,t)})),i.length<=1&&c.a.createElement(Hi,{ariaLabelTypeAhead:"Select source to add to the mapping",placeholderText:"Select source to add to the mapping",isSource:!0,fields:a.map((function(e){return{label:e.amField.isPropertyOrConstant()?e.name:e.path,group:e.amField.docDef.name,onAdd:function(){return E(!0,e)}}})),"data-testid":"add-source-to-mapping"})),c.a.createElement(Pr,{isSource:!1,title:"Targets",onCreateConstant:F,onCreateProperty:T,canAddToSelectedMapping:M},i.map((function(e,t){return N(!1,l,e,t)})),n.length<=1&&c.a.createElement(Hi,{ariaLabelTypeAhead:"Select target to add to the mapping",placeholderText:"Select target to add to the mapping",isSource:!1,fields:r.map((function(e){return{label:e.amField.isProperty()?e.name:e.path,group:e.amField.docDef.name,onAdd:function(){return E(!1,e)}}})),"data-testid":"add-target-to-mapping"}))))},Mo=function(e){var t=e.title,n=e.notifications,i=e.onNotificationRead;return c.a.createElement(Wa,{title:t,noShadows:!0,noPadding:!0,actions:[c.a.createElement(le.a,{key:1},n.length)]},c.a.createElement("div",{style:{maxHeight:200,overflow:"auto"}},n.map((function(e,t){return c.a.createElement(K.a,{key:t,variant:e.variant,title:e.description,isInline:!0,actionClose:c.a.createElement(Z.a,{title:e.title,variantLabel:e.variant+" alert",onClose:function(){return i(e.id)},"data-testid":"dismiss-mapping-notification-"+e.id})})}))))},Co="MappingTableView-module_title__1BqLH",Oo=[{heightAuto:!0,cells:[{props:{colSpan:8},title:c.a.createElement(se.a,null,c.a.createElement(G.a,{variant:G.b.small},c.a.createElement(q.a,{icon:Ue.a}),c.a.createElement(m.a,{headingLevel:"h2",size:"lg"},"No mappings found")))}]}],Ao=function(e){var t=e.mappings,n=e.onSelectMapping,i=e.shouldShowMappingPreview,a=e.onFieldPreviewChange,r=0===t.length?Oo:t.map((function(e){var t=e.sourceFields.map((function(t,n){var r=t,o=r.name;return c.a.createElement("div",{key:n},o,i(e)&&c.a.createElement(lr,{id:r.id,value:r.value,onChange:function(e){return a(r,e)}}))})),n=e.targetFields.map((function(t,n){var a=t,r=a.name;return c.a.createElement("div",{key:n},r,i(e)&&c.a.createElement(cr,{id:a.id,value:a.value}))}));return{cells:[{title:t,data:e.id},{title:n},{title:e.name}]}}));return c.a.createElement(Wr,null,c.a.createElement(m.a,{size:"lg",headingLevel:"h1",className:Co},"Mappings"),c.a.createElement(st.a,{"aria-label":"Mappings",cells:["Sources","Targets","Types"],rows:r},c.a.createElement(ct.a,null),c.a.createElement(ut.a,{onRowClick:function(e,i){var a=t.find((function(e){var t;return(null===(t=i.cells)||void 0===t?void 0:t[0].data)===e.id}));a&&n(a)}})))},Do="NamespaceTableView-module_title__2TUGW",No=function(e){var t=e.sources,n=e.onCreateNamespace,i=e.onEditNamespace,a=e.onDeleteNamespace,r=["Alias","URI","Location URI",{title:"Target Namespace",transforms:[pt.a],cellTransforms:[pt.a]}],o=t.reduce((function(e,t){if("XML"!==t.type)return e;var o=t.namespaces&&0!==t.namespaces.length?t.namespaces.map((function(e){return{cells:[{title:e.alias},{title:e.uri},{title:e.locationUri},{title:e.isTarget?"\u2713":""}]}})):[{cells:["<None>"]}],l=[{title:"Edit",onClick:function(e,n,a,r){var o,l,s,c;i(t.name,null===(o=a.cells)||void 0===o?void 0:o[0].title,null===(l=a.cells)||void 0===l?void 0:l[1].title,null===(s=a.cells)||void 0===s?void 0:s[2].title,(null===(c=a.cells)||void 0===c?void 0:c[3].title.length)>0)}},{title:"Remove",onClick:function(e,n,i,r){return a(t.name,i.alias.title)}}];return[].concat(e,[c.a.createElement(ce.a,{key:"level"},c.a.createElement(ue.a,{key:"title"},c.a.createElement(m.a,{size:"lg",headingLevel:"h1",className:Do},"Namespaces for ",t.name)),c.a.createElement(ue.a,{key:"actions"},c.a.createElement(vi,null,c.a.createElement(A.a,{position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create a namespace"),key:"create-namespace"},c.a.createElement(h.a,{onClick:function(){return n(t.name)},variant:"plain","aria-label":"Create a namespace","data-testid":"create-namespace-button"},c.a.createElement(ve.a,null)))))),c.a.createElement(st.a,{key:"table","aria-label":"Namespaces",cells:r,rows:o,actions:t.namespaces&&t.namespaces.length>0?l:void 0},c.a.createElement(ct.a,null),c.a.createElement(ut.a,null))])}),[]);return 0===o.length?c.a.createElement(se.a,null,c.a.createElement(G.a,{variant:G.b.small},c.a.createElement(q.a,{icon:Ue.a}),c.a.createElement(m.a,{headingLevel:"h2",size:"lg"},"No XML sources found"))):c.a.createElement(Wr,null,o)},Io=function(e){var t=e.sourceProperties,n=e.targetProperties,i=e.constants,a=e.sources,r=e.mappings,o=e.targets,l=e.showMappingPreview,s=e.showTypes,u=e.selectedMappingId,p=e.onSelectMapping,d=e.sourceEvents,f=e.targetEvents;return c.a.createElement(c.a.Fragment,null,c.a.createElement(ni,null,c.a.createElement(Ti,{role:"main"},c.a.createElement(Ci,null,c.a.createElement(pi,{"data-testid":"column-source-area",totalColumns:2},c.a.createElement(Eo,Object.assign({sourceProperties:t,constants:i,sources:a,showTypes:s},d))),c.a.createElement(pi,{"data-testid":"column-target-area",totalColumns:2},c.a.createElement(yo,Object.assign({targetProperties:n,showMappingPreview:l,showTypes:s,targets:o},f))))),c.a.createElement(So,{mappings:r,selectedMappingId:u,onSelectMapping:p})))},xo="toolbarItems-module_toggled__HUrZH",Po=function(e){var t=e.showImportAtlasFileToolbarItem,n=e.showImportAtlasFileFromEntaxyRegistryToolbarItem,i=e.showExportAtlasFileToolbarItem,a=e.showExportAtlasFileIntoEntaxyRegistryToolbarItem,r=e.showResetToolbarItem,o=e.onImportAtlasFile,l=e.onImportAtlasFileFromEntaxyRegistry,s=e.onExportAtlasFile,u=e.onExportAtlasFileIntoEntaxyRegistry,p=e.onResetAtlasmap,d=Vn(!1),f=d.state,m=d.toggle,g=d.toggleOff,v=function(e){return function(){e.apply(void 0,arguments),g()}},h=[t&&c.a.createElement(wo,{onFile:v(o),key:"import-catalog"}),n&&c.a.createElement(Ro,{onRegistryLocation:v(l),key:"import-catalog"}),(t||n)&&c.a.createElement(B.a,{key:"import-separator"}),i&&c.a.createElement(_o,{onClick:v(s),key:"export-catalog"}),a&&c.a.createElement(jo,{onClick:v(u),key:"export-catalog"}),(i||a)&&c.a.createElement(B.a,{key:"export-separator"}),r&&c.a.createElement(ko,{onClick:v(p),key:"reset-catalog"})].filter((function(e){return e}));return c.a.createElement(N.a,null,c.a.createElement(F.a,{toggle:c.a.createElement(V.a,{id:"atlasmap-toggle",onToggle:m,toggleIndicator:Te.a,"data-testid":"atlasmap-menu-button"},"Entaxy Transformation"),isOpen:f,dropdownItems:h,isPlain:!0}))},wo=function(e){var t=e.onFile,n=Object(lt.useFilePicker)({maxFileSize:1}),i=n.files,a=n.onClick,r=n.HiddenFileInput,o=Object(s.useRef)(null);return Object(s.useEffect)((function(){o.current!==i&&(o.current=i,1===(null===i||void 0===i?void 0:i.length)&&(o.current=null,t(i[0])))}),[i,t]),c.a.createElement(z.a,{icon:c.a.createElement(Ie.a,null),onClick:a,"data-testid":"import-mappings-button"},"Import a catalog (.adm)",c.a.createElement(r,{accept:".adm",multiple:!1}))},Ro=function(e){var t=e.onRegistryLocation;return window.onmessage=function(e){e.origin===window.origin&&e.data&&t(e.data)},c.a.createElement(z.a,{icon:c.a.createElement(Ie.a,null),onClick:function(){window.top.postMessage("openRegistryViewerForImport",window.top.origin)}},"Open a catalog from Entaxy registry (.adm)")},_o=function(e){var t=e.onClick;return c.a.createElement(z.a,{icon:c.a.createElement(Ve.a,null),onClick:t,"data-testid":"export-mappings-button"},"Export the current mappings and support files into a catalog (.adm)")},jo=function(e){var t=e.onClick;return c.a.createElement(z.a,{icon:c.a.createElement(Ve.a,null),onClick:t,"data-testid":"export-mappings-button"},"Save the current mappings and support files into Entaxy registry (.adm)")},ko=function(e){var t=e.onClick;return c.a.createElement(z.a,{icon:c.a.createElement(ge.a,null),onClick:t,"data-testid":"reset-all-button"},"Reset all mappings and clear all imported documents")},Lo=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show column mapper")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show column mapper",onClick:a,isDisabled:i,className:Object(d.a)(t&&xo),"data-testid":"show-column-mapper-button"},c.a.createElement(ze.a,null))))},Uo=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show mapping table")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show/hide mapping table",onClick:a,isDisabled:i,className:Object(d.a)(t&&xo),"data-testid":"show-hide-mapping-table-button"},c.a.createElement(Ue.a,null))))},Vo=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show namespace table")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show/hide namespace table",onClick:a,isDisabled:i,className:Object(d.a)(t&&xo),"data-testid":"show-hide-namespace-table-button"},c.a.createElement(Be.a,null))))},zo=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show/hide mapping preview")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show/hide mapping preview",onClick:a,isDisabled:i,className:Object(d.a)(t&&xo),"data-testid":"show-hide-mapping-preview-button"},c.a.createElement(Je.a,null))))},Bo=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show/hide types")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show/hide types",onClick:a,isDisabled:i,className:Object(d.a)(t&&xo),"data-testid":"show-hide-types-button"},c.a.createElement(Ge.a,null))))},Jo=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show/hide mapped fields")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show/hide mapped fields",onClick:a,isDisabled:i,className:Object(d.a)(t&&xo),"data-testid":"show-hide-mapped-fields-button"},c.a.createElement(qe.a,null))))},Go=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show/hide unmapped fields")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show/hide unmapped fields",onClick:a,isDisabled:i,className:Object(d.a)(t&&xo),"data-testid":"show-hide-unmapped-fields-button"},c.a.createElement(He.a,null))))},qo=function(e){var t=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Add a new mapping")},c.a.createElement(h.a,{variant:"plain","aria-label":"Add a new mapping",onClick:t,"data-testid":"add-new-mapping-button"},c.a.createElement(ve.a,null))))},Ho=function(e){var t=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"About AtlasMap")},c.a.createElement(h.a,{variant:"plain","aria-label":"About AtlasMap",onClick:t,"data-testid":"about-button"},c.a.createElement(Ye.a,null))))};function Yo(){return{pending:!1,error:!1,sourceProperties:null,targetProperties:null,constants:null,sources:[],targets:[],mappings:[],selectedMapping:null,flatSources:[],flatTargets:[]}}function Xo(e,t){switch(t.type){case"reset":return{pending:!1,error:!1,sourceProperties:null,targetProperties:null,constants:null,sources:[],targets:[],mappings:[],selectedMapping:null,flatSources:[],flatTargets:[]};case"loading":return ft({},e,{pending:!0,error:!1});case"update":return ft({},e,t.payload);case"error":return ft({},{pending:!1,error:!1,sourceProperties:null,targetProperties:null,constants:null,sources:[],targets:[],mappings:[],selectedMapping:null,flatSources:[],flatTargets:[]});default:return e}}function Wo(){return{notifications:[]}}function Ko(e,t){switch(t.type){case"reset":return{notifications:[]};case"update":return{notifications:t.payload.notifications.map((function(t){var n;return ft({},t,{isRead:null===(n=e.notifications.find((function(e){return e.id===t.id})))||void 0===n?void 0:n.isRead})}))};case"dismiss":return{notifications:e.notifications.map((function(e){return e.id===t.payload.id?ft({},e,{isRead:!0}):e}))};default:return e}}var Zo=Object(s.createContext)(null),$o=function(e){var t=e.baseJavaInspectionServiceUrl,n=e.baseXMLInspectionServiceUrl,i=e.baseJSONInspectionServiceUrl,a=e.baseCSVInspectionServiceUrl,r=e.baseMappingServiceUrl,l=e.externalDocument,u=e.onMappingChange,p=e.logLevel,d=e.children,f=Object(s.useReducer)(Xo,{},Yo),m=f[0],g=f[1],v=Object(s.useReducer)(Ko,{},Wo),h=v[0],E=v[1],y=function(){g({type:"reset"}),E({type:"reset"})},b=function(){g({type:"loading"})};Object(s.useEffect)((function(){var e;y(),wt.resetConfig();var s=wt.cfg;if(null===(e=s.logger)||void 0===e||e.setLevel(p),s.initCfg.dataMapperVersion="2.5.2",s.initCfg.baseMappingServiceUrl=r,s.initCfg.baseJavaInspectionServiceUrl=t,s.initCfg.baseXMLInspectionServiceUrl=n,s.initCfg.baseJSONInspectionServiceUrl=i,s.initCfg.baseCSVInspectionServiceUrl=a,l){l.inputDocuments.forEach((function(e){var t=new o.DocumentInitializationModel;t.type=e.documentType,t.inspectionType=e.inspectionType,t.inspectionSource=e.inspectionSource,t.inspectionParameters=e.inspectionParameters,t.inspectionResult=e.inspectionResult,t.id=e.id,t.name=e.name,t.description=e.description,t.isSource=!0,t.showFields=e.showFields,s.addDocument(t)}));var c=new o.DocumentInitializationModel;c.type=l.outputDocument.documentType,c.inspectionType=l.outputDocument.inspectionType,c.inspectionSource=l.outputDocument.inspectionSource,c.inspectionParameters=l.outputDocument.inspectionParameters,c.inspectionResult=l.outputDocument.inspectionResult,c.id=l.outputDocument.id,c.name=l.outputDocument.name,c.description=l.outputDocument.description,c.isSource=!1,c.showFields=l.outputDocument.showFields,s.addDocument(c),l.initialMappings&&(s.preloadedMappingJson=l.initialMappings)}wt.resetAtlasMap(),b()}),[a,i,t,r,n,l,p]);var S=wt.cfg,F=Object(s.useCallback)((function(){return S.sourceDocs.map(Lt).filter((function(e){return e}))}),[S]),T=Object(s.useCallback)((function(){return Lt(S.constantDoc)}),[S]),M=Object(s.useCallback)((function(){return Lt(S.sourcePropertyDoc)}),[S]),C=Object(s.useCallback)((function(){return Lt(S.targetPropertyDoc)}),[S]),O=Object(s.useCallback)((function(){return S.targetDocs.map(Lt).filter((function(e){return e}))}),[S]),A=Object(s.useCallback)((function(){return(e=S.mappings)?e.mappings.map(Gt).filter((function(e){return e})):[];var e}),[S]),D=Object(s.useCallback)((function(){var e;return Gt(null===(e=S.mappings)||void 0===e?void 0:e.activeMapping)}),[S]),N=Object(s.useCallback)((function(){return S.sourceDocs.flatMap((function(e){return e.getAllFields().flatMap((function(e){var t=_t(e);return t?[t]:[]}))}))}),[S]),I=Object(s.useCallback)((function(){return S.targetDocs.flatMap((function(e){return e.getAllFields().flatMap((function(e){var t=_t(e);return t?[t]:[]}))}))}),[S]),x=Object(s.useCallback)((function(e){var t;t={pending:!S.initCfg.initialized,error:S.initCfg.initializationErrorOccurred,sources:F(),constants:T(),sourceProperties:M(),targets:O(),targetProperties:C(),mappings:A(),selectedMapping:D(),flatSources:N(),flatTargets:I()},g({type:"update",payload:t}),E({type:"update",payload:{notifications:S.errorService.getErrors().reverse().filter((function(e){return"DEBUG"!==e.level})).map(Jt)}})}),[S,T,A,D,F,M,N,O,C,I]);return Object(s.useEffect)((function(){var e=m.pending?1e3:50,t=wt.systemInitializedSource.pipe(Object(dt.a)(e)),n=S.mappingService.lineRefreshSource.pipe(Object(dt.a)(e)),i=S.mappingService.mappingUpdatedSource.pipe(Object(dt.a)(e)),a=S.previewService.mappingPreviewOutput$.pipe(Object(dt.a)(e)),r=[t.subscribe((function(){return x("initializationObservable")})),i.subscribe((function(){return x("mappingUpdatedSource")})),a.subscribe((function(){return x("mappingPreviewOutput$")})),n.subscribe((function(){return x("lineRefreshObservable")})),S.errorService.subscribe((function(){return x("errorService")}))];return function(){r.forEach((function(e){return e.unsubscribe()}))}}),[t,n,i,a,r,S,m.pending,m.selectedMapping,x]),Object(s.useEffect)((function(){u&&S.mappingService.mappingUpdatedSource.subscribe((function(){S.initCfg.initialized&&u(JSON.stringify(o.MappingSerializer.serializeMappings(S)))}))}),[S,u]),c.a.createElement(Zo.Provider,{value:ft({},m,h,{onLoading:b,onReset:y,markNotificationRead:function(e){return E({type:"dismiss",payload:{id:e}})}})},d)};function Qo(){var e,t,n,i,a,r=Object(s.useContext)(Zo);if(!r)throw new Error("useAtlasmap must be used inside an AtlasmapProvider component");var l=wt.cfg,c=r.onReset,u=vt(r,["onLoading","onReset"]),p=Object(s.useCallback)((function(e){return l.documentService.filterDocumentFields(e,!0)}),[l]),d=Object(s.useCallback)((function(e){return l.documentService.filterDocumentFields(e,!1)}),[l]),f=Object(s.useCallback)((function(e){var t;t=e,l.initializationService.initializeWithADMArchiveFile(t)}),[l]),m=Object(s.useCallback)((function(e){!function(e,t){t.initializationService.initializeWithADMArchiveFileFromEntaxyRegistry(e)}(e,l)}),[l]),g=Object(s.useCallback)((function(){c(),o.ConfigModel.getConfig().initializationService.resetAtlasMap()}),[c]),v=Object(s.useCallback)((function(e){Mn(e.amField)}),[]),h=Object(s.useCallback)((function(e){Cn(e.amField)}),[]),E=Object(s.useCallback)((function(e,t){Sn(null===e||void 0===e?void 0:e.amField,null===t||void 0===t?void 0:t.amField)}),[]),y=0===(null===(e=l.mappings)||void 0===e||null===(t=e.activeMapping)||void 0===t||null===(n=t.transition)||void 0===n||null===(i=n.expression)||void 0===i?void 0:i.nodes.length),b=Object(s.useCallback)((function(){return l.expressionService.willClearOutSourceFieldsOnTogglingExpression()}),[l]),S=Object(s.useCallback)((function(e){return l.mappingService.canAddToActiveMapping(e)}),[l]),F=Object(s.useCallback)((function(e,t){return l.mappingService.isFieldAddableToActiveMapping(t.amField)}),[l]),T=Object(s.useCallback)((function(e,t){return l.mappingService.isFieldDragAndDropAllowed(e.amField,t.amField)}),[l]),M=Object(s.useCallback)((function(e,t){return!!r.selectedMapping&&!!r.selectedMapping["source"===e?"sourceFields":"targetFields"].find((function(e){return e.id===t.id}))}),[r.selectedMapping]);return ft({},u,{selectMapping:dn,deselectMapping:fn,deleteAtlasFile:xn,exportADMArchiveFile:wn,exportADMArchiveFileIntoEntaxyRegistry:Rn,importADMArchiveFile:f,importADMArchiveFileFromEntaxyRegistry:m,resetAtlasmap:g,getUIVersion:jn,getRuntimeVersion:_n,mappingExpressionClearText:Xt,isMappingExpressionEmpty:y,executeFieldSearch:qt,getFieldEnums:Dn,setSelectedEnumValue:Nn,mappingExpressionAddField:Ht,mappingExpressionInit:Yt,mappingExpressionInsertText:Wt,mappingExpressionObservable:Kt,mappingExpressionRemoveField:Zt,mappingHasSourceCollection:b,mappingExpressionEnabled:l.expressionService.isExpressionEnabledForActiveMapping(),currentMappingExpression:l.expressionService.getMappingExpressionStr(!0,null===(a=l.mappings)||void 0===a?void 0:a.activeMapping),getMappingExpression:xt,toggleExpressionMode:Qt,toggleMappingPreview:kn,toggleShowMappedFields:Ln,toggleShowUnmappedFields:Un,onFieldPreviewChange:$t,addToCurrentMapping:Mn,removeFromCurrentMapping:Cn,removeMappedFieldFromCurrentMapping:On,fromMappedFieldToIMappingField:Ut,createMapping:Sn,newMapping:Fn,removeMapping:Tn,documentExists:Pn,getMappingActions:en,getMultiplicityActions:tn,getMultiplicityActionDelimiters:nn,handleActionChange:an,handleIndexChange:rn,handleNewTransformation:on,handleRemoveTransformation:cn,handleTransformationChange:ln,handleTransformationArgumentChange:sn,handleMultiplicityChange:un,handleMultiplicityArgumentChange:pn,createConstant:mn,deleteConstant:gn,editConstant:vn,createProperty:hn,deleteProperty:En,editProperty:yn,trailerId:"expression-trailer",canAddToSelectedMapping:S,isFieldAddableToSelection:F,isFieldDragAndDropAllowed:T,isFieldRemovableFromSelection:M,searchSources:p,searchTargets:d,importInstanceSchema:bt,importInstanceSchemaFromEntaxyRegistry:yt,enableCustomClass:At,createNamespace:Ft,editNamespace:Tt,deleteNamespace:Mt,onAddToMapping:v,onRemoveFromMapping:h,onCreateMapping:E,changeDocumentName:St,getEnumerationValues:An,isEnumerationMapping:In,configModel:l})}function el(e,t){var n=Vn(!1),i=n.state,a=n.toggleOn,r=n.toggleOff,o=Object(s.useRef)(null);return[c.a.createElement(Sa,{key:"confirmation-dialog-"+e,title:e,onCancel:r,onConfirm:function(){o.current&&o.current(),r()},isOpen:i},c.a.createElement(pe.a,null,t)),function(e){o.current=e,a()}]}function tl(e){var t=Object(s.useState)(null),n=t[0],i=t[1],a=Object(s.useState)({name:"",value:"",valueType:o.constantTypes[0][0]}),r=a[0],l=a[1],u=Object(s.useState)(null),p=u[0],d=u[1],f=Vn(!1),m=f.state,g=f.toggleOn,v=f.toggleOff,h=Object(s.useCallback)((function(e){n&&((null===r||void 0===r?void 0:r.name)!==e.name?n(e,null===r||void 0===r?void 0:r.name):n(e),v())}),[r,n,v]);return[c.a.createElement(Fa,Object.assign({title:e,isOpen:m,valueTypeOptions:o.constantTypes.map((function(e){return{value:e[0],label:e[1]}})),onCancel:v,onConfirm:h,onValidation:function(e){var t=!1;return p&&(t=p.fields.filter((function(t){return t.name===e})).length>0),e===(null===r||void 0===r?void 0:r.name)||!t}},r||{})),Object(s.useCallback)((function(e,t,n){i((function(){return e})),n&&l(n),t&&d(t),g()}),[g])]}function nl(e){var t=Object(s.useState)(null),n=t[0],i=t[1],a=Object(s.useState)(null),r=a[0],l=a[1],u=Object(s.useState)([]),p=u[0],d=u[1],f=Vn(!1),m=f.state,g=f.toggleOn,v=f.toggleOff,h=Object(s.useCallback)((function(e){n&&(n(e),v())}),[n,v]),E=function(){try{return Promise.resolve(function(){try{return Promise.resolve(new Promise((function(e,t){try{return o.ConfigModel.getConfig().documentService.getLibraryClassNames().then((function(t){e(t)})).catch((function(){t()})),Promise.resolve()}catch(n){return Promise.reject(n)}})))}catch(e){return Promise.reject(e)}}()).then((function(e){d(e)}))}catch(e){return Promise.reject(e)}};return[c.a.createElement(Ta,Object.assign({title:e,isOpen:m,customClassName:p?p[0]:"",customClassNames:p,collectionTypeOptions:o.collectionTypes.map((function(e){return{value:e[0],label:e[1]}})),onCancel:v,onConfirm:h},r||{collectionType:"NONE"})),Object(s.useCallback)((function(e,t){i((function(){return e})),t&&l(t),E(),g()}),[g])]}var il="";function al(){var e=function(){var e=Vn(!1),t=e.state,n=e.toggleOn,i=e.toggleOff,a=Object(s.useRef)(null),r=function(){i()},o="Document ID "+il+" copied to clipboard.",l=c.a.createElement(wr,{variant:"info",title:"Capture Document ID",key:il,onClose:r,onTimeout:r},o);return t?a.current&&a.current():l=c.a.createElement("span",null),[l,function(e){a.current=e,n()}]}(),t=e[0],n=e[1];return[t,Object(s.useCallback)((function(e){il=e,n((function(){return function(e){var t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select();try{document.execCommand("copy")}catch(n){o.ConfigModel.getConfig().errorService.addError(new o.ErrorInfo({message:"Error copying "+e+" to clipboard",level:o.ErrorLevel.ERROR,scope:o.ErrorScope.APPLICATION,type:o.ErrorType.INTERNAL}))}document.body.removeChild(t)}(e)}))}),[n])]}function rl(e){var t=Object(s.useState)(null),n=t[0],i=t[1],a=Object(s.useState)([]),r=a[0],o=a[1],l=Vn(!1),u=l.state,p=l.toggleOn,d=l.toggleOff,f=Object(s.useCallback)((function(){o([])}),[]),m=Object(s.useCallback)((function(e){n&&(n(e),d())}),[n,d]),g=c.a.createElement(wa,{title:e,isOpen:u,onCancel:d,onConfirm:m,parameters:r,initialParameters:r.filter((function(e){return e.required||e.enabled}))}),v=Object(s.useCallback)((function(e,t){i((function(){return e})),t&&o(t),p()}),[p]);return Object(s.useEffect)(f,[f]),[g,v]}function ol(e){var t=Vn(!1),n=Vn(e),i=Object(s.useRef)(null),a=function(){i.current&&i.current(n.state),t.toggleOff()};return[c.a.createElement(I.a,{key:"specify-instance-schema-dialog",variant:"small",title:"Specify Instance/ Schema",description:"Distinguish between instance and schema imported file formats.",isOpen:t.state,onClose:t.toggleOff,actions:[c.a.createElement(h.a,{key:"confirm",variant:"primary",onClick:a,"aria-label":"Ok","data-testid":"specify-instance-schema-dialog-ok-button-test",isDisabled:!a,style:{display:"flex",marginLeft:"auto"}},"OK")]},c.a.createElement(c.a.Fragment,null,c.a.createElement(de.a,{isChecked:!n.state,name:"instance",onChange:function(){n.toggleOff()},label:"Instance",id:"instance-radio","data-testid":"instance-radio-button-test"}),c.a.createElement(de.a,{isChecked:n.state,name:"schema",onChange:function(){n.toggleOn()},label:"Schema",id:"schema-radio","data-testid":"schema-radio-button-test"}))),function(a){i.current=a,e?n.toggleOn():n.toggleOff(),t.toggleOn()}]}function ll(e){var t=Object(s.useState)(null),n=t[0],i=t[1],a=Object(s.useState)(null),r=a[0],o=a[1],l=Vn(!1),u=l.state,p=l.toggleOn,d=l.toggleOff,f=Object(s.useCallback)((function(e){n&&(n(e),d())}),[n,d]);return[c.a.createElement(xa,Object.assign({title:e,isOpen:u,onCancel:d,onConfirm:f},r||{})),Object(s.useCallback)((function(e,t){i((function(){return e})),t&&o(t),p()}),[p])]}function sl(e,t){var n=Object(s.useState)(null),i=n[0],a=n[1],r=Object(s.useState)({name:"",valueType:o.propertyTypes[0][0],scope:t[0].value}),l=r[0],u=r[1],p=Object(s.useState)(null),d=p[0],f=p[1],m=Vn(!1),g=m.state,v=m.toggleOn,h=m.toggleOff,E=Object(s.useCallback)((function(e){i&&(i(e),h())}),[i,h]);return[c.a.createElement(Pa,Object.assign({title:e,valueTypeOptions:o.propertyTypes.map((function(e){return{value:e[0],label:e[1]}})),scopeOptions:t,isOpen:g,onCancel:h,onConfirm:E,onValidation:function(e,t){var n=!1;return d&&(n=d.fields.filter((function(n){return n.name===e&&n.amField.scope===t})).length>0),e===(null===l||void 0===l?void 0:l.name)&&t===l.scope||!n}},l||{})),Object(s.useCallback)((function(e,t,n){a((function(){return e})),n&&u(n),f(t),v()}),[v])]}function cl(){var e=Vn(!1),t=e.state,n=e.toggleOn,i=e.toggleOff,a=Object(s.useState)([]),r=a[0],l=a[1],u=Object(s.useCallback)((function(){!function(e){var t,n=o.ConfigModel.getConfig(),i=null===(t=n.mappings)||void 0===t?void 0:t.activeMapping;i&&wt.cfg.mappingService.updateEnumerationValues(n,i,e)}(r),i()}),[r,i]);return[c.a.createElement(Sa,{title:"Map Enumeration Values",description:"Map enumeration source values to target values.",onCancel:i,onConfirm:u,isOpen:t},t&&r&&r.map((function(e,n){return c.a.createElement("div",{key:n},c.a.createElement(Ia,{enumerationValue:e,sourceKey:n,isOpen:t}))}))),Object(s.useCallback)((function(){l(An()),n()}),[n])]}function ul(e){var t=e.modalContainer,n=Qo(),i=n.configModel,a=n.selectedMapping,r=n.createConstant,l=n.editConstant,u=n.createProperty,p=n.editProperty,d=n.createNamespace,f=n.editNamespace,m=n.deleteNamespace,g=n.changeDocumentName,v=tl("Create Constant"),h=v[0],E=v[1],y=Object(s.useCallback)((function(e,t){E((function(e){var n=e.name,i=e.value,a=e.valueType;r(n,i,a,t)}),e)}),[r,E]),b=tl("Edit Constant"),S=b[0],F=b[1],T=Object(s.useCallback)((function(e,t){F((function(e,t){var n=e.name,i=e.value,a=e.valueType;l(n,i,a,t)}),t,e)}),[l,F]),M=function(){var e=Qo().deleteConstant,t=el("Delete constant?","Are you sure you want to delete the selected constant and remove any associated mapping references?"),n=t[0],i=t[1];return[n,Object(s.useCallback)((function(t){return i((function(){return e(t)}))}),[e,i])]}(),C=M[0],O=M[1],A=Object(s.useState)(Dt(!0)),D=A[0],N=A[1],I=sl("Create Property",D),x=I[0],P=I[1],w=Object(s.useCallback)((function(e,t,n){N(Dt(e)),P((function(t){var i=t.name,a=t.valueType,r=t.scope;u(i,a,r,e,n)}),t)}),[u,P]),R=sl("Edit Property",D),_=R[0],j=R[1],k=Object(s.useCallback)((function(e,t,n){N(Dt(t)),j((function(n){var i=n.name,a=n.valueType,r=n.scope;p(e.name,a,e.scope,t,i,r)}),n,e)}),[p,j]),L=function(){var e=Qo().deleteProperty,t=el("Delete property?","Are you sure you want to delete the selected property and remove any associated mapping references?"),n=t[0],i=t[1];return[n,Object(s.useCallback)((function(t,n,a){return i((function(){return e(t,n,a)}))}),[e,i])]}(),U=L[0],V=L[1],z=function(){var e=Qo().importADMArchiveFile,t=el("Import ADM archive file?","Importing a new ADM archive file will discard all unsaved changes. To save the current mappings, use the Export feature."),n=t[0],i=t[1];return[n,Object(s.useCallback)((function(t){return i((function(){return e(t)}))}),[e,i])]}(),B=z[0],J=z[1],G=function(){var e=Qo().importADMArchiveFileFromEntaxyRegistry,t=el("Import ADM archive file?","Importing a new ADM archive file will discard all unsaved changes. To save the current mappings, use the Export feature."),n=t[0],i=t[1];return[n,Object(s.useCallback)((function(t){return i((function(){return e(t)}))}),[e,i])]}(),q=G[0],H=G[1],Y=function(){var e=Vn(!1),t=e.state,n=e.toggleOn,i=e.toggleOff,a=Qo().exportADMArchiveFile,r=Object(s.useCallback)((function(e){a(e),i()}),[a,i]);return[c.a.createElement(Ca,{isOpen:t,onCancel:i,onConfirm:r}),n]}(),X=Y[0],W=Y[1],K=function(){var e=Vn(!1),t=e.state,n=e.toggleOn,i=e.toggleOff,a=Qo().exportADMArchiveFileIntoEntaxyRegistry,r=Object(s.useCallback)((function(e,t){a(e,t),i()}),[a,i]);return[c.a.createElement(Oa,{isOpen:t,onCancel:i,onConfirm:r}),n]}(),Z=K[0],$=K[1],Q=function(){var e=Qo().resetAtlasmap,t=el("Reset All Mappings and Imports?","Are you sure you want to reset all mappings and clear all imported documents?"),n=t[0],i=t[1];return[n,Object(s.useCallback)((function(){return i(e)}),[i,e])]}(),ee=Q[0],te=Q[1],ne=function(){var e=Qo(),t=e.getRuntimeVersion,n=e.getUIVersion,i=Object(s.useState)("0.0"),a=i[0],r=i[1],o=Vn(!1),l=o.state,u=o.toggleOn,p=o.toggleOff;return[c.a.createElement(ba,{title:"AtlasMap Data Mapper",isOpen:l,onClose:p,uiVersion:n(),runtimeVersion:a}),Object(s.useCallback)((function(){t().then((function(e){r(e),u()})).catch((function(e){r(e),u()}))}),[u,t])]}(),ie=ne[0],ae=ne[1],re=function(){var e=Qo(),t=e.mappingHasSourceCollection,n=e.toggleExpressionMode,i=el("Disable Expression?","If you disable an expression with a source collection, all source fields will be removed from the mapping.  Proceed with expression disable?"),a=i[0],r=i[1];return[a,Object(s.useCallback)((function(){t()?r(n):n()}),[t,r,n])]}(),oe=re[0],le=re[1],se=function(){var e=Qo(),t=e.configModel,n=e.documentExists,i=e.importInstanceSchema,a=e.importInstanceSchemaFromEntaxyRegistry,r=el("Confirm document import","A document with the selected name has already been imported into the specified panel. It will appear in addition to the pre-existing document."),l=r[0],u=r[1],p=rl("Select CSV Processing Parameters"),d=p[0],f=p[1],m=Object(s.useState)(!1),g=m[0],v=m[1],h=ol(g),E=h[0],y=h[1],b=Object(s.useCallback)((function(e,n){if(e.name){var a=e.name.split("."),r=a[a.length-1].toUpperCase();if("CSV"===r)return void f((function(a){for(var r,o={},l=Et(a);!(r=l()).done;){var s=r.value;o[s.name]=s.value}i(e,t,n,!1,o)}),Object(o.getCsvParameterOptions)());v("XSD"===r),y((function(a){i(e,t,n,a)}))}}),[t,i,f,y]),S=Object(s.useCallback)((function(e,n){var i=e.split("/").pop();if(i){var r=i.split("."),l=r[r.length-1].toUpperCase();if("CSV"===l)return void f((function(i){for(var r,o={},l=Et(i);!(r=l()).done;){var s=r.value;o[s.name]=s.value}a(e,t,n,!1,o)}),Object(o.getCsvParameterOptions)());v("XSD"===l),y((function(i){a(e,t,n,i)}))}}),[t,a,f,y]),F=Object(s.useCallback)((function(e,t){n(e.name,t)?u((function(){return b(e,t)})):b(e,t)}),[n,b,u]),T=Object(s.useCallback)((function(e,t){var i=e.split("/").pop();i&&n(i,t)?u((function(){return S(e,t)})):S(e,t)}),[n,S,u]);return[c.a.createElement(c.a.Fragment,null,l,d,E),F,T]}(),ce=se[0],ue=se[1],pe=se[2],de=function(){var e=Qo().deleteAtlasFile,t=el("Delete selected document?","Are you sure you want to delete the selected document and remove any associated mappings?"),n=t[0],i=t[1];return[n,Object(s.useCallback)((function(t,n){return i((function(){return e(t,n)}))}),[e,i])]}(),fe=de[0],me=de[1],ge=al(),ve=ge[0],he=ge[1],Ee=function(){var e=Object(s.useState)(null),t=e[0],n=e[1],i=Object(s.useState)({id:"",name:"",isSource:!1}),a=i[0],r=i[1],o=Vn(!1),l=o.state,u=o.toggleOn,p=o.toggleOff,d=Object(s.useCallback)((function(e){t&&(t(e),p())}),[t,p]);return[c.a.createElement(Ma,Object.assign({isOpen:l,onCancel:p,onConfirm:d},a||{})),Object(s.useCallback)((function(e,t){n((function(){return e})),r(t),u()}),[u])]}(),ye=Ee[0],be=Ee[1],Se=Object(s.useCallback)((function(e){be((function(e){var t=e.id,n=e.name,i=e.isSource;g(t,n,i)}),e)}),[g,be]),Fe=ll("Create namespace"),Te=Fe[0],Me=Fe[1],Ce=Object(s.useCallback)((function(e){Me((function(t){var n=t.alias,i=t.uri,a=t.locationUri,r=t.targetNamespace;return d(e,n,i,a,r)}))}),[d,Me]),Oe=ll("Edit namespace"),Ae=Oe[0],De=Oe[1],Ne=Object(s.useCallback)((function(e,t){De((function(n){var i=n.alias,a=n.uri,r=n.locationUri,o=n.targetNamespace;return f(e,t.alias,i,a,r,o)}),t)}),[f,De]),Ie=function(){var e=el("Remove field?","Are you sure you want to remove this field?"),t=e[0],n=e[1];return[t,Object(s.useCallback)((function(e){return n(e)}),[n])]}(),xe=Ie[0],Pe=Ie[1],we=function(){var e=Qo(),t=e.removeMapping,n=e.deselectMapping,i=el("Remove Mapping?","Are you sure you want to remove the current mapping?"),a=i[0],r=i[1];return[a,Object(s.useCallback)((function(e){r((function(){t(e.mapping),n()}))}),[n,r,t])]}(),Re=we[0],_e=we[1],je=Object(s.useCallback)((function(){a&&_e(a)}),[_e,a]),ke=cl(),Le=ke[0],Ue=ke[1],Ve=nl("Load Java Document From Custom Class"),ze=Ve[0],Be=Ve[1],Je=Object(s.useCallback)((function(e){Be((function(t){var n=t.customClassName,a=t.collectionType;return At(i,n,a,e)}))}),[i,Be]),Ge=rl("Edit CSV Processing Parameters"),qe=Ge[0],He=Ge[1];function Ye(e,t){for(var n,i=function(e,t){var n=Ct(e,o.ConfigModel.getConfig(),t);return null===n||void 0===n?void 0:n.inspectionParameters}(e,t),a=Object(o.getCsvParameterOptions)(),r=Object.keys(i).map((function(e){return e})),l=Object.values(i).map((function(e){return e})),s=Et(a.map((function(e,t){return{index:t,value:e}})));!(n=s()).done;)for(var c,u=n.value.index,p=Et(r.map((function(e,t){return{pindex:t,pvalue:e}})));!(c=p()).done;){var d=c.value,f=d.pvalue,m=d.pindex;if(a[u].name===f){a[u].value=l[m],a[u].enabled=!0;break}}return a}var Xe=Object(s.useCallback)((function(e,t){He((function(n){for(var i,a={},r=Et(n);!(i=r()).done;){var l=i.value;a[l.name]=l.value}!function(e,t,n){try{var i=o.ConfigModel.getConfig();Ct(e,i,t).inspectionParameters=n,Promise.resolve(i.mappingService.notifyMappingUpdated()).then((function(){return Promise.resolve(i.fileService.updateDigestFile()).then((function(){}))}))}catch(a){return Promise.reject(a)}}(e,t,a)}),Ye(e,t))}),[He]),We=ol(!1),Ke=We[0],Ze=We[1],$e=Object(s.useMemo)((function(){return Object(at.createPortal)(c.a.createElement(c.a.Fragment,null,B,q,X,Z,ce,fe,Ke,ve,ye,h,C,S,x,U,_,ee,ie,xe,Re,ze,Te,Ae,oe,Le,qe),t)}),[h,ze,Te,x,C,fe,ve,ye,Re,U,S,Ae,_,X,Z,B,q,ce,Ke,t,xe,ee,ie,oe,Le,qe]);return{handlers:{onImportADMArchive:J,onImportADMArchiveFromEntaxyRegistry:H,onExportADMArchive:W,onExportADMArchiveIntoEntaxyRegistry:$,onCreateConstant:y,onDeleteConstant:O,onEditConstant:T,onCreateProperty:w,onDeleteProperty:V,onEditProperty:k,onResetAtlasmap:te,onAbout:ae,onImportDocument:ue,onImportDocumentFromEntaxyRegistry:pe,onDeleteDocument:me,onSpecifyInstanceSchema:Ze,onCaptureDocumentID:he,onChangeDocumentName:Se,onRemoveMappedField:Pe,onDeleteMapping:_e,onDeleteSelectedMapping:je,onEnableCustomClass:Je,onCreateNamespace:Ce,onEditNamespace:Ne,deleteNamespace:m,onToggleExpressionMode:le,onEditMappingEnumeration:Ue,onEditCSVParams:Xe},dialogs:$e}}var pl=function(e){var t=e.allowImport,n=void 0===t||t,i=e.allowExport,a=void 0===i||i,r=e.allowReset,l=void 0===r||r,u=e.allowDelete,p=void 0===u||u,d=e.allowCustomJavaClasses,f=void 0===d||d,m=e.modalsContainerId,g=void 0===m?"modals":m,v=e.toolbarOptions,h=Qo(),E=h.pending,y=h.notifications,b=h.markNotificationRead,S=h.sourceProperties,F=h.targetProperties,T=h.constants,M=h.sources,C=h.targets,O=h.mappings,A=h.selectedMapping,N=h.selectMapping,I=h.onFieldPreviewChange,x=h.searchSources,P=h.searchTargets,w=h.currentMappingExpression,R=h.executeFieldSearch,_=h.getFieldEnums,j=h.setSelectedEnumValue,k=h.mappingExpressionAddField,L=h.mappingExpressionClearText,U=h.mappingExpressionInit,V=h.mappingExpressionInsertText,z=h.mappingExpressionObservable,B=h.mappingExpressionRemoveField,J=h.mappingExpressionEnabled,G=h.isMappingExpressionEmpty,q=h.trailerId,H=h.canAddToSelectedMapping,Y=h.isFieldAddableToSelection,X=h.isFieldDragAndDropAllowed,W=h.isFieldRemovableFromSelection,K=h.onAddToMapping,Z=h.onRemoveFromMapping,$=h.onCreateMapping,Q=h.isEnumerationMapping,ee=ul({modalContainer:document.getElementById(g)}),te=ee.handlers,ne=ee.dialogs,ie=function(e){var t=e.showImportAtlasFileToolbarItem,n=void 0===t||t,i=e.showImportAtlasFileFromEntaxyRegistryToolbarItem,a=void 0===i||i,r=e.showExportAtlasFileToolbarItem,o=void 0===r||r,l=e.showExportAtlasFileIntoEntaxyRegistryToolbarItem,u=void 0===l||l,p=e.showResetToolbarItem,d=void 0===p||p,f=e.showColumnMapperViewToolbarItem,m=void 0===f||f,g=e.showMappingTableViewToolbarItem,v=void 0===g||g,h=e.showNamespaceTableViewToolbarItem,E=void 0===h||h,y=e.showToggleMappingPreviewToolbarItem,b=void 0===y||y,S=e.showToggleTypesToolbarItem,F=void 0===S||S,T=e.showToggleMappedFieldsToolbarItem,M=void 0===T||T,C=e.showToggleUnmappedFieldsToolbarItem,O=void 0===C||C,A=e.showAddNewMappingToolbarItem,N=void 0===A||A,I=e.onImportADMArchiveFile,x=e.onImportADMArchiveFileFromEntaxyRegistry,P=e.onExportAtlasFile,w=e.onExportAtlasFileIntoEntaxyRegistry,R=e.onResetAtlasmap,_=e.onAbout,j=Qo(),k=j.toggleMappingPreview,L=j.toggleShowMappedFields,U=j.toggleShowUnmappedFields,V=j.newMapping,z=Object(s.useState)("ColumnMapper"),B=z[0],J=z[1],G=Vn(!1,k),q=G.state,H=G.toggle,Y=Vn(!0),X=Y.state,W=Y.toggle,K=Vn(!0,L),Z=K.state,$=K.toggle,Q=Vn(!0,U),ee=Q.state,te=Q.toggle,ne=Object(s.useMemo)((function(){return c.a.createElement(Hr,null,(n||a||o||u||d)&&c.a.createElement(D.a,{variant:"button-group",spacer:{default:"spacerMd"}},c.a.createElement(Po,{showImportAtlasFileToolbarItem:n,showImportAtlasFileFromEntaxyRegistryToolbarItem:a,showExportAtlasFileToolbarItem:o,showExportAtlasFileIntoEntaxyRegistryToolbarItem:u,showResetToolbarItem:d,onImportAtlasFile:I,onImportAtlasFileFromEntaxyRegistry:x,onExportAtlasFile:P,onExportAtlasFileIntoEntaxyRegistry:w,onResetAtlasmap:R})),(m||v||E)&&c.a.createElement(D.a,{variant:"icon-button-group",spacer:{default:"spacerMd"}},m&&c.a.createElement(Lo,{toggled:"ColumnMapper"===B,onClick:function(){return J("ColumnMapper")}}),v&&c.a.createElement(Uo,{toggled:"MappingTable"===B,onClick:function(){return J("MappingTable")}}),E&&c.a.createElement(Vo,{toggled:"NamespaceTable"===B,onClick:function(){return J("NamespaceTable")}})),c.a.createElement(D.a,{variant:"icon-button-group"},b&&("ColumnMapper"===B||"MappingTable"===B)&&c.a.createElement(zo,{toggled:q,onClick:H}),F&&("ColumnMapper"===B||"MappingTable"===B)&&c.a.createElement(Bo,{toggled:X,onClick:W}),M&&"ColumnMapper"===B&&c.a.createElement(Jo,{toggled:Z,onClick:$}),O&&"ColumnMapper"===B&&c.a.createElement(Go,{toggled:ee,onClick:te}),N&&("ColumnMapper"===B||"MappingTable"===B)&&c.a.createElement(qo,{onClick:V}),N&&("ColumnMapper"===B||"MappingTable"===B)&&c.a.createElement(Ho,{onClick:_})))}),[n,a,o,u,d,I,x,P,w,R,_,m,v,E,B,b,q,H,F,X,W,M,Z,$,O,ee,te,N,V]);return{activeView:B,showMappingPreview:q,showTypes:X,showMappedFields:Z,showUnmappedFields:ee,contextToolbar:ne}}(ft({showImportAtlasFileToolbarItem:n,showImportAtlasFileFromEntaxyRegistryToolbarItem:n,showExportAtlasFileToolbarItem:a,showExportAtlasFileIntoEntaxyRegistryToolbarItem:a,showResetToolbarItem:l},v,{onImportADMArchiveFile:te.onImportADMArchive,onImportADMArchiveFileFromEntaxyRegistry:te.onImportADMArchiveFromEntaxyRegistry,onExportAtlasFile:te.onExportADMArchive,onExportAtlasFileIntoEntaxyRegistry:te.onExportADMArchiveIntoEntaxyRegistry,onResetAtlasmap:te.onResetAtlasmap,onAbout:te.onAbout})),ae=ie.activeView,re=ie.showMappingPreview,oe=ie.showTypes,le=ie.contextToolbar,se=Object(s.useCallback)((function(e){return re&&!!A&&e.isConnected&&!!e.mappings.find((function(e){return e.id===A.id}))}),[A,re]),ce=Object(s.useCallback)((function(e){return re&&!!A&&e.id===A.id}),[A,re]),ue=c.a.createElement(Yr,null,c.a.createElement(ya,{mappingExpression:J?w:void 0,executeFieldSearch:R,getFieldEnums:_,mappingExpressionAddField:k,mappingExpressionClearText:L,isMappingExpressionEmpty:G,mappingExpressionInit:U,mappingExpressionInsertText:V,mappingExpressionObservable:z,mappingExpressionRemoveField:B,trailerId:q,disabled:!A,onToggle:te.onToggleExpressionMode,setSelectedEnumValue:j})),pe=Object(s.useMemo)((function(){return{isSource:!0,acceptDropType:"target",draggableType:"source",canDrop:function(e,t){return X(t.payload,e)},onDrop:function(e,t){return $(e,null===t||void 0===t?void 0:t.payload)},onShowMappingDetails:N,onAddToSelectedMapping:K,canAddToSelectedMapping:H,canAddFieldToSelectedMapping:function(e){return Y("source",e)},onAddFieldToSelectedMapping:K,canRemoveFromSelectedMapping:function(e){return W("source",e)},onRemoveFromSelectedMapping:Z,onCreateConstant:function(){return te.onCreateConstant(T)},onEditConstant:function(e,t){var n=e,i=t,a=function(e){return o.ConfigModel.getConfig().documentService.getConstantType(e)}(n);te.onEditConstant({name:n,value:i,valueType:a},T)},onDeleteConstant:te.onDeleteConstant,onCreateProperty:function(e){te.onCreateProperty(e,S)},onEditProperty:function(e,t,n){var i=e.split(" ")[0],a=bn(i,t,n);te.onEditProperty({name:i,valueType:a,scope:t},!0,S)},onDeleteProperty:te.onDeleteProperty,onDeleteDocument:p?function(e){return te.onDeleteDocument(e,!0)}:void 0,onCaptureDocumentID:function(e){return te.onCaptureDocumentID(e)},onChangeDocumentName:function(e,t){return te.onChangeDocumentName({id:e,name:t,isSource:!0})},onCustomClassSearch:f?function(e){return te.onEnableCustomClass(e)}:void 0,onImportDocument:n?function(e){return te.onImportDocument(e,!0)}:void 0,onImportDocumentFromEntaxyRegistry:n?function(e){return te.onImportDocumentFromEntaxyRegistry(e,!0)}:void 0,onSearch:x,shouldShowMappingPreviewForField:se,onFieldPreviewChange:I,canStartMapping:function(){return!0},onStartMapping:function(e){return $(e,void 0)},onEditCSVParams:function(e,t){te.onEditCSVParams(e,t)}}}),[N,K,Z,te,T,p,f,n,x,se,I,$,H,Y,X,W,S]),de=Object(s.useMemo)((function(){return{isSource:!1,acceptDropType:"source",draggableType:"target",canDrop:function(e,t){return X(t.payload,e)},onDrop:function(e,t){return $(null===t||void 0===t?void 0:t.payload,e)},canAddToSelectedMapping:H,canAddFieldToSelectedMapping:function(e){return Y("target",e)},onShowMappingDetails:N,onAddToSelectedMapping:K,canRemoveFromSelectedMapping:function(e){return W("target",e)},onRemoveFromSelectedMapping:Z,onCreateProperty:function(e){te.onCreateProperty(e,F)},onEditProperty:function(e,t,n){var i=e.split(" ")[0],a=bn(i,t,n);te.onEditProperty({name:i,valueType:a,scope:t},!1,F)},onDeleteProperty:te.onDeleteProperty,onDeleteDocument:p?function(e){return te.onDeleteDocument(e,!1)}:void 0,onCaptureDocumentID:function(e){return te.onCaptureDocumentID(e)},onChangeDocumentName:function(e,t){return te.onChangeDocumentName({id:e,name:t,isSource:!1})},onCustomClassSearch:f?function(e){return te.onEnableCustomClass(e)}:void 0,onImportDocument:n?function(e){return te.onImportDocument(e,!1)}:void 0,onImportDocumentFromEntaxyRegistry:n?function(e){return te.onImportDocumentFromEntaxyRegistry(e,!1)}:void 0,onSearch:P,shouldShowMappingPreviewForField:se,onFieldPreviewChange:I,canStartMapping:function(e){return!e.isConnected},onStartMapping:function(e){return $(void 0,e)},onEditCSVParams:function(e,t){te.onEditCSVParams(e,t)}}}),[N,K,Z,te,p,f,n,P,se,I,$,H,Y,X,W,F]),me=Object(s.useMemo)((function(){switch(ae){case"ColumnMapper":return c.a.createElement(Io,{sourceProperties:S,targetProperties:F,constants:T,sources:M,mappings:O,targets:C,selectedMappingId:null===A||void 0===A?void 0:A.id,onSelectMapping:N,showMappingPreview:re,showTypes:oe,sourceEvents:pe,targetEvents:de});case"MappingTable":return c.a.createElement(Ao,{mappings:O,onSelectMapping:N,shouldShowMappingPreview:ce,onFieldPreviewChange:I});case"NamespaceTable":return c.a.createElement(No,{sources:M,onCreateNamespace:te.onCreateNamespace,onEditNamespace:function(e,t,n,i,a){return te.onEditNamespace(e,{alias:t,uri:n,locationUri:i,targetNamespace:a})},onDeleteNamespace:te.deleteNamespace});default:return c.a.createElement(c.a.Fragment,null,"TODO")}}),[ae,T,te,O,I,S,F,N,A,ce,re,oe,pe,M,de,C]),ge=function(e){var t=e.onCreateConstant,n=e.onCreateProperty,i=e.onRemoveMapping,a=e.onEditEnum,r=e.isEnumMapping,l=Qo(),u=l.selectedMapping,p=l.deselectMapping,d=l.removeMappedFieldFromCurrentMapping,f=l.fromMappedFieldToIMappingField,m=l.flatSources,g=l.flatTargets,v=l.constants,h=l.sourceProperties,E=l.targetProperties,y=l.canAddToSelectedMapping,b=l.isFieldAddableToSelection,S=l.addToCurrentMapping,F=l.notifications,T=l.markNotificationRead,M=l.mappingExpressionEnabled,C=l.getMultiplicityActions,O=l.getMultiplicityActionDelimiters,A=l.handleIndexChange,D=l.handleNewTransformation,N=l.handleRemoveTransformation,I=l.handleTransformationChange,x=l.handleTransformationArgumentChange,P=l.handleMultiplicityChange,w=l.handleMultiplicityArgumentChange;return Object(s.useCallback)((function(){if(u){var e=u.mapping,l=e.getMappedFields(!0).map(f),s=e.getMappedFields(!1).map(f),R=l.length>1&&e.transition.isManyToOneMode()&&!e.transition.enableExpression,_=s.length>1&&e.transition.isOneToManyMode()&&!e.transition.enableExpression,j=e.transition.transitionFieldAction,k=void 0;if(j){var L=C(e).map((function(e){return{label:o.CommonUtil.toDisplayable(e.name),name:e.name,value:e.name}})),U=O().map((function(e){return{name:e.prettyName,value:e.actualDelimiter}}));k={name:j.name,transformationsOptions:L,transformationsArguments:j.argumentValues.map((function(e){var t,n;return{label:o.CommonUtil.toDisplayable(e.name),name:e.name,type:null===(t=j.definition)||void 0===t||null===(n=t.arguments.find((function(t){return t.name===e.name})))||void 0===n?void 0:n.type,value:e.value,options:"delimiter"===e.name?U:void 0}})),onChange:function(e){return P(j,e)},onArgumentChange:function(e,t){return w(j,e,t)}}}var V=[null===v||void 0===v?void 0:v.fields,null===h||void 0===h?void 0:h.fields,m].flatMap((function(e){return e||[]})).filter((function(e){return b("source",e)})),z=[null===E||void 0===E?void 0:E.fields,g].flatMap((function(e){return e||[]})).filter((function(e){return b("target",e)}));return c.a.createElement(To,{notifications:F.filter((function(e){return e.mappingId===u.id&&!e.isRead})),sources:l,targets:s,addableSources:V,addableTargets:z,onClose:p,onRemoveMapping:i,onRemoveMappedField:function(e,t){var n=u.mapping.getMappedFieldForIndex(""+(t+1),e);n&&d(n)},showSourcesIndex:R,showTargetsIndex:_,mappingExpressionEnabled:M,multiplicity:k,onIndexChange:A,onNewTransformation:D,onRemoveTransformation:N,onTransformationChange:I,onTransformationArgumentChange:x,onAddFieldToMapping:function(e,t){return S(t.amField)},onNotificationRead:T,onEditEnum:a,isEnumMapping:r,onCreateConstant:t,onCreateProperty:function(e){n(e,e?h:E,!0)},canAddToSelectedMapping:y})}return c.a.createElement(c.a.Fragment,null,"TODO: error")}),[u,f,v,h,E,m,g,F,p,i,a,r,A,D,N,I,x,T,C,O,P,w,d,b,S,M,t,n,y])}({onCreateConstant:function(){te.onCreateConstant(T,!0)},onCreateProperty:function(e){e?te.onCreateProperty(e,S,!0):te.onCreateProperty(e,F,!0)},onRemoveMapping:te.onDeleteSelectedMapping,onEditEnum:te.onEditMappingEnumeration,isEnumMapping:Q});return c.a.createElement(xi,null,c.a.createElement(Bn,null,c.a.createElement(Qr,{loading:E,contextToolbar:le,expressionToolbar:"NamespaceTable"!==ae&&ue,showSidebar:!!A,renderSidebar:ge},me),c.a.createElement(Ji,null),c.a.createElement(fe.a,{isToast:!0},y.filter((function(e){return!e.isRead&&!e.mappingId})).slice(0,5).map((function(e){var t=e.id,n=e.variant,i=e.title,a=e.description;return c.a.createElement(wr,{variant:n,title:i,key:t,onClose:function(){return b(t)},onTimeout:function(){return b(t)}},a)}))),ne))},dl=function(){return c.a.createElement(i.a,null,c.a.createElement(a.a,{variant:"light",padding:{default:"noPadding"},isFilled:!0},c.a.createElement(pl,null)))};rt.a.render(c.a.createElement($o,{baseJavaInspectionServiceUrl:window.top.origin+"/cxf/atlas/java/",baseXMLInspectionServiceUrl:window.top.origin+"/cxf/atlas/xml/",baseJSONInspectionServiceUrl:window.top.origin+"/cxf/atlas/json/",baseCSVInspectionServiceUrl:window.top.origin+"/cxf/atlas/csv/",baseMappingServiceUrl:window.top.origin+"/cxf/atlas/",logLevel:"info"},c.a.createElement(dl,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))},9:function(e,t,n){"use strict";e.exports=n(361)}},[[359,1,2]]]);
//# sourceMappingURL=main.6e66d8d8.chunk.js.map
