1import{a as kt,b as Nt,c as Vt,d as Lt,e as It,f as At,g as ve,h as Bt,i as K,j as I}from"./chunk-2NN4QLWP.js";import{a as Rt}from"./chunk-FWWQCNNO.js";import{a as Ge}from"./chunk-MUS6SW4K.js";import{a as Qe}from"./chunk-P3KAPGQS.js";import{b as Ot}from"./chunk-JYENBUHD.js";import{a as Et,e as Pt}from"./chunk-M5AYQI3W.js";import"./chunk-FWHBGNFB.js";import"./chunk-I6OTESFY.js";import{E as We}from"./chunk-PHRB2UD4.js";import"./chunk-LZQWAODP.js";import"./chunk-GK2MZPED.js";import"./chunk-GD6SFB5P.js";import"./chunk-6C3DDLFZ.js";import"./chunk-UJTXFVLU.js";import"./chunk-MHT4E5X6.js";import"./chunk-BSL22QOB.js";import"./chunk-NJIOGT5G.js";import{a as je,b as St,c as Dt}from"./chunk-KSV4K5L7.js";import"./chunk-CPBDRKJF.js";import{a as Oe,b as fe}from"./chunk-G24DUSEI.js";import{b as Ft}from"./chunk-X4BW4SJU.js";import{c as Mt,d as Pe}from"./chunk-LNJJZS2Z.js";import"./chunk-2NQ7JOGA.js";import"./chunk-2DE3O72C.js";import{a as vt}from"./chunk-NGDLRAEG.js";import"./chunk-PCSK5A3J.js";import{a as bt}from"./chunk-WBKEXQKE.js";import"./chunk-DNWKX7ME.js";import"./chunk-7RJ7KBOV.js";import{a as Fe,b as Ee}from"./chunk-EOY6SAP7.js";import{a as Ne,b as Ve,c as Le,e as Ie,f as Ae,h as Be,i as He,k as ze,l as $e,n as Ue,p as qe,q as xe}from"./chunk-ZGCK3FI7.js";import"./chunk-GFCJRNG7.js";import"./chunk-RVGGNFAO.js";import{J as Ce}from"./chunk-YJGV56BU.js";import"./chunk-5LNWRJOG.js";import"./chunk-TZCA4BMQ.js";import{ea as wt,fa as Tt}from"./chunk-UX52FRTR.js";import"./chunk-IWYKCUBW.js";import"./chunk-MZ3B3AQU.js";import"./chunk-GJ3HPRCZ.js";import"./chunk-L77O44AU.js";import"./chunk-XZDAMPUP.js";import"./chunk-L27WCSZV.js";import"./chunk-UWULTQAP.js";import"./chunk-RB2YP5E2.js";import"./chunk-QIIVFJNA.js";import"./chunk-KO7CD6JP.js";import"./chunk-6D27RETG.js";import{C as te,h as _e,m as ue}from"./chunk-DJ7NG7WZ.js";import{c as q}from"./chunk-KI4XJKCH.js";import{a as Re,c as ke,h as ye,j as Ke}from"./chunk-NERRRF6P.js";import{a as xt,u as he,v as ne,w as j}from"./chunk-SXBT3OYT.js";import"./chunk-SN3EPBFH.js";import{b as De}from"./chunk-EHPYMWXB.js";import"./chunk-EUX7SKJZ.js";import"./chunk-5SQV5IIR.js";import{a as oe}from"./chunk-NVPTMCVP.js";import{s as yt}from"./chunk-7ZFPQAIH.js";import{r as ge,za as Ct}from"./chunk-7NPDSOWV.js";import"./chunk-R5IULLQ2.js";import{x as ft}from"./chunk-LEKN3M5J.js";import"./chunk-KFHTLBNQ.js";import"./chunk-YV5TISNX.js";import{D as me,m as ce,q as Se,r as gt,s as _t,u as ut,z as ht}from"./chunk-IDF3EASQ.js";import"./chunk-WJESYQVL.js";import{$c as N,Aa as rt,Ac as Z,B as ot,Bc as _,Cc as a,Dc as r,Ec as T,Fa as S,Gd as H,Hd as W,I as Ye,Ib as l,Ic as z,Id as pt,Jc as $,Kc as Ze,La as h,Lc as M,Ma as f,Md as pe,Rd as Q,Sb as J,Ta as E,Uc as C,Ud as ct,Vd as mt,Wc as p,Xa as g,Zb as L,_a as se,_c as X,a as R,aa as A,ad as V,b as k,dc as O,ed as B,gd as U,ha as le,jd as s,kd as w,l as it,ld as b,nd as st,pd as Xe,qd as Je,ra as at,rd as et,sa as we,t as be,tc as Te,uc as y,wc as v,wd as tt,xc as lt,xd as de,yc as ee,yd as dt,zc as Y}from"./chunk-K6IHZUMJ.js";function Zt(i,m){if(i&1&&(a(0,"mat-button-toggle",3)(1,"yon-button",15),s(2),r()()),i&2){let e=m.$implicit,n=p();_("value",e)("disabled",n.isLogEmpty(e)),l(),_("customClass","log-filter-button")("disabled",n.isLogEmpty(e)),l(),b(" ",e," ")}}function Xt(i,m){i&1&&(a(0,"mat-header-cell"),s(1,"EVENT TYPE"),r())}function Jt(i,m){if(i&1&&(a(0,"mat-cell"),s(1),r()),i&2){let e=m.$implicit,n=p();l(),b(" ",n.mapEventTypeToDisplay(e.eventType)," ")}}function en(i,m){i&1&&(a(0,"mat-header-cell"),s(1,"MESSAGE"),r())}function tn(i,m){if(i&1&&(a(0,"mat-cell")(1,"p",16),s(2),r()()),i&2){let e=m.$implicit;l(2),w(e.logMessage)}}function nn(i,m){i&1&&(a(0,"mat-header-cell"),s(1,"FURTHER INFORMATION"),r())}function on(i,m){if(i&1&&(a(0,"mat-cell"),s(1),r()),i&2){let e=m.$implicit;l(),b(" ",e.details," ")}}function an(i,m){i&1&&(a(0,"mat-header-cell"),s(1,"REFERENCE"),r())}function rn(i,m){if(i&1&&(a(0,"a",17),s(1),r()),i&2){let e=p().$implicit;_("routerLink",e.referenceLink),l(),w(e.referenceLabel)}}function ln(i,m){if(i&1&&(a(0,"mat-cell"),y(1,rn,2,2,"a",17),r()),i&2){let e=m.$implicit;l(),v(e.referenceLink?1:-1)}}function sn(i,m){i&1&&T(0,"mat-header-row")}function dn(i,m){i&1&&T(0,"mat-row",18)}function pn(i,m){if(i&1){let e=M();a(0,"div",14)(1,"yon-button",19),C("onClick",function(){h(e);let t=p();return f(t.scrollToMapping())}),r()()}i&2&&(l(),_("customClass","operation-log__scroll-up__button")("size",30)("weight",400))}var Ht=(()=>{class i{constructor(){this.errorLogCreated=new E,this.onScrollToMapping=new E,this.operationFinished=!1,this.hideTopButton=!1,this.dataSource=g(new xe),this.operationLog=g([]),this.errorLog=g([]),this.infoLog=g([]),this.successLog=g([]),this.notMappedLog=g([]),this.filters=g(["All","Error","Not Mapped","Info","Success"]),this.activeFilter=g("All"),this.customTableData=g(void 0),this.logExportFileName=g(""),this.baseColumns=["eventType","logMessage","details"],this.displayedColumns=g([...this.baseColumns]),this.dmToolService=S(I)}ngOnInit(){this.fetchAndCreateLogs()}fetchAndCreateLogs(e=!1){let n=this.dmToolService.getLogData()?.log,t=[];if(this.clearLogs(),n){if(n.errors.length>0){let o=this.createLogRowsForCategory(n.errors);t=t.concat(o),this.errorLog.set(o)}if(this.errorLogCreated.emit(),n.info.length>0){let o=this.createLogRowsForCategory(n.info);t=t.concat(o),this.infoLog.set(o)}if(n.notMapped.length>0&&!e){let o=this.createLogRowsForCategory(n.notMapped);t=t.concat(o),this.notMappedLog.set(o)}if(n.operationResults.length>0){let o=this.createLogRowsForCategory(n.operationResults);t=t.concat(o),this.successLog.set(o)}n.internalErrors.length>0&&console.error("Internal Error ",n.internalErrors)}this.operationLog.set(t),this.displayedColumns.set(this.hasReferences(t)?[...this.baseColumns,"reference"]:[...this.baseColumns]),this.dataSource().data=t,this.isActiveFilterEmpty(),this.createCustomTableData(t)}createCustomTableData(e){let n=this.hasReferences(e);this.customTableData.set({headers:n?["Event Type","Message","Further Information","Reference"]:["Event Type","Message","Further Information"],data:e.map(t=>n?[t.eventType,t.logMessage,t.details,t.referenceLink]:[t.eventType,t.logMessage,t.details])}),this.logExportFileName.set("Mapping-Log")}hasReferences(e){return e.some(n=>!!n.referenceLink)}clearLogs(){this.errorLog.set([]),this.infoLog.set([]),this.successLog.set([]),this.notMappedLog.set([])}mapEventTypeToDisplay(e){switch(e){case"DataError":return"Data error";case"GroupingError":return"Grouping error";
1case"OperationResults":return"Operation result";case"InternalError":return"Internal error";case"OperationError":return"Operation error";case"MappingError":return"Mapping error";case"ValidationError":return"Validation error";case"Warning":return"Warning";case"NotMapped":return"Not mapped";default:return e}}createLogRowsForCategory(e){let n=[];return e.forEach(t=>{n.push({eventType:t.eventType,logMessage:t.message,details:t.interpretedMessage??"",referenceLink:this.createReferenceLink(t),referenceLabel:t.entityNumber??t.entityType??""})}),n}createReferenceLink(e){let n=cn[e.entityType?.toLowerCase()];return n&&e.entityId?`${n}/${e.entityId}`:""}activateFilter(e){this.activeFilter.set(e);let n=this.dataSource();e=="All"&&Object.assign(n,k(R({},this.dataSource()),{data:this.operationLog()})),e=="Error"&&Object.assign(n,k(R({},this.dataSource()),{data:this.errorLog()})),e=="Info"&&Object.assign(n,k(R({},this.dataSource()),{data:this.infoLog()})),e=="Success"&&Object.assign(n,k(R({},this.dataSource()),{data:this.successLog()})),e=="Not Mapped"&&Object.assign(n,k(R({},this.dataSource()),{data:this.notMappedLog()})),this.dataSource.set(n)}isLogEmpty(e){return e=="Error"&&this.errorLog().length==0||e=="Info"&&this.infoLog().length==0||e=="Success"&&this.successLog().length==0||e=="Not Mapped"&&this.notMappedLog().length==0}isActiveFilterEmpty(){this.isLogEmpty(this.activeFilter())?this.activeFilter.set("All"):this.activateFilter(this.activeFilter())}scrollToMapping(){this.onScrollToMapping.emit()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=L({type:i,selectors:[["yon-data-management-log"]],viewQuery:function(n,t){if(n&1&&X(je,5),n&2){let o;N(o=V())&&(t.toggleGroup=o.first)}},inputs:{operationFinished:"operationFinished",hideTopButton:"hideTopButton"},outputs:{errorLogCreated:"errorLogCreated",onScrollToMapping:"onScrollToMapping"},decls:23,vars:9,consts:[[3,"header"],[1,"operation-log__filter-buttons"],["color","primary",3,"change","value"],["matTooltipPosition","above",3,"value","disabled"],[3,"useCustomTableData","exportFileName","excludeConfigureColumns"],[1,"operation-log__table",3,"dataSource"],["matColumnDef","eventType"],[4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","logMessage"],["matColumnDef","details"],["matColumnDef","reference"],[4,"matHeaderRowDef"],["matRipple","","class","element-row",4,"matRowDef","matRowDefColumns"],[1,"operation-log__scroll-up-position"],[3,"customClass","disabled"],[1,"log-message-text"],["target","_blank",3,"routerLink"],["matRipple","",1,"element-row"],["type","mat-icon-button","buttonIcon","arrow_upward","tooltip","To the top",1,"operation-log__scroll-up__yon-button",3,"onClick","customClass","size","weight"]],template:function(n,t){n&1&&(a(0,"yon-entity-table-card",0)(1,"div",1)(2,"mat-button-toggle-group",2),C("change",function(d){return t.activateFilter(d.value)}),Y(3,Zt,3,5,"mat-button-toggle",3,ee),r()(),a(5,"yon-entity-table-card-menu-buttons"),T(6,"yon-entity-table-menu-buttons",4),r(),a(7,"mat-table",5),z(8,6),O(9,Xt,2,0,"mat-header-cell",7)(10,Jt,2,1,"mat-cell",8),$(),z(11,9),O(12,en,2,0,"mat-header-cell",7)(13,tn,3,1,"mat-cell",8),$(),z(14,10),O(15,nn,2,0,"mat-header-cell",7)(16,on,2,1,"mat-cell",8),$(),z(17,11),O(18,an,2,0,"mat-header-cell",7)(19,ln,2,1,"mat-cell",8),$(),O(20,sn,1,0,"mat-header-row",12)(21,dn,1,0,"mat-row",13),r(),y(22,pn,2,3,"div",14),r()),n&2&&(_("header","Log"),l(2),_("value",t.activeFilter()),l(),Z(t.filters()),l(3),_("useCustomTableData",t.customTableData())("exportFileName",t.logExportFileName())("excludeConfigureColumns",!0),l(),_("dataSource",t.dataSource()),l(13),_("matHeaderRowDef",t.displayedColumns()),l(),_("matRowDefColumns",t.displayedColumns()),l(),v(t.hideTopButton?-1:22))},dependencies:[j,qe,Ne,Le,He,Ie,Ve,ze,Ae,Be,$e,Ue,Dt,je,St,Ot,Pt,Et,ft],styles:[".color__yon-orange[_ngcontent-%COMP%]{color:var(--color-primary)} .card__header{font-size:24x;font-weight:400}.operation-log__filter-buttons[_ngcontent-%COMP%] .log-filter-button{border-radius:16px;line-height:26px;margin:0!important;height:unset;min-width:75px}.operation-log__filter-buttons[_ngcontent-%COMP%] .log-filter-button:active{border-color:var(--color-primary)}.operation-log__filter-buttons[_ngcontent-%COMP%] .mat-pseudo-checkbox{display:none}.operation-log__filter-buttons[_ngcontent-%COMP%] .mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{background-color:transparent}.operation-log__filter-buttons[_ngcontent-%COMP%] .mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:0}.operation-log__filter-buttons[_ngcontent-%COMP%] .mat-button-toggle[_ngcontent-%COMP%]{border:none;background-color:transparent}.operation-log__filter-buttons[_ngcontent-%COMP%] .mat-button-toggle[_ngcontent-%COMP%] .mat-button-toggle-button{z-index:2}.operation-log__filter-buttons[_ngcontent-%COMP%] .mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 6px}.operation-log__filter-buttons[_ngcontent-%COMP%] .mat-button-toggle-checked .log-filter-button{border:2px solid var(--color-primary)}.operation-log__table[_ngcontent-%COMP%] .mdc-data-table__cell[_ngcontent-%COMP%], .operation-log__table[_ngcontent-%COMP%] .mdc-data-table__header-cell[_ngcontent-%COMP%]{align-items:center;min-height:55px;padding-left:40px}.operation-log__table[_ngcontent-%COMP%] .mdc-data-table__cell[_ngcontent-%COMP%]:first-child, .operation-log__table[_ngcontent-%COMP%] .mdc-data-table__header-cell[_ngcontent-%COMP%]:first-child{max-width:150px}.operation-log__table[_ngcontent-%COMP%]{background-color:transparent;max-height:550px;overflow-y:auto;padding-bottom:20px}.operation-log__table[_ngcontent-%COMP%] .mat-mdc-header-row[_ngcontent-%COMP%]{position:sticky;top:0;z-index:2}.operation-log__table[_ngcontent-%COMP%] .log-message-text[_ngcontent-%COMP%]{margin-bottom:0;padding:5px 0}.operation-log__scroll-up-position[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;margin-right:-65px;position:relative;z-index:2}.operation-log__scroll-up__yon-button[_ngcontent-%COMP%] .operation-log__scroll-up__button{border:1px solid var(--color-secondary);display:flex;align-items:center}.operation-log__scroll-up__yon-button[_ngcontent-%COMP%] .operation-log__scroll-up__button .material-symbols-sharp{width:100%;color:var(--color-secondary)}"],changeDetection:0})}}return i})();var cn={product:"/products",order:"/orders"};var zt=(()=>{class i{constructor(){this.cancelPrevious={},this.apiService=S(Ct),this.uploadFileService=S(K),this.dmToolService=S(I)}preValidate(e){return this.apiService.postDataManagementTool("DataManagementTool/PreValidate",e).pipe(Ye(n=>n))}validateRow(e){return this.apiService.postDataManagementTool("DataManagementTool/Validate/DataFieldAndColumn",e).pipe(Ye(n=>n))}cancelValidationCall(e){this.cancelPrevious[e.id]?.next()}preValidateRow(e,n,t,o,d){let c=this.createDataForRow(t),u=this.createNewDataFields(t,e,n),D=this.createNewMappingConfig(u);var x;let P={data:c,mappingConfig:D,entityType:o.entityName,operationType:d,dataFormatConfig:this.dmToolService.getDataFormatConfig()};return this.cancelPrevious[n.id]?this.cancelPrevious[n.id].next():this.cancelPrevious[n.id]=new be,this.validateRow(P).pipe(at(F=>this.cancelPrevious.isStopped?[]:(x=!(F.log?.errors?.length>0),ot(x))),we(this.cancelPrevious[n.id]))}createDataForRow(e){let n=[],t=this.uploadFileService.getParsedFile().data;return t[0].hasOwnProperty(e)&&t.forEach(o=>{if(o.hasOwnProperty(e)){let d={};d[e]=o[e],n.push(d)}}),n}createNewDataFields(e,n,t){return[{dataFieldKey:e,isMapped:!0,entityName:n.entityName,fieldName:t.fc.fieldName,guiRowId:t.id}]}createNewMappingConfig(e){return{dataFields:e}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=rt({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var fn=["tableRef"],Cn=i=>({"margin-left.px":i}),yn=i=>
1({"invalid-data-mapping":i}),vn=i=>({"red-sample-text":i});function xn(i,m){i&1&&(a(0,"p",9),s(1,"*"),r())}function Mn(i,m){if(i&1){let e=M();a(0,"div",10)(1,"yon-field",11),et("ngModelChange",function(t){h(e);let o=p(2).$implicit;return Je(o.dataFieldKey,t)||(o.dataFieldKey=t),f(t)}),C("onChange",function(t){h(e);let o=p(2),d=o.$implicit,c=o.$index,u=p();return u.setKeyValue(d,t),f(u.addRequiredKeyRows(d,c))}),r()()}if(i&2){let e=p(2).$implicit,n=p();l(),_("useWideDropdown",!0)("disableBlur",!0),Xe("ngModel",e.dataFieldKey),_("title","Select source header to group "+e.entityDisplayName.toLowerCase()+" on")("data",n.sourceHeaderData())}}function bn(i,m){if(i&1){let e=M();a(0,"div")(1,"mat-checkbox",7),et("ngModelChange",function(t){h(e);let o=p().$implicit,d=p();return Je(d.showDropdown[o.entityName],t)||(d.showDropdown[o.entityName]=t),f(t)}),C("change",function(t){h(e);let o=p(),d=o.$implicit,c=o.$index,u=p();return u.toggleKeyDropdowns(d.entityName,t),f(u.toggleKeyRowMandatory(d,c,t))}),a(2,"div",8),s(3),y(4,xn,2,0,"p",9),r()(),y(5,Mn,2,5,"div",10),r()}if(i&2){let e=p(),n=e.$implicit,t=e.$index,o=p();l(),Xe("ngModel",o.showDropdown[n.entityName]),_("disabled",t==0),l(2),b(" ",n.groupByDescription," "),l(),v(t==0?4:-1),l(),v(o.showDropdown[n.entityName]?5:-1)}}function wn(i,m){if(i&1&&(a(0,"div"),y(1,bn,6,5,"div"),r()),i&2){let e=p();
1l(),v(e.collapsedDataDetails()?-1:1)}}function Tn(i,m){i&1&&(a(0,"mat-header-cell"),s(1,"YOUNIUM FIELD"),r())}function Sn(i,m){i&1&&(a(0,"p",31),s(1,"*"),r())}function Dn(i,m){if(i&1&&(y(0,Sn,2,0,"p",31),a(1,"p",32),s(2),r()),i&2){let e=p().$implicit;v(e.isMandatory?0:-1),l(),_("ngStyle",de(3,Cn,e.isMandatory?"20":"10")),l(),b(" ",e.youniumField," ")}}function Fn(i,m){if(i&1){let e=M();a(0,"yon-field",33),C("ngModelChange",function(t){h(e);let o=p().$implicit,d=p(2);return f(d.onYouniumSelectChange(t,o.id))})("onChange",function(t){h(e);let o=p().$implicit,d=p(),c=d.$implicit,u=d.$index,D=p();return f(D.setYouniumField(t,o,u,c))}),r()}if(i&2){let e=p().$implicit,n=p().$implicit,t=p();_("useWideDropdown",!0)("valuePrimitive",!1)("ngModel",t.cofToAdd[e.id])("data",n.addedFieldConfigurations)}}function En(i,m){if(i&1&&(a(0,"mat-cell",29),y(1,Dn,3,5),y(2,Fn,1,4,"yon-field",30),r()),i&2){let e=m.$implicit;_("matTooltip",e.isMandatory?"Mandatory field, must be mapped":""),l(),v(e.youniumField!==""?1:-1),l(),v(e.youniumField==""?2:-1)}}function Pn(i,m){i&1&&(a(0,"mat-header-cell"),s(1,"DATA TYPE"),r())}function On(i,m){if(i&1&&(a(0,"mat-icon",36),s(1," info "),r()),i&2){let e=p().$implicit;_("matTooltip",e.referenceInfo)}}function Rn(i,m){if(i&1&&(a(0,"mat-cell",34)(1,"div",8)(2,"p",35),s(3),H(4,"enumToString"),r(),y(5,On,2,1,"mat-icon",36),r()()),i&2){let e=m.$implicit,n=p(2);_("matTooltip",e.acceptedValues?"Accepted values: "+(e.acceptedValues==null?null:e.acceptedValues.join(", ")):""),l(3),b(" ",pt(4,3,e.dataType,n.FieldTypes)," "),l(2),v(e.dataType=="Reference"?5:-1)}}function kn(i,m){i&1&&(a(0,"mat-header-cell"),s(1,"SOURCE HEADER"),r())}function Nn(i,m){if(i&1){let e=M();a(0,"yon-field",41),C("ngModelChange",function(t){h(e);let o=p().$implicit,d=p(2);return f(d.onDropdownChange(t,o.id))})("onChange",function(t){h(e);let o=p().$implicit,d=p(),c=d.$implicit,u=d.$index,D=p();return f(D.displaySampleData(t,o,u,c))}),r()}if(i&2){let e=p().$implicit,n=p(2);_("ngClass",de(4,yn,!e.validMapping))("useWideDropdown",!0)("data",n.sourceHeaderData())("ngModel",n.selectedSourceHeaders[e.id])}}function Vn(i,m){if(i&1){let e=M();a(0,"mat-cell",37),C("mouseenter",function(){let t=h(e).$implicit,o=p(2);return f(o.showTooltipOnHover(t.id))})("mouseleave",function(){let t=h(e).$implicit,o=p(2);return f(o.hideTooltipOnLeave(t.id))}),y(1,Nn,1,6,"yon-field",38),a(2,"div",39)(3,"p"),s(4,"Invalid mapping."),r(),a(5,"p"),s(6," See "),a(7,"a",40),C("click",function(){h(e);let t=p(2);return f(t.scrollToLog())}),s(8,"Log"),r(),s(9," for more information. "),r()()()}if(i&2){let e=m.$implicit,n=p(2);l(),v(e.youniumField!==""?1:-1),l(),_("hidden",e.validMapping&&n.showTooltip[e.id])}}function Ln(i,m){i&1&&(a(0,"mat-header-cell"),s(1,"SAMPLE DATA"),r())}function In(i,m){if(i&1&&(a(0,"mat-cell")(1,"p",42),s(2),r()()),i&2){let e=m.$implicit;l(),_("ngClass",de(2,vn,!e.validMapping)),l(),b(" ",e.sampleData==null?null:e.sampleData.join(", ")," ")}}function An(i,m){i&1&&(a(0,"mat-header-cell",43),s(1," ACTIONS "),r())}function Bn(i,m){if(i&1){let e=M();a(0,"yon-button",46),C("onClick",function(){h(e);let t=p().$implicit,o=p().$index,d=p();return f(d.removeRow(o,t))}),r()}if(i&2){let e=p().$implicit;_("tooltip","Remove "+e.youniumField+" row")("weight",350)}}function Hn(i,m){if(i&1&&(a(0,"mat-cell",44),y(1,Bn,1,2,"yon-button",45),r()),i&2){let e=m.$implicit;l(),v(e.isMandatory?-1:1)}}function zn(i,m){i&1&&T(0,"mat-header-row")}function $n(i,m){i&1&&T(0,"mat-row",47)}function Un(i,m){if(i&1){let e=M();a(0,"div",6)(1,"h4",12),s(2),r(),a(3,"mat-table",13,0),z(5,14),O(6,Tn,2,0,"mat-header-cell",15)(7,En,3,3,"mat-cell",16),$(),z(8,17),O(9,Pn,2,0,"mat-header-cell",15)(10,Rn,6,6,"mat-cell",18),$(),z(11,19),O(12,kn,2,0,"mat-header-cell",15)(13,Vn,10,2,"mat-cell",20),$(),z(14,21),O(15,Ln,2,0,"mat-header-cell",15)(16,In,3,4,"mat-cell",22),$(),z(17,23),O(18,An,2,0,"mat-header-cell",24)(19,Hn,2,1,"mat-cell",25),$(),O(20,zn,1,0,"mat-header-row",26)(21,$n,1,0,"mat-row",27),r(),a(22,"yon-button",28),C("onClick",function(){let t=h(e),o=t.$implicit,d=t.$index,c=p();return f(c.createEmptyRow(d,o))}),s(23," Add new row "),r()()}if(i&2){let e=m.$implicit,n=m.$index,t=p();l(2),w(e.entityDisplayName),l(),_("dataSource",t.dataSources()[n]),l(17),_("matHeaderRowDef",t.displayedColumns()),l(),_("matRowDefColumns",t.displayedColumns())}}var jt=(()=>{class i{constructor(e,n,t,o){this.uploadFileService=e,this.dmToolService=n,this.dmValidationService=t,this.notificationService=o,this.getMappingConfig=new E,this.anyRowValidating=new E,this.showLog=new E,this.isMandatoryMapped=new E,this.onScrollToLog=new E,this.dataSources=g([]),this.validatingRowsCount=g(void 0),this.orderFieldConfigurations=g([]),this.activeAddFields=g([]),this.dialogOpen=g(!1),this.sourceHeaderData=g([]),this.selectedSourceHeaders={},this.mappingConfig=g(new ve),this.savedMappingConfig=g(new ve),this.tableRows=g([]),this.rowIndex=g(0),this.fileName=g(""),this.templateName=g(void 0),this.isBigFile=g(!1),this.collapsedDataDetail
1s=g(!1),this.sourceHeaderText=g("Select the source header that contains the unique identifier for each "),this.FieldTypes=ge,this.columnHeaders=g([]),this.displayedColumns=g(["youniumField","dataType","sourceHeader","sampleData","actions"]),this.papa=S(Ge),this.showTooltip={},this.showDropdown={},this.cofToAdd={},this.cancelSubject=new be,se(()=>{this.uploadFileService.getFile().size>1e6&&(this.dmToolService.isBigFile.set(!0),this.isBigFile.set(!0)),this.validatingRowsCount()<=0&&!this.isBigFile()&&this.validateAndCreateLog()})}ngOnInit(){let e=this.uploadFileService.getParsedFile().data;this.fileName.set(this.uploadFileService.getFile().name),this.columnHeaders.set(Object.keys(e[0])),this.sourceHeaderData.set(this.columnHeaders()),this.validatingRowsCount.set(0)}ngAfterViewInit(){let e=this.dmToolService.getMappingTemplateData();this.entityDefinition.groupFields.forEach((n,t)=>{this.showDropdown[n.entityName]=t==0}),e?(this.templateName.set(this.dmToolService.getTemplateName()),this.createTablesFromTemplate(e.mappingConfig)):this.createTablesWithoutTemplate()}createTablesWithoutTemplate(){let e=this.entityDefinition.groupFields,n=[];e.forEach((t,o)=>{let d=[],c=new Set,u=[];t.configurableOperationFields.forEach(x=>{let P=this.findHeaderMatch(t,x),F=this.headerInMultipleGroupsFields(P);if(x.isMandatory||P){let G=x.fieldConfiguration,ie=x.isMandatory,re=`table_${o}_row_${this.rowIndex()}`;this.rowIndex.set(this.rowIndex()+1),c.has(x.displayName)||(d.push({groupField:t.entityName,isMandatory:ie,validMapping:!0,id:re,isValidating:!!(P&&!F),youniumField:x.displayName,sampleData:F?[""]:this.getSampleDataForHeader(P),dataType:x.isReference?"Reference":G.fieldType==ge.Enum?"Options":G.fieldType,dataKeyValue:F?"":P??"",isMapped:!!(P&&!F),fc:G,acceptedValues:x.acceptedValues??"",referenceInfo:this.getReferenceInfoDisplay(x)}),P&&!F&&(this.selectedSourceHeaders[re]=P),x.isMandatory??c.add(x.displayName))}c.has(x.displayName)||(!x.isMandatory&&!P&&u.push(x),c.add(x.displayName))}),u.sort((x,P)=>x.displayName.toLowerCase().localeCompare(P.displayName.toLowerCase())),t.addedFieldConfigurations=u,this.tableRows().push(d);let D=new xe(d);n.push(D)}),this.dataSources.set(n),this.createInitialMappingConfig()}createTablesFromTemplate(e,n=!1){n&&(this.mappingConfig.set(new ve),this.tableRows.set([]),this.entityDefinition.groupFields.forEach(d=>{d.dataFieldKey=null})),this.updateDataFieldKeysFromTemplate(e);let t=this.entityDefinition.groupFields,o=[];t.forEach((d,c)=>{let u=[],D=new Set,x=[];d.configurableOperationFields.forEach(F=>{let G=this.findTemplateRow(e,F);if(G){let ie=this.findHeaderMatchForTemplate(G.dataFieldKey),re=F.fieldConfiguration,nt=`table_${c}_row_${this.rowIndex()}`;this.rowIndex.set(this.rowIndex()+1),D.has(F.displayName)||(u.push({groupField:d.entityName,isMandatory:F.isMandatory||this.showDropdown[d.entityName]&&F.isMandatoryWithGroupKey,validMapping:!0,id:nt,isValidating:!!ie,youniumField:F.displayName,sampleData:this.getSampleDataForHeader(ie)??[""],dataType:F.isReference?"Reference":re.fieldType==ge.Enum?"Options":re.fieldType,dataKeyValue:G.dataFieldKey??"",isMapped:!!ie,fc:re,acceptedValues:F.acceptedValues??void 0,referenceInfo:this.getReferenceInfoDisplay(F)}),ie&&(this.selectedSourceHeaders[nt]=ie),F.isMandatory??D.add(F.displayName))}D.has(F.displayName)||(!F.isMandatory&&!G&&x.push(F),D.add(F.displayName))}),x.sort((F,G)=>F.displayName.toLowerCase().localeCompare(G.displayName.toLowerCase())),d.addedFieldConfigurations=x,this.tableRows().push(u);let P=new xe(u);o.push(P)}),this.dataSources.set(o),this.createInitialMappingConfig()}getReferenceInfoDisplay(e){return e.referenceDescription??e.fieldConfiguration.fieldExtendedDescription??`Value referencing ${e.displayName}`}updateDataFieldKeysFromTemplate(e){e.groupFields.forEach(n=>{let t=this.entityDefinition.groupFields.find(d=>d.entityName===n.entityName),o=this.columnHeaders().find(d=>d===n.dataFieldKey);t&&o&&(t.dataFieldKey=n.dataFieldKey,this.showDropdown[t.entityName]=!0,this.setKeyValue(n,n.dataFieldKey))})}headerInMultipleGroupsFields(e){let n=this.entityDefinition.groupFields,t=0;for(let o of n)if(o.configurableOperationFields.some(c=>c.fieldName===e)&&t++,t>1)return!0;return!1}displayHeader(e,n){let t=this.sourceHeaderData().find(o=>o==e.dataFieldKey);this.selectedSourceHeaders[n]=t}findTemplateRow(e,n){return e.dataFields.find(o=>o.fieldName.toLowerCase()===n.fieldName.toLowerCase()&&o.entityName.toLowerCase()===n.fieldConfiguration.entityName.toLowerCase())}findHeaderMatch(e,n){return this.columnHeaders().find(o=>o.replace(/\s/g,"").toLowerCase()==n.fieldConfiguration.fieldName.toLowerCase()||o.replace(/\s/g,"").toLowerCase().startsWith(`${e.entityName.toLowerCase()}:`)&&o.replace(/\s/g,"").toLowerCase()==`${e.entityName.toLowerCase()}:`+n.fieldName.toLowerCase())}findHeaderMatchForTemplate(e){return this.columnHeaders().find(t=>t.replace(/\s/g,"").toLowerCase()==e?.replace(/\s/g,"").toLowerCase())}displayInitialMappedHeaders(e,n){this.selectedSourceHeaders[n]=e}createEmptyRow(e,n){this.rowIndex.set(this.rowIndex()+1);let t=`table_${e}_row_${this.rowIndex()}`,o={groupField:n.entityName,isMandatory:!1,validMapping:!0,id:t,isValidating:!1,youniumField:"",dataType:void 0,fc:void 0},d=this.dataSources();d[e].data.push(o),d[e]._updateChangeSubscription(),this.syncTableWithSourceData(e),this.autoScrollToNewTableRow(e)}autoScrollToNewTableRow(e){let o=this.tableRefs.toArray()[e]._elementRef.nativeElement;o.scrollTop=o.scrollHeight}showTooltipOnHover(e){this.showTooltip[e]=!0}hideTooltipOnLeave(e){this.showTooltip[e]=!1}
1toggleKeyDropdowns(e,n){this.showDropdown[e]=n.checked}onYouniumSelectChange(e,n){this.cofToAdd[n]=e}toggleCollapseDataDetails(){this.collapsedDataDetails.set(!this.collapsedDataDetails())}scrollToLog(){this.onScrollToLog.emit()}setYouniumField(e,n,t,o){if(this.isBigFile()&&this.dmToolService.isValidated.set(!1),!e)return;if(this.tableRows()[t].some(u=>u.youniumField==e.displayName))return this.notificationService.error("Can not add a row that already exists");let d=this.dataSources()[t].data.findIndex(u=>u.id===n.id),c=this.dataSources();c[t].data[d].youniumField=e.displayName,c[t].data[d].dataType=e.isReference?"Reference":e.fieldConfiguration.fieldType==ge.Enum?"Options":e.fieldConfiguration.fieldType,c[t].data[d].fc=e.fieldConfiguration,c[t].data[d].acceptedValues=e.acceptedValues,c[t].data[d].referenceInfo=this.getReferenceInfoDisplay(e),c[t]._updateChangeSubscription(),this.dataSources.set(c),this.syncTableWithSourceData(t),this.updateAddedFieldConfigurationsForGroupField(e.fieldConfiguration.fieldName,t,"remove"),this.addNewDataFieldToMappingConfig(e.fieldName,o.entityName,n)}updateAddedFieldConfigurationsForGroupField(e,n,t){let o=this.entityDefinition.groupFields[n];if(t=="add"&&e){let d=o.configurableOperationFields.find(c=>c.fieldConfiguration.fieldName===e);o.addedFieldConfigurations.push(d),o.addedFieldConfigurations.sort((c,u)=>c.displayName.toLowerCase().localeCompare(u.displayName.toLowerCase()))}else{let d=o.addedFieldConfigurations.findIndex(c=>c.fieldConfiguration.fieldName===e);d!==-1&&o.addedFieldConfigurations.splice(d,1)}this.entityDefinition.groupFields[n]=o}removeRow(e,n){this.isBigFile()&&this.dmToolService.isValidated.set(!1);let t=this.dataSources()[e].data.findIndex(d=>d.id===n.id);n?.sampleData&&n.sampleData==null;let o=this.dataSources();o[e].data.splice(t,1),o[e]._updateChangeSubscription(),this.dataSources.set(o),this.syncTableWithSourceData(e),this.dmValidationService.cancelValidationCall(n),this.selectedSourceHeaders[n.id]=void 0,n.youniumField!==""&&this.removeDataField(n),this.updateAddedFieldConfigurationsForGroupField(n?.fc?.fieldName,e,"add")}removeDataField(e){let n=this.mappingConfig().dataFields.findIndex(t=>t.guiRowId==e.id);this.mappingConfig().dataFields.splice(n,1),this.getMappingConfig.emit(this.mappingConfig()),this.isBigFile()?this.dmToolService.isValidated.set(!1):this.validateAndCreateLog()}addNewDataFieldToMappingConfig(e,n,t){let o={dataFieldKey:"",isMapped:!1,entityName:n,fieldName:e,guiRowId:t.id};this.mappingConfig().dataFields.push(o),this.getMappingConfig.emit(this.mappingConfig())}createInitialMappingConfig(){let e=this.tableRows().flat();this.mappingConfig().dataFields=e.map(n=>({dataFieldKey:n.dataKeyValue,isMapped:n.sampleData[0]!="",entityName:n.fc.entityName,fieldName:n.fc.fieldName,guiRowId:n.id})),this.isBigFile()?this.dmToolService.isValidated.set(!1):this.validateAndCreateLog(),this.getMappingConfig.emit(this.mappingConfig())}getSampleDataForHeader(e,n=3){let t=[];if(e==null)return t.push(""),t;let o=this.uploadFileService.getParsedFile().data,d=0;for(let c of o){if(!Object.prototype.hasOwnProperty.call(c,e))continue;let u=c[e];if(u!==""&&t.push(u),++d>=n)break}return t}displaySampleData(e,n,t,o){let d=[],c=this.getSampleDataForHeader(e);if(this.addRowToMappingCofig(n,e),c.length>0){d.push(...c);let D=this.dataSources()[t].data.map(x=>x.id===n.id?k(R({},x),{sampleData:d}):x);this.dataSources()[t].data=D}this.isBigFile()?this.dmToolService.isValidated.set(!1):this.preValidateRow(o,n,e,t)}preValidateRow(e,n,t,o,d=!1){if(t&&!d){let c=this.dataSources(),u=c[o].data.findIndex(D=>D.id===n.id);c[o].data[u].isValidating=!0,c[o]._updateChangeSubscription(),this.dataSources.set(c)}if(this.validatingRowsCount.set(this.validatingRowsCount()+1),this.validatingRowsCount()>0&&this.anyRowValidating.emit(!0),!t){this.onlyTriggerLogValidation(n,o);return}this.dmValidationService.preValidateRow(e,n,t,this.entityDefinition,this.selectedAction).pipe(A(1),le(()=>{this.validatingRowsCount.set(this.validatingRowsCount()-1),this.syncTableWithSourceData(o)})).subscribe({next:c=>{let u=this.dataSources(),D=u[o].data.findIndex(x=>x.id===n.id);
1D!=null&&(u[o].data[D].validMapping=c,u[o].data[D].isMapped=t?c:!1,u[o].data[D].isValidating=!1),this.dataSources.set(u)}})}onlyTriggerLogValidation(e,n){let t=this.dataSources();this.dmValidationService.cancelValidationCall(e);let o=t[n].data.findIndex(d=>d.id===e.id);o!=null&&(t[n].data[o].isMapped=!1,t[n].data[o].isValidating=!1,t[n].data[o].validMapping=!0),this.dataSources.set(t),this.validatingRowsCount.set(this.validatingRowsCount()-1),this.syncTableWithSourceData(n)}syncTableWithSourceData(e){this.tableRows()[e]=this.dataSources()[e].data}validateAndCreateLog(){this.checkMandatoryRows(),this.cancelSubject.next(),this.anyRowValidating.emit(!0);let n={data:this.uploadFileService.getParsedFile().data,mappingConfig:this.mappingConfig(),entityType:this.entityDefinition.entityName,operationType:this.selectedAction,dataFormatConfig:this.dmToolService.getDataFormatConfig()},t=this.dataSources().flat().map(d=>d.data).flat(),o=new Set;this.dmValidationService.preValidate(n).pipe(we(this.cancelSubject),le(()=>{this.showLog.emit(),this.anyRowValidating.emit(!1)})).subscribe({next:d=>{for(let c of d.log.errors)if(!o.has(c.guiRowId)){let u=t.find(D=>D.id===c.guiRowId);u&&(u.validMapping=!1,o.add(c.guiRowId),u.isValidating=!1)}d.log.errors.length==0&&t.forEach(c=>
1{c.validMapping=!0,c.isValidating=!1}),d?.error&&console.error(d.error),this.dmToolService.setLogData(d),this.dmToolService.setErrorLog(d.log?.errors),this.dmToolService.isValidated.set(!0)},error:d=>{this.dmToolService.isValidated.set(!1),this.notificationService.error(d?.error?.message??d?.message??"Validation failed")}})}addRowToMappingCofig(e,n){let t=this.mappingConfig().dataFields.findIndex(o=>o.entityName.toLowerCase()===e.fc.entityName.toLowerCase()&&o.fieldName.toLowerCase()===e.fc.fieldName.toLowerCase());this.mappingConfig().dataFields[t].dataFieldKey=n??"",this.mappingConfig().dataFields[t].guiRowId=e.id,n?this.mappingConfig().dataFields[t].isMapped=!0:this.mappingConfig().dataFields[t].isMapped=!1,this.getMappingConfig.emit(this.mappingConfig())}setKeyValue(e,n){this.isBigFile()&&this.dmToolService.isValidated.set(!1);let o=this.mappingConfig().groupFields?.some(c=>c.entityName==e.entityName),d=this.mappingConfig().groupFields.findIndex(c=>c.entityName===e.entityName);if(this.validatingRowsCount.set(this.validatingRowsCount()+1),o)this.mappingConfig().groupFields[d].dataFieldKey=n??null,this.mappingConfig().groupFields[d].isMapped=!!n;else{let c={dataFieldKey:n,entityName:e.entityName,isMapped:!0};this.mappingConfig().groupFields.push(c)}this.validatingRowsCount.set(this.validatingRowsCount()-1),this.getMappingConfig.emit(this.mappingConfig())}addRequiredKeyRows(e,n){let t=this.tableRows()[n];e.configurableOperationFields.forEach(o=>{if(o.isMandatoryWithGroupKey){if(t.find(c=>c.youniumField==o.displayName))return;this.createRequiredKeyRows(o,e.entityName,n),this.updateAddedFieldConfigurationsForGroupField(o.fieldConfiguration.fieldName,n,"remove")}})}createRequiredKeyRows(e,n,t){this.rowIndex.set(this.rowIndex()+1);let o=`table_${t}_row_${this.rowIndex()}`,d={groupField:n,isMandatory:!0,validMapping:!0,id:o,isValidating:!1,youniumField:e.displayName,dataType:e.isReference?"Reference":e.fieldConfiguration.fieldType==ge.Enum?"Options":e.fieldConfiguration.fieldType,fc:e.fieldConfiguration,referenceInfo:this.getReferenceInfoDisplay(e)},c=this.dataSources();c[t].data.unshift(d),c[t]._updateChangeSubscription(),this.dataSources.set(c),this.addNewDataFieldToMappingConfig(e.fieldName,n,d),this.syncTableWithSourceData(t)}toggleKeyRowMandatory(e,n,t){let o=this.tableRows()[n];e.configurableOperationFields.forEach(d=>{if(d.isMandatoryWithGroupKey){let c=o.find(u=>u.youniumField==d.displayName&&d.isMandatoryWithGroupKey);if(c){let u=this.dataSources()[n].data.findIndex(x=>x.id===c.id),D=this.dataSources();D[n].data[u].isMandatory=t.checked,D[n]._updateChangeSubscription(),this.dataSources.set(D)}}}),t.checked||(this.setKeyValue(e,void 0),e.dataFieldKey=null)}onDropdownChange(e,n){this.selectedSourceHeaders[n]=e}checkMandatoryRows(){let e=this.tableRows().flat();e.some(n=>n.isMandatory&&!n.isMapped)||e.length==0?this.isMandatoryMapped.emit(!1):this.isMandatoryMapped.emit(!0)}onFileSelected(e){if(e){if(!this.uploadFileService.isValidCsvFile(e))return this.notificationService.error("We currently only support CSV files");if(this.uploadFileService.isFileTooLarge(e))return this.notificationService.error(this.uploadFileService.fileTooLargeMessage(e));this.papa.parse(e,{encoding:"UTF-8",header:!0,skipEmptyLines:!0,complete:n=>{let t=this.uploadFileService.countEmptyRows(n.data);if(t>this.uploadFileService.maxEmptyRows){this.notificationService.error(this.uploadFileService.tooManyEmptyRowsMessage(t));return}this.uploadFileService.setParsedFile(n),this.uploadFileService.setFile(e),this.columnHeaders.set(Object.keys(n.data[0])),this.sourceHeaderData.set(this.columnHeaders()),this.fileName.set(e.name),this.createTablesFromTemplate(this.mappingConfig(),!0),this.dmToolService.isValidated.set(!1)},worker:!1})}}static{this.\u0275fac=function(n){return new(n||i)(J(K),J(I),J(zt),J(q))}}static{this.\u0275cmp=L({type:i,selectors:[["yon-entity-table-mapping"]],viewQuery:function(n,t){if(n&1&&X(fn,5),n&2){let o;N(o=V())&&(t.tableRefs=o)}},inputs:{entityDefinition:"entityDefinition",selectedAction:"selectedAction"},outputs:{getMappingConfig:"getMappingConfig",anyRowValidating:"anyRowValidating",showLog:"showLog",isMandatoryMapped:"isMandatoryMapped",onScrollToLog:"onScrollToLog"},decls:12,vars:3,consts:[["tableRef",""],[1,"mb-2","mt-2"],[1,"headers"],[1,"width-50"],["type","mat-icon-button",1,"collapse-button__position",3,"onClick","ngClass","customClass","buttonIcon"],[1,"mb-3"],[1,"entity-table-import__container"],[1,"group-key-checkboxes",3,"ngModelChange","change","ngModel","disabled"],[1,"flex","items-center"],[1,"mandatory-group-key"],[1,"entity-table-import__key-dropdown-container"],["type","select",1,"entity-table-import__select-key","mb
1-2",3,"ngModelChange","onChange","useWideDropdown","disableBlur","ngModel","title","data"],[1,"headers","mb-1"],[1,"entity-table__import",3,"dataSource"],["matColumnDef","youniumField"],[4,"matHeaderCellDef"],[3,"matTooltip",4,"matCellDef"],["matColumnDef","dataType"],["matTooltipPosition","below",3,"matTooltip",4,"matCellDef"],["matColumnDef","sourceHeader"],["class","invalid-mapping-tooltip",3,"mouseenter","mouseleave",4,"matCellDef"],["matColumnDef","sampleData"],[4,"matCellDef"],["matColumnDef","actions"],["class","table-import__action-header",4,"matHeaderCellDef"],["class","table-import__actions",4,"matCellDef"],[4,"matHeaderRowDef"],["matRipple","","class","element-row",4,"matRowDef","matRowDefColumns"],["buttonIcon","add",1,"entity-table-import__add-row-button","mt-2",3,"onClick"],[3,"matTooltip"],["type","select","textField","displayName","valueField","fieldName",1,"width-80","table-import__drop-down",3,"useWideDropdown","valuePrimitive","ngModel","data"],[1,"mandatory-row"],[1,"youniumfield-text",3,"ngStyle"],["type","select","textField","displayName","valueField","fieldName",1,"width-80","table-import__drop-down",3,"ngModelChange","onChange","useWideDropdown","valuePrimitive","ngModel","data"],["matTooltipPosition","below",3,"matTooltip"],[1,"table-cell__text"],[1,"import-table__reference-info",3,"matTooltip"],[1,"invalid-mapping-tooltip",3,"mouseenter","mouseleave"],["type","select",1,"width-80","table-import__drop-down",3,"ngClass","useWideDropdown","data","ngModel"],[1,"tooltip",3,"hidden"],[3,"click"],["type","select",1,"width-80","table-import__drop-down",3,"ngModelChange","onChange","ngClass","useWideDropdown","data","ngModel"],[1,"table-cell__text",3,"ngClass"],[1,"table-import__action-header"],[1,"table-import__actions"],["type","mat-icon-button","color","primary","buttonIcon","delete",3,"tooltip","weight"],["type","mat-icon-button","color","primary","buttonIcon","delete",3,"onClick","tooltip","weight"],["matRipple","",1,"element-row"]],template:function(n,t){n&1&&(z(0),a(1,"div",1)(2,"h4",2),s(3,"Add supplementary data details"),r(),a(4,"p",3),s(5," Order data consists of one or more products. The source data must have columns that specify how the data should be grouped. "),r(),Y(6,wn,2,1,"div",null,ee),r(),a(8,"yon-button",4),C("onClick",function(){return t.toggleCollapseDataDetails()}),r(),T(9,"mat-divider",5),Y(10,Un,24,4,"div",6,ee),$()),n&2&&(l(6),Z(t.entityDefinition==null?null:t.entityDefinition.groupFields),l(2),_("ngClass",t.collapsedDataDetail
1s()?"isCollapsed":"")("customClass","entity-table-import-data-details-collapse")("buttonIcon","double_arrow"),l(2),Z(t.entityDefinition==null?null:t.entityDefinition.groupFields))},dependencies:[me,ce,Se,te,_e,ue,Ce,Ee,Fe,fe,Oe,qe,Ne,Le,He,Ie,Ve,ze,Ae,Be,$e,Ue,ne,he,j,Rt],styles:['.color__yon-orange[_ngcontent-%COMP%]{color:var(--color-primary)}.entity-table-import__key-dropdown-container[_ngcontent-%COMP%]{margin-left:44px}.entity-table-import__key-dropdown-container[_ngcontent-%COMP%] .entity-table-import__select-key[_ngcontent-%COMP%]{display:block;width:min(30%,300px)}.entity-table-import__select-key[_ngcontent-%COMP%] .field-title{font-weight:400;text-transform:none}.group-key-checkboxes[_ngcontent-%COMP%] .mdc-label{font-weight:500;color:#424242}.group-key-checkboxes[_ngcontent-%COMP%] .mandatory-group-key[_ngcontent-%COMP%]{color:var(--color-primary);font-size:20px;margin-left:5px}.group-key-checkboxes[_ngcontent-%COMP%] .mat-mdc-checkbox.mat-mdc-checkbox-disabled[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{color:#424242}[_nghost-%COMP%]{display:block;position:relative}.collapse-button__position[_ngcontent-%COMP%]{display:flex;position:absolute;left:50%;transform:translate(-50%,-50%)}.isCollapsed[_ngcontent-%COMP%]{transform:translate(-50%,-50%) rotate(180deg)}.collapse-button__position[_ngcontent-%COMP%] .entity-table-import-data-details-collapse{background-color:var(--color-secondary);display:flex;align-items:center}.collapse-button__position[_ngcontent-%COMP%] .entity-table-import-data-details-collapse .material-symbols-sharp{color:#fff;transform:rotate(270deg);width:100%;font-variation-settings:"wght" 400}.headers[_ngcontent-%COMP%]{font-size:20px;font-weight:400}.entity-table-import__container[_ngcontent-%COMP%]{margin-bottom:min(5%,80px)}.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%]{background-color:transparent;max-height:400px;overflow-y:auto}.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%] .mat-mdc-header-row[_ngcontent-%COMP%]{position:sticky;top:0;z-index:2;height:55px}.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%] .mat-mdc-header-row[_ngcontent-%COMP%] .mat-mdc-header-cell[_ngcontent-%COMP%]{align-items:center}.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%] .mat-mdc-header-row[_ngcontent-%COMP%] .mat-mdc-header-cell[_ngcontent-%COMP%]:first-child{padding-left:50px}@media(max-width:1200px){.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%] .mat-mdc-header-row[_ngcontent-%COMP%] .mat-mdc-header-cell[_ngcontent-%COMP%]{padding-left:50px}.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%] .mat-mdc-header-row[_ngcontent-%COMP%] .mat-mdc-header-cell[_ngcontent-%COMP%]:first-child{margin-left:0}}.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%] .mat-mdc-row[_ngcontent-%COMP%]{height:55px}.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%] .mat-mdc-row[_ngcontent-%COMP%] .mdc-data-table__cell[_ngcontent-%COMP%]{padding-left:0}@media(max-width:1200px){.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%] .mat-mdc-row[_ngcontent-%COMP%] .mdc-data-table__cell[_ngcontent-%COMP%]{padding-left:40px}.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%] .mat-mdc-row[_ngcontent-%COMP%] .mdc-data-table__cell[_ngcontent-%COMP%]:last-child{padding-right:40px}}.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%] .mat-mdc-row[_ngcontent-%COMP%] .mdc-data-table__cell[_ngcontent-%COMP%]:first-child{padding-left:40px}.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%] .table-import__action-header[_ngcontent-%COMP%]{max-width:150px}.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%] .table-import__actions[_ngcontent-%COMP%]{max-width:150px;justify-content:space-between}.entity-table-import__container[_ngcontent-%COMP%] .entity-table__import[_ngcontent-%COMP%] .import-table__reference-info[_ngcontent-%COMP%]{color:var(--color-primary);font-size:18px;margin-bottom:5px;font-family:Material Symbols Sharp}.entity-table-import__container[_ngcontent-%COMP%] .entity-table-import__add-button[_ngcontent-%COMP%]{align-self:center}.entity-table-import__container[_ngcontent-%COMP%] .mandatory-row[_ngcontent-%COMP%]{color:var(--color-primary);font-size:20px;margin-left:-20px}.entity-table-import__container[_ngcontent-%COMP%] .youniumfield-text[_ngcontent-%COMP%]{margin-left:20px;margin-bottom:0}.entity-table-import__container[_ngcontent-%COMP%] .table-cell__text[_ngcontent-%COMP%]{margin-left:10px;margin-bottom:0;width:90%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.entity-table-import__container[_ngcontent-%COMP%] .red-sample-text[_ngcontent-%COMP%]{color:red}
1.entity-table-import__container[_ngcontent-%COMP%] .invalid-data-mapping[_ngcontent-%COMP%] .wide__drop-down{border-color:red}.entity-table-import__container[_ngcontent-%COMP%] .table-import__drop-down[_ngcontent-%COMP%]{margin-left:10px}.entity-table-import__container[_ngcontent-%COMP%] .table-import__drop-down[_ngcontent-%COMP%] .wide__drop-down{height:35px}.entity-table-import__container[_ngcontent-%COMP%] .entity-table-import__add-row-button[_ngcontent-%COMP%] .mat-mdc-raised-button{box-shadow:none;border:none;background-color:transparent}.entity-table-import__container[_ngcontent-%COMP%] .entity-table-import__add-row-button[_ngcontent-%COMP%] .mat-mdc-raised-button:hover{box-shadow:none}.entity-table-import__container[_ngcontent-%COMP%] .entity-table-import__add-row-button[_ngcontent-%COMP%] .mat-mdc-raised-button .mdc-button__label{align-items:end}.entity-table-import__container[_ngcontent-%COMP%] .entity-table-import__add-row-button[_ngcontent-%COMP%] :not(.mat-mdc-raised-button[disabled]) .mdc-button__label{color:var(--color-primary)}.entity-table-import__add-dropdown[_ngcontent-%COMP%] .wide__drop-down{height:35px}.invalid-mapping-tooltip[_ngcontent-%COMP%]{overflow:visible}.invalid-mapping-tooltip[_ngcontent-%COMP%] .tooltip[_ngcontent-%COMP%]{opacity:1;position:absolute;top:75%;left:50%;background-color:#373737;color:#fff;padding:8px;border-radius:4px;z-index:999;display:none;font-weight:400;line-height:16px;text-align:left;font-family:Roboto,sans-serif}.invalid-mapping-tooltip[_ngcontent-%COMP%] .tooltip[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;padding:0}.invalid-mapping-tooltip[_ngcontent-%COMP%] .tooltip[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#0284e2;text-decoration:underline;cursor:pointer}.invalid-mapping-tooltip[_ngcontent-%COMP%]:hover .tooltip[_ngcontent-%COMP%]{display:block}.entity-table__import[_ngcontent-%COMP%] .mat-mdc-row[_ngcontent-%COMP%]:last-child .tooltip[_ngcontent-%COMP%]{top:auto;bottom:100%}.check-box__entity-keys[_ngcontent-%COMP%] .headers[_ngcontent-%COMP%]{font-size:20px;font-weight:400}.check-box__entity-keys[_ngcontent-%COMP%] .check-box-entity-keys[_ngcontent-%COMP%]{margin-left:-10px}'],changeDetection:0})}}return i})();var qn=["saveTemplateDialog"];function jn(i,m){if(i&1){let e=M();a(0,"yon-button",9),C("onClick",function(){h(e);let t=p(2);return f(t.updateTemplate())}),s(1,"UPDATE TEMPLATE"),r()}}function Kn(i,m){if(i&1&&(y(0,jn,2,0,"yon-button",8),a(1,"span"),s(2),r()),i&2){let e,n=p();v(n.mappingTemplate().isStandard?-1:0),l(2),b("Current template: ",(e=n.mappingTemplate())==null?null:e.templateName)}}function Wn(i,m){if(i&1){let e=M();a(0,"p"),s(1,"This version will be saved as a template to use in future data mapping."),r(),a(2,"yon-field",10),C("ngModelChange",function(t){h(e);let o=p();return f(o.templateNameFromDialog.set(t))}),r(),a(3,"div",11)(4,"yon-button",12),C("onClick",function(){h(e);let t=p();return f(t.saveTemplate())}),s(5," Save "),r(),a(6,"yon-button",13),C("onClick",function(){h(e),p();let t=B(8);return f(t.close())}),s(7,"Cancel"),r()()}if(i&2){let e=p();l(2),_("ngModel",e.templateNameFromDialog()),l(2),_("disabled",!e.templateNameFromDialog()||e.templateSaving())}}var Kt=(()=>{class i{constructor(){this.operationRequest=mt(),this.onFileSelect=ct(),this.templateNameFromDialog=g(""),this.templateSaving=g(!1),this.mappingTemplate=g(void 0),this.dmToolService=S(I),this.notificationService=S(q)}ngOnInit(){this.mappingTemplate.set(this.dmToolService.getTemplate())}saveTemplate(){this.templateSaving.set(!0);let e=this.createMappingTemplateRequest(Me.Save);this.dmToolService.saveMappingTemplate(e).pipe(A(1),le(()=>this.templateSaving.set(!1))).subscribe({next:n=>{this.notificationService.success("Template created and saved"),this.templateNameFromDialog.set("");let t=new Bt({template:e.template,templateName:e.templateName,templateId:n});this.mappingTemplate.set(t),this.dmToolService.setTemplate(t),this.saveTemplateDialog.close()},error:n=>this.notificationService.error(n?.error?.message)})}updateTemplate(){this.templateSaving.set(!0);let e=this.createMappingTemplateRequest(Me.Update);
1this.dmToolService.updateMappingTemplate(e).pipe(A(1),le(()=>this.templateSaving.set(!1))).subscribe({next:n=>{this.notificationService.success("Template updated")},error:n=>this.notificationService.error(n.error.message)})}createMappingTemplateRequest(e){let n=this.operationRequest();if(!n){this.notificationService.error("Operation request is required");return}let t={mappingConfig:n.mappingConfig,entityType:n.entityType,operationType:n.operationType,dataFormatConfig:k(R({},this.dmToolService.getDataFormatConfig()),{fileName:n.dataFormatConfig?.fileName})};if(e==Me.Save)return{template:t,templateName:this.templateNameFromDialog()};if(e==Me.Update){if(!this.mappingTemplate()||!this.mappingTemplate().templateId){this.notificationService.error("Mapping template is not set or has no Id");return}return{templateId:this.mappingTemplate().templateId,template:t,templateName:this.mappingTemplate().templateName}}else{this.notificationService.error("Invalid request type");return}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=L({type:i,selectors:[["yon-dmt-file-buttons"]],viewQuery:function(n,t){if(n&1&&X(qn,5),n&2){let o;N(o=V())&&(t.saveTemplateDialog=o.first)}},inputs:{operationRequest:[1,"operationRequest"]},outputs:{onFileSelect:"onFileSelect"},decls:11,vars:4,consts:[["saveTemplateDialog",""],["saveTemplateTemplate",""],[1,"file-buttons__container"],[1,"file-buttons__upload"],[3,"onFileSelected","replaceFileForMapping"],[1,"file-buttons__mapping"],["buttonIcon","assignment_add","tooltip","Save a copy of this data mapping to use as template in the future",3,"onClick"],["header","Save Template",3,"customClass","containerTemplate"],["buttonIcon","sync"],["buttonIcon","sync",3,"onClick"],["type","text","title","Set a template name",1,"data-mapping__template-name-input",3,"ngModelChange","ngModel"],[1,"flex","justify-end"],["color","primary",1,"mr-2",3,"onClick","disabled"],[3,"onClick"]],template:function(n,t){if(n&1){let o=M();a(0,"div",2)(1,"div",3)(2,"yon-file-upload",4),C("onFileSelected",function(c){return t.onFileSelect.emit(c)}),r()(),a(3,"div",5)(4,"yon-button",6),C("onClick",function(){h(o);let c=B(8);return f(c.show())}),s(5," SAVE AS TEMPLATE "),r(),y(6,Kn,3,2),r()(),T(7,"yon-dialog-center",7,0),O(9,Wn,8,2,"ng-template",null,1,pe)}if(n&2){let o=B(10);l(2),_("replaceFileForMapping",!0),l(4),v(t.mappingTemplate()?6:-1),l(),_("customClass","data-mapping__save-template-dialog")("containerTemplate",o)}},dependencies:[Qe,j,ke,We,Ce,te,_e,ue],styles:["[_nghost-%COMP%]{display:block}.file-buttons__container[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;flex-wrap:wrap}.file-buttons__upload[_ngcontent-%COMP%], .file-buttons__mapping[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}"],changeDetection:0})}}return i})(),Me=(function(i){return i[i.Save=0]="Save",i[i.Update=1]="Update",i})(Me||{});var Qn=["saveTemplateDialog"],Gn=["entityTableMapping"];function Yn(i,m){i&1&&T(0,"mat-progress-spinner",3),i&2&&_("matTooltip","Validating rows and updating log")}var Wt=(()=>{class i{constructor(){this.showLog=new E,this.onScrollToLog=new E,this.operationDisable=new E(!1),this.mappingConfig=g(new ve),this.operationRequest=g(new kt),this.dataFormatConfig=g(new Nt),this.parsedFile=g([]),this.file=g(void 0),this.templateNameFromDialog=g(""),this.validatingRows=g(!1),this.logHasErrors=g(!0),this.isMandatoryMapped=g(void 0),this.templateSaving=g(!1),this.uploadFileService=S(K),this.dmToolService=S(I),this.notificationService=S(q),this.notificationHubService=S(Pe),se(()=>{this.dmToolService.isValidated()?this.logHasErrors()?this.operationDisable.emit(`Resolve errors before you ${this.selectedAction}`):this.validatingRows()?this.operationDisable.emit("Rows are currently validating"):this.isMandatoryMapped()?this.operationDisable.emit(!1):this.operationDisable.emit("Mandatory rows must be mapped"):this.operationDisable.emit(`Validate mapping before running ${this.selectedAction}`)})}ngOnInit(){this.parsedFile.set(this.uploadFileService.getParsedFile().data),this.file.set(this.uploadFileService.getFile()),this.setOperationRequestData(),this.validatingRows.set(!1)}checkErrorLog(){let e=this.dmToolService.getErrorLog();e.length>0?this.logHasErrors.set(!0):this.logHasErrors.set(!1)}setOperationRequestData(){this.dataFormatConfig.set(k(R({},this.dmToolService.getDataFormatConfig()),{fileName:this.file().name})),this.operationRequest.set(k(R({},this.operationRequest()),{entityType:this.entityDefinition.entityName,operationType:this.selectedAction,data:this.parsedFile(),dataFormatConfig:this.dataFormatConfig()}
1))}onMappingConfigFetched(e){let n=this.uploadFileService.getParsedFile().data;this.operationRequest.set(k(R({},this.operationRequest()),{mappingConfig:e,data:n}));let t={operationRequest:this.operationRequest(),entityDefinition:this.entityDefinition,selectedAction:this.selectedAction};this.dmToolService.setProcessingRequest(t)}updateValidatingRows(e){this.validatingRows.set(e)}showLogAfterValidation(){this.showLog.emit()}scrollToLog(){this.onScrollToLog.emit()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=L({type:i,selectors:[["yon-data-management-mapping"]],viewQuery:function(n,t){if(n&1&&X(Qn,5)(Gn,5),n&2){let o;N(o=V())&&(t.saveTemplateDialog=o.first),N(o=V())&&(t.entityTableMapping=o.first)}},inputs:{entityDefinition:"entityDefinition",selectedAction:"selectedAction"},outputs:{showLog:"showLog",onScrollToLog:"onScrollToLog",operationDisable:"operationDisable"},decls:7,vars:4,consts:[["entityTableMapping",""],["header","Data mapping",1,"data-managment__data-mapping"],[1,"flex","items-center"],["mode","indeterminate","diameter","28",1,"mr-2",3,"matTooltip"],[3,"onFileSelect","operationRequest"],[3,"getMappingConfig","anyRowValidating","showLog","onScrollToLog","isMandatoryMapped","entityDefinition","selectedAction"]],template:function(n,t){if(n&1){let o=M();a(0,"yon-card",1)(1,"yon-card-header-right")(2,"div",2),y(3,Yn,1,1,"mat-progress-spinner",3),r()(),a(4,"yon-dmt-file-buttons",4),C("onFileSelect",function(c){h(o);let u=B(6);return f(u.onFileSelected(c))}),r(),a(5,"yon-entity-table-mapping",5,0),C("getMappingConfig",function(c){return t.onMappingConfigFetched(c)})("anyRowValidating",function(c){return t.updateValidatingRows(c)})("showLog",function(){return t.showLogAfterValidation()})("onScrollToLog",function(){return t.scrollToLog()})("isMandatoryMapped",function(c){return t.isMandatoryMapped.set(c)}),r()()}n&2&&(l(3),v(t.validatingRows()?3:-1),l(),_("operationRequest",t.operationRequest()),l(),_("entityDefinition",t.entityDefinition)("selectedAction",t.selectedAction))},dependencies:[te,ye,Ke,Tt,wt,ne,he,fe,jt,Kt],styles:[".data-managment__data-mapping[_ngcontent-%COMP%] .card-block{padding-bottom:40px}.data-managment__data-mapping[_ngcontent-%COMP%] .card__header{font-size:24px;font-weight:400}"],changeDetection:0})}}return i})();var Zn=i=>({dragover:i}),Xn=(i,m)=>({"max-width.px":i,"height.px":m});function Jn(i,m){if(i&1){let e=M();a(0,"div",4),C("drop",function(t){h(e);let o=p();return f(o.uploadFile(t))})("dragover",function(t){h(e);let o=p();return f(o.onDragOver(t))})("dragleave",function(t){h(e);let o=p();return f(o.onDragLeave(t))}),a(1,"div",5),T(2,"yon-icon",6),a(3,"p",7),s(4,"Drop your file here!"),r(),a(5,"p"),s(6,"or"),r(),a(7,"yon-file-upload",8),C("onFileSelected",function(t){h(e);let o=p();return f(o.onFileSelected(t))}),r(),a(8,"p",9),s(9,"Supported file type: CSV"),r(),a(10,"p"),s(11,"Size limit: 10 MB"),r()()()}if(i&2){let e=p();_("ngClass",de(5,Zn,e.isDragging()))("ngStyle",dt(7,Xn,e.maxWidth,e.height)),l(2),_("size",40)("weight",350),l(5),_("importBrowseFiles",!0)}}function ei(i,m){if(i&1&&(a(0,"div",2)(1,"div",10)(2,"div",11),T(3,"yon-icon",12),a(4,"p",13),s(5),r()(),a(6,"p",9),s(7),r()(),T(8,"progress",14),r()),i&2){let e,n=p();l(3),_("weight",350),l(2),w((e=n.uploadedFile())==null?null:e.name),l(2),w(n.progressText()),l(),_("value",n.uploadProgress())}}function ti(i,m){if(i&1){let e=M();a(0,"div",3)(1,"p",9)(2,"i",15),s(3),r(),s(4),r(),a(5,"yon-button",16),C("onClick",function(){h(e);let t=p();return f(t.removeFile())}),r()()}if(i&2){let e=p();l(3),w(e.uploadedFile().name),l(),b(" ",e.removeFileText()," "),l(),_("size",30)("weight",350)("buttonIcon","delete")}}var Qt=(()=>{class i{constructor(e,n,t){this.papa=e,this.notificationService=n,this.uploadFileService=t,this.maxWidth=600,this.height=300,this.onFileChanged=new E,this.isDragging=g(!1),this.hideDropZone=g(!1),this.hideProgessBar=g(!0),this.uploadedFile=g(void 0),this.progress=g(0),this.uploadProgress=g(null),this.progressText=g(""),this.removeFileText=g("")}onFileSelected(e){if(!e)return;if(!this.uploadFileService.isValidCsvFile(e))return this.uploadedFile.set(void 0),this.notificationService.error("We currently only support CSV files");if(this.exceedsSizeLimit(e))return;this.uploadedFile.set(e),this.hideProgessBar.set(!1);let n=10,t=setInterval(()=>{this.progress.set(Math.min(this.progress()+1,n)),this.updateProgress(this.progress()/n*100)},100);this.hideDropZone.set(!0),this.papa.parse(e,{encoding:"UTF-8",header:!0,skipEmptyLines:!0,complete:o=>{this.rejectIfTooManyEmptyRows(o.data,t)||(this.uploadFileService.setParsedFile(o),this.uploadFileService.setFile(e),this.clearProgress(t),this.setRemoveFileText(this.uploadedFile()))},worker:!1})}onDragOver(e){e.preventDefault(),e.stopPropagation(),this.isDragging.set(!0)}onDragLeave(e){e.preventDefault(),e.stopPropagation(),this.isDragging.set(!1)}uploadFile(e){if(e.preventDefault(),e.stopPropagation(),this.isDragging.set(!1),e.dataTransfer.files.length>1)return this.notificationService.error("We currently do not support uploading multiple files at the same time");let n=e.dataTransfer.files[0];if(!this.uploadFileService.isValidCsvFile(n))return this.uploadedFile.set(void 0),this.notificationService.error("We currently only support CSV files");if(this.exceedsSizeLimit(n))return;this.uploadedFile.set(n),this.hideProgessBar.set(!1);let t=10,o=setInterval(()=>{this.progress.set(Math.min(this.progress()+1,t)),this.updateProgress(this.progress()/t*100)},100);this.hideDropZone.set(!0),this.papa.parse(e.dataTransfer.files[0],{encoding:"UTF-8",header:!0,skipEmptyLines:!0,complete:d=>{this.rejectIfTooManyEmptyRows(d.data,o)||(this.uploadFileService.setParsedFile(d),this.uploadFileService.setFile(this.uploadedFile()),this.clearProgress(o),this.setRemoveFileText(this.uploadedFile()))},worker:!1})}clearProgress(e){setTimeout(()=>{clearInterval(e),this.progress()!=100&&this.updateProgress(100)},600)}updateProgress(e){this.uploadProgress.update(n=>n=e),this.progressText.set(e.toString()+"%"),e==100&&(this.onFileChanged.emit(),setTimeout(()=>{this.hideProgessBar.set(!0)},400))}setRemoveFileText(e){let n=e.size/1048576,t=yt.getDayFormatted(new Date),o=this.uploadFileService.getParsedFile();this.removeFileText.set(`(Uploaded ${t}, ${n.toFixed(2)}MB, Rows ${o.data.length})`)}removeFile(){this.uploadedFile.set(void 0),this.uploadProgress.update(e=>e=0),this.progress.update(e=>e=0),this.uploadFileService.removeFileAndParsedFile(),this.hideDropZone.set(!1),this.onFileChanged.emit()}exceedsSizeLimit(e){return this.uploadFileService.isFileTooLarge(e)?(this.notificationService.error(this.uploadFileService.fileTooLargeMessage(e)),!0):!1}rejectIfTooManyEmptyRows(e,n){let t=this.uploadFileService.countEmptyRows(e);return t<=this.uploadFileService.maxEmptyRows?!1:(clearInterval(n),this.notificationService.error(this.uploadFileService.tooManyEmptyRowsMessage(t)),this.uploadedFile.set(void 0),this.uploadProgress.set(0),this.progress.set(0),this.hideProgessBar.set(!0),this.hideDropZone.set(!1),this.uploadFileService.removeFileAndParsedFile(),!0)}static{this.\u0275fac=function(n){return new(n||i)(J(Ge),J(q),J(K))}}static{this.\u0275cmp=L({type:i,selectors:[["yon-drag-and-drop-file-upload"]],inputs:{maxWidth:"maxWidth",height:"height"},outputs:{onFileChanged:"onFileChanged"},decls:4,vars:3,consts:[[1,"drop-zone-and-progress"],[1,"drop-zone",3,"ngClass","ngStyle"],[1,"progress-and-file-container"],[1,"remove__file","flex","items-center"],[1,"drop-zone",3,"drop","dragover","dragleave","ngClass","ngStyle"],[1,"drop-zone__content"],["name","cloud_upload",3,"size","weight"],[1,"mt-1"],[1,"mb-1",3,"onFileSelected","importBrowseFiles"],[1,"mb-0"],[1,"flex","justify-space-between"],[1,"flex","items-center"],["name","description",1,"mr-3",3,"weight"],[1,"mb-0","progress-file-name"],["max","100",1,"progress-bar-styling",3,"value"],[1,"fw-500"],["type","mat-icon-button","color","#f44336",1,"ml-3","progress__delete-icon-position",3,"onClick","size","weight","buttonIcon"]],template:function(n,t){n&1&&(a(0,"div",0),y(1,Jn,12,10,"div",1),y(2,ei,9,4,"div",2),y(3,ti,6,5,"div",3),r()),n&2&&(l(),v(t.hideDropZone()?-1:1),l(),v(t.hideProgessBar()?-1:2),l(),v(t.hideProgessBar()&&t.hideDropZone()?3:-1))},dependencies:[me,ce,Se,We,Re,Qe,j],styles:[".color__yon-orange[_ngcontent-%COMP%]{color:var(--color-primary)}.drop-zone-and-progress[_ngcontent-%COMP%] .drop-zone[_ngcontent-%COMP%]{display:flex;align-items:center;border:1px dashed #424242}.drop-zone-and-progress[_ngcontent-%COMP%] .drop-zone[_ngcontent-%COMP%] .drop-zone__content[_ngcontent-%COMP%]{margin-left:50%;transform:translate(-50%);text-align:center}.drop-zone-and-progress[_ngcontent-%COMP%] .dragover[_ngcontent-%COMP%]{border:2px dotted #015ea5}.drop-zone-and-progress[_ngcontent-%COMP%] .errorDrag[_ngcontent-%COMP%]{border:2px dotted red}.drop-zone-and-progress[_ngcontent-%COMP%] .progress-and-file-container[_ngcontent-%COMP%]{width:500px}.drop-zone-and-progress[_ngcontent-%COMP%] .progress-and-file-container[_ngcontent-%COMP%] .progress-bar-styling[_ngcontent-%COMP%]{background-color:var(--color-secondary);width:-webkit-fill-available;height:12px;margin-left:40px}.drop-zone-and-progress[_ngcontent-%COMP%] .progress-and-file-container[_ngcontent-%COMP%] .progress-bar-styling[_ngcontent-%COMP%]::-webkit-progress-value{background-color:var(--color-secondary)}.drop-zone-and-progress[_ngcontent-%COMP%] .progress-and-file-container[_ngcontent-%COMP%] .progress-bar-styling[_ngcontent-%COMP%]::-moz-progress-bar{background-color:var(--color-secondary)}.drop-zone-and-progress[_ngcontent-%COMP%] .progress-and-file-container[_ngcontent-%COMP%] .progress-file-name[_ng
1content-%COMP%]{color:#015ea5}.drop-zone-and-progress[_ngcontent-%COMP%] .progress-and-file-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-weight:500}.drop-zone-and-progress[_ngcontent-%COMP%] .remove__file[_ngcontent-%COMP%] .progress__delete-icon-position[_ngcontent-%COMP%]{margin-bottom:5px}"],changeDetection:0})}}return i})();function ni(i,m){if(i&1&&s(0),i&2){let e=p().$implicit;b(" ",e," (Beta) ")}}function ii(i,m){if(i&1&&s(0),i&2){let e=p().$implicit;b(" ",e," ")}}function oi(i,m){if(i&1){let e=M();a(0,"button",19),C("click",function(){let t=h(e).$implicit,o=p(2);return o.selectedOption.set(t),f(o.onActionChange(t))}),y(1,ni,1,1)(2,ii,1,1),r()}if(i&2){let e=m.$implicit,n=p(2);U("data-settings__action-pill--on",n.selectedOption()===e),l(),v(e==="Change"?1:2)}}function ai(i,m){if(i&1&&(a(0,"div",6),Y(1,oi,3,3,"button",18,ee),r()),i&2){let e=p();l(),Z(e.selectedEntity().operations)}}function ri(i,m){i&1&&(a(0,"p",7),s(1,"Pick an entity to see actions."),r())}function li(i,m){if(i&1){let e=M();a(0,"yon-field",20),C("ngModelChange",function(t){h(e);let o=p();return f(o.selectedTemplate.set(t))})("onChange",function(t){h(e);let o=p();return f(o.setTemplate(t))}),r()}if(i&2){let e=p();_("data",e.filteredTemplateList())("valuePrimitive",!1)("ngModel",e.selectedTemplate())}}var Gt=(()=>{class i{constructor(){this.uiService=S(De),this.settingsDone=new E,this.getEntityDefinition=new E,this.getEntityAction=new E,this.entityChanged=new E,this.templateChanged=new E,this.fileChanged=new E,this.useTemplate=g(!1),this.templateFetched=g(!1),this.templateList=g([]),this.filteredTemplateList=g([]),this.selectedTemplate=g(void 0),this.applyingDataSettings=g(!1),this.selectedEntity=g(void 0),this.selectedOption=g(""),this.selectedFile=g(void 0),this.entityList=g([]),this.selectedEntityOperations=g([]),this.dateFormatOptions=Vt,this.decimalSeparatorOptions=Lt,this.dmToolService=S(I),this.uploadFileService=S(K),this.notificationService=S(q),this.permissionService=S(xt),this.featureFlagService=S(vt),this.canContinue=Q(()=>{if(this.useTemplate()){if(!this.selectedTemplate())return"Select a template to continue";if(!this.templateFetched())return"Applying template..."}return!this.selectedEntity()||!this.selectedOption()||!this.selectedFile()?"Select an entity, action and upload a file to continue":this.applyingDataSettings()?"Applying selected settings...":!1}),this.isEntitySelected=Q(()=>!this.selectedEntity())}ngOnInit(){this.dmToolService.getListOfEntityDefinitions().pipe(A(1)).subscribe(e=>{this.applyDataManagemnetPermissions(e),this.entityList.set(e)}),this.dmToolService.getMappingTemplates(!0).pipe(A(1)).subscribe(e=>{this.templateList.set(e.templates),this.filteredTemplateList.set(this.templateList())})}applyDataManagemnetPermissions(e){let n={Order:{Import:oe.DataManagementImportOrder,Edit:oe.DataManagementEditOrder},Product:{Import:oe.DataManagementImportProduct,Update:oe.DataManagementUpdateProduct,Upsert:oe.DataManagementUpsertProduct}};this.featureFlagService.getFeatureFlag("dmtChangeOrderEnabled")&&(n.Order.Change=oe.DataManagementChangeOrder),e.forEach(t=>{let o=n[t.entityName];o&&(t.operations=t.operations.filter(d=>{let c=o[d];return c?this.permissionService.hasPermission(c):!1}))})}setTemplate(e){if(e){if(!this.selectedEntity()){let n=this.entityList().find(t=>t.entityName.toLowerCase()===e?.entityType?.toLowerCase());n&&(this.selectedEntity.set(n),this.entityChanged.emit(n.entityName))}this.selectedOption()||(this.selectedOption.set(e.operationType),this.getEntityAction.emit(e.operationType)),this.refreshTemplateFilter(),this.dmToolService.setTemplate(e),this.dmToolService.getMappingTemplateDataFromBE(e.templateId).pipe(A(1)).subscribe(n=>{let t=n.template;this.dmToolService.setMappingTemplateData(t),this.dmToolService.setDataFormatConfig(At(t?.dataFormatConfig)),this.dmToolService.setTemplateName(n.templateName),this.templateFetched.set(!0)}),this.templateChanged.emit(e)}else this.dmToolService.setEmptyTemplate(),this.dmToolService.setDataFormatConfig(It()),this.templateFetched.set(!1),this.templateChanged.emit(void 0)}dataFormatConfig(){return this.dmToolService.getDataFormatConfig()}onDateFormatChange(e){this.dmToolService.setDataFormatConfig(k(R({},this.dataFormatConfig()),{dateFormat:e}))}onDecimalSeparatorChange(e){this.dmToolService.setDataFormatConfig(k(R({},this.dataFormatConfig()),{decimalSeparator:e}))}onEntitySelect(e){this.selectedEntity.set(e),this.entityChanged.emit(e?.entityName||"");let n=this.selectedOption(),t=!!e&&!!n&&(e.operations||[]).some(o=>String(o).toLowerCase()===n.toLowerCase());(!e||!t)&&(this.selectedOption.set(""),this.getEntityAction.emit("")),this.refreshTemplateFilter()}onFileChange(){let e=this.uploadFileService.getFile();this.selectedFile.set(e),this.fileChanged.emit(e)}onActionChange(e){this.selectedOption.set(e??""),this.refreshTemplateFilter(),this.getEntityAction.emit(e)}refreshTemplateFilter(){let e=this.selectedEntity()?.entityName?.toLowerCase(),n=this.selectedOption()?.toLowerCase(),t=this.templateList(
1).filter(o=>(!e||o?.entityType?.toLowerCase()===e)&&(!n||o?.operationType?.toLowerCase()===n));this.filteredTemplateList.set(t)}continueToDataMapping(){this.applyingDataSettings.set(!0);let e=this.selectedEntity().entityName,n=this.selectedOption();this.dmToolService.getEntityDefinitions(e,n).pipe(A(1)).subscribe({next:t=>{this.settingsDone.emit(!0),this.getEntityDefinition.emit(t),this.getEntityAction.emit(n),this.applyingDataSettings.set(!1)},error:t=>{this.applyingDataSettings.set(!1),this.notificationService.error("Not yet implemented")}})}toggleTemplate(e){if(this.useTemplate.set(e.checked),!e.checked){this.setTemplate(void 0);return}this.selectedTemplate()&&this.setTemplate(this.selectedTemplate())}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=L({type:i,selectors:[["yon-data-management-settings"]],outputs:{settingsDone:"settingsDone",getEntityDefinition:"getEntityDefinition",getEntityAction:"getEntityAction",entityChanged:"entityChanged",templateChanged:"templateChanged",fileChanged:"fileChanged"},decls:55,vars:16,consts:[["header","Settings",1,"import-data-settings"],[1,"flex","mt-1"],[1,"width-20"],[1,"step-headers"],[1,"settings__drop-down-containers"],["textField","entityName","valueField","entityName","type","select",1,"data-settings__drop-down",3,"ngModelChange","data","ngModel","tooltip","valuePrimitive"],[1,"data-settings__action-pills"],[1,"data-settings__action-hint"],[1,"data-settings__source-file-container","mt-2","width-100"],[3,"onFileChanged","maxWidth"],[1,"data__template-container","mt-2","mb-2"],[1,"data-template__checkbox",3,"change"],["textField","templateName","valueField","templateId","type","select",1,"data-settings__template-drop-down",3,"data","valuePrimitive","ngModel"],[1,"settings__drop-down-containers","data-settings__format-container"],["title","Date format","textField","displayValue","valueField","value","type","select",1,"data-settings__format-drop-down",3,"ngModelChange","data","ngModel","valuePrimitive"],["title","Decimal separator","textField","displayValue","valueField","value","type","select",1,"data-settings__format-drop-down",3,"ngModelChange","data","ngModel","valuePrimitive"],[1,"flex","mt-2","mb-2","justify-end","width-95"],["buttonIcon","keyboard_double_arrow_right","buttonIconPosition","after",1,"data-settings__next-button","mt-2",3,"onClick","disabled"],["type","button",1,"data-settings__action-pill",3,"data-settings__action-pill--on"],["type","button",1,"data-settings__action-pill",3,"click"],["textField","templateName","valueField","templateId","type","select",1,"data-settings__template-drop-down",3,"ngModelChange","onChange","data","valuePrimitive","ngModel"]],template:function(n,t){n&1&&(a(0,"yon-card",0)(1,"div",1)(2,"div",2)(3,"h4",3),s(4,"Entity"),r(),a(5,"p"),s(6,"Select data object for import/export operation"),r()(),a(7,"div",4)(8,"yon-field",5),C("ngModelChange",function(d){return t.onEntitySelect(d)}),r()()(),T(9,"mat-divider"),a(10,"div",1)(11,"div",2)(12,"h4",3),s(13,"Action"),r(),a(14,"p"),s(15,"Select action to perform"),r()(),a(16,"div",4),y(17,ai,3,0,"div",6)(18,ri,2,0,"p",7),r()(),T(19,"mat-divider"),a(20,"div",1)(21,"div",2)(22,"h4",3),s(23,"Add source file"),r(),a(24,"p"),s(25,"Upload file containing data for import"),r()(),a(26,"div",8)(27,"yon-drag-and-drop-file-upload",9),C("onFileChanged",function(){return t.onFileChange()}),r()()(),T(28,"mat-divider"),a(29,"div",1)(30,"div",2)(31,"h4",3),s(32,"Data mapping template"),r(),a(33,"p"),s(34,"Use template to re-use previous data mapping"),T(35,"br"),s(36," Template contains Entity, Action, Format settings and Data mapping "),r()(),a(37,"div",10)(38,"mat-checkbox",11),C("change",function(d){return t.toggleTemplate(d)}),s(39," Use template "),r(),y(40,li,1,3,"yon-field",12),r()(),T(41,"mat-divider"),a(42,"div",1)(43,"div",2)(44,"h4",3),s(45,"Format settings"),r(),a(46,"p"),s(47,"Set the date format and decimal separator used in the source file"),r()(),a(48,"div",13)(49,"yon-field",14),C("ngModelChange",function(d){return t.onDateFormatChange(d)}),r(),a(50,"yon-field",15),C("ngModelChange",function(d){return t.onDecimalSeparatorChange(d)}),r()()(),T(51,"mat-divider"),a(52,"div",16)(53,"yon-button",17),C("onClick",function(){return t.continueToDataMapping()}),s(54," NEXT "),r()()()),n&2&&(l(8),_("data",t.entityList())("ngModel",t.selectedEntity())("tooltip","Required field")("valuePrimitive",!1),l(9),v(t.selectedEntity()?17:18),l(9),U("width-60",t.uiService.getUiVersion()=="v3"),l(),_("maxWidth",800),l(13),v(t.useTemplate()?40:-1),l(9),_("data",t.dateFormatOptions)("ngModel",t.dataFormatConfig().dateFormat)("valuePrimitive",!0),l(),_("data",t.decimalSeparatorOptions)("ngModel",t.dataFormatConfig().decimalSeparator)("valuePrimitive",!0),l(3),_("disabled",t.canContinue()))},dependencies:[te,_e,ue,ye,Ce,Qt,j,ne,fe,Oe,Ee,Fe],styles:[".color__yon-orange[_ngcontent-%COMP%]{color:var(--color-primary)}.import-data-settings[_ngcontent-%COMP%] .card__header{font-size:24x;font-weight:400}.import-data-settings[_ngcontent-%COMP%] .card-block{padding-bottom:20px}.import-data-settings[_ngcontent-%COMP%] .step-headers[_ngcontent-%COMP%]{font-size:20px;font-weight:400}.data-settings__action-pills[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px}.data-settings__action-pill[_ngcontent-%COMP%]{font:inherit;padding:6px 16px;line-height:24px;border-radius:16px;border:1px solid var(--color-grey-border, #d6d6d6);background:var(--layout-bg-color-card);color:var(--color-mono-contrast-high);
1cursor:pointer;transition:background-color .15s ease}.data-settings__action-pill[_ngcontent-%COMP%]:hover{background:var(--color-bg-details-box)}.data-settings__action-pill--on[_ngcontent-%COMP%]{border:2px solid var(--color-primary);padding:5px 15px}.data-settings__action-hint[_ngcontent-%COMP%]{margin:0;color:var(--color-mono-contrast-low);font-style:italic}.settings__drop-down-containers[_ngcontent-%COMP%]{display:flex;align-items:center;width:50%;margin-left:10%}.settings__drop-down-containers[_ngcontent-%COMP%] .data-settings__drop-down[_ngcontent-%COMP%]{display:block;width:300px}.data-settings__source-file-container[_ngcontent-%COMP%]{margin-left:10%;margin-bottom:12px;max-width:800px}.data-settings__format-container[_ngcontent-%COMP%]{width:auto;gap:24px}.data-settings__format-container[_ngcontent-%COMP%] .data-settings__format-drop-down[_ngcontent-%COMP%]{display:block;flex:none;width:300px}.data-settings__format-container[_ngcontent-%COMP%] .data-settings__format-drop-down[_ngcontent-%COMP%] .field-title{font-weight:400}.data-settings__next-button[_ngcontent-%COMP%] .mdc-button__label{padding:4px 8px}.data-settings__next-button[_ngcontent-%COMP%] .mat-mdc-raised-button:not([disabled]):not(.mat-primary):not(.mat-accent) .material-symbols-sharp{color:var(--color-mono-contrast-medium)}.data__template-container[_ngcontent-%COMP%]{display:flex;align-items:center;gap:24px;margin-left:10%}.data__template-container[_ngcontent-%COMP%] .data-template__checkbox[_ngcontent-%COMP%]{flex:none;width:300px}.data__template-container[_ngcontent-%COMP%] .data-template__checkbox[_ngcontent-%COMP%] .mdc-checkbox{margin-left:-11px}.data__template-container[_ngcontent-%COMP%] .data-settings__template-drop-down[_ngcontent-%COMP%]{display:block;flex:none;width:300px}.data__template-container[_ngcontent-%COMP%] .data-settings__template-drop-down[_ngcontent-%COMP%] .wide__drop-down{margin-left:0;margin-top:0}.data__template-container[_ngcontent-%COMP%] .mat-mdc-checkbox[_ngcontent-%COMP%] .mdc-label{font-size:16px}.data__template-container[_ngcontent-%COMP%] .data-template__checkbox .mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate):not([data-indeterminate=true])~.mdc-checkbox__background{border-color:var(--color-mono-contrast-medium)}.data__template-container[_ngcontent-%COMP%] .data-template__checkbox .mdc-checkbox__native-control:enabled:checked~.mdc-checkbox__background, .data__template-container[_ngcontent-%COMP%] .data-template__checkbox .mdc-checkbox__native-control:enabled:indeterminate~.mdc-checkbox__background{border-color:var(--color-mono-contrast-medium)}"],changeDetection:0})}}return i})();var si=["logComponent"],di=["logComponentEleRef"],pi=["mappingComponent"],ci=["topEleRef"],mi=["processingDialog"],gi=()=>({compact:!0}),_i=()=>({compact:!1});function ui(i,m){if(i&1){let e=M();a(0,"yon-button",22),C("onClick",function(){h(e),p();let t=B(51);return f(t.show())}),s(1,"Show process"),r()}}function hi(i,m){if(i&1){let e=M();a(0,"yon-button",22),C("onClick",function(){h(e);let t=p();return f(t.onStartNewOperation())}),s(1),r()}if(i&2){let e=p();l(),b(" START A NEW ",e.selectedAction().toUpperCase()," ")}}function fi(i,m){if(i&1){let e=M();a(0,"yon-button",22),C("onClick",function(){h(e),p();let t=B(32);return f(t==null||t.entityTableMapping==null?null:t.entityTableMapping.validateAndCreateLog())}),s(1," Validate "),r()}}function Ci(i,m){if(i&1){let e=M();a(0,"section",24)(1,"div",26)(2,"div",27)(3,"span",28),s(4),a(5,"span",29),s(6,"\u2192"),r(),s(7),H(8,"titlecase"),r(),a(9,"span",30),s(10,"\xB7"),r(),a(11,"span",31),s(12),r(),a(13,"span",30),s(14,"\xB7"),r(),a(15,"span",32),s(16),H(17,"number"),r()(),a(18,"div",33)(19,"span",34),T(20,"span",35),s(21),r(),y(22,fi,2,0,"yon-button"),a(23,"yon-button",36),C("onClick",function(){h(e);let t=p(2);return f(t.scrollToLogComponent())}),a(24,"div",37)(25,"p",38),s(26,"LOG"),r(),a(27,"p",39),s(28),r()()(),a(29,"yon-button",40),C("onClick",function(){h(e);let t=p(2);return f(t.goToPreview())}),s(30," CONTINUE TO PREVIEW "),r()()(),a(31,"yon-data-management-mapping",41,5),C("showLog",function(){h(e);let t=p(2);return f(t.triggerLogTableRefresh())})("onScrollToLog",function(){h(e);let t=p(2);return f(t.scrollToLogComponent())})("operationDisable",function(t){h(e);let o=p(2);return f(o.checkOperationDisable.set(t))}),r(),a(33,"div",42)(34,"div",43),s(35),r(),a(36,"yon-button",40),C("onClick",function(){h(e);let t=p(2);return f(t.goToPreview())}),s(37," CONTINUE TO PREVIEW "),r()()()}if(i&2){let e,n,t=B(32),o=p(2);_("hidden",o.showPreview()||o.viewingDefine()||o.onlyShowProcess()||o.isOperationFinished()),l(4),b(" ",o.selectedEntityName()," "),l(3),b(" ",W(8,19,o.selectedAction())," "),l(4),_("matTooltip",((e=o.selectedFile())==null?null:e.name)||""),l(),b(" ",((n=o.selectedFile())==null?null:n.name)||"\u2014"," "),l(4),b("",W(17,21,o.sourceRowCount())," rows"),l(3),U("dmt-pill--ok",!o.checkOperationDisable())("dmt-pill--warn",!!o.checkOperationDisable()),l(2),b(" ",o.checkOperationDisable()||"Ready to run"," "),l(),v(!(t==null||t.entityTableMapping==null)&&t.entityTableMapping.isBigFile()?22:-1),l(),_("ngClass",o.logHasErrors()?"log-has-errors":""),l(5),w(o.logButtonText()),l(),_("disabled",o.checkOperationDisable()),l(2),_("entityDefinition",o.entityDefinition())("selectedAction",o.selectedAction()),l(4),b(" ",o.checkOperationDisable()||"Mapping looks good. Continue to preview before running."," "),l(),_("disabled",o.checkOperationDisable())}}function yi(i,m){if(i&1&&(a(0,"div",60)(1,"div",62),s(2),H(3,"number"),r(),a(4,"div",63),s(5),r()()),i&2){let e=m.$implicit;l(2),w(W(3,2,e.count)),l(3),w(e.entityName)}}function vi(i,m){if(i&1&&(a(0,"div",45)(1,"div",58),s(2,"Estimated impact"),r(),a(3,"div",59),Y(4,yi,6,4,"div",60,lt),r(),a(6,"div",61),s(7," Counts are based on unique values in the mapped group key columns of the source file. Final numbers may differ slightly after server-side validation. "),r()()),i&2){let e=p(3);l(4),Z(e.entityImpact())}}function xi(i,m){if(i&1&&(a(0,"div",53),T(1,"yon-icon",64),a(2,"div"),s(3),H(4,"number"),r()()),i&2){let e,n=p(3);l(),_("size",18),l(2),st(" Running this ",(e=n.selectedAction())==null?null:e.toLowerCase()," will create or modify ",W(4,4,n.sourceRowCount())," ",n.selectedEntityName()," record(s) in Younium. The operation cannot be undone automatically \u2014 review carefully. ")}}function Mi(i,m){if(i&1){let e=M();a(0,"yon-card",25)(1,"p",44),s(2),a(3,"strong"),s(4),H(5,"number"),r(),s(6," row(s) of "),a(7,"strong"),s(8),r(),s(9," data from "),a(10,"strong"),s(11),r(),s(12,". "),r(),y(13,vi,8,0,"div",45),a(14,"div",46)(15,"div",47)(16,"div",48),s(17,"Operation"),r(),a(18,"div",49)(19,"span"),s(20,"Entity"),r(),a(21,"strong"),s(22),r()(),a(23,"div",49)(24,"span"),s(25,"Action"),r(),a(26,"strong"),s(27),H(28,"titlecase"),r()(),a(29,"div",49)(30,"span"),s(31,"Template"),r(),a(32,"strong"),s(33),r()()(),a(34,"div",47)(35,"div",48),s(36,"
1Source"),r(),a(37,"div",49)(38,"span"),s(39,"File"),r(),a(40,"strong",50),s(41),r()(),a(42,"div",49)(43,"span"),s(44,"Size"),r(),a(45,"strong"),s(46),r()(),a(47,"div",49)(48,"span"),s(49,"Rows"),r(),a(50,"strong"),s(51),H(52,"number"),r()(),a(53,"div",49)(54,"span"),s(55,"Columns"),r(),a(56,"strong"),s(57),r()()(),a(58,"div",47)(59,"div",48),s(60,"Validation"),r(),a(61,"span",51),T(62,"span",35),s(63),r(),a(64,"p",52),s(65),r()()(),y(66,xi,5,6,"div",53),a(67,"div",54)(68,"yon-button",22),C("onClick",function(){h(e);let t=p(2);return f(t.backToMapping())}),s(69,"BACK TO MAPPING"),r(),a(70,"div",55)(71,"div",56),s(72),r(),a(73,"yon-button",57),C("onClick",function(){h(e);let t=p(2);return f(t.runOperation())}),s(74),r()()()()}if(i&2){let e,n,t,o,d,c,u=p(2);_("dividerLineBelowHeader",!0),l(2),b(" About to ",(e=u.selectedAction())==null?null:e.toLowerCase()," "),l(2),w(W(5,24,u.sourceRowCount())),l(4),w(u.selectedEntityName()),l(3),w((n=u.selectedFile())==null?null:n.name),l(2),v(u.entityImpact().length?13:-1),l(9),w(u.selectedEntityName()),l(5),w(W(28,26,u.selectedAction())),l(6),w(((t=u.selectedTemplate())==null?null:t.templateName)||"None"),l(7),_("matTooltip",((o=u.selectedFile())==null?null:o.name)||""),l(),b(" ",(d=u.selectedFile())==null?null:d.name," "),l(5),w(u.formatBytes(u.sourceFileSize())),l(5),w(W(52,28,u.sourceRowCount())),l(6),w(u.sourceColumnCount()),l(4),U("dmt-pill--ok",!u.checkOperationDisable())("dmt-pill--warn",!!u.checkOperationDisable()),l(2),b(" ",u.checkOperationDisable()||"Mapping validated"," "),l(2),b(" ",u.checkOperationDisable()?"Resolve issues in the mapping step before running.":"All mandatory fields are mapped and rows passed validation."," "),l(),v(((c=u.selectedAction())==null?null:c.toLowerCase())==="import"?66:-1),l(6),w(u.checkOperationDisable()||"Ready to run."),l(),_("disabled",u.checkOperationDisable()),l(),b(" RUN ",u.selectedAction().toUpperCase()," ")}}function bi(i,m){if(i&1){let e=M();a(0,"yon-data-management-settings",23),C("settingsDone",function(t){h(e);let o=p();return f(o.onSettingsDone(t))})("getEntityDefinition",function(t){h(e);let o=p();return f(o.onEntityDefinitionFetched(t))})("getEntityAction",function(t){h(e);let o=p();return f(o.onActionFetched(t))})("entityChanged",function(t){h(e);let o=p();return f(o.onEntityChanged(t))})("templateChanged",function(t){h(e);let o=p();return f(o.onTemplateChanged(t))})("fileChanged",function(t){h(e);let o=p();return f(o.onFileChanged(t))}),r(),y(1,Ci,38,23,"section",24),y(2,Mi,75,30,"yon-card",25)}if(i&2){let e=p();_("hidden",e.settingsDone()&&!e.viewingDefine()),l(),v(e.settingsDone()?1:-1),l(),v(e.showPreview()&&!e.isOperationFinished()?2:-1)}}function wi(i,m){if(i&1){let e=M();a(0,"div",67)(1,"p",68),s(2),r(),a(3,"p"),s(4,"Click the RESOLVE ERRORS button to return to data mapping to fix the error(s)."),r(),a(5,"yon-button",69),C("onClick",function(){h(e);let t=p(2);return f(t.onResolveErrorClick())}),s(6,"RESOLVE ERRORS"),r()()}if(i&2){let e=p(2);l(2),b(" ",e.totalErrors()," error(s) found when running the import. You can review the error(s) in the log below. ")}}function Ti(i,m){if(i&1&&(a(0,"div")(1,"yon-card",65)(2,"div")(3,"p",66),s(4),r(),a(5,"p",66),s(6),r(),a(7,"p",66),s(8),r()(),y(9,wi,7,1,"div",67),r()()),i&2){let e=p();l(),_("header",e.operationResultHeader())("headerIcon",e.operationResultIcon())("headerIconColor",e.operationResultColor()),l(3),b("Total number of objects to process: ",e.totalEntityAmount()),l(2),b("Successfully processed: ",e.totalProcessed()),l(2),b("Errors: ",e.totalErrors()),l(),v(e.logHasErrors()?9:-1)}}function Si(i,m){if(i&1){let e=M();a(0,"yon-data-management-log",70,6),C("errorLogCreated",function(){h(e);let t=p();return f(t.checkErrorLog())})("onScrollToMapping",function(){h(e);let t=p();return f(t.scrollToTheTop())}),r()}if(i&2){let e=p();_("operationFinished",e.isOperationFinished())("hideTopButton",e.onlyShowProcess())}}function Di(i,m){i&1&&Ze(0)}function Fi(i,m){i&1&&Ze(0)}function Ei(i,m){if(i&1&&(a(0,"div",78),O(1,Fi,1,0,"ng-container",77),r()),i&2){p(3);let e=B(49);l(),_("ngTemplateOutlet",e)("ngTemplateOutletContext",tt(2,_i))}}function Pi(i,m){if(i&1){let e=M();a(0,"div",72)(1,"yon-card",75)(2,"yon-card-header-right")(3,"yon-button",76),C("onClick",function(){h(e);let t=p(2);return f(t.summaryCollapsed.set(!0))}),r()(),O(4,Di,1,0,"ng-container",77)(5,Ei,2,3,"ng-template",null,7,pe),r()()}if(i&2){p(2);let e=B(49);l(3),_("size",20),l(),_("ngTemplateOutlet",e)("ngTemplateOutletContext",tt(3,gi))}}function Oi(i,m){if(i&1){let e=M();a(0,"div",73)(1,"yon-button",79),C("onClick",function(){h(e);let t=p(2);return f(t.summaryCollapsed.set(!1))}),r(),a(2,"span",80),s(3,"Summary"),r()()}i&2&&(l(),_("size",20))}function Ri(i,m){i&1&&(a(0,"p",81),s(1," Use "),a(2,"code"),s(3,"NULL"),r(),s(4,", "),a(5,"code"),s(6,"[EMPTY]"),r(),s(7," or "),a(8,"code"),s(9,"CLEAR"),r(),s(10," in a source cell to empty out the corresponding value on the existing record. "),r())}function ki(i,m){if(i&1&&(a(0,"div",74),T(1,"yon-icon",64),a(2,"div")(3,"p",81),s(4,"Required fields are marked in mapping. Templates carry both entity and action."),r(),y(5,Ri,11,0,"p",81),r()()),i&2){let e,n=p(2);l(),_("size",18),l(4),v(n.selectedAction()&&((e=n.selectedAction())==null?null:e.toLowerCase())!=="import"?5:-1)}}function Ni(i,m){if(i&1&&(a(0,"aside",71),y(1,Pi,7,4,"div",72)(2,Oi,4,1,"div",73),y(3,ki,6,2,"div",74),r()),i&2){let e=p();U("dmt-rail--collapsed",e.summaryCollapsed())("dmt-rail--map",e.currentStage()==="map"),l(),v(e.summaryCollapsed()?2:1),l(2),v(!e.summaryCollapsed()&&(e.currentStage()==="define"||e.currentStage()==="map")?3:-1)}}function Vi(i,m){i&1&&(a(0,"div",83),s(1,"Operation"),r())}
1function Li(i,m){if(i&1&&(a(0,"span",89),s(1),r()),i&2){let e=m.$implicit;l(),w(e)}}function Ii(i,m){if(i&1&&(a(0,"div",86)(1,"div",87),s(2,"Detected columns"),r(),a(3,"div",88),Y(4,Li,2,1,"span",89,ee),r()()),i&2){let e=p(3);l(4),Z(e.sourceColumns())}}function Ai(i,m){if(i&1&&(a(0,"div",82)(1,"div",83),s(2,"Source file"),r(),a(3,"div",49)(4,"span"),s(5,"File"),r(),a(6,"strong",50),s(7),r()(),a(8,"div",49)(9,"span"),s(10,"Size"),r(),a(11,"strong"),s(12),r()(),a(13,"div",49)(14,"span"),s(15,"Rows"),r(),a(16,"strong"),s(17),H(18,"number"),r()(),a(19,"div",49)(20,"span"),s(21,"Source columns"),r(),a(22,"strong"),s(23),r()(),y(24,Ii,6,0,"div",86),r()),i&2){let e,n,t=p(2);l(6),_("matTooltip",((e=t.selectedFile())==null?null:e.name)||""),l(),b(" ",((n=t.selectedFile())==null?null:n.name)||"\u2014"," "),l(5),w(t.sourceFileSize()?t.formatBytes(t.sourceFileSize()):"\u2014"),l(5),w(t.sourceRowCount()?W(18,6,t.sourceRowCount()):"\u2014"),l(6),w(t.sourceColumnCount()||"\u2014"),l(),v(t.sourceColumns().length?24:-1)}}function Bi(i,m){i&1&&(a(0,"div",83),s(1,"Result"),r())}function Hi(i,m){if(i&1&&(a(0,"div",82),y(1,Vi,2,0,"div",83),a(2,"div",49)(3,"span"),s(4,"Stage"),r(),a(5,"strong"),s(6),H(7,"titlecase"),r()(),a(8,"div",49)(9,"span"),s(10,"Entity"),r(),a(11,"strong"),s(12),r()(),a(13,"div",49)(14,"span"),s(15,"Action"),r(),a(16,"strong"),s(17),r()(),a(18,"div",49)(19,"span"),s(20,"Template"),r(),a(21,"strong",84),s(22),r()()(),y(23,Ai,25,8,"div",82),a(24,"div",82),y(25,Bi,2,0,"div",83),a(26,"div",49)(27,"span"),s(28,"Processed"),r(),a(29,"strong",85),s(30),r()(),a(31,"div",49)(32,"span"),s(33,"Errors"),r(),a(34,"strong"),s(35),r()()()),i&2){let e,n=m.compact,t=p();l(),v(n?-1:1),l(5),w(W(7,11,t.currentStage())),l(6),w(t.selectedEntityName()||"\u2014"),l(5),w(t.selectedAction()||"\u2014"),l(5),w(((e=t.selectedTemplate())==null?null:e.templateName)||"\u2014"),l(),v(n?-1:23),l(2),v(n?-1:25),l(5),w(t.totalProcessed()??"\u2014"),l(4),U("dmt-kv__err",t.totalErrors()>0),l(),w(t.totalErrors()??"\u2014")}}function zi(i,m){if(i&1){let e=M();a(0,"div",90)(1,"div",91)(2,"yon-signal-r-progress",92),H(3,"async"),C("totalAmount",function(t){h(e);let o=p();return f(o.saveTotalAmount(t))}),r()(),a(4,"div",93)(5,"yon-button",94),C("onClick",function(){h(e);let t=p();return f(t.onCancelOperation())}),s(6," CANCEL OPERATION "),r(),a(7,"yon-button",95),C("onClick",function(){h(e);let t=p();return f(t.onProgressCompleted(!0))}),s(8," OK "),r()()()}if(i&2){let e=p();l(2),_("useDialogProgress",!0)("progressResponse",W(3,5,e.notificationHubService.subject(e.ProgressType.DataManagementTool)))("processingMessage","Total number of objects to process"),l(3),_("disabled",e.isOperationFinished()),l(2),_("disabled",!e.canContinueToLog())}}var Mr=(()=>{class i{constructor(){this.settingsDone=g(!1),this.entityDefinition=g(void 0),this.selectedAction=g(""),this.showLog=g(!1),this.hideMapping=g(!1),this.isOperationFinished=g(!1),this.checkOperationDisable=g(!1),this.canContinueToLog=g(!1),this.totalProcessed=g(void 0),this.totalErrors=g(void 0),this.logHasErrors=Q(()=>(this.totalErrors()??0)>0),this.logButtonText=Q(()=>` (${this.totalErrors()??0} errors)`),this.totalEntityAmount=g(void 0),this.headerText=g("Processed"),this.onlyShowProcess=g(!1),this.hasBeenCancelled=g(!1),this.showPreview=g(!1),this.viewingDefine=g(!1),this.summaryCollapsed=g(!1),this.selectedTemplate=g(void 0),this.selectedFile=g(void 0),this.sourceRowCount=g(0),this.sourceColumnCount=g(0),this.sourceColumns=g([]),this.sourceFileSize=g(0),this.entityImpact=g([]),this.selectedEntityName=g(""),this.currentStage=Q(()=>this.isOperationFinished()||this.onlyShowProcess()||this.showPreview()?"execute":this.viewingDefine()?"define":this.settingsDone()?"map":"define"),this.ProgressType=Mt,this.dmToolService=S(I),this.uploadFileService=S(K),this.notificationService=S(q),this.dialogService=S(bt),this.notificationHubService=S(Pe),this.uiService=S(De),this.isV3=Q(()=>this.uiService.getUiVersion()==="v3"),this.operationResultHeader=Q(()=>this.hasBeenCancelled()?this.selectedAction()+" was cancelled!":this.logHasErrors()?this.selectedAction()+" failed due to error(s)!":this.selectedAction()+" completed!"),this.operationResultIcon=Q(()=>this.hasBeenCancelled()?"warning":this.logHasErrors()?"error":"done"),this.operationResultColor=Q(()=>this.hasBeenCancelled()?"var(--color-yellow-warning)":this.logHasErrors()?"var(--color-red-error)":"var(--color-green-success)"),se(()=>{this.uploadFileService.parsedFile$()?.data&&this.captureSourceMetrics()})}ngOnInit(){let e=this.dmToolService.getOperationStatus();this.canContinueToLog.set(this.dmToolService.getCloseProcessing()),this.onlyShowProcess.set(e),e?this.startProgressSubscription():(this.dmToolService.resetVariables(),this.dmToolService.setEmptyTemplate(),this.uploadFileService.removeFileAndParsedFile())}ngAfterViewInit(){if(this.onlyShowProcess()){let e=this.dmToolService.getProcessingRequest();this.entityDefinition.set(e.entityDefinition),this.selectedAction.set(e.selectedAction),this.processingDialog.show()}}onSettingsDone(e){this.settingsDone.set(e),e&&(this.viewingDefine.set(!1),this.captureSourceMetrics(),this.selectedTemplate.set(this.dmToolService.getTemplate()),this.selectedFile.set(this.uploadFileService.getFile()))}triggerLogTableRefresh(e=!1){this.showLog.set(!0),this.logComponent?.fetchAndCreateLogs(e)}checkErrorLog(){this.mappingComponent?.checkErrorLog();let e=this.dmToolService.getLogData()?.log;this.totalErrors.set(e?.errors?.length)}setAmountsFromLogResults(e){this.totalProcessed.set(e?.operationResults?.length),this.totalErrors.set(e?.errors?.length);let n=this.dmToolService.getTotalEntityAmount();this.totalEntityAmount.set(n)}onEntityDefinitionFetched(e){this.entityDefinition.set(e),e?.entityName&&this.selectedEntityName.set(e.entityName)}onEntityChanged(e){this.selectedEntityName.set(e||"")}onTemplateChanged(e){this.selectedTemplate.set(e)}onFileChanged(e){this.selectedFile.set(e),this.captureSourceMetrics()}onActionFetched(e){this.selectedAction.set(e)}scrollToLogComponent(){this.logComponentEleRef&&this.logComponentEleRef.nativeElement&&this.logComponentEleRef.nativeElement.scrollIntoView({behavior:"smooth",block:"nearest"})}scrollToTheTop(){this.topEleRef&&this.topEleRef.nativeElement&&this.topEleRef.nativeElement.scrollIntoView({behavior:"smooth",block:"center"})}onStartNewOperation(){this.isOperationFinished.set(!1),this.resetOperationState(),this.dmToolService.setOperationStatusToFinished(),this.dmToolService.setCloseProcessing(!1),this.dmToolService.resetVariables(),this.uploadFileService.removeFileAndParsedFile()}resetOperationState(){this.hasBeenCancelled.set(!1),this.onlyShowProcess.set(!1),this.settingsDone.set(!1),this.showPreview.set(!1),this.viewingDefine.set(!1),this.canContinueToLog.set(!1),this.showLog.set(!1),this.selectedTemplate.set(void 0),this.selectedFile.set(void 0),this.selectedAction.set(""),this.entityDefinition.set(void 0),this.selectedEntityName.set(""),this.totalProcessed.set(void 0),this.totalErrors.set(void 0),this.totalEntityAmount.set(void 0),this.entity
1Impact.set([]),this.sourceFileSize.set(0),this.sourceRowCount.set(0),this.sourceColumnCount.set(0),this.sourceColumns.set([]),this.checkOperationDisable.set(!1)}onCancelOperation(){this.hasBeenCancelled.set(!1),this.headerText.set("Cancelling..."),this.dmToolService.cancelOperation().subscribe({next:e=>{e.cancelled&&this.hasBeenCancelled.set(!0)},error:e=>{this.notificationService.error(e.message),this.hasBeenCancelled.set(!1),this.headerText.set("Processing")}})}runOperation(){return it(this,null,function*(){if(!(yield this.dialogService.confirmRunOperation(`Do you want to run the ${this.selectedAction()}?`,this.selectedAction())))return;this.isOperationFinished.set(!1),this.dmToolService.setOperationStatusToOnGoing(),this.onlyShowProcess.set(!0),this.canContinueToLog.set(!1),this.headerText.set("Processing"),this.processingDialog.show(),this.startProgressSubscription();let n=this.dmToolService.getProcessingRequest().operationRequest;this.setTempTemplate(n),this.dmToolService.useTool(n).pipe(A(1)).subscribe({next:t=>{this.dmToolService.setLogData(t)},error:t=>this.notificationService.error(t)})})}setTempTemplate(e){let n={mappingConfig:e.mappingConfig,entityType:e.entityType,operationType:e.operationType};this.dmToolService.setMappingTemplateData(n)}startProgressSubscription(){this.progressFinishedSubscription=this.notificationHubService.progressFinished$.pipe(A(1)).subscribe(e=>{this.onProgressCompleted(),this.canContinueToLog.set(!0)})}onResolveErrorClick(){this.onlyShowProcess.set(!1),this.dmToolService.setOperationStatusToFinished(),this.settingsDone.set(!0),this.showPreview.set(!1),this.viewingDefine.set(!1),this.isOperationFinished.set(!1),this.hasBeenCancelled.set(!1),this.canContinueToLog.set(!1)}goToPreview(){this.computeEntityImpact(),this.showPreview.set(!0),setTimeout(()=>this.scrollToTheTop())}backToMapping(){this.showPreview.set(!1)}goToStage(e){if(!(this.isOperationFinished()||this.onlyShowProcess())&&this.isStageReachable(e)){if(e==="define"){this.showPreview.set(!1),this.viewingDefine.set(!0),this.settingsDone.set(!1),this.scrollToTheTop();return}if(e==="map"){this.viewingDefine.set(!1),this.showPreview()&&this.showPreview.set(!1);return}e==="execute"&&this.settingsDone()&&!this.viewingDefine()&&!this.showPreview()&&!this.checkOperationDisable()&&this.goToPreview()}}isStageReachable(e){return this.isOperationFinished()||this.onlyShowProcess()?!1:e==="define"?!0:e==="map"?this.showPreview()||this.settingsDone():e==="execute"?this.settingsDone()&&!this.checkOperationDisable():!1}captureSourceMetrics(){let e=this.uploadFileService.getFile(),t=this.uploadFileService.getParsedFile()?.data||[],o=t.length?Object.keys(t[0]):[];this.sourceFileSize.set(e?.size||0),this.sourceRowCount.set(t.length),this.sourceColumns.set(o),this.sourceColumnCount.set(o.length)}computeEntityImpact(){let n=this.dmToolService.getProcessingRequest()?.operationRequest?.mappingConfig?.groupFields||[],t=this.uploadFileService.getParsedFile()?.data||[],o=this.entityDefinition(),d=n.filter(c=>c?.isMapped&&c?.dataFieldKey).map(c=>{let u=new Set;for(let x of t){let P=x?.[c.dataFieldKey];P!=null&&P!==""&&u.add(String(P))}return{entityName:o?.groupFields?.find(x=>x.entityName===c.entityName)?.entityDisplayName||c.entityName,count:u.size}});this.entityImpact.set(d)}formatBytes(e){if(!e)return"0 B";let n=["B","KB","MB","GB"],t=0,o=e;for(;o>=1024&&t<n.length-1;)o/=1024,t++;return`${o.toFixed(o>=10||t===0?0:1)} ${n[t]}`}onProgressCompleted(e=!1){e&&this.processingDialog?.close(),this.headerText.set("Processed"),this.isOperationFinished.set(!0),this.dmToolService.setCloseProcessing(!0),this.progressFinishedSubscription&&this.progressFinishedSubscription.unsubscribe();let n=this.dmToolService.getLogData()?.log;this.setAmountsFromLogResults(n),this.triggerLogTableRefresh(!0)}saveTotalAmount(e){this.dmToolService.setTotalEntityAmount(e)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=L({type:i,selectors:[["yon-data-management-tool"]],viewQuery:function(n,t){if(n&1&&X(si,5)(di,5)(pi,5)(ci,5)(mi,5),n&2){let o;N(o=V())&&(t.logComponent=o.first),N(o=V())&&(t.logComponentEleRef=o.first),N(o=V())&&(t.mappingComponent=o.first),N(o=V())&&(t.topEleRef=o.first),N(o=V())&&(t.processingDialog=o.first)}},decls:54,vars:43,consts:[["topEleRef",""],["logComponentEleRef",""],["railSummaryTpl",""],["processingDialog",""],["processingDialogTemplate",""],["mappingComponent",""],["logComponent",""],["y
1onCardPopout",""],["header","Data management",1,"data-management-card",3,"dividerLineBelowHeader"],["aria-label","Wizard stages",1,"dmt-stages"],["type","button",1,"dmt-stage",3,"click","disabled"],[1,"dmt-stage__num"],["name","done",1,"dmt-stage__check",3,"size"],[1,"dmt-stage__label"],[1,"dmt-stage__title"],[1,"dmt-stage__desc"],[1,"dmt-grid"],[1,"dmt-main"],[3,"hidden"],[3,"operationFinished","hideTopButton"],[1,"dmt-rail",3,"dmt-rail--collapsed","dmt-rail--map"],["dialogSize","lg",3,"onClose","customClass","height","header","containerTemplate"],[3,"onClick"],[3,"settingsDone","getEntityDefinition","getEntityAction","entityChanged","templateChanged","fileChanged","hidden"],[1,"dmt-map",3,"hidden"],["header","Preview & run",1,"dmt-preview",3,"dividerLineBelowHeader"],[1,"dmt-sticky"],[1,"dmt-sticky__left"],[1,"dmt-sticky__entity"],[1,"dmt-arrow"],[1,"dmt-sticky__sep"],[1,"dmt-sticky__meta",3,"matTooltip"],[1,"dmt-sticky__meta"],[1,"dmt-sticky__right"],[1,"dmt-pill","dmt-pill--sm"],[1,"dmt-pill__dot"],["tooltip","Go to log to see errors and info",3,"onClick","ngClass"],[1,"flex"],[1,"mb-0","log-text"],[1,"mb-0","fw-400"],["color","primary","buttonIcon","keyboard_double_arrow_right","buttonIconPosition","after",3,"onClick","disabled"],[3,"showLog","onScrollToLog","operationDisable","entityDefinition","selectedAction"],[1,"dmt-map__footer"],[1,"dmt-map__hint"],[1,"dmt-preview__lede"],[1,"dmt-impact"],[1,"dmt-preview__grid"],[1,"dmt-preview__card"],[1,"dmt-preview__card-h"],[1,"dmt-kv"],[1,"dmt-kv__truncate",3,"matTooltip"],[1,"dmt-pill"],[1,"dmt-preview__note"],[1,"dmt-warn"],[1,"dmt-preview__actions"],[1,"dmt-preview__run"],[1,"dmt-preview__hint"],["color","primary",3,"onClick","disabled"],[1,"dmt-impact__h"],[1,"dmt-impact__grid"],[1,"dmt-impact__card"],[1,"dmt-impact__note"],[1,"dmt-impact__count"],[1,"dmt-impact__label"],["name","info",3,"size"],[1,"operation-result-card",3,"header","headerIcon","headerIconColor"],[1,"fw-500"],[1,"mt-2"],[1,"mb-0"],["color","primary",3,"onClick"],[3,"errorLogCreated","onScrollToMapping","operationFinished","hideTopButton"],[1,"dmt-rail"],[1,"dmt-rail__card"],[1,"dmt-rail__collapsed"],[1,"dmt-tip"],["header","Operation summary"],["type","mat-icon-button","buttonIcon","keyboard_double_arrow_right","tooltip","Collapse summary",3,"onClick","size"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"dmt-popout"],["type","mat-icon-button","buttonIcon","keyboard_double_arrow_left","tooltip","Expand summary",3,"onClick","size"],[1,"dmt-rail__collapsed-label"],[1,"dmt-tip__p"],[1,"dmt-rail__section"],[1,"dmt-rail__section-h"],[1,"dmt-kv__truncate"],[1,"dmt-kv__ok"],[1,"dmt-rail__columns"],[1,"dmt-rail__columns-h"],[1,"dmt-rail__columns-list"],[1,"dmt-col-chip"],[1,"flex","flex-column","height-100"],[1,"height-100"],[3,"totalAmount","useDialogProgress","progressResponse","processingMessage"],[1,"flex","justify-end"],["color","primary",1,"align-self-end","mr-1",3,"onClick","disabled"],[1,"align-self-end","mr-1",3,"onClick","disabled"]],template:function(n,t){if(n&1&&(a(0,"div",null,0)(2,"yon-card",8)(3,"yon-card-header-right"),y(4,ui,2,0,"yon-button"),y(5,hi,2,1,"yon-button"),r()()(),a(6,"nav",9)(7,"button",10),C("click",function(){return t.goToStage("define")}),a(8,"div",11),T(9,"yon-icon",12),s(10,"01 "),r(),a(11,"div")(12,"div",13),s(13,"Stage 1"),r(),a(14,"div",14),s(15,"Define"),r(),a(16,"div",15),s(17,"Pick entity, action and source."),r()()(),a(18,"button",10),C("click",function(){return t.goToStage("map")}),a(19,"div",11),T(20,"yon-icon",12),s(21,"02 "),r(),a(22,"div")(23,"div",13),s(24,"Stage 2"),r(),a(25,"div",14),s(26,"Map"),r(),a(27,"div",15),s(28,"Tie source columns to fields."),r()()(),a(29,"button",10),C("click",function(){return t.goToStage("execute")}),a(30,"div",11),T(31,"yon-icon",12),s(32,"03 "),r(),a(33,"div")(34,"div",13),s(35,"Stage 3"),r(),a(36,"div",14),s(37,"Preview & run"),r(),a(38,"div",15),s(39,"Confirm what will happen, then run."),r()()()(),a(40,"div",16)(41,"main",17),y(42,bi,3,3),y(43,Ti,10,7,"div"),a(44,"div",18,1),y(46,Si,2,2,"yon-data-management-log",19),r()(),y(47,Ni,4,6,"aside",20),O(48,Hi,36,13,"ng-template",null,2,pe),r(),a(50,"yon-dialog-center",21,3),C("onClose",function(){return t.canContinueToLog()?t.onProgressCompleted(!0):void 0}),r(),O(52,zi,9,7,"ng-template",null,4,pe)),n&2){let o=B(53);l(2),_("dividerLineBelowHeader",!1),l(2),v(t.onlyShowProcess()&&!t.isOperationFinished()?4:-1),l(),v(t.isOperationFinished()?5:-1),l(2),U("dmt-stage--active",t.currentStage()==="define")("dmt-stage--done",t.currentStage()!=="define")("dmt-stage--clickable",t.isStageReachable("define")&&t.currentStage()!=="define"),_("disabled",!t.isStageReachable("define")||t.currentStage()==="define"),Te("aria-current",t.currentStage()==="define"?"step":null),l(2),_("size",24),l(9),U("dmt-stage--active",t.currentStage()==="map")("dmt-stage--done",t.currentStage()==="execute")("dmt-stage--idle",t.currentStage()==="define")("dmt-stage--clickable",t.isStageReachable("map")&&t.currentStage()!=="map"),_("disabled",!t.isStageReachable("map")||t.currentStage()==="map"),Te("aria-current",t.currentStage()==="map"?"step":null),l(2),_("size",24),l(9),U("dmt-stage--active",t.currentStage()==="execute")("dmt-stage--idle",t.currentStage()!=="execute")("dmt-stage--clickable",t.isStageReachable("execute")&&t.currentStage()!=="execute"),_("disabled",!t.isStageReachable("execute")||t.currentStage()==="execute"),Te("aria-current",t.currentStage()==="execute"?"step":null),l(2),_("size",24),l(9),U("dmt-grid--no-rail",!t.isV3()),l(2),v(t.onlyShowProcess()?-1:42),l(),v(t.isOperationFinished()?43:-1),l(),_("hidden",t.currentStage()==="define"),l(2),v(t.showLog()?46:-1),l(),v(t.isV3()?47:-1),l(3),_("customClass","data-management__processing-dialog")("height",400)("header",t.headerText())("containerTemplate",o)}},dependencies:[me,ce,gt,ye,Ke,j,Re,ke,Ft,ne,he,Gt,Wt,Ht,_t,ht,ut],styles:[".color__yon-orange[_ngcontent-%COMP%]{color:var(--color-primary)}.data-management-card[_ngcontent-%COMP%] .card__header{font-size:36px;font-weight:400}.data-management-card[_ngcontent-%COMP%] .card{margin-bottom:0}#ui.v3[_nghost-%COMP%] .data-management-card[_ngcontent-%COMP%] .card-block, #ui.v3 [_nghost-%COMP%] .data-management-card[_ngcontent-%COMP%] .card-block{padding-bottom:0!important}.log-text[_ngcontent-%COMP%]{padding-right:2px}.log-has-errors[_ngcontent-%COMP%] button{border:1px solid var(--color-red-error)}.operation-result-card[_ngcontent-%COMP%] .card__header{font-size:24px;font-weight:400}.dmt-stages[_ngcontent-%COMP%]{display:flex;margin:0 0 16px;border-bottom:1px solid var(--yon-grey-border)}.dmt-stage[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:8px;padding:10px 18px;
1cursor:default;color:var(--color-mono-contrast-low);border:0;border-bottom:2px solid transparent;margin-bottom:-1px;background:transparent;font:inherit;text-align:left}.dmt-stage[disabled][_ngcontent-%COMP%]{opacity:1}.dmt-stage--clickable[_ngcontent-%COMP%]{cursor:pointer}.dmt-stage--clickable[_ngcontent-%COMP%]:hover{color:var(--color-mono-contrast-high)}.dmt-stage--active[_ngcontent-%COMP%]{color:var(--color-mono-contrast-high);border-bottom-color:var(--color-primary)}.dmt-stage--done[_ngcontent-%COMP%]{color:var(--color-mono-contrast-medium)}.dmt-stage__num[_ngcontent-%COMP%]{font-weight:500}.dmt-stage__check[_ngcontent-%COMP%]{display:none;vertical-align:middle;margin-right:4px}.dmt-stage__check[_ngcontent-%COMP%] span{color:inherit!important}.dmt-stage--done[_ngcontent-%COMP%] .dmt-stage__check[_ngcontent-%COMP%]{display:inline-block}.dmt-stage__title[_ngcontent-%COMP%]{font-weight:500}.dmt-stage__label[_ngcontent-%COMP%], .dmt-stage__desc[_ngcontent-%COMP%]{display:none}.dmt-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;align-items:start;transition:grid-template-columns .2s ease}.dmt-grid[_ngcontent-%COMP%]:has(.dmt-rail--collapsed){grid-template-columns:minmax(0,1fr) 56px}.dmt-grid--no-rail[_ngcontent-%COMP%]{grid-template-columns:minmax(0,1fr)}.dmt-main[_ngcontent-%COMP%]{min-width:0}.dmt-sticky[_ngcontent-%COMP%]{position:sticky;top:calc(-1vw - 11px);z-index:50;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:8px 14px;margin-bottom:12px;background:var(--layout-bg-color-card);border:1px solid var(--yon-grey-border)}.dmt-sticky__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;min-width:0;overflow:hidden}.dmt-sticky__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;flex-shrink:0}.dmt-sticky__entity[_ngcontent-%COMP%]{font-weight:500;white-space:nowrap;flex-shrink:0}.dmt-sticky__sep[_ngcontent-%COMP%]{color:var(--color-mono-contrast-low);flex-shrink:0}.dmt-sticky__meta[_ngcontent-%COMP%]{color:var(--color-mono-contrast-medium);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.dmt-arrow[_ngcontent-%COMP%]{color:var(--color-primary);padding:0 4px}.dmt-pill[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;border:1px solid var(--yon-grey-border);background:var(--color-bg-details-box);color:var(--color-mono-contrast-medium);white-space:nowrap}.dmt-pill--ok[_ngcontent-%COMP%]{color:var(--color-green-success);border-color:color-mix(in srgb,var(--color-green-success) 40%,transparent);background:color-mix(in srgb,var(--color-green-success) 8%,transparent)}.dmt-pill--ok[_ngcontent-%COMP%] .dmt-pill__dot[_ngcontent-%COMP%]{background:var(--color-green-success)}.dmt-pill--warn[_ngcontent-%COMP%]{color:var(--color-primary);border-color:color-mix(in srgb,var(--color-primary) 40%,transparent);background:color-mix(in srgb,var(--color-primary) 8%,transparent)}.dmt-pill--warn[_ngcontent-%COMP%] .dmt-pill__dot[_ngcontent-%COMP%]{background:var(--color-primary)}.dmt-pill__dot[_ngcontent-%COMP%]{width:7px;height:7px;border-radius:50%;background:var(--color-mono-contrast-low)}.dmt-link[_ngcontent-%COMP%]{color:var(--color-secondary);cursor:pointer}.dmt-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.dmt-map__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:16px;padding:12px 16px;background:var(--layout-bg-color-card);border:1px solid var(--yon-grey-border)}.dmt-map__hint[_ngcontent-%COMP%], .dmt-preview__hint[_ngcontent-%COMP%]{color:var(--color-mono-contrast-medium)}.dmt-preview__lede[_ngcontent-%COMP%]{margin:4px 0 16px}.dmt-preview__grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:16px}.dmt-preview__card[_ngcontent-%COMP%]{padding:12px 14px;background:var(--color-bg-details-box)}.dmt-preview__card-h[_ngcontent-%COMP%]{font-weight:500;padding-bottom:8px;margin-bottom:8px;border-bottom:1px solid var(--color-input-border)}.dmt-preview__note[_ngcontent-%COMP%]{color:var(--color-mono-contrast-medium);margin:8px 0 0}.dmt-preview__actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:12px;border-top:1px solid var(--color-input-border)}.dmt-preview__run[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.dmt-warn[_ngcontent-%COMP%], .dmt-tip[_ngcontent-%COMP%]{display:flex;gap:10px;padding:12px 14px;border-left:3px solid var(--color-primary);background:color-mix(in srgb,var(--color-primary) 6%,transparent);line-height:1.5}.dmt-warn[_ngcontent-%COMP%]{margin-bottom:16px}.dmt-tip[_ngcontent-%COMP%]{color:var(--color-mono-contrast-medium)}.dmt-tip__p[_ngcontent-%COMP%]{margin:0}.dmt-tip__p[_ngcontent-%COMP%] + .dmt-tip__p[_ngcontent-%COMP%]{margin-top:8px;padding-top:8px;border-top:1px dashed color-mix(in srgb,var(--color-primary) 30%,transparent)}.dmt-tip__p[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-bg-details-box);padding:1px 5px;border-radius:3px}.dmt-impact[_ngcontent-%COMP%]{margin:0 0 16px;padding:12px 14px;background:var(--color-bg-details-box)}.dmt-impact__h[_ngcontent-%COMP%]{font-weight:500;margin-bottom:10px}.dmt-impact__grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:10px}.dmt-impact__card[_ngcontent-%COMP%]{flex:1 1 140px;min-width:140px;padding:10px 12px;background:var(--layout-bg-color-card);border:1px solid var(--yon-grey-border)}.dmt-impact__count[_ngcontent-%COMP%]{font-weight:500}.dmt-impact__label[_ngcontent-%COMP%]{color:var(--color-mono-contrast-medium);margin-top:2px;display:flex;align-items:center;gap:6px}.dmt-impact__note[_ngcontent-%COMP%]{color:var(--color-mono-contrast-medium);margin-top:10px}.dmt-rail[_ngcontent-%COMP%]{position:sticky;top:16px;display:flex;flex-direction:column;gap:12px}.dmt-rail--map[_ngcontent-%COMP%] .dmt-rail__card[_ngcontent-%COMP%]{margin-top:57px}.dmt-rail__collapsed[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:8px;padding:8px 4px;border:1px solid var(--yon-grey-border);background:var(--layout-bg-color-card)}.dmt-rail__collapsed-label[_ngcontent-%COMP%]{writing-mode:vertical-rl;font-size:12px;color:var(--color-mono-contrast-medium);letter-spacing:.05em;padding:4px 0}.dmt-rail__card[_ngcontent-%COMP%]{display:block;border:1px solid var(--yon-grey-border);background:var(--layout-bg-color-card);padding:0 16px 12px;margin-top:-5px}.dmt-rail__card[_ngcontent-%COMP%] .card{margin-bottom:0}.dmt-rail__card[_ngcontent-%COMP%] .card-block{padding:0!important}.dmt-rail__card[_ngcontent-%COMP%] .card__header-row{margin-bottom:10px!important}.dmt-rail__section[_ngcontent-%COMP%] + .dmt-rail__section[_ngcontent-%COMP%]{margin-top:12px;padding-top:10px;border-top:1px solid var(--color-input-border)}.dmt-rail__section-h[_ngcontent-%COMP%], .dmt-rail__columns-h[_ngcontent-%COMP%]{color:var(--color-mono-contrast-medium);margin-bottom:6px;font-weight:500}.dmt-rail__columns[_ngcontent-%COMP%]{margin-top:10px;padding-top:8px;border-top:1px solid var(--color-input-border)}.dmt-rail__columns-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.dmt-kv[_ngcontent-%COMP%]{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:4px 0}.dmt-kv[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--color-mono-contrast-medium);flex-shrink:0;font-weight:600}.dmt-kv[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:400;text-align:right;min-width:0;flex:1;overflow-wrap:break-word}.dmt-kv__truncate[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;max-width:100%}.dmt-kv__ok[_ngcontent-%COMP%]{color:var(--color-green-success)!important}.dmt-kv__err[_ngcontent-%COMP%]{color:var(--color-red-error)!important}.dmt-col-chip[_ngcontent-%COMP%]{display:inline-block;padding:2px 8px;border:1px solid var(--yon-grey-border);border-radius:4px;background:var(--color-bg-details-box);white-space:nowrap}.dmt-popout[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 24px;max-width:820px;padding:8px 4px}.dmt-popout[_ngcontent-%COMP%] .dmt-rail__section[_ngcontent-%COMP%]{margin-top:0;padding-top:0;border-top:0}.dmt-popout[_ngcontent-%COMP%] .dmt-rail__section[_ngcontent-%COMP%]:nth-child(2){grid-row:span 2}@media(max-width:992px){.dmt-grid[_ngcontent-%COMP%], .dmt-preview__grid[_ngcontent-%COMP%]{grid-template-columns:1fr}.dmt-rail[_ngcontent-%COMP%]{position:static}}"],changeDetection:0})}}return i})();export{Mr as DataManagementToolComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.