@ingestro/importer-react 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{a as d}from"./chunk-J5WOZVPO.js";import{isNil as ie,escapeRegExp as tt,isString as rt}from"lodash";import ce from"numbro";import{isNil as fe}from"lodash";var u=class r{static{this.currencySymbol={eu:"\u20AC",us:"$"}}static{this.percentageSymbol="%"}static{this.maxSafeNumberLength=17}static convertToFormat(e,t){if(e==null||e===""||typeof e=="string"&&e.trim()==="")return"";let i="";if(typeof e=="string"){let m=this.convertStringToNumber(e,{targetFormat:t?.targetFormat});if(m===null)return e;i=m}else if(typeof e=="number"){let m=e;t?.adornment==="percentage"&&(m=e*100,m=Number(m.toFixed(10))),i=m.toString()}else throw new Error(`[convertToFormat] unsupported type of the "value" - ${typeof e}`);let[n,o]=i.split("."),a=t?.decimalDigits||o?.length||0,l="";try{l=ce(i).format({thousandSeparated:!0,mantissa:a})}catch{return i}if(t?.targetFormat==="eu"){let m=l.replace(/,/g,"$").replace(/\./g,",").replace(/\$/g,".");return this.appendAdornment(m,t)}return this.appendAdornment(l,t)}static detectNumberFormat(e,t){let i=[];for(let l=0;l<e.length;l++)(e[l]===","||e[l]===".")&&i.push(e[l]);if(i.length===0)return;let n=e.replace(/([+\-EUR€SD$%\s])/g,"");if(i.length===1){let[l,m]=n.split(i[0]);return l.length>3?i[0]===","?"eu":"us":l.replace(/0/g,"")===""?i[0]===","?"eu":"us":m.length===3?t?.targetFormat?t?.targetFormat:t?.resolveUncertainty===!1?void 0:i[0]===","?"us":"eu":i[0]===","?"eu":"us"}let o=/^([1-9]\d{0,2})(\.\d{3})*(,\d+)?$/,a=/^([1-9]\d{0,2})(,\d{3})*(\.\d+)?$/;return o.test(n)?"eu":a.test(n)?"us":null}static convertToUsWithDecimal(e,t){let i=e,n=r.getDelimiters(e),o=e.replace(/([+\-EUR€SD$%\s])/g,"");if(n.length===1){let[a,l]=o.split(n[0]);if(l.length===3)return t==="us"?i=`${e}`?.replace(/,/g,""):i=`${e}`?.replace(/\./g,"$")?.replace(/,/,".").replace(/\$/g,""),i}return this.replaceDelimiter(e)}static{this.convertStringToNumber=(e,t)=>{if(typeof e=="number")return`${e}`;if(typeof e!="string")return null;let i=e.trim().replace(/([EUR€SD$%\s])/g,"");if(i==="")return e;let n=t?.format||this.detectNumberFormat(i,{targetFormat:t?.targetFormat}),o="";if(n===null||(n==="us"?o=i.replace(/,/g,""):o=i.replace(/\./g,"$").replace(/,/,".").replace(/\$/g,""),o.length>r.maxSafeNumberLength&&(o=o.slice(0,r.maxSafeNumberLength),o.at(-1)==="."&&(o=o.slice(0,r.maxSafeNumberLength-1))),isNaN(Number(o))))return null;if(t?.adornment==="percentage"&&e.includes("%")){let a=Number(o)/100;o=Number(a.toFixed(10)).toString()}return o}}static hasDecimalPart(e,t){if(typeof e=="number")return e%1!==0;let i=e.trim(),n=t||this.detectNumberFormat(i);return n===null?!1:n==="us"?e.includes("."):e.includes(",")}static appendAdornment(e,t){return t?.adornment==="currency"?t.symbol==="us"?`${this.currencySymbol.us}${e}`:`${e} ${this.currencySymbol[t.symbol??"eu"]}`:t?.adornment==="percentage"?`${e} ${this.percentageSymbol}`:e}static getDelimiters(e){let t=[];for(let i=0;i<e.length;i++)(e[i]===","||e[i]===".")&&t.push(e[i]);return t}static replaceDelimiter(e){let t=e,i=r.detectNumberFormat(`${e}`);return fe(i)?null:(i==="eu"?t=`${e}`?.replace(/\./g,"$")?.replace(/,/,".").replace(/\$/g,""):t=`${e}`?.replace(/,/g,""),t)}};var D=()=>d.getInstance().getTruthyWords(),I=()=>d.getInstance().getFalsyWords(),ft=()=>d.getInstance().getBooleanOptionToRender(),gt=[...D(),...I()];import{isArray as ge,isNil as Ee,isObject as ye}from"lodash";var N=class{constructor(){this.parse=(e,t)=>Ee(e)||ge(e)||ye(e)?null:D().includes(`${e}`.toLowerCase())?!0:I().includes(`${e}`.toLowerCase())?!1:e===""?null:`${e}`}},w=N;import{isArray as $,isBoolean as Y,isNil as K,isObject as B}from"lodash";var O=class{constructor(){this.parseSingle=(e,t)=>K(e)||B(e)||$(e)?null:Y(e)?JSON.stringify(e):e===""?null:y({value:e,dataModel:t.dataModel,isTrim:!0});this.parseMultiple=(e,t)=>$(e)?e.map(i=>y({value:i,dataModel:t.dataModel,isTrim:!0})):K(e)||B(e)||e===""?null:Y(e)?[JSON.stringify(e)]:[y({value:e,dataModel:t.dataModel,isTrim:!0})];this.parse=(e,t)=>t.dataModel.getIsMultiSelection()&&!t.forceSingle?this.parseMultiple(e,t):this.parseSingle(e,t)}},W=O;import{isArray as _e,isBoolean as be,isNil as Me,isObject as Te}from"lodash";var R=class{constructor(){this.parse=(e,t)=>Me(e)||_e(e)||Te(e)?null:be(e)?JSON.stringify(e):e===""?null:s(`${e}`)}},G=R;import{isArray as he,isBoolean as De,isNil as Ie,isObject as Ne}from"lodash";var A=class{constructor(){this.parse=(e,t)=>Ie(e)?null:De(e)?e?"1":"0":Ne(e)||he(e)||e===""||s(e)===null?null:this.valueParser(e,t)}},_=A;var C=class extends _{constructor(){super(...arguments);this.valueParser=(t,i)=>{let n=u.convertStringToNumber(t,{format:i?.numberFormat});return n===null?s(`${t}`):Number(n)}}},k=C;var S=class extends _{constructor(){super(...arguments);this.valueParser=(t,i)=>{let n=u.convertStringToNumber(t,{format:i?.numberFormat});return n===null?s(`${t}`):Number(n)}}},q=S;import{isArray as Oe,isBoolean as Re,isNil as Ae,isNumber as Ce,isObject as Se}from"lodash";var U=class{constructor(){this.parse=(e,t)=>{if(Ae(e)||Se(e)||Oe(e))return null;if(Re(e))return JSON.stringify(e);if(Ce(e))return e;if(e===""||s(e)===null)return null;let i=u.convertStringToNumber(e,{adornment:"percentage"});return i===null?s(`${e}`):Number(i)}}},Q=U;import{isArray as Ue,isBoolean as Pe,isNil as Ve,isObject as xe}from"lodash";var P=class{constructor(){this.parse=(e,t)=>{if(Ve(e)||Ue(e)||xe(e))return null;if(Pe(e))return JSON.stringify(e);if(e===""||s(e)===null)return null;let i=u.convertStringToNumber(e,{format:t?.numberFormat});return i===null?s(`${e}`):Number(i)}}},Z=P;import{parse as j,format as X,isMatch as Fe}from"date-fns";import p from"moment";var f="dd.MM.yyyy HH:mm:ss:SSS";var z="DD.MM.YYYY HH:mm:ss:SSS",J="DD.MM.YYYY HH:mm:ss:SSSZ";var b={date_dmy:"dd.MM.yyyy",date_mdy:"MM.dd.yyyy",date_iso:"yyyy-MM-dd",datetime:"yyyy-MM-dd HH:mm:ss",time_hm:"hh:mm aaa",time_hms:"hh:mm:ss aaa",time_hm_24:"HH:mm",time_hms_24:"HH:mm:ss"},v={time_hm:"hh:mm a",time_hms:"hh:mm:ss a",time_hm_24:"HH:mm",time_hms_24:"HH:mm:ss"},Jt=r=>{try{return X(j(r,f,new Date),"dd.MM.yyyy")}catch{return r}},He=(r,e,t,i)=>{try{if(typeof r=="string"){if(i===!1||isNaN(Date.parse(r))&&!we(r))return r;let n=t||["dd.MM.yyyy HH:mm:ss","dd.MM.yyyy HH:mm","dd.MM.yyyy","dd/MM/yyyy HH:mm:ss","dd/MM/yyyy HH:mm","dd/MM/yyyy","dd-MM-yyyy HH:mm:ss","dd-MM-yyyy HH:mm","yyyy-MM-dd'T'HH:mm:ssZ","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd","yyyy-MM-dd HH:mm:ss","dd-MM-yyyy"],o;for(let a=0;a<n.length;++a)if(Fe(r,n[a])){o=n[a];break}if(o)return X(j(r,o,new Date),e||f);throw new Error("not found format")}else throw new Error("not date string")}catch{return r}},Le=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],ee=(r,e)=>{r===null&&(r=""),r=/^\d{3,}$/.test(r)?parseInt(r,10):r;let t=/^\d{1,2}$/.test(r);t&&(r+=":00");let i=p(r,Le,!0).isValid()?p(r):p(r,e),n=i.isValid(),o=p(r,e,!0).isValid()&&!t;return r===""&&(n=!0,o=!0),n&&!o?i.format(e):r},jt=(r,e)=>{let t=()=>p.parseZone(r).format(e);try{if(typeof r=="string"){if(p(r,e,!0).isValid())return e.includes("Z")?t():p.utc(r,e).format(e);if(p(r).isValid())return e.includes("Z")?t():p.utc(r).format(e);throw new Error("not found format")}else throw new Error("not date string")}catch{return r}},Xt=(r,e)=>{switch(e){case"date_dmy":case"date_mdy":case"date_iso":case"datetime":return He(r,b[e],[b[e]]);default:return r}},we=r=>{let[e,t,i]=r?.split(" ")?.[0]?.split(/[./-]/);return!!(Number(i)&&Number(t)<=12&&Number(e)<=31)};import{parse as $e,format as Ye}from"date-fns";import{isArray as Ke,isBoolean as Be,isNil as We,isObject as Ge}from"lodash";import T from"moment";var ke=/([+-](?:0\d|1[0-4]):?[0-5]\d|Z)$/i,V=class{constructor(){this.parse=(e,t)=>{if(We(e)||Ke(e)||Ge(e))return null;if(Be(e))return JSON.stringify(e);let i=t?.dataModel?.getType();if(!i)return s(`${e}`);if(typeof e=="string"){if(e==="")return null;try{if(t?.dataModel?.getType()==="date"){let n=t?.dataModel?.getOutputFormat(),o=e.match(ke),l=!!(o?o[0]:"");if((l?T.parseZone(e,n,!0):T(e,n,!0)).isValid())return e;let c=l?T.parseZone(e,J):T(e,z);if(c.isValid())return c.format(n);throw new Error("invalid date")}else{let n=b[i];if(!n)return s(`${e}`);let o=$e(e,f,new Date);return Ye(o,n)}}catch{let o=v[i];return o?s(ee(e,o)):s(`${e}`)}}else return s(`${e}`)}}},te=V;import{isArray as qe}from"lodash";var x=class{constructor({validation:e,regex:t,fields:i,errorMessage:n}){this.getValidation=()=>this.validation;this.getRegex=()=>this.regex;this.getFields=()=>this.fields;this.getErrorMessage=()=>this.errorMessage;this.serialize=()=>({validation:this.getValidation(),fields:this.getFields(),regex:this.getRegex(),errorMessage:this.getErrorMessage()});this.validation=e,this.regex=t,this.fields=i??[],this.errorMessage=n}},lr=x;var h=class r{constructor({description:e,key:t,example:i,label:n,type:o,validators:a,mappingValidation:l,alternativeMatches:m,columnSize:c,creator:oe,baseKey:se,baseKeyCounter:ae,outputFormat:le,numberFormat:ue,hidden:me,disabled:pe,optionMappingConfiguration:de}){this.getDescription=()=>this.description;this.getKey=()=>this.key;this.getExample=()=>this.example;this.getLabel=()=>this.label;this.setLabel=e=>{this.label=e};this.getType=()=>this.type;this.getOutputFormat=()=>r.getOutputFormat(this.outputFormat);this.getValidators=()=>this.validators;this.getColumnSize=()=>this.columnSize;this.getIsRequired=()=>!!this.validators.find(t=>t.getValidation()==="REQUIRED");this.getIsUnique=()=>!!this.validators.find(t=>t.getValidation()==="UNIQUE");this.getIsUniqueAndRequired=()=>this.getIsRequired()===!0&&this.getIsUnique()===!0;this.hasMappingValidation=()=>!!(this.mappingValidation&&this.mappingValidation.logic&&this.mappingValidation.logic.trim().length>0);this.getMappingValidation=()=>this.mappingValidation||void 0;this.getAlternativeMatches=()=>this.alternativeMatches.filter(e=>!!e);this.getCreator=()=>this.creator;this.getBaseKey=()=>this.baseKey;this.getBaseKeyCounter=()=>this.baseKeyCounter;this.setCustomKey=({key:e,baseKey:t,baseKeyCounter:i,creator:n})=>{this.baseKey=t,this.key=e,this.baseKeyCounter=i,this.creator=n};this.isDropdown=()=>r.isTypeDropdown(this.getType());this.isCategoryType=()=>r.isTypeCategory(this.getType());this.isBooleanType=()=>this.type==="boolean";this.serialize=()=>({description:this.getDescription(),example:this.getExample(),key:this.getKey(),label:this.getLabel(),type:this.getType(),validators:[],alternativeMatches:this.getAlternativeMatches(),columnSize:this.getColumnSize(),outputFormat:this.getOutputFormat(),isMultiSelection:this.getIsMultiSelection(),numberFormat:this.getNumberFormat(),baseKey:this.getBaseKey(),baseKeyCounter:this.getBaseKeyCounter(),creator:this.getCreator(),hidden:this.isHidden(),disabled:this.isDisabled(),optionMappingConfiguration:this.getOptionMappingConfiguration()});this.getIsMultiSelection=()=>!1;this.getNumberFormat=()=>this.numberFormat;this.isDisabled=()=>this.disabled;this.isNumeric=()=>this.type==="int"||this.type==="float"||this.type==="currency_eur"||this.type==="currency_usd"||this.type==="percentage";this.isCurrency=()=>this.type==="currency_eur"||this.type==="currency_usd";this.baseClone=()=>{let e=this.serialize();return new r({description:e.description,example:e.example,key:e.key,label:e.label,type:e.type,validators:this.getValidators(),alternativeMatches:e.alternativeMatches,columnSize:e.columnSize,baseKey:e.baseKey,baseKeyCounter:e.baseKeyCounter,creator:e.creator,numberFormat:e.numberFormat,outputFormat:e.outputFormat,hidden:e.hidden,disabled:e.disabled,optionMappingConfiguration:e.optionMappingConfiguration})};this.isHidden=()=>this.hidden;this.getOptionMappingConfiguration=()=>this.optionMappingConfiguration;this.description=e,this.key=t,this.example=i,this.label=n,this.type=o,this.validators=a??[],this.mappingValidation=l,this.alternativeMatches=m?[...m.filter(g=>g!==n&&g!==t)?.map(g=>g?.toString())]:[],this.columnSize=c,this.creator=oe,this.baseKey=se||t,this.baseKeyCounter=ae||0,this.outputFormat=le||"",this.numberFormat=ue||"eu",this.hidden=me??!1,this.disabled=pe??!1,this.optionMappingConfiguration=de}static{this.getOutputFormat=e=>(e||"DD.MM.YYYY").replace(/d/g,"D").replace(/e|E/g,"")}static{this.isTypeDropdown=e=>r.isTypeCategory(e)||e==="boolean"}static{this.isTypeCategory=e=>e==="single-select"||e==="currency_code"||e==="country_code_alpha_2"||e==="country_code_alpha_3"}};var Qe=new k,Ze=new q,ze=new Z,Je=new Q,je=new w,Xe=new W,ve=new G,et=new te,H=class{static{this.parse=(e,t)=>{let i;switch(t?.dataModel?.getType()){case"int":i=Qe;break;case"float":i=Ze;break;case"boolean":i=je;break;case"single-select":case"currency_code":case"country_code_alpha_2":case"country_code_alpha_3":i=Xe;break;case"percentage":i=Je;break;case"currency_eur":case"currency_usd":i=ze;break;case"date":case"date_dmy":case"date_mdy":case"date_iso":case"datetime":case"time_hms":case"time_hms_24":case"time_hm":case"time_hm_24":i=et;break;case"email":case"url_www":case"url_https":case"url":case"phone":case"zip_code_de":case"bic":case"vat_eu":case"gtin":case"iban":default:i=ve;break}return i.parse(e,t)}}static{this.parseRawValueToDisplayValue=(e,t)=>{let i=e;if(t.isNumeric)i=u.convertToFormat(e,{targetFormat:t.numberFormat||"eu",adornment:t.type==="percentage"?"percentage":void 0}),["currency_eur","currency_usd"].includes(t.type)&&(t.type==="currency_usd"?i=`$${i}`:i=`${i} \u20AC`);else if(t.type==="boolean"){let o=d.getInstance().getOptionsForReviewEntries().find(a=>`${a.value}`.includes(`${e}`));o&&(i=`${o.label}`)}else if(h.isTypeCategory(t.type))if(t.isMultiSelection){if(qe(e)){let n=t.options?.filter(o=>e.some(a=>F(o,a)));n&&(i=n.map(o=>o.label).join(", "))}}else{let n=t.options?.find(o=>F(o,e));n&&(i=`${n?.label}`)}return`${i}`}}static{this.parseDisplayValueToRawValue=(e,t)=>{if(t.isNumeric){let i=u.convertToUsWithDecimal(`${e}`,t.numberFormat??"eu");if(i===null)return e;let n=u.convertStringToNumber(i,{format:"us"});return n!==null?Number(n):e}else return e}}},re=H;var $r=r=>Number(r).toLocaleString("de-DE"),Yr=(r,e)=>{let{value:t,isExact:i,columns:n}=e,o=re.parseRawValueToDisplayValue(r,n[0]);return i&&!ie(r)&&o===t?!0:!!(!i&&!ie(r)&&o?.toLowerCase()?.includes(t?.toLowerCase()))},Kr=(r,e,t)=>{let i=new RegExp(tt(e),"gi");return`${r}`.replace(i,t)},Br=r=>typeof r=="string"?r.replace(/(\r\n|\n|\r)/gm,""):r,Wr=(r,e)=>e?e.map((t,i)=>r.map(n=>({rowIndex:i,valid:!0,key:n.key,value:t[n.key]}))):[],s=r=>{if(rt(r)){let e=r.trimEnd();return e===""?null:e}return r};var ne=r=>r.trim()?.replace(/[-!$%^&*()+|~=`{}\[\]:";'<>?,.\/]/g,"")?.replace(/^_+/,"")?.replace(/_+$/,"")?.replace(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g,"")?.replace(/ /g,"_")?.replace(/ß/g,"ss")?.replace(/ä/g,"ae")?.replace(/ö/g,"oe")?.replace(/ü/g,"ue")?.toLowerCase(),L=r=>r?.replace(/[-!$%^&*()_+|~=`{}\\[\]:";'<>?,.\\/]/g," ")?.replace(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g," ")?.toLowerCase();import{isInteger as it,isNumber as nt}from"lodash";var jr=(r,e,t)=>{for(let i=0;i<r.length;i++){let n=r[i].getKey(),o=e;if(t&&(n=L(n),o=L(o)),n===o)return r[i]}return null},Xr=(r,e)=>{for(let t=0;t<e.length;t++)if(e[t].getKey()===r)return t;return-1},F=(r,e)=>`${r.value}`==`${e}`,ot=(r,e)=>{let t=0;for(let i=0;i<e.length;i++){let n=e[i],o="baseKeyCounter";n?.[o]&&r===n?.["baseKey"]&&t<(n?.[o]??0)&&(t=n?.[o]||0)}return t},st=(r,e)=>!r.some(t=>t.baseKey===e),vr=(r,e,t=!0)=>{let i=t?ne(r):r,n=ot(i,e)+1,o=i;return st(e,i)?n--:n>0&&(o=`${i}_${n}`),{key:{value:o,baseKey:i,baseKeyCounter:n}}},y=({value:r,dataModel:e,isTrim:t})=>{let i=e.getOptionTypeMap(),n=r!==void 0?i.get(r):void 0;if(!n&&typeof r=="number"&&(n=i.get(String(r))),!n&&typeof r=="string"){let o=Number(r);isNaN(o)||(n=i.get(o))}if(n=n??"string",n==="int"){let o=Number(r);return!isNaN(o)&&it(o)?o:t?s(`${r}`):`${r}`}else if(n==="float"){if(nt(r))return r;let o=`${r}`.replace(/,/,"."),a=u.convertStringToNumber(`${o}`,{format:"us"});return a===null?t?s(`${r}`):`${r}`:Number(a)}else return t?s(`${r}`):`${r}`};export{u as a,D as b,I as c,ft as d,gt as e,L as f,jr as g,Xr as h,F as i,vr as j,y as k,v as l,Jt as m,ee as n,jt as o,Xt as p,lr as q,h as r,re as s,$r as t,Yr as u,Kr as v,Br as w,Wr as x,s as y};
@@ -0,0 +1 @@
1
+ var x=["label"],y={EMAIL:"^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|'(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*')@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$",WEBSITE:"^(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?$"},I=["label","key","alternateMatches"],S=4;var d=i=>{let t=new Set;for(let n=0;n<i.length;n++){let o=i[n];for(let e of Object.values(o))t.add(e)}return[...t]},b=(i,t)=>{let n={};for(let[o,e]of Object.entries(i)){n[o]={};for(let[r,s]of Object.entries(e))s.simValue>=t&&(n[o][r]=s.simValue)}return n},E=(i,t)=>{let n=new Set;for(let o of i.dropdownOptions??[])for(let[e,r]of Object.entries(o))t.includes(e)&&n.add(r);return[...n]};function R(i){let t={},n=[];for(let o of i?.dropdownOptions??[]){n.push(o),t[o.label]=o.label;for(let e of o.alternativeMatches??[])t[e]||(n.push({...o,label:e}),t[e]=o.label)}return{flatDropdownOptions:n,mappedKey:t}}function L(i,t){let n=structuredClone(i);for(let[o,e]of Object.entries(i.suggestions)){let r={};for(let[s,a]of Object.entries(e)){let u=t[s]??s;(r[u]??0)<=a&&(r[u]=a)}n.suggestions[o]=r}return n}function A(i){return!!(new RegExp(y.EMAIL).test(i)||new RegExp(y.WEBSITE).test(i))}function U(i,t){let n=E(i,x),o=d(t),e=Object.keys(t?.[0]||{})?.[0]??"";return{dropdownOptions:n,uniqueInputOptions:o,inputColumnLabel:e}}function V(i,t){let{dropdownOptions:n,uniqueInputOptions:o,inputColumnLabel:e}=U(i,t),r=j(o,n,i.optionMappingConfiguration);return{tdmColumnKey:i.key,inputColumn:e,suggestions:r}}function _(i){return i.toLowerCase().replace(/[~!@#$%^&*()_\-+={}[\]\\|;:'",./<>?]/g," ").replace(/\s+/g," ").trim()}var M=class{constructor(t,n){this.s1=t,this.s2=n}findLongestMatch(){let t=0,n=0,o=0,e=this.s1.length,r=this.s2.length,s=Array.from({length:e+1},()=>Array(r+1).fill(0));for(let a=0;a<e;a++)for(let u=0;u<r;u++)if(this.s1[a]===this.s2[u]){let l=s[a][u]+1;s[a+1][u+1]=l,l>o&&(o=l,t=a-l+1,n=u-l+1)}return{length:o,start1:t,start2:n}}};function T(i,t){let e=new M(i,t).findLongestMatch().length,r=i.length+t.length;return 2*e/r}function B(i,t){if(i.trim().length===0||t.trim().length===0)return 0;let n=_(i),o=_(t),e=T(n,o);if(Number(e.toFixed(2))===Number((.5+.07).toFixed(2))&&!i.toLowerCase().includes(t.toLowerCase()))e-=.1;else if(e>.56&&e<.5)e+=.02;else if(Number(e.toFixed(2))>.2&&e<=.5&&i.length>0&&t.length>0&&!A(i)){let r=T(n,o);r>e&&t.length>1&&i.length>1&&i.toLowerCase().includes(t.toLowerCase())&&(e=r)}return e}function j(i,t,n){let o={};for(let e of i)o[`${e}`]=O(`${e}`,t,n.layers);return b(o,n.threshold)}function O(i,t,n){let o={},e=n.includes("fuzzy"),s=n.includes("exact")?G(i,t):{},a=1;for(let u=0;u<t.length;u++){let l=t[u],p=0,c=!0;if(s.priority1?.includes(l))p=C(s.priority1.indexOf(l)),a=p<a?p:a;else if(s.priority2?.includes(l)){let f=2+s.priority1.length+s.priority2.indexOf(l);p=C(f),a=p<a?p:a}else if(s.priority3?.includes(l)){let f=3+s.priority2.length+s.priority3.indexOf(l);p=C(f),a=p<a?p:a}else e&&(c=!1,p=B(i,l),s.priority1?.includes(i)&&p===1&&(p=1-1e-4));o[l]={simValue:Number.isNaN(p)?0:p,isSameWord:c}}if(s.priority1?.length>0||s.priority2?.length>0||s.priority3?.length>0)for(let u=0;u<t.length;u++){let l=t[u];o[l].isSameWord||(o[l].simValue=W(a,o[l].simValue))}return o}function W(i,t){let n=Math.abs(i-t-1e-4);return t>n?t-n:0}function C(i){return 1-1e-4*i}function G(i,t){let n={priority1:[],priority2:[],priority3:[]};for(let o=0;o<t.length;o++){let e=t[o],r=i.trim().toLowerCase(),s=e.trim().toLowerCase(),a=r.replace(/[\s\-\\_&+!]/g,""),u=s.replace(/[\s\-\\_&+!]/g,"");i===e?n.priority1.push(e):r===s?n.priority2.push(e):a===u&&n.priority3.push(e)}return n}var $=i=>{let t=new Set;for(let n of i)for(let[o,e]of Object.entries(n))I.includes(o)&&t.add(e);return[...t]};function w(i,t){let n=[...new Set(t)],o=$(i);return{uniqueHeaders:n,tdmMappingKeys:o}}function K(i){let t={},n=[];for(let o of i){n.push(o),t[o.label]=o.key;for(let e of o.alternativeMatches??[])t[e]||(n.push({...o,key:e,label:e}),t[e]=o.key)}return{flatTdmColumns:n,mappedKey:t}}function H(i,t){let n=[];for(let o of i){let e=new Set,r=[];for(let s of o.columnSuggestions){let a=t[s.key]??s.key;e.has(a)||(r.push({...s,key:a}),e.add(a))}n.push({...o,columnSuggestions:r})}return n}function N(i,t,n,o){let e={},r={},s=[];for(let a of i){let u=O(`${a}`,t,o.layers);for(let[l,p]of Object.entries(u))if(p.isSameWord){let c=n?.[l]?.toLowerCase()||l.toLowerCase();r[c]?r[c]=r[c]>p.simValue?p.simValue:r[c]:r[c]=p.simValue}else p.simValue===1&&s.push({inputKey:a,suggestionKey:l});e[`${a}`]=u}for(let a=0;a<s.length;a++){let u=s[a],l=n?.[u.suggestionKey]?.toLowerCase()||u.suggestionKey.toLowerCase();r[l]&&(e[u.inputKey][u.suggestionKey].simValue=r[l]-1e-4)}return e}var v=(i,t)=>{let n={},o={};for(let e of t)for(let r of I){let s=e[r];s&&typeof s=="string"&&(o[s]=e.key)}for(let[e,r]of Object.entries(i)){let s={};for(let[a,u]of Object.entries(r)){let l=o[a],p=s[l];(!p||p.simValue<u.simValue)&&(s[l]=u)}n[e]=s}return n};function D(i,t){let n=[];for(let[o,e]of Object.entries(i)){let r={inputColumnKey:o,columnSuggestions:[]};for(let[s,a]of Object.entries(e))a.simValue>=t&&r.columnSuggestions.push({key:s,percentage:Number(a.simValue.toFixed(8))});r.columnSuggestions=r.columnSuggestions.sort((s,a)=>s.percentage>a.percentage?-1:1).slice(0,S),n.push(r)}return n}var F=(i,t)=>{let{flatDropdownOptions:n,mappedKey:o}=R(i);return i.dropdownOptions=n,{similarities:V(i,t),mappedKey:o}};async function ut(i,t){return new Promise((n,o)=>{try{let{similarities:e,mappedKey:r}=F(i,t),s=L(e,r);n(s)}catch(e){o(e)}})}var q=(i,t,n)=>{let{mappedKey:o,flatTdmColumns:e}=K(i),{uniqueHeaders:r,tdmMappingKeys:s}=w(e,t),a=N(r,s,o,n);return{similarities:v(a,e),mappedKey:o}};async function lt(i,t,n){return new Promise((o,e)=>{try{let{similarities:r,mappedKey:s}=q(i,t,n),a=D(r,n.threshold),u=H(a,s);o(u)}catch(r){e(r)}})}export{ut as a,lt as b};
@@ -0,0 +1 @@
1
+ import{a as $}from"./chunk-J5WOZVPO.js";var E=h=>!h||typeof h!="string"?"":h.replace(/<[^>]*>/g,""),O=(h,i,d)=>{let e=h,a=[...i,{label:"rowIndex",key:"rowIndex"}];for(let u of a){let{label:g,key:o}=u,t=g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=[],c,m=/(['"])((?:(?!\1)[^\\]|\\.)*)(\1)/g;for(;(c=m.exec(e))!==null;)r.push({start:c.index,end:c.index+c[0].length});let f=s=>r.some(n=>s>=n.start&&s<n.end),p=[new RegExp(`@${t}\\b`,"g"),new RegExp(`@${t}(?=\\W|$)`,"g")];for(let s of p){let n,l="",b=0;for(s.lastIndex=0;(n=s.exec(e))!==null;){let y=n.index;l+=e.substring(b,y),f(y)?l+=n[0]:o==="rowIndex"?l+=`row.${o}`:l+=`row["${o.trim()}"]`,b=s.lastIndex,n.index===s.lastIndex&&s.lastIndex++}for(l+=e.substring(b),e=l,r.length=0,m.lastIndex=0;(c=m.exec(e))!==null;)r.push({start:c.index,end:c.index+c[0].length})}}if(d){let u=$.getInstance().getTruthyWords(),g=$.getInstance().getFalsyWords(),o=[],t,r=/(['"])((?:(?!\1)[^\\]|\\.)*)(\1)/g;for(;(t=r.exec(e))!==null;)o.push({start:t.index,end:t.index+t[0].length});let c=f=>o.some(p=>f>=p.start&&f<p.end),m=(f,p,s)=>{let n=f;for(let l of p){let y=String(l).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),x=new RegExp(`\\b${y}\\b`,"gi"),w="",S=0,I;for(x.lastIndex=0;(I=x.exec(n))!==null;){let F=I.index;w+=n.substring(S,F),c(F)?w+=s:w+=I[0],S=x.lastIndex,I.index===x.lastIndex&&x.lastIndex++}w+=n.substring(S),n=w}return n};e=m(e,u,"true"),e=m(e,g,"false")}return e},V=h=>h.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&").replace(/@/g,"[@]");import v from"@nyariv/sandboxjs/build/Sandbox";import k from"is-promise";var R=class{constructor(){this.formula="";this.outputData=[];this.initialize=()=>Promise.resolve();this.cleanupData=()=>{this.outputData=[]};this.setFormula=i=>(this.formula=i,Promise.resolve());this.check=()=>!0;this.parse=async(i,d,e)=>{this.outputData=[];let a=O(this.formula,d,e),u=this.generateInputValues(i,d),g=u?.[0];await this.validateFunction([g],d,a);let o=[];for(let t=0;t<u.length;t++)try{let r=async()=>{let m=await new Function("return "+a)()(u[t],t+1);return JSON.parse(JSON.stringify(m))};o.push(r())}catch{o.push(void 0);continue}return await Promise.allSettled(o).then(t=>{for(let r=0;r<t.length;r++)if(this.outputData[r]||(this.outputData[r]=[]),t[r].status==="fulfilled")this.outputData[r]=[t[r].value];else throw new Error(`Error in row ${r+1}: ${t[r].reason?.message??"Check your formula"}`)}).catch(t=>{throw new Error(t.message)}),this.outputData};this.validateFunction=async(i,d,e)=>{let a=[...d.map(p=>p.key.trim()),"rowIndex"],u=e||this.formula;if(u){let p=/row\.([a-zA-Z_][\w$]*)/g,s=u.matchAll(p);for(let n of s){let l=n[1];if(!a.includes(l))throw new Error(`Invalid variable: row.${l} is not a valid column reference`)}}let g={...v.SAFE_GLOBALS,setTimeout},o=v.SAFE_PROTOTYPES;o.set(Response,new Set);let t=new v({globals:g,prototypeWhitelist:o,executionQuota:BigInt(3e3)}),r=i[0],m=`return (${this.replaceNullishCoalescingWithLogicalOr(e||this.formula)})($$inputs)`,f={$$inputs:{...r,rowIndex:0}};try{let s=t.compileAsync(m,!0)(f),n;k(s)?n=s:n=s.run();let l=await n;this.outputData[0]=[JSON.parse(JSON.stringify(l))]}catch{throw Error("Invalid Syntax")}};this.generateInputValues=(i,d)=>{let e=[];for(let a=0;a<i.length;++a)e[a]={},d.forEach((u,g)=>{e[a][u.key.trim()]=i[a][g]??""}),e[a].rowIndex=a;return e};this.replaceNullishCoalescingWithLogicalOr=i=>i.replace(/\?\?/g,"||")}};export{E as a,O as b,V as c,R as d};
@@ -0,0 +1 @@
1
+ import{a as F}from"./chunk-INNZ66AJ.js";import{e as v,f as c,r as y,s as M}from"./chunk-JEZAW3BC.js";import{isEmpty as W,uniq as q}from"lodash";var J=0,D=class{constructor({sheet:e,columnKey:t,rows:o,id:s,notSetUnique:a=!1,label:r,refJoinSheetColum:n}){this.removed=!1;this.label="";this.parsedDate=!1;this.getColumnKey=()=>this.columnKey;this.getId=()=>this.id;this.getSheet=()=>this.sheet;this.getRows=()=>this.rows;this.getUniqueRows=()=>this.uniques;this.remove=()=>{this.removed=!0};this.unRemove=()=>{this.removed=!1};this.isRemoved=()=>this.removed;this.getType=()=>0;this.getFileName=()=>this.sheet.getSheetFileName();this.toJSON=()=>({columnKey:this.columnKey,id:this.id,rows:this.rows,type:this.getType()});this.equal=e=>this.getId()===e.getId();this.keyEqual=e=>this.columnKey===e.columnKey;this.setIndex=e=>{this.index=e};this.getIndex=()=>this.index;this.getRefJoinSheetColum=()=>this.refJoinSheetColum;this.columnKey=t.trim(),this.sheet=e,this.rows=W(o)?[""]:o,typeof s>"u"?(J++,this.id=`${t}-${J}`):this.id=s,a?this.uniques=[]:this.uniques=q(this.getRows()),r&&(this.label=r),this.refJoinSheetColum=n}setRows(e){this.rows=e}setParsedDate(e){this.parsedDate=e}hasParsedDate(){return this.parsedDate}},g=D;var I=class extends g{constructor({sheet:t,sheetColumns:o,rows:s,id:a,columnKey:r}){super({columnKey:r,rows:s,sheet:t,id:a});this.getType=()=>1;this.getJoinedSheetColumns=()=>this.sheetColumns;this.toJSON=()=>({columnKey:this.columnKey,id:this.id,rows:this.rows,sheetColumns:this.sheetColumns.map(t=>t.toJSON()),type:this.getType()});this.sheetColumns=o}},T=I;var _=["?",",","@"];import{isNaN as X,minBy as G,isString as Q,isEqual as Y,isEmpty as b,isNil as P}from"lodash";var x=class{constructor({sheets:e,filename:t,type:o,fileSize:s}){this.globalNumberFormat="eu";this.columnsNumberFormat=[];this.addSheet=e=>{this.sheets.push(e)};this.isSelected=()=>{for(let e=0;e<this.sheets.length;e++)if(this.sheets[e].isSelected())return!0;return!1};this.getSheets=()=>this.sheets;this.getSelectedSheets=()=>this.sheets.filter(e=>e.isSelected());this.getFilename=()=>this.filename;this.selectAllSheet=e=>this.sheets.forEach(t=>{t.setSelected(e)});this.getType=()=>this.type;this.getFileSize=()=>{let e=this.fileSize/1e6;return Number(parseFloat(`${e}`).toFixed(4))};this.sheets=e,this.filename=t,this.type=o,this.fileSize=s??0,this.sheets.forEach(a=>{a.setSpreadSheet(this)})}setNumberFormat(e){this.globalNumberFormat=e.global,this.columnsNumberFormat=e.columns}getNumberFormat(){return{global:this.globalNumberFormat,columns:this.columnsNumberFormat}}},H=x;var K=0,N=class{constructor({data:e,name:t,isNotSetColumn:o,id:s}){this.selected=!1;this.isManualSelectHeader=!1;this.columns=[];this.headerRowIndex=0;this.spreadSheet=new H({filename:"",sheets:[],type:"xlsx",fileSize:0});this.getId=()=>this.id;this.setSpreadSheet=e=>{this.spreadSheet=e};this.getSpreadSheet=()=>this.spreadSheet;this.setSelected=e=>{this.selected=e};this.isSelected=()=>this.selected;this.setHeaderRowIndex=e=>{this.headerRowIndex=e,this.setColumns()};this.getDataTransform=()=>this.data.map((e,t)=>({data:e,index:t,length:e.filter(o=>o).length}));this.getMaxLengthColumns=()=>this.getDataTransform().reduce((o,s)=>Math.max(o,s.data?.filter(a=>!b(a)&&!_.some(r=>r===a.toString()?.trim()&&a.toString()?.startsWith(r))).length),0);this.setHeaderByAutoDetection=()=>{let e=this.getMaxLengthColumns(),t=this.getDataTransform(),o=[];for(let a=0;a<(t.length>50?50:t.length);a++){let r=t[a],n=r.length===e;r.data.filter(h=>!v.includes(Q(h)?h.toLowerCase():h)&&X(Number(h))).length===e&&n&&o.push(r)}let s=o.length===1?o[0].index:G(o,a=>a.length)?.index??0;this.setHeaderRowIndex(s)};this.getHeaderRowIndex=()=>this.headerRowIndex;this.getHeaderRow=()=>this.data[this.headerRowIndex]?.filter(e=>!!e);this.getColumns=()=>this.columns.filter(e=>!e.isRemoved());this.getSortedColumns=()=>[...this.getColumns()].sort((e,t)=>c(e.getColumnKey())<c(t.getColumnKey())?-1:c(e.getColumnKey())>c(t.getColumnKey())?1:0);this.getColumnsWithRemoved=()=>this.columns.filter(e=>e.getType()!==1);this.getColumn=(e,t)=>this.columns.find(o=>t?c(o.getColumnKey())===c(`${e}`):o.getColumnKey()===e);this.getColumnsByKey=(e,t)=>this.columns.filter(o=>t?c(o.getColumnKey())===c(`${e}`):o.getColumnKey()===e);this.getValues=()=>{let e=this.data.filter((o,s)=>s>this.headerRowIndex);if(b(e))return[[]];let t=[];for(let o=0;o<e.length;o++){let s=[];for(let a=0;a<this.data[this.headerRowIndex].length;a++)P(this.data[this.headerRowIndex][a])||s.push(this.parseValue(e[o][a]));t.push(s)}return t};this.getData=()=>this.data;this.getName=()=>this.name;this.getDisplayName=({t:e})=>{if(this.getName()?.length>0)return this.getName();switch(this.spreadSheet.getType()){case"json":return`${e("txt_default_sheet_prefix_name")} 1`;case"csv":return`${e("txt_default_sheet_prefix_name")} 1`;default:return""}};this.getSheetFileName=()=>`${this.spreadSheet.getFilename()}`;this.getIsManualSelectHeader=()=>this.isManualSelectHeader;this.setIsManualSelectHeader=()=>{this.isManualSelectHeader=!0};this.clearIsManualSelectHeader=()=>{this.isManualSelectHeader=!1};this.getDataAsResults=()=>{let e=[],t=this.getColumnsWithRemoved(),o=this.data.filter((s,a)=>a>this.headerRowIndex);for(let s=0;s<o.length;s++){let a=o[s];e[s]={};for(let r=0;r<t.length;r++){let n=a?.[r];if(!b(n)&&!P(n)){let i=t[r].getColumnKey();e[s][i]=this.parseValue(n)}}}return e};this.addColumn=e=>{this.columns.push(new g({columnKey:`${e}`,sheet:this,rows:this.getRowsByColumnIndex(this.getColumnIndex(e))}))};this.removeColumn=e=>{this.columns.find(t=>t.getColumnKey()===e)?.remove()};this.removeColumnByIndex=e=>{this.columns.find((t,o)=>o===e)?.remove()};this.setData=e=>{this.data=e};this.toJSON=()=>({name:this.name,id:this.id,type:this.getType(),values:this.getValues(),headerRow:this.getHeaderRow()});this.equal=e=>this.id===e.getId();this.getType=()=>0;this.getRowsByColumnIndex=e=>{if(e===-1)return[];let t=[];for(let o=0;o<this.data.length;o++){let s=this.data[o];if(o>this.headerRowIndex){let a=s[e]??"";t.push(this.parseValue(a))}}return t};this.setColumns=()=>{let e=this.data[this.headerRowIndex];if(e){let t=[];for(let o=0;o<e.length;++o){let s=e[o];s&&t.push(new g({columnKey:`${s}`,sheet:this,rows:this.getRowsByColumnIndex(o)}))}this.columns=t}else this.columns=[]};this.getColumnIndex=e=>this.data[this.headerRowIndex].findIndex(s=>Y(`${s}`,`${e}`));this.parseValue=e=>typeof e=="string"?e.trim():e;this.data=e,this.name=t,typeof s>"u"?(K++,this.id=`${t}-${K}`):this.id=s,o||this.setColumns(),this.modifiedData=this.getDataAsResults()}getModifiedData(){return this.modifiedData}mergedModifiedData(e){let t=[],o=this.getColumns();for(let s=0;s<o.length;s++){let a=o[s],r=[];if(!a.isRemoved()){for(let n=0;n<e.length;n++){t[n]||(t[n]=[]);let i=e[n][s];t[n][s]=i,r[n]=i}a.setRows(r)}}this.setData(t)}},L=N;var V=class extends L{constructor({joinedData:t,sheets:o,mappings:s,mappingIndexes:a}){super({data:t.data,name:"join-sheet",isNotSetColumn:!0});this.sheets=[];this.joinHistory=[];this.findRefJoinSheetColumn=t=>{let o=this.sheets.length===2?this.sheets[0]:this,s=this.sheets[this.sheets.length-1];if(t<o.getColumns().length)return o.getColumns()[t];let a=t-o.getColumns().length;return s.getColumns().filter((r,n)=>this.joinHistory[this.joinHistory.length-1].mappingIndexes.every(i=>i.target!==n))[a]};this.setJoinColumns=(t,o)=>{let s=this.data[this.headerRowIndex];if(!s){this.columns=[];return}let a=[];for(let r=0;r<s.length;++r){let n=s[r],i=o.findIndex(u=>u.source===r),h=this.columns[r]&&this.columns[r].getType()===1;if(i>=0||h){let u=t[i],m;h&&i>=0?m=[...this.columns[r].getJoinedSheetColumns(),u.target]:h?m=this.columns[r].getJoinedSheetColumns():m=[u.source.getRefJoinSheetColum()??u.source,u.target],a.push(new T({columnKey:`${n}`,sheetColumns:m,sheet:this,rows:this.getRowsByColumnIndex(r)}))}else{let u=this.columns[r]?this.columns[r].getRefJoinSheetColum()??this.columns[r]:this.findRefJoinSheetColumn(r);a.push(new g({columnKey:`${n}`,sheet:u.getSheet(),rows:this.getRowsByColumnIndex(r),refJoinSheetColum:u}))}}this.columns=a};this.getJoinedSheets=()=>this.sheets;this.getType=()=>1;this.joinSheet=(t,o,s,a)=>{this.setData(t.data),this.sheets.push(o),this.joinHistory.push({mappingIndexes:a,type:t.type,row:t.data.length,col:this.data[this.headerRowIndex]?.length??0}),this.setJoinColumns(s,a)};this.getJoinColumns=()=>this.columns.filter(t=>t.getType()===1);this.getJoinHistory=()=>this.joinHistory;this.headerRowIndex=0,this.joinHistory.push({mappingIndexes:a,type:t.type,row:t.data.length,col:this.data[this.headerRowIndex]?.length??0}),this.sheets=o,this.setJoinColumns(s,a)}},Ne=V;var z=({rowA:l,rowB:e},t)=>t.every(o=>{let s=`${l[o.source]??""}`,a=`${e[o.target]??""}`;return s===a&&s!==""&&a!==""}),Z=(l,e,t)=>{let o=[],s=l.headerRow,a=e.headerRow;for(let r=0;r<s.length;++r)o.push(s[r]);for(let r=0;r<a.length;++r)t.every(n=>n.target!==r)&&o.push(a[r]);return o},Fe=async(l,e)=>{let t=l.values,o=e.values,s=l.headerRow,a=e.headerRow,r=[...s,...a],n=[];n.push(r);for(let i=0;i<t.length;++i)n.push([...t[i],...o[0]]);return{data:n,type:"ADD_TO_ALL_ROWS"}},Je=async(l,e)=>{let t=l.values,o=e.values,s=l.headerRow,a=e.headerRow,r=[...s,...a],n=[];n.push(r);for(let i=0;i<t.length;++i)n.push([...t[i],...a.map(()=>"")]);for(let i=0;i<o.length;++i)n.push([...s.map(()=>""),...o[i]]);return{data:n,type:"JOIN_WITHOUT_COLUMNS"}},Te=async(l,e,t)=>{let o=l.values,s=e.values,a=[],r=[],n={},i=Z(l,e,t);a.push(i);for(let h=0;h<o.length;++h){let u=!1,m=o[h];for(let d=0;d<s.length;++d){let p=s[d];z({rowA:m,rowB:p},t)&&(n[d]=!0,u=!0,a.push([...m,...p.filter((C,$)=>t.every(U=>U.target!==$))]))}u||r.push([...m,...e.headerRow.filter((d,p)=>t.every(C=>C.target!==p)).map(()=>"")])}for(let h=0;h<s.length;++h){if(n[h])continue;let u=s[h],m=l.headerRow.map(()=>"");t.forEach(d=>{m[d.source]=u[d.target]}),r.push([...m,...u.filter((d,p)=>t.every(C=>C.target!==p))])}return r.forEach(h=>{a.push(h)}),{data:a,type:"JOIN_ON_COLUMNS"}},_e=async(l,e,t)=>{let o=e.headerRow.filter((n,i)=>t.every(h=>h.target!==i)),a=[[...l.headerRow,...o]];for(let n=0;n<l.values.length;++n){let i=[...l.values[n],...o.map(()=>"")];a.push(i)}let r=e.values;for(let n=0;n<r.length;++n){let i=l.headerRow.map(()=>""),h=[];for(let u=0;u<e.headerRow.length;++u){let m=t.find(d=>d.target===u);m?i[m.source]=r[n][u]:h.push(r[n][u])}a.push([...i,...h])}return{data:a,type:"APPEND_TO_COLUMNS"}},Ae=async(l,e,t)=>{let o=l.values,s=e.values,a=o.length+s.length,r=0,n={};for(let i=0;i<o.length;i++){let h=o[i],u=null,m=0;for(let d=0;d<s.length;d++){let p=s[d];if(z({rowA:h,rowB:p},t)&&(u=d,m++,m===2))break}m===1&&u!==null&&(r+=1,n[u]=!0)}for(let i=0;i<s.length;i++)n[i]&&(r+=1);return{count:r,total:a}};var R=class{constructor({sheetColumn:e,matchedDataModel:t,detectedNumberFormats:o}){this.getOptionValue=(e,t)=>{if(!t)if(this.matchedDataModel.dataModel){let o=this.sheetColumn.columnKey,a=this.detectedNumberFormats.columns.find(r=>r.column===o)?.numberFormat||this.detectedNumberFormats.global;return M.parse(e,{dataModel:this.matchedDataModel.dataModel,isParseFromSheet:!0,numberFormat:a})}else return e;for(let o=0;o<t.length;o++)if(`${t[o]?.sheetOption}`==`${e}`)return this.matchedDataModel.dataModel&&this.matchedDataModel.dataModel.getIsMultiSelection()?M.parse(t[o]?.dataModelOptions,{dataModel:this.matchedDataModel.dataModel,isParseFromSheet:!0}):this.matchedDataModel.dataModel?M.parse(t[o]?.dataModelOption,{dataModel:this.matchedDataModel.dataModel,isParseFromSheet:!0}):t[o]?.dataModelOption};this.getValues=()=>{let e=this.sheetColumn.rows,t=[];for(let o=0;o<e.length;o++){let s=e[o];t.push(this.getOptionValue(s,this.matchedOptions))}return t};if(this.sheetColumn=e,this.matchedDataModel=t,this.matchedOptions=void 0,this.detectedNumberFormats=o||{global:"eu",columns:[]},this.matchedDataModel.matchedOptions){this.matchedOptions=[];for(let s=0;s<(this.matchedDataModel.matchedOptions?.length??0);s++)this.matchedDataModel.dataModel?.getIsMultiSelection()?this.matchedDataModel.matchedOptions?.[s].dataModelOptions&&this.matchedOptions.push(this.matchedDataModel.matchedOptions?.[s]):this.matchedDataModel.matchedOptions?.[s].dataModelOption&&this.matchedOptions.push(this.matchedDataModel.matchedOptions?.[s])}}},B=R;var O=class{constructor(e){this.matchedColumns=[];this.parseValues=()=>{let e=[];this.matchedColumns.forEach(t=>{let o=t.matchedDataModel,a=new B({sheetColumn:t.sheetColumn,matchedDataModel:o,detectedNumberFormats:this.detectedNumberFormats}).getValues(),r=o.dataModel.getKey();a.forEach((n,i)=>{e[i]?e[i][r]=n:e[i]={[r]:n}})});for(let t=0;t<e.length;++t)for(let o=0;o<this.columns.length;++o){let a=this.columns[o].key;e[t][a]===void 0&&(e[t][a]=null)}return e};this.getValues=()=>(this.matchedColumns=[],this.matching.filter(t=>t.matchedDataModel?.dataModel).forEach(t=>{this.matchedColumns.push({sheetColumn:t.sheetColumn,matchedDataModel:t.matchedDataModel})}),this.parseValues());let{matching:t,detectedNumberFormats:o}=e;this.matching=t,this.detectedNumberFormats=o||{global:"eu",columns:[]},this.columns=e.columns??[]}},j=O;var qe=({matching:l,detectedNumberFormats:e,columns:t})=>new j({matching:l,detectedNumberFormats:e,columns:t}).getValues();import*as E from"comlink";var f=class{static{this.serialize=e=>e.serialize()}static{this.deSerialize=e=>y.isTypeCategory(e.type)?new F({description:e.description,example:e.example,key:e.key,label:e.label,type:e.type,options:e.options,validators:[],alternativeMatches:e.alternativeMatches,columnSize:e.columnSize,isMultiSelection:e.isMultiSelection??!1,allowCustomOptions:e.allowCustomOptions||!1,hidden:e.hidden,disabled:e.disabled,optionMappingConfiguration:e.optionMappingConfiguration}):new y({description:e.description,example:e.example,key:e.key,label:e.label,type:e.type,validators:[],alternativeMatches:e.alternativeMatches,columnSize:e.columnSize,outputFormat:e.outputFormat,numberFormat:e.numberFormat,hidden:e.hidden,disabled:e.disabled,optionMappingConfiguration:e.optionMappingConfiguration})}};var S=class{static{this.serialize=e=>{let t={matching:[],detectedNumberFormats:e.detectedNumberFormats,columns:e.columns};return t.matching=e.matching.map(o=>({sheetColumn:o.sheetColumn,matchedDataModel:o.matchedDataModel?{dataModel:o.matchedDataModel.dataModel?f.serialize(o.matchedDataModel.dataModel):o.matchedDataModel.dataModel,matchedOptions:o.matchedDataModel.matchedOptions}:o.matchedDataModel})),[t,[]]}}static{this.deserialize=e=>({matching:e.matching.map(t=>({sheetColumn:t.sheetColumn,matchedDataModel:t.matchedDataModel?{dataModel:t.matchedDataModel.dataModel?f.deSerialize(t.matchedDataModel.dataModel):t.matchedDataModel.dataModel,matchedOptions:t.matchedDataModel.matchedOptions}:t.matchedDataModel})),detectedNumberFormats:e.detectedNumberFormats,columns:e.columns})}};E.transferHandlers.set("Matching",{canHandle:l=>!!(typeof l=="object"&&l.matching),serialize:l=>S.serialize(l),deserialize:l=>S.deserialize(l)});export{g as a,H as b,L as c,Ne as d,Fe as e,Je as f,Te as g,_e as h,Ae as i,qe as j,f as k};
@@ -0,0 +1 @@
1
+ import{a as N}from"./chunk-INNZ66AJ.js";import{q as C,r as u,u as I}from"./chunk-JEZAW3BC.js";import{isNil as _}from"lodash";var E=[{label:"AFN",value:"AFN",type:"string",alternativeMatches:["Af","Afghanistan"]},{label:"ARS",value:"ARS",type:"string",alternativeMatches:["AR$","Argentina"]},{label:"AWG",value:"AWG",type:"string",alternativeMatches:["Aruba"]},{label:"AUD",value:"AUD",type:"string",alternativeMatches:["AU$","Australia"]},{label:"AZN",value:"AZN",type:"string",alternativeMatches:["man.","Azerbaijan"]},{label:"BSD",value:"BSD",type:"string",alternativeMatches:["Bahamas"]},{label:"BBD",value:"BBD",type:"string",alternativeMatches:["Barbados"]},{label:"BYN",value:"BYN",type:"string",alternativeMatches:["Br"]},{label:"BZD",value:"BZD",type:"string",alternativeMatches:["BZ$","Belize"]},{label:"BMD",value:"BMD",type:"string",alternativeMatches:["Bermuda"]},{label:"BOB",value:"BOB",type:"string",alternativeMatches:["Bs","Bolivia"]},{label:"BAM",value:"BAM",type:"string",alternativeMatches:["KM","Bosnia and Herzegovina"]},{label:"BWP",value:"BWP",type:"string",alternativeMatches:["BWP","Botswana"]},{label:"BGN",value:"BGN",type:"string",alternativeMatches:["BGN","Bulgaria"]},{label:"BRL",value:"BRL",type:"string",alternativeMatches:["R$","Brazil"]},{label:"BND",value:"BND",type:"string",alternativeMatches:["BN$","Brunei"]},{label:"KHR",value:"KHR",type:"string",alternativeMatches:["KHR","Cambodia"]},{label:"CAD",value:"CAD",type:"string",alternativeMatches:["CA$","Canada"]},{label:"KYD",value:"KYD",type:"string",alternativeMatches:["Cayman Islands"]},{label:"CLP",value:"CLP",type:"string",alternativeMatches:["CL$","Chile"]},{label:"CNY",value:"CNY",type:"string",alternativeMatches:["CN\xA5","China"]},{label:"COP",value:"COP",type:"string",alternativeMatches:["CO$","Colombia"]},{label:"CRC",value:"CRC",type:"string",alternativeMatches:["\u20A1","Costa Rica"]},{label:"HRK",value:"HRK",type:"string",alternativeMatches:["kn","Croatia"]},{label:"CUP",value:"CUP",type:"string",alternativeMatches:["Cuba"]},{label:"CZK",value:"CZK",type:"string",alternativeMatches:["K\u010D","Czech Republic"]},{label:"DKK",value:"DKK",type:"string",alternativeMatches:["Dkr","Denmark"]},{label:"DOP",value:"DOP",type:"string",alternativeMatches:["RD$","Dominican Republic"]},{label:"XCD",value:"XCD",type:"string",alternativeMatches:["Anguilla"]},{label:"EGP",value:"EGP",type:"string",alternativeMatches:["EGP","Egypt"]},{label:"SVC",value:"SVC",type:"string",alternativeMatches:["El Salvador"]},{label:"EUR",value:"EUR",type:"string",alternativeMatches:["\u20AC","Germany"]},{label:"FKP",value:"FKP",type:"string",alternativeMatches:["Falkland Islands"]},{label:"FJD",value:"FJD",type:"string",alternativeMatches:["Fiji Islands"]},{label:"GHS",value:"GHS",type:"string",alternativeMatches:["GH\u20B5","Ghana"]},{label:"GIP",value:"GIP",type:"string",alternativeMatches:["Gibraltar"]},{label:"GTQ",value:"GTQ",type:"string",alternativeMatches:["GTQ"]},{label:"GGP",value:"GGP",type:"string",alternativeMatches:[]},{label:"GYD",value:"GYD",type:"string",alternativeMatches:["Guyana"]},{label:"HNL",value:"HNL",type:"string",alternativeMatches:["HNL","Honduras"]},{label:"HKD",value:"HKD",type:"string",alternativeMatches:["HK$","Hong Kong"]},{label:"HUF",value:"HUF",type:"string",alternativeMatches:["Ft","Hungary"]},{label:"ISK",value:"ISK",type:"string",alternativeMatches:["Ikr","Iceland"]},{label:"INR",value:"INR",type:"string",alternativeMatches:["\u20B9","India"]},{label:"IDR",value:"IDR",type:"string",alternativeMatches:["Rp","Indonesia"]},{label:"IRR",value:"IRR",type:"string",alternativeMatches:["IRR","Iran"]},{label:"IMP",value:"IMP",type:"string",alternativeMatches:[]},{label:"ILS",value:"ILS",type:"string",alternativeMatches:["\u20AA","Israel"]},{label:"JMD",value:"JMD",type:"string",alternativeMatches:["J$","Jamaica"]},{label:"JPY",value:"JPY",type:"string",alternativeMatches:["\xA5","Japan"]},{label:"JEP",value:"JEP",type:"string",alternativeMatches:[]},{label:"KZT",value:"KZT",type:"string",alternativeMatches:["KZT","Kazakhstan"]},{label:"KPW",value:"KPW",type:"string",alternativeMatches:["North Korea"]},{label:"KRW",value:"KRW",type:"string",alternativeMatches:["\u20A9","South Korea"]},{label:"KGS",value:"KGS",type:"string",alternativeMatches:["Kyrgyzstan"]},{label:"LAK",value:"LAK",type:"string",alternativeMatches:["Laos"]},{label:"LBP",value:"LBP",type:"string",alternativeMatches:["L.L.","Lebanon"]},{label:"LRD",value:"LRD",type:"string",alternativeMatches:["Liberia"]},{label:"MKD",value:"MKD",type:"string",alternativeMatches:["MKD","North Macedonia"]},{label:"MYR",value:"MYR",type:"string",alternativeMatches:["RM","Malaysia"]},{label:"MUR",value:"MUR",type:"string",alternativeMatches:["MURs","Mauritius"]},{label:"MXN",value:"MXN",type:"string",alternativeMatches:["MX$","Mexico"]},{label:"MNT",value:"MNT",type:"string",alternativeMatches:["Mongolia"]},{label:"MZN",value:"MZN",type:"string",alternativeMatches:["MTn","Mozambique"]},{label:"NAD",value:"NAD",type:"string",alternativeMatches:["N$","Namibia"]},{label:"NPR",value:"NPR",type:"string",alternativeMatches:["NPRs","Nepal"]},{label:"ANG",value:"ANG",type:"string",alternativeMatches:["Netherlands Antilles"]},{label:"NZD",value:"NZD",type:"string",alternativeMatches:["NZ$","Cook Islands"]},{label:"NIO",value:"NIO",type:"string",alternativeMatches:["C$","Nicaragua"]},{label:"NGN",value:"NGN",type:"string",alternativeMatches:["\u20A6","Nigeria"]},{label:"NOK",value:"NOK",type:"string",alternativeMatches:["Nkr","Bouvet Island"]},{label:"OMR",value:"OMR",type:"string",alternativeMatches:["OMR","Oman"]},{label:"PKR",value:"PKR",type:"string",alternativeMatches:["PKRs","Pakistan"]},{label:"PAB",value:"PAB",type:"string",alternativeMatches:["B/.","Panama"]},{label:"PYG",value:"PYG",type:"string",alternativeMatches:["\u20B2","Paraguay"]},{label:"PEN",value:"PEN",type:"string",alternativeMatches:["S/.","Peru"]},{label:"PHP",value:"PHP",type:"string",alternativeMatches:["\u20B1","Philippines"]},{label:"PLN",value:"PLN",type:"string",alternativeMatches:["z\u0142","Poland"]},{label:"QAR",value:"QAR",type:"string",alternativeMatches:["QR","Qatar"]},{label:"RON",value:"RON",type:"string",alternativeMatches:["RON","Romania"]},{label:"RUB",value:"RUB",type:"string",alternativeMatches:["RUB","Russian Federation"]},{label:"SHP",value:"SHP",type:"string",alternativeMatches:["Saint Helena"]},{label:"SAR",value:"SAR",type:"string",alternativeMatches:["SR","Saudi Arabia"]},{label:"RSD",value:"RSD",type:"string",alternativeMatches:["din.","Serbia"]},{label:"SCR",value:"SCR",type:"string",alternativeMatches:["Seychelles"]},{label:"SGD",value:"SGD",type:"string",alternativeMatches:["S$","Singapore"]},{label:"SBD",value:"SBD",type:"string",alternativeMatches:["Solomon Islands"]},{label:"SOS",value:"SOS",type:"string",alternativeMatches:["Ssh","Somalia"]},{label:"ZAR",value:"ZAR",type:"string",alternativeMatches:["R","South Africa"]},{label:"LKR",value:"LKR",type:"string",alternativeMatches:["SLRs","Sri Lanka"]},{label:"SEK",value:"SEK",type:"string",alternativeMatches:["Skr","Sweden"]},{label:"CHF",value:"CHF",type:"string",alternativeMatches:["CHF","Liechtenstein"]},{label:"SRD",value:"SRD",type:"string",alternativeMatches:["Suriname"]},{label:"SYP",value:"SYP",type:"string",alternativeMatches:["SY\xA3","Syria"]},{label:"TWD",value:"TWD",type:"string",alternativeMatches:["NT$"]},{label:"THB",value:"THB",type:"string",alternativeMatches:["\u0E3F","Thailand"]},{label:"TTD",value:"TTD",type:"string",alternativeMatches:["TT$","Trinidad and Tobago"]},{label:"TRY",value:"TRY",type:"string",alternativeMatches:["TL","Turkey"]},{label:"TVD",value:"TVD",type:"string",alternativeMatches:[]},{label:"UAH",value:"UAH",type:"string",alternativeMatches:["\u20B4","Ukraine"]},{label:"GBP",value:"GBP",type:"string",alternativeMatches:["\xA3","England"]},{label:"USD",value:"USD",type:"string",alternativeMatches:["$","USA"]},{label:"UYU",value:"UYU",type:"string",alternativeMatches:["$U","Uruguay"]},{label:"UZS",value:"UZS",type:"string",alternativeMatches:["UZS","Uzbekistan"]},{label:"VEF",value:"VEF",type:"string",alternativeMatches:["Bs.F.","Venezuela"]},{label:"VND",value:"VND",type:"string",alternativeMatches:["\u20AB","Vietnam"]},{label:"YER",value:"YER",type:"string",alternativeMatches:["YR","Yemen"]},{label:"ZWD",value:"ZWD",type:"string",alternativeMatches:["Zimbabwe"]},{label:"XOF",value:"XOF",type:"string",alternativeMatches:["CFA Franc","West Africa"]},{label:"BDT",value:"BDT",type:"string",alternativeMatches:["\u09F3","Bangladesh"]},{label:"UGX",value:"UGX",type:"string",alternativeMatches:["USh","Uganda"]},{label:"KES",value:"KES",type:"string",alternativeMatches:["KSh","Kenya"]},{label:"LSL",value:"LSL",type:"string",alternativeMatches:["Loti","Lesotho"]},{label:"MWK",value:"MWK",type:"string",alternativeMatches:["K","Malawi"]},{label:"TZS",value:"TZS",type:"string",alternativeMatches:["TSh","Tanzania"]},{label:"ETB",value:"ETB",type:"string",alternativeMatches:["Br","Ethiopia"]},{label:"VEB",value:"VEB",type:"string",alternativeMatches:["Bs","Venezuela"]},{label:"XAF",value:"XAF",type:"string",alternativeMatches:["CFA Franc","Central Africa"]}],B=[{value:"AF",label:"AF",type:"string",alternativeMatches:["Afghanistan"]},{value:"AX",label:"AX",type:"string",alternativeMatches:["\xC5land Islands"]},{value:"AL",label:"AL",type:"string",alternativeMatches:["Albania"]},{value:"DZ",label:"DZ",type:"string",alternativeMatches:["Algeria"]},{value:"AS",label:"AS",type:"string",alternativeMatches:["American Samoa"]},{value:"AD",label:"AD",type:"string",alternativeMatches:["Andorra"]},{value:"AO",label:"AO",type:"string",alternativeMatches:["Angola"]},{value:"AI",label:"AI",type:"string",alternativeMatches:["Anguilla"]},{value:"AQ",label:"AQ",type:"string",alternativeMatches:["Antarctica"]},{value:"AG",label:"AG",type:"string",alternativeMatches:["Antigua and Barbuda","Antigua","Barbuda"]},{value:"AR",label:"AR",type:"string",alternativeMatches:["Argentina"]},{value:"AM",label:"AM",type:"string",alternativeMatches:["Armenia"]},{value:"AW",label:"AW",type:"string",alternativeMatches:["Aruba"]},{value:"AU",label:"AU",type:"string",alternativeMatches:["Australia"]},{value:"AT",label:"AT",type:"string",alternativeMatches:["Austria"]},{value:"AZ",label:"AZ",type:"string",alternativeMatches:["Azerbaijan"]},{value:"BS",label:"BS",type:"string",alternativeMatches:["Bahamas"]},{value:"BH",label:"BH",type:"string",alternativeMatches:["Bahrain"]},{value:"BD",label:"BD",type:"string",alternativeMatches:["Bangladesh"]},{value:"BB",label:"BB",type:"string",alternativeMatches:["Barbados"]},{value:"BY",label:"BY",type:"string",alternativeMatches:["Belarus"]},{value:"BE",label:"BE",type:"string",alternativeMatches:["Belgium"]},{value:"BZ",label:"BZ",type:"string",alternativeMatches:["Belize"]},{value:"BJ",label:"BJ",type:"string",alternativeMatches:["Benin"]},{value:"BM",label:"BM",type:"string",alternativeMatches:["Bermuda"]},{value:"BT",label:"BT",type:"string",alternativeMatches:["Bhutan"]},{value:"BO",label:"BO",type:"string",alternativeMatches:["Bolivia (Plurinational State of)","Bolivia"]},{value:"BQ",label:"BQ",type:"string",alternativeMatches:["Bonaire, Sint Eustatius and Saba"]},{value:"BA",label:"BA",type:"string",alternativeMatches:["Bosnia and Herzegovina"]},{value:"BW",label:"BW",type:"string",alternativeMatches:["Botswana"]},{value:"BV",label:"BV",type:"string",alternativeMatches:["Bouvet Island"]},{value:"BR",label:"BR",type:"string",alternativeMatches:["Brazil"]},{value:"IO",label:"IO",type:"string",alternativeMatches:["British Indian Ocean Territory"]},{value:"BN",label:"BN",type:"string",alternativeMatches:["Brunei Darussalam"]},{value:"BG",label:"BG",type:"string",alternativeMatches:["Bulgaria"]},{value:"BF",label:"BF",type:"string",alternativeMatches:["Burkina Faso"]},{value:"BI",label:"BI",type:"string",alternativeMatches:["Burundi"]},{value:"KH",label:"KH",type:"string",alternativeMatches:["Cambodia"]},{value:"CM",label:"CM",type:"string",alternativeMatches:["Cameroon"]},{value:"CA",label:"CA",type:"string",alternativeMatches:["Canada"]},{value:"CV",label:"CV",type:"string",alternativeMatches:["Cape Verde"]},{value:"KY",label:"KY",type:"string",alternativeMatches:["Cayman Islands"]},{value:"CF",label:"CF",type:"string",alternativeMatches:["Central African Republic"]},{value:"TD",label:"TD",type:"string",alternativeMatches:["Chad"]},{value:"CL",label:"CL",type:"string",alternativeMatches:["Chile"]},{value:"CN",label:"CN",type:"string",alternativeMatches:["China"]},{value:"CX",label:"CX",type:"string",alternativeMatches:["Christmas Island"]},{value:"CC",label:"CC",type:"string",alternativeMatches:["Cocos (Keeling) Islands","Cocos Islands"]},{value:"CO",label:"CO",type:"string",alternativeMatches:["Colombia"]},{value:"KM",label:"KM",type:"string",alternativeMatches:["Comoros"]},{value:"CG",label:"CG",type:"string",alternativeMatches:["Congo"]},{value:"CD",label:"CD",type:"string",alternativeMatches:["Congo (the Democratic Republic of the)","Congo"]},{value:"CK",label:"CK",type:"string",alternativeMatches:["Cook Islands"]},{value:"CR",label:"CR",type:"string",alternativeMatches:["Costa Rica"]},{value:"CI",label:"CI",type:"string",alternativeMatches:["C\xF4te d'Ivoire","Cote d Ivoire"]},{value:"HR",label:"HR",type:"string",alternativeMatches:["Croatia"]},{value:"CU",label:"CU",type:"string",alternativeMatches:["Cuba"]},{value:"CW",label:"CW",type:"string",alternativeMatches:["Cura\xE7ao","Curacao"]},{value:"CY",label:"CY",type:"string",alternativeMatches:["Cyprus"]},{value:"CZ",label:"CZ",type:"string",alternativeMatches:["Czechia","Czech Republic"]},{value:"DK",label:"DK",type:"string",alternativeMatches:["Denmark"]},{value:"DJ",label:"DJ",type:"string",alternativeMatches:["Djibouti"]},{value:"DM",label:"DM",type:"string",alternativeMatches:["Dominica"]},{value:"DO",label:"DO",type:"string",alternativeMatches:["Dominican Republic"]},{value:"EC",label:"EC",type:"string",alternativeMatches:["Ecuador"]},{value:"EG",label:"EG",type:"string",alternativeMatches:["Egypt"]},{value:"SV",label:"SV",type:"string",alternativeMatches:["El Salvador"]},{value:"GQ",label:"GQ",type:"string",alternativeMatches:["Equatorial Guinea"]},{value:"ER",label:"ER",type:"string",alternativeMatches:["Eritrea"]},{value:"EE",label:"EE",type:"string",alternativeMatches:["Estonia"]},{value:"ET",label:"ET",type:"string",alternativeMatches:["Ethiopia"]},{value:"FK",label:"FK",type:"string",alternativeMatches:["Falkland Islands (Malvinas)"]},{value:"FO",label:"FO",type:"string",alternativeMatches:["Faroe Islands"]},{value:"FJ",label:"FJ",type:"string",alternativeMatches:["Fiji"]},{value:"FI",label:"FI",type:"string",alternativeMatches:["Finland"]},{value:"FR",label:"FR",type:"string",alternativeMatches:["France"]},{value:"GF",label:"GF",type:"string",alternativeMatches:["French Guiana"]},{value:"PF",label:"PF",type:"string",alternativeMatches:["French Polynesia"]},{value:"TF",label:"TF",type:"string",alternativeMatches:["French Southern Territories"]},{value:"GA",label:"GA",type:"string",alternativeMatches:["Gabon"]},{value:"GM",label:"GM",type:"string",alternativeMatches:["Gambia"]},{value:"GE",label:"GE",type:"string",alternativeMatches:["Georgia"]},{value:"DE",label:"DE",type:"string",alternativeMatches:["Germany"]},{value:"GH",label:"GH",type:"string",alternativeMatches:["Ghana"]},{value:"GI",label:"GI",type:"string",alternativeMatches:["Gibraltar"]},{value:"GR",label:"GR",type:"string",alternativeMatches:["Greece"]},{value:"GL",label:"GL",type:"string",alternativeMatches:["Greenland"]},{value:"GD",label:"GD",type:"string",alternativeMatches:["Grenada"]},{value:"GP",label:"GP",type:"string",alternativeMatches:["Guadeloupe"]},{value:"GU",label:"GU",type:"string",alternativeMatches:["Guam"]},{value:"GT",label:"GT",type:"string",alternativeMatches:["Guatemala"]},{value:"GG",label:"GG",type:"string",alternativeMatches:["Guernsey"]},{value:"GN",label:"GN",type:"string",alternativeMatches:["Guinea"]},{value:"GW",label:"GW",type:"string",alternativeMatches:["Guinea-Bissau"]},{value:"GY",label:"GY",type:"string",alternativeMatches:["Guyana"]},{value:"HT",label:"HT",type:"string",alternativeMatches:["Haiti"]},{value:"HM",label:"HM",type:"string",alternativeMatches:["Heard Island and McDonald Islands","Heard Island","McDonald Islands"]},{value:"VA",label:"VA",type:"string",alternativeMatches:["Holy See (Vatican City State)"]},{value:"HN",label:"HN",type:"string",alternativeMatches:["Honduras"]},{value:"HK",label:"HK",type:"string",alternativeMatches:["Hong Kong"]},{value:"HU",label:"HU",type:"string",alternativeMatches:["Hungary"]},{value:"IS",label:"IS",type:"string",alternativeMatches:["Iceland"]},{value:"IN",label:"IN",type:"string",alternativeMatches:["India"]},{value:"ID",label:"ID",type:"string",alternativeMatches:["Indonesia"]},{value:"IR",label:"IR",type:"string",alternativeMatches:["Iran (Islamic Republic of) ","Iran"]},{value:"IQ",label:"IQ",type:"string",alternativeMatches:["Iraq"]},{value:"IE",label:"IE",type:"string",alternativeMatches:["Ireland"]},{value:"IM",label:"IM",type:"string",alternativeMatches:["Isle of Man"]},{value:"IL",label:"IL",type:"string",alternativeMatches:["Israel"]},{value:"IT",label:"IT",type:"string",alternativeMatches:["Italy"]},{value:"JM",label:"JM",type:"string",alternativeMatches:["Jamaica"]},{value:"JP",label:"JP",type:"string",alternativeMatches:["Japan"]},{value:"JE",label:"JE",type:"string",alternativeMatches:["Jersey"]},{value:"JO",label:"JO",type:"string",alternativeMatches:["Jordan"]},{value:"KZ",label:"KZ",type:"string",alternativeMatches:["Kazakhstan"]},{value:"KE",label:"KE",type:"string",alternativeMatches:["Kenya"]},{value:"KI",label:"KI",type:"string",alternativeMatches:["Kiribati"]},{value:"KP",label:"KP",type:"string",alternativeMatches:["Democratic People's Republic of Korea","North Korea"]},{value:"KR",label:"KR",type:"string",alternativeMatches:["Korea, Republic of Korea","South Korea"]},{value:"KW",label:"KW",type:"string",alternativeMatches:["Kuwait"]},{value:"KG",label:"KG",type:"string",alternativeMatches:["Kyrgyzstan"]},{value:"LA",label:"LA",type:"string",alternativeMatches:["Lao People's Democratic Republic"]},{value:"LV",label:"LV",type:"string",alternativeMatches:["Latvia"]},{value:"LB",label:"LB",type:"string",alternativeMatches:["Lebanon"]},{value:"LS",label:"LS",type:"string",alternativeMatches:["Lesotho"]},{value:"LR",label:"LR",type:"string",alternativeMatches:["Liberia"]},{value:"LY",label:"LY",type:"string",alternativeMatches:["Libya"]},{value:"LI",label:"LI",type:"string",alternativeMatches:["Liechtenstein"]},{value:"LT",label:"LT",type:"string",alternativeMatches:["Lithuania"]},{value:"LU",label:"LU",type:"string",alternativeMatches:["Luxembourg"]},{value:"MO",label:"MO",type:"string",alternativeMatches:["Macao"]},{value:"MK",label:"MK",type:"string",alternativeMatches:["Republic of North Macedonia","North Macedonia"]},{value:"MG",label:"MG",type:"string",alternativeMatches:["Madagascar"]},{value:"MW",label:"MW",type:"string",alternativeMatches:["Malawi"]},{value:"MY",label:"MY",type:"string",alternativeMatches:["Malaysia"]},{value:"MV",label:"MV",type:"string",alternativeMatches:["Maldives"]},{value:"ML",label:"ML",type:"string",alternativeMatches:["Mali"]},{value:"MT",label:"MT",type:"string",alternativeMatches:["Malta"]},{value:"MH",label:"MH",type:"string",alternativeMatches:["Marshall Islands"]},{value:"MQ",label:"MQ",type:"string",alternativeMatches:["Martinique"]},{value:"MR",label:"MR",type:"string",alternativeMatches:["Mauritania"]},{value:"MU",label:"MU",type:"string",alternativeMatches:["Mauritius"]},{value:"YT",label:"YT",type:"string",alternativeMatches:["Mayotte"]},{value:"MX",label:"MX",type:"string",alternativeMatches:["Mexico"]},{value:"FM",label:"FM",type:"string",alternativeMatches:["Micronesia (Federated States of)"]},{value:"MD",label:"MD",type:"string",alternativeMatches:["Moldova (the Republic of)"]},{value:"MC",label:"MC",type:"string",alternativeMatches:["Monaco"]},{value:"MN",label:"MN",type:"string",alternativeMatches:["Mongolia"]},{value:"ME",label:"ME",type:"string",alternativeMatches:["Montenegro"]},{value:"MS",label:"MS",type:"string",alternativeMatches:["Montserrat"]},{value:"MA",label:"MA",type:"string",alternativeMatches:["Morocco"]},{value:"MZ",label:"MZ",type:"string",alternativeMatches:["Mozambique"]},{value:"MM",label:"MM",type:"string",alternativeMatches:["Myanmar"]},{value:"NA",label:"NA",type:"string",alternativeMatches:["Namibia"]},{value:"NR",label:"NR",type:"string",alternativeMatches:["Nauru"]},{value:"NP",label:"NP",type:"string",alternativeMatches:["Nepal"]},{value:"NL",label:"NL",type:"string",alternativeMatches:["Netherlands"]},{value:"NC",label:"NC",type:"string",alternativeMatches:["New Caledonia"]},{value:"NZ",label:"NZ",type:"string",alternativeMatches:["New Zealand"]},{value:"NI",label:"NI",type:"string",alternativeMatches:["Nicaragua"]},{value:"NE",label:"NE",type:"string",alternativeMatches:["Niger"]},{value:"NG",label:"NG",type:"string",alternativeMatches:["Nigeria"]},{value:"NU",label:"NU",type:"string",alternativeMatches:["Niue"]},{value:"NF",label:"NF",type:"string",alternativeMatches:["Norfolk Island"]},{value:"MP",label:"MP",type:"string",alternativeMatches:["Northern Mariana Islands"]},{value:"NO",label:"NO",type:"string",alternativeMatches:["Norway"]},{value:"OM",label:"OM",type:"string",alternativeMatches:["Oman"]},{value:"PK",label:"PK",type:"string",alternativeMatches:["Pakistan"]},{value:"PW",label:"PW",type:"string",alternativeMatches:["Palau"]},{value:"PS",label:"PS",type:"string",alternativeMatches:["Palestinian Territory, Occupied"]},{value:"PA",label:"PA",type:"string",alternativeMatches:["Panama"]},{value:"PG",label:"PG",type:"string",alternativeMatches:["Papua New Guinea"]},{value:"PY",label:"PY",type:"string",alternativeMatches:["Paraguay"]},{value:"PE",label:"PE",type:"string",alternativeMatches:["Peru"]},{value:"PH",label:"PH",type:"string",alternativeMatches:["Philippines"]},{value:"PN",label:"PN",type:"string",alternativeMatches:["Pitcairn"]},{value:"PL",label:"PL",type:"string",alternativeMatches:["Poland"]},{value:"PT",label:"PT",type:"string",alternativeMatches:["Portugal"]},{value:"PR",label:"PR",type:"string",alternativeMatches:["Puerto Rico"]},{value:"QA",label:"QA",type:"string",alternativeMatches:["Qatar"]},{value:"RE",label:"RE",type:"string",alternativeMatches:["R\xE9union"]},{value:"RO",label:"RO",type:"string",alternativeMatches:["Romania"]},{value:"RU",label:"RU",type:"string",alternativeMatches:["Russian Federation"]},{value:"RW",label:"RW",type:"string",alternativeMatches:["Rwanda"]},{value:"BL",label:"BL",type:"string",alternativeMatches:["Saint Barth\xE9lemy"]},{value:"SH",label:"SH",type:"string",alternativeMatches:["Saint Helena, Ascension and Tristan da Cunha"]},{value:"KN",label:"KN",type:"string",alternativeMatches:["Saint Kitts and Nevis","Saint Kitts","Nevis"]},{value:"LC",label:"LC",type:"string",alternativeMatches:["Saint Lucia"]},{value:"MF",label:"MF",type:"string",alternativeMatches:["Saint Martin (French part)"]},{value:"PM",label:"PM",type:"string",alternativeMatches:["Saint Pierre and Miquelon","Saint Pierre","Miquelon"]},{value:"VC",label:"VC",type:"string",alternativeMatches:["Saint Vincent and the Grenadines","Saint Vincent","Grenadines"]},{value:"WS",label:"WS",type:"string",alternativeMatches:["Samoa"]},{value:"SM",label:"SM",type:"string",alternativeMatches:["San Marino"]},{value:"ST",label:"ST",type:"string",alternativeMatches:["Sao Tome and Principe","Sao Tome","Principe"]},{value:"SA",label:"SA",type:"string",alternativeMatches:["Saudi Arabia"]},{value:"SN",label:"SN",type:"string",alternativeMatches:["Senegal"]},{value:"RS",label:"RS",type:"string",alternativeMatches:["Serbia"]},{value:"SC",label:"SC",type:"string",alternativeMatches:["Seychelles"]},{value:"SL",label:"SL",type:"string",alternativeMatches:["Sierra Leone"]},{value:"SG",label:"SG",type:"string",alternativeMatches:["Singapore"]},{value:"SX",label:"SX",type:"string",alternativeMatches:["Sint Maarten"]},{value:"SK",label:"SK",type:"string",alternativeMatches:["Slovakia"]},{value:"SI",label:"SI",type:"string",alternativeMatches:["Slovenia"]},{value:"SB",label:"SB",type:"string",alternativeMatches:["Solomon Islands"]},{value:"SO",label:"SO",type:"string",alternativeMatches:["Somalia"]},{value:"ZA",label:"ZA",type:"string",alternativeMatches:["South Africa"]},{value:"GS",label:"GS",type:"string",alternativeMatches:["South Georgia and the South Sandwich Islands","South Georgia","South Sandwich Islands"]},{value:"SS",label:"SS",type:"string",alternativeMatches:["South Sudan"]},{value:"ES",label:"ES",type:"string",alternativeMatches:["Spain"]},{value:"LK",label:"LK",type:"string",alternativeMatches:["Sri Lanka"]},{value:"SD",label:"SD",type:"string",alternativeMatches:["Sudan"]},{value:"SR",label:"SR",type:"string",alternativeMatches:["Suriname"]},{value:"SJ",label:"SJ",type:"string",alternativeMatches:["Svalbard and Jan Mayen","Svalbard","Jan Mayen"]},{value:"SZ",label:"SZ",type:"string",alternativeMatches:["Swaziland","Eswatini"]},{value:"SE",label:"SE",type:"string",alternativeMatches:["Sweden"]},{value:"CH",label:"CH",type:"string",alternativeMatches:["Switzerland"]},{value:"SY",label:"SY",type:"string",alternativeMatches:["Syrian Arab Republic"]},{value:"TW",label:"TW",type:"string",alternativeMatches:["Taiwan, Province of China"]},{value:"TJ",label:"TJ",type:"string",alternativeMatches:["Tajikistan"]},{value:"TZ",label:"TZ",type:"string",alternativeMatches:["Tanzania, United Republic of","Tanzania"]},{value:"TH",label:"TH",type:"string",alternativeMatches:["Thailand"]},{value:"TL",label:"TL",type:"string",alternativeMatches:["Timor-Leste"]},{value:"TG",label:"TG",type:"string",alternativeMatches:["Togo"]},{value:"TK",label:"TK",type:"string",alternativeMatches:["Tokelau"]},{value:"TO",label:"TO",type:"string",alternativeMatches:["Tonga"]},{value:"TT",label:"TT",type:"string",alternativeMatches:["Trinidad and Tobago","Trinidad","Tobago"]},{value:"TN",label:"TN",type:"string",alternativeMatches:["Tunisia"]},{value:"TR",label:"TR",type:"string",alternativeMatches:["Turkey"]},{value:"TM",label:"TM",type:"string",alternativeMatches:["Turkmenistan"]},{value:"TC",label:"TC",type:"string",alternativeMatches:["Turks and Caicos Islands"]},{value:"TV",label:"TV",type:"string",alternativeMatches:["Tuvalu"]},{value:"UG",label:"UG",type:"string",alternativeMatches:["Uganda"]},{value:"UA",label:"UA",type:"string",alternativeMatches:["Ukraine"]},{value:"AE",label:"AE",type:"string",alternativeMatches:["United Arab Emirates","UAE"]},{value:"GB",label:"GB",type:"string",alternativeMatches:["United Kingdom"]},{value:"US",label:"US",type:"string",alternativeMatches:["United States"]},{value:"UM",label:"UM",type:"string",alternativeMatches:["United States Minor Outlying Islands"]},{value:"UY",label:"UY",type:"string",alternativeMatches:["Uruguay"]},{value:"UZ",label:"UZ",type:"string",alternativeMatches:["Uzbekistan"]},{value:"VU",label:"VU",type:"string",alternativeMatches:["Vanuatu"]},{value:"VE",label:"VE",type:"string",alternativeMatches:["Venezuela (Bolivarian Republic of)","Venezuela","Bolivarian"]},{value:"VN",label:"VN",type:"string",alternativeMatches:["Viet Nam"]},{value:"VG",label:"VG",type:"string",alternativeMatches:["Virgin Islands (British)","British"]},{value:"VI",label:"VI",type:"string",alternativeMatches:["Virgin Islands (U.S.)"]},{value:"WF",label:"WF",type:"string",alternativeMatches:["Wallis and Futuna"]},{value:"EH",label:"EH",type:"string",alternativeMatches:["Western Sahara"]},{value:"YE",label:"YE",type:"string",alternativeMatches:["Yemen"]},{value:"ZM",label:"ZM",type:"string",alternativeMatches:["Zambia"]},{value:"ZW",label:"ZW",type:"string",alternativeMatches:["Zimbabwe"]}],D=[{value:"AFG",label:"AFG",type:"string",alternativeMatches:["Afghanistan"]},{value:"ALA",label:"ALA",type:"string",alternativeMatches:["\xC5land Islands"]},{value:"ALB",label:"ALB",type:"string",alternativeMatches:["Albania"]},{value:"DZA",label:"DZA",type:"string",alternativeMatches:["Algeria"]},{value:"ASM",label:"ASM",type:"string",alternativeMatches:["American Samoa"]},{value:"AND",label:"AND",type:"string",alternativeMatches:["Andorra"]},{value:"AGO",label:"AGO",type:"string",alternativeMatches:["Angola"]},{value:"AIA",label:"AIA",type:"string",alternativeMatches:["Anguilla"]},{value:"ATA",label:"ATA",type:"string",alternativeMatches:["Antarctica"]},{value:"ATG",label:"ATG",type:"string",alternativeMatches:["Antigua and Barbuda","Antigua","Barbuda"]},{value:"ARG",label:"ARG",type:"string",alternativeMatches:["Argentina"]},{value:"ARM",label:"ARM",type:"string",alternativeMatches:["Armenia"]},{value:"ABW",label:"ABW",type:"string",alternativeMatches:["Aruba"]},{value:"AUS",label:"AUS",type:"string",alternativeMatches:["Australia"]},{value:"AUT",label:"AUT",type:"string",alternativeMatches:["Austria"]},{value:"AZE",label:"AZE",type:"string",alternativeMatches:["Azerbaijan"]},{value:"BHS",label:"BHS",type:"string",alternativeMatches:["Bahamas"]},{value:"BHR",label:"BHR",type:"string",alternativeMatches:["Bahrain"]},{value:"BGD",label:"BGD",type:"string",alternativeMatches:["Bangladesh"]},{value:"BRB",label:"BRB",type:"string",alternativeMatches:["Barbados"]},{value:"BLR",label:"BLR",type:"string",alternativeMatches:["Belarus"]},{value:"BEL",label:"BEL",type:"string",alternativeMatches:["Belgium"]},{value:"BLZ",label:"BLZ",type:"string",alternativeMatches:["Belize"]},{value:"BEN",label:"BEN",type:"string",alternativeMatches:["Benin"]},{value:"BMU",label:"BMU",type:"string",alternativeMatches:["Bermuda"]},{value:"BTN",label:"BTN",type:"string",alternativeMatches:["Bhutan"]},{value:"BOL",label:"BOL",type:"string",alternativeMatches:["Bolivia (Plurinational State of)","Bolivia"]},{value:"BES",label:"BES",type:"string",alternativeMatches:["Bonaire, Sint Eustatius and Saba"]},{value:"BIH",label:"BIH",type:"string",alternativeMatches:["Bosnia and Herzegovina"]},{value:"BWA",label:"BWA",type:"string",alternativeMatches:["Botswana"]},{value:"BVT",label:"BVT",type:"string",alternativeMatches:["Bouvet Island"]},{value:"BRA",label:"BRA",type:"string",alternativeMatches:["Brazil"]},{value:"IOT",label:"IOT",type:"string",alternativeMatches:["British Indian Ocean Territory"]},{value:"BRN",label:"BRN",type:"string",alternativeMatches:["Brunei Darussalam"]},{value:"BGR",label:"BGR",type:"string",alternativeMatches:["Bulgaria"]},{value:"BFA",label:"BFA",type:"string",alternativeMatches:["Burkina Faso"]},{value:"BDI",label:"BDI",type:"string",alternativeMatches:["Burundi"]},{value:"KHM",label:"KHM",type:"string",alternativeMatches:["Cambodia"]},{value:"CMR",label:"CMR",type:"string",alternativeMatches:["Cameroon"]},{value:"CAN",label:"CAN",type:"string",alternativeMatches:["Canada"]},{value:"CPV",label:"CPV",type:"string",alternativeMatches:["Cape Verde"]},{value:"CYM",label:"CYM",type:"string",alternativeMatches:["Cayman Islands"]},{value:"CAF",label:"CAF",type:"string",alternativeMatches:["Central African Republic"]},{value:"TCD",label:"TCD",type:"string",alternativeMatches:["Chad"]},{value:"CHL",label:"CHL",type:"string",alternativeMatches:["Chile"]},{value:"CHN",label:"CHN",type:"string",alternativeMatches:["China"]},{value:"CXR",label:"CXR",type:"string",alternativeMatches:["Christmas Island"]},{value:"CCK",label:"CCK",type:"string",alternativeMatches:["Cocos (Keeling) Islands"]},{value:"COL",label:"COL",type:"string",alternativeMatches:["Colombia"]},{value:"COM",label:"COM",type:"string",alternativeMatches:["Comoros"]},{value:"COG",label:"COG",type:"string",alternativeMatches:["Congo"]},{value:"COD",label:"COD",type:"string",alternativeMatches:["Congo (the Democratic Republic of the)"]},{value:"COK",label:"COK",type:"string",alternativeMatches:["Cook Islands"]},{value:"CRI",label:"CRI",type:"string",alternativeMatches:["Costa Rica"]},{value:"CIV",label:"CIV",type:"string",alternativeMatches:["C\xF4te d'Ivoire"]},{value:"HRV",label:"HRV",type:"string",alternativeMatches:["Croatia"]},{value:"CUB",label:"CUB",type:"string",alternativeMatches:["Cuba"]},{value:"CUW",label:"CUW",type:"string",alternativeMatches:["Cura\xE7ao"]},{value:"CYP",label:"CYP",type:"string",alternativeMatches:["Cyprus"]},{value:"CZE",label:"CZE",type:"string",alternativeMatches:["Czechia","Czech Republic"]},{value:"DNK",label:"DNK",type:"string",alternativeMatches:["Denmark"]},{value:"DJI",label:"DJI",type:"string",alternativeMatches:["Djibouti"]},{value:"DMA",label:"DMA",type:"string",alternativeMatches:["Dominica"]},{value:"DOM",label:"DOM",type:"string",alternativeMatches:["Dominican Republic"]},{value:"ECU",label:"ECU",type:"string",alternativeMatches:["Ecuador"]},{value:"EGY",label:"EGY",type:"string",alternativeMatches:["Egypt"]},{value:"SLV",label:"SLV",type:"string",alternativeMatches:["El Salvador"]},{value:"GNQ",label:"GNQ",type:"string",alternativeMatches:["Equatorial Guinea"]},{value:"ERI",label:"ERI",type:"string",alternativeMatches:["Eritrea"]},{value:"EST",label:"EST",type:"string",alternativeMatches:["Estonia"]},{value:"ETH",label:"ETH",type:"string",alternativeMatches:["Ethiopia"]},{value:"FLK",label:"FLK",type:"string",alternativeMatches:["Falkland Islands (Malvinas)"]},{value:"FRO",label:"FRO",type:"string",alternativeMatches:["Faroe Islands"]},{value:"FJI",label:"FJI",type:"string",alternativeMatches:["Fiji"]},{value:"FIN",label:"FIN",type:"string",alternativeMatches:["Finland"]},{value:"FRA",label:"FRA",type:"string",alternativeMatches:["France"]},{value:"GUF",label:"GUF",type:"string",alternativeMatches:["French Guiana"]},{value:"PYF",label:"PYF",type:"string",alternativeMatches:["French Polynesia"]},{value:"ATF",label:"ATF",type:"string",alternativeMatches:["French Southern Territories"]},{value:"GAB",label:"GAB",type:"string",alternativeMatches:["Gabon"]},{value:"GMB",label:"GMB",type:"string",alternativeMatches:["Gambia"]},{value:"GEO",label:"GEO",type:"string",alternativeMatches:["Georgia"]},{value:"DEU",label:"DEU",type:"string",alternativeMatches:["Germany"]},{value:"GHA",label:"GHA",type:"string",alternativeMatches:["Ghana"]},{value:"GIB",label:"GIB",type:"string",alternativeMatches:["Gibraltar"]},{value:"GRC",label:"GRC",type:"string",alternativeMatches:["Greece"]},{value:"GRL",label:"GRL",type:"string",alternativeMatches:["Greenland"]},{value:"GRD",label:"GRD",type:"string",alternativeMatches:["Grenada"]},{value:"GLP",label:"GLP",type:"string",alternativeMatches:["Guadeloupe"]},{value:"GUM",label:"GUM",type:"string",alternativeMatches:["Guam"]},{value:"GTM",label:"GTM",type:"string",alternativeMatches:["Guatemala"]},{value:"GGY",label:"GGY",type:"string",alternativeMatches:["Guernsey"]},{value:"GIN",label:"GIN",type:"string",alternativeMatches:["Guinea"]},{value:"GNB",label:"GNB",type:"string",alternativeMatches:["Guinea-Bissau"]},{value:"GUY",label:"GUY",type:"string",alternativeMatches:["Guyana"]},{value:"HTI",label:"HTI",type:"string",alternativeMatches:["Haiti"]},{value:"HMD",label:"HMD",type:"string",alternativeMatches:["Heard Island and McDonald Islands","Heard Island","McDonald Islands"]},{value:"VAT",label:"VAT",type:"string",alternativeMatches:["Holy See (Vatican City State)"]},{value:"HND",label:"HND",type:"string",alternativeMatches:["Honduras"]},{value:"HKG",label:"HKG",type:"string",alternativeMatches:["Hong Kong"]},{value:"HUN",label:"HUN",type:"string",alternativeMatches:["Hungary"]},{value:"ISL",label:"ISL",type:"string",alternativeMatches:["Iceland"]},{value:"IND",label:"IND",type:"string",alternativeMatches:["India"]},{value:"IDN",label:"IDN",type:"string",alternativeMatches:["Indonesia"]},{value:"IRN",label:"IRN",type:"string",alternativeMatches:["Iran (Islamic Republic of) ","Iran"]},{value:"IRQ",label:"IRQ",type:"string",alternativeMatches:["Iraq"]},{value:"IRL",label:"IRL",type:"string",alternativeMatches:["Ireland"]},{value:"IMN",label:"IMN",type:"string",alternativeMatches:["Isle of Man"]},{value:"ISR",label:"ISR",type:"string",alternativeMatches:["Israel"]},{value:"ITA",label:"ITA",type:"string",alternativeMatches:["Italy"]},{value:"JAM",label:"JAM",type:"string",alternativeMatches:["Jamaica"]},{value:"JPN",label:"JPN",type:"string",alternativeMatches:["Japan"]},{value:"JEY",label:"JEY",type:"string",alternativeMatches:["Jersey"]},{value:"JOR",label:"JOR",type:"string",alternativeMatches:["Jordan"]},{value:"KAZ",label:"KAZ",type:"string",alternativeMatches:["Kazakhstan"]},{value:"KEN",label:"KEN",type:"string",alternativeMatches:["Kenya"]},{value:"KIR",label:"KIR",type:"string",alternativeMatches:["Kiribati"]},{value:"PRK",label:"PRK",type:"string",alternativeMatches:["Democratic People's Republic of Korea","North Korea"]},{value:"KOR",label:"KOR",type:"string",alternativeMatches:["Korea, Republic of Korea","South Korea"]},{value:"KWT",label:"KWT",type:"string",alternativeMatches:["Kuwait"]},{value:"KGZ",label:"KGZ",type:"string",alternativeMatches:["Kyrgyzstan"]},{value:"LAO",label:"LAO",type:"string",alternativeMatches:["Lao People's Democratic Republic"]},{value:"LVA",label:"LVA",type:"string",alternativeMatches:["Latvia"]},{value:"LBN",label:"LBN",type:"string",alternativeMatches:["Lebanon"]},{value:"LSO",label:"LSO",type:"string",alternativeMatches:["Lesotho"]},{value:"LBR",label:"LBR",type:"string",alternativeMatches:["Liberia"]},{value:"LBY",label:"LBY",type:"string",alternativeMatches:["Libya"]},{value:"LIE",label:"LIE",type:"string",alternativeMatches:["Liechtenstein"]},{value:"LTU",label:"LTU",type:"string",alternativeMatches:["Lithuania"]},{value:"LUX",label:"LUX",type:"string",alternativeMatches:["Luxembourg"]},{value:"MAC",label:"MAC",type:"string",alternativeMatches:["Macao"]},{value:"MKD",label:"MKD",type:"string",alternativeMatches:["Republic of North Macedonia","North Macedonia"]},{value:"MDG",label:"MDG",type:"string",alternativeMatches:["Madagascar"]},{value:"MWI",label:"MWI",type:"string",alternativeMatches:["Malawi"]},{value:"MYS",label:"MYS",type:"string",alternativeMatches:["Malaysia"]},{value:"MDV",label:"MDV",type:"string",alternativeMatches:["Maldives"]},{value:"MLI",label:"MLI",type:"string",alternativeMatches:["Mali"]},{value:"MLT",label:"MLT",type:"string",alternativeMatches:["Malta"]},{value:"MHL",label:"MHL",type:"string",alternativeMatches:["Marshall Islands"]},{value:"MTQ",label:"MTQ",type:"string",alternativeMatches:["Martinique"]},{value:"MRT",label:"MRT",type:"string",alternativeMatches:["Mauritania"]},{value:"MUS",label:"MUS",type:"string",alternativeMatches:["Mauritius"]},{value:"MYT",label:"MYT",type:"string",alternativeMatches:["Mayotte"]},{value:"MEX",label:"MEX",type:"string",alternativeMatches:["Mexico"]},{value:"FSM",label:"FSM",type:"string",alternativeMatches:["Micronesia (Federated States of)"]},{value:"MDA",label:"MDA",type:"string",alternativeMatches:["Moldova (the Republic of)"]},{value:"MCO",label:"MCO",type:"string",alternativeMatches:["Monaco"]},{value:"MNG",label:"MNG",type:"string",alternativeMatches:["Mongolia"]},{value:"MNE",label:"MNE",type:"string",alternativeMatches:["Montenegro"]},{value:"MSR",label:"MSR",type:"string",alternativeMatches:["Montserrat"]},{value:"MAR",label:"MAR",type:"string",alternativeMatches:["Morocco"]},{value:"MOZ",label:"MOZ",type:"string",alternativeMatches:["Mozambique"]},{value:"MMR",label:"MMR",type:"string",alternativeMatches:["Myanmar"]},{value:"NAM",label:"NAM",type:"string",alternativeMatches:["Namibia"]},{value:"NRU",label:"NRU",type:"string",alternativeMatches:["Nauru"]},{value:"NPL",label:"NPL",type:"string",alternativeMatches:["Nepal"]},{value:"NLD",label:"NLD",type:"string",alternativeMatches:["Netherlands"]},{value:"NCL",label:"NCL",type:"string",alternativeMatches:["New Caledonia"]},{value:"NZL",label:"NZL",type:"string",alternativeMatches:["New Zealand"]},{value:"NIC",label:"NIC",type:"string",alternativeMatches:["Nicaragua"]},{value:"NER",label:"NER",type:"string",alternativeMatches:["Niger"]},{value:"NGA",label:"NGA",type:"string",alternativeMatches:["Nigeria"]},{value:"NIU",label:"NIU",type:"string",alternativeMatches:["Niue"]},{value:"NFK",label:"NFK",type:"string",alternativeMatches:["Norfolk Island"]},{value:"MNP",label:"MNP",type:"string",alternativeMatches:["Northern Mariana Islands"]},{value:"NOR",label:"NOR",type:"string",alternativeMatches:["Norway"]},{value:"OMN",label:"OMN",type:"string",alternativeMatches:["Oman"]},{value:"PAK",label:"PAK",type:"string",alternativeMatches:["Pakistan"]},{value:"PLW",label:"PLW",type:"string",alternativeMatches:["Palau"]},{value:"PSE",label:"PSE",type:"string",alternativeMatches:["Palestinian Territory, Occupied"]},{value:"PAN",label:"PAN",type:"string",alternativeMatches:["Panama"]},{value:"PNG",label:"PNG",type:"string",alternativeMatches:["Papua New Guinea"]},{value:"PRY",label:"PRY",type:"string",alternativeMatches:["Paraguay"]},{value:"PER",label:"PER",type:"string",alternativeMatches:["Peru"]},{value:"PHL",label:"PHL",type:"string",alternativeMatches:["Philippines"]},{value:"PCN",label:"PCN",type:"string",alternativeMatches:["Pitcairn"]},{value:"POL",label:"POL",type:"string",alternativeMatches:["Poland"]},{value:"PRT",label:"PRT",type:"string",alternativeMatches:["Portugal"]},{value:"PRI",label:"PRI",type:"string",alternativeMatches:["Puerto Rico"]},{value:"QAT",label:"QAT",type:"string",alternativeMatches:["Qatar"]},{value:"REU",label:"REU",type:"string",alternativeMatches:["R\xE9union"]},{value:"ROU",label:"ROU",type:"string",alternativeMatches:["Romania"]},{value:"RUS",label:"RUS",type:"string",alternativeMatches:["Russian Federation"]},{value:"RWA",label:"RWA",type:"string",alternativeMatches:["Rwanda"]},{value:"BLM",label:"BLM",type:"string",alternativeMatches:["Saint Barth\xE9lemy"]},{value:"SHN",label:"SHN",type:"string",alternativeMatches:["Saint Helena, Ascension and Tristan da Cunha"]},{value:"KNA",label:"KNA",type:"string",alternativeMatches:["Saint Kitts and Nevis","Saint Kitts","Nevis"]},{value:"LCA",label:"LCA",type:"string",alternativeMatches:["Saint Lucia"]},{value:"MAF",label:"MAF",type:"string",alternativeMatches:["Saint Martin (French part)"]},{value:"SPM",label:"SPM",type:"string",alternativeMatches:["Saint Pierre and Miquelon","Saint Pierre","Miquelon"]},{value:"VCT",label:"VCT",type:"string",alternativeMatches:["Saint Vincent and the Grenadines","Saint Vincent","Grenadines"]},{value:"WSM",label:"WSM",type:"string",alternativeMatches:["Samoa"]},{value:"SMR",label:"SMR",type:"string",alternativeMatches:["San Marino"]},{value:"STP",label:"STP",type:"string",alternativeMatches:["Sao Tome and Principe","Sao Tome","Principe"]},{value:"SAU",label:"SAU",type:"string",alternativeMatches:["Saudi Arabia"]},{value:"SEN",label:"SEN",type:"string",alternativeMatches:["Senegal"]},{value:"SRB",label:"SRB",type:"string",alternativeMatches:["Serbia"]},{value:"SYC",label:"SYC",type:"string",alternativeMatches:["Seychelles"]},{value:"SLE",label:"SLE",type:"string",alternativeMatches:["Sierra Leone"]},{value:"SGP",label:"SGP",type:"string",alternativeMatches:["Singapore"]},{value:"SXM",label:"SXM",type:"string",alternativeMatches:["Sint Maarten (Dutch part)"]},{value:"SVK",label:"SVK",type:"string",alternativeMatches:["Slovakia"]},{value:"SVN",label:"SVN",type:"string",alternativeMatches:["Slovenia"]},{value:"SLB",label:"SLB",type:"string",alternativeMatches:["Solomon Islands"]},{value:"SOM",label:"SOM",type:"string",alternativeMatches:["Somalia"]},{value:"ZAF",label:"ZAF",type:"string",alternativeMatches:["South Africa"]},{value:"SGS",label:"SGS",type:"string",alternativeMatches:["South Georgia and the South Sandwich Islands","South Georgia","South Sandwich Islands"]},{value:"SSD",label:"SSD",type:"string",alternativeMatches:["South Sudan"]},{value:"ESP",label:"ESP",type:"string",alternativeMatches:["Spain"]},{value:"LKA",label:"LKA",type:"string",alternativeMatches:["Sri Lanka"]},{value:"SDN",label:"SDN",type:"string",alternativeMatches:["Sudan"]},{value:"SUR",label:"SUR",type:"string",alternativeMatches:["Suriname"]},{value:"SJM",label:"SJM",type:"string",alternativeMatches:["Svalbard and Jan Mayen","Svalbard","Jan Mayen"]},{value:"SWZ",label:"SWZ",type:"string",alternativeMatches:["Swaziland","Eswatini"]},{value:"SWE",label:"SWE",type:"string",alternativeMatches:["Sweden"]},{value:"CHE",label:"CHE",type:"string",alternativeMatches:["Switzerland"]},{value:"SYR",label:"SYR",type:"string",alternativeMatches:["Syrian Arab Republic"]},{value:"TWN",label:"TWN",type:"string",alternativeMatches:["Taiwan, Province of China"]},{value:"TJK",label:"TJK",type:"string",alternativeMatches:["Tajikistan"]},{value:"TZA",label:"TZA",type:"string",alternativeMatches:["Tanzania, United Republic of"]},{value:"THA",label:"THA",type:"string",alternativeMatches:["Thailand"]},{value:"TLS",label:"TLS",type:"string",alternativeMatches:["Timor-Leste"]},{value:"TGO",label:"TGO",type:"string",alternativeMatches:["Togo"]},{value:"TKL",label:"TKL",type:"string",alternativeMatches:["Tokelau"]},{value:"TON",label:"TON",type:"string",alternativeMatches:["Tonga"]},{value:"TTO",label:"TTO",type:"string",alternativeMatches:["Trinidad and Tobago","Trinidad","Tobago"]},{value:"TUN",label:"TUN",type:"string",alternativeMatches:["Tunisia"]},{value:"TUR",label:"TUR",type:"string",alternativeMatches:["Turkey"]},{value:"TKM",label:"TKM",type:"string",alternativeMatches:["Turkmenistan"]},{value:"TCA",label:"TCA",type:"string",alternativeMatches:["Turks and Caicos Islands"]},{value:"TUV",label:"TUV",type:"string",alternativeMatches:["Tuvalu"]},{value:"UGA",label:"UGA",type:"string",alternativeMatches:["Uganda"]},{value:"UKR",label:"UKR",type:"string",alternativeMatches:["Ukraine"]},{value:"ARE",label:"ARE",type:"string",alternativeMatches:["United Arab Emirates"]},{value:"GBR",label:"GBR",type:"string",alternativeMatches:["United Kingdom"]},{value:"USA",label:"USA",type:"string",alternativeMatches:["United States"]},{value:"UMI",label:"UMI",type:"string",alternativeMatches:["United States Minor Outlying Islands"]},{value:"URY",label:"URY",type:"string",alternativeMatches:["Uruguay"]},{value:"UZB",label:"UZB",type:"string",alternativeMatches:["Uzbekistan"]},{value:"VUT",label:"VUT",type:"string",alternativeMatches:["Vanuatu"]},{value:"VEN",label:"VEN",type:"string",alternativeMatches:["Venezuela (Bolivarian Republic of)","Venezuela","Bolivarian"]},{value:"VNM",label:"VNM",type:"string",alternativeMatches:["Viet Nam"]},{value:"VGB",label:"VGB",type:"string",alternativeMatches:["Virgin Islands (British)","British"]},{value:"VIR",label:"VIR",type:"string",alternativeMatches:["Virgin Islands (U.S.)"]},{value:"WLF",label:"WLF",type:"string",alternativeMatches:["Wallis and Futuna"]},{value:"ESH",label:"ESH",type:"string",alternativeMatches:["Western Sahara"]},{value:"YEM",label:"YEM",type:"string",alternativeMatches:["Yemen"]},{value:"ZMB",label:"ZMB",type:"string",alternativeMatches:["Zambia"]},{value:"ZWE",label:"ZWE",type:"string",alternativeMatches:["Zimbabwe"]}];import{isArray as K}from"lodash";var b=class i{constructor(a,e){this.dataModels=[];this.mapValidation=a=>{switch(a){case"regex":return"REGEX";case"required":return"REQUIRED";case"required_with":return"REQUIRED_WITH";case"required_with_all":return"REQUIRED_WITH_ALL";case"required_with_all_values":return"REQUIRED_WITH_ALL_VALUES";case"required_with_values":return"REQUIRED_WITH_VALUES";case"required_without":return"REQUIRED_WITHOUT";case"required_without_all":return"REQUIRED_WITHOUT_ALL";case"required_without_all_values":return"REQUIRED_WITHOUT_ALL_VALUES";case"required_without_values":return"REQUIRED_WITHOUT_VALUES";case"unique":return"UNIQUE";default:throw new Error(`validation "${a}" isn't in available options`)}};this.getValidator=(a,e)=>new C({validation:this.mapValidation(a.validate),regex:a.regex??void 0,fields:a.columnValues?.map(t=>({key:t.key,value:t.value??[],type:this.findDataModelTypeByKey(t.key,e),label:this.findDataModelLabelByKey(t.key,e)}))??[],errorMessage:a.errorMessage});this.findDataModel=a=>this.columns.find(e=>e.key===a);this.findDataModelTypeByKey=(a,e)=>{let t=this.findDataModel(a);if(t)return i.mapDataModelType({columnType:t.columnType});if(e.checkValidation)throw new Error(`validation key "${a}" isn't found.`);return"string"};this.findDataModelLabelByKey=(a,e)=>{let t=this.findDataModel(a);if(t)return t.label;if(e.checkValidation)throw new Error(`validation key "${a}" isn't found.`);return""};this.validatorParser=a=>{let e=a.validate.toUpperCase(),t=a.columnValues??{},r=a.columns??[];return e==="REQUIRED_WITH_VALUES"||e==="REQUIRED_WITH_ALL_VALUES"||e==="REQUIRED_WITHOUT_VALUES"||e==="REQUIRED_WITHOUT_ALL_VALUES"?Object.keys(t).map(l=>({key:l,value:K(t[l])?t[l]:[t[l]]})):e==="REQUIRED_WITH"||e==="REQUIRED_WITHOUT"||e==="REQUIRED_WITHOUT_ALL"||e==="REQUIRED_WITH_ALL"?r.map(l=>({key:l})):[]};this.setDataModels=a=>{this.dataModels=this.columns.map(e=>{let t=i.mapDataModelType({columnType:e.columnType});e.numberFormat===void 0&&t==="currency_usd"&&(e.numberFormat="us");let r=e.optionMappingConfiguration?.processingMode??"browser",l=e.optionMappingConfiguration?.layers&&e.optionMappingConfiguration?.layers.length>0?e.optionMappingConfiguration?.layers:["smart","historic","fuzzy","exact"];a.enableNodeProcessing||(r="browser",l=l.filter(n=>n!=="historic"&&n!=="smart")),a.enableReuseMapping||(l=l.filter(n=>n!=="historic"));let M={layers:l,processingMode:r,threshold:e.optionMappingConfiguration?.threshold??.6},s={description:e.description??"",example:e.example??"",key:e.key,label:e.label,type:t,isRequired:!1,outputFormat:e.outputFormat??"",validators:e.validations?.map(n=>this.getValidator({...n,columnValues:this.validatorParser(n)},a)),mappingValidation:e.mappingValidation,alternativeMatches:e.alternativeMatches,columnSize:1,numberFormat:e.numberFormat||"eu",hidden:e.hidden,disabled:e.disabled,optionMappingConfiguration:M};return u.isTypeCategory(t)?new N({...s,type:t,options:i.createDropdownOptions(e),isMultiSelection:e.isMultiSelect??!1,allowCustomOptions:e.allowCustomOptions||!1}):new u(s)})};this.getDataModels=()=>this.dataModels;this.hasDateType=()=>{let a=!1;for(let e=0;e<this.dataModels.length;++e)if(["date","datetime","date_dmy","date_iso","date_mdy"].includes(this.dataModels?.[e].getType())){a=!0;break}return a};this.columns=a,this.setDataModels(e)}static{this.mapDataModelType=({columnType:a})=>{switch(a){case"boolean":return"boolean";case"int":return"int";case"float":return"float";case"category":return"single-select";case"date":return"date";case"date_dmy":return"date_dmy";case"date_mdy":return"date_mdy";case"date_iso":return"date_iso";case"datetime":return"datetime";case"time_hms":return"time_hms";case"time_hms_24":return"time_hms_24";case"time_hm":return"time_hm";case"time_hm_24":return"time_hm_24";case"email":return"email";case"url_www":return"url_www";case"url_https":return"url_https";case"url":return"url";case"phone":return"phone";case"zip_code_de":return"zip_code_de";case"percentage":return"percentage";case"country_code_alpha_2":return"country_code_alpha_2";case"country_code_alpha_3":return"country_code_alpha_3";case"currency_code":return"currency_code";case"currency_eur":return"currency_eur";case"currency_usd":return"currency_usd";case"bic":return"bic";case"vat_eu":return"vat_eu";case"gtin":return"gtin";case"iban":return"iban";default:return"string"}}}static{this.mapColumnType=({dataType:a})=>{switch(a){case"boolean":return"boolean";case"int":return"int";case"float":return"float";case"single-select":return"category";case"date":return"date";case"date_dmy":return"date_dmy";case"date_mdy":return"date_mdy";case"date_iso":return"date_iso";case"datetime":return"datetime";case"time_hms":return"time_hms";case"time_hms_24":return"time_hms_24";case"time_hm":return"time_hm";case"time_hm_24":return"time_hm_24";case"email":return"email";case"url_www":return"url_www";case"url_https":return"url_https";case"url":return"url";case"phone":return"phone";case"zip_code_de":return"zip_code_de";case"percentage":return"percentage";case"country_code_alpha_2":return"country_code_alpha_2";case"country_code_alpha_3":return"country_code_alpha_3";case"currency_code":return"currency_code";case"currency_eur":return"currency_eur";case"currency_usd":return"currency_usd";case"bic":return"bic";case"vat_eu":return"vat_eu";case"gtin":return"gtin";case"iban":return"iban";default:return"string"}}}static{this.createDropdownOptions=a=>a.columnType==="category"?a.dropdownOptions?.map(e=>({label:`${e.label}`,value:`${e.value}`,type:e.type,alternativeMatches:e.alternativeMatches??[],validations:e.validations??[],description:e.description??""}))??[]:a.columnType==="currency_code"?E:a.columnType==="country_code_alpha_2"?B:a.columnType==="country_code_alpha_3"?D:[]}},L=b;var ce=(i,a,e,t,r,l)=>{let M=0,s=0,n=0,o=!1,d=!1,{value:P,columns:S,isExact:G}=a,h=P?.trim();if(!(_(h)||h.length===0)){for(let c=0;c<i.length;c++){let A=i[c],y=Object.keys(A);for(let p=0;p<y.length;p++){let T=S.findIndex(v=>v.key===y[p]),g=T>=0?S[T]:void 0;if(g===void 0)continue;let m=A[y[p]];if(I(m,{value:h,columns:[g],isExact:G})){M++;let v=l.findIndex(U=>U.key===g.key),R=l[v];(e.includes(v)||t.includes(c))&&s++,r.includes(v)&&n++,R.disabled&&(d=!0),u.isTypeCategory(L.mapDataModelType({columnType:R.columnType}))&&(o=!0)}}}return{counter:M,hidden:s,skip:n,matchedCategoryType:o,matchedDisabledColumn:d}}};export{E as a,B as b,D as c,L as d,ce as e};