@syncfy/authentication-widget 2.1.1 → 2.1.2

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.
@@ -2586,9 +2586,9 @@ const paramsValidator = yup.object().shape({
2586
2586
  }).strict().noUnknown();
2587
2587
  let __VERSION__ = {
2588
2588
  "git": {
2589
- "hash": "gf071d3a",
2589
+ "hash": "gd5878a2",
2590
2590
  "distance": 0,
2591
- "tag": "v2.1.1"
2591
+ "tag": "v2.1.2"
2592
2592
  }
2593
2593
  };
2594
2594
  function getVersion() {
@@ -1247,6 +1247,14 @@
1247
1247
  color: #31383e;
1248
1248
  }
1249
1249
 
1250
+ .el-select__popper > .el-select-dropdown {
1251
+ position: static;
1252
+ margin: 0;
1253
+ border: none;
1254
+ background-color: transparent;
1255
+ box-shadow: none;
1256
+ }
1257
+
1250
1258
  .el-select-dropdown__item {
1251
1259
  font-size: 16px;
1252
1260
  }
@@ -2584,9 +2584,9 @@ const paramsValidator = object().shape({
2584
2584
  }).strict().noUnknown();
2585
2585
  let __VERSION__ = {
2586
2586
  "git": {
2587
- "hash": "gf071d3a",
2587
+ "hash": "gd5878a2",
2588
2588
  "distance": 0,
2589
- "tag": "v2.1.1"
2589
+ "tag": "v2.1.2"
2590
2590
  }
2591
2591
  };
2592
2592
  function getVersion() {
@@ -691,7 +691,7 @@
691
691
  */$o(wG,_G,"app");function EG(){const t=Z5({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"});RC(t),en("load")}function en(e,t){const r=RC();BC(r,e,{environment:void 0,eventAction:e,...t||{}})}var vm,PC;function SG(){if(PC)return vm;PC=1;function e(w){this._maxSize=w,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(w){return this._values[w]},e.prototype.set=function(w,M){return this._size>=this._maxSize&&this.clear(),w in this._values||this._size++,this._values[w]=M};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,r=/^\d+$/,n=/^\d/,a=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,s=512,l=new e(s),f=new e(s),d=new e(s);vm={Cache:e,split:v,normalizePath:h,setter:function(w){var M=h(w);return f.get(w)||f.set(w,function(B,D){for(var N=0,O=M.length,P=B;N<O-1;){var L=M[N];if(L==="__proto__"||L==="constructor"||L==="prototype")return B;P=P[M[N++]]}P[M[N]]=D})},getter:function(w,M){var k=h(w);return d.get(w)||d.set(w,function(D){for(var N=0,O=k.length;N<O;)if(D!=null||!M)D=D[k[N++]];else return;return D})},join:function(w){return w.reduce(function(M,k){return M+(g(k)||r.test(k)?"["+k+"]":(M?".":"")+k)},"")},forEach:function(w,M,k){b(Array.isArray(w)?w:v(w),M,k)}};function h(w){return l.get(w)||l.set(w,v(w).map(function(M){return M.replace(i,"$2")}))}function v(w){return w.match(t)||[""]}function b(w,M,k){var B=w.length,D,N,O,P;for(N=0;N<B;N++)D=w[N],D&&(T(D)&&(D='"'+D+'"'),P=g(D),O=!P&&/^\d+$/.test(D),M.call(k,D,P,O,N,w))}function g(w){return typeof w=="string"&&w&&["'",'"'].indexOf(w.charAt(0))!==-1}function y(w){return w.match(n)&&!w.match(r)}function _(w){return a.test(w)}function T(w){return!g(w)&&(y(w)||_(w))}return vm}var Os=SG(),mm,DC;function CG(){if(DC)return mm;DC=1;const e=/[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,t=h=>h.match(e)||[],r=h=>h[0].toUpperCase()+h.slice(1),n=(h,v)=>t(h).join(v).toLowerCase(),a=h=>t(h).reduce((v,b)=>`${v}${v?b[0].toUpperCase()+b.slice(1).toLowerCase():b.toLowerCase()}`,"");return mm={words:t,upperFirst:r,camelCase:a,pascalCase:h=>r(a(h)),snakeCase:h=>n(h,"_"),kebabCase:h=>n(h,"-"),sentenceCase:h=>r(n(h," ")),titleCase:h=>t(h).map(r).join(" ")},mm}var gm=CG(),jd={exports:{}},LC;function MG(){if(LC)return jd.exports;LC=1,jd.exports=function(a){return e(t(a),a)},jd.exports.array=e;function e(a,i){var s=a.length,l=new Array(s),f={},d=s,h=r(i),v=n(a);for(i.forEach(function(g){if(!v.has(g[0])||!v.has(g[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});d--;)f[d]||b(a[d],d,new Set);return l;function b(g,y,_){if(_.has(g)){var T;try{T=", node was:"+JSON.stringify(g)}catch{T=""}throw new Error("Cyclic dependency"+T)}if(!v.has(g))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(g));if(!f[y]){f[y]=!0;var w=h.get(g)||new Set;if(w=Array.from(w),y=w.length){_.add(g);do{var M=w[--y];b(M,v.get(M),_)}while(y);_.delete(g)}l[--s]=g}}}function t(a){for(var i=new Set,s=0,l=a.length;s<l;s++){var f=a[s];i.add(f[0]),i.add(f[1])}return Array.from(i)}function r(a){for(var i=new Map,s=0,l=a.length;s<l;s++){var f=a[s];i.has(f[0])||i.set(f[0],new Set),i.has(f[1])||i.set(f[1],new Set),i.get(f[0]).add(f[1])}return i}function n(a){for(var i=new Map,s=0,l=a.length;s<l;s++)i.set(a[s],s);return i}return jd.exports}var TG=MG();const AG=mi(TG),IG=Object.prototype.toString,kG=Error.prototype.toString,RG=RegExp.prototype.toString,BG=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",OG=/^Symbol\((.*)\)(.*)$/;function NG(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function xC(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const r=typeof e;if(r==="number")return NG(e);if(r==="string")return t?`"${e}"`:e;if(r==="function")return"[Function "+(e.name||"anonymous")+"]";if(r==="symbol")return BG.call(e).replace(OG,"Symbol($1)");const n=IG.call(e).slice(8,-1);return n==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):n==="Error"||e instanceof Error?"["+kG.call(e)+"]":n==="RegExp"?RG.call(e):null}function ro(e,t){let r=xC(e,t);return r!==null?r:JSON.stringify(e,function(n,a){let i=xC(this[n],t);return i!==null?i:a},2)}function FC(e){return e==null?[]:[].concat(e)}let qC,$C,UC,PG=/\$\{\s*(\w+)\s*\}/g;qC=Symbol.toStringTag;class zC{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[qC]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=a,this.errors=[],this.inner=[],FC(t).forEach(i=>{if(tn.isError(i)){this.errors.push(...i.errors);const s=i.inner.length?i.inner:[i];this.inner.push(...s)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}$C=Symbol.hasInstance,UC=Symbol.toStringTag;class tn 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(PG,(a,i)=>ro(r[i])):typeof t=="function"?t(r):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,r,n,a,i){const s=new zC(t,r,n,a);if(i)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[UC]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,tn)}static[$C](t){return zC[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Sa={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 \`${ro(n,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${ro(r,!0)}\``+a:`${e} must match the configured type. The validated value was: \`${ro(r,!0)}\``+a}},$n={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"},Uo={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"},ym={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},bm={isValue:"${path} field must be ${value}"},Kd={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Wd={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:Sa,string:$n,number:Uo,date:ym,object:Kd,array:Wd,boolean:bm,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: \`${ro(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: \`${ro(r,!0)}\``}return tn.formatError(Sa.notType,e)}}});const Qu=e=>e&&e.__isYupSchema__;class Gd{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,s=typeof n=="function"?n:(...l)=>l.every(f=>f===n);return new Gd(t,(l,f)=>{var d;let h=s(...l)?a:i;return(d=h?.(f))!=null?d:f})}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?.value,r?.parent,r?.context)),a=this.fn(n,t,r);if(a===void 0||a===t)return t;if(!Qu(a))throw new TypeError("conditions must return a schema object");return a.resolve(r)}}const Yd={context:"$",value:"."};class Ns{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]===Yd.context,this.isValue=this.key[0]===Yd.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?Yd.context:this.isValue?Yd.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&Os.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?.parent,r?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Ns.prototype.__isYupRef=!0;const Wi=e=>e==null;function Nl(e){function t({value:r,path:n="",options:a,originalValue:i,schema:s},l,f){const{name:d,test:h,params:v,message:b,skipAbsent:g}=e;let{parent:y,context:_,abortEarly:T=s.spec.abortEarly,disableStackTrace:w=s.spec.disableStackTrace}=a;const M={value:r,parent:y,context:_};function k(S={}){const o=VC(Object.assign({value:r,originalValue:i,label:s.spec.label,path:S.path||n,spec:s.spec,disableStackTrace:S.disableStackTrace||w},v,S.params),M),u=new tn(tn.formatError(S.message||b,o),r,o.path,S.type||d,o.disableStackTrace);return u.params=o,u}const B=T?l:f;let D={path:n,parent:y,type:d,from:a.from,createError:k,resolve(S){return HC(S,M)},options:a,originalValue:i,schema:s};const N=S=>{tn.isError(S)?B(S):S?f(null):B(k())},O=S=>{tn.isError(S)?B(S):l(S)};if(g&&Wi(r))return N(!0);let L;try{var F;if(L=h.call(D,r,D),typeof((F=L)==null?void 0:F.then)=="function"){if(a.sync)throw new Error(`Validation test of type: "${D.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(L).then(N,O)}}catch(S){O(S);return}N(L)}return t.OPTIONS=e,t}function VC(e,t){if(!e)return e;for(const r of Object.keys(e))e[r]=HC(e[r],t);return e}function HC(e,t){return Ns.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function DG(e,t,r,n=r){let a,i,s;return t?(Os.forEach(t,(l,f,d)=>{let h=f?l.slice(1,l.length-1):l;e=e.resolve({context:n,parent:a,value:r});let v=e.type==="tuple",b=d?parseInt(h,10):0;if(e.innerType||v){if(v&&!d)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(r&&b>=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[b],e=v?e.spec.types[b]:e.innerType}if(!d){if(!e.fields||!e.fields[h])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${s} which is a type: "${e.type}")`);a=r,r=r&&r[h],e=e.fields[h]}i=h,s=f?"["+l+"]":"."+l}),{schema:e,parent:a,parentPath:i}):{parent:a,parentPath:t,schema:e}}class Zd extends Set{describe(){const t=[];for(const r of this.values())t.push(Ns.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 Zd(this.values())}merge(t,r){const n=this.clone();return t.forEach(a=>n.add(a)),r.forEach(a=>n.delete(a)),n}}function Pl(e,t=new Map){if(Qu(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]=Pl(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,Pl(a,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const n of e)r.add(Pl(n,t))}else if(e instanceof Object){r={},t.set(e,r);for(const[n,a]of Object.entries(e))r[n]=Pl(a,t)}else throw Error(`Unable to clone ${e}`);return r}function LG(e){if(!(e!=null&&e.length))return;const t=[];let r="",n=!1,a=!1;for(let i=0;i<e.length;i++){const s=e[i];if(s==="["&&!a){r&&(t.push(...r.split(".").filter(Boolean)),r=""),n=!0;continue}if(s==="]"&&!a){r&&(/^\d+$/.test(r)?t.push(r):t.push(r.replace(/^"|"$/g,"")),r=""),n=!1;continue}if(s==='"'){a=!a;continue}if(s==="."&&!n&&!a){r&&(t.push(r),r="");continue}r+=s}return r&&t.push(...r.split(".").filter(Boolean)),t}function xG(e,t){const r=t?`${t}.${e.path}`:e.path;return e.errors.map(n=>({message:n,path:LG(r)}))}function wm(e,t){var r;if(!((r=e.inner)!=null&&r.length)&&e.errors.length)return xG(e,t);const n=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(a=>wm(a,n))}let Un=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 Zd,this._blacklist=new Zd,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Sa.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?.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=Pl(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(s=>{i.test(s.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&&Wi(i))return i;let s=ro(t),l=ro(i);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}".
692
692
 
693
693
  attempted value: ${s}
694
- `+(l!==s?`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:s=t,strict:l=this.spec.strict}=r,f=t;l||(f=this._cast(f,Object.assign({assert:!1},r)));let d=[];for(let h of Object.values(this.internalTests))h&&d.push(h);this.runTests({path:i,value:f,originalValue:s,options:r,tests:d},n,h=>{if(h.length)return a(h,f);this.runTests({path:i,value:f,originalValue:s,options:r,tests:this.tests},n,a)})}runTests(t,r,n){let a=!1,{tests:i,value:s,originalValue:l,path:f,options:d}=t,h=_=>{a||(a=!0,r(_,s))},v=_=>{a||(a=!0,n(_,s))},b=i.length,g=[];if(!b)return v([]);let y={value:s,originalValue:l,path:f,options:d,schema:this};for(let _=0;_<i.length;_++){const T=i[_];T(y,h,function(M){M&&(Array.isArray(M)?g.push(...M):g.push(M)),--b<=0&&v(g)})}}asNestedTest({key:t,index:r,parent:n,parentPath:a,originalParent:i,options:s}){const l=t??r;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const f=typeof l=="number";let d=n[l];const h=Object.assign({},s,{strict:!0,parent:n,value:d,originalValue:i[l],key:void 0,[f?"index":"key"]:l,path:f||l.includes(".")?`${a||""}[${f?l:`"${l}"`}]`:(a?`${a}.`:"")+t});return(v,b,g)=>this.resolve(h)._validate(d,h,b,g)}validate(t,r){var n;let a=this.resolve(Object.assign({},r,{value:t})),i=(n=r?.disableStackTrace)!=null?n:a.spec.disableStackTrace;return new Promise((s,l)=>a._validate(t,r,(f,d)=>{tn.isError(f)&&(f.value=d),l(f)},(f,d)=>{f.length?l(new tn(f,d,void 0,void 0,i)):s(d)}))}validateSync(t,r){var n;let a=this.resolve(Object.assign({},r,{value:t})),i,s=(n=r?.disableStackTrace)!=null?n:a.spec.disableStackTrace;return a._validate(t,Object.assign({},r,{sync:!0}),(l,f)=>{throw tn.isError(l)&&(l.value=f),l},(l,f)=>{if(l.length)throw new tn(l,t,void 0,void 0,s);i=f}),i}isValid(t,r){return this.validate(t,r).then(()=>!0,n=>{if(tn.isError(n))return!1;throw n})}isValidSync(t,r){try{return this.validateSync(t,r),!0}catch(n){if(tn.isError(n))return!1;throw n}}_getDefault(t){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,t):Pl(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=Nl({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=Nl({message:r,name:"optionality",test(a){return a===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(t=Sa.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Sa.notNull){return this.nullability(!1,t)}required(t=Sa.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=Sa.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),a=Nl(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(s=>!(s.OPTIONS.name===r.name&&(i||s.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=FC(t).map(i=>new Ns(i));return a.forEach(i=>{i.isSibling&&n.deps.push(i.key)}),n.conditions.push(typeof r=="function"?new Gd(a,r):Gd.fromOptions(a,r)),n}typeError(t){let r=this.clone();return r.internalTests.typeError=Nl({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=Sa.oneOf){let n=this.clone();return t.forEach(a=>{n._whitelist.add(a),n._blacklist.delete(a)}),n.internalTests.whiteList=Nl({message:r,name:"oneOf",skipAbsent:!0,test(a){let i=this.schema._whitelist,s=i.resolveAll(this.resolve);return s.includes(a)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:s}})}}),n}notOneOf(t,r=Sa.notOneOf){let n=this.clone();return t.forEach(a=>{n._blacklist.add(a),n._whitelist.delete(a)}),n.internalTests.blacklist=Nl({message:r,name:"notOneOf",test(a){let i=this.schema._blacklist,s=i.resolveAll(this.resolve);return s.includes(a)?this.createError({params:{values:Array.from(i).join(", "),resolved:s}}):!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:s}=r.spec;return{meta:a,label:n,optional:i,nullable:s,default:r.getDefault(t),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.filter((f,d,h)=>h.findIndex(v=>v.OPTIONS.name===f.OPTIONS.name)===d).map(f=>{const d=f.OPTIONS.params&&t?VC(Object.assign({},f.OPTIONS.params),t):f.OPTIONS.params;return{name:f.OPTIONS.name,params:d}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(n){try{return{value:await t.validate(n,{abortEarly:!1})}}catch(a){if(a instanceof tn)return{issues:wm(a)};throw a}}}}};Un.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Un.prototype[`${e}At`]=function(t,r,n={}){const{parent:a,parentPath:i,schema:s}=DG(this,t,r,n.context);return s[e](a&&a[i],Object.assign({},n,{parent:a,path:t}))};for(const e of["equals","is"])Un.prototype[e]=Un.prototype.oneOf;for(const e of["not","nope"])Un.prototype[e]=Un.prototype.notOneOf;const FG=()=>!0;function _m(e){return new jC(e)}class jC extends Un{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:FG},t))}}_m.prototype=jC.prototype;function Yr(){return new KC}class KC extends Un{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=bm.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return Wi(r)||r===!0}})}isFalse(t=bm.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return Wi(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)}}Yr.prototype=KC.prototype;const qG=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function $G(e){const t=Em(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 Em(e){var t,r;const n=qG.exec(e);return n?{year:no(n[1]),month:no(n[2],1)-1,day:no(n[3],1),hour:no(n[4]),minute:no(n[5]),second:no(n[6]),millisecond:n[7]?no(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:no(n[10]),minuteOffset:no(n[11])}:null}function no(e,t=0){return Number(e)||t}let UG=/^[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])?)*$/,zG=/^((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,VG=/^(?:[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,HG="^\\d{4}-\\d{2}-\\d{2}",jG="\\d{2}:\\d{2}:\\d{2}",KG="(([+-]\\d{2}(:?\\d{2})?)|Z)",WG=new RegExp(`${HG}T${jG}(\\.\\d+)?${KG}$`),GG=e=>Wi(e)||e===e.trim(),YG={}.toString();function wr(){return new WC}class WC extends Un{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===YG?t:a})})}required(t){return super.required(t).withMutation(r=>r.test({message:t||Sa.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=$n.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=$n.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=$n.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||$n.matches,params:{regex:t},skipAbsent:!0,test:s=>s===""&&n||s.search(t)!==-1})}email(t=$n.email){return this.matches(UG,{name:"email",message:t,excludeEmptyString:!0})}url(t=$n.url){return this.matches(zG,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=$n.uuid){return this.matches(VG,{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(WG,{name:"datetime",message:r||$n.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||$n.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:i=>{if(!i||n)return!0;const s=Em(i);return s?!!s.z:!1}}).test({name:"datetime_precision",message:r||$n.datetime_precision,params:{precision:a},skipAbsent:!0,test:i=>{if(!i||a==null)return!0;const s=Em(i);return s?s.precision===a:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=$n.trim){return this.transform(r=>r!=null?r.trim():r).test({message:t,name:"trim",test:GG})}lowercase(t=$n.lowercase){return this.transform(r=>Wi(r)?r:r.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>Wi(r)||r===r.toLowerCase()})}uppercase(t=$n.uppercase){return this.transform(r=>Wi(r)?r:r.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>Wi(r)||r===r.toUpperCase()})}}wr.prototype=WC.prototype;let ZG=e=>e!=+e;function Jd(){return new GC}class GC extends Un{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!ZG(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=Uo.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=Uo.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=Uo.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=Uo.moreThan){return this.test({message:r,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(n){return n>this.resolve(t)}})}positive(t=Uo.positive){return this.moreThan(0,t)}negative(t=Uo.negative){return this.lessThan(0,t)}integer(t=Uo.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(t=>Wi(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=>Wi(a)?a:Math[t](a))}}Jd.prototype=GC.prototype;let JG=new Date(""),XG=e=>Object.prototype.toString.call(e)==="[object Date]";class Sm extends Un{constructor(){super({type:"date",check(t){return XG(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,r,n)=>!n.spec.coerce||n.isType(t)||t===null?t:(t=$G(t),isNaN(t)?Sm.INVALID_DATE:new Date(t)))})}prepareParam(t,r){let n;if(Ns.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=ym.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=ym.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)}})}}Sm.INVALID_DATE=JG;function QG(e,t=[]){let r=[],n=new Set,a=new Set(t.map(([s,l])=>`${s}-${l}`));function i(s,l){let f=Os.split(s)[0];n.add(f),a.has(`${l}-${f}`)||r.push([l,f])}for(const s of Object.keys(e)){let l=e[s];n.add(s),Ns.isRef(l)&&l.isSibling?i(l.path,s):Qu(l)&&"deps"in l&&l.deps.forEach(f=>i(f,s))}return AG.array(Array.from(n),r).reverse()}function YC(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 ZC(e){return(t,r)=>YC(e,t)-YC(e,r)}const JC=(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 Xd(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Xd(n);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=Xd(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(Xd)}):"optional"in e?e.optional():e}const eY=(e,t)=>{const r=[...Os.normalizePath(t)];if(r.length===1)return r[0]in e;let n=r.pop(),a=Os.getter(Os.join(r),!0)(e);return!!(a&&n in a)};let XC=e=>Object.prototype.toString.call(e)==="[object Object]";function QC(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(n=>r.indexOf(n)===-1)}const tY=ZC([]);function gi(e){return new eM(e)}class eM extends Un{constructor(t){super({type:"object",check(r){return XC(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=tY,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,s=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(a).filter(v=>!this._nodes.includes(v))),f={},d=Object.assign({},r,{parent:f,__validating:r.__validating||!1}),h=!1;for(const v of l){let b=i[v],g=v in a;if(b){let y,_=a[v];d.path=(r.path?`${r.path}.`:"")+v,b=b.resolve({value:_,context:r.context,parent:f});let T=b instanceof Un?b.spec:void 0,w=T?.strict;if(T!=null&&T.strip){h=h||v in a;continue}y=!r.__validating||!w?b.cast(a[v],d):a[v],y!==void 0&&(f[v]=y)}else g&&!s&&(f[v]=a[v]);(g!==v in f||f[v]!==a[v])&&(h=!0)}return h?f:a}_validate(t,r={},n,a){let{from:i=[],originalValue:s=t,recursive:l=this.spec.recursive}=r;r.from=[{schema:this,value:s},...i],r.__validating=!0,r.originalValue=s,super._validate(t,r,n,(f,d)=>{if(!l||!XC(d)){a(f,d);return}s=s||d;let h=[];for(let v of this._nodes){let b=this.fields[v];!b||Ns.isRef(b)||h.push(b.asNestedTest({options:r,key:v,parent:d,parentPath:r.path,originalParent:s}))}this.runTests({tests:h,value:d,originalValue:s,options:r},n,v=>{a(v.sort(this._sortErrors).concat(f),d)})})}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 s=n[a];n[a]=s===void 0?i:s}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 s=t;(a=s)!=null&&a.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[n]})),r[n]=i&&"getDefault"in i?i.getDefault(s):void 0}),r}setFields(t,r){let n=this.clone();return n.fields=t,n._nodes=QG(t,r),n._sortErrors=ZC(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 Xd(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=Os.getter(t,!0);return this.transform(i=>{if(!i)return i;let s=i;return eY(i,t)&&(s=Object.assign({},i),n||delete s[t],s[r]=a(i)),s})}json(){return this.transform(JC)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Kd.exact,test(r){if(r==null)return!0;const n=QC(this.schema,r);return n.length===0||this.createError({params:{properties:n.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,r=Kd.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=QC(this.schema,a);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return n.spec.noUnknown=t,n}unknown(t=!0,r=Kd.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(gm.camelCase)}snakeCase(){return this.transformKeys(gm.snakeCase)}constantCase(){return this.transformKeys(t=>gm.snakeCase(t).toUpperCase())}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);n.fields={};for(const[i,s]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]=s.describe(l)}return n}}gi.prototype=eM.prototype;function zo(e){return new tM(e)}class tM extends Un{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((s,l)=>{const f=this.innerType.cast(s,Object.assign({},r,{path:`${r.path||""}[${l}]`}));return f!==s&&(a=!0),f});return a?i:n}_validate(t,r={},n,a){var i;let s=this.innerType,l=(i=r.recursive)!=null?i:this.spec.recursive;r.originalValue!=null&&r.originalValue,super._validate(t,r,n,(f,d)=>{var h;if(!l||!s||!this._typeCheck(d)){a(f,d);return}let v=new Array(d.length);for(let g=0;g<d.length;g++){var b;v[g]=s.asNestedTest({options:r,index:g,parent:d,parentPath:r.path,originalParent:(b=r.originalValue)!=null?b:t})}this.runTests({value:d,tests:v,originalValue:(h=r.originalValue)!=null?h:t,options:r},n,g=>a(g.concat(f),d))})}clone(t){const r=super.clone(t);return r.innerType=this.innerType,r}json(){return this.transform(JC)}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(!Qu(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+ro(t));return r.innerType=t,r.spec=Object.assign({},r.spec,{types:t}),r}length(t,r=Wd.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||Wd.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||Wd.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}}zo.prototype=tM.prototype;function rM(e){return new Cm(e)}function nM(e){try{return e()}catch(t){if(tn.isError(t))return Promise.reject(t);throw t}}class Cm{constructor(t){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(r,n={})=>{let a=this.builder(r,n);if(!Qu(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 Cm(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,s=a[n??r];return this._resolve(s,Object.assign({},i,{value:s,parent:a})).asNestedTest(t)}validate(t,r){return nM(()=>this._resolve(t,r).validate(t,r))}validateSync(t,r){return this._resolve(t,r).validateSync(t,r)}validateAt(t,r,n){return nM(()=>this._resolve(r,n).validateAt(t,r,n))}validateSyncAt(t,r,n){return this._resolve(r,n).validateSyncAt(t,r,n)}isValid(t,r){try{return this._resolve(t,r).isValid(t,r)}catch(n){if(tn.isError(n))return Promise.resolve(!1);throw n}}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}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(n){try{return{value:await t.validate(n,{abortEarly:!1})}}catch(a){if(tn.isError(a))return{issues:wm(a)};throw a}}}}}const Mm=gi().noUnknown().shape({client:gi().noUnknown().shape({logo:wr(),name:wr()}),entrypoint:gi().noUnknown().shape({account:wr(),country:wr(),credential:wr(),site:wr(),siteOrganizationType:wr(),updateCredential:wr()}),locale:wr().oneOf(["es","en"]),navigation:gi().noUnknown().shape({disableFormAutocomplete:Yr(),displayAccountsSelection:Yr(),displayBusinessSites:Yr(),displayCredentialInModal:Yr(),displayErrorsInToast:Yr(),displayLogoImages:Yr(),displayLongDescription:Yr(),displayPersonalSites:Yr(),displayPrivacyScreen:Yr(),displaySiteOrganizations:zo().of(wr()),displaySiteOrganizationTypes:zo().of(wr()),displaySites:zo().of(wr()),displayStatusInToast:Yr(),enableBackNavigation:Yr(),enableTwofaBackNavigation:Yr(),formButtonsDisabledStyle:Yr(),formShowPasswordStyle:wr().oneOf(["icon","none","text"]),getSelectedAccounts:_m().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),hideSelectCountry:Yr(),hideSiteOrganizations:zo().of(wr()),hideSiteOrganizationTypes:zo().of(wr()),hideSites:zo().of(wr()),oneSiteFlow:Yr(),quickAnswer:Yr(),requireConsent:Yr(),returnToSiteFormOnUserError:rM(e=>typeof e=="object"?zo().of(Jd().oneOf([401,403,411])):Yr()),saveCredential:Yr(),selectClass:wr(),socketTimeout:Jd().min(1),toastDuration:Jd().min(0),toastPosition:wr().oneOf(["bottom-left","bottom-right","top-left","top-right"])}),__internal__:gi().noUnknown().shape({apiBaseUrl:wr(),apiEnv:wr().oneOf(["development","production"]),assetsBaseUrl:wr(),plaidSites:Yr(),defaultHttpParams:gi()})}),rY=gi().shape({token:wr().required(),element:rM(e=>{switch(typeof e){case"string":return wr().test("isElement","${path} is not an Element",t=>{if(!document.querySelector(t))throw new tn(`Invalid selector: Element "${t}" not found.`);return!0});case"object":return gi().test("isElement","${path} is not an Element",t=>{if(!kj(t))throw new tn("Invalid element: Object should be a valid HtmlElement.");return!0});default:return wr()}}),refreshTokenFunction:_m().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),enableTestMode:Yr(),strict:gi().noUnknown().nullable().shape({authorization:gi().noUnknown().required().shape({type:wr().oneOf(["jwk"]).required(),key:wr().required()}),body:gi().noUnknown().required().shape({type:wr().oneOf(["jwk"]).required(),key:wr().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:Mm}).strict().noUnknown();let Tm={git:{hash:"gf071d3a",distance:0,tag:"v2.1.1"}};function Qd(){let e=`${Tm.git.tag}.${Tm.git.distance}`;return e=`${e}-${Tm.git.hash}`,e}function nY(e,t){const r=parseInt("0x4",16),n="38060000000000000000000000000000000000000000000F00000000000000000000000000000000000D9802010000010101000000000000";let a;return iY().then(()=>(a=new digipass.nativebridge.DP110,new Promise((s,l)=>{a.onError(()=>l("bridge.not_ready")),a.onReady(f=>{if(f.versionCode<a.versionCode&&l("bridge.host_update_available"),a.isReady())a.getTokenInfo(r,function(h){if(h.returnCode!==0)return l(`bridge.${Math.abs(h.returnCode)}`);a.generateOTP(n,t,function(v){if(v.returnCode!==0)return l(`bridge.${Math.abs(v.returnCode)}`);s({token:`${e}XX${v.otp}XX${h.info}XX${f.versionCode}`,challenge:t})})});else return Promise.reject("bridge.not_ready")})})))}function iY(){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])}function aY(){const e=window.bridgeBluetooth;if(e.timeoutValidation=!1,e.cryptoAppOTP=7,!e.bridge.isReady()){e.bridge.reconnect();return}clearTimeout(e.varSetTime),e.bridge.generateResponseOnlyOTP(e.cryptoAppOTP,function(t){t.returnCode!=0?(t.returnCode==-6014||t.returnCode==-6015||t.returnCode==-6016)&&eh(!1,!1):e.timeoutValidation||(e.validOTP=!0,e.valFinalFlow=!0,e.token=t.otp,e.acceptB?sM():(hY(),oM()))})}function oY(e){const t=window.bridgeBluetooth;return new Promise((r,n)=>{t.resolve=r,t.reject=n,fY(e)})}function sY(e){const t=window.bridgeBluetooth;return new Promise((r,n)=>{t.resolve=r,t.reject=n,cY(e)})}function lY(e,t){window.bridgeBluetooth={acceptB:null,accesLogin:!0,bridge:null,cancelB:!1,cancelB2:!1,changeIdNameOtp:!1,claveInsSegOTP:null,contNB:2,contNBReady:0,contNBVersion:0,cryptoAppOTP:null,digipassSerial:null,eai_firma_DP110:null,eai_serial_DP110:null,isChequeLineaOrSAT:null,jspDesafio:t,jspToken:e,nbProcessIsComplete:!1,resolve:null,reject:null,setTimeReady:!1,switchState:!0,timeoutValidation:!1,token:"",valFinalFlow:!1,validOTP:!1,varSetTime:null,versionCode:null};const r=window.bridgeBluetooth;return uY().then(()=>new Promise((a,i)=>{r.resolve=a,r.reject=i,aM()}))}function uY(){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("widgetBridgeBluetooth"))return r();const a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("id","widgetBridgeBluetooth"),a.setAttribute("src","https://www.paybook.com/lib/syncfy/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])}function iM(){const e=window.bridgeBluetooth;e.accesLogin&&(e.cancelB||(e.valFinalFlow=!0,e.token="********",e.resolve(e.token)),e.accesLogin=!1)}function cY(e){const t=window.bridgeBluetooth,r=JSON.parse(e);r.estado!=="OK"||t.cancelB2||gY(r.requestMessage)}function fY(e){const t=JSON.parse(e);t.estado!=="OK"||yY(t.requestMessage)}function dY(){const e=window.bridgeBluetooth;if(!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.initializeDigipass(e.digipassSerial,function(t){t.returnCode!=0||e.bridge.getDigipassTimeChallenge(function(r){r.returnCode!=0?Am(function(){e.switchState&&ec()},5e3,"timeOut"):(clearTimeout(e.varSetTime),e.timeoutValidation=!1,e.setTimeReady?iM():bY())})})}function aM(){const e=window.bridgeBluetooth;try{e.bridge=new digipass.nativebridge.DPToken,e.bridge.getDigipassTimeChallenge(function(){eh(!0,!1)}),e.bridge.onError(function(){e.contNB++,e.nbProcessIsComplete||e.contNB<=4&&(e.accesLogin?e.bridge.reconnect():e.bridge.getDigipassTimeChallenge(function(){}))}),e.bridge.onReady(function(){clearTimeout(e.varSetTime),e.contNB=0,e.contNBReady===0&&(e.validOTP||(Am(function(){e.timeoutValidation=!0},3e4,"timeOut"),e.switchState&&ec()),e.contNBReady++)})}catch(t){e.reject(t)}}function ec(){const e=window.bridgeBluetooth;if(e.digipassSerial=null,!e.bridge.isReady()){e.bridge.reconnect();return}if(e.contNBVersion===0&&e.bridge.getNativeBridgeVersion(function(t){e.versionCode=t.versionCode,e.contNBVersion++}),!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.getDigipassList(function(t){e.timeoutValidation||t.returnCode!=0||(t.devices.length==0?e.switchState&&ec():(t.devices.forEach(r=>{r.digipassSerial===e.jspToken&&(e.digipassSerial=r.digipassSerial,e.jspDesafio!=="null"&&(e.eai_serial_DP110=e.jspToken))}),e.digipassSerial===null?e.switchState&&ec():e.timeoutValidation||dY()))})}function oM(){const e=window.bridgeBluetooth;if(e.switchState){let t="";e.token!==void 0?(t=e.token,e.token=t+e.cryptoAppOTP):(t=e.claveInsSegOTP,e.claveInsSegOTP=t+e.cryptoAppOTP)}e.resolve(`${e.token}XX${e.eai_firma_DP110}XX${e.eai_serial_DP110}XX${e.versionCode}`)}function hY(){const e=window.bridgeBluetooth;e.changeIdNameOtp=!0}function pY(){const e=window.bridgeBluetooth;e.changeIdNameOtp=!1}function vY(e,t){const r=window.bridgeBluetooth;if(!r.bridge.isReady()){r.bridge.reconnect();return}r.bridge.parseResponseMessage(e,t,function(n){n.returnCode!=0?(n.returnCode==-6014||n.returnCode==-6015||n.returnCode==-6016)&&eh(!1,!1):r.timeoutValidation||(r.validOTP=!0,r.jspDesafio!=="null"&&(r.eai_firma_DP110=n.messageSignature),aY())})}function mY(e,t){const r=window.bridgeBluetooth;if(!r.bridge.isReady()){r.bridge.reconnect();return}r.bridge.parseResponseMessage(e,t,function(n){n.returnCode!=0||(r.setTimeReady=!0,iM())})}function gY(e){const t=window.bridgeBluetooth;if(!t.bridge.isReady()){t.bridge.reconnect();return}t.bridge.transmitRequestMessage(e,function(r){r.returnCode!=0||vY(r.responseMessage,e)})}function yY(e){const t=window.bridgeBluetooth;if(!t.bridge.isReady()){t.bridge.reconnect();return}t.bridge.transmitRequestMessage(e,function(r){r.returnCode!=0||mY(r.responseMessage,e)})}function sM(){const e=window.bridgeBluetooth;clearTimeout(e.varSetTime),oM()}function bY(){const e=window.bridgeBluetooth;if(!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.getDigipassTimeChallenge(function(t){t.returnCode!=0||e.resolve(t.timeChallenge)})}function Am(e,t,r){const n=window.bridgeBluetooth;switch(r){case"timeOut":n.varSetTime=setTimeout(e,t);break;case"interval":setInterval(e,t);break}}function eh(e,t){const r=window.bridgeBluetooth,n="";if(r.timeoutValidation=!1,r.acceptB=t,clearTimeout(r.varSetTime),r.token.length!=8&&!t&&(r.validOTP=!1),t||(r.switchState=e),e)if(r.contNBVersion=0,r.valFinalFlow=!1,t||(r.accesLogin=!0,r.cancelB=!1),r.validOTP)sM(),r.valFinalFlow=!0;else{if(r.contNBVersion=0,r.cancelB2=!1,r.contNB=2,t||(r.token=n),r.bridge===void 0&&aM(),!r.bridge.isReady()){r.bridge.reconnect();return}clearTimeout(r.varSetTime),Am(function(){r.timeoutValidation=!0},3e4,"timeOut"),r.contNBReady!==0?ec():r.bridge.reconnect()}else clearTimeout(r.varSetTime),r.validOTP=!0,r.cancelB=!0,r.cancelB2=!0,pY(),r.claveInsSegOTP=n,r.token=n}function wY(){eh(!0,!0)}const yi="bridgeBluetooth";function _Y(e){const t=window[yi];return new Promise((n,a)=>{t.resolve=n,t.reject=a;let i,s;const{authenticationData:l}=e.authenticationResponse;l[0].idAuthenticationData==="signedMessage"?([i]=l[0].authenticationData,[s]=l[1].authenticationData):([i]=l[1].authenticationData,[s]=l[0].authenticationData),RY({signedMessage:i,signedTimeMessage:s})})}async function EY(){const e=window[yi];return new Promise(async(t,r)=>{if(e.nativeBridgeInstance.isReady())try{const n=await async function(a){return new Promise((i,s)=>{a.getDigipassTimeChallenge(l=>{if(l.returnCode!==0){const d={title:"Generar - TimeChallenge",response:{message:"Se ha producido un error al generar el TimeChallenge. Por favor, aseg\xFArate de tener tu token conectado y encendido.",returnCode:l.returnCode}};return void s(d)}const f={title:"Generar - TimeChallenge",response:{message:`El TimeChallenge es: ${l.timeChallenge}`,timeChallenge:l.timeChallenge,errorCode:""}};i(f)})})}(e.nativeBridgeInstance);t(n)}catch(n){r(n)}else r({title:"Error de conexi\xF3n",response:{message:"No es posible interactuar con el dispositivo.",errorCode:""}})})}function SY(e){window[yi]={isDp785Signature:!1,nativeBridgeInstance:null,resolve:null,reject:null};const t=window[yi];return CY().then(()=>new Promise((n,a)=>{t.resolve=n,t.reject=a,t.isDp785Signature=e!=="214",t.nativeBridgeInstance=new window.digipass.nativebridge.DPToken,kY()}))}function CY(){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","undefineddigipass.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","undefineddigipass.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 MY(){const e=window[yi];try{const t=await TY(e.isDp785Signature);if(t.length===1){const[r]=t;await AY(r.serial);const n=await EY();e.resolve(n.response.timeChallenge)}}catch(t){e.reject(t),alert("Por favor, aseg\xFArate de tener tu token conectado y encendido.")}}async function TY(e){const t=window[yi];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(f){return new Promise((d,h)=>{f.getDigipassList(v=>{if(v.returnCode===0)d(v.devices);else{const b={title:"Listar dispositivos",response:{message:"Error al obtener la lista de dispositivos disponibles.",returnCode:v.returnCode}};h(b)}})})}(t.nativeBridgeInstance),s=i.map(f=>({name:f.deviceName,serial:f.digipassSerial})),[l]=s;if(!l||!l.serial)return void n({title:"Error de conexi\xF3n",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:a}});r(s)}catch(i){n(i)}else n({title:"Error de conexi\xF3n",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:a}})})}async function AY(e){const t=window[yi];return new Promise((r,n)=>{t.nativeBridgeInstance.initializeDigipass(e,a=>{if(a.returnCode!==0){const s={title:"Inicializar dispositivo",response:{message:"Error al intentar inicializar el dispositivo.",returnCode:a.returnCode}};return void n(s)}const i={title:"Inicializar dispositivo",response:{message:`El dispositivo con serial: ${e} est\xE1 listo para ser usado.`,errorCode:""}};r(i)})})}async function IY(e){const t=window[yi];return new Promise(async(r,n)=>{if(t.nativeBridgeInstance.isReady())try{const a=await async function(i,s){return new Promise((l,f)=>{i.generateResponseOnlyOTP(s,d=>{if(d.returnCode!==0){const v={title:"Generar OTP con PIN",response:{message:"No fue posible generar la OTP.",returnCode:d.returnCode}};return void f(v)}const h={title:"Generar OTP con PIN",response:{message:`La OTP se gener\xF3 correctamente: ${d.otp}`,otp:d.otp,errorCode:"",processType:"DP785_T4_LINKED"}};l(h)})})}(t.nativeBridgeInstance,e);r(a)}catch(a){n(a)}else n({title:"Error de conexi\xF3n",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:"DP785_T4_NOT_LINKED"}})})}async function kY(){const e=window[yi],t=await BY();if(t.response.errorCode!==""){alert(t.response.message),e.reject(t.response.errorCode);return}else await MY()}async function RY({signedMessage:e="",signedTimeMessage:t=""}){const r=window[yi];try{await lM(t,r.isDp785Signature);const n=await lM(e,r.isDp785Signature),{response:{messageSignature:a}}=n,i=7,s=await IY(i),{response:{otp:l}}=s,f={};f.otpChallenge=a;const d=`${l}${i}`;f.otp=d,r.resolve(`${f.otpChallenge}XX${f.otp}`)}catch(n){r.reject(n),alert("Error al intentar validar la sesi\xF3n desde el dispositivo de acceso seguro.")}}async function BY(){const e=window[yi];return new Promise((t,r)=>{e.nativeBridgeInstance.onReady(()=>{e.nativeBridgeInstance.getNativeBridgeVersion(n=>{const a={title:"Conexi\xF3n 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\xF3n con Native Bridge",response:{errorCode:"222",message:"El software Native Bridge no se encontr\xF3 instalado en tu ordenador.",processType:"DP785_T4_NOT_LINKED"}})})})}async function lM(e,t){const r=window[yi];return new Promise(async(n,a)=>{const i=t?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(r.nativeBridgeInstance.isReady())try{const{responseMessage:s}=await async function(f,d){return new Promise((h,v)=>{f.transmitRequestMessage(d,b=>{if(b.returnCode===0)h(b);else{const g={title:"Firmar mensaje",response:{message:"No fue posible transmitir el mensaje.",returnCode:b.returnCode}};v(g)}})})}(r.nativeBridgeInstance,e),l=await async function(f,d,h){return new Promise((v,b)=>{f.parseResponseMessage(d,h,g=>{if(g.returnCode!==0){const _={title:"Firmar mensaje",response:{message:"No fue posible parsear el mensaje.",returnCode:g.returnCode}};return void b(_)}const y={title:"Firmar mensaje",response:{message:`Se realiz\xF3 la firma del mensaje correctamente: ${g.messageSignature}`,messageSignature:g.messageSignature,errorCode:"",processType:"DP785_T4_LINKED"}};v(y)})})}(r.nativeBridgeInstance,s,e);n(l)}catch(s){a(s)}else a({title:"Error de conexi\xF3n",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:i}})})}const th=/\{([a-z_]+)\}/g;function OY(e){const t=e.documents||[],r=[];let n=0,a;for(th.lastIndex=0;(a=th.exec(e.text))!==null;){const i=t.find(s=>s.role===a[1]);a.index>n&&r.push({text:e.text.slice(n,a.index)}),r.push(i?{document:i,text:i.label}:{text:a[0]}),n=a.index+a[0].length}return n<e.text.length&&r.push({text:e.text.slice(n)}),r}function NY(e,t=!1){const r=e?.is_business===1,n=e?.is_personal===1;return r&&!n?"legal_entity":n&&!r?"individual":t?"legal_entity":"individual"}function PY(e){var t,r,n;const a=(t=e?.response)==null?void 0:t.status,i=((n=(r=e?.response)==null?void 0:r.data)==null?void 0:n.message)||"";return a===409?"stale":a===400&&/consent/i.test(i)?"missing":null}function DY(e){const t=e.documents||[];return th.lastIndex=0,Array.from(e.text.matchAll(th)).some(r=>!t.some(n=>n.role===r[1]))}const Dl={enables:["download_options"],name:"download_options_active",required:!1,translate_label:"download_options.switch",type:"switch",validation:null},Im={name:"download_options",required:!1,enabled_by:"download_options_active",translate_error_label:"download_options.label",type:"date_range",validation:null},Ll=["56cf5728784806f72b8b456f","5da784f1f9de2a06483abec1"];var km={},tc={},uM;function LY(){if(uM)return tc;uM=1,tc.byteLength=l,tc.toByteArray=d,tc.fromByteArray=b;for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,i=n.length;a<i;++a)e[a]=n[a],t[n.charCodeAt(a)]=a;t[45]=62,t[95]=63;function s(g){var y=g.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var _=g.indexOf("=");_===-1&&(_=y);var T=_===y?0:4-_%4;return[_,T]}function l(g){var y=s(g),_=y[0],T=y[1];return(_+T)*3/4-T}function f(g,y,_){return(y+_)*3/4-_}function d(g){var y,_=s(g),T=_[0],w=_[1],M=new r(f(g,T,w)),k=0,B=w>0?T-4:T,D;for(D=0;D<B;D+=4)y=t[g.charCodeAt(D)]<<18|t[g.charCodeAt(D+1)]<<12|t[g.charCodeAt(D+2)]<<6|t[g.charCodeAt(D+3)],M[k++]=y>>16&255,M[k++]=y>>8&255,M[k++]=y&255;return w===2&&(y=t[g.charCodeAt(D)]<<2|t[g.charCodeAt(D+1)]>>4,M[k++]=y&255),w===1&&(y=t[g.charCodeAt(D)]<<10|t[g.charCodeAt(D+1)]<<4|t[g.charCodeAt(D+2)]>>2,M[k++]=y>>8&255,M[k++]=y&255),M}function h(g){return e[g>>18&63]+e[g>>12&63]+e[g>>6&63]+e[g&63]}function v(g,y,_){for(var T,w=[],M=y;M<_;M+=3)T=(g[M]<<16&16711680)+(g[M+1]<<8&65280)+(g[M+2]&255),w.push(h(T));return w.join("")}function b(g){for(var y,_=g.length,T=_%3,w=[],M=16383,k=0,B=_-T;k<B;k+=M)w.push(v(g,k,k+M>B?B:k+M));return T===1?(y=g[_-1],w.push(e[y>>2]+e[y<<4&63]+"==")):T===2&&(y=(g[_-2]<<8)+g[_-1],w.push(e[y>>10]+e[y>>4&63]+e[y<<2&63]+"=")),w.join("")}return tc}var rh={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var cM;function xY(){return cM||(cM=1,rh.read=function(e,t,r,n,a){var i,s,l=a*8-n-1,f=(1<<l)-1,d=f>>1,h=-7,v=r?a-1:0,b=r?-1:1,g=e[t+v];for(v+=b,i=g&(1<<-h)-1,g>>=-h,h+=l;h>0;i=i*256+e[t+v],v+=b,h-=8);for(s=i&(1<<-h)-1,i>>=-h,h+=n;h>0;s=s*256+e[t+v],v+=b,h-=8);if(i===0)i=1-d;else{if(i===f)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,n),i=i-d}return(g?-1:1)*s*Math.pow(2,i-n)},rh.write=function(e,t,r,n,a,i){var s,l,f,d=i*8-a-1,h=(1<<d)-1,v=h>>1,b=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,y=n?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+v>=1?t+=b/f:t+=b*Math.pow(2,1-v),t*f>=2&&(s++,f/=2),s+v>=h?(l=0,s=h):s+v>=1?(l=(t*f-1)*Math.pow(2,a),s=s+v):(l=t*Math.pow(2,v-1)*Math.pow(2,a),s=0));a>=8;e[r+g]=l&255,g+=y,l/=256,a-=8);for(s=s<<a|l,d+=a;d>0;e[r+g]=s&255,g+=y,s/=256,d-=8);e[r+g-y]|=_*128}),rh}/*!
694
+ `+(l!==s?`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:s=t,strict:l=this.spec.strict}=r,f=t;l||(f=this._cast(f,Object.assign({assert:!1},r)));let d=[];for(let h of Object.values(this.internalTests))h&&d.push(h);this.runTests({path:i,value:f,originalValue:s,options:r,tests:d},n,h=>{if(h.length)return a(h,f);this.runTests({path:i,value:f,originalValue:s,options:r,tests:this.tests},n,a)})}runTests(t,r,n){let a=!1,{tests:i,value:s,originalValue:l,path:f,options:d}=t,h=_=>{a||(a=!0,r(_,s))},v=_=>{a||(a=!0,n(_,s))},b=i.length,g=[];if(!b)return v([]);let y={value:s,originalValue:l,path:f,options:d,schema:this};for(let _=0;_<i.length;_++){const T=i[_];T(y,h,function(M){M&&(Array.isArray(M)?g.push(...M):g.push(M)),--b<=0&&v(g)})}}asNestedTest({key:t,index:r,parent:n,parentPath:a,originalParent:i,options:s}){const l=t??r;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");const f=typeof l=="number";let d=n[l];const h=Object.assign({},s,{strict:!0,parent:n,value:d,originalValue:i[l],key:void 0,[f?"index":"key"]:l,path:f||l.includes(".")?`${a||""}[${f?l:`"${l}"`}]`:(a?`${a}.`:"")+t});return(v,b,g)=>this.resolve(h)._validate(d,h,b,g)}validate(t,r){var n;let a=this.resolve(Object.assign({},r,{value:t})),i=(n=r?.disableStackTrace)!=null?n:a.spec.disableStackTrace;return new Promise((s,l)=>a._validate(t,r,(f,d)=>{tn.isError(f)&&(f.value=d),l(f)},(f,d)=>{f.length?l(new tn(f,d,void 0,void 0,i)):s(d)}))}validateSync(t,r){var n;let a=this.resolve(Object.assign({},r,{value:t})),i,s=(n=r?.disableStackTrace)!=null?n:a.spec.disableStackTrace;return a._validate(t,Object.assign({},r,{sync:!0}),(l,f)=>{throw tn.isError(l)&&(l.value=f),l},(l,f)=>{if(l.length)throw new tn(l,t,void 0,void 0,s);i=f}),i}isValid(t,r){return this.validate(t,r).then(()=>!0,n=>{if(tn.isError(n))return!1;throw n})}isValidSync(t,r){try{return this.validateSync(t,r),!0}catch(n){if(tn.isError(n))return!1;throw n}}_getDefault(t){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,t):Pl(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=Nl({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=Nl({message:r,name:"optionality",test(a){return a===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(t=Sa.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Sa.notNull){return this.nullability(!1,t)}required(t=Sa.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=Sa.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),a=Nl(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(s=>!(s.OPTIONS.name===r.name&&(i||s.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=FC(t).map(i=>new Ns(i));return a.forEach(i=>{i.isSibling&&n.deps.push(i.key)}),n.conditions.push(typeof r=="function"?new Gd(a,r):Gd.fromOptions(a,r)),n}typeError(t){let r=this.clone();return r.internalTests.typeError=Nl({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=Sa.oneOf){let n=this.clone();return t.forEach(a=>{n._whitelist.add(a),n._blacklist.delete(a)}),n.internalTests.whiteList=Nl({message:r,name:"oneOf",skipAbsent:!0,test(a){let i=this.schema._whitelist,s=i.resolveAll(this.resolve);return s.includes(a)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:s}})}}),n}notOneOf(t,r=Sa.notOneOf){let n=this.clone();return t.forEach(a=>{n._blacklist.add(a),n._whitelist.delete(a)}),n.internalTests.blacklist=Nl({message:r,name:"notOneOf",test(a){let i=this.schema._blacklist,s=i.resolveAll(this.resolve);return s.includes(a)?this.createError({params:{values:Array.from(i).join(", "),resolved:s}}):!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:s}=r.spec;return{meta:a,label:n,optional:i,nullable:s,default:r.getDefault(t),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.filter((f,d,h)=>h.findIndex(v=>v.OPTIONS.name===f.OPTIONS.name)===d).map(f=>{const d=f.OPTIONS.params&&t?VC(Object.assign({},f.OPTIONS.params),t):f.OPTIONS.params;return{name:f.OPTIONS.name,params:d}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(n){try{return{value:await t.validate(n,{abortEarly:!1})}}catch(a){if(a instanceof tn)return{issues:wm(a)};throw a}}}}};Un.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Un.prototype[`${e}At`]=function(t,r,n={}){const{parent:a,parentPath:i,schema:s}=DG(this,t,r,n.context);return s[e](a&&a[i],Object.assign({},n,{parent:a,path:t}))};for(const e of["equals","is"])Un.prototype[e]=Un.prototype.oneOf;for(const e of["not","nope"])Un.prototype[e]=Un.prototype.notOneOf;const FG=()=>!0;function _m(e){return new jC(e)}class jC extends Un{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:FG},t))}}_m.prototype=jC.prototype;function Yr(){return new KC}class KC extends Un{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=bm.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return Wi(r)||r===!0}})}isFalse(t=bm.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return Wi(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)}}Yr.prototype=KC.prototype;const qG=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function $G(e){const t=Em(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 Em(e){var t,r;const n=qG.exec(e);return n?{year:no(n[1]),month:no(n[2],1)-1,day:no(n[3],1),hour:no(n[4]),minute:no(n[5]),second:no(n[6]),millisecond:n[7]?no(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:no(n[10]),minuteOffset:no(n[11])}:null}function no(e,t=0){return Number(e)||t}let UG=/^[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])?)*$/,zG=/^((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,VG=/^(?:[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,HG="^\\d{4}-\\d{2}-\\d{2}",jG="\\d{2}:\\d{2}:\\d{2}",KG="(([+-]\\d{2}(:?\\d{2})?)|Z)",WG=new RegExp(`${HG}T${jG}(\\.\\d+)?${KG}$`),GG=e=>Wi(e)||e===e.trim(),YG={}.toString();function wr(){return new WC}class WC extends Un{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===YG?t:a})})}required(t){return super.required(t).withMutation(r=>r.test({message:t||Sa.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=$n.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=$n.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=$n.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||$n.matches,params:{regex:t},skipAbsent:!0,test:s=>s===""&&n||s.search(t)!==-1})}email(t=$n.email){return this.matches(UG,{name:"email",message:t,excludeEmptyString:!0})}url(t=$n.url){return this.matches(zG,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=$n.uuid){return this.matches(VG,{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(WG,{name:"datetime",message:r||$n.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||$n.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:i=>{if(!i||n)return!0;const s=Em(i);return s?!!s.z:!1}}).test({name:"datetime_precision",message:r||$n.datetime_precision,params:{precision:a},skipAbsent:!0,test:i=>{if(!i||a==null)return!0;const s=Em(i);return s?s.precision===a:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=$n.trim){return this.transform(r=>r!=null?r.trim():r).test({message:t,name:"trim",test:GG})}lowercase(t=$n.lowercase){return this.transform(r=>Wi(r)?r:r.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>Wi(r)||r===r.toLowerCase()})}uppercase(t=$n.uppercase){return this.transform(r=>Wi(r)?r:r.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>Wi(r)||r===r.toUpperCase()})}}wr.prototype=WC.prototype;let ZG=e=>e!=+e;function Jd(){return new GC}class GC extends Un{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!ZG(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=Uo.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=Uo.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=Uo.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=Uo.moreThan){return this.test({message:r,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(n){return n>this.resolve(t)}})}positive(t=Uo.positive){return this.moreThan(0,t)}negative(t=Uo.negative){return this.lessThan(0,t)}integer(t=Uo.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(t=>Wi(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=>Wi(a)?a:Math[t](a))}}Jd.prototype=GC.prototype;let JG=new Date(""),XG=e=>Object.prototype.toString.call(e)==="[object Date]";class Sm extends Un{constructor(){super({type:"date",check(t){return XG(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,r,n)=>!n.spec.coerce||n.isType(t)||t===null?t:(t=$G(t),isNaN(t)?Sm.INVALID_DATE:new Date(t)))})}prepareParam(t,r){let n;if(Ns.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=ym.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=ym.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)}})}}Sm.INVALID_DATE=JG;function QG(e,t=[]){let r=[],n=new Set,a=new Set(t.map(([s,l])=>`${s}-${l}`));function i(s,l){let f=Os.split(s)[0];n.add(f),a.has(`${l}-${f}`)||r.push([l,f])}for(const s of Object.keys(e)){let l=e[s];n.add(s),Ns.isRef(l)&&l.isSibling?i(l.path,s):Qu(l)&&"deps"in l&&l.deps.forEach(f=>i(f,s))}return AG.array(Array.from(n),r).reverse()}function YC(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 ZC(e){return(t,r)=>YC(e,t)-YC(e,r)}const JC=(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 Xd(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Xd(n);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=Xd(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(Xd)}):"optional"in e?e.optional():e}const eY=(e,t)=>{const r=[...Os.normalizePath(t)];if(r.length===1)return r[0]in e;let n=r.pop(),a=Os.getter(Os.join(r),!0)(e);return!!(a&&n in a)};let XC=e=>Object.prototype.toString.call(e)==="[object Object]";function QC(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(n=>r.indexOf(n)===-1)}const tY=ZC([]);function gi(e){return new eM(e)}class eM extends Un{constructor(t){super({type:"object",check(r){return XC(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=tY,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,s=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(a).filter(v=>!this._nodes.includes(v))),f={},d=Object.assign({},r,{parent:f,__validating:r.__validating||!1}),h=!1;for(const v of l){let b=i[v],g=v in a;if(b){let y,_=a[v];d.path=(r.path?`${r.path}.`:"")+v,b=b.resolve({value:_,context:r.context,parent:f});let T=b instanceof Un?b.spec:void 0,w=T?.strict;if(T!=null&&T.strip){h=h||v in a;continue}y=!r.__validating||!w?b.cast(a[v],d):a[v],y!==void 0&&(f[v]=y)}else g&&!s&&(f[v]=a[v]);(g!==v in f||f[v]!==a[v])&&(h=!0)}return h?f:a}_validate(t,r={},n,a){let{from:i=[],originalValue:s=t,recursive:l=this.spec.recursive}=r;r.from=[{schema:this,value:s},...i],r.__validating=!0,r.originalValue=s,super._validate(t,r,n,(f,d)=>{if(!l||!XC(d)){a(f,d);return}s=s||d;let h=[];for(let v of this._nodes){let b=this.fields[v];!b||Ns.isRef(b)||h.push(b.asNestedTest({options:r,key:v,parent:d,parentPath:r.path,originalParent:s}))}this.runTests({tests:h,value:d,originalValue:s,options:r},n,v=>{a(v.sort(this._sortErrors).concat(f),d)})})}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 s=n[a];n[a]=s===void 0?i:s}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 s=t;(a=s)!=null&&a.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[n]})),r[n]=i&&"getDefault"in i?i.getDefault(s):void 0}),r}setFields(t,r){let n=this.clone();return n.fields=t,n._nodes=QG(t,r),n._sortErrors=ZC(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 Xd(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=Os.getter(t,!0);return this.transform(i=>{if(!i)return i;let s=i;return eY(i,t)&&(s=Object.assign({},i),n||delete s[t],s[r]=a(i)),s})}json(){return this.transform(JC)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Kd.exact,test(r){if(r==null)return!0;const n=QC(this.schema,r);return n.length===0||this.createError({params:{properties:n.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,r=Kd.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=QC(this.schema,a);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return n.spec.noUnknown=t,n}unknown(t=!0,r=Kd.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(gm.camelCase)}snakeCase(){return this.transformKeys(gm.snakeCase)}constantCase(){return this.transformKeys(t=>gm.snakeCase(t).toUpperCase())}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);n.fields={};for(const[i,s]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]=s.describe(l)}return n}}gi.prototype=eM.prototype;function zo(e){return new tM(e)}class tM extends Un{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((s,l)=>{const f=this.innerType.cast(s,Object.assign({},r,{path:`${r.path||""}[${l}]`}));return f!==s&&(a=!0),f});return a?i:n}_validate(t,r={},n,a){var i;let s=this.innerType,l=(i=r.recursive)!=null?i:this.spec.recursive;r.originalValue!=null&&r.originalValue,super._validate(t,r,n,(f,d)=>{var h;if(!l||!s||!this._typeCheck(d)){a(f,d);return}let v=new Array(d.length);for(let g=0;g<d.length;g++){var b;v[g]=s.asNestedTest({options:r,index:g,parent:d,parentPath:r.path,originalParent:(b=r.originalValue)!=null?b:t})}this.runTests({value:d,tests:v,originalValue:(h=r.originalValue)!=null?h:t,options:r},n,g=>a(g.concat(f),d))})}clone(t){const r=super.clone(t);return r.innerType=this.innerType,r}json(){return this.transform(JC)}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(!Qu(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+ro(t));return r.innerType=t,r.spec=Object.assign({},r.spec,{types:t}),r}length(t,r=Wd.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||Wd.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||Wd.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}}zo.prototype=tM.prototype;function rM(e){return new Cm(e)}function nM(e){try{return e()}catch(t){if(tn.isError(t))return Promise.reject(t);throw t}}class Cm{constructor(t){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(r,n={})=>{let a=this.builder(r,n);if(!Qu(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 Cm(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,s=a[n??r];return this._resolve(s,Object.assign({},i,{value:s,parent:a})).asNestedTest(t)}validate(t,r){return nM(()=>this._resolve(t,r).validate(t,r))}validateSync(t,r){return this._resolve(t,r).validateSync(t,r)}validateAt(t,r,n){return nM(()=>this._resolve(r,n).validateAt(t,r,n))}validateSyncAt(t,r,n){return this._resolve(r,n).validateSyncAt(t,r,n)}isValid(t,r){try{return this._resolve(t,r).isValid(t,r)}catch(n){if(tn.isError(n))return Promise.resolve(!1);throw n}}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}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(n){try{return{value:await t.validate(n,{abortEarly:!1})}}catch(a){if(tn.isError(a))return{issues:wm(a)};throw a}}}}}const Mm=gi().noUnknown().shape({client:gi().noUnknown().shape({logo:wr(),name:wr()}),entrypoint:gi().noUnknown().shape({account:wr(),country:wr(),credential:wr(),site:wr(),siteOrganizationType:wr(),updateCredential:wr()}),locale:wr().oneOf(["es","en"]),navigation:gi().noUnknown().shape({disableFormAutocomplete:Yr(),displayAccountsSelection:Yr(),displayBusinessSites:Yr(),displayCredentialInModal:Yr(),displayErrorsInToast:Yr(),displayLogoImages:Yr(),displayLongDescription:Yr(),displayPersonalSites:Yr(),displayPrivacyScreen:Yr(),displaySiteOrganizations:zo().of(wr()),displaySiteOrganizationTypes:zo().of(wr()),displaySites:zo().of(wr()),displayStatusInToast:Yr(),enableBackNavigation:Yr(),enableTwofaBackNavigation:Yr(),formButtonsDisabledStyle:Yr(),formShowPasswordStyle:wr().oneOf(["icon","none","text"]),getSelectedAccounts:_m().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),hideSelectCountry:Yr(),hideSiteOrganizations:zo().of(wr()),hideSiteOrganizationTypes:zo().of(wr()),hideSites:zo().of(wr()),oneSiteFlow:Yr(),quickAnswer:Yr(),requireConsent:Yr(),returnToSiteFormOnUserError:rM(e=>typeof e=="object"?zo().of(Jd().oneOf([401,403,411])):Yr()),saveCredential:Yr(),selectClass:wr(),socketTimeout:Jd().min(1),toastDuration:Jd().min(0),toastPosition:wr().oneOf(["bottom-left","bottom-right","top-left","top-right"])}),__internal__:gi().noUnknown().shape({apiBaseUrl:wr(),apiEnv:wr().oneOf(["development","production"]),assetsBaseUrl:wr(),plaidSites:Yr(),defaultHttpParams:gi()})}),rY=gi().shape({token:wr().required(),element:rM(e=>{switch(typeof e){case"string":return wr().test("isElement","${path} is not an Element",t=>{if(!document.querySelector(t))throw new tn(`Invalid selector: Element "${t}" not found.`);return!0});case"object":return gi().test("isElement","${path} is not an Element",t=>{if(!kj(t))throw new tn("Invalid element: Object should be a valid HtmlElement.");return!0});default:return wr()}}),refreshTokenFunction:_m().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),enableTestMode:Yr(),strict:gi().noUnknown().nullable().shape({authorization:gi().noUnknown().required().shape({type:wr().oneOf(["jwk"]).required(),key:wr().required()}),body:gi().noUnknown().required().shape({type:wr().oneOf(["jwk"]).required(),key:wr().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:Mm}).strict().noUnknown();let Tm={git:{hash:"gd5878a2",distance:0,tag:"v2.1.2"}};function Qd(){let e=`${Tm.git.tag}.${Tm.git.distance}`;return e=`${e}-${Tm.git.hash}`,e}function nY(e,t){const r=parseInt("0x4",16),n="38060000000000000000000000000000000000000000000F00000000000000000000000000000000000D9802010000010101000000000000";let a;return iY().then(()=>(a=new digipass.nativebridge.DP110,new Promise((s,l)=>{a.onError(()=>l("bridge.not_ready")),a.onReady(f=>{if(f.versionCode<a.versionCode&&l("bridge.host_update_available"),a.isReady())a.getTokenInfo(r,function(h){if(h.returnCode!==0)return l(`bridge.${Math.abs(h.returnCode)}`);a.generateOTP(n,t,function(v){if(v.returnCode!==0)return l(`bridge.${Math.abs(v.returnCode)}`);s({token:`${e}XX${v.otp}XX${h.info}XX${f.versionCode}`,challenge:t})})});else return Promise.reject("bridge.not_ready")})})))}function iY(){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])}function aY(){const e=window.bridgeBluetooth;if(e.timeoutValidation=!1,e.cryptoAppOTP=7,!e.bridge.isReady()){e.bridge.reconnect();return}clearTimeout(e.varSetTime),e.bridge.generateResponseOnlyOTP(e.cryptoAppOTP,function(t){t.returnCode!=0?(t.returnCode==-6014||t.returnCode==-6015||t.returnCode==-6016)&&eh(!1,!1):e.timeoutValidation||(e.validOTP=!0,e.valFinalFlow=!0,e.token=t.otp,e.acceptB?sM():(hY(),oM()))})}function oY(e){const t=window.bridgeBluetooth;return new Promise((r,n)=>{t.resolve=r,t.reject=n,fY(e)})}function sY(e){const t=window.bridgeBluetooth;return new Promise((r,n)=>{t.resolve=r,t.reject=n,cY(e)})}function lY(e,t){window.bridgeBluetooth={acceptB:null,accesLogin:!0,bridge:null,cancelB:!1,cancelB2:!1,changeIdNameOtp:!1,claveInsSegOTP:null,contNB:2,contNBReady:0,contNBVersion:0,cryptoAppOTP:null,digipassSerial:null,eai_firma_DP110:null,eai_serial_DP110:null,isChequeLineaOrSAT:null,jspDesafio:t,jspToken:e,nbProcessIsComplete:!1,resolve:null,reject:null,setTimeReady:!1,switchState:!0,timeoutValidation:!1,token:"",valFinalFlow:!1,validOTP:!1,varSetTime:null,versionCode:null};const r=window.bridgeBluetooth;return uY().then(()=>new Promise((a,i)=>{r.resolve=a,r.reject=i,aM()}))}function uY(){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("widgetBridgeBluetooth"))return r();const a=document.createElement("script");a.setAttribute("type","text/javascript"),a.setAttribute("id","widgetBridgeBluetooth"),a.setAttribute("src","https://www.paybook.com/lib/syncfy/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])}function iM(){const e=window.bridgeBluetooth;e.accesLogin&&(e.cancelB||(e.valFinalFlow=!0,e.token="********",e.resolve(e.token)),e.accesLogin=!1)}function cY(e){const t=window.bridgeBluetooth,r=JSON.parse(e);r.estado!=="OK"||t.cancelB2||gY(r.requestMessage)}function fY(e){const t=JSON.parse(e);t.estado!=="OK"||yY(t.requestMessage)}function dY(){const e=window.bridgeBluetooth;if(!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.initializeDigipass(e.digipassSerial,function(t){t.returnCode!=0||e.bridge.getDigipassTimeChallenge(function(r){r.returnCode!=0?Am(function(){e.switchState&&ec()},5e3,"timeOut"):(clearTimeout(e.varSetTime),e.timeoutValidation=!1,e.setTimeReady?iM():bY())})})}function aM(){const e=window.bridgeBluetooth;try{e.bridge=new digipass.nativebridge.DPToken,e.bridge.getDigipassTimeChallenge(function(){eh(!0,!1)}),e.bridge.onError(function(){e.contNB++,e.nbProcessIsComplete||e.contNB<=4&&(e.accesLogin?e.bridge.reconnect():e.bridge.getDigipassTimeChallenge(function(){}))}),e.bridge.onReady(function(){clearTimeout(e.varSetTime),e.contNB=0,e.contNBReady===0&&(e.validOTP||(Am(function(){e.timeoutValidation=!0},3e4,"timeOut"),e.switchState&&ec()),e.contNBReady++)})}catch(t){e.reject(t)}}function ec(){const e=window.bridgeBluetooth;if(e.digipassSerial=null,!e.bridge.isReady()){e.bridge.reconnect();return}if(e.contNBVersion===0&&e.bridge.getNativeBridgeVersion(function(t){e.versionCode=t.versionCode,e.contNBVersion++}),!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.getDigipassList(function(t){e.timeoutValidation||t.returnCode!=0||(t.devices.length==0?e.switchState&&ec():(t.devices.forEach(r=>{r.digipassSerial===e.jspToken&&(e.digipassSerial=r.digipassSerial,e.jspDesafio!=="null"&&(e.eai_serial_DP110=e.jspToken))}),e.digipassSerial===null?e.switchState&&ec():e.timeoutValidation||dY()))})}function oM(){const e=window.bridgeBluetooth;if(e.switchState){let t="";e.token!==void 0?(t=e.token,e.token=t+e.cryptoAppOTP):(t=e.claveInsSegOTP,e.claveInsSegOTP=t+e.cryptoAppOTP)}e.resolve(`${e.token}XX${e.eai_firma_DP110}XX${e.eai_serial_DP110}XX${e.versionCode}`)}function hY(){const e=window.bridgeBluetooth;e.changeIdNameOtp=!0}function pY(){const e=window.bridgeBluetooth;e.changeIdNameOtp=!1}function vY(e,t){const r=window.bridgeBluetooth;if(!r.bridge.isReady()){r.bridge.reconnect();return}r.bridge.parseResponseMessage(e,t,function(n){n.returnCode!=0?(n.returnCode==-6014||n.returnCode==-6015||n.returnCode==-6016)&&eh(!1,!1):r.timeoutValidation||(r.validOTP=!0,r.jspDesafio!=="null"&&(r.eai_firma_DP110=n.messageSignature),aY())})}function mY(e,t){const r=window.bridgeBluetooth;if(!r.bridge.isReady()){r.bridge.reconnect();return}r.bridge.parseResponseMessage(e,t,function(n){n.returnCode!=0||(r.setTimeReady=!0,iM())})}function gY(e){const t=window.bridgeBluetooth;if(!t.bridge.isReady()){t.bridge.reconnect();return}t.bridge.transmitRequestMessage(e,function(r){r.returnCode!=0||vY(r.responseMessage,e)})}function yY(e){const t=window.bridgeBluetooth;if(!t.bridge.isReady()){t.bridge.reconnect();return}t.bridge.transmitRequestMessage(e,function(r){r.returnCode!=0||mY(r.responseMessage,e)})}function sM(){const e=window.bridgeBluetooth;clearTimeout(e.varSetTime),oM()}function bY(){const e=window.bridgeBluetooth;if(!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.getDigipassTimeChallenge(function(t){t.returnCode!=0||e.resolve(t.timeChallenge)})}function Am(e,t,r){const n=window.bridgeBluetooth;switch(r){case"timeOut":n.varSetTime=setTimeout(e,t);break;case"interval":setInterval(e,t);break}}function eh(e,t){const r=window.bridgeBluetooth,n="";if(r.timeoutValidation=!1,r.acceptB=t,clearTimeout(r.varSetTime),r.token.length!=8&&!t&&(r.validOTP=!1),t||(r.switchState=e),e)if(r.contNBVersion=0,r.valFinalFlow=!1,t||(r.accesLogin=!0,r.cancelB=!1),r.validOTP)sM(),r.valFinalFlow=!0;else{if(r.contNBVersion=0,r.cancelB2=!1,r.contNB=2,t||(r.token=n),r.bridge===void 0&&aM(),!r.bridge.isReady()){r.bridge.reconnect();return}clearTimeout(r.varSetTime),Am(function(){r.timeoutValidation=!0},3e4,"timeOut"),r.contNBReady!==0?ec():r.bridge.reconnect()}else clearTimeout(r.varSetTime),r.validOTP=!0,r.cancelB=!0,r.cancelB2=!0,pY(),r.claveInsSegOTP=n,r.token=n}function wY(){eh(!0,!0)}const yi="bridgeBluetooth";function _Y(e){const t=window[yi];return new Promise((n,a)=>{t.resolve=n,t.reject=a;let i,s;const{authenticationData:l}=e.authenticationResponse;l[0].idAuthenticationData==="signedMessage"?([i]=l[0].authenticationData,[s]=l[1].authenticationData):([i]=l[1].authenticationData,[s]=l[0].authenticationData),RY({signedMessage:i,signedTimeMessage:s})})}async function EY(){const e=window[yi];return new Promise(async(t,r)=>{if(e.nativeBridgeInstance.isReady())try{const n=await async function(a){return new Promise((i,s)=>{a.getDigipassTimeChallenge(l=>{if(l.returnCode!==0){const d={title:"Generar - TimeChallenge",response:{message:"Se ha producido un error al generar el TimeChallenge. Por favor, aseg\xFArate de tener tu token conectado y encendido.",returnCode:l.returnCode}};return void s(d)}const f={title:"Generar - TimeChallenge",response:{message:`El TimeChallenge es: ${l.timeChallenge}`,timeChallenge:l.timeChallenge,errorCode:""}};i(f)})})}(e.nativeBridgeInstance);t(n)}catch(n){r(n)}else r({title:"Error de conexi\xF3n",response:{message:"No es posible interactuar con el dispositivo.",errorCode:""}})})}function SY(e){window[yi]={isDp785Signature:!1,nativeBridgeInstance:null,resolve:null,reject:null};const t=window[yi];return CY().then(()=>new Promise((n,a)=>{t.resolve=n,t.reject=a,t.isDp785Signature=e!=="214",t.nativeBridgeInstance=new window.digipass.nativebridge.DPToken,kY()}))}function CY(){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","undefineddigipass.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","undefineddigipass.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 MY(){const e=window[yi];try{const t=await TY(e.isDp785Signature);if(t.length===1){const[r]=t;await AY(r.serial);const n=await EY();e.resolve(n.response.timeChallenge)}}catch(t){e.reject(t),alert("Por favor, aseg\xFArate de tener tu token conectado y encendido.")}}async function TY(e){const t=window[yi];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(f){return new Promise((d,h)=>{f.getDigipassList(v=>{if(v.returnCode===0)d(v.devices);else{const b={title:"Listar dispositivos",response:{message:"Error al obtener la lista de dispositivos disponibles.",returnCode:v.returnCode}};h(b)}})})}(t.nativeBridgeInstance),s=i.map(f=>({name:f.deviceName,serial:f.digipassSerial})),[l]=s;if(!l||!l.serial)return void n({title:"Error de conexi\xF3n",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:a}});r(s)}catch(i){n(i)}else n({title:"Error de conexi\xF3n",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:a}})})}async function AY(e){const t=window[yi];return new Promise((r,n)=>{t.nativeBridgeInstance.initializeDigipass(e,a=>{if(a.returnCode!==0){const s={title:"Inicializar dispositivo",response:{message:"Error al intentar inicializar el dispositivo.",returnCode:a.returnCode}};return void n(s)}const i={title:"Inicializar dispositivo",response:{message:`El dispositivo con serial: ${e} est\xE1 listo para ser usado.`,errorCode:""}};r(i)})})}async function IY(e){const t=window[yi];return new Promise(async(r,n)=>{if(t.nativeBridgeInstance.isReady())try{const a=await async function(i,s){return new Promise((l,f)=>{i.generateResponseOnlyOTP(s,d=>{if(d.returnCode!==0){const v={title:"Generar OTP con PIN",response:{message:"No fue posible generar la OTP.",returnCode:d.returnCode}};return void f(v)}const h={title:"Generar OTP con PIN",response:{message:`La OTP se gener\xF3 correctamente: ${d.otp}`,otp:d.otp,errorCode:"",processType:"DP785_T4_LINKED"}};l(h)})})}(t.nativeBridgeInstance,e);r(a)}catch(a){n(a)}else n({title:"Error de conexi\xF3n",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:"DP785_T4_NOT_LINKED"}})})}async function kY(){const e=window[yi],t=await BY();if(t.response.errorCode!==""){alert(t.response.message),e.reject(t.response.errorCode);return}else await MY()}async function RY({signedMessage:e="",signedTimeMessage:t=""}){const r=window[yi];try{await lM(t,r.isDp785Signature);const n=await lM(e,r.isDp785Signature),{response:{messageSignature:a}}=n,i=7,s=await IY(i),{response:{otp:l}}=s,f={};f.otpChallenge=a;const d=`${l}${i}`;f.otp=d,r.resolve(`${f.otpChallenge}XX${f.otp}`)}catch(n){r.reject(n),alert("Error al intentar validar la sesi\xF3n desde el dispositivo de acceso seguro.")}}async function BY(){const e=window[yi];return new Promise((t,r)=>{e.nativeBridgeInstance.onReady(()=>{e.nativeBridgeInstance.getNativeBridgeVersion(n=>{const a={title:"Conexi\xF3n 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\xF3n con Native Bridge",response:{errorCode:"222",message:"El software Native Bridge no se encontr\xF3 instalado en tu ordenador.",processType:"DP785_T4_NOT_LINKED"}})})})}async function lM(e,t){const r=window[yi];return new Promise(async(n,a)=>{const i=t?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(r.nativeBridgeInstance.isReady())try{const{responseMessage:s}=await async function(f,d){return new Promise((h,v)=>{f.transmitRequestMessage(d,b=>{if(b.returnCode===0)h(b);else{const g={title:"Firmar mensaje",response:{message:"No fue posible transmitir el mensaje.",returnCode:b.returnCode}};v(g)}})})}(r.nativeBridgeInstance,e),l=await async function(f,d,h){return new Promise((v,b)=>{f.parseResponseMessage(d,h,g=>{if(g.returnCode!==0){const _={title:"Firmar mensaje",response:{message:"No fue posible parsear el mensaje.",returnCode:g.returnCode}};return void b(_)}const y={title:"Firmar mensaje",response:{message:`Se realiz\xF3 la firma del mensaje correctamente: ${g.messageSignature}`,messageSignature:g.messageSignature,errorCode:"",processType:"DP785_T4_LINKED"}};v(y)})})}(r.nativeBridgeInstance,s,e);n(l)}catch(s){a(s)}else a({title:"Error de conexi\xF3n",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:i}})})}const th=/\{([a-z_]+)\}/g;function OY(e){const t=e.documents||[],r=[];let n=0,a;for(th.lastIndex=0;(a=th.exec(e.text))!==null;){const i=t.find(s=>s.role===a[1]);a.index>n&&r.push({text:e.text.slice(n,a.index)}),r.push(i?{document:i,text:i.label}:{text:a[0]}),n=a.index+a[0].length}return n<e.text.length&&r.push({text:e.text.slice(n)}),r}function NY(e,t=!1){const r=e?.is_business===1,n=e?.is_personal===1;return r&&!n?"legal_entity":n&&!r?"individual":t?"legal_entity":"individual"}function PY(e){var t,r,n;const a=(t=e?.response)==null?void 0:t.status,i=((n=(r=e?.response)==null?void 0:r.data)==null?void 0:n.message)||"";return a===409?"stale":a===400&&/consent/i.test(i)?"missing":null}function DY(e){const t=e.documents||[];return th.lastIndex=0,Array.from(e.text.matchAll(th)).some(r=>!t.some(n=>n.role===r[1]))}const Dl={enables:["download_options"],name:"download_options_active",required:!1,translate_label:"download_options.switch",type:"switch",validation:null},Im={name:"download_options",required:!1,enabled_by:"download_options_active",translate_error_label:"download_options.label",type:"date_range",validation:null},Ll=["56cf5728784806f72b8b456f","5da784f1f9de2a06483abec1"];var km={},tc={},uM;function LY(){if(uM)return tc;uM=1,tc.byteLength=l,tc.toByteArray=d,tc.fromByteArray=b;for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,i=n.length;a<i;++a)e[a]=n[a],t[n.charCodeAt(a)]=a;t[45]=62,t[95]=63;function s(g){var y=g.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var _=g.indexOf("=");_===-1&&(_=y);var T=_===y?0:4-_%4;return[_,T]}function l(g){var y=s(g),_=y[0],T=y[1];return(_+T)*3/4-T}function f(g,y,_){return(y+_)*3/4-_}function d(g){var y,_=s(g),T=_[0],w=_[1],M=new r(f(g,T,w)),k=0,B=w>0?T-4:T,D;for(D=0;D<B;D+=4)y=t[g.charCodeAt(D)]<<18|t[g.charCodeAt(D+1)]<<12|t[g.charCodeAt(D+2)]<<6|t[g.charCodeAt(D+3)],M[k++]=y>>16&255,M[k++]=y>>8&255,M[k++]=y&255;return w===2&&(y=t[g.charCodeAt(D)]<<2|t[g.charCodeAt(D+1)]>>4,M[k++]=y&255),w===1&&(y=t[g.charCodeAt(D)]<<10|t[g.charCodeAt(D+1)]<<4|t[g.charCodeAt(D+2)]>>2,M[k++]=y>>8&255,M[k++]=y&255),M}function h(g){return e[g>>18&63]+e[g>>12&63]+e[g>>6&63]+e[g&63]}function v(g,y,_){for(var T,w=[],M=y;M<_;M+=3)T=(g[M]<<16&16711680)+(g[M+1]<<8&65280)+(g[M+2]&255),w.push(h(T));return w.join("")}function b(g){for(var y,_=g.length,T=_%3,w=[],M=16383,k=0,B=_-T;k<B;k+=M)w.push(v(g,k,k+M>B?B:k+M));return T===1?(y=g[_-1],w.push(e[y>>2]+e[y<<4&63]+"==")):T===2&&(y=(g[_-2]<<8)+g[_-1],w.push(e[y>>10]+e[y>>4&63]+e[y<<2&63]+"=")),w.join("")}return tc}var rh={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var cM;function xY(){return cM||(cM=1,rh.read=function(e,t,r,n,a){var i,s,l=a*8-n-1,f=(1<<l)-1,d=f>>1,h=-7,v=r?a-1:0,b=r?-1:1,g=e[t+v];for(v+=b,i=g&(1<<-h)-1,g>>=-h,h+=l;h>0;i=i*256+e[t+v],v+=b,h-=8);for(s=i&(1<<-h)-1,i>>=-h,h+=n;h>0;s=s*256+e[t+v],v+=b,h-=8);if(i===0)i=1-d;else{if(i===f)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,n),i=i-d}return(g?-1:1)*s*Math.pow(2,i-n)},rh.write=function(e,t,r,n,a,i){var s,l,f,d=i*8-a-1,h=(1<<d)-1,v=h>>1,b=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,y=n?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+v>=1?t+=b/f:t+=b*Math.pow(2,1-v),t*f>=2&&(s++,f/=2),s+v>=h?(l=0,s=h):s+v>=1?(l=(t*f-1)*Math.pow(2,a),s=s+v):(l=t*Math.pow(2,v-1)*Math.pow(2,a),s=0));a>=8;e[r+g]=l&255,g+=y,l/=256,a-=8);for(s=s<<a|l,d+=a;d>0;e[r+g]=s&255,g+=y,s/=256,d-=8);e[r+g-y]|=_*128}),rh}/*!
695
695
  * The buffer module from node.js, for the browser.
696
696
  *
697
697
  * @author Feross Aboukhadijeh <https://feross.org>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfy/authentication-widget",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "author": {
5
5
  "email": "chipi@syncfy.com",
6
6
  "name": "Edgar Martinez"