@syncfy/authentication-widget 0.0.13 → 0.0.14
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.
|
@@ -8039,26 +8039,26 @@ const d2 = qi().noUnknown().shape({
|
|
|
8039
8039
|
let dg = {
|
|
8040
8040
|
git: {
|
|
8041
8041
|
dirty: !1,
|
|
8042
|
-
raw: "v0.0.
|
|
8043
|
-
hash: "
|
|
8042
|
+
raw: "v0.0.14-0-g24bd51e",
|
|
8043
|
+
hash: "g24bd51e",
|
|
8044
8044
|
distance: 0,
|
|
8045
|
-
tag: "v0.0.
|
|
8045
|
+
tag: "v0.0.14",
|
|
8046
8046
|
semver: {
|
|
8047
8047
|
options: {
|
|
8048
8048
|
loose: !1,
|
|
8049
8049
|
includePrerelease: !1
|
|
8050
8050
|
},
|
|
8051
8051
|
loose: !1,
|
|
8052
|
-
raw: "v0.0.
|
|
8052
|
+
raw: "v0.0.14",
|
|
8053
8053
|
major: 0,
|
|
8054
8054
|
minor: 0,
|
|
8055
|
-
patch:
|
|
8055
|
+
patch: 14,
|
|
8056
8056
|
prerelease: [],
|
|
8057
8057
|
build: [],
|
|
8058
|
-
version: "0.0.
|
|
8058
|
+
version: "0.0.14"
|
|
8059
8059
|
},
|
|
8060
|
-
suffix: "0-
|
|
8061
|
-
semverString: "0.0.
|
|
8060
|
+
suffix: "0-g24bd51e",
|
|
8061
|
+
semverString: "0.0.14"
|
|
8062
8062
|
}
|
|
8063
8063
|
};
|
|
8064
8064
|
function V0() {
|
|
@@ -73476,14 +73476,7 @@ const rBe = ["aria-label"], nBe = { key: 1 }, iBe = ["aria-label"], aBe = { key:
|
|
|
73476
73476
|
return typeof ce == "string" ? ce : ce.response && ce.response.data && ce.response.data.message === "Credential error, please consider updating credential password" ? "api_errors.credential_error." : `api_errors.${ce.response ? ce.response.status ? ce.response.status : 500 : "no_internet"}.`;
|
|
73477
73477
|
}
|
|
73478
73478
|
function F() {
|
|
73479
|
-
|
|
73480
|
-
B.value ? ne() : O.value ? (a("back"), O.value = null) : (a("back"), T.value = !0);
|
|
73481
|
-
else if (L.value === "finish")
|
|
73482
|
-
fe();
|
|
73483
|
-
else if (L.value === "twofa")
|
|
73484
|
-
Qe();
|
|
73485
|
-
else
|
|
73486
|
-
return Me();
|
|
73479
|
+
L.value ? L.value === "finish" ? fe() : L.value === "twofa" ? Qe() : n.navigation.oneSiteFlow && n.navigation.displayPrivacyScreen ? (a("back"), T.value = !0) : Me() : B.value ? ne() : O.value ? (a("back"), O.value = null) : (a("back"), T.value = !0);
|
|
73487
73480
|
}
|
|
73488
73481
|
function U() {
|
|
73489
73482
|
C.value = !0, re();
|
|
@@ -73687,7 +73680,7 @@ const rBe = ["aria-label"], nBe = { key: 1 }, iBe = ["aria-label"], aBe = { key:
|
|
|
73687
73680
|
});
|
|
73688
73681
|
}
|
|
73689
73682
|
function me(ce, _e = !1) {
|
|
73690
|
-
if (Un("open_credential", { id_credential: ce }), !M || !M.loading) {
|
|
73683
|
+
if (T.value = !1, Un("open_credential", { id_credential: ce }), !M || !M.loading) {
|
|
73691
73684
|
let it = new Xb({
|
|
73692
73685
|
short: i("credential.search.title")
|
|
73693
73686
|
}), we;
|
|
@@ -681,7 +681,7 @@
|
|
|
681
681
|
*/cs(Lz,Dz,"app");function $z(){const t=Gx({apiKey:"AIzaSyC9JxQ4ULW2nC-tBNwsZ52OTQnS9mIeeS8",authDomain:"syncfy-widget.firebaseapp.com",projectId:"syncfy-widget",storageBucket:"syncfy-widget.appspot.com",messagingSenderId:"406921126981",appId:"1:406921126981:web:788d7d85203868101aaf2c",measurementId:"G-FYDLPN68N8"});O6(t),Ln("load")}function Ln(e,t){const r=O6();R6(r,e,{environment:{}.NODE_ENV,eventAction:e,...t||{}})}function yl(e){this._maxSize=e,this.clear()}yl.prototype.clear=function(){this._size=0,this._values=Object.create(null)},yl.prototype.get=function(e){return this._values[e]},yl.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var zz=/[^.^\]^[]+|(?=\[\]|\.\.)/g,L6=/^\d+$/,Uz=/^\d/,Vz=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,qz=/^\s*(['"]?)(.*?)(\1)\s*$/,Bg=512,D6=new yl(Bg),$6=new yl(Bg),z6=new yl(Bg),bl={Cache:yl,split:Ng,normalizePath:kg,setter:function(e){var t=kg(e);return $6.get(e)||$6.set(e,function(n,a){for(var i=0,o=t.length,l=n;i<o-1;){var u=t[i];if(u==="__proto__"||u==="constructor"||u==="prototype")return n;l=l[t[i++]]}l[t[i]]=a})},getter:function(e,t){var r=kg(e);return z6.get(e)||z6.set(e,function(a){for(var i=0,o=r.length;i<o;)if(a!=null||!t)a=a[r[i++]];else return;return a})},join:function(e){return e.reduce(function(t,r){return t+(Og(r)||L6.test(r)?"["+r+"]":(t?".":"")+r)},"")},forEach:function(e,t,r){Hz(Array.isArray(e)?e:Ng(e),t,r)}};function kg(e){return D6.get(e)||D6.set(e,Ng(e).map(function(t){return t.replace(qz,"$2")}))}function Ng(e){return e.match(zz)||[""]}function Hz(e,t,r){var n=e.length,a,i,o,l;for(i=0;i<n;i++)a=e[i],a&&(Wz(a)&&(a='"'+a+'"'),l=Og(a),o=!l&&/^\d+$/.test(a),t.call(r,a,l,o,i,e))}function Og(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function jz(e){return e.match(Uz)&&!e.match(L6)}function Kz(e){return Vz.test(e)}function Wz(e){return!Og(e)&&(jz(e)||Kz(e))}const Gz=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Ed=e=>e.match(Gz)||[],xd=e=>e[0].toUpperCase()+e.slice(1),Rg=(e,t)=>Ed(e).join(t).toLowerCase(),U6=e=>Ed(e).reduce((t,r)=>`${t}${t?r[0].toUpperCase()+r.slice(1).toLowerCase():r.toLowerCase()}`,"");var Pg={words:Ed,upperFirst:xd,camelCase:U6,pascalCase:e=>xd(U6(e)),snakeCase:e=>Rg(e,"_"),kebabCase:e=>Rg(e,"-"),sentenceCase:e=>xd(Rg(e," ")),titleCase:e=>Ed(e).map(xd).join(" ")},Fg={exports:{}};Fg.exports=function(e){return V6(Zz(e),e)},Fg.exports.array=V6;function V6(e,t){var r=e.length,n=new Array(r),a={},i=r,o=Yz(t),l=Jz(e);for(t.forEach(function(c){if(!l.has(c[0])||!l.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)a[i]||u(e[i],i,new Set);return n;function u(c,d,v){if(v.has(c)){var m;try{m=", node was:"+JSON.stringify(c)}catch{m=""}throw new Error("Cyclic dependency"+m)}if(!l.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!a[d]){a[d]=!0;var b=o.get(c)||new Set;if(b=Array.from(b),d=b.length){v.add(c);do{var _=b[--d];u(_,l.get(_),v)}while(d);v.delete(c)}n[--r]=c}}}function Zz(e){for(var t=new Set,r=0,n=e.length;r<n;r++){var a=e[r];t.add(a[0]),t.add(a[1])}return Array.from(t)}function Yz(e){for(var t=new Map,r=0,n=e.length;r<n;r++){var a=e[r];t.has(a[0])||t.set(a[0],new Set),t.has(a[1])||t.set(a[1],new Set),t.get(a[0]).add(a[1])}return t}function Jz(e){for(var t=new Map,r=0,n=e.length;r<n;r++)t.set(e[r],r);return t}var Xz=Fg.exports;const Qz=cd(Xz),eU=Object.prototype.toString,tU=Error.prototype.toString,rU=RegExp.prototype.toString,nU=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",iU=/^Symbol\((.*)\)(.*)$/;function aU(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function q6(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const r=typeof e;if(r==="number")return aU(e);if(r==="string")return t?`"${e}"`:e;if(r==="function")return"[Function "+(e.name||"anonymous")+"]";if(r==="symbol")return nU.call(e).replace(iU,"Symbol($1)");const n=eU.call(e).slice(8,-1);return n==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):n==="Error"||e instanceof Error?"["+tU.call(e)+"]":n==="RegExp"?rU.call(e):null}function To(e,t){let r=q6(e,t);return r!==null?r:JSON.stringify(e,function(n,a){let i=q6(this[n],t);return i!==null?i:a},2)}function H6(e){return e==null?[]:[].concat(e)}let j6,K6,W6,oU=/\$\{\s*(\w+)\s*\}/g;j6=Symbol.toStringTag;class G6{constructor(t,r,n,a){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[j6]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=a,this.errors=[],this.inner=[],H6(t).forEach(i=>{if(Dn.isError(i)){this.errors.push(...i.errors);const o=i.inner.length?i.inner:[i];this.inner.push(...o)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}K6=Symbol.hasInstance,W6=Symbol.toStringTag;class Dn extends Error{static formatError(t,r){const n=r.label||r.path||"this";return r=Object.assign({},r,{path:n,originalPath:r.path}),typeof t=="string"?t.replace(oU,(a,i)=>To(r[i])):typeof t=="function"?t(r):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,r,n,a,i){const o=new G6(t,r,n,a);if(i)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[W6]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Dn)}static[K6](t){return G6[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let ja={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:n})=>{const a=n!=null&&n!==r?` (cast from the value \`${To(n,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${To(r,!0)}\``+a:`${e} must match the configured type. The validated value was: \`${To(r,!0)}\``+a}},fi={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},ds={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Lg={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Dg={isValue:"${path} field must be ${value}"},Sd={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Md={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed:ja,string:fi,number:ds,date:Lg,object:Sd,array:Md,boolean:Dg,tuple:{notType:e=>{const{path:t,value:r,spec:n}=e,a=n.types.length;if(Array.isArray(r)){if(r.length<a)return`${t} tuple value has too few items, expected a length of ${a} but got ${r.length} for value: \`${To(r,!0)}\``;if(r.length>a)return`${t} tuple value has too many items, expected a length of ${a} but got ${r.length} for value: \`${To(r,!0)}\``}return Dn.formatError(ja.notType,e)}}});const fc=e=>e&&e.__isYupSchema__;class Cd{static fromOptions(t,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:a,otherwise:i}=r,o=typeof n=="function"?n:(...l)=>l.every(u=>u===n);return new Cd(t,(l,u)=>{var c;let d=o(...l)?a:i;return(c=d==null?void 0:d(u))!=null?c:u})}constructor(t,r){this.fn=void 0,this.refs=t,this.refs=t,this.fn=r}resolve(t,r){let n=this.refs.map(i=>i.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),a=this.fn(n,t,r);if(a===void 0||a===t)return t;if(!fc(a))throw new TypeError("conditions must return a schema object");return a.resolve(r)}}const Td={context:"$",value:"."};class _l{constructor(t,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Td.context,this.isValue=this.key[0]===Td.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?Td.context:this.isValue?Td.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&bl.getter(this.path,!0),this.map=r.map}getValue(t,r,n){let a=this.isContext?n:this.isValue?t:r;return this.getter&&(a=this.getter(a||{})),this.map&&(a=this.map(a)),a}cast(t,r){return this.getValue(t,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}_l.prototype.__isYupRef=!0;const ma=e=>e==null;function Fu(e){function t({value:r,path:n="",options:a,originalValue:i,schema:o},l,u){const{name:c,test:d,params:v,message:m,skipAbsent:b}=e;let{parent:_,context:S,abortEarly:T=o.spec.abortEarly,disableStackTrace:C=o.spec.disableStackTrace}=a;function I(M){return _l.isRef(M)?M.getValue(r,_,S):M}function B(M={}){const s=Object.assign({value:r,originalValue:i,label:o.spec.label,path:M.path||n,spec:o.spec,disableStackTrace:M.disableStackTrace||C},v,M.params);for(const p of Object.keys(s))s[p]=I(s[p]);const h=new Dn(Dn.formatError(M.message||m,s),r,s.path,M.type||c,s.disableStackTrace);return h.params=s,h}const N=T?l:u;let O={path:n,parent:_,type:c,from:a.from,createError:B,resolve:I,options:a,originalValue:i,schema:o};const P=M=>{Dn.isError(M)?N(M):M?u(null):N(B())},L=M=>{Dn.isError(M)?N(M):l(M)};if(b&&ma(r))return P(!0);let z;try{var K;if(z=d.call(O,r,O),typeof((K=z)==null?void 0:K.then)=="function"){if(a.sync)throw new Error(`Validation test of type: "${O.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(z).then(P,L)}}catch(M){L(M);return}P(z)}return t.OPTIONS=e,t}function sU(e,t,r,n=r){let a,i,o;return t?(bl.forEach(t,(l,u,c)=>{let d=u?l.slice(1,l.length-1):l;e=e.resolve({context:n,parent:a,value:r});let v=e.type==="tuple",m=c?parseInt(d,10):0;if(e.innerType||v){if(v&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(r&&m>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${t}. because there is no value at that index. `);a=r,r=r&&r[m],e=v?e.spec.types[m]:e.innerType}if(!c){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);a=r,r=r&&r[d],e=e.fields[d]}i=d,o=u?"["+l+"]":"."+l}),{schema:e,parent:a,parentPath:i}):{parent:a,parentPath:t,schema:e}}class Ad extends Set{describe(){const t=[];for(const r of this.values())t.push(_l.isRef(r)?r.describe():r);return t}resolveAll(t){let r=[];for(const n of this.values())r.push(t(n));return r}clone(){return new Ad(this.values())}merge(t,r){const n=this.clone();return t.forEach(a=>n.add(a)),r.forEach(a=>n.delete(a)),n}}function Lu(e,t=new Map){if(fc(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let n=0;n<e.length;n++)r[n]=Lu(e[n],t)}else if(e instanceof Map){r=new Map,t.set(e,r);for(const[n,a]of e.entries())r.set(n,Lu(a,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const n of e)r.add(Lu(n,t))}else if(e instanceof Object){r={},t.set(e,r);for(const[n,a]of Object.entries(e))r[n]=Lu(a,t)}else throw Error(`Unable to clone ${e}`);return r}let ci=class{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Ad,this._blacklist=new Ad,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(ja.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=Lu(Object.assign({},this.spec,t)),r}label(t){let r=this.clone();return r.spec.label=t,r}meta(...t){if(t.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},t[0]),r}withMutation(t){let r=this._mutate;this._mutate=!0;let n=t(this);return this._mutate=r,n}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let r=this,n=t.clone();const a=Object.assign({},r.spec,n.spec);return n.spec=a,n.internalTests=Object.assign({},r.internalTests,n.internalTests),n._whitelist=r._whitelist.merge(t._whitelist,t._blacklist),n._blacklist=r._blacklist.merge(t._blacklist,t._whitelist),n.tests=r.tests,n.exclusiveTests=r.exclusiveTests,n.withMutation(i=>{t.tests.forEach(o=>{i.test(o.OPTIONS)})}),n.transforms=[...r.transforms,...n.transforms],n}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let r=this;if(r.conditions.length){let n=r.conditions;r=r.clone(),r.conditions=[],r=n.reduce((a,i)=>i.resolve(a,t),r),r=r.resolve(t)}return r}resolveOptions(t){var r,n,a,i;return Object.assign({},t,{from:t.from||[],strict:(r=t.strict)!=null?r:this.spec.strict,abortEarly:(n=t.abortEarly)!=null?n:this.spec.abortEarly,recursive:(a=t.recursive)!=null?a:this.spec.recursive,disableStackTrace:(i=t.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(t,r={}){let n=this.resolve(Object.assign({value:t},r)),a=r.assert==="ignore-optionality",i=n._cast(t,r);if(r.assert!==!1&&!n.isType(i)){if(a&&ma(i))return i;let o=To(t),l=To(i);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}".
|
|
682
682
|
|
|
683
683
|
attempted value: ${o}
|
|
684
|
-
`+(l!==o?`result of cast: ${l}`:""))}return i}_cast(t,r){let n=t===void 0?t:this.transforms.reduce((a,i)=>i.call(this,a,t,this),t);return n===void 0&&(n=this.getDefault(r)),n}_validate(t,r={},n,a){let{path:i,originalValue:o=t,strict:l=this.spec.strict}=r,u=t;l||(u=this._cast(u,Object.assign({assert:!1},r)));let c=[];for(let d of Object.values(this.internalTests))d&&c.push(d);this.runTests({path:i,value:u,originalValue:o,options:r,tests:c},n,d=>{if(d.length)return a(d,u);this.runTests({path:i,value:u,originalValue:o,options:r,tests:this.tests},n,a)})}runTests(t,r,n){let a=!1,{tests:i,value:o,originalValue:l,path:u,options:c}=t,d=S=>{a||(a=!0,r(S,o))},v=S=>{a||(a=!0,n(S,o))},m=i.length,b=[];if(!m)return v([]);let _={value:o,originalValue:l,path:u,options:c,schema:this};for(let S=0;S<i.length;S++){const T=i[S];T(_,d,function(I){I&&(Array.isArray(I)?b.push(...I):b.push(I)),--m<=0&&v(b)})}}asNestedTest({key:t,index:r,parent:n,parentPath:a,originalParent:i,options:o}){const l=t??r;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const u=typeof l=="number";let c=n[l];const d=Object.assign({},o,{strict:!0,parent:n,value:c,originalValue:i[l],key:void 0,[u?"index":"key"]:l,path:u||l.includes(".")?`${a||""}[${u?l:`"${l}"`}]`:(a?`${a}.`:"")+t});return(v,m,b)=>this.resolve(d)._validate(c,d,m,b)}validate(t,r){var n;let a=this.resolve(Object.assign({},r,{value:t})),i=(n=r==null?void 0:r.disableStackTrace)!=null?n:a.spec.disableStackTrace;return new Promise((o,l)=>a._validate(t,r,(u,c)=>{Dn.isError(u)&&(u.value=c),l(u)},(u,c)=>{u.length?l(new Dn(u,c,void 0,void 0,i)):o(c)}))}validateSync(t,r){var n;let a=this.resolve(Object.assign({},r,{value:t})),i,o=(n=r==null?void 0:r.disableStackTrace)!=null?n:a.spec.disableStackTrace;return a._validate(t,Object.assign({},r,{sync:!0}),(l,u)=>{throw Dn.isError(l)&&(l.value=u),l},(l,u)=>{if(l.length)throw new Dn(l,t,void 0,void 0,o);i=u}),i}isValid(t,r){return this.validate(t,r).then(()=>!0,n=>{if(Dn.isError(n))return!1;throw n})}isValidSync(t,r){try{return this.validateSync(t,r),!0}catch(n){if(Dn.isError(n))return!1;throw n}}_getDefault(t){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,t):Lu(r)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,r){const n=this.clone({nullable:t});return n.internalTests.nullable=Fu({message:r,name:"nullable",test(a){return a===null?this.schema.spec.nullable:!0}}),n}optionality(t,r){const n=this.clone({optional:t});return n.internalTests.optionality=Fu({message:r,name:"optionality",test(a){return a===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(t=ja.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=ja.notNull){return this.nullability(!1,t)}required(t=ja.required){return this.clone().withMutation(r=>r.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let r=this.clone();return r.transforms.push(t),r}test(...t){let r;if(t.length===1?typeof t[0]=="function"?r={test:t[0]}:r=t[0]:t.length===2?r={name:t[0],test:t[1]}:r={name:t[0],message:t[1],test:t[2]},r.message===void 0&&(r.message=ja.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),a=Fu(r),i=r.exclusive||r.name&&n.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(n.exclusiveTests[r.name]=!!r.exclusive),n.tests=n.tests.filter(o=>!(o.OPTIONS.name===r.name&&(i||o.OPTIONS.test===a.OPTIONS.test))),n.tests.push(a),n}when(t,r){!Array.isArray(t)&&typeof t!="string"&&(r=t,t=".");let n=this.clone(),a=H6(t).map(i=>new _l(i));return a.forEach(i=>{i.isSibling&&n.deps.push(i.key)}),n.conditions.push(typeof r=="function"?new Cd(a,r):Cd.fromOptions(a,r)),n}typeError(t){let r=this.clone();return r.internalTests.typeError=Fu({message:t,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(t,r=ja.oneOf){let n=this.clone();return t.forEach(a=>{n._whitelist.add(a),n._blacklist.delete(a)}),n.internalTests.whiteList=Fu({message:r,name:"oneOf",skipAbsent:!0,test(a){let i=this.schema._whitelist,o=i.resolveAll(this.resolve);return o.includes(a)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:o}})}}),n}notOneOf(t,r=ja.notOneOf){let n=this.clone();return t.forEach(a=>{n._blacklist.add(a),n._whitelist.delete(a)}),n.internalTests.blacklist=Fu({message:r,name:"notOneOf",test(a){let i=this.schema._blacklist,o=i.resolveAll(this.resolve);return o.includes(a)?this.createError({params:{values:Array.from(i).join(", "),resolved:o}}):!0}}),n}strip(t=!0){let r=this.clone();return r.spec.strip=t,r}describe(t){const r=(t?this.resolve(t):this).clone(),{label:n,meta:a,optional:i,nullable:o}=r.spec;return{meta:a,label:n,optional:i,nullable:o,default:r.getDefault(t),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(u=>({name:u.OPTIONS.name,params:u.OPTIONS.params})).filter((u,c,d)=>d.findIndex(v=>v.name===u.name)===c)}}};ci.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ci.prototype[`${e}At`]=function(t,r,n={}){const{parent:a,parentPath:i,schema:o}=sU(this,t,r,n.context);return o[e](a&&a[i],Object.assign({},n,{parent:a,path:t}))};for(const e of["equals","is"])ci.prototype[e]=ci.prototype.oneOf;for(const e of["not","nope"])ci.prototype[e]=ci.prototype.notOneOf;const lU=()=>!0;function Z6(e){return new Y6(e)}class Y6 extends ci{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:lU},t))}}Z6.prototype=Y6.prototype;function ln(){return new J6}class J6 extends ci{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(n.spec.coerce&&!n.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Dg.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return ma(r)||r===!0}})}isFalse(t=Dg.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return ma(r)||r===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}ln.prototype=J6.prototype;const uU=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function fU(e){const t=$g(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(r=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}function $g(e){var t,r;const n=uU.exec(e);return n?{year:Ao(n[1]),month:Ao(n[2],1)-1,day:Ao(n[3],1),hour:Ao(n[4]),minute:Ao(n[5]),second:Ao(n[6]),millisecond:n[7]?Ao(n[7].substring(0,3)):0,precision:(t=(r=n[7])==null?void 0:r.length)!=null?t:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:Ao(n[10]),minuteOffset:Ao(n[11])}:null}function Ao(e,t=0){return Number(e)||t}let cU=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,hU=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,dU=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,pU="^\\d{4}-\\d{2}-\\d{2}",vU="\\d{2}:\\d{2}:\\d{2}",mU="(([+-]\\d{2}(:?\\d{2})?)|Z)",gU=new RegExp(`${pU}T${vU}(\\.\\d+)?${mU}$`),yU=e=>ma(e)||e===e.trim(),bU={}.toString();function br(){return new X6}class X6 extends ci{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce||n.isType(t)||Array.isArray(t))return t;const a=t!=null&&t.toString?t.toString():t;return a===bU?t:a})})}required(t){return super.required(t).withMutation(r=>r.test({message:t||ja.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(r=>r.OPTIONS.name!=="required"),t))}length(t,r=fi.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r=fi.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r=fi.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}matches(t,r){let n=!1,a,i;return r&&(typeof r=="object"?{excludeEmptyString:n=!1,message:a,name:i}=r:a=r),this.test({name:i||"matches",message:a||fi.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&n||o.search(t)!==-1})}email(t=fi.email){return this.matches(cU,{name:"email",message:t,excludeEmptyString:!0})}url(t=fi.url){return this.matches(hU,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=fi.uuid){return this.matches(dU,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let r="",n,a;return t&&(typeof t=="object"?{message:r="",allowOffset:n=!1,precision:a=void 0}=t:r=t),this.matches(gU,{name:"datetime",message:r||fi.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||fi.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:i=>{if(!i||n)return!0;const o=$g(i);return o?!!o.z:!1}}).test({name:"datetime_precision",message:r||fi.datetime_precision,params:{precision:a},skipAbsent:!0,test:i=>{if(!i||a==null)return!0;const o=$g(i);return o?o.precision===a:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=fi.trim){return this.transform(r=>r!=null?r.trim():r).test({message:t,name:"trim",test:yU})}lowercase(t=fi.lowercase){return this.transform(r=>ma(r)?r:r.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>ma(r)||r===r.toLowerCase()})}uppercase(t=fi.uppercase){return this.transform(r=>ma(r)?r:r.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>ma(r)||r===r.toUpperCase()})}}br.prototype=X6.prototype;let _U=e=>e!=+e;function Id(){return new Q6}class Q6 extends ci{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!_U(t)}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce)return t;let a=t;if(typeof a=="string"){if(a=a.replace(/\s/g,""),a==="")return NaN;a=+a}return n.isType(a)||a===null?a:parseFloat(a)})})}min(t,r=ds.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n>=this.resolve(t)}})}max(t,r=ds.max){return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n<=this.resolve(t)}})}lessThan(t,r=ds.lessThan){return this.test({message:r,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(n){return n<this.resolve(t)}})}moreThan(t,r=ds.moreThan){return this.test({message:r,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(n){return n>this.resolve(t)}})}positive(t=ds.positive){return this.moreThan(0,t)}negative(t=ds.negative){return this.lessThan(0,t)}integer(t=ds.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(t=>ma(t)?t:t|0)}round(t){var r;let n=["ceil","floor","round","trunc"];if(t=((r=t)==null?void 0:r.toLowerCase())||"round",t==="trunc")return this.truncate();if(n.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(a=>ma(a)?a:Math[t](a))}}Id.prototype=Q6.prototype;let wU=new Date(""),EU=e=>Object.prototype.toString.call(e)==="[object Date]";class Bd extends ci{constructor(){super({type:"date",check(t){return EU(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,r,n)=>!n.spec.coerce||n.isType(t)||t===null?t:(t=fU(t),isNaN(t)?Bd.INVALID_DATE:new Date(t)))})}prepareParam(t,r){let n;if(_l.isRef(t))n=t;else{let a=this.cast(t);if(!this._typeCheck(a))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);n=a}return n}min(t,r=Lg.min){let n=this.prepareParam(t,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a>=this.resolve(n)}})}max(t,r=Lg.max){let n=this.prepareParam(t,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a<=this.resolve(n)}})}}Bd.INVALID_DATE=wU,Bd.prototype;function xU(e,t=[]){let r=[],n=new Set,a=new Set(t.map(([o,l])=>`${o}-${l}`));function i(o,l){let u=bl.split(o)[0];n.add(u),a.has(`${l}-${u}`)||r.push([l,u])}for(const o of Object.keys(e)){let l=e[o];n.add(o),_l.isRef(l)&&l.isSibling?i(l.path,o):fc(l)&&"deps"in l&&l.deps.forEach(u=>i(u,o))}return Qz.array(Array.from(n),r).reverse()}function e4(e,t){let r=1/0;return e.some((n,a)=>{var i;if((i=t.path)!=null&&i.includes(n))return r=a,!0}),r}function t4(e){return(t,r)=>e4(e,t)-e4(e,r)}const r4=(e,t,r)=>{if(typeof e!="string")return e;let n=e;try{n=JSON.parse(e)}catch{}return r.isType(n)?n:e};function kd(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=kd(n);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=kd(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(kd)}):"optional"in e?e.optional():e}const SU=(e,t)=>{const r=[...bl.normalizePath(t)];if(r.length===1)return r[0]in e;let n=r.pop(),a=bl.getter(bl.join(r),!0)(e);return!!(a&&n in a)};let n4=e=>Object.prototype.toString.call(e)==="[object Object]";function i4(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(n=>r.indexOf(n)===-1)}const MU=t4([]);function Li(e){return new a4(e)}class a4 extends ci{constructor(t){super({type:"object",check(r){return n4(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=MU,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,r={}){var n;let a=super._cast(t,r);if(a===void 0)return this.getDefault(r);if(!this._typeCheck(a))return a;let i=this.fields,o=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(a).filter(v=>!this._nodes.includes(v))),u={},c=Object.assign({},r,{parent:u,__validating:r.__validating||!1}),d=!1;for(const v of l){let m=i[v],b=v in a;if(m){let _,S=a[v];c.path=(r.path?`${r.path}.`:"")+v,m=m.resolve({value:S,context:r.context,parent:u});let T=m instanceof ci?m.spec:void 0,C=T==null?void 0:T.strict;if(T!=null&&T.strip){d=d||v in a;continue}_=!r.__validating||!C?m.cast(a[v],c):a[v],_!==void 0&&(u[v]=_)}else b&&!o&&(u[v]=a[v]);(b!==v in u||u[v]!==a[v])&&(d=!0)}return d?u:a}_validate(t,r={},n,a){let{from:i=[],originalValue:o=t,recursive:l=this.spec.recursive}=r;r.from=[{schema:this,value:o},...i],r.__validating=!0,r.originalValue=o,super._validate(t,r,n,(u,c)=>{if(!l||!n4(c)){a(u,c);return}o=o||c;let d=[];for(let v of this._nodes){let m=this.fields[v];!m||_l.isRef(m)||d.push(m.asNestedTest({options:r,key:v,parent:c,parentPath:r.path,originalParent:o}))}this.runTests({tests:d,value:c,originalValue:o,options:r},n,v=>{a(v.sort(this._sortErrors).concat(u),c)})})}clone(t){const r=super.clone(t);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(t){let r=super.concat(t),n=r.fields;for(let[a,i]of Object.entries(this.fields)){const o=n[a];n[a]=o===void 0?i:o}return r.withMutation(a=>a.setFields(n,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let r={};return this._nodes.forEach(n=>{var a;const i=this.fields[n];let o=t;(a=o)!=null&&a.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[n]})),r[n]=i&&"getDefault"in i?i.getDefault(o):void 0}),r}setFields(t,r){let n=this.clone();return n.fields=t,n._nodes=xU(t,r),n._sortErrors=t4(Object.keys(t)),r&&(n._excludedEdges=r),n}shape(t,r=[]){return this.clone().withMutation(n=>{let a=n._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),a=[...n._excludedEdges,...r]),n.setFields(Object.assign(n.fields,t),a)})}partial(){const t={};for(const[r,n]of Object.entries(this.fields))t[r]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(t)}deepPartial(){return kd(this)}pick(t){const r={};for(const n of t)this.fields[n]&&(r[n]=this.fields[n]);return this.setFields(r,this._excludedEdges.filter(([n,a])=>t.includes(n)&&t.includes(a)))}omit(t){const r=[];for(const n of Object.keys(this.fields))t.includes(n)||r.push(n);return this.pick(r)}from(t,r,n){let a=bl.getter(t,!0);return this.transform(i=>{if(!i)return i;let o=i;return SU(i,t)&&(o=Object.assign({},i),n||delete o[t],o[r]=a(i)),o})}json(){return this.transform(r4)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Sd.exact,test(r){if(r==null)return!0;const n=i4(this.schema,r);return n.length===0||this.createError({params:{properties:n.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,r=Sd.noUnknown){typeof t!="boolean"&&(r=t,t=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:r,test(a){if(a==null)return!0;const i=i4(this.schema,a);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return n.spec.noUnknown=t,n}unknown(t=!0,r=Sd.noUnknown){return this.noUnknown(!t,r)}transformKeys(t){return this.transform(r=>{if(!r)return r;const n={};for(const a of Object.keys(r))n[t(a)]=r[a];return n})}camelCase(){return this.transformKeys(Pg.camelCase)}snakeCase(){return this.transformKeys(Pg.snakeCase)}constantCase(){return this.transformKeys(t=>Pg.snakeCase(t).toUpperCase())}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);n.fields={};for(const[i,o]of Object.entries(r.fields)){var a;let l=t;(a=l)!=null&&a.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[i]})),n.fields[i]=o.describe(l)}return n}}Li.prototype=a4.prototype;function ps(e){return new o4(e)}class o4 extends ci{constructor(t){super({type:"array",spec:{types:t},check(r){return Array.isArray(r)}}),this.innerType=void 0,this.innerType=t}_cast(t,r){const n=super._cast(t,r);if(!this._typeCheck(n)||!this.innerType)return n;let a=!1;const i=n.map((o,l)=>{const u=this.innerType.cast(o,Object.assign({},r,{path:`${r.path||""}[${l}]`}));return u!==o&&(a=!0),u});return a?i:n}_validate(t,r={},n,a){var i;let o=this.innerType,l=(i=r.recursive)!=null?i:this.spec.recursive;r.originalValue!=null&&r.originalValue,super._validate(t,r,n,(u,c)=>{var d;if(!l||!o||!this._typeCheck(c)){a(u,c);return}let v=new Array(c.length);for(let b=0;b<c.length;b++){var m;v[b]=o.asNestedTest({options:r,index:b,parent:c,parentPath:r.path,originalParent:(m=r.originalValue)!=null?m:t})}this.runTests({value:c,tests:v,originalValue:(d=r.originalValue)!=null?d:t,options:r},n,b=>a(b.concat(u),c))})}clone(t){const r=super.clone(t);return r.innerType=this.innerType,r}json(){return this.transform(r4)}concat(t){let r=super.concat(t);return r.innerType=this.innerType,t.innerType&&(r.innerType=r.innerType?r.innerType.concat(t.innerType):t.innerType),r}of(t){let r=this.clone();if(!fc(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+To(t));return r.innerType=t,r.spec=Object.assign({},r.spec,{types:t}),r}length(t,r=Md.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r){return r=r||Md.min,this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r){return r=r||Md.max,this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,r)=>this._typeCheck(t)?t:r==null?[]:[].concat(r))}compact(t){let r=t?(n,a,i)=>!t(n,a,i):n=>!!n;return this.transform(n=>n!=null?n.filter(r):n)}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);if(r.innerType){var a;let i=t;(a=i)!=null&&a.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),n.innerType=r.innerType.describe(i)}return n}}ps.prototype=o4.prototype;function s4(e){return new zg(e)}class zg{constructor(t){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(r,n={})=>{let a=this.builder(r,n);if(!fc(a))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(a=a.optional()),a.resolve(n)},this.builder=t,this.spec={meta:void 0,optional:!1}}clone(t){const r=new zg(this.builder);return r.spec=Object.assign({},this.spec,t),r}optionality(t){return this.clone({optional:t})}optional(){return this.optionality(!0)}resolve(t){return this._resolve(t.value,t)}cast(t,r){return this._resolve(t,r).cast(t,r)}asNestedTest(t){let{key:r,index:n,parent:a,options:i}=t,o=a[n??r];return this._resolve(o,Object.assign({},i,{value:o,parent:a})).asNestedTest(t)}validate(t,r){return this._resolve(t,r).validate(t,r)}validateSync(t,r){return this._resolve(t,r).validateSync(t,r)}validateAt(t,r,n){return this._resolve(r,n).validateAt(t,r,n)}validateSyncAt(t,r,n){return this._resolve(r,n).validateSyncAt(t,r,n)}isValid(t,r){return this._resolve(t,r).isValid(t,r)}isValidSync(t,r){return this._resolve(t,r).isValidSync(t,r)}describe(t){return t?this.resolve(t).describe(t):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...t){if(t.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},t[0]),r}}const Ug=Li().noUnknown().shape({client:Li().noUnknown().shape({logo:br(),name:br()}),entrypoint:Li().noUnknown().shape({account:br(),country:br(),credential:br(),site:br(),siteOrganizationType:br()}),locale:br().oneOf(["es","en"]),navigation:Li().noUnknown().shape({disableFormAutocomplete:ln(),displayAccountsSelection:ln(),displayBusinessSites:ln(),displayCredentialInModal:ln(),displayErrorsInToast:ln(),displayLogoImages:ln(),displayLongDescription:ln(),displayPersonalSites:ln(),displayPrivacyScreen:ln(),displaySiteOrganizations:ps().of(br()),displaySiteOrganizationTypes:ps().of(br()),displaySites:ps().of(br()),displayStatusInToast:ln(),enableBackNavigation:ln(),enableTwofaBackNavigation:ln(),formButtonsDisabledStyle:ln(),formShowPasswordStyle:br().oneOf(["icon","none","text"]),hideSelectCountry:ln(),hideSiteOrganizations:ps().of(br()),hideSiteOrganizationTypes:ps().of(br()),hideSites:ps().of(br()),oneSiteFlow:ln(),quickAnswer:ln(),returnToSiteFormOnUserError:s4(e=>typeof e=="object"?ps().of(Id().oneOf([401,403,411])):ln()),saveCredential:ln(),selectClass:br(),socketTimeout:Id().min(1),toastDuration:Id().min(0),toastPosition:br().oneOf(["bottom-left","bottom-right","top-left","top-right"])}),__internal__:Li().noUnknown().shape({apiBaseUrl:br(),apiEnv:br().oneOf(["development","production"]),assetsBaseUrl:br(),plaidSites:ln(),defaultHttpParams:Li()})}),CU=Li().shape({token:br().required(),element:s4(e=>{switch(typeof e){case"string":return br().test("isElement","${path} is not an Element",t=>{if(!document.querySelector(t))throw new Dn(`Invalid selector: Element "${t}" not found.`);return!0});case"object":return Li().test("isElement","${path} is not an Element",t=>{if(!ul(t))throw new Dn("Invalid element: Object should be a valid HtmlElement.");return!0});default:br()}}),refreshTokenFunction:Z6().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),enableTestMode:ln(),strict:Li().noUnknown().nullable().shape({authorization:Li().noUnknown().required().shape({type:br().oneOf(["jwk"]).required(),key:br().required()}),body:Li().noUnknown().required().shape({type:br().oneOf(["jwk"]).required(),key:br().required().test("isBase64","${path} is not a base64 encoded",e=>e&&/^(?:[A-Za-z0-9+/]{2}[A-Za-z0-9+/]{2})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e))})}),config:Ug}).strict().noUnknown();let Vg={git:{dirty:!1,raw:"v0.0.13-0-gafb5ec4",hash:"gafb5ec4",distance:0,tag:"v0.0.13",semver:{options:{loose:!1,includePrerelease:!1},loose:!1,raw:"v0.0.13",major:0,minor:0,patch:13,prerelease:[],build:[],version:"0.0.13"},suffix:"0-gafb5ec4",semverString:"0.0.13"}};function Nd(){let e=`${Vg.git.tag}.${Vg.git.distance}`;return{}.NODE_ENV==="production"?e=`${e}-beta`:e=`${e}-${Vg.git.hash}`,e}function TU(e,t){const r=parseInt("0x4",16),n="38060000000000000000000000000000000000000000000F00000000000000000000000000000000000D9802010000010101000000000000";let a;return console.log("OBTEINING BRIDGE SCRIPTS"),console.log("TOKEN",e),console.log("CHALLENGE",t),AU().then(()=>(console.log("BRIDGE SCRIPTS OK"),a=new digipass.nativebridge.DP110,new Promise((o,l)=>{console.log(" PROCESSING BRIDGE CONNECTION"),a.onError(()=>(console.log(" ERROR ON BRIDGE CONNECTION"),l("bridge.not_ready"))),a.onReady(u=>{console.log("BRIDGE CONNECTION READY"),console.log("DATA VERSION",u.versionCode),console.log("BRIDGE VERSION",a.versionCode),u.versionCode<a.versionCode&&l("bridge.host_update_available");const c=a.isReady();if(console.log("BRIDGE CONNECTION READY VERIFICATION",c),c)console.log("COMMAND_ID",r),a.getTokenInfo(r,function(d){if(console.log("BRIDGE CONNECTION getTokenInfo",d,d.returnCode),d.returnCode!==0)return l(`bridge.${Math.abs(d.returnCode)}`);console.log("STATIC_VECTOR",n),a.generateOTP(n,t,function(v){if(console.log("BRIDGE CONNECTION generateOTP",v,v.returnCode),v.returnCode!==0)return l(`bridge.${Math.abs(v.returnCode)}`);o({token:`${e}XX${v.otp}XX${d.info}XX${u.versionCode}`,challenge:t})})});else return Promise.reject("bridge.not_ready")})})))}function AU(){const e=new Promise((r,n)=>{if(document.getElementById("widgetBridgeConfig"))return r();const a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("id","widgetBridgeConfig"),a.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(a),a.onload=()=>r(),a.onerror=()=>{n("bridge.digipass_config_script_not_loaded")}}),t=new Promise((r,n)=>{if(document.getElementById("widgetBridgeUsb"))return r();const a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("id","widgetBridgeUsb"),a.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.dp110.min.js"),(document.head||document.body).appendChild(a),a.onload=()=>r(),a.onerror=()=>{n("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}const Di="bridgeBluetooth";function IU(e){const t=window[Di];return new Promise((n,a)=>{t.resolve=n,t.reject=a;let i,o;const{authenticationData:l}=e.authenticationResponse;l[0].idAuthenticationData==="signedMessage"?([i]=l[0].authenticationData,[o]=l[1].authenticationData):([i]=l[1].authenticationData,[o]=l[0].authenticationData),DU({signedMessage:i,signedTimeMessage:o})})}async function BU(){const e=window[Di];return new Promise(async(t,r)=>{if(e.nativeBridgeInstance.isReady())try{const n=await async function(a){return new Promise((i,o)=>{a.getDigipassTimeChallenge(l=>{if(l.returnCode!==0){const c={title:"Generar - TimeChallenge",response:{message:"Se ha producido un error al generar el TimeChallenge. Por favor, asegúrate de tener tu token conectado y encendido.",returnCode:l.returnCode}};return void o(c)}const u={title:"Generar - TimeChallenge",response:{message:`El TimeChallenge es: ${l.timeChallenge}`,timeChallenge:l.timeChallenge,errorCode:""}};i(u)})})}(e.nativeBridgeInstance);t(n)}catch(n){r(n)}else r({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:""}})})}function kU(e){window[Di]={isDp785Signature:!1,nativeBridgeInstance:null,resolve:null,reject:null};const t=window[Di];return NU().then(()=>new Promise((n,a)=>{t.resolve=n,t.reject=a,t.isDp785Signature=e!=="214",t.nativeBridgeInstance=new window.digipass.nativebridge.DPToken,LU()}))}function NU(){const e=new Promise((r,n)=>{if(document.getElementById("widgetBridgeConfig"))return r();const a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("id","widgetBridgeConfig"),a.setAttribute("src",`${{}.VUE_APP_LIB_BASE_URL_DEFAULT}digipass.nativebridge.config.min.js`),(document.head||document.body).appendChild(a),a.onload=()=>r(),a.onerror=()=>{n("bridge.digipass_config_script_not_loaded")}}),t=new Promise((r,n)=>{if(document.getElementById("widgetBridgeBluetooth"))return r();const a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("id","widgetBridgeBluetooth"),a.setAttribute("src",`${{}.VUE_APP_LIB_BASE_URL_DEFAULT}digipass.nativebridge.dptoken.min.js`),(document.head||document.body).appendChild(a),a.onload=()=>r(),a.onerror=()=>{n("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}async function OU(){const e=window[Di];try{const t=await RU(e.isDp785Signature);if(t.length===1){const[r]=t;await PU(r.serial);const n=await BU();e.resolve(n.response.timeChallenge)}}catch(t){e.reject(t),alert("Por favor, asegúrate de tener tu token conectado y encendido.")}}async function RU(e){const t=window[Di];return new Promise(async(r,n)=>{const a=e?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(t.nativeBridgeInstance.isReady())try{const i=await async function(u){return new Promise((c,d)=>{u.getDigipassList(v=>{if(v.returnCode===0)c(v.devices);else{const m={title:"Listar dispositivos",response:{message:"Error al obtener la lista de dispositivos disponibles.",returnCode:v.returnCode}};d(m)}})})}(t.nativeBridgeInstance),o=i.map(u=>({name:u.deviceName,serial:u.digipassSerial})),[l]=o;if(!l||!l.serial)return void n({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:a}});r(o)}catch(i){n(i)}else n({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:a}})})}async function PU(e){const t=window[Di];return new Promise((r,n)=>{t.nativeBridgeInstance.initializeDigipass(e,a=>{if(a.returnCode!==0){const o={title:"Inicializar dispositivo",response:{message:"Error al intentar inicializar el dispositivo.",returnCode:a.returnCode}};return void n(o)}const i={title:"Inicializar dispositivo",response:{message:`El dispositivo con serial: ${e} está listo para ser usado.`,errorCode:""}};r(i)})})}async function FU(e){const t=window[Di];return new Promise(async(r,n)=>{if(t.nativeBridgeInstance.isReady())try{const a=await async function(i,o){return new Promise((l,u)=>{i.generateResponseOnlyOTP(o,c=>{if(c.returnCode!==0){const v={title:"Generar OTP con PIN",response:{message:"No fue posible generar la OTP.",returnCode:c.returnCode}};return void u(v)}const d={title:"Generar OTP con PIN",response:{message:`La OTP se generó correctamente: ${c.otp}`,otp:c.otp,errorCode:"",processType:"DP785_T4_LINKED"}};l(d)})})}(t.nativeBridgeInstance,e);r(a)}catch(a){n(a)}else n({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:"DP785_T4_NOT_LINKED"}})})}async function LU(){const e=window[Di],t=await $U();if(t.response.errorCode!==""){alert(t.response.message),e.reject(t.response.errorCode);return}else await OU()}async function DU({signedMessage:e="",signedTimeMessage:t=""}){const r=window[Di];try{await l4(t,r.isDp785Signature);const n=await l4(e,r.isDp785Signature),{response:{messageSignature:a}}=n,i=7,o=await FU(i),{response:{otp:l}}=o,u={};u.otpChallenge=a;const c=`${l}${i}`;u.otp=c,r.resolve(`${u.otpChallenge}XX${u.otp}`)}catch(n){r.reject(n),alert("Error al intentar validar la sesión desde el dispositivo de acceso seguro.")}}async function $U(){const e=window[Di];return new Promise((t,r)=>{e.nativeBridgeInstance.onReady(()=>{e.nativeBridgeInstance.getNativeBridgeVersion(n=>{const a={title:"Conexión con Native Bridge",response:{errorCode:"",message:"El software Native Bridge se encuentra instalado en tu ordenador.",updateAvailable:!(n.versionCode>=e.nativeBridgeInstance.versionCode)}};t(a)})}),e.nativeBridgeInstance.onError(()=>{r({title:"Conexión con Native Bridge",response:{errorCode:"222",message:"El software Native Bridge no se encontró instalado en tu ordenador.",processType:"DP785_T4_NOT_LINKED"}})})})}async function l4(e,t){const r=window[Di];return new Promise(async(n,a)=>{const i=t?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(r.nativeBridgeInstance.isReady())try{const{responseMessage:o}=await async function(u,c){return new Promise((d,v)=>{u.transmitRequestMessage(c,m=>{if(m.returnCode===0)d(m);else{const b={title:"Firmar mensaje",response:{message:"No fue posible transmitir el mensaje.",returnCode:m.returnCode}};v(b)}})})}(r.nativeBridgeInstance,e),l=await async function(u,c,d){return new Promise((v,m)=>{u.parseResponseMessage(c,d,b=>{if(b.returnCode!==0){const S={title:"Firmar mensaje",response:{message:"No fue posible parsear el mensaje.",returnCode:b.returnCode}};return void m(S)}const _={title:"Firmar mensaje",response:{message:`Se realizó la firma del mensaje correctamente: ${b.messageSignature}`,messageSignature:b.messageSignature,errorCode:"",processType:"DP785_T4_LINKED"}};v(_)})})}(r.nativeBridgeInstance,o,e);n(l)}catch(o){a(o)}else a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:i}})})}function zU(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qg={exports:{}},u4;function f4(){return u4||(u4=1,function(e,t){(function(r,n){e.exports=n()})(Bt,function(){function r(fe){var H=typeof fe;return fe!==null&&(H==="object"||H==="function")}function n(fe){return typeof fe=="function"}var a=void 0;Array.isArray?a=Array.isArray:a=function(fe){return Object.prototype.toString.call(fe)==="[object Array]"};var i=a,o=0,l=void 0,u=void 0,c=function(H,G){P[o]=H,P[o+1]=G,o+=2,o===2&&(u?u(L):z())};function d(fe){u=fe}function v(fe){c=fe}var m=typeof window<"u"?window:void 0,b=m||{},_=b.MutationObserver||b.WebKitMutationObserver,S=typeof self>"u"&&typeof ue<"u"&&{}.toString.call(ue)==="[object process]",T=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function C(){return function(){return ue.nextTick(L)}}function I(){return typeof l<"u"?function(){l(L)}:O()}function B(){var fe=0,H=new _(L),G=document.createTextNode("");return H.observe(G,{characterData:!0}),function(){G.data=fe=++fe%2}}function N(){var fe=new MessageChannel;return fe.port1.onmessage=L,function(){return fe.port2.postMessage(0)}}function O(){var fe=setTimeout;return function(){return fe(L,1)}}var P=new Array(1e3);function L(){for(var fe=0;fe<o;fe+=2){var H=P[fe],G=P[fe+1];H(G),P[fe]=void 0,P[fe+1]=void 0}o=0}function $(){try{var fe=Function("return this")().require("vertx");return l=fe.runOnLoop||fe.runOnContext,I()}catch{return O()}}var z=void 0;S?z=C():_?z=B():T?z=N():m===void 0&&typeof zU=="function"?z=$():z=O();function K(fe,H){var G=this,me=new this.constructor(h);me[s]===void 0&&j(me);var oe=G._state;if(oe){var pe=arguments[oe-1];c(function(){return te(oe,me,pe,G._result)})}else X(G,me,fe,H);return me}function M(fe){var H=this;if(fe&&typeof fe=="object"&&fe.constructor===H)return fe;var G=new H(h);return R(G,fe),G}var s=Math.random().toString(36).substring(2);function h(){}var p=void 0,g=1,y=2;function w(){return new TypeError("You cannot resolve a promise with itself")}function A(){return new TypeError("A promises callback cannot return that same promise.")}function E(fe,H,G,me){try{fe.call(H,G,me)}catch(oe){return oe}}function f(fe,H,G){c(function(me){var oe=!1,pe=E(G,H,function(Je){oe||(oe=!0,H!==Je?R(me,Je):J(me,Je))},function(Je){oe||(oe=!0,W(me,Je))},"Settle: "+(me._label||" unknown promise"));!oe&&pe&&(oe=!0,W(me,pe))},fe)}function x(fe,H){H._state===g?J(fe,H._result):H._state===y?W(fe,H._result):X(H,void 0,function(G){return R(fe,G)},function(G){return W(fe,G)})}function k(fe,H,G){H.constructor===fe.constructor&&G===K&&H.constructor.resolve===M?x(fe,H):G===void 0?J(fe,H):n(G)?f(fe,H,G):J(fe,H)}function R(fe,H){if(fe===H)W(fe,w());else if(r(H)){var G=void 0;try{G=H.then}catch(me){W(fe,me);return}k(fe,H,G)}else J(fe,H)}function q(fe){fe._onerror&&fe._onerror(fe._result),ae(fe)}function J(fe,H){fe._state===p&&(fe._result=H,fe._state=g,fe._subscribers.length!==0&&c(ae,fe))}function W(fe,H){fe._state===p&&(fe._state=y,fe._result=H,c(q,fe))}function X(fe,H,G,me){var oe=fe._subscribers,pe=oe.length;fe._onerror=null,oe[pe]=H,oe[pe+g]=G,oe[pe+y]=me,pe===0&&fe._state&&c(ae,fe)}function ae(fe){var H=fe._subscribers,G=fe._state;if(H.length!==0){for(var me=void 0,oe=void 0,pe=fe._result,Je=0;Je<H.length;Je+=3)me=H[Je],oe=H[Je+G],me?te(G,me,oe,pe):oe(pe);fe._subscribers.length=0}}function te(fe,H,G,me){var oe=n(G),pe=void 0,Je=void 0,xe=!0;if(oe){try{pe=G(me)}catch(Me){xe=!1,Je=Me}if(H===pe){W(H,A());return}}else pe=me;H._state!==p||(oe&&xe?R(H,pe):xe===!1?W(H,Je):fe===g?J(H,pe):fe===y&&W(H,pe))}function he(fe,H){try{H(function(me){R(fe,me)},function(me){W(fe,me)})}catch(G){W(fe,G)}}var re=0;function Z(){return re++}function j(fe){fe[s]=re++,fe._state=void 0,fe._result=void 0,fe._subscribers=[]}function ie(){return new Error("Array Methods must be provided an Array")}var le=function(){function fe(H,G){this._instanceConstructor=H,this.promise=new H(h),this.promise[s]||j(this.promise),i(G)?(this.length=G.length,this._remaining=G.length,this._result=new Array(this.length),this.length===0?J(this.promise,this._result):(this.length=this.length||0,this._enumerate(G),this._remaining===0&&J(this.promise,this._result))):W(this.promise,ie())}return fe.prototype._enumerate=function(G){for(var me=0;this._state===p&&me<G.length;me++)this._eachEntry(G[me],me)},fe.prototype._eachEntry=function(G,me){var oe=this._instanceConstructor,pe=oe.resolve;if(pe===M){var Je=void 0,xe=void 0,Me=!1;try{Je=G.then}catch(ce){Me=!0,xe=ce}if(Je===K&&G._state!==p)this._settledAt(G._state,me,G._result);else if(typeof Je!="function")this._remaining--,this._result[me]=G;else if(oe===Q){var et=new oe(h);Me?W(et,xe):k(et,G,Je),this._willSettleAt(et,me)}else this._willSettleAt(new oe(function(ce){return ce(G)}),me)}else this._willSettleAt(pe(G),me)},fe.prototype._settledAt=function(G,me,oe){var pe=this.promise;pe._state===p&&(this._remaining--,G===y?W(pe,oe):this._result[me]=oe),this._remaining===0&&J(pe,this._result)},fe.prototype._willSettleAt=function(G,me){var oe=this;X(G,void 0,function(pe){return oe._settledAt(g,me,pe)},function(pe){return oe._settledAt(y,me,pe)})},fe}();function V(fe){return new le(this,fe).promise}function D(fe){var H=this;return i(fe)?new H(function(G,me){for(var oe=fe.length,pe=0;pe<oe;pe++)H.resolve(fe[pe]).then(G,me)}):new H(function(G,me){return me(new TypeError("You must pass an array to race."))})}function F(fe){var H=this,G=new H(h);return W(G,fe),G}function U(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function se(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var Q=function(){function fe(H){this[s]=Z(),this._result=this._state=void 0,this._subscribers=[],h!==H&&(typeof H!="function"&&U(),this instanceof fe?he(this,H):se())}return fe.prototype.catch=function(G){return this.then(null,G)},fe.prototype.finally=function(G){var me=this,oe=me.constructor;return n(G)?me.then(function(pe){return oe.resolve(G()).then(function(){return pe})},function(pe){return oe.resolve(G()).then(function(){throw pe})}):me.then(G,G)},fe}();Q.prototype.then=K,Q.all=V,Q.race=D,Q.resolve=M,Q.reject=F,Q._setScheduler=d,Q._setAsap=v,Q._asap=c;function ne(){var fe=void 0;if(typeof Bt<"u")fe=Bt;else if(typeof self<"u")fe=self;else try{fe=Function("return this")()}catch{throw new Error("polyfill failed because global object is unavailable in this environment")}var H=fe.Promise;if(H){var G=null;try{G=Object.prototype.toString.call(H.resolve())}catch{}if(G==="[object Promise]"&&!H.cast)return}fe.Promise=Q}return Q.polyfill=ne,Q.Promise=Q,Q})}(qg)),qg.exports}function UU(e){return e}var Hg=UU;function VU(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var jg=VU,qU=jg,c4=Math.max;function HU(e,t,r){return t=c4(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=c4(n.length-t,0),o=Array(i);++a<i;)o[a]=n[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=n[a];return l[t]=r(o),qU(e,this,l)}}var h4=HU;function jU(e){return function(){return e}}var KU=jU,WU=typeof Bt=="object"&&Bt&&Bt.Object===Object&&Bt,d4=WU,GU=d4,ZU=typeof self=="object"&&self&&self.Object===Object&&self,YU=GU||ZU||Function("return this")(),hi=YU,JU=hi,XU=JU.Symbol,cc=XU,p4=cc,v4=Object.prototype,QU=v4.hasOwnProperty,eV=v4.toString,hc=p4?p4.toStringTag:void 0;function tV(e){var t=QU.call(e,hc),r=e[hc];try{e[hc]=void 0;var n=!0}catch{}var a=eV.call(e);return n&&(t?e[hc]=r:delete e[hc]),a}var rV=tV,nV=Object.prototype,iV=nV.toString;function aV(e){return iV.call(e)}var oV=aV,m4=cc,sV=rV,lV=oV,uV="[object Null]",fV="[object Undefined]",g4=m4?m4.toStringTag:void 0;function cV(e){return e==null?e===void 0?fV:uV:g4&&g4 in Object(e)?sV(e):lV(e)}var Du=cV;function hV(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ga=hV,dV=Du,pV=ga,vV="[object AsyncFunction]",mV="[object Function]",gV="[object GeneratorFunction]",yV="[object Proxy]";function bV(e){if(!pV(e))return!1;var t=dV(e);return t==mV||t==gV||t==vV||t==yV}var Kg=bV,_V=hi,wV=_V["__core-js_shared__"],EV=wV,Wg=EV,y4=function(){var e=/[^.]+$/.exec(Wg&&Wg.keys&&Wg.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function xV(e){return!!y4&&y4 in e}var SV=xV,MV=Function.prototype,CV=MV.toString;function TV(e){if(e!=null){try{return CV.call(e)}catch{}try{return e+""}catch{}}return""}var b4=TV,AV=Kg,IV=SV,BV=ga,kV=b4,NV=/[\\^$.*+?()[\]{}|]/g,OV=/^\[object .+?Constructor\]$/,RV=Function.prototype,PV=Object.prototype,FV=RV.toString,LV=PV.hasOwnProperty,DV=RegExp("^"+FV.call(LV).replace(NV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $V(e){if(!BV(e)||IV(e))return!1;var t=AV(e)?DV:OV;return t.test(kV(e))}var zV=$V;function UV(e,t){return e==null?void 0:e[t]}var VV=UV,qV=zV,HV=VV;function jV(e,t){var r=HV(e,t);return qV(r)?r:void 0}var wl=jV,KV=wl,WV=function(){try{var e=KV(Object,"defineProperty");return e({},"",{}),e}catch{}}(),_4=WV,GV=KU,w4=_4,ZV=Hg,YV=w4?function(e,t){return w4(e,"toString",{configurable:!0,enumerable:!1,value:GV(t),writable:!0})}:ZV,JV=YV,XV=800,QV=16,eq=Date.now;function tq(e){var t=0,r=0;return function(){var n=eq(),a=QV-(n-r);if(r=n,a>0){if(++t>=XV)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var E4=tq,rq=JV,nq=E4,iq=nq(rq),Gg=iq,aq=Hg,oq=h4,sq=Gg;function lq(e,t){return sq(oq(e,t,aq),e+"")}var Zg=lq,uq=wl,fq=hi,cq=uq(fq,"WeakMap"),x4=cq,S4=x4,hq=S4&&new S4,M4=hq,dq=Hg,C4=M4,pq=C4?function(e,t){return C4.set(e,t),e}:dq,T4=pq,vq=ga,A4=Object.create,mq=function(){function e(){}return function(t){if(!vq(t))return{};if(A4)return A4(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Od=mq,gq=Od,yq=ga;function bq(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=gq(e.prototype),n=e.apply(r,t);return yq(n)?n:r}}var Rd=bq,_q=Rd,wq=hi,Eq=1;function xq(e,t,r){var n=t&Eq,a=_q(e);function i(){var o=this&&this!==wq&&this instanceof i?a:e;return o.apply(n?r:this,arguments)}return i}var Sq=xq,Mq=Math.max;function Cq(e,t,r,n){for(var a=-1,i=e.length,o=r.length,l=-1,u=t.length,c=Mq(i-o,0),d=Array(u+c),v=!n;++l<u;)d[l]=t[l];for(;++a<o;)(v||a<i)&&(d[r[a]]=e[a]);for(;c--;)d[l++]=e[a++];return d}var I4=Cq,Tq=Math.max;function Aq(e,t,r,n){for(var a=-1,i=e.length,o=-1,l=r.length,u=-1,c=t.length,d=Tq(i-l,0),v=Array(d+c),m=!n;++a<d;)v[a]=e[a];for(var b=a;++u<c;)v[b+u]=t[u];for(;++o<l;)(m||a<i)&&(v[b+r[o]]=e[a++]);return v}var B4=Aq;function Iq(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Bq=Iq;function kq(){}var Yg=kq,Nq=Od,Oq=Yg,Rq=4294967295;function Pd(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Rq,this.__views__=[]}Pd.prototype=Nq(Oq.prototype),Pd.prototype.constructor=Pd;var Jg=Pd;function Pq(){}var k4=Pq,N4=M4,Fq=k4,Lq=N4?function(e){return N4.get(e)}:Fq,O4=Lq,Dq={},$q=Dq,R4=$q,zq=Object.prototype,Uq=zq.hasOwnProperty;function Vq(e){for(var t=e.name+"",r=R4[t],n=Uq.call(R4,t)?r.length:0;n--;){var a=r[n],i=a.func;if(i==null||i==e)return a.name}return t}var qq=Vq,Hq=Od,jq=Yg;function Fd(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}Fd.prototype=Hq(jq.prototype),Fd.prototype.constructor=Fd;var P4=Fd,Kq=Array.isArray,Ka=Kq;function Wq(e){return e!=null&&typeof e=="object"}var Io=Wq;function Gq(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Ld=Gq,Zq=Jg,Yq=P4,Jq=Ld;function Xq(e){if(e instanceof Zq)return e.clone();var t=new Yq(e.__wrapped__,e.__chain__);return t.__actions__=Jq(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Qq=Xq,eH=Jg,F4=P4,tH=Yg,rH=Ka,nH=Io,iH=Qq,aH=Object.prototype,oH=aH.hasOwnProperty;function Dd(e){if(nH(e)&&!rH(e)&&!(e instanceof eH)){if(e instanceof F4)return e;if(oH.call(e,"__wrapped__"))return iH(e)}return new F4(e)}Dd.prototype=tH.prototype,Dd.prototype.constructor=Dd;var sH=Dd,lH=Jg,uH=O4,fH=qq,cH=sH;function hH(e){var t=fH(e),r=cH[t];if(typeof r!="function"||!(t in lH.prototype))return!1;if(e===r)return!0;var n=uH(r);return!!n&&e===n[0]}var dH=hH,pH=T4,vH=E4,mH=vH(pH),L4=mH,gH=/\{\n\/\* \[wrapped with (.+)\] \*/,yH=/,? & /;function bH(e){var t=e.match(gH);return t?t[1].split(yH):[]}var _H=bH,wH=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function EH(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(wH,`{
|
|
684
|
+
`+(l!==o?`result of cast: ${l}`:""))}return i}_cast(t,r){let n=t===void 0?t:this.transforms.reduce((a,i)=>i.call(this,a,t,this),t);return n===void 0&&(n=this.getDefault(r)),n}_validate(t,r={},n,a){let{path:i,originalValue:o=t,strict:l=this.spec.strict}=r,u=t;l||(u=this._cast(u,Object.assign({assert:!1},r)));let c=[];for(let d of Object.values(this.internalTests))d&&c.push(d);this.runTests({path:i,value:u,originalValue:o,options:r,tests:c},n,d=>{if(d.length)return a(d,u);this.runTests({path:i,value:u,originalValue:o,options:r,tests:this.tests},n,a)})}runTests(t,r,n){let a=!1,{tests:i,value:o,originalValue:l,path:u,options:c}=t,d=S=>{a||(a=!0,r(S,o))},v=S=>{a||(a=!0,n(S,o))},m=i.length,b=[];if(!m)return v([]);let _={value:o,originalValue:l,path:u,options:c,schema:this};for(let S=0;S<i.length;S++){const T=i[S];T(_,d,function(I){I&&(Array.isArray(I)?b.push(...I):b.push(I)),--m<=0&&v(b)})}}asNestedTest({key:t,index:r,parent:n,parentPath:a,originalParent:i,options:o}){const l=t??r;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const u=typeof l=="number";let c=n[l];const d=Object.assign({},o,{strict:!0,parent:n,value:c,originalValue:i[l],key:void 0,[u?"index":"key"]:l,path:u||l.includes(".")?`${a||""}[${u?l:`"${l}"`}]`:(a?`${a}.`:"")+t});return(v,m,b)=>this.resolve(d)._validate(c,d,m,b)}validate(t,r){var n;let a=this.resolve(Object.assign({},r,{value:t})),i=(n=r==null?void 0:r.disableStackTrace)!=null?n:a.spec.disableStackTrace;return new Promise((o,l)=>a._validate(t,r,(u,c)=>{Dn.isError(u)&&(u.value=c),l(u)},(u,c)=>{u.length?l(new Dn(u,c,void 0,void 0,i)):o(c)}))}validateSync(t,r){var n;let a=this.resolve(Object.assign({},r,{value:t})),i,o=(n=r==null?void 0:r.disableStackTrace)!=null?n:a.spec.disableStackTrace;return a._validate(t,Object.assign({},r,{sync:!0}),(l,u)=>{throw Dn.isError(l)&&(l.value=u),l},(l,u)=>{if(l.length)throw new Dn(l,t,void 0,void 0,o);i=u}),i}isValid(t,r){return this.validate(t,r).then(()=>!0,n=>{if(Dn.isError(n))return!1;throw n})}isValidSync(t,r){try{return this.validateSync(t,r),!0}catch(n){if(Dn.isError(n))return!1;throw n}}_getDefault(t){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,t):Lu(r)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,r){const n=this.clone({nullable:t});return n.internalTests.nullable=Fu({message:r,name:"nullable",test(a){return a===null?this.schema.spec.nullable:!0}}),n}optionality(t,r){const n=this.clone({optional:t});return n.internalTests.optionality=Fu({message:r,name:"optionality",test(a){return a===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(t=ja.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=ja.notNull){return this.nullability(!1,t)}required(t=ja.required){return this.clone().withMutation(r=>r.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let r=this.clone();return r.transforms.push(t),r}test(...t){let r;if(t.length===1?typeof t[0]=="function"?r={test:t[0]}:r=t[0]:t.length===2?r={name:t[0],test:t[1]}:r={name:t[0],message:t[1],test:t[2]},r.message===void 0&&(r.message=ja.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),a=Fu(r),i=r.exclusive||r.name&&n.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(n.exclusiveTests[r.name]=!!r.exclusive),n.tests=n.tests.filter(o=>!(o.OPTIONS.name===r.name&&(i||o.OPTIONS.test===a.OPTIONS.test))),n.tests.push(a),n}when(t,r){!Array.isArray(t)&&typeof t!="string"&&(r=t,t=".");let n=this.clone(),a=H6(t).map(i=>new _l(i));return a.forEach(i=>{i.isSibling&&n.deps.push(i.key)}),n.conditions.push(typeof r=="function"?new Cd(a,r):Cd.fromOptions(a,r)),n}typeError(t){let r=this.clone();return r.internalTests.typeError=Fu({message:t,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(t,r=ja.oneOf){let n=this.clone();return t.forEach(a=>{n._whitelist.add(a),n._blacklist.delete(a)}),n.internalTests.whiteList=Fu({message:r,name:"oneOf",skipAbsent:!0,test(a){let i=this.schema._whitelist,o=i.resolveAll(this.resolve);return o.includes(a)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:o}})}}),n}notOneOf(t,r=ja.notOneOf){let n=this.clone();return t.forEach(a=>{n._blacklist.add(a),n._whitelist.delete(a)}),n.internalTests.blacklist=Fu({message:r,name:"notOneOf",test(a){let i=this.schema._blacklist,o=i.resolveAll(this.resolve);return o.includes(a)?this.createError({params:{values:Array.from(i).join(", "),resolved:o}}):!0}}),n}strip(t=!0){let r=this.clone();return r.spec.strip=t,r}describe(t){const r=(t?this.resolve(t):this).clone(),{label:n,meta:a,optional:i,nullable:o}=r.spec;return{meta:a,label:n,optional:i,nullable:o,default:r.getDefault(t),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(u=>({name:u.OPTIONS.name,params:u.OPTIONS.params})).filter((u,c,d)=>d.findIndex(v=>v.name===u.name)===c)}}};ci.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ci.prototype[`${e}At`]=function(t,r,n={}){const{parent:a,parentPath:i,schema:o}=sU(this,t,r,n.context);return o[e](a&&a[i],Object.assign({},n,{parent:a,path:t}))};for(const e of["equals","is"])ci.prototype[e]=ci.prototype.oneOf;for(const e of["not","nope"])ci.prototype[e]=ci.prototype.notOneOf;const lU=()=>!0;function Z6(e){return new Y6(e)}class Y6 extends ci{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:lU},t))}}Z6.prototype=Y6.prototype;function ln(){return new J6}class J6 extends ci{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(n.spec.coerce&&!n.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Dg.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return ma(r)||r===!0}})}isFalse(t=Dg.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return ma(r)||r===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}ln.prototype=J6.prototype;const uU=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function fU(e){const t=$g(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(r=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}function $g(e){var t,r;const n=uU.exec(e);return n?{year:Ao(n[1]),month:Ao(n[2],1)-1,day:Ao(n[3],1),hour:Ao(n[4]),minute:Ao(n[5]),second:Ao(n[6]),millisecond:n[7]?Ao(n[7].substring(0,3)):0,precision:(t=(r=n[7])==null?void 0:r.length)!=null?t:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:Ao(n[10]),minuteOffset:Ao(n[11])}:null}function Ao(e,t=0){return Number(e)||t}let cU=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,hU=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,dU=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,pU="^\\d{4}-\\d{2}-\\d{2}",vU="\\d{2}:\\d{2}:\\d{2}",mU="(([+-]\\d{2}(:?\\d{2})?)|Z)",gU=new RegExp(`${pU}T${vU}(\\.\\d+)?${mU}$`),yU=e=>ma(e)||e===e.trim(),bU={}.toString();function br(){return new X6}class X6 extends ci{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce||n.isType(t)||Array.isArray(t))return t;const a=t!=null&&t.toString?t.toString():t;return a===bU?t:a})})}required(t){return super.required(t).withMutation(r=>r.test({message:t||ja.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(r=>r.OPTIONS.name!=="required"),t))}length(t,r=fi.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r=fi.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r=fi.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}matches(t,r){let n=!1,a,i;return r&&(typeof r=="object"?{excludeEmptyString:n=!1,message:a,name:i}=r:a=r),this.test({name:i||"matches",message:a||fi.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&n||o.search(t)!==-1})}email(t=fi.email){return this.matches(cU,{name:"email",message:t,excludeEmptyString:!0})}url(t=fi.url){return this.matches(hU,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=fi.uuid){return this.matches(dU,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let r="",n,a;return t&&(typeof t=="object"?{message:r="",allowOffset:n=!1,precision:a=void 0}=t:r=t),this.matches(gU,{name:"datetime",message:r||fi.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||fi.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:i=>{if(!i||n)return!0;const o=$g(i);return o?!!o.z:!1}}).test({name:"datetime_precision",message:r||fi.datetime_precision,params:{precision:a},skipAbsent:!0,test:i=>{if(!i||a==null)return!0;const o=$g(i);return o?o.precision===a:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=fi.trim){return this.transform(r=>r!=null?r.trim():r).test({message:t,name:"trim",test:yU})}lowercase(t=fi.lowercase){return this.transform(r=>ma(r)?r:r.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>ma(r)||r===r.toLowerCase()})}uppercase(t=fi.uppercase){return this.transform(r=>ma(r)?r:r.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>ma(r)||r===r.toUpperCase()})}}br.prototype=X6.prototype;let _U=e=>e!=+e;function Id(){return new Q6}class Q6 extends ci{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!_U(t)}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce)return t;let a=t;if(typeof a=="string"){if(a=a.replace(/\s/g,""),a==="")return NaN;a=+a}return n.isType(a)||a===null?a:parseFloat(a)})})}min(t,r=ds.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n>=this.resolve(t)}})}max(t,r=ds.max){return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n<=this.resolve(t)}})}lessThan(t,r=ds.lessThan){return this.test({message:r,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(n){return n<this.resolve(t)}})}moreThan(t,r=ds.moreThan){return this.test({message:r,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(n){return n>this.resolve(t)}})}positive(t=ds.positive){return this.moreThan(0,t)}negative(t=ds.negative){return this.lessThan(0,t)}integer(t=ds.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(t=>ma(t)?t:t|0)}round(t){var r;let n=["ceil","floor","round","trunc"];if(t=((r=t)==null?void 0:r.toLowerCase())||"round",t==="trunc")return this.truncate();if(n.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(a=>ma(a)?a:Math[t](a))}}Id.prototype=Q6.prototype;let wU=new Date(""),EU=e=>Object.prototype.toString.call(e)==="[object Date]";class Bd extends ci{constructor(){super({type:"date",check(t){return EU(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,r,n)=>!n.spec.coerce||n.isType(t)||t===null?t:(t=fU(t),isNaN(t)?Bd.INVALID_DATE:new Date(t)))})}prepareParam(t,r){let n;if(_l.isRef(t))n=t;else{let a=this.cast(t);if(!this._typeCheck(a))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);n=a}return n}min(t,r=Lg.min){let n=this.prepareParam(t,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a>=this.resolve(n)}})}max(t,r=Lg.max){let n=this.prepareParam(t,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a<=this.resolve(n)}})}}Bd.INVALID_DATE=wU,Bd.prototype;function xU(e,t=[]){let r=[],n=new Set,a=new Set(t.map(([o,l])=>`${o}-${l}`));function i(o,l){let u=bl.split(o)[0];n.add(u),a.has(`${l}-${u}`)||r.push([l,u])}for(const o of Object.keys(e)){let l=e[o];n.add(o),_l.isRef(l)&&l.isSibling?i(l.path,o):fc(l)&&"deps"in l&&l.deps.forEach(u=>i(u,o))}return Qz.array(Array.from(n),r).reverse()}function e4(e,t){let r=1/0;return e.some((n,a)=>{var i;if((i=t.path)!=null&&i.includes(n))return r=a,!0}),r}function t4(e){return(t,r)=>e4(e,t)-e4(e,r)}const r4=(e,t,r)=>{if(typeof e!="string")return e;let n=e;try{n=JSON.parse(e)}catch{}return r.isType(n)?n:e};function kd(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=kd(n);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=kd(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(kd)}):"optional"in e?e.optional():e}const SU=(e,t)=>{const r=[...bl.normalizePath(t)];if(r.length===1)return r[0]in e;let n=r.pop(),a=bl.getter(bl.join(r),!0)(e);return!!(a&&n in a)};let n4=e=>Object.prototype.toString.call(e)==="[object Object]";function i4(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(n=>r.indexOf(n)===-1)}const MU=t4([]);function Li(e){return new a4(e)}class a4 extends ci{constructor(t){super({type:"object",check(r){return n4(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=MU,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,r={}){var n;let a=super._cast(t,r);if(a===void 0)return this.getDefault(r);if(!this._typeCheck(a))return a;let i=this.fields,o=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(a).filter(v=>!this._nodes.includes(v))),u={},c=Object.assign({},r,{parent:u,__validating:r.__validating||!1}),d=!1;for(const v of l){let m=i[v],b=v in a;if(m){let _,S=a[v];c.path=(r.path?`${r.path}.`:"")+v,m=m.resolve({value:S,context:r.context,parent:u});let T=m instanceof ci?m.spec:void 0,C=T==null?void 0:T.strict;if(T!=null&&T.strip){d=d||v in a;continue}_=!r.__validating||!C?m.cast(a[v],c):a[v],_!==void 0&&(u[v]=_)}else b&&!o&&(u[v]=a[v]);(b!==v in u||u[v]!==a[v])&&(d=!0)}return d?u:a}_validate(t,r={},n,a){let{from:i=[],originalValue:o=t,recursive:l=this.spec.recursive}=r;r.from=[{schema:this,value:o},...i],r.__validating=!0,r.originalValue=o,super._validate(t,r,n,(u,c)=>{if(!l||!n4(c)){a(u,c);return}o=o||c;let d=[];for(let v of this._nodes){let m=this.fields[v];!m||_l.isRef(m)||d.push(m.asNestedTest({options:r,key:v,parent:c,parentPath:r.path,originalParent:o}))}this.runTests({tests:d,value:c,originalValue:o,options:r},n,v=>{a(v.sort(this._sortErrors).concat(u),c)})})}clone(t){const r=super.clone(t);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(t){let r=super.concat(t),n=r.fields;for(let[a,i]of Object.entries(this.fields)){const o=n[a];n[a]=o===void 0?i:o}return r.withMutation(a=>a.setFields(n,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let r={};return this._nodes.forEach(n=>{var a;const i=this.fields[n];let o=t;(a=o)!=null&&a.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[n]})),r[n]=i&&"getDefault"in i?i.getDefault(o):void 0}),r}setFields(t,r){let n=this.clone();return n.fields=t,n._nodes=xU(t,r),n._sortErrors=t4(Object.keys(t)),r&&(n._excludedEdges=r),n}shape(t,r=[]){return this.clone().withMutation(n=>{let a=n._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),a=[...n._excludedEdges,...r]),n.setFields(Object.assign(n.fields,t),a)})}partial(){const t={};for(const[r,n]of Object.entries(this.fields))t[r]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(t)}deepPartial(){return kd(this)}pick(t){const r={};for(const n of t)this.fields[n]&&(r[n]=this.fields[n]);return this.setFields(r,this._excludedEdges.filter(([n,a])=>t.includes(n)&&t.includes(a)))}omit(t){const r=[];for(const n of Object.keys(this.fields))t.includes(n)||r.push(n);return this.pick(r)}from(t,r,n){let a=bl.getter(t,!0);return this.transform(i=>{if(!i)return i;let o=i;return SU(i,t)&&(o=Object.assign({},i),n||delete o[t],o[r]=a(i)),o})}json(){return this.transform(r4)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Sd.exact,test(r){if(r==null)return!0;const n=i4(this.schema,r);return n.length===0||this.createError({params:{properties:n.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,r=Sd.noUnknown){typeof t!="boolean"&&(r=t,t=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:r,test(a){if(a==null)return!0;const i=i4(this.schema,a);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return n.spec.noUnknown=t,n}unknown(t=!0,r=Sd.noUnknown){return this.noUnknown(!t,r)}transformKeys(t){return this.transform(r=>{if(!r)return r;const n={};for(const a of Object.keys(r))n[t(a)]=r[a];return n})}camelCase(){return this.transformKeys(Pg.camelCase)}snakeCase(){return this.transformKeys(Pg.snakeCase)}constantCase(){return this.transformKeys(t=>Pg.snakeCase(t).toUpperCase())}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);n.fields={};for(const[i,o]of Object.entries(r.fields)){var a;let l=t;(a=l)!=null&&a.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[i]})),n.fields[i]=o.describe(l)}return n}}Li.prototype=a4.prototype;function ps(e){return new o4(e)}class o4 extends ci{constructor(t){super({type:"array",spec:{types:t},check(r){return Array.isArray(r)}}),this.innerType=void 0,this.innerType=t}_cast(t,r){const n=super._cast(t,r);if(!this._typeCheck(n)||!this.innerType)return n;let a=!1;const i=n.map((o,l)=>{const u=this.innerType.cast(o,Object.assign({},r,{path:`${r.path||""}[${l}]`}));return u!==o&&(a=!0),u});return a?i:n}_validate(t,r={},n,a){var i;let o=this.innerType,l=(i=r.recursive)!=null?i:this.spec.recursive;r.originalValue!=null&&r.originalValue,super._validate(t,r,n,(u,c)=>{var d;if(!l||!o||!this._typeCheck(c)){a(u,c);return}let v=new Array(c.length);for(let b=0;b<c.length;b++){var m;v[b]=o.asNestedTest({options:r,index:b,parent:c,parentPath:r.path,originalParent:(m=r.originalValue)!=null?m:t})}this.runTests({value:c,tests:v,originalValue:(d=r.originalValue)!=null?d:t,options:r},n,b=>a(b.concat(u),c))})}clone(t){const r=super.clone(t);return r.innerType=this.innerType,r}json(){return this.transform(r4)}concat(t){let r=super.concat(t);return r.innerType=this.innerType,t.innerType&&(r.innerType=r.innerType?r.innerType.concat(t.innerType):t.innerType),r}of(t){let r=this.clone();if(!fc(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+To(t));return r.innerType=t,r.spec=Object.assign({},r.spec,{types:t}),r}length(t,r=Md.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r){return r=r||Md.min,this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r){return r=r||Md.max,this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,r)=>this._typeCheck(t)?t:r==null?[]:[].concat(r))}compact(t){let r=t?(n,a,i)=>!t(n,a,i):n=>!!n;return this.transform(n=>n!=null?n.filter(r):n)}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);if(r.innerType){var a;let i=t;(a=i)!=null&&a.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),n.innerType=r.innerType.describe(i)}return n}}ps.prototype=o4.prototype;function s4(e){return new zg(e)}class zg{constructor(t){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(r,n={})=>{let a=this.builder(r,n);if(!fc(a))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(a=a.optional()),a.resolve(n)},this.builder=t,this.spec={meta:void 0,optional:!1}}clone(t){const r=new zg(this.builder);return r.spec=Object.assign({},this.spec,t),r}optionality(t){return this.clone({optional:t})}optional(){return this.optionality(!0)}resolve(t){return this._resolve(t.value,t)}cast(t,r){return this._resolve(t,r).cast(t,r)}asNestedTest(t){let{key:r,index:n,parent:a,options:i}=t,o=a[n??r];return this._resolve(o,Object.assign({},i,{value:o,parent:a})).asNestedTest(t)}validate(t,r){return this._resolve(t,r).validate(t,r)}validateSync(t,r){return this._resolve(t,r).validateSync(t,r)}validateAt(t,r,n){return this._resolve(r,n).validateAt(t,r,n)}validateSyncAt(t,r,n){return this._resolve(r,n).validateSyncAt(t,r,n)}isValid(t,r){return this._resolve(t,r).isValid(t,r)}isValidSync(t,r){return this._resolve(t,r).isValidSync(t,r)}describe(t){return t?this.resolve(t).describe(t):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...t){if(t.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},t[0]),r}}const Ug=Li().noUnknown().shape({client:Li().noUnknown().shape({logo:br(),name:br()}),entrypoint:Li().noUnknown().shape({account:br(),country:br(),credential:br(),site:br(),siteOrganizationType:br()}),locale:br().oneOf(["es","en"]),navigation:Li().noUnknown().shape({disableFormAutocomplete:ln(),displayAccountsSelection:ln(),displayBusinessSites:ln(),displayCredentialInModal:ln(),displayErrorsInToast:ln(),displayLogoImages:ln(),displayLongDescription:ln(),displayPersonalSites:ln(),displayPrivacyScreen:ln(),displaySiteOrganizations:ps().of(br()),displaySiteOrganizationTypes:ps().of(br()),displaySites:ps().of(br()),displayStatusInToast:ln(),enableBackNavigation:ln(),enableTwofaBackNavigation:ln(),formButtonsDisabledStyle:ln(),formShowPasswordStyle:br().oneOf(["icon","none","text"]),hideSelectCountry:ln(),hideSiteOrganizations:ps().of(br()),hideSiteOrganizationTypes:ps().of(br()),hideSites:ps().of(br()),oneSiteFlow:ln(),quickAnswer:ln(),returnToSiteFormOnUserError:s4(e=>typeof e=="object"?ps().of(Id().oneOf([401,403,411])):ln()),saveCredential:ln(),selectClass:br(),socketTimeout:Id().min(1),toastDuration:Id().min(0),toastPosition:br().oneOf(["bottom-left","bottom-right","top-left","top-right"])}),__internal__:Li().noUnknown().shape({apiBaseUrl:br(),apiEnv:br().oneOf(["development","production"]),assetsBaseUrl:br(),plaidSites:ln(),defaultHttpParams:Li()})}),CU=Li().shape({token:br().required(),element:s4(e=>{switch(typeof e){case"string":return br().test("isElement","${path} is not an Element",t=>{if(!document.querySelector(t))throw new Dn(`Invalid selector: Element "${t}" not found.`);return!0});case"object":return Li().test("isElement","${path} is not an Element",t=>{if(!ul(t))throw new Dn("Invalid element: Object should be a valid HtmlElement.");return!0});default:br()}}),refreshTokenFunction:Z6().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),enableTestMode:ln(),strict:Li().noUnknown().nullable().shape({authorization:Li().noUnknown().required().shape({type:br().oneOf(["jwk"]).required(),key:br().required()}),body:Li().noUnknown().required().shape({type:br().oneOf(["jwk"]).required(),key:br().required().test("isBase64","${path} is not a base64 encoded",e=>e&&/^(?:[A-Za-z0-9+/]{2}[A-Za-z0-9+/]{2})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e))})}),config:Ug}).strict().noUnknown();let Vg={git:{dirty:!1,raw:"v0.0.14-0-g24bd51e",hash:"g24bd51e",distance:0,tag:"v0.0.14",semver:{options:{loose:!1,includePrerelease:!1},loose:!1,raw:"v0.0.14",major:0,minor:0,patch:14,prerelease:[],build:[],version:"0.0.14"},suffix:"0-g24bd51e",semverString:"0.0.14"}};function Nd(){let e=`${Vg.git.tag}.${Vg.git.distance}`;return{}.NODE_ENV==="production"?e=`${e}-beta`:e=`${e}-${Vg.git.hash}`,e}function TU(e,t){const r=parseInt("0x4",16),n="38060000000000000000000000000000000000000000000F00000000000000000000000000000000000D9802010000010101000000000000";let a;return console.log("OBTEINING BRIDGE SCRIPTS"),console.log("TOKEN",e),console.log("CHALLENGE",t),AU().then(()=>(console.log("BRIDGE SCRIPTS OK"),a=new digipass.nativebridge.DP110,new Promise((o,l)=>{console.log(" PROCESSING BRIDGE CONNECTION"),a.onError(()=>(console.log(" ERROR ON BRIDGE CONNECTION"),l("bridge.not_ready"))),a.onReady(u=>{console.log("BRIDGE CONNECTION READY"),console.log("DATA VERSION",u.versionCode),console.log("BRIDGE VERSION",a.versionCode),u.versionCode<a.versionCode&&l("bridge.host_update_available");const c=a.isReady();if(console.log("BRIDGE CONNECTION READY VERIFICATION",c),c)console.log("COMMAND_ID",r),a.getTokenInfo(r,function(d){if(console.log("BRIDGE CONNECTION getTokenInfo",d,d.returnCode),d.returnCode!==0)return l(`bridge.${Math.abs(d.returnCode)}`);console.log("STATIC_VECTOR",n),a.generateOTP(n,t,function(v){if(console.log("BRIDGE CONNECTION generateOTP",v,v.returnCode),v.returnCode!==0)return l(`bridge.${Math.abs(v.returnCode)}`);o({token:`${e}XX${v.otp}XX${d.info}XX${u.versionCode}`,challenge:t})})});else return Promise.reject("bridge.not_ready")})})))}function AU(){const e=new Promise((r,n)=>{if(document.getElementById("widgetBridgeConfig"))return r();const a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("id","widgetBridgeConfig"),a.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(a),a.onload=()=>r(),a.onerror=()=>{n("bridge.digipass_config_script_not_loaded")}}),t=new Promise((r,n)=>{if(document.getElementById("widgetBridgeUsb"))return r();const a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("id","widgetBridgeUsb"),a.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.dp110.min.js"),(document.head||document.body).appendChild(a),a.onload=()=>r(),a.onerror=()=>{n("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}const Di="bridgeBluetooth";function IU(e){const t=window[Di];return new Promise((n,a)=>{t.resolve=n,t.reject=a;let i,o;const{authenticationData:l}=e.authenticationResponse;l[0].idAuthenticationData==="signedMessage"?([i]=l[0].authenticationData,[o]=l[1].authenticationData):([i]=l[1].authenticationData,[o]=l[0].authenticationData),DU({signedMessage:i,signedTimeMessage:o})})}async function BU(){const e=window[Di];return new Promise(async(t,r)=>{if(e.nativeBridgeInstance.isReady())try{const n=await async function(a){return new Promise((i,o)=>{a.getDigipassTimeChallenge(l=>{if(l.returnCode!==0){const c={title:"Generar - TimeChallenge",response:{message:"Se ha producido un error al generar el TimeChallenge. Por favor, asegúrate de tener tu token conectado y encendido.",returnCode:l.returnCode}};return void o(c)}const u={title:"Generar - TimeChallenge",response:{message:`El TimeChallenge es: ${l.timeChallenge}`,timeChallenge:l.timeChallenge,errorCode:""}};i(u)})})}(e.nativeBridgeInstance);t(n)}catch(n){r(n)}else r({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:""}})})}function kU(e){window[Di]={isDp785Signature:!1,nativeBridgeInstance:null,resolve:null,reject:null};const t=window[Di];return NU().then(()=>new Promise((n,a)=>{t.resolve=n,t.reject=a,t.isDp785Signature=e!=="214",t.nativeBridgeInstance=new window.digipass.nativebridge.DPToken,LU()}))}function NU(){const e=new Promise((r,n)=>{if(document.getElementById("widgetBridgeConfig"))return r();const a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("id","widgetBridgeConfig"),a.setAttribute("src",`${{}.VUE_APP_LIB_BASE_URL_DEFAULT}digipass.nativebridge.config.min.js`),(document.head||document.body).appendChild(a),a.onload=()=>r(),a.onerror=()=>{n("bridge.digipass_config_script_not_loaded")}}),t=new Promise((r,n)=>{if(document.getElementById("widgetBridgeBluetooth"))return r();const a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("id","widgetBridgeBluetooth"),a.setAttribute("src",`${{}.VUE_APP_LIB_BASE_URL_DEFAULT}digipass.nativebridge.dptoken.min.js`),(document.head||document.body).appendChild(a),a.onload=()=>r(),a.onerror=()=>{n("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}async function OU(){const e=window[Di];try{const t=await RU(e.isDp785Signature);if(t.length===1){const[r]=t;await PU(r.serial);const n=await BU();e.resolve(n.response.timeChallenge)}}catch(t){e.reject(t),alert("Por favor, asegúrate de tener tu token conectado y encendido.")}}async function RU(e){const t=window[Di];return new Promise(async(r,n)=>{const a=e?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(t.nativeBridgeInstance.isReady())try{const i=await async function(u){return new Promise((c,d)=>{u.getDigipassList(v=>{if(v.returnCode===0)c(v.devices);else{const m={title:"Listar dispositivos",response:{message:"Error al obtener la lista de dispositivos disponibles.",returnCode:v.returnCode}};d(m)}})})}(t.nativeBridgeInstance),o=i.map(u=>({name:u.deviceName,serial:u.digipassSerial})),[l]=o;if(!l||!l.serial)return void n({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:a}});r(o)}catch(i){n(i)}else n({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:a}})})}async function PU(e){const t=window[Di];return new Promise((r,n)=>{t.nativeBridgeInstance.initializeDigipass(e,a=>{if(a.returnCode!==0){const o={title:"Inicializar dispositivo",response:{message:"Error al intentar inicializar el dispositivo.",returnCode:a.returnCode}};return void n(o)}const i={title:"Inicializar dispositivo",response:{message:`El dispositivo con serial: ${e} está listo para ser usado.`,errorCode:""}};r(i)})})}async function FU(e){const t=window[Di];return new Promise(async(r,n)=>{if(t.nativeBridgeInstance.isReady())try{const a=await async function(i,o){return new Promise((l,u)=>{i.generateResponseOnlyOTP(o,c=>{if(c.returnCode!==0){const v={title:"Generar OTP con PIN",response:{message:"No fue posible generar la OTP.",returnCode:c.returnCode}};return void u(v)}const d={title:"Generar OTP con PIN",response:{message:`La OTP se generó correctamente: ${c.otp}`,otp:c.otp,errorCode:"",processType:"DP785_T4_LINKED"}};l(d)})})}(t.nativeBridgeInstance,e);r(a)}catch(a){n(a)}else n({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:"DP785_T4_NOT_LINKED"}})})}async function LU(){const e=window[Di],t=await $U();if(t.response.errorCode!==""){alert(t.response.message),e.reject(t.response.errorCode);return}else await OU()}async function DU({signedMessage:e="",signedTimeMessage:t=""}){const r=window[Di];try{await l4(t,r.isDp785Signature);const n=await l4(e,r.isDp785Signature),{response:{messageSignature:a}}=n,i=7,o=await FU(i),{response:{otp:l}}=o,u={};u.otpChallenge=a;const c=`${l}${i}`;u.otp=c,r.resolve(`${u.otpChallenge}XX${u.otp}`)}catch(n){r.reject(n),alert("Error al intentar validar la sesión desde el dispositivo de acceso seguro.")}}async function $U(){const e=window[Di];return new Promise((t,r)=>{e.nativeBridgeInstance.onReady(()=>{e.nativeBridgeInstance.getNativeBridgeVersion(n=>{const a={title:"Conexión con Native Bridge",response:{errorCode:"",message:"El software Native Bridge se encuentra instalado en tu ordenador.",updateAvailable:!(n.versionCode>=e.nativeBridgeInstance.versionCode)}};t(a)})}),e.nativeBridgeInstance.onError(()=>{r({title:"Conexión con Native Bridge",response:{errorCode:"222",message:"El software Native Bridge no se encontró instalado en tu ordenador.",processType:"DP785_T4_NOT_LINKED"}})})})}async function l4(e,t){const r=window[Di];return new Promise(async(n,a)=>{const i=t?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(r.nativeBridgeInstance.isReady())try{const{responseMessage:o}=await async function(u,c){return new Promise((d,v)=>{u.transmitRequestMessage(c,m=>{if(m.returnCode===0)d(m);else{const b={title:"Firmar mensaje",response:{message:"No fue posible transmitir el mensaje.",returnCode:m.returnCode}};v(b)}})})}(r.nativeBridgeInstance,e),l=await async function(u,c,d){return new Promise((v,m)=>{u.parseResponseMessage(c,d,b=>{if(b.returnCode!==0){const S={title:"Firmar mensaje",response:{message:"No fue posible parsear el mensaje.",returnCode:b.returnCode}};return void m(S)}const _={title:"Firmar mensaje",response:{message:`Se realizó la firma del mensaje correctamente: ${b.messageSignature}`,messageSignature:b.messageSignature,errorCode:"",processType:"DP785_T4_LINKED"}};v(_)})})}(r.nativeBridgeInstance,o,e);n(l)}catch(o){a(o)}else a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:i}})})}function zU(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qg={exports:{}},u4;function f4(){return u4||(u4=1,function(e,t){(function(r,n){e.exports=n()})(Bt,function(){function r(fe){var H=typeof fe;return fe!==null&&(H==="object"||H==="function")}function n(fe){return typeof fe=="function"}var a=void 0;Array.isArray?a=Array.isArray:a=function(fe){return Object.prototype.toString.call(fe)==="[object Array]"};var i=a,o=0,l=void 0,u=void 0,c=function(H,G){P[o]=H,P[o+1]=G,o+=2,o===2&&(u?u(L):z())};function d(fe){u=fe}function v(fe){c=fe}var m=typeof window<"u"?window:void 0,b=m||{},_=b.MutationObserver||b.WebKitMutationObserver,S=typeof self>"u"&&typeof ue<"u"&&{}.toString.call(ue)==="[object process]",T=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function C(){return function(){return ue.nextTick(L)}}function I(){return typeof l<"u"?function(){l(L)}:O()}function B(){var fe=0,H=new _(L),G=document.createTextNode("");return H.observe(G,{characterData:!0}),function(){G.data=fe=++fe%2}}function N(){var fe=new MessageChannel;return fe.port1.onmessage=L,function(){return fe.port2.postMessage(0)}}function O(){var fe=setTimeout;return function(){return fe(L,1)}}var P=new Array(1e3);function L(){for(var fe=0;fe<o;fe+=2){var H=P[fe],G=P[fe+1];H(G),P[fe]=void 0,P[fe+1]=void 0}o=0}function $(){try{var fe=Function("return this")().require("vertx");return l=fe.runOnLoop||fe.runOnContext,I()}catch{return O()}}var z=void 0;S?z=C():_?z=B():T?z=N():m===void 0&&typeof zU=="function"?z=$():z=O();function K(fe,H){var G=this,me=new this.constructor(h);me[s]===void 0&&j(me);var oe=G._state;if(oe){var pe=arguments[oe-1];c(function(){return te(oe,me,pe,G._result)})}else X(G,me,fe,H);return me}function M(fe){var H=this;if(fe&&typeof fe=="object"&&fe.constructor===H)return fe;var G=new H(h);return R(G,fe),G}var s=Math.random().toString(36).substring(2);function h(){}var p=void 0,g=1,y=2;function w(){return new TypeError("You cannot resolve a promise with itself")}function A(){return new TypeError("A promises callback cannot return that same promise.")}function E(fe,H,G,me){try{fe.call(H,G,me)}catch(oe){return oe}}function f(fe,H,G){c(function(me){var oe=!1,pe=E(G,H,function(Je){oe||(oe=!0,H!==Je?R(me,Je):J(me,Je))},function(Je){oe||(oe=!0,W(me,Je))},"Settle: "+(me._label||" unknown promise"));!oe&&pe&&(oe=!0,W(me,pe))},fe)}function x(fe,H){H._state===g?J(fe,H._result):H._state===y?W(fe,H._result):X(H,void 0,function(G){return R(fe,G)},function(G){return W(fe,G)})}function k(fe,H,G){H.constructor===fe.constructor&&G===K&&H.constructor.resolve===M?x(fe,H):G===void 0?J(fe,H):n(G)?f(fe,H,G):J(fe,H)}function R(fe,H){if(fe===H)W(fe,w());else if(r(H)){var G=void 0;try{G=H.then}catch(me){W(fe,me);return}k(fe,H,G)}else J(fe,H)}function q(fe){fe._onerror&&fe._onerror(fe._result),ae(fe)}function J(fe,H){fe._state===p&&(fe._result=H,fe._state=g,fe._subscribers.length!==0&&c(ae,fe))}function W(fe,H){fe._state===p&&(fe._state=y,fe._result=H,c(q,fe))}function X(fe,H,G,me){var oe=fe._subscribers,pe=oe.length;fe._onerror=null,oe[pe]=H,oe[pe+g]=G,oe[pe+y]=me,pe===0&&fe._state&&c(ae,fe)}function ae(fe){var H=fe._subscribers,G=fe._state;if(H.length!==0){for(var me=void 0,oe=void 0,pe=fe._result,Je=0;Je<H.length;Je+=3)me=H[Je],oe=H[Je+G],me?te(G,me,oe,pe):oe(pe);fe._subscribers.length=0}}function te(fe,H,G,me){var oe=n(G),pe=void 0,Je=void 0,xe=!0;if(oe){try{pe=G(me)}catch(Me){xe=!1,Je=Me}if(H===pe){W(H,A());return}}else pe=me;H._state!==p||(oe&&xe?R(H,pe):xe===!1?W(H,Je):fe===g?J(H,pe):fe===y&&W(H,pe))}function he(fe,H){try{H(function(me){R(fe,me)},function(me){W(fe,me)})}catch(G){W(fe,G)}}var re=0;function Z(){return re++}function j(fe){fe[s]=re++,fe._state=void 0,fe._result=void 0,fe._subscribers=[]}function ie(){return new Error("Array Methods must be provided an Array")}var le=function(){function fe(H,G){this._instanceConstructor=H,this.promise=new H(h),this.promise[s]||j(this.promise),i(G)?(this.length=G.length,this._remaining=G.length,this._result=new Array(this.length),this.length===0?J(this.promise,this._result):(this.length=this.length||0,this._enumerate(G),this._remaining===0&&J(this.promise,this._result))):W(this.promise,ie())}return fe.prototype._enumerate=function(G){for(var me=0;this._state===p&&me<G.length;me++)this._eachEntry(G[me],me)},fe.prototype._eachEntry=function(G,me){var oe=this._instanceConstructor,pe=oe.resolve;if(pe===M){var Je=void 0,xe=void 0,Me=!1;try{Je=G.then}catch(ce){Me=!0,xe=ce}if(Je===K&&G._state!==p)this._settledAt(G._state,me,G._result);else if(typeof Je!="function")this._remaining--,this._result[me]=G;else if(oe===Q){var et=new oe(h);Me?W(et,xe):k(et,G,Je),this._willSettleAt(et,me)}else this._willSettleAt(new oe(function(ce){return ce(G)}),me)}else this._willSettleAt(pe(G),me)},fe.prototype._settledAt=function(G,me,oe){var pe=this.promise;pe._state===p&&(this._remaining--,G===y?W(pe,oe):this._result[me]=oe),this._remaining===0&&J(pe,this._result)},fe.prototype._willSettleAt=function(G,me){var oe=this;X(G,void 0,function(pe){return oe._settledAt(g,me,pe)},function(pe){return oe._settledAt(y,me,pe)})},fe}();function V(fe){return new le(this,fe).promise}function D(fe){var H=this;return i(fe)?new H(function(G,me){for(var oe=fe.length,pe=0;pe<oe;pe++)H.resolve(fe[pe]).then(G,me)}):new H(function(G,me){return me(new TypeError("You must pass an array to race."))})}function F(fe){var H=this,G=new H(h);return W(G,fe),G}function U(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function se(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var Q=function(){function fe(H){this[s]=Z(),this._result=this._state=void 0,this._subscribers=[],h!==H&&(typeof H!="function"&&U(),this instanceof fe?he(this,H):se())}return fe.prototype.catch=function(G){return this.then(null,G)},fe.prototype.finally=function(G){var me=this,oe=me.constructor;return n(G)?me.then(function(pe){return oe.resolve(G()).then(function(){return pe})},function(pe){return oe.resolve(G()).then(function(){throw pe})}):me.then(G,G)},fe}();Q.prototype.then=K,Q.all=V,Q.race=D,Q.resolve=M,Q.reject=F,Q._setScheduler=d,Q._setAsap=v,Q._asap=c;function ne(){var fe=void 0;if(typeof Bt<"u")fe=Bt;else if(typeof self<"u")fe=self;else try{fe=Function("return this")()}catch{throw new Error("polyfill failed because global object is unavailable in this environment")}var H=fe.Promise;if(H){var G=null;try{G=Object.prototype.toString.call(H.resolve())}catch{}if(G==="[object Promise]"&&!H.cast)return}fe.Promise=Q}return Q.polyfill=ne,Q.Promise=Q,Q})}(qg)),qg.exports}function UU(e){return e}var Hg=UU;function VU(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var jg=VU,qU=jg,c4=Math.max;function HU(e,t,r){return t=c4(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=c4(n.length-t,0),o=Array(i);++a<i;)o[a]=n[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=n[a];return l[t]=r(o),qU(e,this,l)}}var h4=HU;function jU(e){return function(){return e}}var KU=jU,WU=typeof Bt=="object"&&Bt&&Bt.Object===Object&&Bt,d4=WU,GU=d4,ZU=typeof self=="object"&&self&&self.Object===Object&&self,YU=GU||ZU||Function("return this")(),hi=YU,JU=hi,XU=JU.Symbol,cc=XU,p4=cc,v4=Object.prototype,QU=v4.hasOwnProperty,eV=v4.toString,hc=p4?p4.toStringTag:void 0;function tV(e){var t=QU.call(e,hc),r=e[hc];try{e[hc]=void 0;var n=!0}catch{}var a=eV.call(e);return n&&(t?e[hc]=r:delete e[hc]),a}var rV=tV,nV=Object.prototype,iV=nV.toString;function aV(e){return iV.call(e)}var oV=aV,m4=cc,sV=rV,lV=oV,uV="[object Null]",fV="[object Undefined]",g4=m4?m4.toStringTag:void 0;function cV(e){return e==null?e===void 0?fV:uV:g4&&g4 in Object(e)?sV(e):lV(e)}var Du=cV;function hV(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ga=hV,dV=Du,pV=ga,vV="[object AsyncFunction]",mV="[object Function]",gV="[object GeneratorFunction]",yV="[object Proxy]";function bV(e){if(!pV(e))return!1;var t=dV(e);return t==mV||t==gV||t==vV||t==yV}var Kg=bV,_V=hi,wV=_V["__core-js_shared__"],EV=wV,Wg=EV,y4=function(){var e=/[^.]+$/.exec(Wg&&Wg.keys&&Wg.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function xV(e){return!!y4&&y4 in e}var SV=xV,MV=Function.prototype,CV=MV.toString;function TV(e){if(e!=null){try{return CV.call(e)}catch{}try{return e+""}catch{}}return""}var b4=TV,AV=Kg,IV=SV,BV=ga,kV=b4,NV=/[\\^$.*+?()[\]{}|]/g,OV=/^\[object .+?Constructor\]$/,RV=Function.prototype,PV=Object.prototype,FV=RV.toString,LV=PV.hasOwnProperty,DV=RegExp("^"+FV.call(LV).replace(NV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $V(e){if(!BV(e)||IV(e))return!1;var t=AV(e)?DV:OV;return t.test(kV(e))}var zV=$V;function UV(e,t){return e==null?void 0:e[t]}var VV=UV,qV=zV,HV=VV;function jV(e,t){var r=HV(e,t);return qV(r)?r:void 0}var wl=jV,KV=wl,WV=function(){try{var e=KV(Object,"defineProperty");return e({},"",{}),e}catch{}}(),_4=WV,GV=KU,w4=_4,ZV=Hg,YV=w4?function(e,t){return w4(e,"toString",{configurable:!0,enumerable:!1,value:GV(t),writable:!0})}:ZV,JV=YV,XV=800,QV=16,eq=Date.now;function tq(e){var t=0,r=0;return function(){var n=eq(),a=QV-(n-r);if(r=n,a>0){if(++t>=XV)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var E4=tq,rq=JV,nq=E4,iq=nq(rq),Gg=iq,aq=Hg,oq=h4,sq=Gg;function lq(e,t){return sq(oq(e,t,aq),e+"")}var Zg=lq,uq=wl,fq=hi,cq=uq(fq,"WeakMap"),x4=cq,S4=x4,hq=S4&&new S4,M4=hq,dq=Hg,C4=M4,pq=C4?function(e,t){return C4.set(e,t),e}:dq,T4=pq,vq=ga,A4=Object.create,mq=function(){function e(){}return function(t){if(!vq(t))return{};if(A4)return A4(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Od=mq,gq=Od,yq=ga;function bq(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=gq(e.prototype),n=e.apply(r,t);return yq(n)?n:r}}var Rd=bq,_q=Rd,wq=hi,Eq=1;function xq(e,t,r){var n=t&Eq,a=_q(e);function i(){var o=this&&this!==wq&&this instanceof i?a:e;return o.apply(n?r:this,arguments)}return i}var Sq=xq,Mq=Math.max;function Cq(e,t,r,n){for(var a=-1,i=e.length,o=r.length,l=-1,u=t.length,c=Mq(i-o,0),d=Array(u+c),v=!n;++l<u;)d[l]=t[l];for(;++a<o;)(v||a<i)&&(d[r[a]]=e[a]);for(;c--;)d[l++]=e[a++];return d}var I4=Cq,Tq=Math.max;function Aq(e,t,r,n){for(var a=-1,i=e.length,o=-1,l=r.length,u=-1,c=t.length,d=Tq(i-l,0),v=Array(d+c),m=!n;++a<d;)v[a]=e[a];for(var b=a;++u<c;)v[b+u]=t[u];for(;++o<l;)(m||a<i)&&(v[b+r[o]]=e[a++]);return v}var B4=Aq;function Iq(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Bq=Iq;function kq(){}var Yg=kq,Nq=Od,Oq=Yg,Rq=4294967295;function Pd(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Rq,this.__views__=[]}Pd.prototype=Nq(Oq.prototype),Pd.prototype.constructor=Pd;var Jg=Pd;function Pq(){}var k4=Pq,N4=M4,Fq=k4,Lq=N4?function(e){return N4.get(e)}:Fq,O4=Lq,Dq={},$q=Dq,R4=$q,zq=Object.prototype,Uq=zq.hasOwnProperty;function Vq(e){for(var t=e.name+"",r=R4[t],n=Uq.call(R4,t)?r.length:0;n--;){var a=r[n],i=a.func;if(i==null||i==e)return a.name}return t}var qq=Vq,Hq=Od,jq=Yg;function Fd(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}Fd.prototype=Hq(jq.prototype),Fd.prototype.constructor=Fd;var P4=Fd,Kq=Array.isArray,Ka=Kq;function Wq(e){return e!=null&&typeof e=="object"}var Io=Wq;function Gq(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Ld=Gq,Zq=Jg,Yq=P4,Jq=Ld;function Xq(e){if(e instanceof Zq)return e.clone();var t=new Yq(e.__wrapped__,e.__chain__);return t.__actions__=Jq(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Qq=Xq,eH=Jg,F4=P4,tH=Yg,rH=Ka,nH=Io,iH=Qq,aH=Object.prototype,oH=aH.hasOwnProperty;function Dd(e){if(nH(e)&&!rH(e)&&!(e instanceof eH)){if(e instanceof F4)return e;if(oH.call(e,"__wrapped__"))return iH(e)}return new F4(e)}Dd.prototype=tH.prototype,Dd.prototype.constructor=Dd;var sH=Dd,lH=Jg,uH=O4,fH=qq,cH=sH;function hH(e){var t=fH(e),r=cH[t];if(typeof r!="function"||!(t in lH.prototype))return!1;if(e===r)return!0;var n=uH(r);return!!n&&e===n[0]}var dH=hH,pH=T4,vH=E4,mH=vH(pH),L4=mH,gH=/\{\n\/\* \[wrapped with (.+)\] \*/,yH=/,? & /;function bH(e){var t=e.match(gH);return t?t[1].split(yH):[]}var _H=bH,wH=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function EH(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(wH,`{
|
|
685
685
|
/* [wrapped with `+t+`] */
|
|
686
686
|
`)}var xH=EH;function SH(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var D4=SH;function MH(e,t,r,n){for(var a=e.length,i=r+(n?1:-1);n?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var CH=MH;function TH(e){return e!==e}var AH=TH;function IH(e,t,r){for(var n=r-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}var BH=IH,kH=CH,NH=AH,OH=BH;function RH(e,t,r){return t===t?OH(e,t,r):kH(e,NH,r)}var PH=RH,FH=PH;function LH(e,t){var r=e==null?0:e.length;return!!r&&FH(e,t,0)>-1}var Xg=LH,DH=D4,$H=Xg,zH=1,UH=2,VH=8,qH=16,HH=32,jH=64,KH=128,WH=256,GH=512,ZH=[["ary",KH],["bind",zH],["bindKey",UH],["curry",VH],["curryRight",qH],["flip",GH],["partial",HH],["partialRight",jH],["rearg",WH]];function YH(e,t){return DH(ZH,function(r){var n="_."+r[0];t&r[1]&&!$H(e,n)&&e.push(n)}),e.sort()}var JH=YH,XH=_H,QH=xH,ej=Gg,tj=JH;function rj(e,t,r){var n=t+"";return ej(e,QH(n,tj(XH(n),r)))}var $4=rj,nj=dH,ij=L4,aj=$4,oj=1,sj=2,lj=4,uj=8,z4=32,U4=64;function fj(e,t,r,n,a,i,o,l,u,c){var d=t&uj,v=d?o:void 0,m=d?void 0:o,b=d?i:void 0,_=d?void 0:i;t|=d?z4:U4,t&=~(d?U4:z4),t&lj||(t&=~(oj|sj));var S=[e,t,a,b,v,_,m,l,u,c],T=r.apply(void 0,S);return nj(e)&&ij(T,S),T.placeholder=n,aj(T,e,t)}var V4=fj;function cj(e){var t=e;return t.placeholder}var Qg=cj,hj=9007199254740991,dj=/^(?:0|[1-9]\d*)$/;function pj(e,t){var r=typeof e;return t=t??hj,!!t&&(r=="number"||r!="symbol"&&dj.test(e))&&e>-1&&e%1==0&&e<t}var dc=pj,vj=Ld,mj=dc,gj=Math.min;function yj(e,t){for(var r=e.length,n=gj(t.length,r),a=vj(e);n--;){var i=t[n];e[n]=mj(i,r)?a[i]:void 0}return e}var bj=yj,q4="__lodash_placeholder__";function _j(e,t){for(var r=-1,n=e.length,a=0,i=[];++r<n;){var o=e[r];(o===t||o===q4)&&(e[r]=q4,i[a++]=r)}return i}var $d=_j,wj=I4,Ej=B4,xj=Bq,H4=Rd,Sj=V4,Mj=Qg,Cj=bj,Tj=$d,Aj=hi,Ij=1,Bj=2,kj=8,Nj=16,Oj=128,Rj=512;function j4(e,t,r,n,a,i,o,l,u,c){var d=t&Oj,v=t&Ij,m=t&Bj,b=t&(kj|Nj),_=t&Rj,S=m?void 0:H4(e);function T(){for(var C=arguments.length,I=Array(C),B=C;B--;)I[B]=arguments[B];if(b)var N=Mj(T),O=xj(I,N);if(n&&(I=wj(I,n,a,b)),i&&(I=Ej(I,i,o,b)),C-=O,b&&C<c){var P=Tj(I,N);return Sj(e,t,j4,T.placeholder,r,I,P,l,u,c-C)}var L=v?r:this,$=m?L[e]:e;return C=I.length,l?I=Cj(I,l):_&&C>1&&I.reverse(),d&&u<C&&(I.length=u),this&&this!==Aj&&this instanceof T&&($=S||H4($)),$.apply(L,I)}return T}var K4=j4,Pj=jg,Fj=Rd,Lj=K4,Dj=V4,$j=Qg,zj=$d,Uj=hi;function Vj(e,t,r){var n=Fj(e);function a(){for(var i=arguments.length,o=Array(i),l=i,u=$j(a);l--;)o[l]=arguments[l];var c=i<3&&o[0]!==u&&o[i-1]!==u?[]:zj(o,u);if(i-=c.length,i<r)return Dj(e,t,Lj,a.placeholder,void 0,o,c,void 0,void 0,r-i);var d=this&&this!==Uj&&this instanceof a?n:e;return Pj(d,this,o)}return a}var qj=Vj,Hj=jg,jj=Rd,Kj=hi,Wj=1;function Gj(e,t,r,n){var a=t&Wj,i=jj(e);function o(){for(var l=-1,u=arguments.length,c=-1,d=n.length,v=Array(d+u),m=this&&this!==Kj&&this instanceof o?i:e;++c<d;)v[c]=n[c];for(;u--;)v[c++]=arguments[++l];return Hj(m,a?r:this,v)}return o}var Zj=Gj,Yj=I4,Jj=B4,W4=$d,G4="__lodash_placeholder__",e1=1,Xj=2,Qj=4,Z4=8,pc=128,Y4=256,eK=Math.min;function tK(e,t){var r=e[1],n=t[1],a=r|n,i=a<(e1|Xj|pc),o=n==pc&&r==Z4||n==pc&&r==Y4&&e[7].length<=t[8]||n==(pc|Y4)&&t[7].length<=t[8]&&r==Z4;if(!(i||o))return e;n&e1&&(e[2]=t[2],a|=r&e1?0:Qj);var l=t[3];if(l){var u=e[3];e[3]=u?Yj(u,l,t[4]):l,e[4]=u?W4(e[3],G4):t[4]}return l=t[5],l&&(u=e[5],e[5]=u?Jj(u,l,t[6]):l,e[6]=u?W4(e[5],G4):t[6]),l=t[7],l&&(e[7]=l),n&pc&&(e[8]=e[8]==null?t[8]:eK(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=a,e}var rK=tK,nK=/\s/;function iK(e){for(var t=e.length;t--&&nK.test(e.charAt(t)););return t}var aK=iK,oK=aK,sK=/^\s+/;function lK(e){return e&&e.slice(0,oK(e)+1).replace(sK,"")}var uK=lK,fK=Du,cK=Io,hK="[object Symbol]";function dK(e){return typeof e=="symbol"||cK(e)&&fK(e)==hK}var zd=dK,pK=uK,J4=ga,vK=zd,X4=0/0,mK=/^[-+]0x[0-9a-f]+$/i,gK=/^0b[01]+$/i,yK=/^0o[0-7]+$/i,bK=parseInt;function _K(e){if(typeof e=="number")return e;if(vK(e))return X4;if(J4(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=J4(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=pK(e);var r=gK.test(e);return r||yK.test(e)?bK(e.slice(2),r?2:8):mK.test(e)?X4:+e}var wK=_K,EK=wK,Q4=1/0,xK=17976931348623157e292;function SK(e){if(!e)return e===0?e:0;if(e=EK(e),e===Q4||e===-Q4){var t=e<0?-1:1;return t*xK}return e===e?e:0}var MK=SK,CK=MK;function TK(e){var t=CK(e),r=t%1;return t===t?r?t-r:t:0}var t1=TK,AK=T4,IK=Sq,BK=qj,kK=K4,NK=Zj,OK=O4,RK=rK,PK=L4,FK=$4,eS=t1,LK="Expected a function",tS=1,DK=2,r1=8,n1=16,i1=32,rS=64,nS=Math.max;function $K(e,t,r,n,a,i,o,l){var u=t&DK;if(!u&&typeof e!="function")throw new TypeError(LK);var c=n?n.length:0;if(c||(t&=~(i1|rS),n=a=void 0),o=o===void 0?o:nS(eS(o),0),l=l===void 0?l:eS(l),c-=a?a.length:0,t&rS){var d=n,v=a;n=a=void 0}var m=u?void 0:OK(e),b=[e,t,r,n,a,d,v,i,o,l];if(m&&RK(b,m),e=b[0],t=b[1],r=b[2],n=b[3],a=b[4],l=b[9]=b[9]===void 0?u?0:e.length:nS(b[9]-c,0),!l&&t&(r1|n1)&&(t&=~(r1|n1)),!t||t==tS)var _=IK(e,t,r);else t==r1||t==n1?_=BK(e,t,l):(t==i1||t==(tS|i1))&&!a.length?_=NK(e,t,r,n):_=kK.apply(void 0,b);var S=m?AK:PK;return FK(S(_,b),e,t)}var zK=$K,UK=Zg,VK=zK,qK=Qg,HK=$d,jK=64,a1=UK(function(e,t){var r=HK(t,qK(a1));return VK(e,jK,void 0,t,r)});a1.placeholder={};var KK=a1;function WK(){this.__data__=[],this.size=0}var GK=WK;function ZK(e,t){return e===t||e!==e&&t!==t}var Ud=ZK,YK=Ud;function JK(e,t){for(var r=e.length;r--;)if(YK(e[r][0],t))return r;return-1}var Vd=JK,XK=Vd,QK=Array.prototype,eW=QK.splice;function tW(e){var t=this.__data__,r=XK(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():eW.call(t,r,1),--this.size,!0}var rW=tW,nW=Vd;function iW(e){var t=this.__data__,r=nW(t,e);return r<0?void 0:t[r][1]}var aW=iW,oW=Vd;function sW(e){return oW(this.__data__,e)>-1}var lW=sW,uW=Vd;function fW(e,t){var r=this.__data__,n=uW(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var cW=fW,hW=GK,dW=rW,pW=aW,vW=lW,mW=cW;function $u(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}$u.prototype.clear=hW,$u.prototype.delete=dW,$u.prototype.get=pW,$u.prototype.has=vW,$u.prototype.set=mW;var qd=$u,gW=qd;function yW(){this.__data__=new gW,this.size=0}var bW=yW;function _W(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var wW=_W;function EW(e){return this.__data__.get(e)}var xW=EW;function SW(e){return this.__data__.has(e)}var MW=SW,CW=wl,TW=hi,AW=CW(TW,"Map"),o1=AW,IW=wl,BW=IW(Object,"create"),Hd=BW,iS=Hd;function kW(){this.__data__=iS?iS(null):{},this.size=0}var NW=kW;function OW(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var RW=OW,PW=Hd,FW="__lodash_hash_undefined__",LW=Object.prototype,DW=LW.hasOwnProperty;function $W(e){var t=this.__data__;if(PW){var r=t[e];return r===FW?void 0:r}return DW.call(t,e)?t[e]:void 0}var zW=$W,UW=Hd,VW=Object.prototype,qW=VW.hasOwnProperty;function HW(e){var t=this.__data__;return UW?t[e]!==void 0:qW.call(t,e)}var jW=HW,KW=Hd,WW="__lodash_hash_undefined__";function GW(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=KW&&t===void 0?WW:t,this}var ZW=GW,YW=NW,JW=RW,XW=zW,QW=jW,eG=ZW;function zu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}zu.prototype.clear=YW,zu.prototype.delete=JW,zu.prototype.get=XW,zu.prototype.has=QW,zu.prototype.set=eG;var tG=zu,aS=tG,rG=qd,nG=o1;function iG(){this.size=0,this.__data__={hash:new aS,map:new(nG||rG),string:new aS}}var aG=iG;function oG(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var sG=oG,lG=sG;function uG(e,t){var r=e.__data__;return lG(t)?r[typeof t=="string"?"string":"hash"]:r.map}var jd=uG,fG=jd;function cG(e){var t=fG(this,e).delete(e);return this.size-=t?1:0,t}var hG=cG,dG=jd;function pG(e){return dG(this,e).get(e)}var vG=pG,mG=jd;function gG(e){return mG(this,e).has(e)}var yG=gG,bG=jd;function _G(e,t){var r=bG(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var wG=_G,EG=aG,xG=hG,SG=vG,MG=yG,CG=wG;function Uu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Uu.prototype.clear=EG,Uu.prototype.delete=xG,Uu.prototype.get=SG,Uu.prototype.has=MG,Uu.prototype.set=CG;var s1=Uu,TG=qd,AG=o1,IG=s1,BG=200;function kG(e,t){var r=this.__data__;if(r instanceof TG){var n=r.__data__;if(!AG||n.length<BG-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new IG(n)}return r.set(e,t),this.size=r.size,this}var NG=kG,OG=qd,RG=bW,PG=wW,FG=xW,LG=MW,DG=NG;function Vu(e){var t=this.__data__=new OG(e);this.size=t.size}Vu.prototype.clear=RG,Vu.prototype.delete=PG,Vu.prototype.get=FG,Vu.prototype.has=LG,Vu.prototype.set=DG;var oS=Vu,sS=_4;function $G(e,t,r){t=="__proto__"&&sS?sS(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var l1=$G,zG=l1,UG=Ud;function VG(e,t,r){(r!==void 0&&!UG(e[t],r)||r===void 0&&!(t in e))&&zG(e,t,r)}var lS=VG;function qG(e){return function(t,r,n){for(var a=-1,i=Object(t),o=n(t),l=o.length;l--;){var u=o[e?l:++a];if(r(i[u],u,i)===!1)break}return t}}var HG=qG,jG=HG,KG=jG(),WG=KG,Kd={exports:{}};Kd.exports,function(e,t){var r=hi,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i?r.Buffer:void 0,l=o?o.allocUnsafe:void 0;function u(c,d){if(d)return c.slice();var v=c.length,m=l?l(v):new c.constructor(v);return c.copy(m),m}e.exports=u}(Kd,Kd.exports);var uS=Kd.exports,GG=hi,ZG=GG.Uint8Array,YG=ZG,fS=YG;function JG(e){var t=new e.constructor(e.byteLength);return new fS(t).set(new fS(e)),t}var u1=JG,XG=u1;function QG(e,t){var r=t?XG(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var cS=QG;function eZ(e,t){return function(r){return e(t(r))}}var hS=eZ,tZ=hS,rZ=tZ(Object.getPrototypeOf,Object),f1=rZ,nZ=Object.prototype;function iZ(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||nZ;return e===r}var Wd=iZ,aZ=Od,oZ=f1,sZ=Wd;function lZ(e){return typeof e.constructor=="function"&&!sZ(e)?aZ(oZ(e)):{}}var dS=lZ,uZ=Du,fZ=Io,cZ="[object Arguments]";function hZ(e){return fZ(e)&&uZ(e)==cZ}var dZ=hZ,pS=dZ,pZ=Io,vS=Object.prototype,vZ=vS.hasOwnProperty,mZ=vS.propertyIsEnumerable,gZ=pS(function(){return arguments}())?pS:function(e){return pZ(e)&&vZ.call(e,"callee")&&!mZ.call(e,"callee")},Gd=gZ,yZ=9007199254740991;function bZ(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=yZ}var c1=bZ,_Z=Kg,wZ=c1;function EZ(e){return e!=null&&wZ(e.length)&&!_Z(e)}var vc=EZ,xZ=vc,SZ=Io;function MZ(e){return SZ(e)&&xZ(e)}var mS=MZ,Zd={exports:{}};function CZ(){return!1}var TZ=CZ;Zd.exports,function(e,t){var r=hi,n=TZ,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,l=o?r.Buffer:void 0,u=l?l.isBuffer:void 0,c=u||n;e.exports=c}(Zd,Zd.exports);var h1=Zd.exports,AZ=Du,IZ=f1,BZ=Io,kZ="[object Object]",NZ=Function.prototype,OZ=Object.prototype,gS=NZ.toString,RZ=OZ.hasOwnProperty,PZ=gS.call(Object);function FZ(e){if(!BZ(e)||AZ(e)!=kZ)return!1;var t=IZ(e);if(t===null)return!0;var r=RZ.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&gS.call(r)==PZ}var yS=FZ,LZ=Du,DZ=c1,$Z=Io,zZ="[object Arguments]",UZ="[object Array]",VZ="[object Boolean]",qZ="[object Date]",HZ="[object Error]",jZ="[object Function]",KZ="[object Map]",WZ="[object Number]",GZ="[object Object]",ZZ="[object RegExp]",YZ="[object Set]",JZ="[object String]",XZ="[object WeakMap]",QZ="[object ArrayBuffer]",eY="[object DataView]",tY="[object Float32Array]",rY="[object Float64Array]",nY="[object Int8Array]",iY="[object Int16Array]",aY="[object Int32Array]",oY="[object Uint8Array]",sY="[object Uint8ClampedArray]",lY="[object Uint16Array]",uY="[object Uint32Array]",jr={};jr[tY]=jr[rY]=jr[nY]=jr[iY]=jr[aY]=jr[oY]=jr[sY]=jr[lY]=jr[uY]=!0,jr[zZ]=jr[UZ]=jr[QZ]=jr[VZ]=jr[eY]=jr[qZ]=jr[HZ]=jr[jZ]=jr[KZ]=jr[WZ]=jr[GZ]=jr[ZZ]=jr[YZ]=jr[JZ]=jr[XZ]=!1;function fY(e){return $Z(e)&&DZ(e.length)&&!!jr[LZ(e)]}var cY=fY;function hY(e){return function(t){return e(t)}}var Yd=hY,Jd={exports:{}};Jd.exports,function(e,t){var r=d4,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i&&r.process,l=function(){try{var u=a&&a.require&&a.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l}(Jd,Jd.exports);var d1=Jd.exports,dY=cY,pY=Yd,bS=d1,_S=bS&&bS.isTypedArray,vY=_S?pY(_S):dY,wS=vY;function mY(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var ES=mY,gY=l1,yY=Ud,bY=Object.prototype,_Y=bY.hasOwnProperty;function wY(e,t,r){var n=e[t];(!(_Y.call(e,t)&&yY(n,r))||r===void 0&&!(t in e))&&gY(e,t,r)}var Xd=wY,EY=Xd,xY=l1;function SY(e,t,r,n){var a=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var l=t[i],u=n?n(r[l],e[l],l,r,e):void 0;u===void 0&&(u=e[l]),a?xY(r,l,u):EY(r,l,u)}return r}var El=SY;function MY(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var CY=MY,TY=CY,AY=Gd,IY=Ka,BY=h1,kY=dc,NY=wS,OY=Object.prototype,RY=OY.hasOwnProperty;function PY(e,t){var r=IY(e),n=!r&&AY(e),a=!r&&!n&&BY(e),i=!r&&!n&&!a&&NY(e),o=r||n||a||i,l=o?TY(e.length,String):[],u=l.length;for(var c in e)(t||RY.call(e,c))&&!(o&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||kY(c,u)))&&l.push(c);return l}var xS=PY;function FY(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var LY=FY,DY=ga,$Y=Wd,zY=LY,UY=Object.prototype,VY=UY.hasOwnProperty;function qY(e){if(!DY(e))return zY(e);var t=$Y(e),r=[];for(var n in e)n=="constructor"&&(t||!VY.call(e,n))||r.push(n);return r}var HY=qY,jY=xS,KY=HY,WY=vc;function GY(e){return WY(e)?jY(e,!0):KY(e)}var mc=GY,ZY=El,YY=mc;function JY(e){return ZY(e,YY(e))}var XY=JY,SS=lS,QY=uS,eJ=cS,tJ=Ld,rJ=dS,MS=Gd,CS=Ka,nJ=mS,iJ=h1,aJ=Kg,oJ=ga,sJ=yS,lJ=wS,TS=ES,uJ=XY;function fJ(e,t,r,n,a,i,o){var l=TS(e,r),u=TS(t,r),c=o.get(u);if(c){SS(e,r,c);return}var d=i?i(l,u,r+"",e,t,o):void 0,v=d===void 0;if(v){var m=CS(u),b=!m&&iJ(u),_=!m&&!b&&lJ(u);d=u,m||b||_?CS(l)?d=l:nJ(l)?d=tJ(l):b?(v=!1,d=QY(u,!0)):_?(v=!1,d=eJ(u,!0)):d=[]:sJ(u)||MS(u)?(d=l,MS(l)?d=uJ(l):(!oJ(l)||aJ(l))&&(d=rJ(u))):v=!1}v&&(o.set(u,d),a(d,u,n,i,o),o.delete(u)),SS(e,r,d)}var cJ=fJ,hJ=oS,dJ=lS,pJ=WG,vJ=cJ,mJ=ga,gJ=mc,yJ=ES;function AS(e,t,r,n,a){e!==t&&pJ(t,function(i,o){if(a||(a=new hJ),mJ(i))vJ(e,t,o,r,AS,n,a);else{var l=n?n(yJ(e,o),i,o+"",e,t,a):void 0;l===void 0&&(l=i),dJ(e,o,l)}},gJ)}var bJ=AS,_J=Ud,wJ=vc,EJ=dc,xJ=ga;function SJ(e,t,r){if(!xJ(r))return!1;var n=typeof t;return(n=="number"?wJ(r)&&EJ(t,r.length):n=="string"&&t in r)?_J(r[t],e):!1}var IS=SJ,MJ=Zg,CJ=IS;function TJ(e){return MJ(function(t,r){var n=-1,a=r.length,i=a>1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,o&&CJ(r[0],r[1],o)&&(i=a<3?void 0:i,a=1),t=Object(t);++n<a;){var l=r[n];l&&e(t,l,n,i)}return t})}var BS=TJ,AJ=bJ,IJ=BS,BJ=IJ(function(e,t,r){AJ(e,t,r)}),kJ=BJ,NJ=KK,OJ=kJ,p1=function(){var e=[];return typeof Uint8ClampedArray<"u"&&e.push(Uint8ClampedArray),typeof Uint8Array<"u"&&e.push(Uint8Array),typeof Uint16Array<"u"&&e.push(Uint16Array),typeof Uint32Array<"u"&&e.push(Uint32Array),typeof Float32Array<"u"&&e.push(Float32Array),typeof Float64Array<"u"&&e.push(Float64Array),e}();function RJ(e){for(var t,r=0;!t&&p1.length>r;r++)e instanceof p1[r]&&(t=p1[r]);return t}function PJ(e,t){if(ve.Buffer.isBuffer(t))t=ve.Buffer.from(t);else{var r=RJ(t);t=r?new r(t,t.byteOffset,t.byteLength):void 0}return t}var vs=NJ(OJ,PJ),pr={options:{usePureJavaScript:!1}},v1={},FJ=v1,kS={};v1.encode=function(e,t,r){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(e instanceof Uint8Array))n=LJ(e,t);else{var a=0,i=t.length,o=t.charAt(0),l=[0];for(a=0;a<e.length;++a){for(var u=0,c=e[a];u<l.length;++u)c+=l[u]<<8,l[u]=c%i,c=c/i|0;for(;c>0;)l.push(c%i),c=c/i|0}for(a=0;e[a]===0&&a<e.length-1;++a)n+=o;for(a=l.length-1;a>=0;--a)n+=t[l[a]]}if(r){var d=new RegExp(".{1,"+r+"}","g");n=n.match(d).join(`\r
|
|
687
687
|
`)}return n},v1.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var r=kS[t];if(!r){r=kS[t]=[];for(var n=0;n<t.length;++n)r[t.charCodeAt(n)]=n}e=e.replace(/\s/g,"");for(var a=t.length,i=t.charAt(0),o=[0],n=0;n<e.length;n++){var l=r[e.charCodeAt(n)];if(l===void 0)return;for(var u=0,c=l;u<o.length;++u)c+=o[u]*a,o[u]=c&255,c>>=8;for(;c>0;)o.push(c&255),c>>=8}for(var d=0;e[d]===i&&d<e.length-1;++d)o.push(0);return typeof ve.Buffer<"u"?ve.Buffer.from(o.reverse()):new Uint8Array(o.reverse())};function LJ(e,t){var r=0,n=t.length,a=t.charAt(0),i=[0];for(r=0;r<e.length();++r){for(var o=0,l=e.at(r);o<i.length;++o)l+=i[o]<<8,i[o]=l%n,l=l/n|0;for(;l>0;)i.push(l%n),l=l/n|0}var u="";for(r=0;e.at(r)===0&&r<e.length()-1;++r)u+=a;for(r=i.length-1;r>=0;--r)u+=t[i[r]];return u}var NS=pr,OS=FJ,Se=NS.util=NS.util||{};(function(){if(typeof ue<"u"&&ue.nextTick&&!ue.browser){Se.nextTick=ue.nextTick,typeof setImmediate=="function"?Se.setImmediate=setImmediate:Se.setImmediate=Se.nextTick;return}if(typeof setImmediate=="function"){Se.setImmediate=function(){return setImmediate.apply(void 0,arguments)},Se.nextTick=function(o){return setImmediate(o)};return}if(Se.setImmediate=function(o){setTimeout(o,0)},typeof window<"u"&&typeof window.postMessage=="function"){let o=function(l){if(l.source===window&&l.data===e){l.stopPropagation();var u=t.slice();t.length=0,u.forEach(function(c){c()})}};var e="forge.setImmediate",t=[];Se.setImmediate=function(l){t.push(l),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",o,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,a=document.createElement("div"),t=[];new MutationObserver(function(){var l=t.slice();t.length=0,l.forEach(function(u){u()})}).observe(a,{attributes:!0});var i=Se.setImmediate;Se.setImmediate=function(l){Date.now()-r>15?(r=Date.now(),i(l)):(t.push(l),t.length===1&&a.setAttribute("a",n=!n))}}Se.nextTick=Se.setImmediate})(),Se.isNodejs=typeof ue<"u"&&ue.versions&&ue.versions.node,Se.globalScope=function(){return Se.isNodejs?Bt:typeof self>"u"?window:self}(),Se.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},Se.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer},Se.isArrayBufferView=function(e){return e&&Se.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function gc(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}Se.ByteBuffer=m1;function m1(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(Se.isArrayBuffer(e)||Se.isArrayBufferView(e))if(typeof ve.Buffer<"u"&&e instanceof ve.Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof m1||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}Se.ByteStringBuffer=m1;var DJ=4096;Se.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>DJ&&(this.data.substr(0,1),this._constructedStringLength=0)},Se.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},Se.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},Se.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},Se.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},Se.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},Se.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(Se.encodeUtf8(e))},Se.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},Se.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},Se.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))},Se.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))},Se.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},Se.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},Se.ByteStringBuffer.prototype.putInt=function(e,t){gc(t);var r="";do t-=8,r+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(r)},Se.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},Se.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},Se.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},Se.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},Se.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},Se.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},Se.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},Se.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},Se.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},Se.ByteStringBuffer.prototype.getInt=function(e){gc(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t},Se.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},Se.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t},Se.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},Se.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},Se.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},Se.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},Se.ByteStringBuffer.prototype.copy=function(){var e=Se.createBuffer(this.data);return e.read=this.read,e},Se.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},Se.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},Se.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},Se.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},Se.ByteStringBuffer.prototype.toString=function(){return Se.decodeUtf8(this.bytes())};function $J(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=Se.isArrayBuffer(e),n=Se.isArrayBufferView(e);if(r||n){r?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}Se.DataBuffer=$J,Se.DataBuffer.prototype.length=function(){return this.write-this.read},Se.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},Se.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},Se.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},Se.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},Se.DataBuffer.prototype.putBytes=function(e,t){if(Se.isArrayBufferView(e)){var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=r.byteLength-r.byteOffset;this.accommodate(n);var a=new Uint8Array(this.data.buffer,this.write);return a.set(r),this.write+=n,this}if(Se.isArrayBuffer(e)){var r=new Uint8Array(e);this.accommodate(r.byteLength);var a=new Uint8Array(this.data.buffer);return a.set(r,this.write),this.write+=r.byteLength,this}if(e instanceof Se.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&Se.isArrayBufferView(e.data)){var r=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(r.byteLength);var a=new Uint8Array(e.data.byteLength,this.write);return a.set(r),this.write+=r.byteLength,this}if(e instanceof Se.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var i;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=Se.binary.hex.decode(e,i,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),i=new Uint8Array(this.data.buffer,this.write),this.write+=Se.binary.base64.decode(e,i,this.write),this;if(t==="utf8"&&(e=Se.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=Se.binary.raw.decode(i),this;if(t==="utf16")return this.accommodate(e.length*2),i=new Uint16Array(this.data.buffer,this.write),this.write+=Se.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},Se.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},Se.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},Se.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},Se.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},Se.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},Se.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},Se.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},Se.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},Se.DataBuffer.prototype.putInt=function(e,t){gc(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this},Se.DataBuffer.prototype.putSignedInt=function(e,t){return gc(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},Se.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},Se.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},Se.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},Se.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},Se.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},Se.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},Se.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},Se.DataBuffer.prototype.getInt=function(e){gc(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t},Se.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},Se.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t},Se.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},Se.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},Se.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},Se.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},Se.DataBuffer.prototype.copy=function(){return new Se.DataBuffer(this)},Se.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},Se.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},Se.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},Se.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},Se.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return Se.binary.raw.encode(t);if(e==="hex")return Se.binary.hex.encode(t);if(e==="base64")return Se.binary.base64.encode(t);if(e==="utf8")return Se.text.utf8.decode(t);if(e==="utf16")return Se.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},Se.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=Se.encodeUtf8(e)),new Se.ByteBuffer(e)},Se.fillString=function(e,t){for(var r="";t>0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return r},Se.xorBytes=function(e,t,r){for(var n="",a="",i="",o=0,l=0;r>0;--r,++o)a=e.charCodeAt(o)^t.charCodeAt(o),l>=10&&(n+=i,i="",l=0),i+=String.fromCharCode(a),++l;return n+=i,n},Se.hexToBytes=function(e){var t="",r=0;for(e.length&!0&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},Se.bytesToHex=function(e){return Se.createBuffer(e).toHex()},Se.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var ms="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",gs=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],RS="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";Se.encode64=function(e,t){for(var r="",n="",a,i,o,l=0;l<e.length;)a=e.charCodeAt(l++),i=e.charCodeAt(l++),o=e.charCodeAt(l++),r+=ms.charAt(a>>2),r+=ms.charAt((a&3)<<4|i>>4),isNaN(i)?r+="==":(r+=ms.charAt((i&15)<<2|o>>6),r+=isNaN(o)?"=":ms.charAt(o&63)),t&&r.length>t&&(n+=r.substr(0,t)+`\r
|
|
@@ -866,4 +866,4 @@ For more detail, please visit: ${a}
|
|
|
866
866
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(a=>n.set(a)),n}static accessor(t){const n=(this[oL]=this[oL]={accessors:{}}).accessors,a=this.prototype;function i(o){const l=fd(o);n[l]||(tAe(a,o),n[l]=!0)}return Ve.isArray(t)?t.forEach(i):i(t),this}}Wm.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ve.reduceDescriptors(Wm.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),Ve.freezeMethods(Wm);const za=Wm;function vx(e,t){const r=this||dx,n=t||r,a=za.from(n.headers);let i=n.data;return Ve.forEach(e,function(l){i=l.call(r,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function sL(e){return!!(e&&e.__CANCEL__)}function sc(e,t,r){Ft.call(this,e??"canceled",Ft.ERR_CANCELED,t,r),this.name="CanceledError"}Ve.inherits(sc,Ft,{__CANCEL__:!0});function lL(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Ft("Request failed with status code "+r.status,[Ft.ERR_BAD_REQUEST,Ft.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function rAe(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function nAe(e,t){e=e||10;const r=new Array(e),n=new Array(e);let a=0,i=0,o;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),d=n[i];o||(o=c),r[a]=u,n[a]=c;let v=i,m=0;for(;v!==a;)m+=r[v++],v=v%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),c-o<t)return;const b=d&&c-d;return b?Math.round(m*1e3/b):void 0}}function iAe(e,t){let r=0,n=1e3/t,a,i;const o=(c,d=Date.now())=>{r=d,a=null,i&&(clearTimeout(i),i=null),e.apply(null,c)};return[(...c)=>{const d=Date.now(),v=d-r;v>=n?o(c,d):(a=c,i||(i=setTimeout(()=>{i=null,o(a)},n-v)))},()=>a&&o(a)]}const Gm=(e,t,r=3)=>{let n=0;const a=nAe(50,250);return iAe(i=>{const o=i.loaded,l=i.lengthComputable?i.total:void 0,u=o-n,c=a(u),d=o<=l;n=o;const v={loaded:o,total:l,progress:l?o/l:void 0,bytes:u,rate:c||void 0,estimated:c&&l&&d?(l-o)/c:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(v)},r)},uL=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},fL=e=>(...t)=>Ve.asap(()=>e(...t)),aAe=Gn.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Gn.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Gn.origin),Gn.navigator&&/(msie|trident)/i.test(Gn.navigator.userAgent)):()=>!0,oAe=Gn.hasStandardBrowserEnv?{write(e,t,r,n,a,i){const o=[e+"="+encodeURIComponent(t)];Ve.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Ve.isString(n)&&o.push("path="+n),Ve.isString(a)&&o.push("domain="+a),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function sAe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function lAe(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function cL(e,t){return e&&!sAe(t)?lAe(e,t):t}const hL=e=>e instanceof za?{...e}:e;function Ou(e,t){t=t||{};const r={};function n(c,d,v,m){return Ve.isPlainObject(c)&&Ve.isPlainObject(d)?Ve.merge.call({caseless:m},c,d):Ve.isPlainObject(d)?Ve.merge({},d):Ve.isArray(d)?d.slice():d}function a(c,d,v,m){if(Ve.isUndefined(d)){if(!Ve.isUndefined(c))return n(void 0,c,v,m)}else return n(c,d,v,m)}function i(c,d){if(!Ve.isUndefined(d))return n(void 0,d)}function o(c,d){if(Ve.isUndefined(d)){if(!Ve.isUndefined(c))return n(void 0,c)}else return n(void 0,d)}function l(c,d,v){if(v in t)return n(c,d);if(v in e)return n(void 0,c)}const u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(c,d,v)=>a(hL(c),hL(d),v,!0)};return Ve.forEach(Object.keys(Object.assign({},e,t)),function(d){const v=u[d]||a,m=v(e[d],t[d],d);Ve.isUndefined(m)&&v!==l||(r[d]=m)}),r}const dL=e=>{const t=Ou({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:i,headers:o,auth:l}=t;t.headers=o=za.from(o),t.url=rL(cL(t.baseURL,t.url),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(Ve.isFormData(r)){if(Gn.hasStandardBrowserEnv||Gn.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){const[c,...d]=u?u.split(";").map(v=>v.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...d].join("; "))}}if(Gn.hasStandardBrowserEnv&&(n&&Ve.isFunction(n)&&(n=n(t)),n||n!==!1&&aAe(t.url))){const c=a&&i&&oAe.read(i);c&&o.set(a,c)}return t},uAe=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const a=dL(e);let i=a.data;const o=za.from(a.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:c}=a,d,v,m,b,_;function S(){b&&b(),_&&_(),a.cancelToken&&a.cancelToken.unsubscribe(d),a.signal&&a.signal.removeEventListener("abort",d)}let T=new XMLHttpRequest;T.open(a.method.toUpperCase(),a.url,!0),T.timeout=a.timeout;function C(){if(!T)return;const B=za.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),O={data:!l||l==="text"||l==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:B,config:e,request:T};lL(function(L){r(L),S()},function(L){n(L),S()},O),T=null}"onloadend"in T?T.onloadend=C:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(C)},T.onabort=function(){T&&(n(new Ft("Request aborted",Ft.ECONNABORTED,e,T)),T=null)},T.onerror=function(){n(new Ft("Network Error",Ft.ERR_NETWORK,e,T)),T=null},T.ontimeout=function(){let N=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const O=a.transitional||iL;a.timeoutErrorMessage&&(N=a.timeoutErrorMessage),n(new Ft(N,O.clarifyTimeoutError?Ft.ETIMEDOUT:Ft.ECONNABORTED,e,T)),T=null},i===void 0&&o.setContentType(null),"setRequestHeader"in T&&Ve.forEach(o.toJSON(),function(N,O){T.setRequestHeader(O,N)}),Ve.isUndefined(a.withCredentials)||(T.withCredentials=!!a.withCredentials),l&&l!=="json"&&(T.responseType=a.responseType),c&&([m,_]=Gm(c,!0),T.addEventListener("progress",m)),u&&T.upload&&([v,b]=Gm(u),T.upload.addEventListener("progress",v),T.upload.addEventListener("loadend",b)),(a.cancelToken||a.signal)&&(d=B=>{T&&(n(!B||B.type?new sc(null,e,T):B),T.abort(),T=null)},a.cancelToken&&a.cancelToken.subscribe(d),a.signal&&(a.signal.aborted?d():a.signal.addEventListener("abort",d)));const I=rAe(a.url);if(I&&Gn.protocols.indexOf(I)===-1){n(new Ft("Unsupported protocol "+I+":",Ft.ERR_BAD_REQUEST,e));return}T.send(i||null)})},fAe=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,a;const i=function(c){if(!a){a=!0,l();const d=c instanceof Error?c:this.reason;n.abort(d instanceof Ft?d:new sc(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,i(new Ft(`timeout ${t} of ms exceeded`,Ft.ETIMEDOUT))},t);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:u}=n;return u.unsubscribe=()=>Ve.asap(l),u}},cAe=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,a;for(;n<r;)a=n+t,yield e.slice(n,a),n=a},hAe=async function*(e,t){for await(const r of dAe(e))yield*cAe(r,t)},dAe=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},pL=(e,t,r,n)=>{const a=hAe(e,t);let i=0,o,l=u=>{o||(o=!0,n&&n(u))};return new ReadableStream({async pull(u){try{const{done:c,value:d}=await a.next();if(c){l(),u.close();return}let v=d.byteLength;if(r){let m=i+=v;r(m)}u.enqueue(new Uint8Array(d))}catch(c){throw l(c),c}},cancel(u){return l(u),a.return()}},{highWaterMark:2})},Zm=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",vL=Zm&&typeof ReadableStream=="function",pAe=Zm&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),mL=(e,...t)=>{try{return!!e(...t)}catch{return!1}},vAe=vL&&mL(()=>{let e=!1;const t=new Request(Gn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),gL=64*1024,mx=vL&&mL(()=>Ve.isReadableStream(new Response("").body)),Ym={stream:mx&&(e=>e.body)};Zm&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ym[t]&&(Ym[t]=Ve.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new Ft(`Response type '${t}' is not supported`,Ft.ERR_NOT_SUPPORT,n)})})})(new Response);const mAe=async e=>{if(e==null)return 0;if(Ve.isBlob(e))return e.size;if(Ve.isSpecCompliantForm(e))return(await new Request(Gn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Ve.isArrayBufferView(e)||Ve.isArrayBuffer(e))return e.byteLength;if(Ve.isURLSearchParams(e)&&(e=e+""),Ve.isString(e))return(await pAe(e)).byteLength},gAe=async(e,t)=>{const r=Ve.toFiniteNumber(e.getContentLength());return r??mAe(t)},gx={http:LTe,xhr:uAe,fetch:Zm&&(async e=>{let{url:t,method:r,data:n,signal:a,cancelToken:i,timeout:o,onDownloadProgress:l,onUploadProgress:u,responseType:c,headers:d,withCredentials:v="same-origin",fetchOptions:m}=dL(e);c=c?(c+"").toLowerCase():"text";let b=fAe([a,i&&i.toAbortSignal()],o),_;const S=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let T;try{if(u&&vAe&&r!=="get"&&r!=="head"&&(T=await gAe(d,n))!==0){let O=new Request(t,{method:"POST",body:n,duplex:"half"}),P;if(Ve.isFormData(n)&&(P=O.headers.get("content-type"))&&d.setContentType(P),O.body){const[L,$]=uL(T,Gm(fL(u)));n=pL(O.body,gL,L,$)}}Ve.isString(v)||(v=v?"include":"omit");const C="credentials"in Request.prototype;_=new Request(t,{...m,signal:b,method:r.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",credentials:C?v:void 0});let I=await fetch(_);const B=mx&&(c==="stream"||c==="response");if(mx&&(l||B&&S)){const O={};["status","statusText","headers"].forEach(z=>{O[z]=I[z]});const P=Ve.toFiniteNumber(I.headers.get("content-length")),[L,$]=l&&uL(P,Gm(fL(l),!0))||[];I=new Response(pL(I.body,gL,L,()=>{$&&$(),S&&S()}),O)}c=c||"text";let N=await Ym[Ve.findKey(Ym,c)||"text"](I,e);return!B&&S&&S(),await new Promise((O,P)=>{lL(O,P,{data:N,headers:za.from(I.headers),status:I.status,statusText:I.statusText,config:e,request:_})})}catch(C){throw S&&S(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new Ft("Network Error",Ft.ERR_NETWORK,e,_),{cause:C.cause||C}):Ft.from(C,C&&C.code,e,_)}})};Ve.forEach(gx,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const yL=e=>`- ${e}`,yAe=e=>Ve.isFunction(e)||e===null||e===!1,bL={getAdapter:e=>{e=Ve.isArray(e)?e:[e];const{length:t}=e;let r,n;const a={};for(let i=0;i<t;i++){r=e[i];let o;if(n=r,!yAe(r)&&(n=gx[(o=String(r)).toLowerCase()],n===void 0))throw new Ft(`Unknown adapter '${o}'`);if(n)break;a[o||"#"+i]=n}if(!n){const i=Object.entries(a).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
|
|
867
867
|
`+i.map(yL).join(`
|
|
868
868
|
`):" "+yL(i[0]):"as no adapter specified";throw new Ft("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:gx};function yx(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new sc(null,e)}function _L(e){return yx(e),e.headers=za.from(e.headers),e.data=vx.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),bL.getAdapter(e.adapter||dx.adapter)(e).then(function(n){return yx(e),n.data=vx.call(e,e.transformResponse,n),n.headers=za.from(n.headers),n},function(n){return sL(n)||(yx(e),n&&n.response&&(n.response.data=vx.call(e,e.transformResponse,n.response),n.response.headers=za.from(n.response.headers))),Promise.reject(n)})}const wL="1.7.9",Jm={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Jm[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const EL={};Jm.transitional=function(t,r,n){function a(i,o){return"[Axios v"+wL+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,l)=>{if(t===!1)throw new Ft(a(o," has been removed"+(r?" in "+r:"")),Ft.ERR_DEPRECATED);return r&&!EL[o]&&(EL[o]=!0,console.warn(a(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,o,l):!0}},Jm.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function bAe(e,t,r){if(typeof e!="object")throw new Ft("options must be an object",Ft.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let a=n.length;for(;a-- >0;){const i=n[a],o=t[i];if(o){const l=e[i],u=l===void 0||o(l,i,e);if(u!==!0)throw new Ft("option "+i+" must be "+u,Ft.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Ft("Unknown option "+i,Ft.ERR_BAD_OPTION)}}const Xm={assertOptions:bAe,validators:Jm},So=Xm.validators;class Qm{constructor(t){this.defaults=t,this.interceptors={request:new nL,response:new nL}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
869
|
-
`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ou(this.defaults,r);const{transitional:n,paramsSerializer:a,headers:i}=r;n!==void 0&&Xm.assertOptions(n,{silentJSONParsing:So.transitional(So.boolean),forcedJSONParsing:So.transitional(So.boolean),clarifyTimeoutError:So.transitional(So.boolean)},!1),a!=null&&(Ve.isFunction(a)?r.paramsSerializer={serialize:a}:Xm.assertOptions(a,{encode:So.function,serialize:So.function},!0)),Xm.assertOptions(r,{baseUrl:So.spelling("baseURL"),withXsrfToken:So.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&Ve.merge(i.common,i[r.method]);i&&Ve.forEach(["delete","get","head","post","put","patch","common"],_=>{delete i[_]}),r.headers=za.concat(o,i);const l=[];let u=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(r)===!1||(u=u&&S.synchronous,l.unshift(S.fulfilled,S.rejected))});const c=[];this.interceptors.response.forEach(function(S){c.push(S.fulfilled,S.rejected)});let d,v=0,m;if(!u){const _=[_L.bind(this),void 0];for(_.unshift.apply(_,l),_.push.apply(_,c),m=_.length,d=Promise.resolve(r);v<m;)d=d.then(_[v++],_[v++]);return d}m=l.length;let b=r;for(v=0;v<m;){const _=l[v++],S=l[v++];try{b=_(b)}catch(T){S.call(this,T);break}}try{d=_L.call(this,b)}catch(_){return Promise.reject(_)}for(v=0,m=c.length;v<m;)d=d.then(c[v++],c[v++]);return d}getUri(t){t=Ou(this.defaults,t);const r=cL(t.baseURL,t.url);return rL(r,t.params,t.paramsSerializer)}}Ve.forEach(["delete","get","head","options"],function(t){Qm.prototype[t]=function(r,n){return this.request(Ou(n||{},{method:t,url:r,data:(n||{}).data}))}}),Ve.forEach(["post","put","patch"],function(t){function r(n){return function(i,o,l){return this.request(Ou(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Qm.prototype[t]=r(),Qm.prototype[t+"Form"]=r(!0)});const eg=Qm;class bx{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(a=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](a);n._listeners=null}),this.promise.then=a=>{let i;const o=new Promise(l=>{n.subscribe(l),i=l}).then(a);return o.cancel=function(){n.unsubscribe(i)},o},t(function(i,o,l){n.reason||(n.reason=new sc(i,o,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new bx(function(a){t=a}),cancel:t}}}const _Ae=bx;function wAe(e){return function(r){return e.apply(null,r)}}function EAe(e){return Ve.isObject(e)&&e.isAxiosError===!0}const _x={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(_x).forEach(([e,t])=>{_x[t]=e});const xAe=_x;function xL(e){const t=new eg(e),r=zF(eg.prototype.request,t);return Ve.extend(r,eg.prototype,t,{allOwnKeys:!0}),Ve.extend(r,t,null,{allOwnKeys:!0}),r.create=function(a){return xL(Ou(e,a))},r}const pn=xL(dx);pn.Axios=eg,pn.CanceledError=sc,pn.CancelToken=_Ae,pn.isCancel=sL,pn.VERSION=wL,pn.toFormData=jm,pn.AxiosError=Ft,pn.Cancel=pn.CanceledError,pn.all=function(t){return Promise.all(t)},pn.spread=wAe,pn.isAxiosError=EAe,pn.mergeConfig=Ou,pn.AxiosHeaders=za,pn.formToJSON=e=>aL(Ve.isHTMLForm(e)?new FormData(e):e),pn.getAdapter=bL.getAdapter,pn.HttpStatusCode=xAe,pn.default=pn;const Ua=pn;function SAe(e,t,r){var n=r||{},a=n.noTrailing,i=a===void 0?!1:a,o=n.noLeading,l=o===void 0?!1:o,u=n.debounceMode,c=u===void 0?void 0:u,d,v=!1,m=0;function b(){d&&clearTimeout(d)}function _(T){var C=T||{},I=C.upcomingOnly,B=I===void 0?!1:I;b(),v=!B}function S(){for(var T=arguments.length,C=new Array(T),I=0;I<T;I++)C[I]=arguments[I];var B=this,N=Date.now()-m;if(v)return;function O(){m=Date.now(),t.apply(B,C)}function P(){d=void 0}!l&&c&&!d&&O(),b(),c===void 0&&N>e?l?(m=Date.now(),i||(d=setTimeout(c?P:O,e))):O():i!==!0&&(d=setTimeout(c?P:O,c===void 0?e-N:e))}return S.cancel=_,S}function SL(e,t,r){var n=r||{},a=n.atBegin,i=a===void 0?!1:a;return SAe(e,t,{debounceMode:i!==!1})}class wx extends ys.EventEmitter{constructor(r,n,a=!0){super();kt(this,"connection");kt(this,"data",{});kt(this,"displaySubmitButton",!0);kt(this,"http");kt(this,"_loading",!1);kt(this,"rules",{});kt(this,"rulesDefined",!1);if(this.config=r,this.measureEvents=a,this.http=n.getInstance(),r.twofa&&r.twofa.length)this.configuredMeasureEvent("twofa_request",{id_site:r.id_site,...r.id_site?{}:{id_request:r.id_request}}),r.twofa.forEach(i=>{const o=i.name;this.data[o]=null,(i.type==="authentication_type"||i.type==="challenge")&&(this.data[o]=i.label),i.type==="connection"&&(this.connection=this.data[o]=i.label),(i.type==="externalAction"||i.type==="instructions")&&(this.displaySubmitButton=!1)}),this.connectSantanderUsbToken(),this.handleBbvaNetcashConnections();else throw new Error("TWOFA credentials are required.")}get loading(){return this._loading}set loading(r){this._loading=r,r&&this.emit("loading")}authenticate(r){return this.data={...r},this.configuredMeasureEvent("twofa_send",{id_site:this.config.id_site,...this.config.id_site?{}:{id_request:this.config.id_request}}),this.loading=!0,this.connection==="eai_otp_GO3"?this.sendBbvaNetcashUsbToken():this.http.post(this.config.address,{twofa:{...this.data}}).then(n=>(this.emit("login-success"),n)).catch(n=>(this.loading=!1,this.emit("twofa-api-error"),Promise.reject(n)))}defineRules(r){this.rulesDefined||(this.rulesDefined=!0,this.config.twofa.forEach(n=>{Object.defineProperty(this.rules,n.name,{value:this.setRules(n,r)})}))}getFields(){return this.config.twofa.filter(r=>r.type!=="challenge"&&r.type!=="connection")}statusChanged(){this.loading||(this.loading=!0)}configuredMeasureEvent(r,n){this.measureEvents&&Ln(r,n)}connectSantanderUsbToken(){this.config.id_site==="57f6dd8c78480602048b4567"&&this.config.twofa[0].type==="instructions"&&Ope(this.config.twofa[0].imgBase64File).then(r=>{this.authenticate(r)}).catch(r=>{this.emit("twofa-api-error"),this.emit("twofa-device-error",r)})}findTwofaByName(r){return this.config.twofa.find(n=>n.name===r)}findTwofaByType(r){return this.config.twofa.find(n=>n.type===r)}handleBbvaNetcashConnections(){this.connection==="eai_otp_GO3"&&this.setBbvaNetcashUsbFields(),this.findTwofaByType("authentication_type")&&this.sendBbvaNetcashBluetoothTimeChallenge(),this.config.id_site==="57239fae78480601038b4567"&&!this.connection&&this.findTwofaByType("challenge")&&this.sendBbvaNetcashBluetoothSecondToken()}sendBbvaNetcashBluetoothSecondToken(){const r=JSON.parse(this.findTwofaByType("challenge").label),n=this.findTwofaByName("token").label;this.displaySubmitButton=!1,this.config.twofa=[{label:n,name:"token",type:"instructions"}],IU(r).then(a=>{this.authenticate({challenge:a,token:a})})}sendBbvaNetcashBluetoothTimeChallenge(){const r=this.findTwofaByType("authentication_type").label,n=this.findTwofaByName("token").label;this.displaySubmitButton=!1,this.config.twofa=[{label:n,name:"token",type:"instructions"}],kU(r).then(a=>{this.authenticate({authentication_type:"authentication_type",token:a})})}sendBbvaNetcashUsbToken(){return TU(this.data.token,this.data.challenge).then(r=>this.http.post(this.config.address,{twofa:{...this.data,...r,bluetooth_device:"bluetooth_device",challenge:"challenge",connection:"connection"}}).then(n=>(this.emit("login-success"),n)).catch(n=>(this.loading=!1,this.emit("twofa-api-error"),Promise.reject(n)))).catch(r=>(this.loading=!1,this.emit("twofa-api-error"),Promise.reject(r.response?{...r,response:{...r.response,status:500}}:r)))}setBbvaNetcashUsbFields(){this.config.twofa=[this.findTwofaByType("text")]}setRules(r,n){const a=[];return a.push({required:!0,message:n("form_errors.required",{label:r.label})}),r.validation&&r.validation.forEach(i=>{switch(i.type){case"text":break;case"regex":a.push({pattern:i.value,message:i.error_message});break}}),a}}class MAe extends ys.EventEmitter{constructor(r,n,a,i,o=!1){super();kt(this,"loading",!1);kt(this,"response");kt(this,"_config");kt(this,"_error");kt(this,"_message");kt(this,"_status","searching");kt(this,"_twofa");kt(this,"http");kt(this,"isSocketOpen",!1);kt(this,"options",{});kt(this,"socket");kt(this,"socketOpened",!1);kt(this,"socketTimeoutAfterError");kt(this,"timer",null);this.syncService=n,this.httpService=a,this.socketTimeoutTime=i,this.isHeadless=o,this.http=this.httpService.getInstance(),this.getSitefromCredential({id_credential:r}).then(({site:l,credential:u})=>{this.config={...u,avatar:l.organizationSite.avatar,cover:l.organizationSite.cover,name:l.name,quickAnswer:this.syncService.quickAnswer,site:l},this.status="found",this.sync().then(()=>{this.status="loading"}).catch(c=>{this.error=c,this.status="error"})}).catch(l=>{this.error=l,this.status="not-found"})}get config(){return this._config}set config(r){this._config=r}get error(){return this._error}set error(r){this._error=r}get message(){return this._message}set message(r){this._message=r}get status(){return this._status}set status(r){const n=this._status!==r;this._status=r,n&&(this.emit(r),this.emit("status-updated",r))}get twofa(){return this._twofa}set twofa(r){this._twofa=r,r&&(this.status="twofa",r.on("loading",()=>{this._twofa===r&&this.status==="twofa"&&(this.status="twofa-loading")}),r.on("twofa-api-error",()=>{this.status="twofa-api-error",this.socketClose()}))}getAvatar(){return this.config.avatar}getCover(){return this.config.cover}getCredentialData(){return{...this.config}}getName(){return this.config.name}getSite(){return{...this.config.site}}setOption(r,n){this.options[r]=n}sync(){return this.configuredMeasureEvent("sync_credential",{id_credential:this.config.id_credential,id_site:this.config.id_site}),this.loading=!0,this.startTimer(),this.http.put(`/v1/credentials/${this.config.id_credential}/sync`,{...this.spreadOptions()}).then(r=>(this.response=r,this.setSocket(r.ws),r)).catch(r=>(this.loading=!1,this.configuredMeasureEvent("sync_credential_error",{code:r.response.status,code_origin:"endpoint",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.clearTimer(),Promise.reject(r)))}clearTimer(){clearTimeout(this.timer)}configuredMeasureEvent(r,n){this.isHeadless||Ln(r,n)}getSitefromCredential(r){return this.http.get("/v1/credentials",{params:{...this.syncService.defaultParams,...r}}).then(n=>r.id_credential&&!n.length?Promise.reject({response:{status:"credential_not_found"}}):this.syncService.getOrganizationSites({id_site_organization:n[0].id_site_organization}).then(a=>{if(r.id_credential&&!a.length)return Promise.reject({response:{status:"credential_not_found"}});let i=a[0].sites.find(o=>o.id_site===n[0].id_site);if(i)i={...i};else return Promise.reject({response:{status:"credential_not_found"}});return i.organizationSite=a[0],{site:i,credential:n[0]}}).catch(a=>Promise.reject(a)))}reopenSocket(r){this.isSocketOpen=!1,this.socketTimeoutAfterError||this.setSocket(r.target.url)}reopenSocketAfterError(){if(!this.socketTimeoutAfterError){this.socketTimeoutAfterError=new Date().getTime()+12e4,this.setSocket(this.response.ws);const r=setInterval(()=>{this.isSocketOpen?clearInterval(r):new Date().getTime()<this.socketTimeoutAfterError?(this.socket.close(),this.setSocket(this.response.ws)):(clearInterval(r),this.socket.close(),this.loading=!1,this.status="socket-error")},2e3)}}setSocket(r){this.socket=new WebSocket(r),this.socket.onclose=n=>this.reopenSocket(n),this.socket.onerror=()=>this.socketError(),this.socket.onmessage=n=>this.socketMessage(n),this.socket.onopen=()=>this.socketOpen()}socketClose(r){this.clearTimer(),this.socket.onclose=()=>{this.twofa=null,r&&r(this)},this.socket.close()}socketError(){this.isSocketOpen=!1,this.socketOpened?this.reopenSocketAfterError():(this.loading=!1,this.status="socket-error")}socketMessage(r){const n=JSON.parse(r.data);if(this.clearTimer(),this.config.quickAnswer&&n.code===102){this.socketClose(()=>{this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.status="socket-quick-answer"}),this.configuredMeasureEvent("sync_credential_success",{code:n.code,id_credential:this.config.id_credential,id_site:this.config.id_site});return}n.code===401&&this.configuredMeasureEvent("unauthorized",{id_site:this.config.id_site}),n.code===410&&(this.twofa=new wx({...n,id_site:this.config.id_site},this.httpService)),this.emit("socket-message",n),this.startTimer(),n.code===411&&this.configuredMeasureEvent("twofa_timeout",{id_site:this.config.id_site}),200<=n.code&&n.code<300||400<=n.code&&n.code<600&&n.code!==410?(this.loading=!1,this.twofa&&(this.twofa.loading=!1),n.code<300?(this.configuredMeasureEvent("sync_credential_success",{code:n.code,id_credential:this.config.id_credential,id_site:this.config.id_site}),this.message=n,this.status="success"):(this.configuredMeasureEvent("sync_credential_error",{code:n.code,code_origin:"socket",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.error=n,this.status="error"),this.socketClose()):this.twofa&&n.code!==410&&this.twofa.statusChanged()}socketOpen(){this.isSocketOpen=this.socketOpened=!0,this.socketTimeoutAfterError=void 0}socketTimeout(){this.status="socket-timeout",this.socketClose()}spreadOptions(){return Object.keys(this.options).length?{options:{...this.options}}:{}}startTimer(){this.timer=setTimeout(()=>{this.socketTimeout()},this.socketTimeoutTime)}}Ua.defaults.baseURL="https://sync.paybook.com";class ML extends ys.EventEmitter{constructor(r,n={}){super();kt(this,"baseURL");kt(this,"isStrict");kt(this,"jwk");this.token=r,n.baseURL&&(this.baseURL=Ua.defaults.baseURL=n.baseURL),this.isStrict=n.isStrict||!1,Ua.defaults.headers.common={"x-app-version":`sync-widget:${n.widgetVersion}:${yw.os.name}:${yw.os.version}`},Ua.interceptors.request.use(a=>(a.headers.Authorization=`Bearer ${this.token}`,a),function(a){return Promise.reject(a)}),Ua.interceptors.response.use(a=>a.data.response||a.data||a,a=>(a.response&&a.response.status===401&&this.emit("401"),Promise.reject(a)))}getInstance(){const r=Ua.create({baseURL:this.baseURL});return r.interceptors.request.use(n=>(n.headers.Authorization=`Bearer ${this.token}`,n),function(n){return Promise.reject(n)}),r.interceptors.response.use(n=>n.data.response||n.data||n,n=>(n.response&&n.response.status===401&&this.emit("401"),Promise.reject(n))),this.isStrict&&r.interceptors.request.use(n=>n.data?$B(n.data,this.jwk).then(a=>(n.data={jwe:a},Promise.resolve(n))):Promise.resolve(n),n=>Promise.reject(n)),r}updateToken(r,n){this.token=r,n&&(this.jwk=n)}}class CL extends ys.EventEmitter{constructor(r,n,a){super();kt(this,"config");kt(this,"response");kt(this,"testMode",!1);kt(this,"http");kt(this,"_finalResponse",null);kt(this,"_lastSocketMessage");kt(this,"_loading",!1);kt(this,"_status","start");kt(this,"_twofa");kt(this,"isSocketOpen",!1);kt(this,"options",{});kt(this,"socket");kt(this,"socketOpened",!1);kt(this,"socketTimeoutAfterError");kt(this,"timer",null);this.httpService=n,this.userConfig=a,this.config=r,this.http=n.getInstance()}get finalResponse(){return this._finalResponse}set finalResponse(r){this._finalResponse=r,this.status="finish"}get lastSocketMessage(){return this._lastSocketMessage}set lastSocketMessage(r){this._lastSocketMessage=r}get loading(){return this._loading}set loading(r){this._loading=r,r&&(this.status="loading")}get status(){return this._status}set status(r){const n=this._status!==r;this._status=r,n&&(this.emit(r),this.emit("status-update",r))}get twofa(){return this._twofa}set twofa(r){this._twofa=r,r&&(this.status="twofa",r.on("loading",()=>{this._twofa===r&&this.status==="twofa"&&(this.status="twofa-loading")}))}setOption(r,n){this.options[r]=n}toggleTestMode(){this.testMode=!this.testMode}configuredMeasureEvent(r,n){this.userConfig.isHeadless||Ln(r,n)}clearTimer(){clearTimeout(this.timer)}reopenSocket(r){this.setSocket(r.target.url)}setRules(r){const n=[];return r.required&&n.push({required:!0,message:"required"}),r.validation&&r.validation.forEach(a=>{switch(a.type){case"text":break;case"regex":n.push({pattern:a.value,message:"regex"});break}}),n}setSocket(r){this.socket=new WebSocket(r),this.socket.onclose=n=>this.reopenSocket(n),this.socket.onerror=()=>this.socketError(),this.socket.onmessage=n=>this.socketMessage(n),this.socket.onopen=()=>this.socketOpen()}reopenSocketAfterError(){if(!this.socketTimeoutAfterError){this.socketTimeoutAfterError=new Date().getTime()+12e4,this.setSocket(this.response.ws);const r=setInterval(()=>{this.isSocketOpen?clearInterval(r):new Date().getTime()<this.socketTimeoutAfterError?(this.socket.close(),this.setSocket(this.response.ws)):(clearInterval(r),this.socket.close(),this.loading=!1,this.emit("socket-error"),this.finalResponse="error")},2e3)}}socketClose(r){this.clearTimer(),this.socket.onclose=n=>{this.twofa=null,this.emit("socket-close",n),r&&r(this)},this.socket.close()}socketError(){this.isSocketOpen=!1,this.socketOpened?this.reopenSocketAfterError():(this.loading=!1,this.emit("socket-error"),this.finalResponse="error")}socketMessage(r){const n=JSON.parse(r.data);if(this.lastSocketMessage=n,this.clearTimer(),this.config.quickAnswer&&n.code===102){this.socketClose(()=>{this.finalResponse="success",this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.emit("socket-quick-answer")}),this.configuredMeasureEvent("sync_success",{code:n.code,id_site:this.config.id_site});return}n.code===401&&this.configuredMeasureEvent("unauthorized",{id_site:this.config.id_site}),n.code===410&&(this.twofa=new wx({...n,id_site:this.config.id_site},this.httpService,!this.userConfig.isHeadless),this.emit("twofa",this.twofa),this.twofa.on("twofa-api-error",()=>{this.socketClose()})),this.emit("socket-message",n),this.startTimer(),n.code===411&&this.configuredMeasureEvent("twofa_timeout",{id_site:this.config.id_site}),(200<=n.code&&n.code<300||400<=n.code&&n.code<600&&n.code!==410)&&(n.code<300?(this.finalResponse="success",this.configuredMeasureEvent("sync_success",{code:n.code,id_site:this.config.id_site})):(this.finalResponse="error",this.configuredMeasureEvent("sync_error",{code:n.code,code_origin:"socket",id_site:this.config.id_site})),this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.socketClose()),!(400<=n.code&&n.code<600&&n.code!==410||200<=n.code&&n.code<300)&&this.twofa&&n.code!==410&&(this.twofa.loading=!0,this.status="twofa-loading")}socketOpen(){this.isSocketOpen=this.socketOpened=!0,this.socketTimeoutAfterError=void 0}socketTimeout(){this.socketClose(()=>{this.finalResponse="error",this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.emit("socket-timeout")})}spreadOptions(){return Object.keys(this.options).length?{options:{...this.options}}:{}}startTimer(){this.timer=setTimeout(()=>{this.socketTimeout()},this.userConfig.socketTimeoutTime)}}class CAe extends CL{constructor(r,n,a,i){super(r,n,i);kt(this,"data",{});kt(this,"rules",{});if(this.defaultParams=a,this.userConfig=i,r.credentials&&r.credentials.length)i.isHeadless||r.credentials.forEach(o=>{const l=o.name;Object.defineProperty(this.rules,l,{enumerable:!0,value:this.setRules(o)})});else throw new Error("Site credentials are required.")}get version(){return 1}connect(r){this.data={...r};const n={...this.defaultParams,id_site:this.config.id_site,credentials:{...this.data},...this.spreadOptions()};return this.config.request?Promise.resolve(n.credentials):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(n.save_credential=this.userConfig.saveCredential),this.testMode&&(n.test=1),this.startTimer(),this.http.post(this.config.endpoint,n).then(a=>(this.response=a,this.emit("login-success"),this.setSocket(a.ws),a)).catch(a=>(this.configuredMeasureEvent("sync_error",{code:a.response?a.response.status:a.toString(),code_origin:"endpoint",id_site:this.config.id_site}),this.loading=!1,this.status="start",this.clearTimer(),Promise.reject(a))))}getFields(){return this.config.credentials}}class TAe extends CL{constructor(r,n,a,i){super(r,n,i);kt(this,"input",[]);this.defaultParams=a,this.userConfig=i,r.input.forEach(o=>{const l={rules:{},data:{}};o.fields.forEach(u=>{const c=u.name;Object.defineProperty(l.rules,c,{enumerable:!0,value:this.setRules(u)}),l.data[c]=null}),this.input.push(l)})}get version(){return 3}connect(r,n){this.updateData(r,n);const a=r||0,i={...this.defaultParams,id_site:this.config.id_site,input_name:this.config.input[r].name,input:{...this.input[a].data},...this.spreadOptions()};return this.config.request?Promise.resolve(i.input):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(i.save_credential=this.userConfig.saveCredential),this.testMode&&(i.test=1),this.startTimer(),this.http.post(this.config.endpoint,i).then(o=>(this.response=o,this.emit("login-success"),this.setSocket(o.ws),o)).catch(o=>(this.configuredMeasureEvent("sync_error",{code:o.response?o.response.status:o.toString(),code_origin:"endpoint",id_site:this.config.id_site}),this.loading=!1,this.status="start",this.clearTimer(),Promise.reject(o))))}getFields(r){return this.config.input[r].fields}getOptions(){return this.config.input}updateData(r,n){this.input[r].data={...n}}}class TL extends ys.EventEmitter{constructor(r,n){super();kt(this,"http");kt(this,"httpService");this.token=r,this.config=n,this.httpService=n.http?new ML(r,{...n.http,widgetVersion:n.widgetVersion}):new ML(r,{widgetVersion:n.widgetVersion}),this.http=this.httpService.getInstance(),this.httpService.on("401",this.debounce401())}get defaultParams(){return this.config.defaultParams}set defaultParams(r){this.config.defaultParams=r}get quickAnswer(){return this.config.quickAnswer}getAccounts(r){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/accounts",{params:{...this.config.defaultParams,...r}})}getCountries(){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/countries",{params:{...this.config.defaultParams}})}getHttpService(){return this.httpService}getOrganizationSites(r){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/organizations/sites",{params:{...this.config.defaultParams,...r}})}getOrganizationTypes(){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/site_organization_types",{params:{...this.config.defaultParams}})}getSite(r){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get(`/v1/catalogues/widget/sites/${r}`,{params:{...this.config.defaultParams}})}siteConnection(r){switch(r.version){case 3:return new TAe({...r,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout});default:return new CAe({...r,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout})}}strictMode({token:r,strict:n}){return this.token=r,Npe(n).then(({strictAuthorizationKey:a,strictBodyKey:i})=>DB({token:r},a).then(o=>(this.httpService.updateToken(o),kpe().then(({authorization:l})=>{const u={authorization:btoa(JSON.stringify(l.toJSON(!0)))};return $B(u,i).then(c=>this.updateStrictSession(r,o,c).then(()=>DB({token:r},l).then(d=>this.updateToken(d).then(()=>(this.httpService.updateToken(this.token,i),{jws:d,jwe:i})))))}))))}syncCredential(r){return new MAe(r,this,this.httpService,this.config.socketTimeout,this.config.isHeadless)}updateApiBaseUrl(r){this.http.defaults.baseURL=r,Ua.defaults.baseURL=r}updateEnvironment(r){switch(r){case"production":this.http.defaults.baseURL="https://sync.paybook.com",Ua.defaults.baseURL="https://sync.paybook.com";break;case"development":this.http.defaults.baseURL="https://api.syncfy.paybook.dev",Ua.defaults.baseURL="https://api.syncfy.paybook.dev";break;default:this.http.defaults.baseURL="https://sync.paybook.com",Ua.defaults.baseURL="https://sync.paybook.com";break}}updateToken(r){return new Promise(n=>{this.token!==r&&(this.token=r,this.httpService.updateToken(this.token)),n({token:r})})}debounce401(){return SL(200,()=>{this.emit("sync_401")})}updateStrictSession(r,n,a){return Ua.put(`/v1/sessions/jwt/${r}`,{type:"jwt","payload/jwe":a},{headers:{Authorization:`Bearer ${n}`}})}}class Ex{constructor(t){kt(this,"callback");kt(this,"messages");this.messages=t}getMessages(){return this.messages}subscribe(t){this.callback=t}updateMessages(t){this.messages={...this.messages,...t},this.callback&&this.callback()}}const DBe="",AAe=["aria-label"],IAe={key:1},BAe=["aria-label"],kAe={key:0},NAe=li(rt({__name:"DataWidget",props:{client:{},enableTestMode:{type:Boolean},entrypoint:{},internal:{},locale:{},navigation:{},refreshTokenFunction:{type:Function},strict:{},token:{}},emits:["tokenRefreshed"],setup(e,{expose:t,emit:r}){const n=e,a=Et(ia),{t:i,locale:o}=Ba({useScope:"global"}),{mobile:l}=ix(),u=Oe([]),c=Oe(null),d=Oe(null),v=Oe(!1),m=Oe(null),b=Oe(null),_=Oe(""),S=Oe(""),T=Oe(n.navigation.displayPrivacyScreen),C=Oe(!0),I=Oe(!1),B=Oe(null),N=Oe([]),O=Oe(null),P=Oe(!1),L=Oe(null),$=Oe(null),z=Oe(!1);let K="https://s.paybook.com",M=null,s=`${Nd()}${n.strict?"-strict":""}`,h=null,p,g=[],y=null,w=null,A=null;const E=be(()=>C.value?!1:L.value?n.entrypoint.site&&n.navigation.oneSiteFlow?L.value==="twofa"||n.navigation.displayPrivacyScreen:L.value==="finish"?n.navigation.enableBackNavigation:L.value==="twofa"?n.navigation.enableTwofaBackNavigation:n.navigation.enableBackNavigation&&L.value==="start":!!O.value||n.navigation.displayPrivacyScreen),f=be(()=>u.value.filter(ce=>(ce.id_country==="51ad44db3b8e77631200047d"||ce.id_country==="51ad44793b8e77631200027a")&&n.internal.plaidSites||le(ce.id_country).length).sort((ce,_e)=>ce.name.localeCompare(_e.name))),x=be(()=>ie(c.value,O.value)),k=be(()=>le(c.value)),R=be(()=>V(c.value,O.value,B.value)),q=be(()=>({short:S.value,long:_.value})),J=be(()=>{let ce=[];return N.value&&N.value.forEach(_e=>{ce=[...ce,..._e.sites.map(it=>({...it,avatar:_e.avatar,cover:_e.cover,organizationSite:_e}))]}),ce}),W=be(()=>v.value||I.value?"":P.value?i("accounts_selection.title"):L.value?L.value==="start"?i("common.header.login"):"":O.value?c.value&&O.value?i("common.header.select"):"":i("common.header.link"));dt(()=>n.locale,(ce,_e)=>{ce!==_e&&["es","en"].includes(ce)&&(o.value=ce)}),dt(()=>n.internal,(ce,_e)=>{if(A.defaultParams=ce.defaultHttpParams||{},A.defaultParams.locale=n.locale,ce.apiEnv!==_e.apiEnv)switch(A.updateEnvironment(ce.apiEnv),ce.apiEnv){case"production":K="https://s.paybook.com";break;case"development":K="https://s.paybook.dev";break;default:K="https://s.paybook.com";break}ce.apiBaseUrl!==_e.apiBaseUrl&&ce.apiBaseUrl&&A.updateApiBaseUrl(ce.apiBaseUrl),ce.assetsBaseUrl!==_e.assetsBaseUrl&&ce.assetsBaseUrl&&(K=ce.assetsBaseUrl),U()}),dt(()=>n.navigation.displayPersonalSites,()=>{U()}),dt(()=>n.navigation.displayBusinessSites,()=>{U()}),dt(S,ce=>{h&&p.updateMessages({short:ce})}),dt(_,ce=>{h&&p.updateMessages({long:ce})}),dt(z,()=>{!z.value&&!h&&L.value&&L.value!=="start"&&L.value!=="finish"?(p=new Ex({short:_.value}),h=on.info({duration:0,message:Ot(hn,{assetsPath:K,buttonDisabledStyle:n.navigation.formButtonsDisabledStyle,disableFormAutocomplete:n.navigation.disableFormAutocomplete,duration:0,enableBackNavigation:n.navigation.enableTwofaBackNavigation,item:y,messagesUpdater:p,rootEmit:a,selectClass:n.navigation.selectClass,showLogo:n.navigation.displayLogoImages,showPasswordStyle:n.navigation.formShowPasswordStyle,t:i,type:"info",onBack:()=>{a("back"),te(),y=L.value=null,G(w,!1),z.value=!0},onError:ce=>{he(ce)},onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),position:n.navigation.toastPosition,showClose:!1})):z.value&&h&&(z.value=!1,on.error({duration:0,position:n.navigation.toastPosition,message:Ot(hn,{duration:0,initMessage:i("common.process_running"),initTitle:i("common.error"),showLogo:!1,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}})}))}),lr(()=>{Xt(()=>{a("dom-updated")})}),xh(()=>{Xt(()=>{a("dom-updated")})});function X(){["es","en"].includes(n.locale)&&(o.value=n.locale),K=n.internal.apiEnv?n.internal.apiEnv==="production"?"https://s.paybook.com":"https://s.paybook.dev":"https://s.paybook.com",n.internal.assetsBaseUrl&&(K=n.internal.assetsBaseUrl),n.strict?(Je(),C.value=!0,setTimeout(()=>{A.strictMode({token:n.token,strict:n.strict}).then(()=>{U()})},400)):(Je(),U())}function ae(){Ln("close"),z.value=!1,(L.value==="start"||L.value==="finish")&&(L.value=y=null),a("closed")}function te(){h&&(h.close(),h=null)}function he(ce){const _e=D(ce);!n.navigation.displayErrorsInToast&&z?(m.value=i(`${_e}long_description`),b.value=i(`${_e}short_description`)):on.error({position:n.navigation.toastPosition,message:Ot(hn,{displayLongDescription:n.navigation.displayLongDescription,duration:0,initLongMessage:i(`${_e}long_description`),initMessage:i(`${_e}short_description`),initTitle:i("common.error"),showLogo:!1,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0}),Z(ce,_e)}const re=SL(200,function(){if(v.value=!1,n.entrypoint.credential)return me(n.entrypoint.credential,!0);if(n.entrypoint.site&&n.navigation.oneSiteFlow)A.getSite(n.entrypoint.site).then(ce=>{if(a("loaded"),ce&&ce.length){const _e=ce[0].site_organization;G({...ce[0],avatar:_e.avatar,cover:_e.avatar,organizationSite:_e})}else se({response:{status:"site_not_found"}})}).catch(se).finally(()=>{C.value=!1});else{const ce={};B.value=null,(n.navigation.displayPersonalSites||n.navigation.displayBusinessSites)&&!(n.navigation.displayPersonalSites&&n.navigation.displayBusinessSites)&&(n.navigation.displayPersonalSites?ce.is_personal=1:ce.is_business=1);const _e=[A.getCountries(),A.getOrganizationTypes(),A.getOrganizationSites(ce)];return Promise.all(_e).then(it=>{u.value=it[0],g=it[1],n.internal.plaidSites&&g.unshift({id_site_organization_type:"__internal__.plaidSites",label:"webapp_add_banks",name:"plaid"}),N.value=it[2]}).then(()=>Xt().then(()=>{if(a("loaded"),oe(),n.entrypoint.site){const it=J.value.find(Ee=>Ee.id_site===n.entrypoint.site);return it?G(it):Promise.reject({response:{status:"site_not_found"}})}})).catch(se).finally(()=>{C.value=!1})}});function Z(ce,_e){a("api-error",ce.response?ce.response.status:500,{longMessage:i(`${_e}real.long_description`),message:i(`${_e}real.short_description`),noInternet:!ce.response})}function j(ce){a("socket-error",{longMessage:i(`socket.${ce}.long_description`),type:ce,message:i(`socket.${ce}.short_description`)})}function ie(ce,_e){return(n.navigation.displaySiteOrganizations.length||n.navigation.hideSiteOrganizations.length?N.value.filter(it=>{if(n.navigation.displaySiteOrganizations.length)return!!n.navigation.displaySiteOrganizations.find(Ee=>Ee===it.name||Ee===it.id_site_organization);if(n.navigation.hideSiteOrganizations.length)return!n.navigation.hideSiteOrganizations.find(Ee=>Ee===it.name||Ee===it.id_site_organization)}):N.value).filter(it=>ce===it.id_country&&_e===it.id_site_organization_type&&V(ce,_e,it.id_site_organization).length)}function le(ce){return(n.navigation.displaySiteOrganizationTypes.length||n.navigation.hideSiteOrganizationTypes.length?g.filter(_e=>{if(n.navigation.displaySiteOrganizationTypes.length)return!!n.navigation.displaySiteOrganizationTypes.find(it=>it===_e.name||it===_e.id_site_organization_type);if(n.navigation.hideSiteOrganizationTypes.length)return!n.navigation.hideSiteOrganizationTypes.find(it=>it===_e.name||it===_e.id_site_organization_type)}):g).filter(_e=>(ce==="51ad44db3b8e77631200047d"||ce==="51ad44793b8e77631200027a")&&n.internal.plaidSites&&_e.id_site_organization_type==="__internal__.plaidSites"?!0:ie(ce,_e.id_site_organization_type).length)}function V(ce,_e,it){return(n.navigation.displaySites.length||n.navigation.hideSites.length?J.value.filter(Ee=>{if(n.navigation.displaySites.length)return!!n.navigation.displaySites.find(Ae=>Ae===Ee.name||Ae===Ee.id_site);if(n.navigation.hideSites.length)return!n.navigation.hideSites.find(Ae=>Ae===Ee.name||Ae===Ee.id_site)}):J.value).filter(Ee=>ce===Ee.organizationSite.id_country&&_e===Ee.organizationSite.id_site_organization_type&&it===Ee.organizationSite.id_site_organization)}function D(ce){return typeof ce=="string"?ce:ce.response&&ce.response.data&&ce.response.data.message==="Credential error, please consider updating credential password"?"api_errors.credential_error.":`api_errors.${ce.response?ce.response.status?ce.response.status:500:"no_internet"}.`}function F(){if(!L.value)B.value?ne():O.value?(a("back"),O.value=null):(a("back"),T.value=!0);else if(L.value==="finish")fe();else if(L.value==="twofa")et();else return Me()}function U(){C.value=!0,re()}function se(ce){const _e=D(ce);v.value=i(`${_e}short_description`),!ce.response&&n.navigation.displayErrorsInToast&&on.error({position:n.navigation.toastPosition,message:Ot(hn,{duration:0,initLongMessage:i(`${_e}long_description`),initMessage:i(`${_e}short_description`),showLogo:!1,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0}),a("loaded"),Z(ce,_e)}function Q(){Ln("open"),C.value||oe(),z.value=!0,a("opened")}function ne(){a("back"),B.value=null}function fe(){L.value=B.value=y=null}function H(ce){a("organization-selected",ce),Ln("open_site_organization",{id_site_organization:ce.id_site_organization}),B.value=ce.id_site_organization,Xt(()=>{R.value.length===1&&G(R.value[0])})}function G(ce,_e=!0){let it;_e&&(a("organization-site-selected",ce),Ln("open_site",{id_site:ce.id_site})),!y||!y.loading?(w=ce,it=y=A.siteConnection(ce),L.value="start",b.value=null,m.value=null,y.on("login-success",()=>{z.value&&n.navigation.displayStatusInToast&&ae()}),y.on("socket-close",te),y.on("socket-error",()=>{n.navigation.displayErrorsInToast?on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,duration:0,hideForm:!0,initLongMessage:i("socket.error.long_description"),initMessage:i("socket.error.short_description"),item:y,showLogo:n.navigation.displayLogoImages,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0}):(m.value=i("socket.error.long_description"),b.value=i("socket.error.short_description")),j("error")}),y.on("socket-message",Ee=>{const Ae=`socket.message.${Ee.code?Ee.code:500}.`,mt=i(`${Ae}short_description`),ke=i(`${Ae}long_description`);switch(!0){case(400<=Ee.code&&Ee.code<600&&Ee.code!==410):te(),b.value=mt,m.value=ke,a("error",y.response,{code:Ee.code,longMessage:ke,message:mt}),z.value?n.navigation.returnToSiteFormOnUserError!==!1&&(n.navigation.returnToSiteFormOnUserError===!0&&[401,403,411].includes(Ee.code)||n.navigation.returnToSiteFormOnUserError!==!0&&n.navigation.returnToSiteFormOnUserError.includes(Ee.code))&&(L.value=y=null,G(w,!1),$.value={short:mt,long:ke}):(on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:ke,initMessage:mt,item:y,showLogo:n.navigation.displayLogoImages,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0}),fe(),oe());break;case(200<=Ee.code&&Ee.code<300):te(),b.value=mt,m.value=ke,a("success",y.response),z.value||(on.success({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:n.navigation.toastDuration,hideForm:!0,initLongMessage:ke,initMessage:mt,item:y,showLogo:n.navigation.displayLogoImages,t:i,type:"success",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:n.navigation.toastDuration}),fe(),oe());break;default:S.value=mt,_.value=ke}a("status",Ee)}),y.on("socket-quick-answer",()=>{b.value=i("socket.quick_answer.short_description"),m.value=i("socket.quick_answer.long_description"),a("success",y.response),te(),z.value||(on.success({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:n.navigation.toastDuration,hideForm:!0,initLongMessage:i("socket.quick_answer.long_description"),initMessage:i("socket.quick_answer.short_description"),item:y,showLogo:n.navigation.displayLogoImages,t:i,type:"success",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:n.navigation.toastDuration}),fe(),oe())}),y.on("socket-timeout",()=>{b.value=i("socket.timeout.short_description"),m.value=i("socket.timeout.long_description"),a("error",y.response),z.value||(on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:i("socket.timeout.long_description"),initMessage:i("socket.timeout.short_description"),item:y,showLogo:n.navigation.displayLogoImages,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0}),fe(),oe()),j("timeout")}),y.on("status-update",Ee=>{y===it&&(L.value=Ee)}),y.on("twofa",()=>{S.value=i("twofa.waiting")})):on.error({position:n.navigation.toastPosition,message:Ot(hn,{duration:0,initMessage:i("common.process_running"),initTitle:i("common.error"),showLogo:!1,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})}function me(ce,_e=!1){if(Ln("open_credential",{id_credential:ce}),!M||!M.loading){let it=new Ex({short:i("credential.search.title")}),Ee;n.navigation.displayCredentialInModal?(a("opened"),d.value={loaderType:"loading",loading:!0,messages:{short:i("credential.search.title"),long:i("credential.search.message")}}):Ee=on.info({showClose:!1,position:n.navigation.toastPosition,duration:0,message:Ot(hn,{assetsPath:K,duration:0,initTitle:i("credential.search.title"),messagesUpdater:it,showLogo:!1,t:i,type:"info",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}})}),M=A.syncCredential(ce),M.on("error",()=>{const{code:Ae}=M.error,mt=M.error.response?D(M.error):`socket.message.${Ae||500}.`,ke=i(`${mt}short_description`),Ue=i(`${mt}long_description`);n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"error",messages:{short:ke,long:Ue}}:(M.error.response?Ee.close():te(),on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:Ue,initMessage:ke,item:M,showLogo:n.navigation.displayLogoImages,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})),M.error.response?Z(M.error,mt):a("error",M.response,{code:Ae,longMessage:Ue,message:ke})}),M.on("found",()=>{_e&&a("loaded"),n.navigation.displayCredentialInModal?d.value={...d.value,avatar:n.navigation.displayLogoImages?`${K}${M.config.avatar}`:void 0,messages:{short:i("credential.found.title"),long:i("credential.found.message")}}:it.updateMessages({short:i("credential.found.message")})}),M.on("loading",()=>{a("updated",M.response),n.navigation.displayCredentialInModal?d.value={...d.value,messages:{short:i("credential.loading.title"),long:i("credential.loading.message")}}:(Ee.close(),p=new Ex({}),h=on.info({showClose:!1,position:n.navigation.toastPosition,duration:0,message:Ot(hn,{assetsPath:K,buttonDisabledStyle:n.navigation.formButtonsDisabledStyle,disableFormAutocomplete:n.navigation.disableFormAutocomplete,duration:0,item:M,messagesUpdater:p,rootEmit:a,selectClass:n.navigation.selectClass,showLogo:n.navigation.displayLogoImages,showPasswordStyle:n.navigation.formShowPasswordStyle,t:i,type:"info",onError:Ae=>{te(),he(Ae)},onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}})}))}),M.on("not-found",()=>{const Ae=D(M.error);_e&&a("loaded"),n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"error",messages:{short:i(`${Ae}short_description`),long:i(`${Ae}long_description`)}}:(Ee.close(),on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:i(`${Ae}long_description`),initMessage:i(`${Ae}short_description`),t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})),Z(M.error,Ae)}),M.on("socket-error",()=>{n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"error",messages:{short:i("socket.error.short_description"),long:i("socket.error.long_description")}}:(te(),on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:0,initLongMessage:i("socket.error.long_description"),initMessage:i("socket.error.short_description"),item:M,hideForm:!0,showLogo:n.navigation.displayLogoImages,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})),j("error")}),M.on("socket-message",Ae=>{const mt=`socket.message.${Ae.code?Ae.code:500}.`,ke=i(`${mt}short_description`),Ue=i(`${mt}long_description`);n.navigation.displayCredentialInModal?d.value={...d.value,messages:{short:ke,long:Ue}}:p.updateMessages({long:Ue,short:ke}),a("status",Ae)}),M.on("socket-quick-answer",()=>{b.value=i("socket.quick_answer.short_description"),m.value=i("socket.quick_answer.long_description"),a("success",M.response),n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"success",messages:{short:i("socket.quick_answer.short_description"),long:i("socket.quick_answer.long_description")}}:(te(),on.success({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:n.navigation.toastDuration,initLongMessage:i("socket.quick_answer.long_description"),initMessage:i("socket.quick_answer.short_description"),item:M,hideForm:!0,showLogo:n.navigation.displayLogoImages,t:i,type:"success",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:n.navigation.toastDuration}))}),M.on("socket-timeout",()=>{n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"error",messages:{short:i("socket.timeout.short_description"),long:i("socket.timeout.long_description")}}:(te(),on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:i("socket.timeout.long_description"),initMessage:i("socket.timeout.short_description"),item:M,showLogo:n.navigation.displayLogoImages,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})),a("error",M.response),j("timeout")}),M.on("success",()=>{const{code:Ae}=M.message,mt=`socket.message.${Ae||500}.`,ke=i(`${mt}short_description`),Ue=i(`${mt}long_description`);n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"success",messages:{short:ke,long:Ue}}:(te(),on.success({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:n.navigation.toastDuration,hideForm:!0,initLongMessage:Ue,initMessage:ke,item:M,showLogo:n.navigation.displayLogoImages,t:i,type:"success",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:n.navigation.toastDuration})),a("success",M.response)}),M.on("twofa",()=>{d.value={...d.value,loading:!1}}),M.on("twofa-api-error",()=>{n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"error",messages:{short:i("credential.api_error.title"),long:i("credential.api_error.message")}}:te()}),M.on("twofa-loading",()=>{d.value={...d.value,loading:!0,loaderType:"loading",messages:{short:i("twofa.waiting"),long:i("twofa.waiting")}}})}else on.error({position:n.navigation.toastPosition,message:Ot(hn,{duration:0,initMessage:i("common.process_running"),initTitle:i("common.error"),showLogo:!1,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})}function oe(){if(v.value)return;let ce;n.entrypoint.country&&(ce=f.value.find(_e=>_e.code===n.entrypoint.country||_e.id_country===n.entrypoint.country)),f.value.length?(c.value=ce?ce.id_country:f.value[0].id_country,Ln("open_country",{id_country:c.value}),pe(),I.value=!1):I.value=!0}function pe(){if(n.entrypoint.siteOrganizationType){const ce=k.value.find(_e=>_e.id_site_organization_type===n.entrypoint.siteOrganizationType);if(ce){const _e=ce.id_site_organization_type;Ln("open_site_organization_type",{id_site_organization_type:_e}),O.value=_e}}}function Je(){A=new TL(n.token,{http:{baseURL:n.internal.apiBaseUrl?n.internal.apiBaseUrl:n.internal.apiEnv?n.internal.apiEnv==="production"?"https://sync.paybook.com":"https://api.syncfy.paybook.dev":"https://sync.paybook.com",isStrict:!!n.strict},defaultParams:{locale:n.locale,...n.internal.defaultHttpParams},isHeadless:!1,quickAnswer:n.navigation.quickAnswer,saveCredential:n.navigation.saveCredential,socketTimeout:n.navigation.socketTimeout,widgetVersion:s});let ce=null;A.on("sync_401",()=>{n.refreshTokenFunction&&!ce&&(ce=on.error({position:n.navigation.toastPosition,showClose:!1,message:Ot(J5e,{initTitle:i("common.unauthorized"),initMessage:i("common.unauthorized_message"),refreshTokenFunction:n.refreshTokenFunction,t:i,onClosed:()=>{ce=null},onCloseNotification:()=>{ce.close()},onRefreshToken:({token:_e,strict:it,resolve:Ee})=>{r("tokenRefreshed",_e),xe(_e,it).then(()=>(ce.close(),on.success({position:n.navigation.toastPosition,message:Ot(hn,{displayLongDescription:!1,duration:n.navigation.toastDuration,initMessage:i("common.session_refreshed_message"),initTitle:i("common.session_refreshed"),showLogo:!1,t:i,type:"success",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:n.navigation.toastDuration}),U(),Ee(null)))},onRefreshTokenError:()=>{on.error({position:n.navigation.toastPosition,message:Ot(hn,{displayLongDescription:!1,duration:0,initMessage:i("common.session_error"),initTitle:i("common.error"),showLogo:!1,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})}}),duration:0})),a("401")})}function xe(ce,_e){return _e?A.strictMode({token:ce,strict:_e}):A.updateToken(ce)}function Me(){a("back"),Ln("close_site",{id_site:y.config.id_site}),L.value=y=null,$.value=null,R.value.length===1&&(B.value=null)}function et(ce=!0){ce&&a("back"),L.value=y=null,G(w,!1)}return X(),t({close:ae,open:Q,setCredential:me,setToken:xe}),(ce,_e)=>(de(),Be(St,null,[_t($5e,{visible:z.value,"onUpdate:visible":_e[6]||(_e[6]=it=>z.value=it),mobile:Y(l)},{default:lt(()=>[z.value?(de(),Be("div",{key:0,class:Ce([ce.$style.container,{[ce.$style["is-mobile"]]:Y(l)}])},[T.value?(de(),nt(C5e,{key:0,client:n.client,onContinue:_e[0]||(_e[0]=()=>{T.value=!1})},null,8,["client"])):(de(),Be(St,{key:1},[Re("div",{class:Ce(ce.$style["widget-header"])},[E.value?(de(),Be("button",{key:0,"aria-label":Y(i)("common.back"),class:Ce(ce.$style["widget-back-button"]),onClick:F},[_t(Da,{icon:"back"})],10,AAe)):(de(),Be("span",IAe)),Re("h1",null,at(L.value&&n.entrypoint.site?Y(i)("common.update_title"):W.value),1),Re("button",{class:Ce(ce.$style["widget-close-button"]),"aria-label":Y(i)("common.close"),onClick:ae},[_t(Da,{icon:"close"})],10,BAe)],2),Re("div",{class:Ce(ce.$style["widget-content"])},[d.value?(de(),Be("div",{key:0,class:Ce([[ce.$style["credential-content"]],{[ce.$style["credential-twofa"]]:!d.value.loading}])},[d.value.loading?(de(),nt(ku,{key:0,avatar:d.value.avatar,grow:d.value.loaderType==="loading",message:d.value.messages.long,size:"large",title:d.value.messages.short,type:d.value.loaderType},null,8,["avatar","grow","message","title","type"])):Y(M).twofa?(de(),nt(nx,{key:1,avatar:d.value.avatar,"button-disabled-style":n.navigation.formButtonsDisabledStyle,cover:`${Y(K)}${Y(M).config.cover}`,"disable-form-autocomplete":n.navigation.disableFormAutocomplete,"enable-back-navigation":!1,"in-notification":!1,"loader-message":q.value,"select-class":n.navigation.selectClass,"show-logo":n.navigation.displayLogoImages,"show-password-style":n.navigation.formShowPasswordStyle,"site-name":Y(M).config.name,twofa:Y(M).twofa},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])):Ye("",!0),d.value.loaderType!=="loading"?(de(),Be("button",{key:2,class:"pb-w-sync_primary-button",onClick:ae},at(Y(i)("common.finish")),1)):Ye("",!0)],2)):(de(),Be(St,{key:1},[C.value?(de(),nt(ku,{key:0})):Ye("",!0),!C.value&&!v.value&&!I.value?(de(),Be(St,{key:1},[L.value?(de(),Be(St,{key:1},[L.value==="start"||L.value==="loading"?(de(),nt(P5e,{key:0,"assets-path":Y(K),"button-disabled-style":n.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":n.navigation.disableFormAutocomplete,"error-message":$.value,"loader-message":q.value,"select-class":n.navigation.selectClass,"show-logo":n.navigation.displayLogoImages,"show-password-style":n.navigation.formShowPasswordStyle,site:Y(y),"test-mode":ce.enableTestMode,onBack:Me,onError:he,onSuccess:_e[3]||(_e[3]=()=>{S.value=Y(i)("site.login.success")}),onValid:_e[4]||(_e[4]=()=>{S.value=Y(i)("site.login.authenticating"),$.value=null})},null,8,["assets-path","button-disabled-style","disable-form-autocomplete","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):Ye("",!0),L.value==="twofa"||L.value==="twofa-loading"?(de(),nt(nx,{key:1,avatar:`${Y(K)}${Y(y).config.avatar}`,"button-disabled-style":n.navigation.formButtonsDisabledStyle,cover:`${Y(K)}${Y(y).config.cover}`,"disable-form-autocomplete":n.navigation.disableFormAutocomplete,"enable-back-navigation":n.navigation.enableTwofaBackNavigation,"in-notification":!1,"loader-message":q.value,"select-class":n.navigation.selectClass,"show-logo":n.navigation.displayLogoImages,"show-password-style":n.navigation.formShowPasswordStyle,"site-name":Y(y).config.name,twofa:Y(y).twofa,onBack:et,onError:he},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","enable-back-navigation","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])):Ye("",!0),L.value==="finish"?(de(),Be(St,{key:2},[P.value?(de(),nt(l5e,{key:0,avatar:n.navigation.displayLogoImages?`${Y(K)}${Y(y).config.avatar}`:void 0,"button-disabled-style":n.navigation.formButtonsDisabledStyle,client:n.client,credential:Y(y).response.id_credential,"disable-form-autocomplete":n.navigation.disableFormAutocomplete,"select-class":n.navigation.selectClass,sync:Y(A),onDone:ae},null,8,["avatar","button-disabled-style","client","credential","disable-form-autocomplete","select-class","sync"])):(de(),nt(u5e,{key:1,avatar:`${Y(K)}${Y(y).config.avatar}`,"display-accounts-selection":n.navigation.displayAccountsSelection,"long-message":m.value,message:b.value,"one-site-flow":n.navigation.oneSiteFlow&&!!n.entrypoint.site,"show-logo":n.navigation.displayLogoImages,type:Y(y).finalResponse,onAddOther:fe,onSelectAccounts:_e[5]||(_e[5]=()=>{P.value=!0})},null,8,["avatar","display-accounts-selection","long-message","message","one-site-flow","show-logo","type"]))],64)):Ye("",!0)],64)):(de(),Be("div",kAe,[O.value?Ye("",!0):(de(),nt(v5e,{key:0,"country-id":c.value,"onUpdate:countryId":_e[1]||(_e[1]=it=>c.value=it),"organization-type-id":O.value,"onUpdate:organizationTypeId":_e[2]||(_e[2]=it=>O.value=it),"filtered-countries":f.value,"filtered-organization-types":k.value,"select-class":n.navigation.selectClass,"show-countries":!n.navigation.hideSelectCountry},null,8,["country-id","organization-type-id","filtered-countries","filtered-organization-types","select-class","show-countries"])),c.value&&O.value&&!B.value?(de(),nt(b5e,{key:1,"assets-path":Y(K),items:x.value,"show-logo":n.navigation.displayLogoImages,"show-plaid-sites-button":n.internal.plaidSites&&O.value==="__internal__.plaidSites",onSelect:H},null,8,["assets-path","items","show-logo","show-plaid-sites-button"])):Ye("",!0),c.value&&O.value&&B.value?(de(),nt(D5e,{key:2,"assets-path":Y(K),items:R.value,organization:x.value.find(it=>it.id_site_organization===B.value),"show-logo":n.navigation.displayLogoImages,onSelect:G},null,8,["assets-path","items","organization","show-logo"])):Ye("",!0)]))],64)):Ye("",!0),v.value?(de(),Be("div",{key:2,class:Ce(ce.$style["widget-data-error"])},[Re("p",null,at(v.value.length?v.value:Y(i)("common.data_error")),1),Re("button",{class:"pb-w-sync_primary-button",onClick:U},at(Y(i)("common.retry")),1)],2)):Ye("",!0),I.value?(de(),Be("div",{key:3,class:Ce(ce.$style["widget-data-error"])},[Re("p",null,at(Y(i)("common.no_filtered_data")),1),Re("button",{class:"pb-w-sync_primary-button",onClick:ae},at(Y(i)("common.close")),1)],2)):Ye("",!0)],64)),!C.value&&!v.value&&!I.value||d.value?(de(),Be("div",{key:2,class:Ce(ce.$style["security-banner"])},[Re("p",null,at(Y(i)("common.security_banner_title")),1),Re("p",null,at(Y(i)("common.security_banner_content")),1)],2)):Ye("",!0)],2)],64))],2)):Ye("",!0)]),_:1},8,["visible","mobile"]),Re("div",{class:Ce(ce.$style["widget-version"])},at(Y(s)),3)],64))}}),[["__cssModules",{$style:{container:"pb-w-sync_container","credential-content":"pb-w-sync_credential-content","credential-twofa":"pb-w-sync_credential-twofa","is-mobile":"pb-w-sync_is-mobile","security-banner":"pb-w-sync_security-banner","widget-back-button":"pb-w-sync_widget-back-button","widget-close-button":"pb-w-sync_widget-close-button","widget-content":"pb-w-sync_widget-content","widget-data-error":"pb-w-sync_widget-data-error","widget-header":"pb-w-sync_widget-header","widget-version":"pb-w-sync_widget-version"}}]]),OAe=rt({__name:"App",props:{config:{default:()=>({})},enableTestMode:{type:Boolean,default:!1},refreshTokenFunction:{type:Function,default:void 0},strict:{default:void 0},token:{}},setup(e,{expose:t}){const r=e,n=Oe(null),{t:a}=Ba();un(mw,a);const i={client:{},locale:"en",entrypoint:{country:"MX"},navigation:{disableFormAutocomplete:!1,displayAccountsSelection:!1,displayBusinessSites:!0,displayCredentialInModal:!1,displayErrorsInToast:!0,displayLogoImages:!0,displayLongDescription:!1,displayPersonalSites:!0,displayPrivacyScreen:!0,displaySiteOrganizations:[],displaySiteOrganizationTypes:[],displaySites:[],displayStatusInToast:!1,enableBackNavigation:!0,enableTwofaBackNavigation:!1,formButtonsDisabledStyle:!1,formShowPasswordStyle:"icon",hideSelectCountry:!1,hideSiteOrganizations:[],hideSiteOrganizationTypes:[],hideSites:[],oneSiteFlow:!1,quickAnswer:!1,returnToSiteFormOnUserError:!1,saveCredential:!0,selectClass:"",socketTimeout:24e4,toastDuration:5e3,toastPosition:"top-right"},__internal__:{apiBaseUrl:null,apiEnv:null,assetsBaseUrl:null,plaidSites:!1,defaultHttpParams:{}}},o=mn({client:{...i.client,..._(r.config.client)},enableTestMode:r.enableTestMode,entrypoint:{...i.entrypoint,..._(r.config.entrypoint)},internal:{...i.__internal__,..._(r.config.__internal__)},locale:r.config.locale||i.locale,navigation:{...i.navigation,..._(r.config.navigation)},refreshTokenFunction:r.refreshTokenFunction,strict:r.strict,token:r.token,onTokenRefreshed:S=>{o.token=S}});function l(){n.value.close()}function u(){Xt(()=>{n.value.open()})}function c(S={}){try{Ug.validateSync(S)}catch(T){if(T.name==="ValidationError")throw new Error(`ValidationError: ${T.message}`)}o.client={...i.client,..._(S.client)},o.entrypoint={...i.entrypoint,..._(S.entrypoint)},o.internal={...i.__internal__,..._(S.__internal__)},o.locale=S.locale||i.locale,o.navigation={...i.navigation,..._(S.navigation)}}function d(S){n.value.setCredential&&n.value.setCredential(S)}function v(S){o.entrypoint={...o.entrypoint,site:S},u()}function m(S,T){return n.value.setToken(S,T)}function b(S={}){try{Ug.validateSync(S)}catch(T){if(T.name==="ValidationError")throw new Error(`ValidationError: ${T.message}`)}o.client={...o.client,..._(S.client)},o.entrypoint={...o.entrypoint,..._(S.entrypoint)},o.internal={...o.internal,..._(S.__internal__)},o.locale=S.locale||o.locale,o.navigation={...o.navigation,..._(S.navigation)}}function _(S={}){const T={...S};return Object.keys(T).forEach(C=>{T[C]===void 0&&delete T[C]}),T}return t({close:l,open:u,setConfig:c,setEntrypointCredential:d,setEntrypointSite:v,setToken:m,upsertConfig:b}),(S,T)=>(de(),nt(Y(D8e),{locale:o.locale==="es"?Y(RCe):Y(OCe)},{default:lt(()=>[_t(NAe,la(o,{ref_key:"widgetComponent",ref:n}),null,16)]),_:1},8,["locale"]))}});function sl(e){return e||(e={}),{locale:e.locale?e.locale:"en",quickAnswer:!!e.quickAnswer,socketTimeout:e.socketTimeout||24e4}}function ll(e,t){return new Promise(n=>{const a=new TL(e.token,{http:{baseURL:"https://sync.paybook.com",isStrict:!!e.strict},defaultParams:{locale:t.locale},isHeadless:!0,quickAnswer:t.quickAnswer,socketTimeout:t.socketTimeout,widgetVersion:`${Nd()}-headless`});e.strict?a.strictMode({token:e.token,strict:e.strict}).then(()=>{n(a)}):n(a)})}function RAe(e,t,r){return new Promise((a,i)=>{const o=sl(r);ll(e,o).then(l=>{l.getAccounts({id_credential:t}).then(u=>{a(u)}).catch(u=>{i(u)})})})}function PAe(e,t){return new Promise((n,a)=>{const i=sl(t);ll(e,i).then(o=>{o.getCountries().then(l=>{n(l)}).catch(l=>{a(l)})})})}function FAe(e,t={},r){return new Promise((a,i)=>{const o=sl(r);ll(e,o).then(l=>{l.getOrganizationSites(t).then(u=>{a(u)}).catch(u=>{i(u)})})})}function LAe(e,t){return new Promise((n,a)=>{const i=sl(t);ll(e,i).then(o=>{o.getOrganizationTypes().then(l=>{n(l)}).catch(l=>{a(l)})})})}function DAe(e,t,r){return new Promise((a,i)=>{const o=sl(r);ll(e,o).then(l=>{l.getSite(t).then(u=>{a(u[0])}).catch(u=>{i(u)})})})}function $Ae(e,t,r){return new Promise(a=>{const i=sl(r);ll(e,i).then(o=>{a(o.siteConnection(t))})})}function zAe(e,t,r){return new Promise(a=>{const i=sl(r);ll(e,i).then(o=>{a(o.syncCredential(t))})})}function UAe(e,t,r,n){return new Promise(i=>{const o=sl(n);ll(e,o).then(l=>{i(new wx({...t,id_site:r},l.getHttpService(),!1))})})}const VAe={getAccounts:RAe,getCountries:PAe,getOrganizationSites:FAe,getOrganizationTypes:LAe,getSite:DAe,siteConnection:$Ae,syncCredential:zAe,twofa:UAe},qBe="";$z();class xx{constructor(t){const r=new Lpe({accessToken:"2d928ea9aa674c6ea84dbf6f3901a403",captureUncaught:!1,captureUnhandledRejections:!1,enabled:!0,environment:"production",payload:{code_version:Nd()}});let n;if(typeof t=="string")n={token:t};else if(typeof t=="object")n=t;else throw new Error("Invalid params type. Params must be either string or object.");try{CU.validateSync(n)}catch(d){if(d.name==="ValidationError")throw new Error(`ValidationError: ${d.message}`)}Ln("instantiation");const a=aN(OAe,{config:n.config,enableTestMode:n.enableTestMode,refreshTokenFunction:n.refreshTokenFunction,strict:n.strict,token:n.token}),i=Uye({availableLocales:["en","es"],fallbackLocale:"en",legacy:!1,locale:"en",messages:{en:va,es:Ei}});a.use(i),a.use(s1e),a.config.errorHandler=d=>{throw r.error(d),d};const o=[];function l(d,v){o.push({callback:v,e:d})}function u(d,...v){o.forEach(({callback:m,e:b})=>{d===b&&m(...v)})}a.provide(ia,u);const c=a.mount(n.element||"#widget");return{on:l,close:c.close,open:c.open,setConfig:c.setConfig,setEntrypointCredential:c.setEntrypointCredential,setEntrypointSite:c.setEntrypointSite,setToken:c.setToken,upsertConfig:c.upsertConfig}}static getVersion(){return Nd()}}return kt(xx,"headless",VAe),window.SyncfyWidget=xx,xx});
|
|
869
|
+
`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ou(this.defaults,r);const{transitional:n,paramsSerializer:a,headers:i}=r;n!==void 0&&Xm.assertOptions(n,{silentJSONParsing:So.transitional(So.boolean),forcedJSONParsing:So.transitional(So.boolean),clarifyTimeoutError:So.transitional(So.boolean)},!1),a!=null&&(Ve.isFunction(a)?r.paramsSerializer={serialize:a}:Xm.assertOptions(a,{encode:So.function,serialize:So.function},!0)),Xm.assertOptions(r,{baseUrl:So.spelling("baseURL"),withXsrfToken:So.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&Ve.merge(i.common,i[r.method]);i&&Ve.forEach(["delete","get","head","post","put","patch","common"],_=>{delete i[_]}),r.headers=za.concat(o,i);const l=[];let u=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(r)===!1||(u=u&&S.synchronous,l.unshift(S.fulfilled,S.rejected))});const c=[];this.interceptors.response.forEach(function(S){c.push(S.fulfilled,S.rejected)});let d,v=0,m;if(!u){const _=[_L.bind(this),void 0];for(_.unshift.apply(_,l),_.push.apply(_,c),m=_.length,d=Promise.resolve(r);v<m;)d=d.then(_[v++],_[v++]);return d}m=l.length;let b=r;for(v=0;v<m;){const _=l[v++],S=l[v++];try{b=_(b)}catch(T){S.call(this,T);break}}try{d=_L.call(this,b)}catch(_){return Promise.reject(_)}for(v=0,m=c.length;v<m;)d=d.then(c[v++],c[v++]);return d}getUri(t){t=Ou(this.defaults,t);const r=cL(t.baseURL,t.url);return rL(r,t.params,t.paramsSerializer)}}Ve.forEach(["delete","get","head","options"],function(t){Qm.prototype[t]=function(r,n){return this.request(Ou(n||{},{method:t,url:r,data:(n||{}).data}))}}),Ve.forEach(["post","put","patch"],function(t){function r(n){return function(i,o,l){return this.request(Ou(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Qm.prototype[t]=r(),Qm.prototype[t+"Form"]=r(!0)});const eg=Qm;class bx{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(a=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](a);n._listeners=null}),this.promise.then=a=>{let i;const o=new Promise(l=>{n.subscribe(l),i=l}).then(a);return o.cancel=function(){n.unsubscribe(i)},o},t(function(i,o,l){n.reason||(n.reason=new sc(i,o,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new bx(function(a){t=a}),cancel:t}}}const _Ae=bx;function wAe(e){return function(r){return e.apply(null,r)}}function EAe(e){return Ve.isObject(e)&&e.isAxiosError===!0}const _x={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(_x).forEach(([e,t])=>{_x[t]=e});const xAe=_x;function xL(e){const t=new eg(e),r=zF(eg.prototype.request,t);return Ve.extend(r,eg.prototype,t,{allOwnKeys:!0}),Ve.extend(r,t,null,{allOwnKeys:!0}),r.create=function(a){return xL(Ou(e,a))},r}const pn=xL(dx);pn.Axios=eg,pn.CanceledError=sc,pn.CancelToken=_Ae,pn.isCancel=sL,pn.VERSION=wL,pn.toFormData=jm,pn.AxiosError=Ft,pn.Cancel=pn.CanceledError,pn.all=function(t){return Promise.all(t)},pn.spread=wAe,pn.isAxiosError=EAe,pn.mergeConfig=Ou,pn.AxiosHeaders=za,pn.formToJSON=e=>aL(Ve.isHTMLForm(e)?new FormData(e):e),pn.getAdapter=bL.getAdapter,pn.HttpStatusCode=xAe,pn.default=pn;const Ua=pn;function SAe(e,t,r){var n=r||{},a=n.noTrailing,i=a===void 0?!1:a,o=n.noLeading,l=o===void 0?!1:o,u=n.debounceMode,c=u===void 0?void 0:u,d,v=!1,m=0;function b(){d&&clearTimeout(d)}function _(T){var C=T||{},I=C.upcomingOnly,B=I===void 0?!1:I;b(),v=!B}function S(){for(var T=arguments.length,C=new Array(T),I=0;I<T;I++)C[I]=arguments[I];var B=this,N=Date.now()-m;if(v)return;function O(){m=Date.now(),t.apply(B,C)}function P(){d=void 0}!l&&c&&!d&&O(),b(),c===void 0&&N>e?l?(m=Date.now(),i||(d=setTimeout(c?P:O,e))):O():i!==!0&&(d=setTimeout(c?P:O,c===void 0?e-N:e))}return S.cancel=_,S}function SL(e,t,r){var n=r||{},a=n.atBegin,i=a===void 0?!1:a;return SAe(e,t,{debounceMode:i!==!1})}class wx extends ys.EventEmitter{constructor(r,n,a=!0){super();kt(this,"connection");kt(this,"data",{});kt(this,"displaySubmitButton",!0);kt(this,"http");kt(this,"_loading",!1);kt(this,"rules",{});kt(this,"rulesDefined",!1);if(this.config=r,this.measureEvents=a,this.http=n.getInstance(),r.twofa&&r.twofa.length)this.configuredMeasureEvent("twofa_request",{id_site:r.id_site,...r.id_site?{}:{id_request:r.id_request}}),r.twofa.forEach(i=>{const o=i.name;this.data[o]=null,(i.type==="authentication_type"||i.type==="challenge")&&(this.data[o]=i.label),i.type==="connection"&&(this.connection=this.data[o]=i.label),(i.type==="externalAction"||i.type==="instructions")&&(this.displaySubmitButton=!1)}),this.connectSantanderUsbToken(),this.handleBbvaNetcashConnections();else throw new Error("TWOFA credentials are required.")}get loading(){return this._loading}set loading(r){this._loading=r,r&&this.emit("loading")}authenticate(r){return this.data={...r},this.configuredMeasureEvent("twofa_send",{id_site:this.config.id_site,...this.config.id_site?{}:{id_request:this.config.id_request}}),this.loading=!0,this.connection==="eai_otp_GO3"?this.sendBbvaNetcashUsbToken():this.http.post(this.config.address,{twofa:{...this.data}}).then(n=>(this.emit("login-success"),n)).catch(n=>(this.loading=!1,this.emit("twofa-api-error"),Promise.reject(n)))}defineRules(r){this.rulesDefined||(this.rulesDefined=!0,this.config.twofa.forEach(n=>{Object.defineProperty(this.rules,n.name,{value:this.setRules(n,r)})}))}getFields(){return this.config.twofa.filter(r=>r.type!=="challenge"&&r.type!=="connection")}statusChanged(){this.loading||(this.loading=!0)}configuredMeasureEvent(r,n){this.measureEvents&&Ln(r,n)}connectSantanderUsbToken(){this.config.id_site==="57f6dd8c78480602048b4567"&&this.config.twofa[0].type==="instructions"&&Ope(this.config.twofa[0].imgBase64File).then(r=>{this.authenticate(r)}).catch(r=>{this.emit("twofa-api-error"),this.emit("twofa-device-error",r)})}findTwofaByName(r){return this.config.twofa.find(n=>n.name===r)}findTwofaByType(r){return this.config.twofa.find(n=>n.type===r)}handleBbvaNetcashConnections(){this.connection==="eai_otp_GO3"&&this.setBbvaNetcashUsbFields(),this.findTwofaByType("authentication_type")&&this.sendBbvaNetcashBluetoothTimeChallenge(),this.config.id_site==="57239fae78480601038b4567"&&!this.connection&&this.findTwofaByType("challenge")&&this.sendBbvaNetcashBluetoothSecondToken()}sendBbvaNetcashBluetoothSecondToken(){const r=JSON.parse(this.findTwofaByType("challenge").label),n=this.findTwofaByName("token").label;this.displaySubmitButton=!1,this.config.twofa=[{label:n,name:"token",type:"instructions"}],IU(r).then(a=>{this.authenticate({challenge:a,token:a})})}sendBbvaNetcashBluetoothTimeChallenge(){const r=this.findTwofaByType("authentication_type").label,n=this.findTwofaByName("token").label;this.displaySubmitButton=!1,this.config.twofa=[{label:n,name:"token",type:"instructions"}],kU(r).then(a=>{this.authenticate({authentication_type:"authentication_type",token:a})})}sendBbvaNetcashUsbToken(){return TU(this.data.token,this.data.challenge).then(r=>this.http.post(this.config.address,{twofa:{...this.data,...r,bluetooth_device:"bluetooth_device",challenge:"challenge",connection:"connection"}}).then(n=>(this.emit("login-success"),n)).catch(n=>(this.loading=!1,this.emit("twofa-api-error"),Promise.reject(n)))).catch(r=>(this.loading=!1,this.emit("twofa-api-error"),Promise.reject(r.response?{...r,response:{...r.response,status:500}}:r)))}setBbvaNetcashUsbFields(){this.config.twofa=[this.findTwofaByType("text")]}setRules(r,n){const a=[];return a.push({required:!0,message:n("form_errors.required",{label:r.label})}),r.validation&&r.validation.forEach(i=>{switch(i.type){case"text":break;case"regex":a.push({pattern:i.value,message:i.error_message});break}}),a}}class MAe extends ys.EventEmitter{constructor(r,n,a,i,o=!1){super();kt(this,"loading",!1);kt(this,"response");kt(this,"_config");kt(this,"_error");kt(this,"_message");kt(this,"_status","searching");kt(this,"_twofa");kt(this,"http");kt(this,"isSocketOpen",!1);kt(this,"options",{});kt(this,"socket");kt(this,"socketOpened",!1);kt(this,"socketTimeoutAfterError");kt(this,"timer",null);this.syncService=n,this.httpService=a,this.socketTimeoutTime=i,this.isHeadless=o,this.http=this.httpService.getInstance(),this.getSitefromCredential({id_credential:r}).then(({site:l,credential:u})=>{this.config={...u,avatar:l.organizationSite.avatar,cover:l.organizationSite.cover,name:l.name,quickAnswer:this.syncService.quickAnswer,site:l},this.status="found",this.sync().then(()=>{this.status="loading"}).catch(c=>{this.error=c,this.status="error"})}).catch(l=>{this.error=l,this.status="not-found"})}get config(){return this._config}set config(r){this._config=r}get error(){return this._error}set error(r){this._error=r}get message(){return this._message}set message(r){this._message=r}get status(){return this._status}set status(r){const n=this._status!==r;this._status=r,n&&(this.emit(r),this.emit("status-updated",r))}get twofa(){return this._twofa}set twofa(r){this._twofa=r,r&&(this.status="twofa",r.on("loading",()=>{this._twofa===r&&this.status==="twofa"&&(this.status="twofa-loading")}),r.on("twofa-api-error",()=>{this.status="twofa-api-error",this.socketClose()}))}getAvatar(){return this.config.avatar}getCover(){return this.config.cover}getCredentialData(){return{...this.config}}getName(){return this.config.name}getSite(){return{...this.config.site}}setOption(r,n){this.options[r]=n}sync(){return this.configuredMeasureEvent("sync_credential",{id_credential:this.config.id_credential,id_site:this.config.id_site}),this.loading=!0,this.startTimer(),this.http.put(`/v1/credentials/${this.config.id_credential}/sync`,{...this.spreadOptions()}).then(r=>(this.response=r,this.setSocket(r.ws),r)).catch(r=>(this.loading=!1,this.configuredMeasureEvent("sync_credential_error",{code:r.response.status,code_origin:"endpoint",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.clearTimer(),Promise.reject(r)))}clearTimer(){clearTimeout(this.timer)}configuredMeasureEvent(r,n){this.isHeadless||Ln(r,n)}getSitefromCredential(r){return this.http.get("/v1/credentials",{params:{...this.syncService.defaultParams,...r}}).then(n=>r.id_credential&&!n.length?Promise.reject({response:{status:"credential_not_found"}}):this.syncService.getOrganizationSites({id_site_organization:n[0].id_site_organization}).then(a=>{if(r.id_credential&&!a.length)return Promise.reject({response:{status:"credential_not_found"}});let i=a[0].sites.find(o=>o.id_site===n[0].id_site);if(i)i={...i};else return Promise.reject({response:{status:"credential_not_found"}});return i.organizationSite=a[0],{site:i,credential:n[0]}}).catch(a=>Promise.reject(a)))}reopenSocket(r){this.isSocketOpen=!1,this.socketTimeoutAfterError||this.setSocket(r.target.url)}reopenSocketAfterError(){if(!this.socketTimeoutAfterError){this.socketTimeoutAfterError=new Date().getTime()+12e4,this.setSocket(this.response.ws);const r=setInterval(()=>{this.isSocketOpen?clearInterval(r):new Date().getTime()<this.socketTimeoutAfterError?(this.socket.close(),this.setSocket(this.response.ws)):(clearInterval(r),this.socket.close(),this.loading=!1,this.status="socket-error")},2e3)}}setSocket(r){this.socket=new WebSocket(r),this.socket.onclose=n=>this.reopenSocket(n),this.socket.onerror=()=>this.socketError(),this.socket.onmessage=n=>this.socketMessage(n),this.socket.onopen=()=>this.socketOpen()}socketClose(r){this.clearTimer(),this.socket.onclose=()=>{this.twofa=null,r&&r(this)},this.socket.close()}socketError(){this.isSocketOpen=!1,this.socketOpened?this.reopenSocketAfterError():(this.loading=!1,this.status="socket-error")}socketMessage(r){const n=JSON.parse(r.data);if(this.clearTimer(),this.config.quickAnswer&&n.code===102){this.socketClose(()=>{this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.status="socket-quick-answer"}),this.configuredMeasureEvent("sync_credential_success",{code:n.code,id_credential:this.config.id_credential,id_site:this.config.id_site});return}n.code===401&&this.configuredMeasureEvent("unauthorized",{id_site:this.config.id_site}),n.code===410&&(this.twofa=new wx({...n,id_site:this.config.id_site},this.httpService)),this.emit("socket-message",n),this.startTimer(),n.code===411&&this.configuredMeasureEvent("twofa_timeout",{id_site:this.config.id_site}),200<=n.code&&n.code<300||400<=n.code&&n.code<600&&n.code!==410?(this.loading=!1,this.twofa&&(this.twofa.loading=!1),n.code<300?(this.configuredMeasureEvent("sync_credential_success",{code:n.code,id_credential:this.config.id_credential,id_site:this.config.id_site}),this.message=n,this.status="success"):(this.configuredMeasureEvent("sync_credential_error",{code:n.code,code_origin:"socket",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.error=n,this.status="error"),this.socketClose()):this.twofa&&n.code!==410&&this.twofa.statusChanged()}socketOpen(){this.isSocketOpen=this.socketOpened=!0,this.socketTimeoutAfterError=void 0}socketTimeout(){this.status="socket-timeout",this.socketClose()}spreadOptions(){return Object.keys(this.options).length?{options:{...this.options}}:{}}startTimer(){this.timer=setTimeout(()=>{this.socketTimeout()},this.socketTimeoutTime)}}Ua.defaults.baseURL="https://sync.paybook.com";class ML extends ys.EventEmitter{constructor(r,n={}){super();kt(this,"baseURL");kt(this,"isStrict");kt(this,"jwk");this.token=r,n.baseURL&&(this.baseURL=Ua.defaults.baseURL=n.baseURL),this.isStrict=n.isStrict||!1,Ua.defaults.headers.common={"x-app-version":`sync-widget:${n.widgetVersion}:${yw.os.name}:${yw.os.version}`},Ua.interceptors.request.use(a=>(a.headers.Authorization=`Bearer ${this.token}`,a),function(a){return Promise.reject(a)}),Ua.interceptors.response.use(a=>a.data.response||a.data||a,a=>(a.response&&a.response.status===401&&this.emit("401"),Promise.reject(a)))}getInstance(){const r=Ua.create({baseURL:this.baseURL});return r.interceptors.request.use(n=>(n.headers.Authorization=`Bearer ${this.token}`,n),function(n){return Promise.reject(n)}),r.interceptors.response.use(n=>n.data.response||n.data||n,n=>(n.response&&n.response.status===401&&this.emit("401"),Promise.reject(n))),this.isStrict&&r.interceptors.request.use(n=>n.data?$B(n.data,this.jwk).then(a=>(n.data={jwe:a},Promise.resolve(n))):Promise.resolve(n),n=>Promise.reject(n)),r}updateToken(r,n){this.token=r,n&&(this.jwk=n)}}class CL extends ys.EventEmitter{constructor(r,n,a){super();kt(this,"config");kt(this,"response");kt(this,"testMode",!1);kt(this,"http");kt(this,"_finalResponse",null);kt(this,"_lastSocketMessage");kt(this,"_loading",!1);kt(this,"_status","start");kt(this,"_twofa");kt(this,"isSocketOpen",!1);kt(this,"options",{});kt(this,"socket");kt(this,"socketOpened",!1);kt(this,"socketTimeoutAfterError");kt(this,"timer",null);this.httpService=n,this.userConfig=a,this.config=r,this.http=n.getInstance()}get finalResponse(){return this._finalResponse}set finalResponse(r){this._finalResponse=r,this.status="finish"}get lastSocketMessage(){return this._lastSocketMessage}set lastSocketMessage(r){this._lastSocketMessage=r}get loading(){return this._loading}set loading(r){this._loading=r,r&&(this.status="loading")}get status(){return this._status}set status(r){const n=this._status!==r;this._status=r,n&&(this.emit(r),this.emit("status-update",r))}get twofa(){return this._twofa}set twofa(r){this._twofa=r,r&&(this.status="twofa",r.on("loading",()=>{this._twofa===r&&this.status==="twofa"&&(this.status="twofa-loading")}))}setOption(r,n){this.options[r]=n}toggleTestMode(){this.testMode=!this.testMode}configuredMeasureEvent(r,n){this.userConfig.isHeadless||Ln(r,n)}clearTimer(){clearTimeout(this.timer)}reopenSocket(r){this.setSocket(r.target.url)}setRules(r){const n=[];return r.required&&n.push({required:!0,message:"required"}),r.validation&&r.validation.forEach(a=>{switch(a.type){case"text":break;case"regex":n.push({pattern:a.value,message:"regex"});break}}),n}setSocket(r){this.socket=new WebSocket(r),this.socket.onclose=n=>this.reopenSocket(n),this.socket.onerror=()=>this.socketError(),this.socket.onmessage=n=>this.socketMessage(n),this.socket.onopen=()=>this.socketOpen()}reopenSocketAfterError(){if(!this.socketTimeoutAfterError){this.socketTimeoutAfterError=new Date().getTime()+12e4,this.setSocket(this.response.ws);const r=setInterval(()=>{this.isSocketOpen?clearInterval(r):new Date().getTime()<this.socketTimeoutAfterError?(this.socket.close(),this.setSocket(this.response.ws)):(clearInterval(r),this.socket.close(),this.loading=!1,this.emit("socket-error"),this.finalResponse="error")},2e3)}}socketClose(r){this.clearTimer(),this.socket.onclose=n=>{this.twofa=null,this.emit("socket-close",n),r&&r(this)},this.socket.close()}socketError(){this.isSocketOpen=!1,this.socketOpened?this.reopenSocketAfterError():(this.loading=!1,this.emit("socket-error"),this.finalResponse="error")}socketMessage(r){const n=JSON.parse(r.data);if(this.lastSocketMessage=n,this.clearTimer(),this.config.quickAnswer&&n.code===102){this.socketClose(()=>{this.finalResponse="success",this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.emit("socket-quick-answer")}),this.configuredMeasureEvent("sync_success",{code:n.code,id_site:this.config.id_site});return}n.code===401&&this.configuredMeasureEvent("unauthorized",{id_site:this.config.id_site}),n.code===410&&(this.twofa=new wx({...n,id_site:this.config.id_site},this.httpService,!this.userConfig.isHeadless),this.emit("twofa",this.twofa),this.twofa.on("twofa-api-error",()=>{this.socketClose()})),this.emit("socket-message",n),this.startTimer(),n.code===411&&this.configuredMeasureEvent("twofa_timeout",{id_site:this.config.id_site}),(200<=n.code&&n.code<300||400<=n.code&&n.code<600&&n.code!==410)&&(n.code<300?(this.finalResponse="success",this.configuredMeasureEvent("sync_success",{code:n.code,id_site:this.config.id_site})):(this.finalResponse="error",this.configuredMeasureEvent("sync_error",{code:n.code,code_origin:"socket",id_site:this.config.id_site})),this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.socketClose()),!(400<=n.code&&n.code<600&&n.code!==410||200<=n.code&&n.code<300)&&this.twofa&&n.code!==410&&(this.twofa.loading=!0,this.status="twofa-loading")}socketOpen(){this.isSocketOpen=this.socketOpened=!0,this.socketTimeoutAfterError=void 0}socketTimeout(){this.socketClose(()=>{this.finalResponse="error",this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.emit("socket-timeout")})}spreadOptions(){return Object.keys(this.options).length?{options:{...this.options}}:{}}startTimer(){this.timer=setTimeout(()=>{this.socketTimeout()},this.userConfig.socketTimeoutTime)}}class CAe extends CL{constructor(r,n,a,i){super(r,n,i);kt(this,"data",{});kt(this,"rules",{});if(this.defaultParams=a,this.userConfig=i,r.credentials&&r.credentials.length)i.isHeadless||r.credentials.forEach(o=>{const l=o.name;Object.defineProperty(this.rules,l,{enumerable:!0,value:this.setRules(o)})});else throw new Error("Site credentials are required.")}get version(){return 1}connect(r){this.data={...r};const n={...this.defaultParams,id_site:this.config.id_site,credentials:{...this.data},...this.spreadOptions()};return this.config.request?Promise.resolve(n.credentials):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(n.save_credential=this.userConfig.saveCredential),this.testMode&&(n.test=1),this.startTimer(),this.http.post(this.config.endpoint,n).then(a=>(this.response=a,this.emit("login-success"),this.setSocket(a.ws),a)).catch(a=>(this.configuredMeasureEvent("sync_error",{code:a.response?a.response.status:a.toString(),code_origin:"endpoint",id_site:this.config.id_site}),this.loading=!1,this.status="start",this.clearTimer(),Promise.reject(a))))}getFields(){return this.config.credentials}}class TAe extends CL{constructor(r,n,a,i){super(r,n,i);kt(this,"input",[]);this.defaultParams=a,this.userConfig=i,r.input.forEach(o=>{const l={rules:{},data:{}};o.fields.forEach(u=>{const c=u.name;Object.defineProperty(l.rules,c,{enumerable:!0,value:this.setRules(u)}),l.data[c]=null}),this.input.push(l)})}get version(){return 3}connect(r,n){this.updateData(r,n);const a=r||0,i={...this.defaultParams,id_site:this.config.id_site,input_name:this.config.input[r].name,input:{...this.input[a].data},...this.spreadOptions()};return this.config.request?Promise.resolve(i.input):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(i.save_credential=this.userConfig.saveCredential),this.testMode&&(i.test=1),this.startTimer(),this.http.post(this.config.endpoint,i).then(o=>(this.response=o,this.emit("login-success"),this.setSocket(o.ws),o)).catch(o=>(this.configuredMeasureEvent("sync_error",{code:o.response?o.response.status:o.toString(),code_origin:"endpoint",id_site:this.config.id_site}),this.loading=!1,this.status="start",this.clearTimer(),Promise.reject(o))))}getFields(r){return this.config.input[r].fields}getOptions(){return this.config.input}updateData(r,n){this.input[r].data={...n}}}class TL extends ys.EventEmitter{constructor(r,n){super();kt(this,"http");kt(this,"httpService");this.token=r,this.config=n,this.httpService=n.http?new ML(r,{...n.http,widgetVersion:n.widgetVersion}):new ML(r,{widgetVersion:n.widgetVersion}),this.http=this.httpService.getInstance(),this.httpService.on("401",this.debounce401())}get defaultParams(){return this.config.defaultParams}set defaultParams(r){this.config.defaultParams=r}get quickAnswer(){return this.config.quickAnswer}getAccounts(r){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/accounts",{params:{...this.config.defaultParams,...r}})}getCountries(){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/countries",{params:{...this.config.defaultParams}})}getHttpService(){return this.httpService}getOrganizationSites(r){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/organizations/sites",{params:{...this.config.defaultParams,...r}})}getOrganizationTypes(){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/site_organization_types",{params:{...this.config.defaultParams}})}getSite(r){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get(`/v1/catalogues/widget/sites/${r}`,{params:{...this.config.defaultParams}})}siteConnection(r){switch(r.version){case 3:return new TAe({...r,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout});default:return new CAe({...r,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout})}}strictMode({token:r,strict:n}){return this.token=r,Npe(n).then(({strictAuthorizationKey:a,strictBodyKey:i})=>DB({token:r},a).then(o=>(this.httpService.updateToken(o),kpe().then(({authorization:l})=>{const u={authorization:btoa(JSON.stringify(l.toJSON(!0)))};return $B(u,i).then(c=>this.updateStrictSession(r,o,c).then(()=>DB({token:r},l).then(d=>this.updateToken(d).then(()=>(this.httpService.updateToken(this.token,i),{jws:d,jwe:i})))))}))))}syncCredential(r){return new MAe(r,this,this.httpService,this.config.socketTimeout,this.config.isHeadless)}updateApiBaseUrl(r){this.http.defaults.baseURL=r,Ua.defaults.baseURL=r}updateEnvironment(r){switch(r){case"production":this.http.defaults.baseURL="https://sync.paybook.com",Ua.defaults.baseURL="https://sync.paybook.com";break;case"development":this.http.defaults.baseURL="https://api.syncfy.paybook.dev",Ua.defaults.baseURL="https://api.syncfy.paybook.dev";break;default:this.http.defaults.baseURL="https://sync.paybook.com",Ua.defaults.baseURL="https://sync.paybook.com";break}}updateToken(r){return new Promise(n=>{this.token!==r&&(this.token=r,this.httpService.updateToken(this.token)),n({token:r})})}debounce401(){return SL(200,()=>{this.emit("sync_401")})}updateStrictSession(r,n,a){return Ua.put(`/v1/sessions/jwt/${r}`,{type:"jwt","payload/jwe":a},{headers:{Authorization:`Bearer ${n}`}})}}class Ex{constructor(t){kt(this,"callback");kt(this,"messages");this.messages=t}getMessages(){return this.messages}subscribe(t){this.callback=t}updateMessages(t){this.messages={...this.messages,...t},this.callback&&this.callback()}}const DBe="",AAe=["aria-label"],IAe={key:1},BAe=["aria-label"],kAe={key:0},NAe=li(rt({__name:"DataWidget",props:{client:{},enableTestMode:{type:Boolean},entrypoint:{},internal:{},locale:{},navigation:{},refreshTokenFunction:{type:Function},strict:{},token:{}},emits:["tokenRefreshed"],setup(e,{expose:t,emit:r}){const n=e,a=Et(ia),{t:i,locale:o}=Ba({useScope:"global"}),{mobile:l}=ix(),u=Oe([]),c=Oe(null),d=Oe(null),v=Oe(!1),m=Oe(null),b=Oe(null),_=Oe(""),S=Oe(""),T=Oe(n.navigation.displayPrivacyScreen),C=Oe(!0),I=Oe(!1),B=Oe(null),N=Oe([]),O=Oe(null),P=Oe(!1),L=Oe(null),$=Oe(null),z=Oe(!1);let K="https://s.paybook.com",M=null,s=`${Nd()}${n.strict?"-strict":""}`,h=null,p,g=[],y=null,w=null,A=null;const E=be(()=>C.value?!1:L.value?n.entrypoint.site&&n.navigation.oneSiteFlow?L.value==="twofa"||n.navigation.displayPrivacyScreen:L.value==="finish"?n.navigation.enableBackNavigation:L.value==="twofa"?n.navigation.enableTwofaBackNavigation:n.navigation.enableBackNavigation&&L.value==="start":!!O.value||n.navigation.displayPrivacyScreen),f=be(()=>u.value.filter(ce=>(ce.id_country==="51ad44db3b8e77631200047d"||ce.id_country==="51ad44793b8e77631200027a")&&n.internal.plaidSites||le(ce.id_country).length).sort((ce,_e)=>ce.name.localeCompare(_e.name))),x=be(()=>ie(c.value,O.value)),k=be(()=>le(c.value)),R=be(()=>V(c.value,O.value,B.value)),q=be(()=>({short:S.value,long:_.value})),J=be(()=>{let ce=[];return N.value&&N.value.forEach(_e=>{ce=[...ce,..._e.sites.map(it=>({...it,avatar:_e.avatar,cover:_e.cover,organizationSite:_e}))]}),ce}),W=be(()=>v.value||I.value?"":P.value?i("accounts_selection.title"):L.value?L.value==="start"?i("common.header.login"):"":O.value?c.value&&O.value?i("common.header.select"):"":i("common.header.link"));dt(()=>n.locale,(ce,_e)=>{ce!==_e&&["es","en"].includes(ce)&&(o.value=ce)}),dt(()=>n.internal,(ce,_e)=>{if(A.defaultParams=ce.defaultHttpParams||{},A.defaultParams.locale=n.locale,ce.apiEnv!==_e.apiEnv)switch(A.updateEnvironment(ce.apiEnv),ce.apiEnv){case"production":K="https://s.paybook.com";break;case"development":K="https://s.paybook.dev";break;default:K="https://s.paybook.com";break}ce.apiBaseUrl!==_e.apiBaseUrl&&ce.apiBaseUrl&&A.updateApiBaseUrl(ce.apiBaseUrl),ce.assetsBaseUrl!==_e.assetsBaseUrl&&ce.assetsBaseUrl&&(K=ce.assetsBaseUrl),U()}),dt(()=>n.navigation.displayPersonalSites,()=>{U()}),dt(()=>n.navigation.displayBusinessSites,()=>{U()}),dt(S,ce=>{h&&p.updateMessages({short:ce})}),dt(_,ce=>{h&&p.updateMessages({long:ce})}),dt(z,()=>{!z.value&&!h&&L.value&&L.value!=="start"&&L.value!=="finish"?(p=new Ex({short:_.value}),h=on.info({duration:0,message:Ot(hn,{assetsPath:K,buttonDisabledStyle:n.navigation.formButtonsDisabledStyle,disableFormAutocomplete:n.navigation.disableFormAutocomplete,duration:0,enableBackNavigation:n.navigation.enableTwofaBackNavigation,item:y,messagesUpdater:p,rootEmit:a,selectClass:n.navigation.selectClass,showLogo:n.navigation.displayLogoImages,showPasswordStyle:n.navigation.formShowPasswordStyle,t:i,type:"info",onBack:()=>{a("back"),te(),y=L.value=null,G(w,!1),z.value=!0},onError:ce=>{he(ce)},onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),position:n.navigation.toastPosition,showClose:!1})):z.value&&h&&(z.value=!1,on.error({duration:0,position:n.navigation.toastPosition,message:Ot(hn,{duration:0,initMessage:i("common.process_running"),initTitle:i("common.error"),showLogo:!1,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}})}))}),lr(()=>{Xt(()=>{a("dom-updated")})}),xh(()=>{Xt(()=>{a("dom-updated")})});function X(){["es","en"].includes(n.locale)&&(o.value=n.locale),K=n.internal.apiEnv?n.internal.apiEnv==="production"?"https://s.paybook.com":"https://s.paybook.dev":"https://s.paybook.com",n.internal.assetsBaseUrl&&(K=n.internal.assetsBaseUrl),n.strict?(Je(),C.value=!0,setTimeout(()=>{A.strictMode({token:n.token,strict:n.strict}).then(()=>{U()})},400)):(Je(),U())}function ae(){Ln("close"),z.value=!1,(L.value==="start"||L.value==="finish")&&(L.value=y=null),a("closed")}function te(){h&&(h.close(),h=null)}function he(ce){const _e=D(ce);!n.navigation.displayErrorsInToast&&z?(m.value=i(`${_e}long_description`),b.value=i(`${_e}short_description`)):on.error({position:n.navigation.toastPosition,message:Ot(hn,{displayLongDescription:n.navigation.displayLongDescription,duration:0,initLongMessage:i(`${_e}long_description`),initMessage:i(`${_e}short_description`),initTitle:i("common.error"),showLogo:!1,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0}),Z(ce,_e)}const re=SL(200,function(){if(v.value=!1,n.entrypoint.credential)return me(n.entrypoint.credential,!0);if(n.entrypoint.site&&n.navigation.oneSiteFlow)A.getSite(n.entrypoint.site).then(ce=>{if(a("loaded"),ce&&ce.length){const _e=ce[0].site_organization;G({...ce[0],avatar:_e.avatar,cover:_e.avatar,organizationSite:_e})}else se({response:{status:"site_not_found"}})}).catch(se).finally(()=>{C.value=!1});else{const ce={};B.value=null,(n.navigation.displayPersonalSites||n.navigation.displayBusinessSites)&&!(n.navigation.displayPersonalSites&&n.navigation.displayBusinessSites)&&(n.navigation.displayPersonalSites?ce.is_personal=1:ce.is_business=1);const _e=[A.getCountries(),A.getOrganizationTypes(),A.getOrganizationSites(ce)];return Promise.all(_e).then(it=>{u.value=it[0],g=it[1],n.internal.plaidSites&&g.unshift({id_site_organization_type:"__internal__.plaidSites",label:"webapp_add_banks",name:"plaid"}),N.value=it[2]}).then(()=>Xt().then(()=>{if(a("loaded"),oe(),n.entrypoint.site){const it=J.value.find(Ee=>Ee.id_site===n.entrypoint.site);return it?G(it):Promise.reject({response:{status:"site_not_found"}})}})).catch(se).finally(()=>{C.value=!1})}});function Z(ce,_e){a("api-error",ce.response?ce.response.status:500,{longMessage:i(`${_e}real.long_description`),message:i(`${_e}real.short_description`),noInternet:!ce.response})}function j(ce){a("socket-error",{longMessage:i(`socket.${ce}.long_description`),type:ce,message:i(`socket.${ce}.short_description`)})}function ie(ce,_e){return(n.navigation.displaySiteOrganizations.length||n.navigation.hideSiteOrganizations.length?N.value.filter(it=>{if(n.navigation.displaySiteOrganizations.length)return!!n.navigation.displaySiteOrganizations.find(Ee=>Ee===it.name||Ee===it.id_site_organization);if(n.navigation.hideSiteOrganizations.length)return!n.navigation.hideSiteOrganizations.find(Ee=>Ee===it.name||Ee===it.id_site_organization)}):N.value).filter(it=>ce===it.id_country&&_e===it.id_site_organization_type&&V(ce,_e,it.id_site_organization).length)}function le(ce){return(n.navigation.displaySiteOrganizationTypes.length||n.navigation.hideSiteOrganizationTypes.length?g.filter(_e=>{if(n.navigation.displaySiteOrganizationTypes.length)return!!n.navigation.displaySiteOrganizationTypes.find(it=>it===_e.name||it===_e.id_site_organization_type);if(n.navigation.hideSiteOrganizationTypes.length)return!n.navigation.hideSiteOrganizationTypes.find(it=>it===_e.name||it===_e.id_site_organization_type)}):g).filter(_e=>(ce==="51ad44db3b8e77631200047d"||ce==="51ad44793b8e77631200027a")&&n.internal.plaidSites&&_e.id_site_organization_type==="__internal__.plaidSites"?!0:ie(ce,_e.id_site_organization_type).length)}function V(ce,_e,it){return(n.navigation.displaySites.length||n.navigation.hideSites.length?J.value.filter(Ee=>{if(n.navigation.displaySites.length)return!!n.navigation.displaySites.find(Ae=>Ae===Ee.name||Ae===Ee.id_site);if(n.navigation.hideSites.length)return!n.navigation.hideSites.find(Ae=>Ae===Ee.name||Ae===Ee.id_site)}):J.value).filter(Ee=>ce===Ee.organizationSite.id_country&&_e===Ee.organizationSite.id_site_organization_type&&it===Ee.organizationSite.id_site_organization)}function D(ce){return typeof ce=="string"?ce:ce.response&&ce.response.data&&ce.response.data.message==="Credential error, please consider updating credential password"?"api_errors.credential_error.":`api_errors.${ce.response?ce.response.status?ce.response.status:500:"no_internet"}.`}function F(){L.value?L.value==="finish"?fe():L.value==="twofa"?et():n.navigation.oneSiteFlow&&n.navigation.displayPrivacyScreen?(a("back"),T.value=!0):Me():B.value?ne():O.value?(a("back"),O.value=null):(a("back"),T.value=!0)}function U(){C.value=!0,re()}function se(ce){const _e=D(ce);v.value=i(`${_e}short_description`),!ce.response&&n.navigation.displayErrorsInToast&&on.error({position:n.navigation.toastPosition,message:Ot(hn,{duration:0,initLongMessage:i(`${_e}long_description`),initMessage:i(`${_e}short_description`),showLogo:!1,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0}),a("loaded"),Z(ce,_e)}function Q(){Ln("open"),C.value||oe(),z.value=!0,a("opened")}function ne(){a("back"),B.value=null}function fe(){L.value=B.value=y=null}function H(ce){a("organization-selected",ce),Ln("open_site_organization",{id_site_organization:ce.id_site_organization}),B.value=ce.id_site_organization,Xt(()=>{R.value.length===1&&G(R.value[0])})}function G(ce,_e=!0){let it;_e&&(a("organization-site-selected",ce),Ln("open_site",{id_site:ce.id_site})),!y||!y.loading?(w=ce,it=y=A.siteConnection(ce),L.value="start",b.value=null,m.value=null,y.on("login-success",()=>{z.value&&n.navigation.displayStatusInToast&&ae()}),y.on("socket-close",te),y.on("socket-error",()=>{n.navigation.displayErrorsInToast?on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,duration:0,hideForm:!0,initLongMessage:i("socket.error.long_description"),initMessage:i("socket.error.short_description"),item:y,showLogo:n.navigation.displayLogoImages,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0}):(m.value=i("socket.error.long_description"),b.value=i("socket.error.short_description")),j("error")}),y.on("socket-message",Ee=>{const Ae=`socket.message.${Ee.code?Ee.code:500}.`,mt=i(`${Ae}short_description`),ke=i(`${Ae}long_description`);switch(!0){case(400<=Ee.code&&Ee.code<600&&Ee.code!==410):te(),b.value=mt,m.value=ke,a("error",y.response,{code:Ee.code,longMessage:ke,message:mt}),z.value?n.navigation.returnToSiteFormOnUserError!==!1&&(n.navigation.returnToSiteFormOnUserError===!0&&[401,403,411].includes(Ee.code)||n.navigation.returnToSiteFormOnUserError!==!0&&n.navigation.returnToSiteFormOnUserError.includes(Ee.code))&&(L.value=y=null,G(w,!1),$.value={short:mt,long:ke}):(on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:ke,initMessage:mt,item:y,showLogo:n.navigation.displayLogoImages,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0}),fe(),oe());break;case(200<=Ee.code&&Ee.code<300):te(),b.value=mt,m.value=ke,a("success",y.response),z.value||(on.success({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:n.navigation.toastDuration,hideForm:!0,initLongMessage:ke,initMessage:mt,item:y,showLogo:n.navigation.displayLogoImages,t:i,type:"success",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:n.navigation.toastDuration}),fe(),oe());break;default:S.value=mt,_.value=ke}a("status",Ee)}),y.on("socket-quick-answer",()=>{b.value=i("socket.quick_answer.short_description"),m.value=i("socket.quick_answer.long_description"),a("success",y.response),te(),z.value||(on.success({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:n.navigation.toastDuration,hideForm:!0,initLongMessage:i("socket.quick_answer.long_description"),initMessage:i("socket.quick_answer.short_description"),item:y,showLogo:n.navigation.displayLogoImages,t:i,type:"success",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:n.navigation.toastDuration}),fe(),oe())}),y.on("socket-timeout",()=>{b.value=i("socket.timeout.short_description"),m.value=i("socket.timeout.long_description"),a("error",y.response),z.value||(on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:i("socket.timeout.long_description"),initMessage:i("socket.timeout.short_description"),item:y,showLogo:n.navigation.displayLogoImages,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0}),fe(),oe()),j("timeout")}),y.on("status-update",Ee=>{y===it&&(L.value=Ee)}),y.on("twofa",()=>{S.value=i("twofa.waiting")})):on.error({position:n.navigation.toastPosition,message:Ot(hn,{duration:0,initMessage:i("common.process_running"),initTitle:i("common.error"),showLogo:!1,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})}function me(ce,_e=!1){if(T.value=!1,Ln("open_credential",{id_credential:ce}),!M||!M.loading){let it=new Ex({short:i("credential.search.title")}),Ee;n.navigation.displayCredentialInModal?(a("opened"),d.value={loaderType:"loading",loading:!0,messages:{short:i("credential.search.title"),long:i("credential.search.message")}}):Ee=on.info({showClose:!1,position:n.navigation.toastPosition,duration:0,message:Ot(hn,{assetsPath:K,duration:0,initTitle:i("credential.search.title"),messagesUpdater:it,showLogo:!1,t:i,type:"info",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}})}),M=A.syncCredential(ce),M.on("error",()=>{const{code:Ae}=M.error,mt=M.error.response?D(M.error):`socket.message.${Ae||500}.`,ke=i(`${mt}short_description`),Ue=i(`${mt}long_description`);n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"error",messages:{short:ke,long:Ue}}:(M.error.response?Ee.close():te(),on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:Ue,initMessage:ke,item:M,showLogo:n.navigation.displayLogoImages,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})),M.error.response?Z(M.error,mt):a("error",M.response,{code:Ae,longMessage:Ue,message:ke})}),M.on("found",()=>{_e&&a("loaded"),n.navigation.displayCredentialInModal?d.value={...d.value,avatar:n.navigation.displayLogoImages?`${K}${M.config.avatar}`:void 0,messages:{short:i("credential.found.title"),long:i("credential.found.message")}}:it.updateMessages({short:i("credential.found.message")})}),M.on("loading",()=>{a("updated",M.response),n.navigation.displayCredentialInModal?d.value={...d.value,messages:{short:i("credential.loading.title"),long:i("credential.loading.message")}}:(Ee.close(),p=new Ex({}),h=on.info({showClose:!1,position:n.navigation.toastPosition,duration:0,message:Ot(hn,{assetsPath:K,buttonDisabledStyle:n.navigation.formButtonsDisabledStyle,disableFormAutocomplete:n.navigation.disableFormAutocomplete,duration:0,item:M,messagesUpdater:p,rootEmit:a,selectClass:n.navigation.selectClass,showLogo:n.navigation.displayLogoImages,showPasswordStyle:n.navigation.formShowPasswordStyle,t:i,type:"info",onError:Ae=>{te(),he(Ae)},onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}})}))}),M.on("not-found",()=>{const Ae=D(M.error);_e&&a("loaded"),n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"error",messages:{short:i(`${Ae}short_description`),long:i(`${Ae}long_description`)}}:(Ee.close(),on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:i(`${Ae}long_description`),initMessage:i(`${Ae}short_description`),t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})),Z(M.error,Ae)}),M.on("socket-error",()=>{n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"error",messages:{short:i("socket.error.short_description"),long:i("socket.error.long_description")}}:(te(),on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:0,initLongMessage:i("socket.error.long_description"),initMessage:i("socket.error.short_description"),item:M,hideForm:!0,showLogo:n.navigation.displayLogoImages,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})),j("error")}),M.on("socket-message",Ae=>{const mt=`socket.message.${Ae.code?Ae.code:500}.`,ke=i(`${mt}short_description`),Ue=i(`${mt}long_description`);n.navigation.displayCredentialInModal?d.value={...d.value,messages:{short:ke,long:Ue}}:p.updateMessages({long:Ue,short:ke}),a("status",Ae)}),M.on("socket-quick-answer",()=>{b.value=i("socket.quick_answer.short_description"),m.value=i("socket.quick_answer.long_description"),a("success",M.response),n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"success",messages:{short:i("socket.quick_answer.short_description"),long:i("socket.quick_answer.long_description")}}:(te(),on.success({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:n.navigation.toastDuration,initLongMessage:i("socket.quick_answer.long_description"),initMessage:i("socket.quick_answer.short_description"),item:M,hideForm:!0,showLogo:n.navigation.displayLogoImages,t:i,type:"success",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:n.navigation.toastDuration}))}),M.on("socket-timeout",()=>{n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"error",messages:{short:i("socket.timeout.short_description"),long:i("socket.timeout.long_description")}}:(te(),on.error({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:i("socket.timeout.long_description"),initMessage:i("socket.timeout.short_description"),item:M,showLogo:n.navigation.displayLogoImages,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})),a("error",M.response),j("timeout")}),M.on("success",()=>{const{code:Ae}=M.message,mt=`socket.message.${Ae||500}.`,ke=i(`${mt}short_description`),Ue=i(`${mt}long_description`);n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"success",messages:{short:ke,long:Ue}}:(te(),on.success({position:n.navigation.toastPosition,message:Ot(hn,{assetsPath:K,displayLongDescription:n.navigation.displayLongDescription,duration:n.navigation.toastDuration,hideForm:!0,initLongMessage:Ue,initMessage:ke,item:M,showLogo:n.navigation.displayLogoImages,t:i,type:"success",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:n.navigation.toastDuration})),a("success",M.response)}),M.on("twofa",()=>{d.value={...d.value,loading:!1}}),M.on("twofa-api-error",()=>{n.navigation.displayCredentialInModal?d.value={...d.value,loaderType:"error",messages:{short:i("credential.api_error.title"),long:i("credential.api_error.message")}}:te()}),M.on("twofa-loading",()=>{d.value={...d.value,loading:!0,loaderType:"loading",messages:{short:i("twofa.waiting"),long:i("twofa.waiting")}}})}else on.error({position:n.navigation.toastPosition,message:Ot(hn,{duration:0,initMessage:i("common.process_running"),initTitle:i("common.error"),showLogo:!1,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})}function oe(){if(v.value)return;let ce;n.entrypoint.country&&(ce=f.value.find(_e=>_e.code===n.entrypoint.country||_e.id_country===n.entrypoint.country)),f.value.length?(c.value=ce?ce.id_country:f.value[0].id_country,Ln("open_country",{id_country:c.value}),pe(),I.value=!1):I.value=!0}function pe(){if(n.entrypoint.siteOrganizationType){const ce=k.value.find(_e=>_e.id_site_organization_type===n.entrypoint.siteOrganizationType);if(ce){const _e=ce.id_site_organization_type;Ln("open_site_organization_type",{id_site_organization_type:_e}),O.value=_e}}}function Je(){A=new TL(n.token,{http:{baseURL:n.internal.apiBaseUrl?n.internal.apiBaseUrl:n.internal.apiEnv?n.internal.apiEnv==="production"?"https://sync.paybook.com":"https://api.syncfy.paybook.dev":"https://sync.paybook.com",isStrict:!!n.strict},defaultParams:{locale:n.locale,...n.internal.defaultHttpParams},isHeadless:!1,quickAnswer:n.navigation.quickAnswer,saveCredential:n.navigation.saveCredential,socketTimeout:n.navigation.socketTimeout,widgetVersion:s});let ce=null;A.on("sync_401",()=>{n.refreshTokenFunction&&!ce&&(ce=on.error({position:n.navigation.toastPosition,showClose:!1,message:Ot(J5e,{initTitle:i("common.unauthorized"),initMessage:i("common.unauthorized_message"),refreshTokenFunction:n.refreshTokenFunction,t:i,onClosed:()=>{ce=null},onCloseNotification:()=>{ce.close()},onRefreshToken:({token:_e,strict:it,resolve:Ee})=>{r("tokenRefreshed",_e),xe(_e,it).then(()=>(ce.close(),on.success({position:n.navigation.toastPosition,message:Ot(hn,{displayLongDescription:!1,duration:n.navigation.toastDuration,initMessage:i("common.session_refreshed_message"),initTitle:i("common.session_refreshed"),showLogo:!1,t:i,type:"success",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:n.navigation.toastDuration}),U(),Ee(null)))},onRefreshTokenError:()=>{on.error({position:n.navigation.toastPosition,message:Ot(hn,{displayLongDescription:!1,duration:0,initMessage:i("common.session_error"),initTitle:i("common.error"),showLogo:!1,t:i,type:"error",onImagesLoaded:()=>{a("images-loaded")},onImagesLoading:()=>{a("images-loading")}}),duration:0})}}),duration:0})),a("401")})}function xe(ce,_e){return _e?A.strictMode({token:ce,strict:_e}):A.updateToken(ce)}function Me(){a("back"),Ln("close_site",{id_site:y.config.id_site}),L.value=y=null,$.value=null,R.value.length===1&&(B.value=null)}function et(ce=!0){ce&&a("back"),L.value=y=null,G(w,!1)}return X(),t({close:ae,open:Q,setCredential:me,setToken:xe}),(ce,_e)=>(de(),Be(St,null,[_t($5e,{visible:z.value,"onUpdate:visible":_e[6]||(_e[6]=it=>z.value=it),mobile:Y(l)},{default:lt(()=>[z.value?(de(),Be("div",{key:0,class:Ce([ce.$style.container,{[ce.$style["is-mobile"]]:Y(l)}])},[T.value?(de(),nt(C5e,{key:0,client:n.client,onContinue:_e[0]||(_e[0]=()=>{T.value=!1})},null,8,["client"])):(de(),Be(St,{key:1},[Re("div",{class:Ce(ce.$style["widget-header"])},[E.value?(de(),Be("button",{key:0,"aria-label":Y(i)("common.back"),class:Ce(ce.$style["widget-back-button"]),onClick:F},[_t(Da,{icon:"back"})],10,AAe)):(de(),Be("span",IAe)),Re("h1",null,at(L.value&&n.entrypoint.site?Y(i)("common.update_title"):W.value),1),Re("button",{class:Ce(ce.$style["widget-close-button"]),"aria-label":Y(i)("common.close"),onClick:ae},[_t(Da,{icon:"close"})],10,BAe)],2),Re("div",{class:Ce(ce.$style["widget-content"])},[d.value?(de(),Be("div",{key:0,class:Ce([[ce.$style["credential-content"]],{[ce.$style["credential-twofa"]]:!d.value.loading}])},[d.value.loading?(de(),nt(ku,{key:0,avatar:d.value.avatar,grow:d.value.loaderType==="loading",message:d.value.messages.long,size:"large",title:d.value.messages.short,type:d.value.loaderType},null,8,["avatar","grow","message","title","type"])):Y(M).twofa?(de(),nt(nx,{key:1,avatar:d.value.avatar,"button-disabled-style":n.navigation.formButtonsDisabledStyle,cover:`${Y(K)}${Y(M).config.cover}`,"disable-form-autocomplete":n.navigation.disableFormAutocomplete,"enable-back-navigation":!1,"in-notification":!1,"loader-message":q.value,"select-class":n.navigation.selectClass,"show-logo":n.navigation.displayLogoImages,"show-password-style":n.navigation.formShowPasswordStyle,"site-name":Y(M).config.name,twofa:Y(M).twofa},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])):Ye("",!0),d.value.loaderType!=="loading"?(de(),Be("button",{key:2,class:"pb-w-sync_primary-button",onClick:ae},at(Y(i)("common.finish")),1)):Ye("",!0)],2)):(de(),Be(St,{key:1},[C.value?(de(),nt(ku,{key:0})):Ye("",!0),!C.value&&!v.value&&!I.value?(de(),Be(St,{key:1},[L.value?(de(),Be(St,{key:1},[L.value==="start"||L.value==="loading"?(de(),nt(P5e,{key:0,"assets-path":Y(K),"button-disabled-style":n.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":n.navigation.disableFormAutocomplete,"error-message":$.value,"loader-message":q.value,"select-class":n.navigation.selectClass,"show-logo":n.navigation.displayLogoImages,"show-password-style":n.navigation.formShowPasswordStyle,site:Y(y),"test-mode":ce.enableTestMode,onBack:Me,onError:he,onSuccess:_e[3]||(_e[3]=()=>{S.value=Y(i)("site.login.success")}),onValid:_e[4]||(_e[4]=()=>{S.value=Y(i)("site.login.authenticating"),$.value=null})},null,8,["assets-path","button-disabled-style","disable-form-autocomplete","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):Ye("",!0),L.value==="twofa"||L.value==="twofa-loading"?(de(),nt(nx,{key:1,avatar:`${Y(K)}${Y(y).config.avatar}`,"button-disabled-style":n.navigation.formButtonsDisabledStyle,cover:`${Y(K)}${Y(y).config.cover}`,"disable-form-autocomplete":n.navigation.disableFormAutocomplete,"enable-back-navigation":n.navigation.enableTwofaBackNavigation,"in-notification":!1,"loader-message":q.value,"select-class":n.navigation.selectClass,"show-logo":n.navigation.displayLogoImages,"show-password-style":n.navigation.formShowPasswordStyle,"site-name":Y(y).config.name,twofa:Y(y).twofa,onBack:et,onError:he},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","enable-back-navigation","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])):Ye("",!0),L.value==="finish"?(de(),Be(St,{key:2},[P.value?(de(),nt(l5e,{key:0,avatar:n.navigation.displayLogoImages?`${Y(K)}${Y(y).config.avatar}`:void 0,"button-disabled-style":n.navigation.formButtonsDisabledStyle,client:n.client,credential:Y(y).response.id_credential,"disable-form-autocomplete":n.navigation.disableFormAutocomplete,"select-class":n.navigation.selectClass,sync:Y(A),onDone:ae},null,8,["avatar","button-disabled-style","client","credential","disable-form-autocomplete","select-class","sync"])):(de(),nt(u5e,{key:1,avatar:`${Y(K)}${Y(y).config.avatar}`,"display-accounts-selection":n.navigation.displayAccountsSelection,"long-message":m.value,message:b.value,"one-site-flow":n.navigation.oneSiteFlow&&!!n.entrypoint.site,"show-logo":n.navigation.displayLogoImages,type:Y(y).finalResponse,onAddOther:fe,onSelectAccounts:_e[5]||(_e[5]=()=>{P.value=!0})},null,8,["avatar","display-accounts-selection","long-message","message","one-site-flow","show-logo","type"]))],64)):Ye("",!0)],64)):(de(),Be("div",kAe,[O.value?Ye("",!0):(de(),nt(v5e,{key:0,"country-id":c.value,"onUpdate:countryId":_e[1]||(_e[1]=it=>c.value=it),"organization-type-id":O.value,"onUpdate:organizationTypeId":_e[2]||(_e[2]=it=>O.value=it),"filtered-countries":f.value,"filtered-organization-types":k.value,"select-class":n.navigation.selectClass,"show-countries":!n.navigation.hideSelectCountry},null,8,["country-id","organization-type-id","filtered-countries","filtered-organization-types","select-class","show-countries"])),c.value&&O.value&&!B.value?(de(),nt(b5e,{key:1,"assets-path":Y(K),items:x.value,"show-logo":n.navigation.displayLogoImages,"show-plaid-sites-button":n.internal.plaidSites&&O.value==="__internal__.plaidSites",onSelect:H},null,8,["assets-path","items","show-logo","show-plaid-sites-button"])):Ye("",!0),c.value&&O.value&&B.value?(de(),nt(D5e,{key:2,"assets-path":Y(K),items:R.value,organization:x.value.find(it=>it.id_site_organization===B.value),"show-logo":n.navigation.displayLogoImages,onSelect:G},null,8,["assets-path","items","organization","show-logo"])):Ye("",!0)]))],64)):Ye("",!0),v.value?(de(),Be("div",{key:2,class:Ce(ce.$style["widget-data-error"])},[Re("p",null,at(v.value.length?v.value:Y(i)("common.data_error")),1),Re("button",{class:"pb-w-sync_primary-button",onClick:U},at(Y(i)("common.retry")),1)],2)):Ye("",!0),I.value?(de(),Be("div",{key:3,class:Ce(ce.$style["widget-data-error"])},[Re("p",null,at(Y(i)("common.no_filtered_data")),1),Re("button",{class:"pb-w-sync_primary-button",onClick:ae},at(Y(i)("common.close")),1)],2)):Ye("",!0)],64)),!C.value&&!v.value&&!I.value||d.value?(de(),Be("div",{key:2,class:Ce(ce.$style["security-banner"])},[Re("p",null,at(Y(i)("common.security_banner_title")),1),Re("p",null,at(Y(i)("common.security_banner_content")),1)],2)):Ye("",!0)],2)],64))],2)):Ye("",!0)]),_:1},8,["visible","mobile"]),Re("div",{class:Ce(ce.$style["widget-version"])},at(Y(s)),3)],64))}}),[["__cssModules",{$style:{container:"pb-w-sync_container","credential-content":"pb-w-sync_credential-content","credential-twofa":"pb-w-sync_credential-twofa","is-mobile":"pb-w-sync_is-mobile","security-banner":"pb-w-sync_security-banner","widget-back-button":"pb-w-sync_widget-back-button","widget-close-button":"pb-w-sync_widget-close-button","widget-content":"pb-w-sync_widget-content","widget-data-error":"pb-w-sync_widget-data-error","widget-header":"pb-w-sync_widget-header","widget-version":"pb-w-sync_widget-version"}}]]),OAe=rt({__name:"App",props:{config:{default:()=>({})},enableTestMode:{type:Boolean,default:!1},refreshTokenFunction:{type:Function,default:void 0},strict:{default:void 0},token:{}},setup(e,{expose:t}){const r=e,n=Oe(null),{t:a}=Ba();un(mw,a);const i={client:{},locale:"en",entrypoint:{country:"MX"},navigation:{disableFormAutocomplete:!1,displayAccountsSelection:!1,displayBusinessSites:!0,displayCredentialInModal:!1,displayErrorsInToast:!0,displayLogoImages:!0,displayLongDescription:!1,displayPersonalSites:!0,displayPrivacyScreen:!0,displaySiteOrganizations:[],displaySiteOrganizationTypes:[],displaySites:[],displayStatusInToast:!1,enableBackNavigation:!0,enableTwofaBackNavigation:!1,formButtonsDisabledStyle:!1,formShowPasswordStyle:"icon",hideSelectCountry:!1,hideSiteOrganizations:[],hideSiteOrganizationTypes:[],hideSites:[],oneSiteFlow:!1,quickAnswer:!1,returnToSiteFormOnUserError:!1,saveCredential:!0,selectClass:"",socketTimeout:24e4,toastDuration:5e3,toastPosition:"top-right"},__internal__:{apiBaseUrl:null,apiEnv:null,assetsBaseUrl:null,plaidSites:!1,defaultHttpParams:{}}},o=mn({client:{...i.client,..._(r.config.client)},enableTestMode:r.enableTestMode,entrypoint:{...i.entrypoint,..._(r.config.entrypoint)},internal:{...i.__internal__,..._(r.config.__internal__)},locale:r.config.locale||i.locale,navigation:{...i.navigation,..._(r.config.navigation)},refreshTokenFunction:r.refreshTokenFunction,strict:r.strict,token:r.token,onTokenRefreshed:S=>{o.token=S}});function l(){n.value.close()}function u(){Xt(()=>{n.value.open()})}function c(S={}){try{Ug.validateSync(S)}catch(T){if(T.name==="ValidationError")throw new Error(`ValidationError: ${T.message}`)}o.client={...i.client,..._(S.client)},o.entrypoint={...i.entrypoint,..._(S.entrypoint)},o.internal={...i.__internal__,..._(S.__internal__)},o.locale=S.locale||i.locale,o.navigation={...i.navigation,..._(S.navigation)}}function d(S){n.value.setCredential&&n.value.setCredential(S)}function v(S){o.entrypoint={...o.entrypoint,site:S},u()}function m(S,T){return n.value.setToken(S,T)}function b(S={}){try{Ug.validateSync(S)}catch(T){if(T.name==="ValidationError")throw new Error(`ValidationError: ${T.message}`)}o.client={...o.client,..._(S.client)},o.entrypoint={...o.entrypoint,..._(S.entrypoint)},o.internal={...o.internal,..._(S.__internal__)},o.locale=S.locale||o.locale,o.navigation={...o.navigation,..._(S.navigation)}}function _(S={}){const T={...S};return Object.keys(T).forEach(C=>{T[C]===void 0&&delete T[C]}),T}return t({close:l,open:u,setConfig:c,setEntrypointCredential:d,setEntrypointSite:v,setToken:m,upsertConfig:b}),(S,T)=>(de(),nt(Y(D8e),{locale:o.locale==="es"?Y(RCe):Y(OCe)},{default:lt(()=>[_t(NAe,la(o,{ref_key:"widgetComponent",ref:n}),null,16)]),_:1},8,["locale"]))}});function sl(e){return e||(e={}),{locale:e.locale?e.locale:"en",quickAnswer:!!e.quickAnswer,socketTimeout:e.socketTimeout||24e4}}function ll(e,t){return new Promise(n=>{const a=new TL(e.token,{http:{baseURL:"https://sync.paybook.com",isStrict:!!e.strict},defaultParams:{locale:t.locale},isHeadless:!0,quickAnswer:t.quickAnswer,socketTimeout:t.socketTimeout,widgetVersion:`${Nd()}-headless`});e.strict?a.strictMode({token:e.token,strict:e.strict}).then(()=>{n(a)}):n(a)})}function RAe(e,t,r){return new Promise((a,i)=>{const o=sl(r);ll(e,o).then(l=>{l.getAccounts({id_credential:t}).then(u=>{a(u)}).catch(u=>{i(u)})})})}function PAe(e,t){return new Promise((n,a)=>{const i=sl(t);ll(e,i).then(o=>{o.getCountries().then(l=>{n(l)}).catch(l=>{a(l)})})})}function FAe(e,t={},r){return new Promise((a,i)=>{const o=sl(r);ll(e,o).then(l=>{l.getOrganizationSites(t).then(u=>{a(u)}).catch(u=>{i(u)})})})}function LAe(e,t){return new Promise((n,a)=>{const i=sl(t);ll(e,i).then(o=>{o.getOrganizationTypes().then(l=>{n(l)}).catch(l=>{a(l)})})})}function DAe(e,t,r){return new Promise((a,i)=>{const o=sl(r);ll(e,o).then(l=>{l.getSite(t).then(u=>{a(u[0])}).catch(u=>{i(u)})})})}function $Ae(e,t,r){return new Promise(a=>{const i=sl(r);ll(e,i).then(o=>{a(o.siteConnection(t))})})}function zAe(e,t,r){return new Promise(a=>{const i=sl(r);ll(e,i).then(o=>{a(o.syncCredential(t))})})}function UAe(e,t,r,n){return new Promise(i=>{const o=sl(n);ll(e,o).then(l=>{i(new wx({...t,id_site:r},l.getHttpService(),!1))})})}const VAe={getAccounts:RAe,getCountries:PAe,getOrganizationSites:FAe,getOrganizationTypes:LAe,getSite:DAe,siteConnection:$Ae,syncCredential:zAe,twofa:UAe},qBe="";$z();class xx{constructor(t){const r=new Lpe({accessToken:"2d928ea9aa674c6ea84dbf6f3901a403",captureUncaught:!1,captureUnhandledRejections:!1,enabled:!0,environment:"production",payload:{code_version:Nd()}});let n;if(typeof t=="string")n={token:t};else if(typeof t=="object")n=t;else throw new Error("Invalid params type. Params must be either string or object.");try{CU.validateSync(n)}catch(d){if(d.name==="ValidationError")throw new Error(`ValidationError: ${d.message}`)}Ln("instantiation");const a=aN(OAe,{config:n.config,enableTestMode:n.enableTestMode,refreshTokenFunction:n.refreshTokenFunction,strict:n.strict,token:n.token}),i=Uye({availableLocales:["en","es"],fallbackLocale:"en",legacy:!1,locale:"en",messages:{en:va,es:Ei}});a.use(i),a.use(s1e),a.config.errorHandler=d=>{throw r.error(d),d};const o=[];function l(d,v){o.push({callback:v,e:d})}function u(d,...v){o.forEach(({callback:m,e:b})=>{d===b&&m(...v)})}a.provide(ia,u);const c=a.mount(n.element||"#widget");return{on:l,close:c.close,open:c.open,setConfig:c.setConfig,setEntrypointCredential:c.setEntrypointCredential,setEntrypointSite:c.setEntrypointSite,setToken:c.setToken,upsertConfig:c.upsertConfig}}static getVersion(){return Nd()}}return kt(xx,"headless",VAe),window.SyncfyWidget=xx,xx});
|