@invoice-sdk/widget 1.50.7 → 1.50.9

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.
@@ -2406,7 +2406,7 @@ let ce = null, le = null;
2406
2406
  function il(o) {
2407
2407
  return se(this, null, function* () {
2408
2408
  if (o.mode && Ze(o.mode), o.language && et(o.language), !le) {
2409
- const { InvoiceRegisterWidget: n } = yield import("./widget-D0ESdvpL.js");
2409
+ const { InvoiceRegisterWidget: n } = yield import("./widget-DuBPhwVR.js");
2410
2410
  le = n;
2411
2411
  }
2412
2412
  const e = typeof o.selector == "string" ? document.querySelector(o.selector) : o.selector;
@@ -2428,7 +2428,7 @@ function il(o) {
2428
2428
  function ol(o) {
2429
2429
  return se(this, null, function* () {
2430
2430
  if (o.mode && Ze(o.mode), o.language && et(o.language), !ce) {
2431
- const { EContractWidget: n } = yield import("./widget-D0ESdvpL.js");
2431
+ const { EContractWidget: n } = yield import("./widget-DuBPhwVR.js");
2432
2432
  ce = n;
2433
2433
  }
2434
2434
  const e = typeof o.selector == "string" ? document.querySelector(o.selector) : o.selector;
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i, a, r as s, s as r, u as g } from "./index-CYkUPESa.js";
1
+ import { i, a, r as s, s as r, u as g } from "./index-uN-nVMca.js";
2
2
  export {
3
3
  i as init,
4
4
  a as initEContract,
package/dist/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  (function(Z,_){typeof exports=="object"&&typeof module!="undefined"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(Z=typeof globalThis!="undefined"?globalThis:Z||self,_(Z.InvoiceRegisterWidget={}))})(this,function(Z){"use strict";var mo=Object.defineProperty,qo=Object.defineProperties;var Mo=Object.getOwnPropertyDescriptors;var XC=Object.getOwnPropertySymbols;var It=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable;var yg=(Z,_)=>(_=Symbol[Z])?_:Symbol.for("Symbol."+Z),lo=Z=>{throw TypeError(Z)};var Qt=(Z,_,y)=>_ in Z?mo(Z,_,{enumerable:!0,configurable:!0,writable:!0,value:y}):Z[_]=y,N=(Z,_)=>{for(var y in _||(_={}))It.call(_,y)&&Qt(Z,y,_[y]);if(XC)for(var y of XC(_))Et.call(_,y)&&Qt(Z,y,_[y]);return Z},sA=(Z,_)=>qo(Z,Mo(_));var DQ=(Z,_)=>{var y={};for(var eA in Z)It.call(Z,eA)&&_.indexOf(eA)<0&&(y[eA]=Z[eA]);if(Z!=null&&XC)for(var eA of XC(Z))_.indexOf(eA)<0&&Et.call(Z,eA)&&(y[eA]=Z[eA]);return y};var K=(Z,_,y)=>new Promise((eA,JA)=>{var mA=qA=>{try{RA(y.next(qA))}catch(xA){JA(xA)}},kA=qA=>{try{RA(y.throw(qA))}catch(xA){JA(xA)}},RA=qA=>qA.done?eA(qA.value):Promise.resolve(qA.value).then(mA,kA);RA((y=y.apply(Z,_)).next())}),Jg=function(Z,_){this[0]=Z,this[1]=_},fQ=(Z,_,y)=>{var eA=(kA,RA,qA,xA)=>{try{var bg=y[kA](RA),IC=(RA=bg.value)instanceof Jg,Tg=bg.done;Promise.resolve(IC?RA[0]:RA).then(_A=>IC?eA(kA==="return"?kA:"next",RA[1]?{done:_A.done,value:_A.value}:_A,qA,xA):qA({value:_A,done:Tg})).catch(_A=>eA("throw",_A,qA,xA))}catch(_A){xA(_A)}},JA=kA=>mA[kA]=RA=>new Promise((qA,xA)=>eA(kA,RA,qA,xA)),mA={};return y=y.apply(Z,_),mA[yg("asyncIterator")]=()=>mA,JA("next"),JA("throw"),JA("return"),mA},mQ=Z=>{var _=Z[yg("asyncIterator")],y=!1,eA,JA={};return _==null?(_=Z[yg("iterator")](),eA=mA=>JA[mA]=kA=>_[mA](kA)):(_=_.call(Z),eA=mA=>JA[mA]=kA=>{if(y){if(y=!1,mA==="throw")throw kA;return kA}return y=!0,{done:!1,value:new Jg(new Promise(RA=>{var qA=_[mA](kA);qA instanceof Object||lo("Object expected"),RA(qA)}),1)}}),JA[yg("iterator")]=()=>JA,eA("next"),"throw"in _?eA("throw"):JA.throw=mA=>{throw mA},"return"in _&&eA("return"),JA},nt=(Z,_,y)=>(_=Z[yg("asyncIterator")])?_.call(Z):(Z=Z[yg("iterator")](),_={},y=(eA,JA)=>(JA=Z[eA])&&(_[eA]=mA=>new Promise((kA,RA,qA)=>(mA=JA.call(Z,mA),qA=mA.done,Promise.resolve(mA.value).then(xA=>kA({value:xA,done:qA}),RA)))),y("next"),y("return"),_);function _(g,A){for(var C=0;C<A.length;C++){const B=A[C];if(typeof B!="string"&&!Array.isArray(B)){for(const Q in B)if(Q!=="default"&&!(Q in g)){const I=Object.getOwnPropertyDescriptor(B,Q);I&&Object.defineProperty(g,Q,I.get?I:{enumerable:!0,get:()=>B[Q]})}}}return Object.freeze(Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}))}const y=g=>typeof g=="string",eA=()=>{let g,A;const C=new Promise((B,Q)=>{g=B,A=Q});return C.resolve=g,C.reject=A,C},JA=g=>g==null?"":""+g,mA=(g,A,C)=>{g.forEach(B=>{A[B]&&(C[B]=A[B])})},kA=/###/g,RA=g=>g&&g.indexOf("###")>-1?g.replace(kA,"."):g,qA=g=>!g||y(g),xA=(g,A,C)=>{const B=y(A)?A.split("."):A;let Q=0;for(;Q<B.length-1;){if(qA(g))return{};const I=RA(B[Q]);!g[I]&&C&&(g[I]=new C),Object.prototype.hasOwnProperty.call(g,I)?g=g[I]:g={},++Q}return qA(g)?{}:{obj:g,k:RA(B[Q])}},bg=(g,A,C)=>{const{obj:B,k:Q}=xA(g,A,Object);if(B!==void 0||A.length===1){B[Q]=C;return}let I=A[A.length-1],E=A.slice(0,A.length-1),n=xA(g,E,Object);for(;n.obj===void 0&&E.length;)I=`${E[E.length-1]}.${I}`,E=E.slice(0,E.length-1),n=xA(g,E,Object),n!=null&&n.obj&&typeof n.obj[`${n.k}.${I}`]!="undefined"&&(n.obj=void 0);n.obj[`${n.k}.${I}`]=C},IC=(g,A,C,B)=>{const{obj:Q,k:I}=xA(g,A,Object);Q[I]=Q[I]||[],Q[I].push(C)},Tg=(g,A)=>{const{obj:C,k:B}=xA(g,A);if(C&&Object.prototype.hasOwnProperty.call(C,B))return C[B]},_A=(g,A,C)=>{const B=Tg(g,C);return B!==void 0?B:Tg(A,C)},qQ=(g,A,C)=>{for(const B in A)B!=="__proto__"&&B!=="constructor"&&(B in g?y(g[B])||g[B]instanceof String||y(A[B])||A[B]instanceof String?C&&(g[B]=A[B]):qQ(g[B],A[B],C):g[B]=A[B]);return g},Hg=g=>g.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var et={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const ht=g=>y(g)?g.replace(/[&<>"'\/]/g,A=>et[A]):g;class ct{constructor(A){this.capacity=A,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(A){const C=this.regExpMap.get(A);if(C!==void 0)return C;const B=new RegExp(A);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(A,B),this.regExpQueue.push(A),B}}const ot=[" ",",","?","!",";"],it=new ct(20),at=(g,A,C)=>{A=A||"",C=C||"";const B=ot.filter(E=>A.indexOf(E)<0&&C.indexOf(E)<0);if(B.length===0)return!0;const Q=it.getRegExp(`(${B.map(E=>E==="?"?"\\?":E).join("|")})`);let I=!Q.test(g);if(!I){const E=g.indexOf(C);E>0&&!Q.test(g.substring(0,E))&&(I=!0)}return I},FC=(g,A,C=".")=>{if(!g)return;if(g[A])return Object.prototype.hasOwnProperty.call(g,A)?g[A]:void 0;const B=A.split(C);let Q=g;for(let I=0;I<B.length;){if(!Q||typeof Q!="object")return;let E,n="";for(let t=I;t<B.length;++t)if(t!==I&&(n+=C),n+=B[t],E=Q[n],E!==void 0){if(["string","number","boolean"].indexOf(typeof E)>-1&&t<B.length-1)continue;I+=t-I+1;break}Q=E}return Q},jg=g=>g==null?void 0:g.replace("_","-"),st={type:"logger",log(g){this.output("log",g)},warn(g){this.output("warn",g)},error(g){this.output("error",g)},output(g,A){var C,B;(B=(C=console==null?void 0:console[g])==null?void 0:C.apply)==null||B.call(C,console,A)}};class EC{constructor(A,C={}){this.init(A,C)}init(A,C={}){this.prefix=C.prefix||"i18next:",this.logger=A||st,this.options=C,this.debug=C.debug}log(...A){return this.forward(A,"log","",!0)}warn(...A){return this.forward(A,"warn","",!0)}error(...A){return this.forward(A,"error","")}deprecate(...A){return this.forward(A,"warn","WARNING DEPRECATED: ",!0)}forward(A,C,B,Q){return Q&&!this.debug?null:(y(A[0])&&(A[0]=`${B}${this.prefix} ${A[0]}`),this.logger[C](A))}create(A){return new EC(this.logger,N({prefix:`${this.prefix}:${A}:`},this.options))}clone(A){return A=A||this.options,A.prefix=A.prefix||this.prefix,new EC(this.logger,A)}}var Ag=new EC;class nC{constructor(){this.observers={}}on(A,C){return A.split(" ").forEach(B=>{this.observers[B]||(this.observers[B]=new Map);const Q=this.observers[B].get(C)||0;this.observers[B].set(C,Q+1)}),this}off(A,C){if(this.observers[A]){if(!C){delete this.observers[A];return}this.observers[A].delete(C)}}emit(A,...C){this.observers[A]&&Array.from(this.observers[A].entries()).forEach(([Q,I])=>{for(let E=0;E<I;E++)Q(...C)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([Q,I])=>{for(let E=0;E<I;E++)Q.apply(Q,[A,...C])})}}class MQ extends nC{constructor(A,C={ns:["translation"],defaultNS:"translation"}){super(),this.data=A||{},this.options=C,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(A){this.options.ns.indexOf(A)<0&&this.options.ns.push(A)}removeNamespaces(A){const C=this.options.ns.indexOf(A);C>-1&&this.options.ns.splice(C,1)}getResource(A,C,B,Q={}){var e,h;const I=Q.keySeparator!==void 0?Q.keySeparator:this.options.keySeparator,E=Q.ignoreJSONStructure!==void 0?Q.ignoreJSONStructure:this.options.ignoreJSONStructure;let n;A.indexOf(".")>-1?n=A.split("."):(n=[A,C],B&&(Array.isArray(B)?n.push(...B):y(B)&&I?n.push(...B.split(I)):n.push(B)));const t=Tg(this.data,n);return!t&&!C&&!B&&A.indexOf(".")>-1&&(A=n[0],C=n[1],B=n.slice(2).join(".")),t||!E||!y(B)?t:FC((h=(e=this.data)==null?void 0:e[A])==null?void 0:h[C],B,I)}addResource(A,C,B,Q,I={silent:!1}){const E=I.keySeparator!==void 0?I.keySeparator:this.options.keySeparator;let n=[A,C];B&&(n=n.concat(E?B.split(E):B)),A.indexOf(".")>-1&&(n=A.split("."),Q=C,C=n[1]),this.addNamespaces(C),bg(this.data,n,Q),I.silent||this.emit("added",A,C,B,Q)}addResources(A,C,B,Q={silent:!1}){for(const I in B)(y(B[I])||Array.isArray(B[I]))&&this.addResource(A,C,I,B[I],{silent:!0});Q.silent||this.emit("added",A,C,B)}addResourceBundle(A,C,B,Q,I,E={silent:!1,skipCopy:!1}){let n=[A,C];A.indexOf(".")>-1&&(n=A.split("."),Q=B,B=C,C=n[1]),this.addNamespaces(C);let t=Tg(this.data,n)||{};E.skipCopy||(B=JSON.parse(JSON.stringify(B))),Q?qQ(t,B,I):t=N(N({},t),B),bg(this.data,n,t),E.silent||this.emit("added",A,C,B)}removeResourceBundle(A,C){this.hasResourceBundle(A,C)&&delete this.data[A][C],this.removeNamespaces(C),this.emit("removed",A,C)}hasResourceBundle(A,C){return this.getResource(A,C)!==void 0}getResourceBundle(A,C){return C||(C=this.options.defaultNS),this.getResource(A,C)}getDataByLanguage(A){return this.data[A]}hasLanguageSomeTranslations(A){const C=this.getDataByLanguage(A);return!!(C&&Object.keys(C)||[]).find(Q=>C[Q]&&Object.keys(C[Q]).length>0)}toJSON(){return this.data}}var dQ={processors:{},addPostProcessor(g){this.processors[g.name]=g},handle(g,A,C,B,Q){return g.forEach(I=>{var E,n;A=(n=(E=this.processors[I])==null?void 0:E.process(A,C,B,Q))!=null?n:A}),A}};const lQ={},vQ=g=>!y(g)&&typeof g!="boolean"&&typeof g!="number";class tC extends nC{constructor(A,C={}){super(),mA(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],A,this),this.options=C,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ag.create("translator")}changeLanguage(A){A&&(this.language=A)}exists(A,C={interpolation:{}}){const B=N({},C);if(A==null)return!1;const Q=this.resolve(A,B);return(Q==null?void 0:Q.res)!==void 0}extractFromKey(A,C){let B=C.nsSeparator!==void 0?C.nsSeparator:this.options.nsSeparator;B===void 0&&(B=":");const Q=C.keySeparator!==void 0?C.keySeparator:this.options.keySeparator;let I=C.ns||this.options.defaultNS||[];const E=B&&A.indexOf(B)>-1,n=!this.options.userDefinedKeySeparator&&!C.keySeparator&&!this.options.userDefinedNsSeparator&&!C.nsSeparator&&!at(A,B,Q);if(E&&!n){const t=A.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:A,namespaces:y(I)?[I]:I};const e=A.split(B);(B!==Q||B===Q&&this.options.ns.indexOf(e[0])>-1)&&(I=e.shift()),A=e.join(Q)}return{key:A,namespaces:y(I)?[I]:I}}translate(A,C,B){let Q=typeof C=="object"?N({},C):C;if(typeof Q!="object"&&this.options.overloadTranslationOptionHandler&&(Q=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(Q=N({},Q)),Q||(Q={}),A==null)return"";Array.isArray(A)||(A=[String(A)]);const I=Q.returnDetails!==void 0?Q.returnDetails:this.options.returnDetails,E=Q.keySeparator!==void 0?Q.keySeparator:this.options.keySeparator,{key:n,namespaces:t}=this.extractFromKey(A[A.length-1],Q),e=t[t.length-1];let h=Q.nsSeparator!==void 0?Q.nsSeparator:this.options.nsSeparator;h===void 0&&(h=":");const c=Q.lng||this.language,o=Q.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((c==null?void 0:c.toLowerCase())==="cimode")return o?I?{res:`${e}${h}${n}`,usedKey:n,exactUsedKey:n,usedLng:c,usedNS:e,usedParams:this.getUsedParamsDetails(Q)}:`${e}${h}${n}`:I?{res:n,usedKey:n,exactUsedKey:n,usedLng:c,usedNS:e,usedParams:this.getUsedParamsDetails(Q)}:n;const a=this.resolve(A,Q);let i=a==null?void 0:a.res;const s=(a==null?void 0:a.usedKey)||n,r=(a==null?void 0:a.exactUsedKey)||n,P=["[object Number]","[object Function]","[object RegExp]"],u=Q.joinArrays!==void 0?Q.joinArrays:this.options.joinArrays,f=!this.i18nFormat||this.i18nFormat.handleAsObject,M=Q.count!==void 0&&!y(Q.count),l=tC.hasDefaultValue(Q),J=M?this.pluralResolver.getSuffix(c,Q.count,Q):"",q=Q.ordinal&&M?this.pluralResolver.getSuffix(c,Q.count,{ordinal:!1}):"",m=M&&!Q.ordinal&&Q.count===0,v=m&&Q[`defaultValue${this.options.pluralSeparator}zero`]||Q[`defaultValue${J}`]||Q[`defaultValue${q}`]||Q.defaultValue;let Y=i;f&&!i&&l&&(Y=v);const z=vQ(Y),x=Object.prototype.toString.apply(Y);if(f&&Y&&z&&P.indexOf(x)<0&&!(y(u)&&Array.isArray(Y))){if(!Q.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const R=this.options.returnedObjectHandler?this.options.returnedObjectHandler(s,Y,sA(N({},Q),{ns:t})):`key '${n} (${this.language})' returned an object instead of string.`;return I?(a.res=R,a.usedParams=this.getUsedParamsDetails(Q),a):R}if(E){const R=Array.isArray(Y),O=R?[]:{},D=R?r:s;for(const k in Y)if(Object.prototype.hasOwnProperty.call(Y,k)){const j=`${D}${E}${k}`;l&&!i?O[k]=this.translate(j,sA(N({},Q),{defaultValue:vQ(v)?v[k]:void 0,joinArrays:!1,ns:t})):O[k]=this.translate(j,sA(N({},Q),{joinArrays:!1,ns:t})),O[k]===j&&(O[k]=Y[k])}i=O}}else if(f&&y(u)&&Array.isArray(i))i=i.join(u),i&&(i=this.extendTranslation(i,A,Q,B));else{let R=!1,O=!1;!this.isValidLookup(i)&&l&&(R=!0,i=v),this.isValidLookup(i)||(O=!0,i=n);const k=(Q.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&O?void 0:i,j=l&&v!==i&&this.options.updateMissing;if(O||R||j){if(this.logger.log(j?"updateKey":"missingKey",c,e,n,j?v:i),E){const G=this.resolve(n,sA(N({},Q),{keySeparator:!1}));G&&G.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let p=[];const H=this.languageUtils.getFallbackCodes(this.options.fallbackLng,Q.lng||this.language);if(this.options.saveMissingTo==="fallback"&&H&&H[0])for(let G=0;G<H.length;G++)p.push(H[G]);else this.options.saveMissingTo==="all"?p=this.languageUtils.toResolveHierarchy(Q.lng||this.language):p.push(Q.lng||this.language);const d=(G,b,F)=>{var EA;const U=l&&F!==i?F:k;this.options.missingKeyHandler?this.options.missingKeyHandler(G,e,b,U,j,Q):(EA=this.backendConnector)!=null&&EA.saveMissing&&this.backendConnector.saveMissing(G,e,b,U,j,Q),this.emit("missingKey",G,e,b,i)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?p.forEach(G=>{const b=this.pluralResolver.getSuffixes(G,Q);m&&Q[`defaultValue${this.options.pluralSeparator}zero`]&&b.indexOf(`${this.options.pluralSeparator}zero`)<0&&b.push(`${this.options.pluralSeparator}zero`),b.forEach(F=>{d([G],n+F,Q[`defaultValue${F}`]||v)})}):d(p,n,v))}i=this.extendTranslation(i,A,Q,a,B),O&&i===n&&this.options.appendNamespaceToMissingKey&&(i=`${e}${h}${n}`),(O||R)&&this.options.parseMissingKeyHandler&&(i=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${e}${h}${n}`:n,R?i:void 0,Q))}return I?(a.res=i,a.usedParams=this.getUsedParamsDetails(Q),a):i}extendTranslation(A,C,B,Q,I){var t,e;if((t=this.i18nFormat)!=null&&t.parse)A=this.i18nFormat.parse(A,N(N({},this.options.interpolation.defaultVariables),B),B.lng||this.language||Q.usedLng,Q.usedNS,Q.usedKey,{resolved:Q});else if(!B.skipInterpolation){B.interpolation&&this.interpolator.init(sA(N({},B),{interpolation:N(N({},this.options.interpolation),B.interpolation)}));const h=y(A)&&(((e=B==null?void 0:B.interpolation)==null?void 0:e.skipOnVariables)!==void 0?B.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(h){const a=A.match(this.interpolator.nestingRegexp);c=a&&a.length}let o=B.replace&&!y(B.replace)?B.replace:B;if(this.options.interpolation.defaultVariables&&(o=N(N({},this.options.interpolation.defaultVariables),o)),A=this.interpolator.interpolate(A,o,B.lng||this.language||Q.usedLng,B),h){const a=A.match(this.interpolator.nestingRegexp),i=a&&a.length;c<i&&(B.nest=!1)}!B.lng&&Q&&Q.res&&(B.lng=this.language||Q.usedLng),B.nest!==!1&&(A=this.interpolator.nest(A,(...a)=>(I==null?void 0:I[0])===a[0]&&!B.context?(this.logger.warn(`It seems you are nesting recursively key: ${a[0]} in key: ${C[0]}`),null):this.translate(...a,C),B)),B.interpolation&&this.interpolator.reset()}const E=B.postProcess||this.options.postProcess,n=y(E)?[E]:E;return A!=null&&(n!=null&&n.length)&&B.applyPostProcessor!==!1&&(A=dQ.handle(n,A,C,this.options&&this.options.postProcessPassResolved?N({i18nResolved:sA(N({},Q),{usedParams:this.getUsedParamsDetails(B)})},B):B,this)),A}resolve(A,C={}){let B,Q,I,E,n;return y(A)&&(A=[A]),A.forEach(t=>{if(this.isValidLookup(B))return;const e=this.extractFromKey(t,C),h=e.key;Q=h;let c=e.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const o=C.count!==void 0&&!y(C.count),a=o&&!C.ordinal&&C.count===0,i=C.context!==void 0&&(y(C.context)||typeof C.context=="number")&&C.context!=="",s=C.lngs?C.lngs:this.languageUtils.toResolveHierarchy(C.lng||this.language,C.fallbackLng);c.forEach(r=>{var P,u;this.isValidLookup(B)||(n=r,!lQ[`${s[0]}-${r}`]&&((P=this.utils)!=null&&P.hasLoadedNamespace)&&!((u=this.utils)!=null&&u.hasLoadedNamespace(n))&&(lQ[`${s[0]}-${r}`]=!0,this.logger.warn(`key "${Q}" for languages "${s.join(", ")}" won't get resolved as namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),s.forEach(f=>{var J;if(this.isValidLookup(B))return;E=f;const M=[h];if((J=this.i18nFormat)!=null&&J.addLookupKeys)this.i18nFormat.addLookupKeys(M,h,f,r,C);else{let q;o&&(q=this.pluralResolver.getSuffix(f,C.count,C));const m=`${this.options.pluralSeparator}zero`,v=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(o&&(M.push(h+q),C.ordinal&&q.indexOf(v)===0&&M.push(h+q.replace(v,this.options.pluralSeparator)),a&&M.push(h+m)),i){const Y=`${h}${this.options.contextSeparator}${C.context}`;M.push(Y),o&&(M.push(Y+q),C.ordinal&&q.indexOf(v)===0&&M.push(Y+q.replace(v,this.options.pluralSeparator)),a&&M.push(Y+m))}}let l;for(;l=M.pop();)this.isValidLookup(B)||(I=l,B=this.getResource(f,r,l,C))}))})}),{res:B,usedKey:Q,exactUsedKey:I,usedLng:E,usedNS:n}}isValidLookup(A){return A!==void 0&&!(!this.options.returnNull&&A===null)&&!(!this.options.returnEmptyString&&A==="")}getResource(A,C,B,Q={}){var I;return(I=this.i18nFormat)!=null&&I.getResource?this.i18nFormat.getResource(A,C,B,Q):this.resourceStore.getResource(A,C,B,Q)}getUsedParamsDetails(A={}){const C=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],B=A.replace&&!y(A.replace);let Q=B?A.replace:A;if(B&&typeof A.count!="undefined"&&(Q.count=A.count),this.options.interpolation.defaultVariables&&(Q=N(N({},this.options.interpolation.defaultVariables),Q)),!B){Q=N({},Q);for(const I of C)delete Q[I]}return Q}static hasDefaultValue(A){const C="defaultValue";for(const B in A)if(Object.prototype.hasOwnProperty.call(A,B)&&C===B.substring(0,C.length)&&A[B]!==void 0)return!0;return!1}}class PQ{constructor(A){this.options=A,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ag.create("languageUtils")}getScriptPartFromCode(A){if(A=jg(A),!A||A.indexOf("-")<0)return null;const C=A.split("-");return C.length===2||(C.pop(),C[C.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(C.join("-"))}getLanguagePartFromCode(A){if(A=jg(A),!A||A.indexOf("-")<0)return A;const C=A.split("-");return this.formatLanguageCode(C[0])}formatLanguageCode(A){if(y(A)&&A.indexOf("-")>-1){let C;try{C=Intl.getCanonicalLocales(A)[0]}catch(B){}return C&&this.options.lowerCaseLng&&(C=C.toLowerCase()),C||(this.options.lowerCaseLng?A.toLowerCase():A)}return this.options.cleanCode||this.options.lowerCaseLng?A.toLowerCase():A}isSupportedCode(A){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(A=this.getLanguagePartFromCode(A)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(A)>-1}getBestMatchFromCodes(A){if(!A)return null;let C;return A.forEach(B=>{if(C)return;const Q=this.formatLanguageCode(B);(!this.options.supportedLngs||this.isSupportedCode(Q))&&(C=Q)}),!C&&this.options.supportedLngs&&A.forEach(B=>{if(C)return;const Q=this.getScriptPartFromCode(B);if(this.isSupportedCode(Q))return C=Q;const I=this.getLanguagePartFromCode(B);if(this.isSupportedCode(I))return C=I;C=this.options.supportedLngs.find(E=>{if(E===I)return E;if(!(E.indexOf("-")<0&&I.indexOf("-")<0)&&(E.indexOf("-")>0&&I.indexOf("-")<0&&E.substring(0,E.indexOf("-"))===I||E.indexOf(I)===0&&I.length>1))return E})}),C||(C=this.getFallbackCodes(this.options.fallbackLng)[0]),C}getFallbackCodes(A,C){if(!A)return[];if(typeof A=="function"&&(A=A(C)),y(A)&&(A=[A]),Array.isArray(A))return A;if(!C)return A.default||[];let B=A[C];return B||(B=A[this.getScriptPartFromCode(C)]),B||(B=A[this.formatLanguageCode(C)]),B||(B=A[this.getLanguagePartFromCode(C)]),B||(B=A.default),B||[]}toResolveHierarchy(A,C){const B=this.getFallbackCodes((C===!1?[]:C)||this.options.fallbackLng||[],A),Q=[],I=E=>{E&&(this.isSupportedCode(E)?Q.push(E):this.logger.warn(`rejecting language code not found in supportedLngs: ${E}`))};return y(A)&&(A.indexOf("-")>-1||A.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&I(this.formatLanguageCode(A)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&I(this.getScriptPartFromCode(A)),this.options.load!=="currentOnly"&&I(this.getLanguagePartFromCode(A))):y(A)&&I(this.formatLanguageCode(A)),B.forEach(E=>{Q.indexOf(E)<0&&I(this.formatLanguageCode(E))}),Q}}const JQ={zero:0,one:1,two:2,few:3,many:4,other:5},TQ={select:g=>g===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class wt{constructor(A,C={}){this.languageUtils=A,this.options=C,this.logger=Ag.create("pluralResolver"),this.pluralRulesCache={}}addRule(A,C){this.rules[A]=C}clearCache(){this.pluralRulesCache={}}getRule(A,C={}){const B=jg(A==="dev"?"en":A),Q=C.ordinal?"ordinal":"cardinal",I=JSON.stringify({cleanedCode:B,type:Q});if(I in this.pluralRulesCache)return this.pluralRulesCache[I];let E;try{E=new Intl.PluralRules(B,{type:Q})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),TQ;if(!A.match(/-|_/))return TQ;const t=this.languageUtils.getLanguagePartFromCode(A);E=this.getRule(t,C)}return this.pluralRulesCache[I]=E,E}needsPlural(A,C={}){let B=this.getRule(A,C);return B||(B=this.getRule("dev",C)),(B==null?void 0:B.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(A,C,B={}){return this.getSuffixes(A,B).map(Q=>`${C}${Q}`)}getSuffixes(A,C={}){let B=this.getRule(A,C);return B||(B=this.getRule("dev",C)),B?B.resolvedOptions().pluralCategories.sort((Q,I)=>JQ[Q]-JQ[I]).map(Q=>`${this.options.prepend}${C.ordinal?`ordinal${this.options.prepend}`:""}${Q}`):[]}getSuffix(A,C,B={}){const Q=this.getRule(A,B);return Q?`${this.options.prepend}${B.ordinal?`ordinal${this.options.prepend}`:""}${Q.select(C)}`:(this.logger.warn(`no plural rule found for: ${A}`),this.getSuffix("dev",C,B))}}const HQ=(g,A,C,B=".",Q=!0)=>{let I=_A(g,A,C);return!I&&Q&&y(C)&&(I=FC(g,C,B),I===void 0&&(I=FC(A,C,B))),I},LC=g=>g.replace(/\$/g,"$$$$");class ut{constructor(A={}){var C;this.logger=Ag.create("interpolator"),this.options=A,this.format=((C=A==null?void 0:A.interpolation)==null?void 0:C.format)||(B=>B),this.init(A)}init(A={}){A.interpolation||(A.interpolation={escapeValue:!0});const{escape:C,escapeValue:B,useRawValueToEscape:Q,prefix:I,prefixEscaped:E,suffix:n,suffixEscaped:t,formatSeparator:e,unescapeSuffix:h,unescapePrefix:c,nestingPrefix:o,nestingPrefixEscaped:a,nestingSuffix:i,nestingSuffixEscaped:s,nestingOptionsSeparator:r,maxReplaces:P,alwaysFormat:u}=A.interpolation;this.escape=C!==void 0?C:ht,this.escapeValue=B!==void 0?B:!0,this.useRawValueToEscape=Q!==void 0?Q:!1,this.prefix=I?Hg(I):E||"{{",this.suffix=n?Hg(n):t||"}}",this.formatSeparator=e||",",this.unescapePrefix=h?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=o?Hg(o):a||Hg("$t("),this.nestingSuffix=i?Hg(i):s||Hg(")"),this.nestingOptionsSeparator=r||",",this.maxReplaces=P||1e3,this.alwaysFormat=u!==void 0?u:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const A=(C,B)=>(C==null?void 0:C.source)===B?(C.lastIndex=0,C):new RegExp(B,"g");this.regexp=A(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=A(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=A(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(A,C,B,Q){var a;let I,E,n;const t=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},e=i=>{if(i.indexOf(this.formatSeparator)<0){const u=HQ(C,t,i,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(u,void 0,B,sA(N(N({},Q),C),{interpolationkey:i})):u}const s=i.split(this.formatSeparator),r=s.shift().trim(),P=s.join(this.formatSeparator).trim();return this.format(HQ(C,t,r,this.options.keySeparator,this.options.ignoreJSONStructure),P,B,sA(N(N({},Q),C),{interpolationkey:r}))};this.resetRegExp();const h=(Q==null?void 0:Q.missingInterpolationHandler)||this.options.missingInterpolationHandler,c=((a=Q==null?void 0:Q.interpolation)==null?void 0:a.skipOnVariables)!==void 0?Q.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:i=>LC(i)},{regex:this.regexp,safeValue:i=>this.escapeValue?LC(this.escape(i)):LC(i)}].forEach(i=>{for(n=0;I=i.regex.exec(A);){const s=I[1].trim();if(E=e(s),E===void 0)if(typeof h=="function"){const P=h(A,I,Q);E=y(P)?P:""}else if(Q&&Object.prototype.hasOwnProperty.call(Q,s))E="";else if(c){E=I[0];continue}else this.logger.warn(`missed to pass in variable ${s} for interpolating ${A}`),E="";else!y(E)&&!this.useRawValueToEscape&&(E=JA(E));const r=i.safeValue(E);if(A=A.replace(I[0],r),c?(i.regex.lastIndex+=E.length,i.regex.lastIndex-=I[0].length):i.regex.lastIndex=0,n++,n>=this.maxReplaces)break}}),A}nest(A,C,B={}){let Q,I,E;const n=(t,e)=>{var s;const h=this.nestingOptionsSeparator;if(t.indexOf(h)<0)return t;const c=t.split(new RegExp(`${h}[ ]*{`));let o=`{${c[1]}`;t=c[0],o=this.interpolate(o,E);const a=o.match(/'/g),i=o.match(/"/g);(((s=a==null?void 0:a.length)!=null?s:0)%2===0&&!i||i.length%2!==0)&&(o=o.replace(/'/g,'"'));try{E=JSON.parse(o),e&&(E=N(N({},e),E))}catch(r){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,r),`${t}${h}${o}`}return E.defaultValue&&E.defaultValue.indexOf(this.prefix)>-1&&delete E.defaultValue,t};for(;Q=this.nestingRegexp.exec(A);){let t=[];E=N({},B),E=E.replace&&!y(E.replace)?E.replace:E,E.applyPostProcessor=!1,delete E.defaultValue;const e=/{.*}/.test(Q[1])?Q[1].lastIndexOf("}")+1:Q[1].indexOf(this.formatSeparator);if(e!==-1&&(t=Q[1].slice(e).split(this.formatSeparator).map(h=>h.trim()).filter(Boolean),Q[1]=Q[1].slice(0,e)),I=C(n.call(this,Q[1].trim(),E),E),I&&Q[0]===A&&!y(I))return I;y(I)||(I=JA(I)),I||(this.logger.warn(`missed to resolve ${Q[1]} for nesting ${A}`),I=""),t.length&&(I=t.reduce((h,c)=>this.format(h,c,B.lng,sA(N({},B),{interpolationkey:Q[1].trim()})),I.trim())),A=A.replace(Q[0],I),this.regexp.lastIndex=0}return A}}const rt=g=>{let A=g.toLowerCase().trim();const C={};if(g.indexOf("(")>-1){const B=g.split("(");A=B[0].toLowerCase().trim();const Q=B[1].substring(0,B[1].length-1);A==="currency"&&Q.indexOf(":")<0?C.currency||(C.currency=Q.trim()):A==="relativetime"&&Q.indexOf(":")<0?C.range||(C.range=Q.trim()):Q.split(";").forEach(E=>{if(E){const[n,...t]=E.split(":"),e=t.join(":").trim().replace(/^'+|'+$/g,""),h=n.trim();C[h]||(C[h]=e),e==="false"&&(C[h]=!1),e==="true"&&(C[h]=!0),isNaN(e)||(C[h]=parseInt(e,10))}})}return{formatName:A,formatOptions:C}},kQ=g=>{const A={};return(C,B,Q)=>{let I=Q;Q&&Q.interpolationkey&&Q.formatParams&&Q.formatParams[Q.interpolationkey]&&Q[Q.interpolationkey]&&(I=sA(N({},I),{[Q.interpolationkey]:void 0}));const E=B+JSON.stringify(I);let n=A[E];return n||(n=g(jg(B),Q),A[E]=n),n(C)}},Dt=g=>(A,C,B)=>g(jg(C),B)(A);class ft{constructor(A={}){this.logger=Ag.create("formatter"),this.options=A,this.init(A)}init(A,C={interpolation:{}}){this.formatSeparator=C.interpolation.formatSeparator||",";const B=C.cacheInBuiltFormats?kQ:Dt;this.formats={number:B((Q,I)=>{const E=new Intl.NumberFormat(Q,N({},I));return n=>E.format(n)}),currency:B((Q,I)=>{const E=new Intl.NumberFormat(Q,sA(N({},I),{style:"currency"}));return n=>E.format(n)}),datetime:B((Q,I)=>{const E=new Intl.DateTimeFormat(Q,N({},I));return n=>E.format(n)}),relativetime:B((Q,I)=>{const E=new Intl.RelativeTimeFormat(Q,N({},I));return n=>E.format(n,I.range||"day")}),list:B((Q,I)=>{const E=new Intl.ListFormat(Q,N({},I));return n=>E.format(n)})}}add(A,C){this.formats[A.toLowerCase().trim()]=C}addCached(A,C){this.formats[A.toLowerCase().trim()]=kQ(C)}format(A,C,B,Q={}){const I=C.split(this.formatSeparator);if(I.length>1&&I[0].indexOf("(")>1&&I[0].indexOf(")")<0&&I.find(n=>n.indexOf(")")>-1)){const n=I.findIndex(t=>t.indexOf(")")>-1);I[0]=[I[0],...I.splice(1,n)].join(this.formatSeparator)}return I.reduce((n,t)=>{var c;const{formatName:e,formatOptions:h}=rt(t);if(this.formats[e]){let o=n;try{const a=((c=Q==null?void 0:Q.formatParams)==null?void 0:c[Q.interpolationkey])||{},i=a.locale||a.lng||Q.locale||Q.lng||B;o=this.formats[e](n,i,N(N(N({},h),Q),a))}catch(a){this.logger.warn(a)}return o}else this.logger.warn(`there was no format function for ${e}`);return n},A)}}const mt=(g,A)=>{g.pending[A]!==void 0&&(delete g.pending[A],g.pendingCount--)};class qt extends nC{constructor(A,C,B,Q={}){var I,E;super(),this.backend=A,this.store=C,this.services=B,this.languageUtils=B.languageUtils,this.options=Q,this.logger=Ag.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=Q.maxParallelReads||10,this.readingCalls=0,this.maxRetries=Q.maxRetries>=0?Q.maxRetries:5,this.retryTimeout=Q.retryTimeout>=1?Q.retryTimeout:350,this.state={},this.queue=[],(E=(I=this.backend)==null?void 0:I.init)==null||E.call(I,B,Q.backend,Q)}queueLoad(A,C,B,Q){const I={},E={},n={},t={};return A.forEach(e=>{let h=!0;C.forEach(c=>{const o=`${e}|${c}`;!B.reload&&this.store.hasResourceBundle(e,c)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?E[o]===void 0&&(E[o]=!0):(this.state[o]=1,h=!1,E[o]===void 0&&(E[o]=!0),I[o]===void 0&&(I[o]=!0),t[c]===void 0&&(t[c]=!0)))}),h||(n[e]=!0)}),(Object.keys(I).length||Object.keys(E).length)&&this.queue.push({pending:E,pendingCount:Object.keys(E).length,loaded:{},errors:[],callback:Q}),{toLoad:Object.keys(I),pending:Object.keys(E),toLoadLanguages:Object.keys(n),toLoadNamespaces:Object.keys(t)}}loaded(A,C,B){const Q=A.split("|"),I=Q[0],E=Q[1];C&&this.emit("failedLoading",I,E,C),!C&&B&&this.store.addResourceBundle(I,E,B,void 0,void 0,{skipCopy:!0}),this.state[A]=C?-1:2,C&&B&&(this.state[A]=0);const n={};this.queue.forEach(t=>{IC(t.loaded,[I],E),mt(t,A),C&&t.errors.push(C),t.pendingCount===0&&!t.done&&(Object.keys(t.loaded).forEach(e=>{n[e]||(n[e]={});const h=t.loaded[e];h.length&&h.forEach(c=>{n[e][c]===void 0&&(n[e][c]=!0)})}),t.done=!0,t.errors.length?t.callback(t.errors):t.callback())}),this.emit("loaded",n),this.queue=this.queue.filter(t=>!t.done)}read(A,C,B,Q=0,I=this.retryTimeout,E){if(!A.length)return E(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:A,ns:C,fcName:B,tried:Q,wait:I,callback:E});return}this.readingCalls++;const n=(e,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const c=this.waitingReads.shift();this.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}if(e&&h&&Q<this.maxRetries){setTimeout(()=>{this.read.call(this,A,C,B,Q+1,I*2,E)},I);return}E(e,h)},t=this.backend[B].bind(this.backend);if(t.length===2){try{const e=t(A,C);e&&typeof e.then=="function"?e.then(h=>n(null,h)).catch(n):n(null,e)}catch(e){n(e)}return}return t(A,C,n)}prepareLoading(A,C,B={},Q){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),Q&&Q();y(A)&&(A=this.languageUtils.toResolveHierarchy(A)),y(C)&&(C=[C]);const I=this.queueLoad(A,C,B,Q);if(!I.toLoad.length)return I.pending.length||Q(),null;I.toLoad.forEach(E=>{this.loadOne(E)})}load(A,C,B){this.prepareLoading(A,C,{},B)}reload(A,C,B){this.prepareLoading(A,C,{reload:!0},B)}loadOne(A,C=""){const B=A.split("|"),Q=B[0],I=B[1];this.read(Q,I,"read",void 0,void 0,(E,n)=>{E&&this.logger.warn(`${C}loading namespace ${I} for language ${Q} failed`,E),!E&&n&&this.logger.log(`${C}loaded namespace ${I} for language ${Q}`,n),this.loaded(A,E,n)})}saveMissing(A,C,B,Q,I,E={},n=()=>{}){var t,e,h,c,o;if((e=(t=this.services)==null?void 0:t.utils)!=null&&e.hasLoadedNamespace&&!((c=(h=this.services)==null?void 0:h.utils)!=null&&c.hasLoadedNamespace(C))){this.logger.warn(`did not save key "${B}" as the namespace "${C}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(B==null||B==="")){if((o=this.backend)!=null&&o.create){const a=sA(N({},E),{isUpdate:I}),i=this.backend.create.bind(this.backend);if(i.length<6)try{let s;i.length===5?s=i(A,C,B,Q,a):s=i(A,C,B,Q),s&&typeof s.then=="function"?s.then(r=>n(null,r)).catch(n):n(null,s)}catch(s){n(s)}else i(A,C,B,Q,n,a)}!A||!A[0]||this.store.addResource(A[0],C,B,Q)}}}const RQ=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:g=>{let A={};if(typeof g[1]=="object"&&(A=g[1]),y(g[1])&&(A.defaultValue=g[1]),y(g[2])&&(A.tDescription=g[2]),typeof g[2]=="object"||typeof g[3]=="object"){const C=g[3]||g[2];Object.keys(C).forEach(B=>{A[B]=C[B]})}return A},interpolation:{escapeValue:!0,format:g=>g,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),YQ=g=>{var A,C;return y(g.ns)&&(g.ns=[g.ns]),y(g.fallbackLng)&&(g.fallbackLng=[g.fallbackLng]),y(g.fallbackNS)&&(g.fallbackNS=[g.fallbackNS]),((C=(A=g.supportedLngs)==null?void 0:A.indexOf)==null?void 0:C.call(A,"cimode"))<0&&(g.supportedLngs=g.supportedLngs.concat(["cimode"])),typeof g.initImmediate=="boolean"&&(g.initAsync=g.initImmediate),g},eC=()=>{},Mt=g=>{Object.getOwnPropertyNames(Object.getPrototypeOf(g)).forEach(C=>{typeof g[C]=="function"&&(g[C]=g[C].bind(g))})};class Kg extends nC{constructor(A={},C){if(super(),this.options=YQ(A),this.services={},this.logger=Ag,this.modules={external:[]},Mt(this),C&&!this.isInitialized&&!A.isClone){if(!this.options.initAsync)return this.init(A,C),this;setTimeout(()=>{this.init(A,C)},0)}}init(A={},C){this.isInitializing=!0,typeof A=="function"&&(C=A,A={}),A.defaultNS==null&&A.ns&&(y(A.ns)?A.defaultNS=A.ns:A.ns.indexOf("translation")<0&&(A.defaultNS=A.ns[0]));const B=RQ();this.options=N(N(N({},B),this.options),YQ(A)),this.options.interpolation=N(N({},B.interpolation),this.options.interpolation),A.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=A.keySeparator),A.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=A.nsSeparator);const Q=e=>e?typeof e=="function"?new e:e:null;if(!this.options.isClone){this.modules.logger?Ag.init(Q(this.modules.logger),this.options):Ag.init(null,this.options);let e;this.modules.formatter?e=this.modules.formatter:e=ft;const h=new PQ(this.options);this.store=new MQ(this.options.resources,this.options);const c=this.services;c.logger=Ag,c.resourceStore=this.store,c.languageUtils=h,c.pluralResolver=new wt(h,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==B.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),e&&(!this.options.interpolation.format||this.options.interpolation.format===B.interpolation.format)&&(c.formatter=Q(e),c.formatter.init&&c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new ut(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new qt(Q(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",(a,...i)=>{this.emit(a,...i)}),this.modules.languageDetector&&(c.languageDetector=Q(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=Q(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new tC(this.services,this.options),this.translator.on("*",(a,...i)=>{this.emit(a,...i)}),this.modules.external.forEach(a=>{a.init&&a.init(this)})}if(this.format=this.options.interpolation.format,C||(C=eC),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!=="dev"&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...h)=>this.store[e](...h)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...h)=>(this.store[e](...h),this)});const n=eA(),t=()=>{const e=(h,c)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),n.resolve(c),C(h,c)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?t():setTimeout(t,0),n}loadResources(A,C=eC){var I,E;let B=C;const Q=y(A)?A:this.language;if(typeof A=="function"&&(B=A),!this.options.resources||this.options.partialBundledLanguages){if((Q==null?void 0:Q.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return B();const n=[],t=e=>{if(!e||e==="cimode")return;this.services.languageUtils.toResolveHierarchy(e).forEach(c=>{c!=="cimode"&&n.indexOf(c)<0&&n.push(c)})};Q?t(Q):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(h=>t(h)),(E=(I=this.options.preload)==null?void 0:I.forEach)==null||E.call(I,e=>t(e)),this.services.backendConnector.load(n,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),B(e)})}else B(null)}reloadResources(A,C,B){const Q=eA();return typeof A=="function"&&(B=A,A=void 0),typeof C=="function"&&(B=C,C=void 0),A||(A=this.languages),C||(C=this.options.ns),B||(B=eC),this.services.backendConnector.reload(A,C,I=>{Q.resolve(),B(I)}),Q}use(A){if(!A)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!A.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return A.type==="backend"&&(this.modules.backend=A),(A.type==="logger"||A.log&&A.warn&&A.error)&&(this.modules.logger=A),A.type==="languageDetector"&&(this.modules.languageDetector=A),A.type==="i18nFormat"&&(this.modules.i18nFormat=A),A.type==="postProcessor"&&dQ.addPostProcessor(A),A.type==="formatter"&&(this.modules.formatter=A),A.type==="3rdParty"&&this.modules.external.push(A),this}setResolvedLanguage(A){if(!(!A||!this.languages)&&!(["cimode","dev"].indexOf(A)>-1)){for(let C=0;C<this.languages.length;C++){const B=this.languages[C];if(!(["cimode","dev"].indexOf(B)>-1)&&this.store.hasLanguageSomeTranslations(B)){this.resolvedLanguage=B;break}}!this.resolvedLanguage&&this.languages.indexOf(A)<0&&this.store.hasLanguageSomeTranslations(A)&&(this.resolvedLanguage=A,this.languages.unshift(A))}}changeLanguage(A,C){this.isLanguageChangingTo=A;const B=eA();this.emit("languageChanging",A);const Q=n=>{this.language=n,this.languages=this.services.languageUtils.toResolveHierarchy(n),this.resolvedLanguage=void 0,this.setResolvedLanguage(n)},I=(n,t)=>{t?this.isLanguageChangingTo===A&&(Q(t),this.translator.changeLanguage(t),this.isLanguageChangingTo=void 0,this.emit("languageChanged",t),this.logger.log("languageChanged",t)):this.isLanguageChangingTo=void 0,B.resolve((...e)=>this.t(...e)),C&&C(n,(...e)=>this.t(...e))},E=n=>{var h,c;!A&&!n&&this.services.languageDetector&&(n=[]);const t=y(n)?n:n&&n[0],e=this.store.hasLanguageSomeTranslations(t)?t:this.services.languageUtils.getBestMatchFromCodes(y(n)?[n]:n);e&&(this.language||Q(e),this.translator.language||this.translator.changeLanguage(e),(c=(h=this.services.languageDetector)==null?void 0:h.cacheUserLanguage)==null||c.call(h,e)),this.loadResources(e,o=>{I(o,e)})};return!A&&this.services.languageDetector&&!this.services.languageDetector.async?E(this.services.languageDetector.detect()):!A&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(E):this.services.languageDetector.detect(E):E(A),B}getFixedT(A,C,B){const Q=(I,E,...n)=>{let t;typeof E!="object"?t=this.options.overloadTranslationOptionHandler([I,E].concat(n)):t=N({},E),t.lng=t.lng||Q.lng,t.lngs=t.lngs||Q.lngs,t.ns=t.ns||Q.ns,t.keyPrefix!==""&&(t.keyPrefix=t.keyPrefix||B||Q.keyPrefix);const e=this.options.keySeparator||".";let h;return t.keyPrefix&&Array.isArray(I)?h=I.map(c=>`${t.keyPrefix}${e}${c}`):h=t.keyPrefix?`${t.keyPrefix}${e}${I}`:I,this.t(h,t)};return y(A)?Q.lng=A:Q.lngs=A,Q.ns=C,Q.keyPrefix=B,Q}t(...A){var C;return(C=this.translator)==null?void 0:C.translate(...A)}exists(...A){var C;return(C=this.translator)==null?void 0:C.exists(...A)}setDefaultNamespace(A){this.options.defaultNS=A}hasLoadedNamespace(A,C={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const B=C.lng||this.resolvedLanguage||this.languages[0],Q=this.options?this.options.fallbackLng:!1,I=this.languages[this.languages.length-1];if(B.toLowerCase()==="cimode")return!0;const E=(n,t)=>{const e=this.services.backendConnector.state[`${n}|${t}`];return e===-1||e===0||e===2};if(C.precheck){const n=C.precheck(this,E);if(n!==void 0)return n}return!!(this.hasResourceBundle(B,A)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||E(B,A)&&(!Q||E(I,A)))}loadNamespaces(A,C){const B=eA();return this.options.ns?(y(A)&&(A=[A]),A.forEach(Q=>{this.options.ns.indexOf(Q)<0&&this.options.ns.push(Q)}),this.loadResources(Q=>{B.resolve(),C&&C(Q)}),B):(C&&C(),Promise.resolve())}loadLanguages(A,C){const B=eA();y(A)&&(A=[A]);const Q=this.options.preload||[],I=A.filter(E=>Q.indexOf(E)<0&&this.services.languageUtils.isSupportedCode(E));return I.length?(this.options.preload=Q.concat(I),this.loadResources(E=>{B.resolve(),C&&C(E)}),B):(C&&C(),Promise.resolve())}dir(A){var Q,I;if(A||(A=this.resolvedLanguage||(((Q=this.languages)==null?void 0:Q.length)>0?this.languages[0]:this.language)),!A)return"rtl";if(Intl.Locale){const E=new Intl.Locale(A);if(E&&E.getTextInfo){const n=E.getTextInfo();if(n&&n.direction)return n.direction}}const C=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],B=((I=this.services)==null?void 0:I.languageUtils)||new PQ(RQ());return A.toLowerCase().indexOf("-latn")>1?"ltr":C.indexOf(B.getLanguagePartFromCode(A))>-1||A.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(A={},C){return new Kg(A,C)}cloneInstance(A={},C=eC){const B=A.forkResourceStore;B&&delete A.forkResourceStore;const Q=sA(N(N({},this.options),A),{isClone:!0}),I=new Kg(Q);if((A.debug!==void 0||A.prefix!==void 0)&&(I.logger=I.logger.clone(A)),["store","services","language"].forEach(n=>{I[n]=this[n]}),I.services=N({},this.services),I.services.utils={hasLoadedNamespace:I.hasLoadedNamespace.bind(I)},B){const n=Object.keys(this.store.data).reduce((t,e)=>(t[e]=N({},this.store.data[e]),t[e]=Object.keys(t[e]).reduce((h,c)=>(h[c]=N({},t[e][c]),h),t[e]),t),{});I.store=new MQ(n,Q),I.services.resourceStore=I.store}return I.translator=new tC(I.services,Q),I.translator.on("*",(n,...t)=>{I.emit(n,...t)}),I.init(Q,C),I.translator.options=Q,I.translator.backendConnector.services.utils={hasLoadedNamespace:I.hasLoadedNamespace.bind(I)},I}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const YA=Kg.createInstance();YA.createInstance=Kg.createInstance,YA.createInstance,YA.dir,YA.init,YA.loadResources,YA.reloadResources,YA.use,YA.changeLanguage,YA.getFixedT,YA.t,YA.exists,YA.setDefaultNamespace,YA.hasLoadedNamespace,YA.loadNamespaces,YA.loadLanguages;const dt={accountName:"Account Name",accountNumber:"Account Number",address:"Unit Address",agreeWith:"I agree with",and:"and",back:"Back",backIdCard:"Back ID Card",bankName:"Bank Name",beneficiaryBank:"Beneficiary Bank",businessLicense:"Business Registration License",cancel:"Cancel",cancelTransaction:"Cancel Transaction",close:"Close",codeTypeC:"C (With tax authority code)",codeTypeK:"K (Without code)",codeTypeTooltip:"C: With tax authority code, K: Without code",comingSoon:"Coming Soon",companyName:"Unit Name",completePaymentIn:"Complete your payment within",completeRegistration:"Complete registration",confirm:"Confirm",confirmationTitle:"Important Notice:",contactInfo:"3. Contact Person Information:",copy:"Copy",country:"Country",customLettersTooltip:"2 custom characters (default: YY)",customUnits:"Custom quantity",dateOfBirth:"Date of Birth",decrease:"Decrease",delete:"Delete",digitalSignaturePackage:"Digital Signature Package",district:"District",duration:"Duration",eContractTitle:"E-Contract",edit:"Edit",electronicInvoices:"e-invoices",email:"Email",enterIdCard:"Enter ID Card Number",enterInvoiceSymbol:"Enter Invoice Symbol",enterPassport:"Enter Passport Number",enterProviderName:"Enter Provider Name",enterTaxAuthorityCode:"Enter Tax Authority Code",errorCheckingCustomer:"Failed to check customer status",errorCreatingOrder:"Failed to create order",errorFetchTaxInfo:"Error fetching tax information.",errorFileFormat:"File format not supported",errorFileSize:"File size is too large",errorForbidden:"Access denied",errorInvalidAddress:"Address cannot contain special characters",errorInvalidCard:"Invalid ID card",errorInvalidDate:"Invalid date of birth",errorInvalidEmail:"Invalid email address",errorInvalidIdCard:"Invalid ID card number",errorInvalidName:"Only letters, numbers and underscores allowed",errorInvalidPhone:"Invalid phone number",errorInvalidProviderName:"Invalid provider name",errorInvalidRequest:"Invalid request",errorInvalidTaxAuthorityCode:"Invalid tax authority code",errorInvalidTaxCode:"Invalid tax code",errorLoadingData:"Failed to load data",errorLoadingInitPackages:"Failed to load registration packages",errorLoadingInvoicePackages:"Failed to load invoice packages",errorLoadingSignaturePackages:"Failed to load signature packages",errorNetwork:"Network connection error",errorNotFound:"Data not found",errorOrderStatus:"Unable to check order status. Please try again.",errorQRGeneration:"Unable to generate QR payment code. Please try again.",errorRequired:"This field is required",errorSearchingPackages:"Failed to search packages",errorServer:"Server error, please try again later",errorServiceUnavailable:"Service temporarily unavailable",errorTooManyRequests:"Too many requests, please try again later",errorUnauthorized:"Unauthorized access",errorUnknown:"An error occurred",errorValidation:"Invalid data",female:"Female",fileFormat:"Format",frontIdCard:"Front ID Card",fullName:"Full Name",gender:"Gender",hasUsedEInvoice:"Have you used e-invoices?",hasUsedEInvoiceBefore:"Are you using another e-invoice provider other than M-invoice?",hotlineDesc:"(Free Consulting and Support Hotline)",hotlineDomestic:"Hotline:",idNumber:"ID Card Number",increase:"Increase",informationSent:"Information sent to the provider",invoicePackage:"Invoice Package",invoiceSymbol:"Invoice Symbol",invoiceTemplate:"Invoice Template",invoiceTemplateTypes:{1:"1 (VAT Invoice)",2:"2 (Sales Invoice)",3:"3 (Public Asset Sales)",4:"4 (National Reserve Sales)",5:"5 (Stamps, Tickets, Other Cards)",6:"6 (Internal Documents)",7:"7 (Commercial Invoice)",8:"8 (VAT with Integrated Tax)",9:"9 (Sales with Integrated Tax)"},invoiceTypeB:"B (Agent)",invoiceTypeD:"D (Asset)",invoiceTypeG:"G (VAT Stamp)",invoiceTypeH:"H (Sales Stamp)",invoiceTypeL:"L (Tax Authority)",invoiceTypeM:"M (Cash Register)",invoiceTypeN:"N (Internal)",invoiceTypeT:"T (Registration)",invoiceTypeTooltip:"Invoice type",invoiceTypeX:"X (Commercial)",invoiceUsageInfo:"4. E-INVOICE USAGE INFORMATION:",invoicesPerMonth:"invoices/month",legalRepInfo:"2. Legal Representative Information:",legalRepNote:"Please check and enter the correct legal representative name according to the uploaded business license.",loading:"Loading...",male:"Male",maxFileSize:"Max 500KB",month:"Month",mostSuitablePackage:"Most Suitable Package",next:"Continue",noDataAvailable:"No data available",noPackageFound:"No package found.",notice1:"Please check your email inbox regularly to receive account information notifications from the provider.",notice2:"If you have not received the email account information (username/password) within 2 hours, please contact the information below for the fastest support:","notice3.1":"After being granted an account, please go to the Link","notice3.2":"to connect and use the service HDDT",of:"of",ok:"OK",optional:"Optional",or:"or",orderCreated:"Order created successfully",orderExpired:"Order has expired",orderInfo:"Order Information",orderSummary:"Order Summary",organizationCert:"Organization Registration Certificate",package:"Package",passport:"Passport",paymentAmount:"Payment Amount",paymentFailed:"Payment Failed",paymentInstructions:["Open your banking app or digital wallet on your phone","Select the QR Code scan feature in the app","Scan the QR code on this page and make payment"],paymentInstructionsTitle:"QR Payment Instructions",paymentMethod:"Payment Method:",paymentSuccess:"Payment Successful!",paymentTimeout:"Payment timeout",paymentTimeoutMessage:"Payment timeout! Please try again.",paymentTitle:"Payment",permanentAddress:"Permanent address",phone:"Phone Number",product:"Product",provider:"Provider",providerName:"Provider Name",province:"Province/City",qrPayment:"QR Code Payment",qrPaymentTitle:"Scan QR Code to Pay",quantity:"Quantity",registrationFee:"Registration Fee",required:"Required",returnHome:"Return Home",returnToStep1:"Return to step 1",sampleNumberTooltip:"Invoice template number (1-9)",save:"Save",searchUnits:"Units per month",selectFile:"Select File",selectInvoicePackage:"Select E-Invoice Package",selectProvider:"Select Provider",selectSignaturePackage:"Select Digital Signature Package",selectSubscriptionPackage:"Select Subscription Package",selectedProducts:"Selected Products",settings:"Settings",signaturePackage:"Digital Signature Package",softwareLicense:"E-invoice software license",stepInfo:"Information",stepPayment:"Confirmation & Payment",stepPlan:"Invoice Package",subscriptionPackage:"Subscription Package",taxAuthority:"Tax Authority",taxAuthorityCode:"5 characters issued by the Authority for cash register bills",taxCode:"Unit Tax Code",termsAndUsagePolicy:"Terms and Usage Policy",timeLeft:"Time Left",total:"Total",totalAmount:"Total Amount",totalPrice:"Total Price",transactionCanceled:"Transaction has been canceled. Returning to registration page.",unit:"Unit",unitInfo:"1. Unit Information",unitPerMonth:"units/month",unitPrice:"Unit Price",unitsPerMonth:"units/ month",uploadBackId:"Upload Back ID Card",uploadFile:"Upload File",uploadFrontId:"Upload Front ID Card",uploadLogo:"Upload Logo",usagePolicy:"Usage Policy",ward:"Ward",website:"Website",widgetTitle:"E-Invoice Registration",yearTooltip:"Release year (last 2 digits)"},lt={accountName:"Tên tài khoản",accountNumber:"Số tài khoản",address:"Địa chỉ đơn vị",agreeWith:"Tôi đồng ý với",and:"và",back:"Quay lại",backIdCard:"Mặt sau CCCD",bankName:"Ngân hàng",beneficiaryBank:"Ngân hàng thụ hưởng",businessLicense:"Giấy phép đăng ký kinh doanh",cancel:"Hủy",cancelTransaction:"Hủy giao dịch",close:"Đóng",codeTypeC:"C (Có mã CQT)",codeTypeK:"K (Không mã)",codeTypeTooltip:"C: Có mã CQT, K: Không mã",comingSoon:"Sắp ra mắt",companyName:"Tên đơn vị",completePaymentIn:"Hoàn tất thanh toán của bạn trong",completeRegistration:"Hoàn tất đăng ký",confirm:"Xác nhận",confirmationTitle:"Thông tin lưu ý:",contactInfo:"3. Thông tin người liên hệ:",copy:"Bản",country:"Quốc gia",customLettersTooltip:"2 ký tự tùy chọn (mặc định: YY)",customUnits:"Số lượng tùy chỉnh",dateOfBirth:"Ngày sinh",decrease:"Giảm",delete:"Xóa",digitalSignaturePackage:"Gói chữ ký số",district:"Quận/Huyện",duration:"Thời hạn",eContractTitle:"E-Contract",edit:"Chỉnh sửa",electronicInvoices:"hóa đơn điện tử",email:"Email",enterIdCard:"Nhập số CMND/CCCD",enterInvoiceSymbol:"Nhập ký hiệu hóa đơn",enterPassport:"Nhập số hộ chiếu",enterProviderName:"Nhập tên nhà cung cấp",enterTaxAuthorityCode:"Nhập mã CQT cấp",errorCheckingCustomer:"Không thể kiểm tra trạng thái khách hàng",errorCreatingOrder:"Không thể tạo đơn hàng",errorFetchTaxInfo:"Lỗi khi lấy thông tin mã số thuế.",errorFileFormat:"Định dạng tệp không được hỗ trợ",errorFileSize:"Kích thước tệp quá lớn",errorForbidden:"Truy cập bị từ chối",errorInvalidAddress:"Địa chỉ không được chứa ký tự đặc biệt",errorInvalidCard:"CCCD không hợp lệ",errorInvalidDate:"Ngày sinh không hợp lệ",errorInvalidEmail:"Email không hợp lệ",errorInvalidIdCard:"Số CCCD không hợp lệ",errorInvalidName:"Chỉ được dùng chữ cái, số và dấu gạch dưới",errorInvalidPhone:"Số điện thoại không hợp lệ",errorInvalidProviderName:"Tên nhà cung cấp không hợp lệ",errorInvalidRequest:"Yêu cầu không hợp lệ",errorInvalidTaxAuthorityCode:"Mã CQT cấp không hợp lệ",errorInvalidTaxCode:"Mã số thuế không hợp lệ",errorLoadingData:"Không thể tải dữ liệu",errorLoadingInitPackages:"Không thể tải gói đăng ký",errorLoadingInvoicePackages:"Không thể tải gói hóa đơn",errorLoadingSignaturePackages:"Không thể tải gói chữ ký số",errorNetwork:"Lỗi kết nối mạng",errorNotFound:"Không tìm thấy dữ liệu",errorOrderStatus:"Không thể kiểm tra trạng thái đơn hàng. Vui lòng thử lại.",errorQRGeneration:"Không thể tạo mã QR thanh toán. Vui lòng thử lại.",errorRequired:"Trường này là bắt buộc",errorSearchingPackages:"Không thể tìm kiếm gói",errorServer:"Lỗi máy chủ, vui lòng thử lại sau",errorServiceUnavailable:"Dịch vụ tạm thời không khả dụng",errorTooManyRequests:"Quá nhiều yêu cầu, vui lòng thử lại sau",errorUnauthorized:"Không có quyền truy cập",errorUnknown:"Đã xảy ra lỗi",errorValidation:"Dữ liệu không hợp lệ",female:"Nữ",fileFormat:"Định dạng",frontIdCard:"Mặt trước CCCD",fullName:"Họ và tên",gender:"Giới tính",hasUsedEInvoice:"Bạn đã sử dụng hoá đơn điện tử?",hasUsedEInvoiceBefore:"Bạn đang sử dụng nhà NCC hoá đơn điện tử khác M-invoice không?",hotlineDesc:"(Tổng đài Tư vấn, Hỗ trợ miễn phí)",hotlineDomestic:"Hotline:",idNumber:"CCCD",increase:"Tăng",informationSent:"Đã gửi thông tin sang nhà cung cấp",invoicePackage:"Gói hóa đơn",invoiceSymbol:"Ký hiệu hóa đơn",invoiceTemplate:"Mẫu số",invoiceTemplateTypes:{1:"1 (Hóa đơn GTGT)",2:"2 (Hóa đơn bán hàng)",3:"3 (Bán tài sản công)",4:"4 (Bán dự trữ quốc gia)",5:"5 (Tem, vé, thẻ khác)",6:"6 (Chứng từ nội bộ)",7:"7 (Hóa đơn thương mại)",8:"8 (GTGT tích hợp thuế)",9:"9 (Bán hàng tích hợp thuế)"},invoiceTypeB:"B (Đại lý)",invoiceTypeD:"D (Tài sản)",invoiceTypeG:"G (Tem GTGT)",invoiceTypeH:"H (Tem bán hàng)",invoiceTypeL:"L (CQT)",invoiceTypeM:"M (Máy tính tiền)",invoiceTypeN:"N (Nội bộ)",invoiceTypeT:"T (Đăng ký)",invoiceTypeTooltip:"Loại hóa đơn",invoiceTypeX:"X (Thương mại)",invoiceUsageInfo:"4. THÔNG TIN SỬ DỤNG HDDT:",invoicesPerMonth:"hóa đơn/tháng",legalRepInfo:"2. Thông tin người đại diện pháp luật:",legalRepNote:"Vui lòng kiểm tra và nhập đúng tên người đại diện theo Giấy phép kinh doanh đã tải lên.",loading:"Đang tải...",male:"Nam",maxFileSize:"Tối đa 500Kb",month:"Tháng",mostSuitablePackage:"Gói phù hợp nhất",next:"Tiếp tục",noDataAvailable:"Không có dữ liệu",noPackageFound:"Không tìm thấy gói nào.",notice1:"Vui lòng thường xuyên kiểm tra hợp thư Email nhận thông báo thông tin tài khoản từ nhà cung cấp",notice2:"Trong vòng 2 giờ nếu chưa nhận được thông tin Email tài khoản (username/password). Bạn có thể liên hệ thông tin phía bên dưới để được hỗ trợ sớm nhất:","notice3.1":"Sau khi được cấp tài khoản, vui lòng vào Link","notice3.2":"để kết nối và sử dụng dịch vụ HDDT",of:"của",ok:"OK",optional:"Tùy chọn",or:"hoặc",orderCreated:"Đơn hàng đã được tạo thành công",orderExpired:"Đơn hàng đã hết hạn",orderInfo:"Thông tin đơn hàng",orderSummary:"Tóm tắt đơn hàng",organizationCert:"Giấy chứng nhận đăng ký doanh nghiệp",package:"Gói",passport:"Hộ chiếu",paymentAmount:"Số tiền thanh toán",paymentFailed:"Thanh toán thất bại",paymentInstructions:["Mở ứng dụng Ngân hàng hoặc Ví điện tử trên điện thoại","Trên ứng dụng chọn tính năng Quét mã QR","Quét mã QR ở trang này và thanh toán"],paymentInstructionsTitle:"Hướng dẫn thanh toán QR",paymentMethod:"Hình thức thanh toán:",paymentSuccess:"Thanh toán thành công!",paymentTimeout:"Hết thời gian thanh toán",paymentTimeoutMessage:"Hết thời gian thanh toán! Vui lòng thử lại.",paymentTitle:"Thanh toán",permanentAddress:"Địa chỉ thường trú",phone:"Số điện thoại",product:"Sản phẩm",provider:"Nhà cung cấp",providerName:"Tên NCC",province:"Tỉnh/Thành phố",qrPayment:"Thanh toán qua mã QR",qrPaymentTitle:"Quét mã QR để thanh toán",quantity:"Số lượng",registrationFee:"Phí đăng ký",required:"Bắt buộc",returnHome:"Trở về trang chủ",returnToStep1:"Quay lại bước 1",sampleNumberTooltip:"Mẫu số hóa đơn (1-9)",save:"Lưu",searchUnits:"Số đơn/tháng",selectFile:"Chọn tệp",selectInvoicePackage:"Chọn gói hóa đơn điện tử",selectProvider:"Chọn nhà cung cấp",selectSignaturePackage:"Chọn gói chữ ký số",selectSubscriptionPackage:"Chọn gói đăng ký",selectedProducts:"Sản phẩm đã chọn",settings:"Thiết lập",signaturePackage:"Gói chữ ký số",softwareLicense:"Bản quyền phần mềm hóa đơn điện tử",stepInfo:"Thông Tin",stepPayment:"Xác Nhận Và Thanh Toán",stepPlan:"Gói Hóa Đơn",subscriptionPackage:"Gói đăng ký",taxAuthority:"CQT quản lý",taxAuthorityCode:"5 ký tự do CQT cấp cho loại hóa đơn máy tính tiền",taxCode:"Mã số thuế đơn vị",termsAndUsagePolicy:"Điều khoản và Chính sách sử dụng",timeLeft:"Thời gian còn lại",total:"Tổng cộng",totalAmount:"Tổng tiền",totalPrice:"Thành tiền",transactionCanceled:"Giao dịch đã được hủy. Quay về trang đăng ký.",unit:"Đơn vị tính",unitInfo:"1. Thông tin đơn vị",unitPerMonth:"đơn/tháng",unitPrice:"Đơn giá",unitsPerMonth:"đơn/ tháng",uploadBackId:"Tải lên mặt sau CCCD",uploadFile:"Tải lên tệp",uploadFrontId:"Tải lên mặt trước CCCD",uploadLogo:"Tải logo lên",usagePolicy:"Chính sách sử dụng",ward:"Phường/Xã",website:"Website",widgetTitle:"Đăng ký hóa đơn điện tử",yearTooltip:"Năm phát hành (2 chữ số cuối)"},{slice:vt,forEach:Pt}=[];function Jt(g){return Pt.call(vt.call(arguments,1),A=>{if(A)for(const C in A)g[C]===void 0&&(g[C]=A[C])}),g}function Tt(g){return typeof g!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(C=>C.test(g))}const xQ=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Ht=function(g,A){const B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},Q=encodeURIComponent(A);let I=`${g}=${Q}`;if(B.maxAge>0){const E=B.maxAge-0;if(Number.isNaN(E))throw new Error("maxAge should be a Number");I+=`; Max-Age=${Math.floor(E)}`}if(B.domain){if(!xQ.test(B.domain))throw new TypeError("option domain is invalid");I+=`; Domain=${B.domain}`}if(B.path){if(!xQ.test(B.path))throw new TypeError("option path is invalid");I+=`; Path=${B.path}`}if(B.expires){if(typeof B.expires.toUTCString!="function")throw new TypeError("option expires is invalid");I+=`; Expires=${B.expires.toUTCString()}`}if(B.httpOnly&&(I+="; HttpOnly"),B.secure&&(I+="; Secure"),B.sameSite)switch(typeof B.sameSite=="string"?B.sameSite.toLowerCase():B.sameSite){case!0:I+="; SameSite=Strict";break;case"lax":I+="; SameSite=Lax";break;case"strict":I+="; SameSite=Strict";break;case"none":I+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return B.partitioned&&(I+="; Partitioned"),I},zQ={create(g,A,C,B){let Q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};C&&(Q.expires=new Date,Q.expires.setTime(Q.expires.getTime()+C*60*1e3)),B&&(Q.domain=B),document.cookie=Ht(g,A,Q)},read(g){const A=`${g}=`,C=document.cookie.split(";");for(let B=0;B<C.length;B++){let Q=C[B];for(;Q.charAt(0)===" ";)Q=Q.substring(1,Q.length);if(Q.indexOf(A)===0)return Q.substring(A.length,Q.length)}return null},remove(g,A){this.create(g,"",-1,A)}};var kt={name:"cookie",lookup(g){let{lookupCookie:A}=g;if(A&&typeof document!="undefined")return zQ.read(A)||void 0},cacheUserLanguage(g,A){let{lookupCookie:C,cookieMinutes:B,cookieDomain:Q,cookieOptions:I}=A;C&&typeof document!="undefined"&&zQ.create(C,g,B,Q,I)}},Rt={name:"querystring",lookup(g){var B;let{lookupQuerystring:A}=g,C;if(typeof window!="undefined"){let{search:Q}=window.location;!window.location.search&&((B=window.location.hash)==null?void 0:B.indexOf("?"))>-1&&(Q=window.location.hash.substring(window.location.hash.indexOf("?")));const E=Q.substring(1).split("&");for(let n=0;n<E.length;n++){const t=E[n].indexOf("=");t>0&&E[n].substring(0,t)===A&&(C=E[n].substring(t+1))}}return C}},Yt={name:"hash",lookup(g){var Q;let{lookupHash:A,lookupFromHashIndex:C}=g,B;if(typeof window!="undefined"){const{hash:I}=window.location;if(I&&I.length>2){const E=I.substring(1);if(A){const n=E.split("&");for(let t=0;t<n.length;t++){const e=n[t].indexOf("=");e>0&&n[t].substring(0,e)===A&&(B=n[t].substring(e+1))}}if(B)return B;if(!B&&C>-1){const n=I.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(Q=n[typeof C=="number"?C:0])==null?void 0:Q.replace("/",""):void 0}}}return B}};let kg=null;const GQ=()=>{if(kg!==null)return kg;try{if(kg=typeof window!="undefined"&&window.localStorage!==null,!kg)return!1;const g="i18next.translate.boo";window.localStorage.setItem(g,"foo"),window.localStorage.removeItem(g)}catch(g){kg=!1}return kg};var xt={name:"localStorage",lookup(g){let{lookupLocalStorage:A}=g;if(A&&GQ())return window.localStorage.getItem(A)||void 0},cacheUserLanguage(g,A){let{lookupLocalStorage:C}=A;C&&GQ()&&window.localStorage.setItem(C,g)}};let Rg=null;const OQ=()=>{if(Rg!==null)return Rg;try{if(Rg=typeof window!="undefined"&&window.sessionStorage!==null,!Rg)return!1;const g="i18next.translate.boo";window.sessionStorage.setItem(g,"foo"),window.sessionStorage.removeItem(g)}catch(g){Rg=!1}return Rg};var zt={name:"sessionStorage",lookup(g){let{lookupSessionStorage:A}=g;if(A&&OQ())return window.sessionStorage.getItem(A)||void 0},cacheUserLanguage(g,A){let{lookupSessionStorage:C}=A;C&&OQ()&&window.sessionStorage.setItem(C,g)}},Gt={name:"navigator",lookup(g){const A=[];if(typeof navigator!="undefined"){const{languages:C,userLanguage:B,language:Q}=navigator;if(C)for(let I=0;I<C.length;I++)A.push(C[I]);B&&A.push(B),Q&&A.push(Q)}return A.length>0?A:void 0}},Ot={name:"htmlTag",lookup(g){let{htmlTag:A}=g,C;const B=A||(typeof document!="undefined"?document.documentElement:null);return B&&typeof B.getAttribute=="function"&&(C=B.getAttribute("lang")),C}},Xt={name:"path",lookup(g){var Q;let{lookupFromPathIndex:A}=g;if(typeof window=="undefined")return;const C=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(C)?(Q=C[typeof A=="number"?A:0])==null?void 0:Q.replace("/",""):void 0}},Ft={name:"subdomain",lookup(g){var Q,I;let{lookupFromSubdomainIndex:A}=g;const C=typeof A=="number"?A+1:1,B=typeof window!="undefined"&&((I=(Q=window.location)==null?void 0:Q.hostname)==null?void 0:I.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(B)return B[C]}};let XQ=!1;try{document.cookie,XQ=!0}catch(g){}const FQ=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];XQ||FQ.splice(1,1);const Lt=()=>({order:FQ,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:g=>g});class LQ{constructor(A){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(A,C)}init(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=A,this.options=Jt(C,this.options||{},Lt()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=Q=>Q.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=B,this.addDetector(kt),this.addDetector(Rt),this.addDetector(xt),this.addDetector(zt),this.addDetector(Gt),this.addDetector(Ot),this.addDetector(Xt),this.addDetector(Ft),this.addDetector(Yt)}addDetector(A){return this.detectors[A.name]=A,this}detect(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,C=[];return A.forEach(B=>{if(this.detectors[B]){let Q=this.detectors[B].lookup(this.options);Q&&typeof Q=="string"&&(Q=[Q]),Q&&(C=C.concat(Q))}}),C=C.filter(B=>B!=null&&!Tt(B)).map(B=>this.options.convertDetectedLanguage(B)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?C:C.length>0?C[0]:null}cacheUserLanguage(A){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;C&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(A)>-1||C.forEach(B=>{this.detectors[B]&&this.detectors[B].cacheUserLanguage(A,this.options)}))}}LQ.type="languageDetector";function NC(g){"@babel/helpers - typeof";return NC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},NC(g)}function NQ(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest=="undefined"?"undefined":NC(XMLHttpRequest))==="object"}function Nt(g){return!!g&&typeof g.then=="function"}function yt(g){return Nt(g)?g:Promise.resolve(g)}function yQ(g,A){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(g);A&&(B=B.filter(function(Q){return Object.getOwnPropertyDescriptor(g,Q).enumerable})),C.push.apply(C,B)}return C}function bQ(g){for(var A=1;A<arguments.length;A++){var C=arguments[A]!=null?arguments[A]:{};A%2?yQ(Object(C),!0).forEach(function(B){bt(g,B,C[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):yQ(Object(C)).forEach(function(B){Object.defineProperty(g,B,Object.getOwnPropertyDescriptor(C,B))})}return g}function bt(g,A,C){return(A=jt(A))in g?Object.defineProperty(g,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[A]=C,g}function jt(g){var A=Kt(g,"string");return ug(A)=="symbol"?A:A+""}function Kt(g,A){if(ug(g)!="object"||!g)return g;var C=g[Symbol.toPrimitive];if(C!==void 0){var B=C.call(g,A);if(ug(B)!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(g)}function ug(g){"@babel/helpers - typeof";return ug=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},ug(g)}var cg=typeof fetch=="function"?fetch:void 0;typeof global!="undefined"&&global.fetch?cg=global.fetch:typeof window!="undefined"&&window.fetch&&(cg=window.fetch);var pg;NQ()&&(typeof global!="undefined"&&global.XMLHttpRequest?pg=global.XMLHttpRequest:typeof window!="undefined"&&window.XMLHttpRequest&&(pg=window.XMLHttpRequest));var hC;if(typeof ActiveXObject=="function"&&(typeof global!="undefined"&&global.ActiveXObject?hC=global.ActiveXObject:typeof window!="undefined"&&window.ActiveXObject&&(hC=window.ActiveXObject)),typeof cg!="function"&&(cg=void 0),!cg&&!pg&&!hC)try{Promise.resolve().then(()=>E0).then(function(g){cg=g.default}).catch(function(){})}catch(g){}var yC=function(A,C){if(C&&ug(C)==="object"){var B="";for(var Q in C)B+="&"+encodeURIComponent(Q)+"="+encodeURIComponent(C[Q]);if(!B)return A;A=A+(A.indexOf("?")!==-1?"&":"?")+B.slice(1)}return A},jQ=function(A,C,B,Q){var I=function(t){if(!t.ok)return B(t.statusText||"Error",{status:t.status});t.text().then(function(e){B(null,{status:t.status,data:e})}).catch(B)};if(Q){var E=Q(A,C);if(E instanceof Promise){E.then(I).catch(B);return}}typeof fetch=="function"?fetch(A,C).then(I).catch(B):cg(A,C).then(I).catch(B)},KQ=!1,pt=function(A,C,B,Q){A.queryStringParams&&(C=yC(C,A.queryStringParams));var I=bQ({},typeof A.customHeaders=="function"?A.customHeaders():A.customHeaders);typeof window=="undefined"&&typeof global!="undefined"&&typeof global.process!="undefined"&&global.process.versions&&global.process.versions.node&&(I["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),B&&(I["Content-Type"]="application/json");var E=typeof A.requestOptions=="function"?A.requestOptions(B):A.requestOptions,n=bQ({method:B?"POST":"GET",body:B?A.stringify(B):void 0,headers:I},KQ?{}:E),t=typeof A.alternateFetch=="function"&&A.alternateFetch.length>=1?A.alternateFetch:void 0;try{jQ(C,n,Q,t)}catch(e){if(!E||Object.keys(E).length===0||!e.message||e.message.indexOf("not implemented")<0)return Q(e);try{Object.keys(E).forEach(function(h){delete n[h]}),jQ(C,n,Q,t),KQ=!0}catch(h){Q(h)}}},St=function(A,C,B,Q){B&&ug(B)==="object"&&(B=yC("",B).slice(1)),A.queryStringParams&&(C=yC(C,A.queryStringParams));try{var I=pg?new pg:new hC("MSXML2.XMLHTTP.3.0");I.open(B?"POST":"GET",C,1),A.crossDomain||I.setRequestHeader("X-Requested-With","XMLHttpRequest"),I.withCredentials=!!A.withCredentials,B&&I.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),I.overrideMimeType&&I.overrideMimeType("application/json");var E=A.customHeaders;if(E=typeof E=="function"?E():E,E)for(var n in E)I.setRequestHeader(n,E[n]);I.onreadystatechange=function(){I.readyState>3&&Q(I.status>=400?I.statusText:null,{status:I.status,data:I.responseText})},I.send(B)}catch(t){console&&console.log(t)}},Ut=function(A,C,B,Q){if(typeof B=="function"&&(Q=B,B=void 0),Q=Q||function(){},cg&&C.indexOf("file:")!==0)return pt(A,C,B,Q);if(NQ()||typeof ActiveXObject=="function")return St(A,C,B,Q);Q(new Error("No fetch and no xhr implementation found!"))};function Yg(g){"@babel/helpers - typeof";return Yg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Yg(g)}function pQ(g,A){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(g);A&&(B=B.filter(function(Q){return Object.getOwnPropertyDescriptor(g,Q).enumerable})),C.push.apply(C,B)}return C}function bC(g){for(var A=1;A<arguments.length;A++){var C=arguments[A]!=null?arguments[A]:{};A%2?pQ(Object(C),!0).forEach(function(B){SQ(g,B,C[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(C)):pQ(Object(C)).forEach(function(B){Object.defineProperty(g,B,Object.getOwnPropertyDescriptor(C,B))})}return g}function Zt(g,A){if(!(g instanceof A))throw new TypeError("Cannot call a class as a function")}function Vt(g,A){for(var C=0;C<A.length;C++){var B=A[C];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(g,UQ(B.key),B)}}function Wt(g,A,C){return A&&Vt(g.prototype,A),Object.defineProperty(g,"prototype",{writable:!1}),g}function SQ(g,A,C){return(A=UQ(A))in g?Object.defineProperty(g,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):g[A]=C,g}function UQ(g){var A=$t(g,"string");return Yg(A)=="symbol"?A:A+""}function $t(g,A){if(Yg(g)!="object"||!g)return g;var C=g[Symbol.toPrimitive];if(C!==void 0){var B=C.call(g,A);if(Yg(B)!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(g)}var _t=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(C){return JSON.parse(C)},stringify:JSON.stringify,parsePayload:function(C,B,Q){return SQ({},B,Q||"")},parseLoadPayload:function(C,B){},request:Ut,reloadInterval:typeof window!="undefined"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},ZQ=function(){function g(A){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Zt(this,g),this.services=A,this.options=C,this.allOptions=B,this.type="backend",this.init(A,C,B)}return Wt(g,[{key:"init",value:function(C){var B=this,Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=C,this.options=bC(bC(bC({},_t()),this.options||{}),Q),this.allOptions=I,this.services&&this.options.reloadInterval){var E=setInterval(function(){return B.reload()},this.options.reloadInterval);Yg(E)==="object"&&typeof E.unref=="function"&&E.unref()}}},{key:"readMulti",value:function(C,B,Q){this._readAny(C,C,B,B,Q)}},{key:"read",value:function(C,B,Q){this._readAny([C],C,[B],B,Q)}},{key:"_readAny",value:function(C,B,Q,I,E){var n=this,t=this.options.loadPath;typeof this.options.loadPath=="function"&&(t=this.options.loadPath(C,Q)),t=yt(t),t.then(function(e){if(!e)return E(null,{});var h=n.services.interpolator.interpolate(e,{lng:C.join("+"),ns:Q.join("+")});n.loadUrl(h,E,B,I)})}},{key:"loadUrl",value:function(C,B,Q,I){var E=this,n=typeof Q=="string"?[Q]:Q,t=typeof I=="string"?[I]:I,e=this.options.parseLoadPayload(n,t);this.options.request(this.options,C,e,function(h,c){if(c&&(c.status>=500&&c.status<600||!c.status))return B("failed loading "+C+"; status code: "+c.status,!0);if(c&&c.status>=400&&c.status<500)return B("failed loading "+C+"; status code: "+c.status,!1);if(!c&&h&&h.message){var o=h.message.toLowerCase(),a=["failed","fetch","network","load"].find(function(r){return o.indexOf(r)>-1});if(a)return B("failed loading "+C+": "+h.message,!0)}if(h)return B(h,!1);var i,s;try{typeof c.data=="string"?i=E.options.parse(c.data,Q,I):i=c.data}catch(r){s="failed parsing "+C+" to json"}if(s)return B(s,!1);B(null,i)})}},{key:"create",value:function(C,B,Q,I,E){var n=this;if(this.options.addPath){typeof C=="string"&&(C=[C]);var t=this.options.parsePayload(B,Q,I),e=0,h=[],c=[];C.forEach(function(o){var a=n.options.addPath;typeof n.options.addPath=="function"&&(a=n.options.addPath(o,B));var i=n.services.interpolator.interpolate(a,{lng:o,ns:B});n.options.request(n.options,i,t,function(s,r){e+=1,h.push(s),c.push(r),e===C.length&&typeof E=="function"&&E(h,c)})})}}},{key:"reload",value:function(){var C=this,B=this.services,Q=B.backendConnector,I=B.languageUtils,E=B.logger,n=Q.language;if(!(n&&n.toLowerCase()==="cimode")){var t=[],e=function(c){var o=I.toResolveHierarchy(c);o.forEach(function(a){t.indexOf(a)<0&&t.push(a)})};e(n),this.allOptions.preload&&this.allOptions.preload.forEach(function(h){return e(h)}),t.forEach(function(h){C.allOptions.ns.forEach(function(c){Q.read(h,c,"read",null,null,function(o,a){o&&E.warn("loading namespace ".concat(c," for language ").concat(h," failed"),o),!o&&a&&E.log("loaded namespace ".concat(c," for language ").concat(h),a),Q.loaded("".concat(h,"|").concat(c),o,a)})})})}}}])}();ZQ.type="backend",YA.use(ZQ).use(LQ).init({lng:"vi",fallbackLng:"vi",debug:!1,resources:{en:{translation:dt},vi:{translation:lt}},interpolation:{escapeValue:!1},returnObjects:!0});function A0(g){YA.changeLanguage(g)}function w(g,A){return YA.t(g,N({returnObjects:!0},A))}function g0(g="dev"){const A={dev:{invoiceHubBaseUrl:"https://stag-invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-uat-api-outscope-pos.atomsolution.vn/v1/portal",posBvbApiUrl:"https://bvbank-stag.atomsolution.vn/v1/portal"},stag:{invoiceHubBaseUrl:"https://stag-invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-uat-api-outscope-pos.atomsolution.vn/v1/portal",posBvbApiUrl:"https://bvbank-stag.atomsolution.vn/v1/portal"},uat:{invoiceHubBaseUrl:"https://stag-invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-uat-api-outscope-pos.atomsolution.vn/v1/portal",posBvbApiUrl:"https://bvbank-api-outscope.atomsolution.vn/v1/portal"},pilot:{invoiceHubBaseUrl:"https://invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-smartmerchant-pl-api.ocb.com.vn/v1/portal",posBvbApiUrl:"https://api-outscope-pos.bvbank.net.vn/v1/portal"},prod:{invoiceHubBaseUrl:"https://invoice-hub.atomsolution.vn",posOcbApiUrl:"https://ocb-smartmerchant-api.ocb.com.vn/v1/portal",posBvbApiUrl:"https://api-outscope-pos.bvbank.net.vn/v1/portal"}};return A[g]||A.dev}let cC=null,jC=!1;function VQ(g){if(!["dev","uat","prod","stag","pilot"].includes(g))throw new Error(`Invalid mode: ${g}. Valid modes are 'dev', 'uat', 'prod', 'stag', 'pilot'.`);cC=g,jC=!0;try{localStorage.setItem("currentMode",g)}catch(A){console.warn("Could not save to localStorage:",A)}}function C0(){if(jC&&cC)return cC;try{const g=localStorage.getItem("currentMode");if(g)return cC=g,jC=!0,g}catch(g){console.warn("Could not read from localStorage:",g)}return"dev"}function oC(){const g=C0();return g0(g)}let KC=null,pC=null;function B0(g){return K(this,null,function*(){if(g.mode&&VQ(g.mode),g.language&&UC(g.language),!pC){const{InvoiceRegisterWidget:B}=yield Promise.resolve().then(()=>rn);pC=B}const A=typeof g.selector=="string"?document.querySelector(g.selector):g.selector;if(!A)throw new Error(`[WidgetSDK] Mount element not found: ${g.selector}`);function C(){A.innerHTML="",g.onClose&&g.onClose()}return pC(A,C,g.onShowPolicy||(()=>{}),g.data||{},g.theme),{destroy:C}})}function Q0(g){return K(this,null,function*(){if(g.mode&&VQ(g.mode),g.language&&UC(g.language),!KC){const{EContractWidget:B}=yield Promise.resolve().then(()=>rn);KC=B}const A=typeof g.selector=="string"?document.querySelector(g.selector):g.selector;if(!A)throw new Error(`[WidgetSDK] Mount element not found: ${g.selector}`);function C(){A.innerHTML="",g.onClose&&g.onClose()}return KC(A,C,g.data||{},g.theme),{destroy:C}})}let SC=new Set;function UC(g){if(g!=="vi"&&g!=="en")throw new Error(`[WidgetSDK] Unsupported language: ${g}`);A0(g),SC.forEach(A=>{A.rerender&&A.rerender()})}function ZC(g){SC.add(g)}function VC(g){SC.delete(g)}var WQ=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function WC(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}var iC={exports:{}},$Q;function I0(){return $Q||($Q=1,function(g,A){var C=typeof globalThis!="undefined"&&globalThis||typeof self!="undefined"&&self||typeof WQ!="undefined"&&WQ,B=function(){function I(){this.fetch=!1,this.DOMException=C.DOMException}return I.prototype=C,new I}();(function(I){(function(E){var n=typeof I!="undefined"&&I||typeof self!="undefined"&&self||typeof n!="undefined"&&n,t={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(D){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function e(D){return D&&DataView.prototype.isPrototypeOf(D)}if(t.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(D){return D&&h.indexOf(Object.prototype.toString.call(D))>-1};function o(D){if(typeof D!="string"&&(D=String(D)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(D)||D==="")throw new TypeError('Invalid character in header field name: "'+D+'"');return D.toLowerCase()}function a(D){return typeof D!="string"&&(D=String(D)),D}function i(D){var k={next:function(){var j=D.shift();return{done:j===void 0,value:j}}};return t.iterable&&(k[Symbol.iterator]=function(){return k}),k}function s(D){this.map={},D instanceof s?D.forEach(function(k,j){this.append(j,k)},this):Array.isArray(D)?D.forEach(function(k){this.append(k[0],k[1])},this):D&&Object.getOwnPropertyNames(D).forEach(function(k){this.append(k,D[k])},this)}s.prototype.append=function(D,k){D=o(D),k=a(k);var j=this.map[D];this.map[D]=j?j+", "+k:k},s.prototype.delete=function(D){delete this.map[o(D)]},s.prototype.get=function(D){return D=o(D),this.has(D)?this.map[D]:null},s.prototype.has=function(D){return this.map.hasOwnProperty(o(D))},s.prototype.set=function(D,k){this.map[o(D)]=a(k)},s.prototype.forEach=function(D,k){for(var j in this.map)this.map.hasOwnProperty(j)&&D.call(k,this.map[j],j,this)},s.prototype.keys=function(){var D=[];return this.forEach(function(k,j){D.push(j)}),i(D)},s.prototype.values=function(){var D=[];return this.forEach(function(k){D.push(k)}),i(D)},s.prototype.entries=function(){var D=[];return this.forEach(function(k,j){D.push([j,k])}),i(D)},t.iterable&&(s.prototype[Symbol.iterator]=s.prototype.entries);function r(D){if(D.bodyUsed)return Promise.reject(new TypeError("Already read"));D.bodyUsed=!0}function P(D){return new Promise(function(k,j){D.onload=function(){k(D.result)},D.onerror=function(){j(D.error)}})}function u(D){var k=new FileReader,j=P(k);return k.readAsArrayBuffer(D),j}function f(D){var k=new FileReader,j=P(k);return k.readAsText(D),j}function M(D){for(var k=new Uint8Array(D),j=new Array(k.length),p=0;p<k.length;p++)j[p]=String.fromCharCode(k[p]);return j.join("")}function l(D){if(D.slice)return D.slice(0);var k=new Uint8Array(D.byteLength);return k.set(new Uint8Array(D)),k.buffer}function J(){return this.bodyUsed=!1,this._initBody=function(D){this.bodyUsed=this.bodyUsed,this._bodyInit=D,D?typeof D=="string"?this._bodyText=D:t.blob&&Blob.prototype.isPrototypeOf(D)?this._bodyBlob=D:t.formData&&FormData.prototype.isPrototypeOf(D)?this._bodyFormData=D:t.searchParams&&URLSearchParams.prototype.isPrototypeOf(D)?this._bodyText=D.toString():t.arrayBuffer&&t.blob&&e(D)?(this._bodyArrayBuffer=l(D.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(D)||c(D))?this._bodyArrayBuffer=l(D):this._bodyText=D=Object.prototype.toString.call(D):this._bodyText="",this.headers.get("content-type")||(typeof D=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(D)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var D=r(this);if(D)return D;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var D=r(this);return D||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(u)}),this.text=function(){var D=r(this);if(D)return D;if(this._bodyBlob)return f(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(M(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(Y)}),this.json=function(){return this.text().then(JSON.parse)},this}var q=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(D){var k=D.toUpperCase();return q.indexOf(k)>-1?k:D}function v(D,k){if(!(this instanceof v))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');k=k||{};var j=k.body;if(D instanceof v){if(D.bodyUsed)throw new TypeError("Already read");this.url=D.url,this.credentials=D.credentials,k.headers||(this.headers=new s(D.headers)),this.method=D.method,this.mode=D.mode,this.signal=D.signal,!j&&D._bodyInit!=null&&(j=D._bodyInit,D.bodyUsed=!0)}else this.url=String(D);if(this.credentials=k.credentials||this.credentials||"same-origin",(k.headers||!this.headers)&&(this.headers=new s(k.headers)),this.method=m(k.method||this.method||"GET"),this.mode=k.mode||this.mode||null,this.signal=k.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&j)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(j),(this.method==="GET"||this.method==="HEAD")&&(k.cache==="no-store"||k.cache==="no-cache")){var p=/([?&])_=[^&]*/;if(p.test(this.url))this.url=this.url.replace(p,"$1_="+new Date().getTime());else{var H=/\?/;this.url+=(H.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})};function Y(D){var k=new FormData;return D.trim().split("&").forEach(function(j){if(j){var p=j.split("="),H=p.shift().replace(/\+/g," "),d=p.join("=").replace(/\+/g," ");k.append(decodeURIComponent(H),decodeURIComponent(d))}}),k}function z(D){var k=new s,j=D.replace(/\r?\n[\t ]+/g," ");return j.split("\r").map(function(p){return p.indexOf(`
2
- `)===0?p.substr(1,p.length):p}).forEach(function(p){var H=p.split(":"),d=H.shift().trim();if(d){var G=H.join(":").trim();k.append(d,G)}}),k}J.call(v.prototype);function x(D,k){if(!(this instanceof x))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');k||(k={}),this.type="default",this.status=k.status===void 0?200:k.status,this.ok=this.status>=200&&this.status<300,this.statusText=k.statusText===void 0?"":""+k.statusText,this.headers=new s(k.headers),this.url=k.url||"",this._initBody(D)}J.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},x.error=function(){var D=new x(null,{status:0,statusText:""});return D.type="error",D};var R=[301,302,303,307,308];x.redirect=function(D,k){if(R.indexOf(k)===-1)throw new RangeError("Invalid status code");return new x(null,{status:k,headers:{location:D}})},E.DOMException=n.DOMException;try{new E.DOMException}catch(D){E.DOMException=function(k,j){this.message=k,this.name=j;var p=Error(k);this.stack=p.stack},E.DOMException.prototype=Object.create(Error.prototype),E.DOMException.prototype.constructor=E.DOMException}function O(D,k){return new Promise(function(j,p){var H=new v(D,k);if(H.signal&&H.signal.aborted)return p(new E.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function G(){d.abort()}d.onload=function(){var F={status:d.status,statusText:d.statusText,headers:z(d.getAllResponseHeaders()||"")};F.url="responseURL"in d?d.responseURL:F.headers.get("X-Request-URL");var U="response"in d?d.response:d.responseText;setTimeout(function(){j(new x(U,F))},0)},d.onerror=function(){setTimeout(function(){p(new TypeError("Network request failed"))},0)},d.ontimeout=function(){setTimeout(function(){p(new TypeError("Network request failed"))},0)},d.onabort=function(){setTimeout(function(){p(new E.DOMException("Aborted","AbortError"))},0)};function b(F){try{return F===""&&n.location.href?n.location.href:F}catch(U){return F}}d.open(H.method,b(H.url),!0),H.credentials==="include"?d.withCredentials=!0:H.credentials==="omit"&&(d.withCredentials=!1),"responseType"in d&&(t.blob?d.responseType="blob":t.arrayBuffer&&H.headers.get("Content-Type")&&H.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(d.responseType="arraybuffer")),k&&typeof k.headers=="object"&&!(k.headers instanceof s)?Object.getOwnPropertyNames(k.headers).forEach(function(F){d.setRequestHeader(F,a(k.headers[F]))}):H.headers.forEach(function(F,U){d.setRequestHeader(U,F)}),H.signal&&(H.signal.addEventListener("abort",G),d.onreadystatechange=function(){d.readyState===4&&H.signal.removeEventListener("abort",G)}),d.send(typeof H._bodyInit=="undefined"?null:H._bodyInit)})}return O.polyfill=!0,n.fetch||(n.fetch=O,n.Headers=s,n.Request=v,n.Response=x),E.Headers=s,E.Request=v,E.Response=x,E.fetch=O,E})({})})(B),B.fetch.ponyfill=!0,delete B.fetch.polyfill;var Q=C.fetch?C:B;A=Q.fetch,A.default=Q.fetch,A.fetch=Q.fetch,A.Headers=Q.Headers,A.Request=Q.Request,A.Response=Q.Response,g.exports=A}(iC,iC.exports)),iC.exports}var _Q=I0();const E0=_({__proto__:null,default:WC(_Q)},[_Q]);function AI({steps:g=[],currentStep:A=1}={}){const C=document.createElement("div");C.className=["wgt:relative","wgt:flex","wgt:bg-weak-50","wgt:rounded-[10px]","wgt:overflow-hidden","wgt:shadow-sm"].join(" ");const B=document.createElement("div");B.className=["wgt:absolute","wgt:inset-0","wgt:transition-all","wgt:duration-250","wgt:rounded-r-md"].join(" "),B.style.backgroundColor="rgba(0,140,79,0.16)",B.style.clipPath="polygon(0 0, calc(100% - 36px) 0, 100% 50%, calc(100% - 36px) 100%, 0 100%)";const Q=document.createElement("div");Q.className="wgt:relative wgt:flex wgt:w-full wgt:z-10";const I=[];g.forEach((n,t)=>{const e=t+1,h=document.createElement("div");h.setAttribute("role","listitem"),h.setAttribute("aria-label",`Step ${e} of ${g.length}: ${n.label}`),h.className=["wgt:flex-1","wgt:flex","wgt:items-center","wgt:justify-center","wgt:py-5","wgt:px-4",t<g.length-1?"wgt:pr-9":""].filter(Boolean).join(" ");const c=document.createElement("div");c.className=["wgt:flex","wgt:items-center","wgt:justify-center","wgt:w-8","wgt:h-8","wgt:rounded-full","wgt:mr-4"].join(" ");const o=document.createElement("span");o.innerText=String(e),o.className="wgt:text-white wgt:font-medium",c.appendChild(o);const a=document.createElement("span");a.innerText=n.label,a.className="wgt:font-medium wgt:whitespace-nowrap",h.append(c,a),Q.append(h),I.push({wrap:h,circle:c,label:a})}),C.append(B,Q);function E(n){const t=g.length,e=Math.max(0,Math.min(n,t)),h=e/t*100;B.style.width=`${h}%`,e===t?(B.style.clipPath="none",B.style.borderTopRightRadius="10px",B.style.borderBottomRightRadius="10px"):(B.style.clipPath="polygon(0 0, calc(100% - 36px) 0, 100% 50%, calc(100% - 36px) 100%, 0 100%)",B.style.borderTopRightRadius="0",B.style.borderBottomRightRadius="0"),I.forEach(({circle:c,label:o},a)=>{a+1<=e?(c.classList.add("wgt:bg-icon-primary"),c.classList.remove("wgt:bg-icon-soft-400"),o.classList.add("wgt:text-primary-dark"),o.classList.remove("wgt:text-soft-400")):(c.classList.add("wgt:bg-icon-soft-400"),c.classList.remove("wgt:bg-icon-primary"),o.classList.add("wgt:text-soft-400"),o.classList.remove("wgt:text-primary-dark"))})}return E(A),{container:C,update(n){E(n)}}}function n0({steps:g=[],currentStep:A=1}={}){const C=document.createElement("div");C.className=["wgt:flex","wgt:bg-transparent","wgt:flex-col","wgt:h-fit","wgt:gap-6","wgt:items-center","wgt:justify-start","wgt:w-full","wgt:h-full","wgt:py-8","wgt:overflow-auto"].join(" ");const B=document.createElement("h1");B.className=["wgt:text-[28px]","wgt:font-bold","wgt:leading-[30px]","wgt:text-strong-950"].join(" "),B.innerText=w("widgetTitle");const Q=document.createElement("div");Q.className=["wgt:w-full","wgt:bg-white","wgt:max-w-[1320px]","wgt:flex-1","wgt:mx-auto","wgt:p-6","wgt:flex","wgt:flex-col","wgt:border","wgt:border-[#E1E4EA]","wgt:rounded-3xl","wgt:gap-6","wgt:shadow-[0px_1px_8px_0px_rgba(82,88,102,0.06)]"].join(" ");let I=AI({steps:g.map(e=>({label:e})),currentStep:A});Q.appendChild(I.container);const E=document.createElement("div");E.className="wgt:flex-1",Q.appendChild(E),C.appendChild(B),C.appendChild(Q);function n(){B.innerText=w("widgetTitle")}function t(e){I.container.remove(),I=AI({steps:e.map(h=>({label:h})),currentStep:A}),Q.insertBefore(I.container,E)}return{container:C,setStep(e){A=e,I.update(e)},setContent(e){E.replaceChildren(e)},updateSteps:t,updateTitle:n}}function gI({name:g,value:A="",label:C="",checked:B=!1,onChange:Q,disabled:I=!1}){const E=document.createElement("label");E.className="wgt:flex wgt:items-center wgt:gap-2 wgt:cursor-pointer";const n=document.createElement("input");n.type="radio",g&&(n.name=g),A&&(n.value=A),n.checked=B,n.disabled=I,n.className=["wgt:form-radio","wgt:h-6","wgt:w-6","wgt:border-grey-6","wgt:checked:accent-primary","wgt:focus:ring-primary"].join(" "),n.addEventListener("change",e=>{const h=e.target.checked;typeof Q=="function"&&Q(h)});const t=document.createElement("span");return t.innerText=C,E.append(n,t),{container:E,setChecked(e){n.checked=e}}}let og=[],dA=null,rg=null;const t0=3;function e0(){!dA&&document.body&&CI()}function CI(){if(!document.body)if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",CI);return}else{console.warn("Document body not available for notification container");return}dA&&dA.parentNode&&dA.parentNode.removeChild(dA),dA=document.createElement("div"),dA.className="wgt:fixed wgt:z-[99999] wgt:pointer-events-none",window.innerWidth>=768?dA.className+=" wgt:bottom-4 wgt:right-4":dA.className+=" wgt:top-4 wgt:right-4",document.body.appendChild(dA),rg&&window.removeEventListener("resize",rg),rg=()=>{if(!dA)return;const A=window.innerWidth>=768;dA.className="wgt:fixed wgt:z-[99999] wgt:pointer-events-none",A?dA.className+=" wgt:bottom-4 wgt:right-4":dA.className+=" wgt:top-4 wgt:right-4"},window.addEventListener("resize",rg)}function aC(g,A={}){if(e0(),!dA)return console.warn("Notification container not available"),null;const{autoClose:C=5e3,hideProgressBar:B=!0,closeButton:Q=!1,icon:I=!1,type:E="info"}=A;og.length>=t0&&sC(og[0].id);const n=Date.now()+Math.random(),t=h0(n,g,{autoClose:C,hideProgressBar:B,closeButton:Q,icon:I,type:E});return og.push({id:n,element:t}),dA.appendChild(t),requestAnimationFrame(()=>{t.classList.remove("wgt:translate-x-full","wgt:opacity-0"),t.classList.add("wgt:translate-x-0","wgt:opacity-100")}),C>0&&setTimeout(()=>{sC(n)},C),n}function h0(g,A,C){const{hideProgressBar:B,closeButton:Q,icon:I,type:E,autoClose:n}=C,t=document.createElement("div");t.className=["wgt:bg-white","wgt:px-5","wgt:py-4","wgt:rounded-lg","wgt:shadow-lg","wgt:mb-2","wgt:max-w-sm","wgt:w-full","wgt:transform","wgt:translate-x-full","wgt:opacity-0","wgt:transition-all","wgt:duration-300","wgt:ease-out","wgt:pointer-events-auto","wgt:relative","wgt:overflow-hidden"].join(" ");const e={info:"#40A9FF",success:"#52C41A",warning:"#FAAD14",error:"#FF4D4F"};t.style.borderLeft=`4px solid ${e[E]||e.info}`,t.style.zIndex="99999";const h=document.createElement("div");if(h.className="wgt:flex wgt:items-start wgt:gap-3",I){const o=document.createElement("div"),a={info:"wgt:bg-blue-500",success:"wgt:bg-green-500",warning:"wgt:bg-orange-500",error:"wgt:bg-red-500"};o.className=`wgt:flex-shrink-0 wgt:w-5 wgt:h-5 wgt:rounded-full wgt:flex wgt:items-center wgt:justify-center wgt:mt-0.5 ${a[E]||a.info}`,o.innerHTML='<span class="wgt:text-white wgt:text-xs wgt:font-bold">!</span>',h.appendChild(o)}const c=document.createElement("div");if(c.className="wgt:text-sm wgt:font-medium wgt:text-gray-700 wgt:leading-5 wgt:flex-1",c.innerText=A,h.appendChild(c),Q){const o=document.createElement("button");o.className="wgt:flex-shrink-0 wgt:ml-2 wgt:text-gray-400 wgt:hover:text-gray-600 wgt:text-lg wgt:leading-none",o.innerHTML="×",o.addEventListener("click",()=>{sC(g)}),h.appendChild(o)}if(t.appendChild(h),!B&&n>0){const o=document.createElement("div"),a={info:"wgt:bg-blue-500",success:"wgt:bg-green-500",warning:"wgt:bg-orange-500",error:"wgt:bg-red-500"};o.className=`wgt:absolute wgt:bottom-0 wgt:left-0 wgt:h-1 wgt:transition-all wgt:duration-300 ${a[E]||a.info}`,o.style.width="100%",requestAnimationFrame(()=>{o.style.transition=`width ${n}ms linear`,o.style.width="0%"}),t.appendChild(o)}return t}function sC(g){const A=og.findIndex(B=>B.id===g);if(A===-1)return;const{element:C}=og[A];C.classList.remove("wgt:translate-x-0","wgt:opacity-100"),C.classList.add("wgt:translate-x-full","wgt:opacity-0"),setTimeout(()=>{C.parentNode&&C.parentNode.removeChild(C),og.splice(A,1)},300)}function BI(){og.forEach(({id:g})=>sC(g))}function c0(){BI(),dA&&dA.parentNode&&dA.parentNode.removeChild(dA),rg&&window.removeEventListener("resize",rg),dA=null,rg=null,og=[]}const ng={info:(g,A={})=>aC(g,sA(N({},A),{type:"info"})),success:(g,A={})=>aC(g,sA(N({},A),{type:"success"})),warning:(g,A={})=>aC(g,sA(N({},A),{type:"warning"})),error:(g,A={})=>aC(g,sA(N({},A),{type:"error"})),clear:BI,destroy:c0};function o0({providers:g=[],selectedRoute:A=null,onProviderChange:C}){const B=document.createElement("div");B.className="wgt:max-w-[1072px] wgt:mx-auto wgt:w-full wgt:flex wgt:flex-col wgt:gap-2";const Q=document.createElement("h2");Q.className="wgt:text-sm wgt:font-semibold wgt:text-black",Q.innerText=w("selectProvider"),B.appendChild(Q);const I=document.createElement("div");I.className="wgt:grid wgt:grid-cols-3 wgt:gap-4",B.appendChild(I);function E(){I.innerHTML="",g.forEach(n=>{const t=n.route===A,e=document.createElement("div");e.dataset.checked=t?"true":"false",e.className=["wgt:flex","wgt:items-center","wgt:justify-between","wgt:gap-2","wgt:p-4","wgt:border","wgt:border-border-light","wgt:rounded-xl","wgt:hover:bg-gray-100","wgt:cursor-pointer","wgt:transition-colors","wgt:duration-200",t?"wgt:border-primary":""].filter(Boolean).join(" "),e.addEventListener("click",()=>{if(n.route==="fpt"){ng.info(w("comingSoon"),{hideProgressBar:!0,closeButton:!1,autoClose:5e3,icon:!0,limit:3});return}A=n.route,typeof C=="function"&&C(n),E()});const h=document.createElement("div");h.className="wgt:flex wgt:items-center wgt:gap-3";const c=document.createElement("img");c.src=n.logoUrl,c.alt=n.name,c.className="wgt:h-8 wgt:object-contain";const o=document.createElement("div");o.className="wgt:w-[1px] wgt:h-8 wgt:bg-border-light";const a=document.createElement("label");a.className="wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-black wgt:uppercase",a.innerText=n.name,h.appendChild(c),h.appendChild(o),h.appendChild(a);const{container:i}=gI({checked:t,onChange:s=>{if(s){if(n.route==="fpt"){ng.info(w("comingSoon"),{hideProgressBar:!0,closeButton:!1,autoClose:5e3,icon:!0,limit:3});return}A=n.route,typeof C=="function"&&C(n),E()}},disabled:n.route==="fpt"});e.appendChild(h),e.appendChild(i),I.appendChild(e)})}return E(),{container:B,setSelectedRoute(n){A=n,E()}}}function OA({name:g,value:A="",type:C="text",placeholder:B="",label:Q,required:I=!1,error:E=null,onInput:n=null,readOnly:t=!1,horizontal:e=!1}){const h=document.createElement("div");if(h.className="wgt:w-full "+(e?"wgt:grid wgt:grid-cols-6 wgt:items-center wgt:gap-2":"wgt:flex wgt:flex-col wgt:gap-2"),Q){const a=document.createElement("label");if(a.htmlFor=g,a.className="wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2",a.innerText=Q,I){const i=document.createElement("span");i.className="wgt:text-red-500 wgt:ml-1",i.innerText="*",a.appendChild(i)}h.appendChild(a)}const c=document.createElement("input");c.type=C,c.name=g,c.id=g,c.value=A,c.placeholder=B,c.readOnly=t,c.autocomplete="off",c.autocapitalize="off",c.spellcheck=!1,c.className=["wgt:col-span-4","wgt:w-full","wgt:border","wgt:rounded","wgt:px-3","wgt:py-2","wgt:focus:outline-none","wgt:focus:ring-2",E?"wgt:border-red-500":"wgt:border-gray-300","wgt:read-only:focus:ring-transparent","wgt:bg-white","wgt:focus:ring-primary"].join(" "),I&&c.setAttribute("required","true"),typeof n=="function"&&c.addEventListener("input",n);const o=document.createElement("span");return o.className="wgt:text-red-500 wgt:text-sm wgt:whitespace-nowrap",o.innerText=E||"",E||(o.style.display="none"),h.appendChild(c),h.appendChild(o),{container:h,inputEl:c,setError(a){a?(o.innerText=a,o.style.display="block",c.classList.remove("wgt:border-gray-300"),c.classList.add("wgt:border-red-500")):(o.innerText="",o.style.display="none",c.classList.remove("wgt:border-red-500"),c.classList.add("wgt:border-gray-300"))},getValue(){return c.value}}}function $C({name:g,value:A="",options:C=[],label:B,disabled:Q=!1,error:I=null,onChange:E=null,required:n=!1,horizontal:t=!1,searchable:e=!1}){const h=document.createElement("div");h.className="wgt:w-full "+(t?"wgt:grid wgt:grid-cols-6 wgt:items-center wgt:gap-2":"wgt:flex wgt:flex-col wgt:gap-2");const c=document.createElement("label");if(c.htmlFor=g,c.className="wgt:font-medium wgt:text-text-sub-600 wgt:whitespace-nowrap wgt:col-span-2",c.innerText=B,h.appendChild(c),n){const o=document.createElement("span");o.className="wgt:text-red-500 wgt:ml-1",o.innerText="*",c.appendChild(o)}if(e){const o=document.createElement("div");o.className="wgt:col-span-4 wgt:relative";const a=document.createElement("input");a.type="text",a.placeholder=`Tìm kiếm ${B.toLowerCase()}...`,a.disabled=Q,a.className=["wgt:border","wgt:rounded","wgt:px-3","wgt:py-2","wgt:w-full","wgt:focus:outline-none","wgt:focus:ring-2","wgt:focus:ring-blue-500","wgt:bg-white",I?"wgt:border-red-500":"wgt:border-gray-300"].join(" ");const i=document.createElement("div");i.className="wgt:absolute wgt:top-full wgt:left-0 wgt:right-0 wgt:bg-white wgt:border wgt:border-gray-300 wgt:rounded wgt:shadow-lg wgt:z-50 wgt:hidden wgt:max-h-[500px] wgt:overflow-y-auto";const s=document.createElement("div");s.className="wgt:divide-y wgt:divide-gray-200";let r=A,P=null,u=[...C];const f=()=>{const q=C.find(m=>m.id?m.id===P:m.value===r);return q?q.label:""};a.value=f();const M=(q=u)=>{if(s.innerHTML="",q.length===0){const m=document.createElement("div");m.className="wgt:px-3 wgt:py-2 wgt:text-gray-500 wgt:text-sm",m.innerText="Không tìm thấy kết quả",s.appendChild(m);return}q.forEach(m=>{const v=document.createElement("div");v.className=["wgt:px-3","wgt:py-2","wgt:cursor-pointer","wgt:hover:bg-gray-100","wgt:text-sm",m.id?P===m.id?"wgt:bg-blue-50 wgt:text-blue-700":"":r===m.value?"wgt:bg-blue-50 wgt:text-blue-700":""].filter(Boolean).join(" "),v.innerText=m.label,v.dataset.value=m.value,v.addEventListener("click",()=>{if(m.id&&(P=m.id),r=m.value,a.value=m.label,i.classList.add("wgt:hidden"),typeof E=="function"){const Y={target:{value:m.value}};m.id&&(Y.target.id=m.id),E(Y)}}),s.appendChild(v)})};a.addEventListener("input",q=>{const m=q.target.value.toLowerCase();u=C.filter(v=>v.label.toLowerCase().includes(m)),M(u),i.classList.contains("wgt:hidden")||i.classList.remove("wgt:hidden")}),a.addEventListener("focus",()=>{i.classList.remove("wgt:hidden"),M()}),document.addEventListener("click",q=>{o.contains(q.target)||i.classList.add("wgt:hidden")}),a.addEventListener("keydown",q=>{q.key==="Escape"&&i.classList.add("wgt:hidden")}),i.appendChild(s),o.appendChild(a),o.appendChild(i),M();const l=document.createElement("select");l.style.display="none",l.name=g,l.id=g,C.forEach(q=>{const m=document.createElement("option");m.value=q.value,m.innerText=q.label,q.value===A&&(m.selected=!0),l.appendChild(m)}),h.appendChild(o),h.appendChild(l);const J=document.createElement("span");return J.className="wgt:text-red-500 wgt:text-sm wgt:mt-1",J.innerText=I||"",I||(J.style.display="none"),h.appendChild(J),{container:h,selectEl:l,setError(q){q?(J.innerText=q,J.style.display="block",a.classList.remove("wgt:border-gray-300"),a.classList.add("wgt:border-red-500")):(J.innerText="",J.style.display="none",a.classList.remove("wgt:border-red-500"),a.classList.add("wgt:border-gray-300"))},getValue(){return r},setValue(q,m,v){P=v||null,r=q||"";const Y=C.find(z=>z.id?z.id===v:z.value===q);Y?(a.value=Y.label,l.value=q,M()):(a.value=m||"",l.value=q||"",M())},setOptions(q){for(C.splice(0,C.length,...q),u=[...q];l.options.length>0;)l.remove(0);q.forEach(m=>{const v=document.createElement("option");v.value=m.value,v.innerText=m.label,l.appendChild(v)}),M()},setDisabled(q){a.disabled=!!q,l.disabled=!!q,q?(o.classList.add("wgt:opacity-75"),i.classList.add("wgt:hidden")):o.classList.remove("wgt:opacity-75")}}}else{const o=document.createElement("select");o.id=g,o.name=g,o.disabled=Q,o.className=["wgt:col-span-4","wgt:border","wgt:rounded","wgt:px-3","wgt:py-2","wgt:focus:outline-none","wgt:focus:ring-2","wgt:focus:ring-blue-500","wgt:bg-white",I?"wgt:border-red-500":"wgt:border-gray-300"].join(" ");const a=document.createElement("option");a.value="",a.disabled=!0,a.selected=A===""||A==null,a.innerText=`-- Chọn ${B.toLowerCase()} --`,o.appendChild(a),C.forEach(s=>{const r=document.createElement("option");r.value=s.value,r.innerText=s.label,s.value===A&&(r.selected=!0),o.appendChild(r)}),typeof E=="function"&&o.addEventListener("change",E),h.appendChild(o);const i=document.createElement("span");return i.className="wgt:text-red-500 wgt:text-sm wgt:mt-1",i.innerText=I||"",I||(i.style.display="none"),h.appendChild(i),{container:h,selectEl:o,setError(s){s?(i.innerText=s,i.style.display="block",o.classList.remove("wgt:border-gray-300"),o.classList.add("wgt:border-red-500")):(i.innerText="",i.style.display="none",o.classList.remove("wgt:border-red-500"),o.classList.add("wgt:border-gray-300"))},getValue(){return o.value},setOptions(s){for(;o.options.length>1;)o.remove(1);s.forEach(r=>{const P=document.createElement("option");P.value=r.value,P.innerText=r.label,o.appendChild(P)})},setDisabled(s){o.disabled=!!s}}}}function xg({title:g,isDisabled:A=!1,handleClick:C=null,type:B="button",className:Q=""}={}){const I=document.createElement("button");return I.type=B,I.disabled=A,I.className=["wgt:bg-primary","wgt:hover:bg-primary-dark","wgt:px-6","wgt:py-2","wgt:rounded-lg","wgt:disabled:opacity-50","wgt:disabled:cursor-not-allowed","wgt:cursor-pointer",Q].filter(Boolean).join(" "),I.innerText=g,typeof C=="function"&&I.addEventListener("click",E=>{I.disabled||C(E)}),I}function QI({label:g,required:A=!1,file:C=null,onFileChange:B,error:Q=null,accept:I=""}){const E=document.createElement("form");E.className="wgt:flex wgt:flex-col";const n=document.createElement("label");if(n.htmlFor="upload",n.className="wgt:font-medium wgt:mb-1 wgt:text-text-sub-600",n.innerText=g,A){const f=document.createElement("span");f.className="wgt:text-red-500 wgt:ml-1",f.innerText="*",n.appendChild(f)}const t=I?I.split(",").map(f=>f.trim().startsWith("image/")?f.replace("image/","").toUpperCase():f.trim().startsWith(".")?f.replace(".","").toUpperCase():f.toUpperCase().replace("/*","")).filter(Boolean).join(", "):`JPG, PNG ${w("or")} JPEG`;n.innerHTML+=` <span class="wgt:text-xs wgt:font-normal wgt:leading-4 wgt:text-soft-400">(${w("fileFormat")} ${t}. ${w("maxFileSize")})</span>`,E.appendChild(n);const e=document.createElement("div");e.className=["wgt:h-fit","wgt:w-full","wgt:rounded","wgt:overflow-hidden","wgt:flex","wgt:items-start","wgt:cursor-pointer","wgt:justify-start","wgt:gap-2"].join(" ");const h=document.createElement("input");h.accept=I||"image/png, image/jpeg, .jpg, .jpeg, .png",h.id="upload",h.type="file",h.className="wgt:hidden";const c=document.createElement("div");c.className="wgt:w-full wgt:flex wgt:gap-1 wgt:items-start wgt:justify-start";const o=document.createElement("span");o.className="wgt:text-red-500 wgt:text-sm wgt:mt-1",o.innerText=Q||"",Q||(o.style.display="none");let a=null;function i(f){a=f,f?(o.innerText=f,o.style.display="block"):(o.innerText="",o.style.display="none")}const s=xg({title:"Upload file",className:"wgt:bg-primary wgt:hover:bg-primary-dark wgt:text-white wgt:px-6 wgt:py-1 wgt:rounded-md wgt:cursor-pointer",handleClick:f=>{f.stopPropagation(),h.click()}});function r(f,M=2){if(f===0)return"0 Bytes";const l=1024,J=Math.max(0,M),q=["Bytes","KB","MB","GB","TB"],m=Math.floor(Math.log(f)/Math.log(l));return parseFloat((f/Math.pow(l,m)).toFixed(J))+" "+q[m]}function P(f){const M=f.type.toLowerCase(),l="."+f.name.split(".").pop().toLowerCase();return h.accept.split(",").map(q=>q.trim().toLowerCase()).filter(Boolean).some(q=>q.startsWith(".")?q===l:q.endsWith("/*")?M.startsWith(q.replace("/*","")):M===q)}function u(f){if(c.innerHTML="",i(null),f){P(f)||i(`File không hợp lệ. Chỉ chấp nhận: ${h.accept}`),f.size<=500*1024||i("Dung lượng file vượt quá 500KB.");const l=document.createElement("div");if(l.className="wgt:flex wgt:items-center wgt:gap-4",l.addEventListener("click",()=>{h.click()}),f.type.startsWith("image/")){const v=document.createElement("img");v.src=URL.createObjectURL(f),v.alt="Preview",v.className="wgt:h-20 wgt:w-20 wgt:rounded wgt:object-contain wgt:rounded",l.appendChild(v)}const J=document.createElement("div");J.className="wgt:flex wgt:flex-col";const q=document.createElement("p");q.className="wgt:text-sm wgt:font-medium wgt:text-gray-800",q.innerText=f.name;const m=document.createElement("p");m.className="wgt:text-sm wgt:text-gray-500",m.innerText=r(f.size),J.appendChild(q),J.appendChild(m),l.appendChild(J),c.appendChild(l),C=f,typeof B=="function"&&B(f)}else{const M=document.createElement("div");M.className="wgt:flex wgt:items-center",M.appendChild(s),c.appendChild(M)}}return h.addEventListener("change",f=>{const M=f.target.files&&f.target.files[0]?f.target.files[0]:null;M&&(u(M),typeof B=="function"&&B(M))}),u(C),e.appendChild(c),e.appendChild(h),E.appendChild(e),E.appendChild(o),{container:E,getValues(){return C},setFile(f){C=f,u(f),typeof B=="function"&&B(f)},clearFile(){C=null,u(null),typeof B=="function"&&B(null)},getError:()=>a}}function II({file:g,placeholder:A,caption:C,onFileSelected:B,onError:Q}){const I=document.createElement("div");I.className="wgt:flex wgt:flex-col wgt:items-center wgt:gap-2";const E=document.createElement("div");E.className=["wgt:w-full","wgt:h-fit","wgt:border-2","wgt:border-dashed","wgt:border-sub-300","wgt:rounded-lg","wgt:flex","wgt:flex-col","wgt:gap-2","wgt:items-center","wgt:justify-center","wgt:cursor-pointer","wgt:bg-weak-50","wgt:py-6"].join(" "),I.append(E);const n=document.createElement("input");n.type="file",n.accept="image/png, image/jpeg, image/jpg",n.className="wgt:hidden",E.append(n);const t=document.createElement("div");t.className="wgt:w-10 wgt:h-10 wgt:rounded-full wgt:bg-primary/16 wgt:flex wgt:items-center wgt:justify-center",t.innerHTML=`
2
+ `)===0?p.substr(1,p.length):p}).forEach(function(p){var H=p.split(":"),d=H.shift().trim();if(d){var G=H.join(":").trim();k.append(d,G)}}),k}J.call(v.prototype);function x(D,k){if(!(this instanceof x))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');k||(k={}),this.type="default",this.status=k.status===void 0?200:k.status,this.ok=this.status>=200&&this.status<300,this.statusText=k.statusText===void 0?"":""+k.statusText,this.headers=new s(k.headers),this.url=k.url||"",this._initBody(D)}J.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},x.error=function(){var D=new x(null,{status:0,statusText:""});return D.type="error",D};var R=[301,302,303,307,308];x.redirect=function(D,k){if(R.indexOf(k)===-1)throw new RangeError("Invalid status code");return new x(null,{status:k,headers:{location:D}})},E.DOMException=n.DOMException;try{new E.DOMException}catch(D){E.DOMException=function(k,j){this.message=k,this.name=j;var p=Error(k);this.stack=p.stack},E.DOMException.prototype=Object.create(Error.prototype),E.DOMException.prototype.constructor=E.DOMException}function O(D,k){return new Promise(function(j,p){var H=new v(D,k);if(H.signal&&H.signal.aborted)return p(new E.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function G(){d.abort()}d.onload=function(){var F={status:d.status,statusText:d.statusText,headers:z(d.getAllResponseHeaders()||"")};F.url="responseURL"in d?d.responseURL:F.headers.get("X-Request-URL");var U="response"in d?d.response:d.responseText;setTimeout(function(){j(new x(U,F))},0)},d.onerror=function(){setTimeout(function(){p(new TypeError("Network request failed"))},0)},d.ontimeout=function(){setTimeout(function(){p(new TypeError("Network request failed"))},0)},d.onabort=function(){setTimeout(function(){p(new E.DOMException("Aborted","AbortError"))},0)};function b(F){try{return F===""&&n.location.href?n.location.href:F}catch(U){return F}}d.open(H.method,b(H.url),!0),H.credentials==="include"?d.withCredentials=!0:H.credentials==="omit"&&(d.withCredentials=!1),"responseType"in d&&(t.blob?d.responseType="blob":t.arrayBuffer&&H.headers.get("Content-Type")&&H.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(d.responseType="arraybuffer")),k&&typeof k.headers=="object"&&!(k.headers instanceof s)?Object.getOwnPropertyNames(k.headers).forEach(function(F){d.setRequestHeader(F,a(k.headers[F]))}):H.headers.forEach(function(F,U){d.setRequestHeader(U,F)}),H.signal&&(H.signal.addEventListener("abort",G),d.onreadystatechange=function(){d.readyState===4&&H.signal.removeEventListener("abort",G)}),d.send(typeof H._bodyInit=="undefined"?null:H._bodyInit)})}return O.polyfill=!0,n.fetch||(n.fetch=O,n.Headers=s,n.Request=v,n.Response=x),E.Headers=s,E.Request=v,E.Response=x,E.fetch=O,E})({})})(B),B.fetch.ponyfill=!0,delete B.fetch.polyfill;var Q=C.fetch?C:B;A=Q.fetch,A.default=Q.fetch,A.fetch=Q.fetch,A.Headers=Q.Headers,A.Request=Q.Request,A.Response=Q.Response,g.exports=A}(iC,iC.exports)),iC.exports}var _Q=I0();const E0=_({__proto__:null,default:WC(_Q)},[_Q]);function AI({steps:g=[],currentStep:A=1}={}){const C=document.createElement("div");C.className=["wgt:relative","wgt:flex","wgt:bg-weak-50","wgt:rounded-[10px]","wgt:overflow-hidden","wgt:shadow-sm"].join(" ");const B=document.createElement("div");B.className=["wgt:absolute","wgt:inset-0","wgt:transition-all","wgt:duration-250","wgt:rounded-r-md"].join(" "),B.style.backgroundColor="rgba(0,140,79,0.16)",B.style.clipPath="polygon(0 0, calc(100% - 36px) 0, 100% 50%, calc(100% - 36px) 100%, 0 100%)";const Q=document.createElement("div");Q.className="wgt:relative wgt:flex wgt:w-full wgt:z-10";const I=[];g.forEach((n,t)=>{const e=t+1,h=document.createElement("div");h.setAttribute("role","listitem"),h.setAttribute("aria-label",`Step ${e} of ${g.length}: ${n.label}`),h.className=["wgt:flex-1","wgt:flex","wgt:items-center","wgt:justify-center","wgt:py-5","wgt:px-4",t<g.length-1?"wgt:pr-9":""].filter(Boolean).join(" ");const c=document.createElement("div");c.className=["wgt:flex","wgt:items-center","wgt:justify-center","wgt:w-8","wgt:h-8","wgt:rounded-full","wgt:mr-4"].join(" ");const o=document.createElement("span");o.innerText=String(e),o.className="wgt:text-white wgt:font-medium",c.appendChild(o);const a=document.createElement("span");a.innerText=n.label,a.className="wgt:font-medium wgt:whitespace-nowrap",h.append(c,a),Q.append(h),I.push({wrap:h,circle:c,label:a})}),C.append(B,Q);function E(n){const t=g.length,e=Math.max(0,Math.min(n,t)),h=e/t*100;B.style.width=`${h}%`,e===t?(B.style.clipPath="none",B.style.borderTopRightRadius="10px",B.style.borderBottomRightRadius="10px"):(B.style.clipPath="polygon(0 0, calc(100% - 36px) 0, 100% 50%, calc(100% - 36px) 100%, 0 100%)",B.style.borderTopRightRadius="0",B.style.borderBottomRightRadius="0"),I.forEach(({circle:c,label:o},a)=>{a+1<=e?(c.classList.add("wgt:bg-icon-primary"),c.classList.remove("wgt:bg-icon-soft-400"),o.classList.add("wgt:text-primary-dark"),o.classList.remove("wgt:text-soft-400")):(c.classList.add("wgt:bg-icon-soft-400"),c.classList.remove("wgt:bg-icon-primary"),o.classList.add("wgt:text-soft-400"),o.classList.remove("wgt:text-primary-dark"))})}return E(A),{container:C,update(n){E(n)}}}function n0({steps:g=[],currentStep:A=1}={}){const C=document.createElement("div");C.className=["wgt:flex","wgt:bg-transparent","wgt:flex-col","wgt:h-fit","wgt:gap-6","wgt:items-center","wgt:justify-start","wgt:w-full","wgt:h-full","wgt:py-8","wgt:overflow-auto"].join(" ");const B=document.createElement("h1");B.className=["wgt:text-[28px]","wgt:font-bold","wgt:leading-[30px]","wgt:text-strong-950"].join(" "),B.innerText=w("widgetTitle");const Q=document.createElement("div");Q.className=["wgt:w-full","wgt:bg-white","wgt:max-w-[1320px]","wgt:flex-1","wgt:mx-auto","wgt:p-6","wgt:flex","wgt:flex-col","wgt:border","wgt:border-[#E1E4EA]","wgt:rounded-3xl","wgt:gap-6","wgt:shadow-[0px_1px_8px_0px_rgba(82,88,102,0.06)]"].join(" ");let I=AI({steps:g.map(e=>({label:e})),currentStep:A});Q.appendChild(I.container);const E=document.createElement("div");E.className="wgt:flex-1",Q.appendChild(E),C.appendChild(B),C.appendChild(Q);function n(){B.innerText=w("widgetTitle")}function t(e){I.container.remove(),I=AI({steps:e.map(h=>({label:h})),currentStep:A}),Q.insertBefore(I.container,E)}return{container:C,setStep(e){A=e,I.update(e)},setContent(e){E.replaceChildren(e)},updateSteps:t,updateTitle:n}}function gI({name:g,value:A="",label:C="",checked:B=!1,onChange:Q,disabled:I=!1}){const E=document.createElement("label");E.className="wgt:flex wgt:items-center wgt:gap-2 wgt:cursor-pointer";const n=document.createElement("input");n.type="radio",g&&(n.name=g),A&&(n.value=A),n.checked=B,n.disabled=I,n.className=["wgt:form-radio","wgt:h-6","wgt:w-6","wgt:border-grey-6","wgt:checked:accent-primary","wgt:focus:ring-primary"].join(" "),n.addEventListener("change",e=>{const h=e.target.checked;typeof Q=="function"&&Q(h)});const t=document.createElement("span");return t.innerText=C,E.append(n,t),{container:E,setChecked(e){n.checked=e}}}let og=[],dA=null,rg=null;const t0=3;function e0(){!dA&&document.body&&CI()}function CI(){if(!document.body)if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",CI);return}else{console.warn("Document body not available for notification container");return}dA&&dA.parentNode&&dA.parentNode.removeChild(dA),dA=document.createElement("div"),dA.className="wgt:fixed wgt:z-[99999] wgt:pointer-events-none",window.innerWidth>=768?dA.className+=" wgt:bottom-4 wgt:right-4":dA.className+=" wgt:top-4 wgt:right-4",document.body.appendChild(dA),rg&&window.removeEventListener("resize",rg),rg=()=>{if(!dA)return;const A=window.innerWidth>=768;dA.className="wgt:fixed wgt:z-[99999] wgt:pointer-events-none",A?dA.className+=" wgt:bottom-4 wgt:right-4":dA.className+=" wgt:top-4 wgt:right-4"},window.addEventListener("resize",rg)}function aC(g,A={}){if(e0(),!dA)return console.warn("Notification container not available"),null;const{autoClose:C=5e3,hideProgressBar:B=!0,closeButton:Q=!1,icon:I=!1,type:E="info"}=A;og.length>=t0&&sC(og[0].id);const n=Date.now()+Math.random(),t=h0(n,g,{autoClose:C,hideProgressBar:B,closeButton:Q,icon:I,type:E});return og.push({id:n,element:t}),dA.appendChild(t),requestAnimationFrame(()=>{t.classList.remove("wgt:translate-x-full","wgt:opacity-0"),t.classList.add("wgt:translate-x-0","wgt:opacity-100")}),C>0&&setTimeout(()=>{sC(n)},C),n}function h0(g,A,C){const{hideProgressBar:B,closeButton:Q,icon:I,type:E,autoClose:n}=C,t=document.createElement("div");t.className=["wgt:bg-white","wgt:px-5","wgt:py-4","wgt:rounded-lg","wgt:shadow-lg","wgt:mb-2","wgt:max-w-sm","wgt:w-full","wgt:transform","wgt:translate-x-full","wgt:opacity-0","wgt:transition-all","wgt:duration-300","wgt:ease-out","wgt:pointer-events-auto","wgt:relative","wgt:overflow-hidden"].join(" ");const e={info:"#40A9FF",success:"#52C41A",warning:"#FAAD14",error:"#FF4D4F"};t.style.borderLeft=`4px solid ${e[E]||e.info}`,t.style.zIndex="99999";const h=document.createElement("div");if(h.className="wgt:flex wgt:items-start wgt:gap-3",I){const o=document.createElement("div"),a={info:"wgt:bg-blue-500",success:"wgt:bg-green-500",warning:"wgt:bg-orange-500",error:"wgt:bg-red-500"};o.className=`wgt:flex-shrink-0 wgt:w-5 wgt:h-5 wgt:rounded-full wgt:flex wgt:items-center wgt:justify-center wgt:mt-0.5 ${a[E]||a.info}`,o.innerHTML='<span class="wgt:text-white wgt:text-xs wgt:font-bold">!</span>',h.appendChild(o)}const c=document.createElement("div");if(c.className="wgt:text-sm wgt:font-medium wgt:text-gray-700 wgt:leading-5 wgt:flex-1",c.innerText=A,h.appendChild(c),Q){const o=document.createElement("button");o.className="wgt:flex-shrink-0 wgt:ml-2 wgt:text-gray-400 wgt:hover:text-gray-600 wgt:text-lg wgt:leading-none",o.innerHTML="×",o.addEventListener("click",()=>{sC(g)}),h.appendChild(o)}if(t.appendChild(h),!B&&n>0){const o=document.createElement("div"),a={info:"wgt:bg-blue-500",success:"wgt:bg-green-500",warning:"wgt:bg-orange-500",error:"wgt:bg-red-500"};o.className=`wgt:absolute wgt:bottom-0 wgt:left-0 wgt:h-1 wgt:transition-all wgt:duration-300 ${a[E]||a.info}`,o.style.width="100%",requestAnimationFrame(()=>{o.style.transition=`width ${n}ms linear`,o.style.width="0%"}),t.appendChild(o)}return t}function sC(g){const A=og.findIndex(B=>B.id===g);if(A===-1)return;const{element:C}=og[A];C.classList.remove("wgt:translate-x-0","wgt:opacity-100"),C.classList.add("wgt:translate-x-full","wgt:opacity-0"),setTimeout(()=>{C.parentNode&&C.parentNode.removeChild(C),og.splice(A,1)},300)}function BI(){og.forEach(({id:g})=>sC(g))}function c0(){BI(),dA&&dA.parentNode&&dA.parentNode.removeChild(dA),rg&&window.removeEventListener("resize",rg),dA=null,rg=null,og=[]}const ng={info:(g,A={})=>aC(g,sA(N({},A),{type:"info"})),success:(g,A={})=>aC(g,sA(N({},A),{type:"success"})),warning:(g,A={})=>aC(g,sA(N({},A),{type:"warning"})),error:(g,A={})=>aC(g,sA(N({},A),{type:"error"})),clear:BI,destroy:c0};function o0({providers:g=[],selectedRoute:A=null,onProviderChange:C}){const B=document.createElement("div");B.className="wgt:max-w-[1072px] wgt:mx-auto wgt:w-full wgt:flex wgt:flex-col wgt:gap-2";const Q=document.createElement("h2");Q.className="wgt:text-sm wgt:font-semibold wgt:text-black",Q.innerText=w("selectProvider"),B.appendChild(Q);const I=document.createElement("div");I.className="wgt:grid wgt:grid-cols-3 wgt:gap-4",B.appendChild(I);function E(){I.innerHTML="",g.forEach(n=>{const t=n.route===A,e=document.createElement("div");e.dataset.checked=t?"true":"false",e.className=["wgt:flex","wgt:items-center","wgt:justify-between","wgt:gap-2","wgt:p-4","wgt:border","wgt:border-border-light","wgt:rounded-xl","wgt:hover:bg-gray-100","wgt:cursor-pointer","wgt:transition-colors","wgt:duration-200",t?"wgt:border-primary":""].filter(Boolean).join(" "),e.addEventListener("click",()=>{if(n.route==="fpt"){ng.info(w("comingSoon"),{hideProgressBar:!0,closeButton:!1,autoClose:5e3,icon:!0,limit:3});return}A=n.route,typeof C=="function"&&C(n),E()});const h=document.createElement("div");h.className="wgt:flex wgt:items-center wgt:gap-3";const c=document.createElement("img");c.src=n.logoUrl,c.alt=n.name,c.className="wgt:h-8 wgt:object-contain";const o=document.createElement("div");o.className="wgt:w-[1px] wgt:h-8 wgt:bg-border-light";const a=document.createElement("label");a.className="wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-black wgt:uppercase",a.innerText=n.name,h.appendChild(c),h.appendChild(o),h.appendChild(a);const{container:i}=gI({checked:t,onChange:s=>{if(s){if(n.route==="fpt"){ng.info(w("comingSoon"),{hideProgressBar:!0,closeButton:!1,autoClose:5e3,icon:!0,limit:3});return}A=n.route,typeof C=="function"&&C(n),E()}},disabled:n.route==="fpt"});e.appendChild(h),e.appendChild(i),I.appendChild(e)})}return E(),{container:B,setSelectedRoute(n){A=n,E()}}}function OA({name:g,value:A="",type:C="text",placeholder:B="",label:Q,required:I=!1,error:E=null,onInput:n=null,readOnly:t=!1,horizontal:e=!1}){const h=document.createElement("div");if(h.className="wgt:w-full "+(e?"wgt:grid wgt:grid-cols-6 wgt:items-center wgt:gap-2":"wgt:flex wgt:flex-col wgt:gap-2"),Q){const a=document.createElement("label");if(a.htmlFor=g,a.className="wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2",a.innerText=Q,I){const i=document.createElement("span");i.className="wgt:text-red-500 wgt:ml-1",i.innerText="*",a.appendChild(i)}h.appendChild(a)}const c=document.createElement("input");c.type=C,c.name=g,c.id=g,c.value=A,c.placeholder=B,c.readOnly=t,c.autocomplete="off",c.autocapitalize="off",c.spellcheck=!1,c.className=["wgt:col-span-4","wgt:w-full","wgt:border","wgt:rounded","wgt:px-3","wgt:py-2","wgt:focus:outline-none","wgt:focus:ring-2",E?"wgt:border-red-500":"wgt:border-gray-300","wgt:read-only:focus:ring-transparent","wgt:bg-white","wgt:focus:ring-primary"].join(" "),I&&c.setAttribute("required","true"),typeof n=="function"&&c.addEventListener("input",n);const o=document.createElement("span");return o.className="wgt:text-red-500 wgt:text-sm wgt:whitespace-nowrap",o.innerText=E||"",E||(o.style.display="none"),h.appendChild(c),h.appendChild(o),{container:h,inputEl:c,setError(a){a?(o.innerText=a,o.style.display="block",c.classList.remove("wgt:border-gray-300"),c.classList.add("wgt:border-red-500")):(o.innerText="",o.style.display="none",c.classList.remove("wgt:border-red-500"),c.classList.add("wgt:border-gray-300"))},getValue(){return c.value}}}function $C({name:g,value:A="",options:C=[],label:B,disabled:Q=!1,error:I=null,onChange:E=null,required:n=!1,horizontal:t=!1,searchable:e=!1}){const h=document.createElement("div");h.className="wgt:w-full "+(t?"wgt:grid wgt:grid-cols-6 wgt:items-center wgt:gap-2":"wgt:flex wgt:flex-col wgt:gap-2");const c=document.createElement("label");if(c.htmlFor=g,c.className="wgt:font-medium wgt:text-text-sub-600 wgt:whitespace-nowrap wgt:col-span-2",c.innerText=B,h.appendChild(c),n){const o=document.createElement("span");o.className="wgt:text-red-500 wgt:ml-1",o.innerText="*",c.appendChild(o)}if(e){const o=document.createElement("div");o.className="wgt:col-span-4 wgt:relative";const a=document.createElement("input");a.type="text",a.placeholder=`Tìm kiếm ${B.toLowerCase()}...`,a.disabled=Q,a.className=["wgt:border","wgt:rounded","wgt:px-3","wgt:py-2","wgt:w-full","wgt:focus:outline-none","wgt:focus:ring-2","wgt:focus:ring-blue-500","wgt:bg-white",I?"wgt:border-red-500":"wgt:border-gray-300"].join(" ");const i=document.createElement("div");i.className="wgt:absolute wgt:top-full wgt:left-0 wgt:right-0 wgt:bg-white wgt:border wgt:border-gray-300 wgt:rounded wgt:shadow-lg wgt:z-50 wgt:hidden wgt:max-h-[500px] wgt:overflow-y-auto";const s=document.createElement("div");s.className="wgt:divide-y wgt:divide-gray-200";let r=A,P=null,u=[...C];const f=()=>{const q=C.find(m=>m.id?m.id===P:m.value===r);return q?q.label:""};a.value=f();const M=(q=u)=>{if(s.innerHTML="",q.length===0){const m=document.createElement("div");m.className="wgt:px-3 wgt:py-2 wgt:text-gray-500 wgt:text-sm",m.innerText="Không tìm thấy kết quả",s.appendChild(m);return}q.forEach(m=>{const v=document.createElement("div");v.className=["wgt:px-3","wgt:py-2","wgt:cursor-pointer","wgt:hover:bg-gray-100","wgt:text-sm",m.id?P===m.id?"wgt:bg-blue-50 wgt:text-blue-700":"":r===m.value?"wgt:bg-blue-50 wgt:text-blue-700":""].filter(Boolean).join(" "),v.innerText=m.label,v.dataset.value=m.value,v.addEventListener("click",()=>{if(m.id&&(P=m.id),r=m.value,a.value=m.label,i.classList.add("wgt:hidden"),typeof E=="function"){const Y={target:{value:m.value}};m.id&&(Y.target.id=m.id),E(Y)}}),s.appendChild(v)})};a.addEventListener("input",q=>{const m=q.target.value.toLowerCase();u=C.filter(v=>v.label.toLowerCase().includes(m)),M(u),i.classList.contains("wgt:hidden")||i.classList.remove("wgt:hidden")}),a.addEventListener("focus",()=>{i.classList.remove("wgt:hidden"),M()}),document.addEventListener("click",q=>{o.contains(q.target)||i.classList.add("wgt:hidden")}),a.addEventListener("keydown",q=>{q.key==="Escape"&&i.classList.add("wgt:hidden")}),i.appendChild(s),o.appendChild(a),o.appendChild(i),M();const l=document.createElement("select");l.style.display="none",l.name=g,l.id=g,C.forEach(q=>{const m=document.createElement("option");m.value=q.value,m.innerText=q.label,q.value===A&&(m.selected=!0),l.appendChild(m)}),h.appendChild(o),h.appendChild(l);const J=document.createElement("span");return J.className="wgt:text-red-500 wgt:text-sm wgt:mt-1",J.innerText=I||"",I||(J.style.display="none"),h.appendChild(J),{container:h,selectEl:l,setError(q){q?(J.innerText=q,J.style.display="block",a.classList.remove("wgt:border-gray-300"),a.classList.add("wgt:border-red-500")):(J.innerText="",J.style.display="none",a.classList.remove("wgt:border-red-500"),a.classList.add("wgt:border-gray-300"))},getValue(){return r},setValue(q,m,v){P=v||null,r=q||"";const Y=C.find(z=>z.id?z.id===v:z.value===q);Y?(a.value=Y.label,l.value=q,M()):(a.value=m||"",l.value=q||"",M())},setOptions(q){for(C.splice(0,C.length,...q),u=[...q];l.options.length>0;)l.remove(0);q.forEach(m=>{const v=document.createElement("option");v.value=m.value,v.innerText=m.label,l.appendChild(v)}),M()},setDisabled(q){a.disabled=!!q,l.disabled=!!q,q?(o.classList.add("wgt:opacity-75"),i.classList.add("wgt:hidden")):o.classList.remove("wgt:opacity-75")}}}else{const o=document.createElement("select");o.id=g,o.name=g,o.disabled=Q,o.className=["wgt:col-span-4","wgt:border","wgt:rounded","wgt:px-3","wgt:py-2","wgt:focus:outline-none","wgt:focus:ring-2","wgt:focus:ring-blue-500","wgt:bg-white",I?"wgt:border-red-500":"wgt:border-gray-300"].join(" ");const a=document.createElement("option");a.value="",a.disabled=!0,a.selected=A===""||A==null,a.innerText=`-- Chọn ${B.toLowerCase()} --`,o.appendChild(a),C.forEach(s=>{const r=document.createElement("option");r.value=s.value,r.innerText=s.label,s.value===A&&(r.selected=!0),o.appendChild(r)}),typeof E=="function"&&o.addEventListener("change",E),h.appendChild(o);const i=document.createElement("span");return i.className="wgt:text-red-500 wgt:text-sm wgt:mt-1",i.innerText=I||"",I||(i.style.display="none"),h.appendChild(i),{container:h,selectEl:o,setError(s){s?(i.innerText=s,i.style.display="block",o.classList.remove("wgt:border-gray-300"),o.classList.add("wgt:border-red-500")):(i.innerText="",i.style.display="none",o.classList.remove("wgt:border-red-500"),o.classList.add("wgt:border-gray-300"))},getValue(){return o.value},setOptions(s){for(;o.options.length>1;)o.remove(1);s.forEach(r=>{const P=document.createElement("option");P.value=r.value,P.innerText=r.label,o.appendChild(P)})},setDisabled(s){o.disabled=!!s}}}}function xg({title:g,isDisabled:A=!1,handleClick:C=null,type:B="button",className:Q=""}={}){const I=document.createElement("button");return I.type=B,I.disabled=A,I.className=["wgt:bg-primary","wgt:hover:bg-primary-dark","wgt:px-6","wgt:py-2","wgt:rounded-lg","wgt:disabled:opacity-50","wgt:disabled:cursor-not-allowed","wgt:cursor-pointer",Q].filter(Boolean).join(" "),I.innerText=g,typeof C=="function"&&I.addEventListener("click",E=>K(null,null,function*(){if(!I.disabled){I.disabled=!0;try{yield C(E)}catch(n){console.error("Button click handler error:",n)}finally{I.disabled=!1}}})),I}function QI({label:g,required:A=!1,file:C=null,onFileChange:B,error:Q=null,accept:I=""}){const E=document.createElement("form");E.className="wgt:flex wgt:flex-col";const n=document.createElement("label");if(n.htmlFor="upload",n.className="wgt:font-medium wgt:mb-1 wgt:text-text-sub-600",n.innerText=g,A){const f=document.createElement("span");f.className="wgt:text-red-500 wgt:ml-1",f.innerText="*",n.appendChild(f)}const t=I?I.split(",").map(f=>f.trim().startsWith("image/")?f.replace("image/","").toUpperCase():f.trim().startsWith(".")?f.replace(".","").toUpperCase():f.toUpperCase().replace("/*","")).filter(Boolean).join(", "):`JPG, PNG ${w("or")} JPEG`;n.innerHTML+=` <span class="wgt:text-xs wgt:font-normal wgt:leading-4 wgt:text-soft-400">(${w("fileFormat")} ${t}. ${w("maxFileSize")})</span>`,E.appendChild(n);const e=document.createElement("div");e.className=["wgt:h-fit","wgt:w-full","wgt:rounded","wgt:overflow-hidden","wgt:flex","wgt:items-start","wgt:cursor-pointer","wgt:justify-start","wgt:gap-2"].join(" ");const h=document.createElement("input");h.accept=I||"image/png, image/jpeg, .jpg, .jpeg, .png",h.id="upload",h.type="file",h.className="wgt:hidden";const c=document.createElement("div");c.className="wgt:w-full wgt:flex wgt:gap-1 wgt:items-start wgt:justify-start";const o=document.createElement("span");o.className="wgt:text-red-500 wgt:text-sm wgt:mt-1",o.innerText=Q||"",Q||(o.style.display="none");let a=null;function i(f){a=f,f?(o.innerText=f,o.style.display="block"):(o.innerText="",o.style.display="none")}const s=xg({title:"Upload file",className:"wgt:bg-primary wgt:hover:bg-primary-dark wgt:text-white wgt:px-6 wgt:py-1 wgt:rounded-md wgt:cursor-pointer",handleClick:f=>{f.stopPropagation(),h.click()}});function r(f,M=2){if(f===0)return"0 Bytes";const l=1024,J=Math.max(0,M),q=["Bytes","KB","MB","GB","TB"],m=Math.floor(Math.log(f)/Math.log(l));return parseFloat((f/Math.pow(l,m)).toFixed(J))+" "+q[m]}function P(f){const M=f.type.toLowerCase(),l="."+f.name.split(".").pop().toLowerCase();return h.accept.split(",").map(q=>q.trim().toLowerCase()).filter(Boolean).some(q=>q.startsWith(".")?q===l:q.endsWith("/*")?M.startsWith(q.replace("/*","")):M===q)}function u(f){if(c.innerHTML="",i(null),f){P(f)||i(`File không hợp lệ. Chỉ chấp nhận: ${h.accept}`),f.size<=500*1024||i("Dung lượng file vượt quá 500KB.");const l=document.createElement("div");if(l.className="wgt:flex wgt:items-center wgt:gap-4",l.addEventListener("click",()=>{h.click()}),f.type.startsWith("image/")){const v=document.createElement("img");v.src=URL.createObjectURL(f),v.alt="Preview",v.className="wgt:h-20 wgt:w-20 wgt:rounded wgt:object-contain wgt:rounded",l.appendChild(v)}const J=document.createElement("div");J.className="wgt:flex wgt:flex-col";const q=document.createElement("p");q.className="wgt:text-sm wgt:font-medium wgt:text-gray-800",q.innerText=f.name;const m=document.createElement("p");m.className="wgt:text-sm wgt:text-gray-500",m.innerText=r(f.size),J.appendChild(q),J.appendChild(m),l.appendChild(J),c.appendChild(l),C=f,typeof B=="function"&&B(f)}else{const M=document.createElement("div");M.className="wgt:flex wgt:items-center",M.appendChild(s),c.appendChild(M)}}return h.addEventListener("change",f=>{const M=f.target.files&&f.target.files[0]?f.target.files[0]:null;M&&(u(M),typeof B=="function"&&B(M))}),u(C),e.appendChild(c),e.appendChild(h),E.appendChild(e),E.appendChild(o),{container:E,getValues(){return C},setFile(f){C=f,u(f),typeof B=="function"&&B(f)},clearFile(){C=null,u(null),typeof B=="function"&&B(null)},getError:()=>a}}function II({file:g,placeholder:A,caption:C,onFileSelected:B,onError:Q}){const I=document.createElement("div");I.className="wgt:flex wgt:flex-col wgt:items-center wgt:gap-2";const E=document.createElement("div");E.className=["wgt:w-full","wgt:h-fit","wgt:border-2","wgt:border-dashed","wgt:border-sub-300","wgt:rounded-lg","wgt:flex","wgt:flex-col","wgt:gap-2","wgt:items-center","wgt:justify-center","wgt:cursor-pointer","wgt:bg-weak-50","wgt:py-6"].join(" "),I.append(E);const n=document.createElement("input");n.type="file",n.accept="image/png, image/jpeg, image/jpg",n.className="wgt:hidden",E.append(n);const t=document.createElement("div");t.className="wgt:w-10 wgt:h-10 wgt:rounded-full wgt:bg-primary/16 wgt:flex wgt:items-center wgt:justify-center",t.innerHTML=`
3
3
  <svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg">
4
4
  <path d="M8.83184 0.96875H10.3485C10.4833 0.96875 10.5507 1.03316 10.5507 1.16199V18.1668C10.5507 18.2956 10.4833 18.3601 10.3485 18.3601H8.83184C8.69702 18.3601 8.62962 18.2956 8.62962 18.1668V1.16199C8.62962 1.03316 8.69702 0.96875 8.83184 0.96875Z" fill="#008C4F"/>
5
5
  <path d="M1.09676 8.74653H18.0836C18.2184 8.74653 18.2858 8.81094 18.2858 8.93976V10.389C18.2858 10.5179 18.2184 10.5823 18.0836 10.5823H1.09676C0.961939 10.5823 0.894531 10.5179 0.894531 10.389V8.93976C0.894531 8.81094 0.961939 8.74653 1.09676 8.74653Z" fill="#008C4F"/>
@@ -67,7 +67,7 @@ var L = (g, A, B) => new Promise((C, Q) => {
67
67
  throw I;
68
68
  }, "return" in A && C("return"), Q;
69
69
  }, rQ = (g, A, B) => (A = g[sg("asyncIterator")]) ? A.call(g) : (g = g[sg("iterator")](), A = {}, B = (C, Q) => (Q = g[C]) && (A[C] = (I) => new Promise((E, n, t) => (I = Q.call(g, I), t = I.done, Promise.resolve(I.value).then((c) => E({ value: c, done: t }), n)))), B("next"), B("return"), A);
70
- import { t as a, g as _g, r as NI, u as yI } from "./index-CYkUPESa.js";
70
+ import { t as a, g as _g, r as NI, u as yI } from "./index-uN-nVMca.js";
71
71
  import { g as jI } from "./_commonjsHelpers-bAxELxBV.js";
72
72
  function qQ({ steps: g = [], currentStep: A = 1 } = {}) {
73
73
  const B = document.createElement("div");
@@ -667,9 +667,18 @@ function rg({
667
667
  "wgt:disabled:cursor-not-allowed",
668
668
  "wgt:cursor-pointer",
669
669
  Q
670
- ].filter(Boolean).join(" "), I.innerText = g, typeof B == "function" && I.addEventListener("click", (E) => {
671
- I.disabled || B(E);
672
- }), I;
670
+ ].filter(Boolean).join(" "), I.innerText = g, typeof B == "function" && I.addEventListener("click", (E) => L(null, null, function* () {
671
+ if (!I.disabled) {
672
+ I.disabled = !0;
673
+ try {
674
+ yield B(E);
675
+ } catch (n) {
676
+ console.error("Button click handler error:", n);
677
+ } finally {
678
+ I.disabled = !1;
679
+ }
680
+ }
681
+ })), I;
673
682
  }
674
683
  function fQ({
675
684
  label: g,
package/package.json CHANGED
@@ -46,7 +46,7 @@
46
46
  "prepare": "npm run build"
47
47
  },
48
48
  "type": "module",
49
- "version": "1.50.7",
49
+ "version": "1.50.9",
50
50
  "repository": {},
51
51
  "dependencies": {
52
52
  "axios": "^1.9.0",