@stitch-money/client 3.8.1 → 3.10.0

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.
package/build/index.js CHANGED
@@ -1,15 +1,27 @@
1
1
  "use client"
2
- var ft=Object.create;var Y=Object.defineProperty,pt=Object.defineProperties,dt=Object.getOwnPropertyDescriptor,yt=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertyNames,L=Object.getOwnPropertySymbols,mt=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;var J=(e,t,r)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_=(e,t)=>{for(var r in t||(t={}))q.call(t,r)&&J(e,r,t[r]);if(L)for(var r of L(t))de.call(t,r)&&J(e,r,t[r]);return e},ye=(e,t)=>pt(e,yt(t));var ge=(e,t)=>{var r={};for(var n in e)q.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&L)for(var n of L(e))t.indexOf(n)<0&&de.call(e,n)&&(r[n]=e[n]);return r};var ht=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Rt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gt(t))!q.call(e,i)&&i!==r&&Y(e,i,{get:()=>t[i],enumerable:!(n=dt(t,i))||n.enumerable});return e};var bt=(e,t,r)=>(r=e!=null?ft(mt(e)):{},Rt(t||!e||!e.__esModule?Y(r,"default",{value:e,enumerable:!0}):r,e));var E=(e,t,r)=>(J(e,typeof t!="symbol"?t+"":t,r),r);var m=(e,t,r)=>new Promise((n,i)=>{var s=a=>{try{u(r.next(a))}catch(c){i(c)}},o=a=>{try{u(r.throw(a))}catch(c){i(c)}},u=a=>a.done?n(a.value):Promise.resolve(a.value).then(s,o);u((r=r.apply(e,t)).next())});var Te=ht((vr,Ae)=>{"use strict";var Q=class e extends Error{constructor(t){super(e._prepareSuperMessage(t)),Object.defineProperty(this,"name",{value:"NonError",configurable:!0,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(this,e)}static _prepareSuperMessage(t){try{return JSON.stringify(t)}catch(r){return String(t)}}},At=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0}],ee=Symbol(".toJSON called"),Tt=e=>{e[ee]=!0;let t=e.toJSON();return delete e[ee],t},te=({from:e,seen:t,to_:r,forceEnumerable:n,maxDepth:i,depth:s})=>{let o=r||(Array.isArray(e)?[]:{});if(t.push(e),s>=i)return o;if(typeof e.toJSON=="function"&&e[ee]!==!0)return Tt(e);for(let[u,a]of Object.entries(e)){if(typeof Buffer=="function"&&Buffer.isBuffer(a)){o[u]="[object Buffer]";continue}if(typeof a!="function"){if(!a||typeof a!="object"){o[u]=a;continue}if(!t.includes(e[u])){s++,o[u]=te({from:e[u],seen:t.slice(),forceEnumerable:n,maxDepth:i,depth:s});continue}o[u]="[Circular]"}}for(let{property:u,enumerable:a}of At)typeof e[u]=="string"&&Object.defineProperty(o,u,{value:e[u],enumerable:n?!0:a,configurable:!0,writable:!0});return o},Ct=(e,t={})=>{let{maxDepth:r=Number.POSITIVE_INFINITY}=t;return typeof e=="object"&&e!==null?te({from:e,seen:[],forceEnumerable:!0,maxDepth:r,depth:0}):typeof e=="function"?`[Function: ${e.name||"anonymous"}]`:e},xt=(e,t={})=>{let{maxDepth:r=Number.POSITIVE_INFINITY}=t;if(e instanceof Error)return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let n=new Error;return te({from:e,seen:[],to_:n,maxDepth:r,depth:0}),n}return new Q(e)};Ae.exports={serializeError:Ct,deserializeError:xt}});var me=(n=>(n.ApplePay="APPLE_PAY",n.SamsungPay="SAMSUNG_PAY",n.GooglePay="GOOGLE_PAY",n))(me||{});var D=function(){return D=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},D.apply(this,arguments)};function he(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function Re(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}function St(e,t){return function(r,n){return Object.prototype.hasOwnProperty.call(r,n)}(e,t)?e[t]:void 0}function Et(e,t,r,n){var i,s=document,o="securitypolicyviolation",u=function(c){var l=new URL(e,location.href),f=c.blockedURI;f!==l.href&&f!==l.protocol.slice(0,-1)&&f!==l.origin||(i=c,a())};s.addEventListener(o,u);var a=function(){return s.removeEventListener(o,u)};return n==null||n.then(a,a),Promise.resolve().then(t).then(function(c){return a(),c},function(c){return new Promise(function(l){var f=new MessageChannel;f.port1.onmessage=function(){return l()},f.port2.postMessage(null)}).then(function(){if(a(),i)return r(i);throw c})})}var be={default:"endpoint"};var Se="Blocked by CSP",Ee="The endpoint parameter is not a valid URL";var Pt="API key required";var _t="3.11.4",H="Failed to load the JS script of the agent",W="9319";function vt(e,t){var r,n,i,s,o,u,a,c=[],l=(r=function(d){var g=Re([],d,!0);return{current:function(){return g[0]},postpone:function(){var h=g.shift();h!==void 0&&g.push(h)},exclude:function(){g.shift()}}}(e),s=100,o=3e3,u=0,n=function(){return Math.random()*Math.min(o,s*Math.pow(2,u++))},i=new Set,[r.current(),function(d,g){var h,b=g instanceof Error?g.message:"";if(b===Se||b===Ee)r.exclude(),h=0;else if(b===W)r.exclude();else if(b===H){var A=Date.now()-d.getTime()<50,w=r.current();w&&A&&!i.has(w)&&(i.add(w),h=0),r.postpone()}else r.postpone();var N=r.current();return N===void 0?void 0:[N,h!=null?h:d.getTime()+n()-Date.now()]}]),f=l[0],p=l[1];if(f===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var y=function(d){var g=new Date,h=function(A){return c.push({url:d,startedAt:g,finishedAt:new Date,error:A})},b=t(d);return b.then(function(){return h()},h),b.catch(function(A){if(a!=null||(a=A),c.length>=5)throw a;var w=p(g,A);if(!w)throw a;var N,ut=w[0],ct=w[1];return(N=ct,new Promise(function(lt){return setTimeout(lt,N)})).then(function(){return y(ut)})})};return y(f).then(function(d){return[d,c]})}var Pe="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",_e=Pe;function ve(e){var t;e.scriptUrlPattern;var r=e.token,n=e.apiKey,i=n===void 0?r:n,s=he(e,["scriptUrlPattern","token","apiKey"]),o=(t=St(e,"scriptUrlPattern"))!==null&&t!==void 0?t:Pe,u=function(){var l=[],f=function(){l.push({time:new Date,state:document.visibilityState})},p=function(y,d,g,h){return y.addEventListener(d,g,h),function(){return y.removeEventListener(d,g,h)}}(document,"visibilitychange",f);return f(),[l,p]}(),a=u[0],c=u[1];return Promise.resolve().then(function(){if(!i||typeof i!="string")throw new Error(Pt);var l=function(f,p){return(Array.isArray(f)?f:[f]).map(function(y){return function(d,g){var h=encodeURIComponent;return d.replace(/<[^<>]+>/g,function(b){return b==="<version>"?"3":b==="<apiKey>"?h(g):b==="<loaderVersion>"?h(_t):b})}(String(y),p)})}(o,i);return vt(l,wt)}).catch(function(l){throw c(),function(f){return f instanceof Error&&f.message===W?new Error(H):f}(l)}).then(function(l){var f=l[0],p=l[1];return c(),f.load(D(D({},s),{ldi:{attempts:p,visibilityStates:a}}))})}function wt(e){return Et(e,function(){return function(t){return new Promise(function(r,n){if(function(u){if(URL.prototype)try{return new URL(u,location.href),!1}catch(a){if(a instanceof Error&&a.name==="TypeError")return!0;throw a}}(t))throw new Error(Ee);var i=document.createElement("script"),s=function(){var u;return(u=i.parentNode)===null||u===void 0?void 0:u.removeChild(i)},o=document.head||document.getElementsByTagName("head")[0];i.onload=function(){s(),r()},i.onerror=function(){s(),n(new Error(H))},i.async=!0,i.src=t,o.appendChild(i)})}(e)},function(){throw new Error(Se)}).then(Ot)}function Ot(){var e=window,t="__fpjs_p_l_b",r=e[t];if(function(n,i){var s,o=(s=Object.getOwnPropertyDescriptor)===null||s===void 0?void 0:s.call(Object,n,i);o!=null&&o.configurable?delete n[i]:o&&!o.writable||(n[i]=void 0)}(e,t),typeof(r==null?void 0:r.load)!="function")throw new Error(W);return r}var X,Z;function we(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<e;n++)r+=t.charAt(Math.floor(Math.random()*t.length));return r}function Oe(t){return m(this,arguments,function*({config:e}){return yield ve({apiKey:e.publicKey,endpoint:[e.endpoint,be],scriptUrlPattern:[e.scriptUrlPattern,_e],region:"eu"})})}function Ie(i){return m(this,arguments,function*({config:e,clientId:t,agent:r,payerId:n}){if((e==null?void 0:e.disabled)===!0){let o={disabled:!0,emulated:!1,fingerprintDetails:{timestamp:new Date().toISOString(),requestId:"",visitorId:""}};return btoa(JSON.stringify(o))}if((e==null?void 0:e.disabled)===!1&&(e!=null&&e.useEmulation)&&(t!=null&&t.startsWith("test"))){let o={disabled:!1,emulated:!0,fingerprintDetails:{timestamp:new Date().toISOString(),requestId:`${Date.now()}.${we(6)}`,visitorId:we(20)}};return btoa(JSON.stringify(o))}if(r!==void 0&&(e==null?void 0:e.disabled)===!1){let o=Date.now();if(X!==void 0&&Z!==void 0&&o-Z<e.cacheDurationInSeconds*1e3)return btoa(JSON.stringify(X));try{let u=yield r.get({linkedId:t,tag:{payerId:n}}),a={disabled:!1,emulated:!1,fingerprintDetails:{timestamp:new Date().toISOString(),requestId:u.requestId,visitorId:u.visitorId}};return X=a,Z=o,btoa(JSON.stringify(a))}catch(u){let a={error:{outcome:"Failed",message:`Error: ${JSON.stringify(u)}`}};return btoa(JSON.stringify(a))}}return btoa(JSON.stringify({error:{outcome:"Failed",message:"Attempted to get fingerprint data but either runtime config or the agent are not present"}}))})}var Ce=bt(Te());function re(){return typeof crypto!="undefined"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Nt="https://analytics.stitch.money/query",ne={loggingUrl:Nt},G={};function ie(e={}){let n=e,{loggingUrl:t}=n,r=ge(n,["loggingUrl"]);typeof t=="string"&&t.length>0&&(ne.loggingUrl=t),G=_(_({sessionId:re()},G),r)}function xe(){var e,t,r;return((t=(e=window==null?void 0:window.location)==null?void 0:e.ancestorOrigins)==null?void 0:t.length)>0?Object.values((r=window==null?void 0:window.location)==null?void 0:r.ancestorOrigins).join(","):(document==null?void 0:document.referrer)||void 0}function oe(e,t){return m(this,null,function*(){try{yield fetch(ne.loggingUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"LOG_EVENT",event:{message:e,metadata:_(_({hostname:xe()},G),t)}})})}catch(r){try{yield S("[logEvent] Error logging event",r,t)}catch(n){}}})}function S(e,t,r){return m(this,null,function*(){try{yield fetch(ne.loggingUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"LOG_ERROR",error:{message:e,error:(0,Ce.serializeError)(t),metadata:_(_({hostname:xe()},G),r)}})})}catch(n){}})}function Dt(e){return typeof e=="number"}function Mt(e){return typeof e=="string"}function jt(e){return typeof e=="bigint"}function De(e){return!!e&&Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e)}function Me(e){return e!=null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"}var je=new WeakSet;function M(e){return je.add(e),e}function ke(e,t){return M({type:"object",fields:e,text:t})}function kt(e,t){return M({type:"array",items:e,text:t})}function V(e,t){return M({type:"opaque",value:e,text:t})}function $t(e,t){return M({type:"scalar",value:e,text:t})}function $e(e,t){return t!==void 0?M(ye(_({},e),{text:t})):e}function Ue(e,t){let r=new Map([...e.fields,...t]);return ke(r,e.text)}function Fe(e){return je.has(e)}function Ut(e,t,r){r.add(e);let n=[];for(let i of e)n.push(ue(i,void 0,r));return kt(n,t)}function Le(e,t,r){r.add(e);let n=new Map;for(let i of Object.keys(e)){let s=e[i];n.set(i,ue(s,void 0,r))}return ke(n,t)}function ue(e,t,r){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e.getMonth=="function"?$t(e,t):Fe(e)?$e(e,t):Array.isArray(e)?r.has(e)?V("<circular ref>",t):Ut(e,t,r):Me(e)?r.has(e)?V("<circular ref>",t):Le(e,t,r):V(typeof e=="function"?"<function>":"???",t)}function O(e,t){return ue(e,t,new WeakSet)}function Ge(e,t){return Le(e,t,new WeakSet)}var I=" ";function ae(e){return e.indexOf(`
3
- `)>=0}function ce(e,t=I){return ae(e)?e.split(`
4
- `).map(r=>`${t}${r}`).join(`
5
- `):`${t}${e}`}var Ft=/'/g;function T(e){return typeof e=="string"?"'"+e.replace(Ft,"\\'")+"'":JSON.stringify(e)}function z(e,t=[]){let r=[];if(e.type==="array"){let s=e.items,o=0;for(let u of s)for(let a of z(u,[...t,o++]))r.push(a)}else if(e.type==="object"){let s=e.fields;for(let[o,u]of s)for(let a of z(u,[...t,o]))r.push(a)}let n=e.text;if(!n)return r;let i;return t.length===0?i="":t.length===1?i=typeof t[0]=="number"?`Value at index ${t[0]}: `:`Value at key ${T(t[0])}: `:i=`Value at keypath ${T(t.map(String).join("."))}: `,[...r,`${i}${n}`]}function Lt(e,t=80){let r=JSON.stringify(e);if(r.length<=t)return r;let n=`${e.substring(0,t-15)}...`;return r=`${JSON.stringify(n)} [truncated]`,r}function Gt(e,t){let{items:r}=e;if(r.length===0)return"[]";let n=[];for(let i of r){let[s,o]=le(i,`${t}${I}`);n.push(`${t}${I}${s},`),o!==void 0&&n.push(ce(o,`${t}${I}`))}return["[",...n,`${t}]`].join(`
6
- `)}function Vt(e,t){let{fields:r}=e;if(r.size===0)return"{}";let n=[];for(let[i,s]of r){let o=Ve(i),u=`${t}${I}${" ".repeat(o.length+2)}`,[a,c]=le(s,`${t}${I}`);n.push(`${t}${I}${o}: ${a},`),c!==void 0&&n.push(ce(c,u))}return["{",...n,`${t}}`].join(`
7
- `)}function Ve(e){return typeof e=="string"?Lt(e):typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"?e.toString():e===null?"null":e===void 0?"undefined":De(e)?`new Date(${T(e.toISOString())})`:e instanceof Date?"(Invalid Date)":"(unserializable)"}function le(e,t=""){let r;e.type==="array"?r=Gt(e,t):e.type==="object"?r=Vt(e,t):e.type==="scalar"?r=Ve(e.value):r=e.value;let n=e.text;if(n!==void 0){let i="^".repeat(ae(r)?1:r.length);return[r,[i,n].join(ae(n)?`
8
- `:" ")]}else return[r,void 0]}function zt(e){let[t,r]=le(e);return r!==void 0?`${t}
9
- ${r}`:t}function Kt(e){return z(e,[]).join(`
10
- `)}function ze(e){return{ok:!0,value:e,error:void 0}}function Ke(e){return{ok:!1,value:void 0,error:e}}function Bt(e){return t=>{try{let r=e(t);return ze(r)}catch(r){return Ke(O(t,r instanceof Error?r.message:String(r)))}}}function Jt(e,t){let r=t(e);if(typeof r=="string"){let n=new Error(`
11
- ${r}`);return n.name="Decoding error",n}else return r}function R(e){function t(l){return e(l,ze,f=>Ke(Fe(f)?f:O(l,f)))}function r(l,f=zt){let p=t(l);if(p.ok)return p.value;throw Jt(p.error,f)}function n(l){return t(l).value}function i(l){return o(Bt(l))}function s(l,f){return a(p=>l(p)?null:f)}function o(l){return R((f,p,y)=>{let d=t(f);if(!d.ok)return d;let g=Ne(l)?l:l(d.value,p,y);return Ne(g)?g.decode(d.value):g})}function u(l){return o(l)}function a(l){return o((f,p,y)=>{let d=l(f);return d===null?p(f):y(typeof d=="string"?O(f,d):d)})}function c(l){return R((f,p,y)=>{let d=t(f);return d.ok?d:y(O(d.error,l))})}return Yt({verify:r,value:n,decode:t,transform:i,refine:s,reject:a,describe:c,then:o,pipe:u})}var Be=new WeakSet;function Yt(e){return Be.add(e),e}function Ne(e){return Be.has(e)}var qt=R((e,t,r)=>Array.isArray(e)?t(e):r("Must be an array"));function Ht(e,t,r,n){let i=[];for(let s=0;s<e.length;++s){let o=e[s];if(o.ok)i.push(o.value);else{let u=o.error,a=t.slice();return a.splice(s,1,O(u,u.text?`${u.text} (at index ${s})`:`index ${s}`)),n(O(a))}}return r(i)}function Wt(e){let t=e.decode;return qt.then((r,n,i)=>{let s=r.map(t);return Ht(s,r,n,i)})}function Xt(e){return R((t,r,n)=>t instanceof e?r(t):n(`Must be ${e.name} instance`))}function Je(e){return R(t=>e().decode(t))}function Zt(e,t){let r=new Set;for(let n of e)t.has(n)||r.add(n);return r}var Ye=R((e,t,r)=>Me(e)?t(e):r("Must be an object"));function j(e){let t=new Set(Object.keys(e));return Ye.then((r,n,i)=>{let s=new Set(Object.keys(r)),o=Zt(t,s),u={},a=null;for(let c of Object.keys(e)){let l=e[c],f=r[c],p=l.decode(f);if(p.ok){let y=p.value;y!==void 0&&(u[c]=y),o.delete(c)}else{let y=p.error;f===void 0?o.add(c):(a===null&&(a=new Map),a.set(c,y))}}if(a||o.size>0){let c=Ge(r);if(a&&(c=Ue(c,a)),o.size>0){let l=Array.from(o).map(T).join(", "),f=o.size>1?"keys":"key";c=$e(c,`Missing ${f}: ${l}`)}return i(c)}return n(u)})}var se=`Either:
12
- `;function Qt(e){return`-${ce(e).substring(1)}`}function er(e){return e.startsWith(se)?e.substring(se.length):Qt(e)}function fe(...e){if(e.length===0)throw new Error("Pass at least one decoder to either()");return R((t,r,n)=>{let i=[];for(let o=0;o<e.length;o++){let u=e[o].decode(t);if(u.ok)return u;i.push(u.error)}let s=se+i.map(o=>er(z(o).join(`
2
+ var Wn=Object.create;var ce=Object.defineProperty,$n=Object.defineProperties,Un=Object.getOwnPropertyDescriptor,Zn=Object.getOwnPropertyDescriptors,Yn=Object.getOwnPropertyNames,se=Object.getOwnPropertySymbols,Hn=Object.getPrototypeOf,Ie=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable;var _e=(e,t,n)=>t in e?ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R=(e,t)=>{for(var n in t||(t={}))Ie.call(t,n)&&_e(e,n,t[n]);if(se)for(var n of se(t))ot.call(t,n)&&_e(e,n,t[n]);return e},it=(e,t)=>$n(e,Zn(t));var at=(e,t)=>{var n={};for(var r in e)Ie.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&se)for(var r of se(e))t.indexOf(r)<0&&ot.call(e,r)&&(n[r]=e[r]);return n};var zn=(e,t)=>()=>(e&&(t=e(e=0)),t);var Bn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Jn=(e,t)=>{for(var n in t)ce(e,n,{get:t[n],enumerable:!0})},Xn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Yn(t))!Ie.call(e,o)&&o!==n&&ce(e,o,{get:()=>t[o],enumerable:!(r=Un(t,o))||r.enumerable});return e};var st=(e,t,n)=>(n=e!=null?Wn(Hn(e)):{},Xn(t||!e||!e.__esModule?ce(n,"default",{value:e,enumerable:!0}):n,e));var C=(e,t,n)=>(_e(e,typeof t!="symbol"?t+"":t,n),n);var h=(e,t,n)=>new Promise((r,o)=>{var c=l=>{try{s(n.next(l))}catch(f){o(f)}},i=l=>{try{s(n.throw(l))}catch(f){o(f)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(c,i);s((n=n.apply(e,t)).next())});var ke=Bn((oa,ht)=>{"use strict";var Ae=class e extends Error{constructor(t){super(e._prepareSuperMessage(t)),Object.defineProperty(this,"name",{value:"NonError",configurable:!0,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(this,e)}static _prepareSuperMessage(t){try{return JSON.stringify(t)}catch(n){return String(t)}}},ir=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0}],Ce=Symbol(".toJSON called"),ar=e=>{e[Ce]=!0;let t=e.toJSON();return delete e[Ce],t},Te=({from:e,seen:t,to_:n,forceEnumerable:r,maxDepth:o,depth:c})=>{let i=n||(Array.isArray(e)?[]:{});if(t.push(e),c>=o)return i;if(typeof e.toJSON=="function"&&e[Ce]!==!0)return ar(e);for(let[s,l]of Object.entries(e)){if(typeof Buffer=="function"&&Buffer.isBuffer(l)){i[s]="[object Buffer]";continue}if(typeof l!="function"){if(!l||typeof l!="object"){i[s]=l;continue}if(!t.includes(e[s])){c++,i[s]=Te({from:e[s],seen:t.slice(),forceEnumerable:r,maxDepth:o,depth:c});continue}i[s]="[Circular]"}}for(let{property:s,enumerable:l}of ir)typeof e[s]=="string"&&Object.defineProperty(i,s,{value:e[s],enumerable:r?!0:l,configurable:!0,writable:!0});return i},sr=(e,t={})=>{let{maxDepth:n=Number.POSITIVE_INFINITY}=t;return typeof e=="object"&&e!==null?Te({from:e,seen:[],forceEnumerable:!0,maxDepth:n,depth:0}):typeof e=="function"?`[Function: ${e.name||"anonymous"}]`:e},cr=(e,t={})=>{let{maxDepth:n=Number.POSITIVE_INFINITY}=t;if(e instanceof Error)return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let r=new Error;return Te({from:e,seen:[],to_:r,maxDepth:n,depth:0}),r}return new Ae(e)};ht.exports={serializeError:sr,deserializeError:cr}});var on={};Jn(on,{componentsToDebugString:()=>He,default:()=>li,getFullscreenElement:()=>Ut,getUnstableAudioFingerprint:()=>Yt,getUnstableCanvasFingerprint:()=>Ht,getUnstableHardwareConcurrency:()=>Jt,getUnstableScreenFrame:()=>Bt,getUnstableScreenResolution:()=>zt,getWebGLContext:()=>Ye,hashComponents:()=>ze,isAndroid:()=>he,isChromium:()=>Y,isDesktopWebKit:()=>ge,isEdgeHTML:()=>Wt,isGecko:()=>H,isSamsungInternet:()=>Zt,isTrident:()=>Ue,isWebKit:()=>A,load:()=>rn,loadSources:()=>Gt,murmurX64Hash128:()=>fi,prepareForSources:()=>nn,sources:()=>tn,transformSource:()=>Pr,withIframe:()=>Ze});function me(e,t){return new Promise(n=>setTimeout(n,e,t))}function lr(){return new Promise(e=>{let t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function fr(e,t=1/0){let{requestIdleCallback:n}=window;return n?new Promise(r=>n.call(window,()=>r(),{timeout:t})):me(Math.min(e,t))}function ye(e){return!!e&&typeof e.then=="function"}function Pt(e,t){try{let n=e();ye(n)?n.then(r=>t(!0,r),r=>t(!1,r)):t(!0,n)}catch(n){t(!1,n)}}function Et(e,t,n=16){return h(this,null,function*(){let r=Array(e.length),o=Date.now();for(let c=0;c<e.length;++c){r[c]=t(e[c],c);let i=Date.now();i>=o+n&&(o=i,yield lr())}return r})}function K(e){return e.then(void 0,()=>{}),e}function dr(e,t){for(let n=0,r=e.length;n<r;++n)if(e[n]===t)return!0;return!1}function pr(e,t){return!dr(e,t)}function $e(e){return parseInt(e)}function T(e){return parseFloat(e)}function N(e,t){return typeof e=="number"&&isNaN(e)?t:e}function E(e){return e.reduce((t,n)=>t+(n?1:0),0)}function Dt(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{let n=1/t;return Math.round(e*n)/n}}function mr(e){var t,n;let r=`Unexpected syntax '${e}'`,o=/^\s*([a-z-]*)(.*)$/i.exec(e),c=o[1]||void 0,i={},s=/([.:#][\w-]+|\[.+?\])/gi,l=(f,a)=>{i[f]=i[f]||[],i[f].push(a)};for(;;){let f=s.exec(o[2]);if(!f)break;let a=f[0];switch(a[0]){case".":l("class",a.slice(1));break;case"#":l("id",a.slice(1));break;case"[":{let u=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(a);if(u)l(u[1],(n=(t=u[4])!==null&&t!==void 0?t:u[5])!==null&&n!==void 0?n:"");else throw new Error(r);break}default:throw new Error(r)}}return[c,i]}function yr(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>127)return new TextEncoder().encode(e);t[n]=r}return t}function D(e,t){let n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,c=e[1]&65535,i=t[0]>>>16,s=t[0]&65535,l=t[1]>>>16,f=t[1]&65535,a=0,u=0,d=0,p=0;p+=c+f,d+=p>>>16,p&=65535,d+=o+l,u+=d>>>16,d&=65535,u+=r+s,a+=u>>>16,u&=65535,a+=n+i,a&=65535,e[0]=a<<16|u,e[1]=d<<16|p}function O(e,t){let n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,c=e[1]&65535,i=t[0]>>>16,s=t[0]&65535,l=t[1]>>>16,f=t[1]&65535,a=0,u=0,d=0,p=0;p+=c*f,d+=p>>>16,p&=65535,d+=o*f,u+=d>>>16,d&=65535,d+=c*l,u+=d>>>16,d&=65535,u+=r*f,a+=u>>>16,u&=65535,u+=o*l,a+=u>>>16,u&=65535,u+=c*s,a+=u>>>16,u&=65535,a+=n*f+r*l+o*s+c*i,a&=65535,e[0]=a<<16|u,e[1]=d<<16|p}function $(e,t){let n=e[0];t%=64,t===32?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function x(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function S(e,t){e[0]^=t[0],e[1]^=t[1]}function _t(e){let t=[0,e[0]>>>1];S(e,t),O(e,gr),t[1]=e[0]>>>1,S(e,t),O(e,hr),t[1]=e[0]>>>1,S(e,t)}function jt(e,t){let n=yr(e);t=t||0;let r=[0,n.length],o=r[1]%16,c=r[1]-o,i=[0,t],s=[0,t],l=[0,0],f=[0,0],a;for(a=0;a<c;a=a+16)l[0]=n[a+4]|n[a+5]<<8|n[a+6]<<16|n[a+7]<<24,l[1]=n[a]|n[a+1]<<8|n[a+2]<<16|n[a+3]<<24,f[0]=n[a+12]|n[a+13]<<8|n[a+14]<<16|n[a+15]<<24,f[1]=n[a+8]|n[a+9]<<8|n[a+10]<<16|n[a+11]<<24,O(l,fe),$(l,31),O(l,de),S(i,l),$(i,27),D(i,s),O(i,It),D(i,br),O(f,de),$(f,33),O(f,fe),S(s,f),$(s,31),D(s,i),O(s,It),D(s,wr);l[0]=0,l[1]=0,f[0]=0,f[1]=0;let u=[0,0];switch(o){case 15:u[1]=n[a+14],x(u,48),S(f,u);case 14:u[1]=n[a+13],x(u,40),S(f,u);case 13:u[1]=n[a+12],x(u,32),S(f,u);case 12:u[1]=n[a+11],x(u,24),S(f,u);case 11:u[1]=n[a+10],x(u,16),S(f,u);case 10:u[1]=n[a+9],x(u,8),S(f,u);case 9:u[1]=n[a+8],S(f,u),O(f,de),$(f,33),O(f,fe),S(s,f);case 8:u[1]=n[a+7],x(u,56),S(l,u);case 7:u[1]=n[a+6],x(u,48),S(l,u);case 6:u[1]=n[a+5],x(u,40),S(l,u);case 5:u[1]=n[a+4],x(u,32),S(l,u);case 4:u[1]=n[a+3],x(u,24),S(l,u);case 3:u[1]=n[a+2],x(u,16),S(l,u);case 2:u[1]=n[a+1],x(u,8),S(l,u);case 1:u[1]=n[a],S(l,u),O(l,fe),$(l,31),O(l,de),S(i,l)}return S(i,r),S(s,r),D(i,s),D(s,i),_t(i),_t(s),D(i,s),D(s,i),("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)}function vr(e){var t;return R({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
3
+ `)},e)}function Sr(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Vt(e){return typeof e!="function"}function Rr(e,t){let n=K(new Promise(r=>{let o=Date.now();Pt(e.bind(null,t),(...c)=>{let i=Date.now()-o;if(!c[0])return r(()=>({error:c[1],duration:i}));let s=c[1];if(Vt(s))return r(()=>({value:s,duration:i}));r(()=>new Promise(l=>{let f=Date.now();Pt(s,(...a)=>{let u=i+Date.now()-f;if(!a[0])return l({error:a[1],duration:u});l({value:a[1],duration:u})})}))})}));return function(){return n.then(o=>o())}}function Gt(e,t,n,r){let o=Object.keys(e).filter(i=>pr(n,i)),c=K(Et(o,i=>Rr(e[i],t),r));return function(){return h(this,null,function*(){let s=yield c,l=yield Et(s,u=>K(u()),r),f=yield Promise.all(l),a={};for(let u=0;u<o.length;++u)a[o[u]]=f[u];return a})}}function Pr(e,t){let n=r=>Vt(r)?t(r):()=>{let o=r();return ye(o)?o.then(t):t(o)};return r=>{let o=e(r);return ye(o)?o.then(n):n(o)}}function Ue(){let e=window,t=navigator;return E(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Wt(){let e=window,t=navigator;return E(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Ue()}function Y(){let e=window,t=navigator;return E(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function A(){let e=window,t=navigator;return E(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function ge(){let e=window,{HTMLElement:t,Document:n}=e;return E(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function q(){let e=window;return Sr(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function H(){var e,t;let n=window;return E(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function Er(){let e=window,t=navigator,{CSS:n}=e;return E(["userActivation"in t,n.supports("color","light-dark(#000, #fff)"),n.supports("height","1lh"),"globalPrivacyControl"in t])>=3}function $t(){let{CSS:e}=window;return E([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function _r(){let e=window;return E([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function Ir(){let e=window,{URLPattern:t}=e;return E(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function xr(){let e=window;return E(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function Q(){let e=window,t=navigator,{CSS:n,HTMLButtonElement:r}=e;return E([!("getStorageUpdates"in t),r&&"popover"in r.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Or(){if(navigator.platform==="iPad")return!0;let e=screen,t=e.width/e.height;return E(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function Ut(){let e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Ar(){let e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function he(){let e=Y(),t=H(),n=window,r=navigator,o="connection";return e?E([!("SharedWorker"in n),r[o]&&"ontypechange"in r[o],!("sinkId"in new Audio)])>=2:t?E(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function Zt(){let e=navigator,t=window,n=Audio.prototype,{visualViewport:r}=t;return E(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3}function Cr(){return kr()?-4:Yt()}function Yt(){let e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Tr())return-1;let n=4500,r=5e3,o=new t(1,r,44100),c=o.createOscillator();c.type="triangle",c.frequency.value=1e4;let i=o.createDynamicsCompressor();i.threshold.value=-50,i.knee.value=40,i.ratio.value=12,i.attack.value=0,i.release.value=.25,c.connect(i),i.connect(o.destination),c.start(0);let[s,l]=Mr(o),f=K(s.then(a=>Lr(a.getChannelData(0).subarray(n)),a=>{if(a.name==="timeout"||a.name==="suspended")return-3;throw a}));return()=>(l(),f)}function Tr(){return A()&&!ge()&&!xr()}function kr(){return A()&&Q()&&q()||Y()&&Zt()&&Ir()}function Mr(e){let c=()=>{};return[new Promise((s,l)=>{let f=!1,a=0,u=0;e.oncomplete=y=>s(y.renderedBuffer);let d=()=>{setTimeout(()=>l(xt("timeout")),Math.min(500,u+5e3-Date.now()))},p=()=>{try{let y=e.startRendering();switch(ye(y)&&K(y),e.state){case"running":u=Date.now(),f&&d();break;case"suspended":document.hidden||a++,f&&a>=3?l(xt("suspended")):setTimeout(p,500);break}}catch(y){l(y)}};p(),c=()=>{f||(f=!0,u>0&&d())}}),c]}function Lr(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function xt(e){let t=new Error(e);return t.name=e,t}function Ze(e,t,n=50){return h(this,null,function*(){var r,o,c;let i=document;for(;!i.body;)yield me(n);let s=i.createElement("iframe");try{for(yield new Promise((l,f)=>{let a=!1,u=()=>{a=!0,l()},d=m=>{a=!0,f(m)};s.onload=u,s.onerror=d;let{style:p}=s;p.setProperty("display","block","important"),p.position="absolute",p.top="0",p.left="0",p.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",i.body.appendChild(s);let y=()=>{var m,g;a||(((g=(m=s.contentWindow)===null||m===void 0?void 0:m.document)===null||g===void 0?void 0:g.readyState)==="complete"?u():setTimeout(y,10))};y()});!(!((o=(r=s.contentWindow)===null||r===void 0?void 0:r.document)===null||o===void 0)&&o.body);)yield me(n);return yield e(s,s.contentWindow)}finally{(c=s.parentNode)===null||c===void 0||c.removeChild(s)}})}function Nr(e){let[t,n]=mr(e),r=document.createElement(t!=null?t:"div");for(let o of Object.keys(n)){let c=n[o].join(" ");o==="style"?Fr(r.style,c):r.setAttribute(o,c)}return r}function Fr(e,t){for(let n of t.split(";")){let r=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(r){let[,o,c,,i]=r;e.setProperty(o,c,i||"")}}}function Dr(){let e=window;for(;;){let t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}e=t}}function Gr(){return Ze((n,r)=>h(this,[n,r],function*(e,{document:t}){let o=t.body;o.style.fontSize=Vr;let c=t.createElement("div");c.style.setProperty("visibility","hidden","important");let i={},s={},l=m=>{let g=t.createElement("span"),{style:w}=g;return w.position="absolute",w.top="0",w.left="0",w.fontFamily=m,g.textContent=jr,c.appendChild(g),g},f=(m,g)=>l(`'${m}',${g}`),a=()=>U.map(l),u=()=>{let m={};for(let g of Ot)m[g]=U.map(w=>f(g,w));return m},d=m=>U.some((g,w)=>m[w].offsetWidth!==i[g]||m[w].offsetHeight!==s[g]),p=a(),y=u();o.appendChild(c);for(let m=0;m<U.length;m++)i[U[m]]=p[m].offsetWidth,s[U[m]]=p[m].offsetHeight;return Ot.filter(m=>d(y[m]))}))}function Wr(){let e=navigator.plugins;if(!e)return;let t=[];for(let n=0;n<e.length;++n){let r=e[n];if(!r)continue;let o=[];for(let c=0;c<r.length;++c){let i=r[c];o.push({type:i.type,suffixes:i.suffixes})}t.push({name:r.name,description:r.description,mimeTypes:o})}return t}function $r(){return Ht(Jr())}function Ht(e){let t=!1,n,r,[o,c]=Ur();return Zr(o,c)?(t=Yr(c),e?n=r="skipped":[n,r]=Hr(o,c)):n=r="unsupported",{winding:t,geometry:n,text:r}}function Ur(){let e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function Zr(e,t){return!!(t&&e.toDataURL)}function Yr(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function Hr(e,t){zr(e,t);let n=De(e),r=De(e);return n!==r?["unstable","unstable"]:(Br(e,t),[De(e),n])}function zr(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';let n="Cwm fjordbank gly \u{1F603}";t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}function Br(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(let[n,r,o]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(r,o,40,0,Math.PI*2,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function De(e){return e.toDataURL()}function Jr(){let e=A()&&Q()&&q(),t=H()&&Er();return e||t}function Xr(){let e=navigator,t=0,n;e.maxTouchPoints!==void 0?t=$e(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch(o){n=!1}let r="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:n,touchStart:r}}function Kr(){return navigator.oscpu}function qr(){let e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(n!==void 0&&t.push([n]),Array.isArray(e.languages))Y()&&_r()||t.push(e.languages);else if(typeof e.languages=="string"){let r=e.languages;r&&t.push(r.split(","))}return t}function Qr(){return window.screen.colorDepth}function eo(){return N(T(navigator.deviceMemory),void 0)}function to(){if(!(A()&&Q()&&q()))return zt()}function zt(){let e=screen,t=r=>N($e(r),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}function oo(){if(je!==void 0)return;let e=()=>{let t=Ge();We(t)?je=setTimeout(e,no):(pe=t,je=void 0)};e()}function Bt(){return oo(),()=>h(this,null,function*(){let e=Ge();if(We(e)){if(pe)return[...pe];Ut()&&(yield Ar(),e=Ge())}return We(e)||(pe=e),e})}function io(){let e=A()&&Q()&&q(),t=H()&&$t();if(e||t)return()=>Promise.resolve(void 0);let n=Bt();return()=>h(this,null,function*(){let r=yield n(),o=c=>c===null?null:Dt(c,ro);return[o(r[0]),o(r[1]),o(r[2]),o(r[3])]})}function Ge(){let e=screen;return[N(T(e.availTop),null),N(T(e.width)-T(e.availWidth)-N(T(e.availLeft),0),null),N(T(e.height)-T(e.availHeight)-N(T(e.availTop),0),null),N(T(e.availLeft),null)]}function We(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function ao(){let e=Jt();return e!==void 0&&H()&&$t()?e>=8?8:4:e}function Jt(){return N($e(navigator.hardwareConcurrency),void 0)}function so(){var e;let t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){let r=new t().resolvedOptions().timeZone;if(r)return r}let n=-co();return`UTC${n>=0?"+":""}${n}`}function co(){let e=new Date().getFullYear();return Math.max(T(new Date(e,0,1).getTimezoneOffset()),T(new Date(e,6,1).getTimezoneOffset()))}function uo(){try{return!!window.sessionStorage}catch(e){return!0}}function lo(){try{return!!window.localStorage}catch(e){return!0}}function fo(){if(!(Ue()||Wt()))try{return!!window.indexedDB}catch(e){return!0}}function po(){return!!window.openDatabase}function mo(){return navigator.cpuClass}function yo(){let{platform:e}=navigator;return e==="MacIntel"&&A()&&!ge()?Or()?"iPad":"iPhone":e}function go(){return navigator.vendor||""}function ho(){let e=[];for(let t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){let n=window[t];n&&typeof n=="object"&&e.push(t)}return e.sort()}function bo(){let e=document;try{e.cookie="cookietest=1; SameSite=Strict;";let t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(t){return!1}}function wo(){let e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function vo(){return h(this,arguments,function*({debug:e}={}){if(!So())return;let t=wo(),n=Object.keys(t),r=[].concat(...n.map(i=>t[i])),o=yield Ro(r);e&&Po(t,o);let c=n.filter(i=>{let s=t[i];return E(s.map(f=>o[f]))>s.length*.6});return c.sort(),c})}function So(){return A()||he()}function Ro(e){return h(this,null,function*(){var t;let n=document,r=n.createElement("div"),o=new Array(e.length),c={};At(r);for(let i=0;i<e.length;++i){let s=Nr(e[i]);s.tagName==="DIALOG"&&s.show();let l=n.createElement("div");At(l),l.appendChild(s),r.appendChild(l),o[i]=s}for(;!n.body;)yield me(50);n.body.appendChild(r);try{for(let i=0;i<e.length;++i)o[i].offsetParent||(c[e[i]]=!0)}finally{(t=r.parentNode)===null||t===void 0||t.removeChild(r)}return c})}function At(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Po(e,t){let n="DOM blockers debug:\n```";for(let r of Object.keys(e)){n+=`
4
+ ${r}:`;for(let o of e[r])n+=`
5
+ ${t[o]?"\u{1F6AB}":"\u27A1\uFE0F"} ${o}`}console.log(`${n}
6
+ \`\`\``)}function Eo(){for(let e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e}function _o(){if(Ct("inverted"))return!0;if(Ct("none"))return!1}function Ct(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Io(){if(Tt("active"))return!0;if(Tt("none"))return!1}function Tt(e){return matchMedia(`(forced-colors: ${e})`).matches}function Oo(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=xo;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}}function Ao(){if(Z("no-preference"))return 0;if(Z("high")||Z("more"))return 1;if(Z("low")||Z("less"))return-1;if(Z("forced"))return 10}function Z(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function Co(){if(kt("reduce"))return!0;if(kt("no-preference"))return!1}function kt(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function To(){if(Mt("reduce"))return!0;if(Mt("no-preference"))return!1}function Mt(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function ko(){if(Lt("high"))return!0;if(Lt("standard"))return!1}function Lt(e){return matchMedia(`(dynamic-range: ${e})`).matches}function Mo(){let e=b.acos||I,t=b.acosh||I,n=b.asin||I,r=b.asinh||I,o=b.atanh||I,c=b.atan||I,i=b.sin||I,s=b.sinh||I,l=b.cos||I,f=b.cosh||I,a=b.tan||I,u=b.tanh||I,d=b.exp||I,p=b.expm1||I,y=b.log1p||I,m=v=>b.pow(b.PI,v),g=v=>b.log(v+b.sqrt(v*v-1)),w=v=>b.log(v+b.sqrt(v*v+1)),F=v=>b.log((1+v)/(1-v))/2,M=v=>b.exp(v)-1/b.exp(v)/2,V=v=>(b.exp(v)+1/b.exp(v))/2,Re=v=>b.exp(v)-1,Pe=v=>(b.exp(2*v)-1)/(b.exp(2*v)+1),Ee=v=>b.log(1+v);return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:g(1e154),asin:n(.12312423423423424),asinh:r(1),asinhPf:w(1),atanh:o(.5),atanhPf:F(.5),atan:c(.5),sin:i(-1e300),sinh:s(1),sinhPf:M(1),cos:l(10.000000000123),cosh:f(1),coshPf:V(1),tan:a(-1e300),tanh:u(1),tanhPf:Pe(1),exp:d(1),expm1:p(1),expm1Pf:Re(1),log1p:y(10),log1pPf:Ee(10),powPI:m(-100)}}function No(){return Fo((e,t)=>{let n={},r={};for(let o of Object.keys(Ve)){let[c={},i=Lo]=Ve[o],s=e.createElement("span");s.textContent=i,s.style.whiteSpace="nowrap";for(let l of Object.keys(c)){let f=c[l];f!==void 0&&(s.style[l]=f)}n[o]=s,t.append(e.createElement("br"),s)}for(let o of Object.keys(Ve))r[o]=n[o].getBoundingClientRect().width;return r})}function Fo(e,t=4e3){return Ze((n,r)=>{let o=r.document,c=o.body,i=c.style;i.width=`${t}px`,i.webkitTextSizeAdjust=i.textSizeAdjust="none",Y()?c.style.zoom=`${1/r.devicePixelRatio}`:A()&&(c.style.zoom="reset");let s=o.createElement("div");return s.textContent=[...Array(t/20<<0)].map(()=>"word").join(" "),c.appendChild(s),e(o,c)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function Do(){return navigator.pdfViewerEnabled}function jo(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function Vo(){let{ApplePaySession:e}=window;if(typeof(e==null?void 0:e.canMakePayments)!="function")return-1;if(Go())return-3;try{return e.canMakePayments()?1:0}catch(t){return Wo(t)}}function Wo(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function $o(){var e;let t=document.createElement("a"),n=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return n===void 0?void 0:String(n)}function Bo({cache:e}){var t,n,r,o,c,i;let s=Ye(e);if(!s)return Xt;if(!en(s))return Kt;let l=Qt()?null:s.getExtension(qt);return{version:((t=s.getParameter(s.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((n=s.getParameter(s.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:l?(r=s.getParameter(l.UNMASKED_VENDOR_WEBGL))===null||r===void 0?void 0:r.toString():"",renderer:((o=s.getParameter(s.RENDERER))===null||o===void 0?void 0:o.toString())||"",rendererUnmasked:l?(c=s.getParameter(l.UNMASKED_RENDERER_WEBGL))===null||c===void 0?void 0:c.toString():"",shadingLanguageVersion:((i=s.getParameter(s.SHADING_LANGUAGE_VERSION))===null||i===void 0?void 0:i.toString())||""}}function Jo({cache:e}){let t=Ye(e);if(!t)return Xt;if(!en(t))return Kt;let n=t.getSupportedExtensions(),r=t.getContextAttributes(),o=[],c=[],i=[],s=[],l=[];if(r)for(let a of Object.keys(r))c.push(`${a}=${r[a]}`);let f=Nt(t);for(let a of f){let u=t[a];i.push(`${a}=${u}${Uo.has(u)?`=${t.getParameter(u)}`:""}`)}if(n)for(let a of n){if(a===qt&&Qt()||a===zo&&qo())continue;let u=t.getExtension(a);if(!u){o.push(a);continue}for(let d of Nt(u)){let p=u[d];s.push(`${d}=${p}${Zo.has(p)?`=${t.getParameter(p)}`:""}`)}}for(let a of Yo)for(let u of Ho){let d=Xo(t,a,u);l.push(`${a}.${u}=${d.join(",")}`)}return s.sort(),i.sort(),{contextAttributes:c,parameters:i,shaderPrecisions:l,extensions:n,extensionParameters:s,unsupportedExtensions:o}}function Ye(e){if(e.webgl)return e.webgl.context;let t=document.createElement("canvas"),n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(let r of["webgl","experimental-webgl"]){try{n=t.getContext(r)}catch(o){}if(n)break}return e.webgl={context:n},n}function Xo(e,t,n){let r=e.getShaderPrecisionFormat(e[t],e[n]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function Nt(e){return Object.keys(e.__proto__).filter(Ko)}function Ko(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function Qt(){return H()}function qo(){return Y()||A()}function en(e){return typeof e.getParameter=="function"}function Qo(){if(!(he()||A()))return-2;if(!window.AudioContext)return-1;let t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function ei(){if(!window.Intl)return-1;let e=window.Intl.DateTimeFormat;if(!e)return-2;let t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}function ti(e){return Gt(tn,e,[])}function ri(e){let t=oi(e),n=ii(t);return{score:t,comment:ni.replace(/\$/g,`${n}`)}}function oi(e){if(he())return .4;if(A())return ge()&&!(Q()&&q())?.5:.3;let t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function ii(e){return Dt(.99+.01*e,1e-4)}function ai(e){let t="";for(let n of Object.keys(e).sort()){let r=e[n],o="error"in r?"error":JSON.stringify(r.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${o}`}return t}function He(e){return JSON.stringify(e,(t,n)=>n instanceof Error?vr(n):n,2)}function ze(e){return jt(ai(e))}function si(e){let t,n=ri(e);return{get visitorId(){return t===void 0&&(t=ze(this.components)),t},set visitorId(r){t=r},confidence:n,components:e,version:Ft}}function nn(e=50){return fr(e,e*2)}function ci(e,t){let n=Date.now();return{get(o){return h(this,null,function*(){let c=Date.now(),i=yield e(),s=si(i);return(t||o!=null&&o.debug)&&console.log(`Copy the text below to get the debug data:
7
+
8
+ \`\`\`
9
+ version: ${s.version}
10
+ userAgent: ${navigator.userAgent}
11
+ timeBetweenLoadAndGet: ${c-n}
12
+ visitorId: ${s.visitorId}
13
+ components: ${He(i)}
14
+ \`\`\``),s})}}}function ui(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{let e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${Ft}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}function rn(){return h(this,arguments,function*(e={}){let{delayFallback:t,debug:n,monitoring:r=!0}=e;r&&ui(),yield nn(t);let o=ti({cache:{},debug:n});return ci(o,n)})}var Ft,gr,hr,fe,de,It,br,wr,jr,Vr,U,Ot,no,ro,pe,je,xo,b,I,Lo,Ve,Go,Xt,Kt,Uo,Zo,Yo,Ho,qt,zo,tn,ni,li,fi,an=zn(()=>{"use strict";Ft="5.1.0";gr=[4283543511,3981806797],hr=[3301882366,444984403];fe=[2277735313,289559509],de=[1291169091,658871167],It=[0,5],br=[0,1390208809],wr=[0,944331445];jr="mmMwWLliI0O&1",Vr="48px",U=["monospace","sans-serif","serif"],Ot=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];no=2500,ro=10;xo=100;b=Math,I=()=>0;Lo="mmMwWLliI0fiflO&1",Ve={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};Go=Dr;Xt=-1,Kt=-2,Uo=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Zo=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Yo=["FRAGMENT_SHADER","VERTEX_SHADER"],Ho=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],qt="WEBGL_debug_renderer_info",zo="WEBGL_polygon_mode";tn={fonts:Gr,domBlockers:vo,fontPreferences:No,audio:Cr,screenFrame:io,canvas:$r,osCpu:Kr,languages:qr,colorDepth:Qr,deviceMemory:eo,screenResolution:to,hardwareConcurrency:ao,timezone:so,sessionStorage:uo,localStorage:lo,indexedDB:fo,openDatabase:po,cpuClass:mo,platform:yo,plugins:Wr,touchSupport:Xr,vendor:go,vendorFlavors:ho,cookiesEnabled:bo,colorGamut:Eo,invertedColors:_o,forcedColors:Io,monochrome:Oo,contrast:Ao,reducedMotion:Co,reducedTransparency:To,hdr:ko,math:Mo,pdfViewerEnabled:Do,architecture:jo,applePay:Vo,privateClickMeasurement:$o,audioBaseLatency:Qo,dateTimeLocale:ei,webGlBasics:Bo,webGlExtensions:Jo};ni="$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score";li={load:rn,hashComponents:ze,componentsToDebugString:He},fi=jt});var ct=(r=>(r.ApplePay="APPLE_PAY",r.SamsungPay="SAMSUNG_PAY",r.GooglePay="GOOGLE_PAY",r))(ct||{});var X=function(){return X=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(t[c]=n[c])}return t},X.apply(this,arguments)};function ut(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function lt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,c;r<o;r++)(c||!(r in t))&&(c||(c=Array.prototype.slice.call(t,0,r)),c[r]=t[r]);return e.concat(c||Array.prototype.slice.call(t))}function Kn(e,t){return function(n,r){return Object.prototype.hasOwnProperty.call(n,r)}(e,t)?e[t]:void 0}function qn(e,t,n,r){var o,c=document,i="securitypolicyviolation",s=function(f){var a=new URL(e,location.href),u=f.blockedURI;u!==a.href&&u!==a.protocol.slice(0,-1)&&u!==a.origin||(o=f,l())};c.addEventListener(i,s);var l=function(){return c.removeEventListener(i,s)};return r==null||r.then(l,l),Promise.resolve().then(t).then(function(f){return l(),f},function(f){return new Promise(function(a){var u=new MessageChannel;u.port1.onmessage=function(){return a()},u.port2.postMessage(null)}).then(function(){if(l(),o)return n(o);throw f})})}var ft={default:"endpoint"};var dt="Blocked by CSP",pt="The endpoint parameter is not a valid URL";var Qn="API key required";var er="3.11.4",xe="Failed to load the JS script of the agent",Oe="9319";function tr(e,t){var n,r,o,c,i,s,l,f=[],a=(n=function(y){var m=lt([],y,!0);return{current:function(){return m[0]},postpone:function(){var g=m.shift();g!==void 0&&m.push(g)},exclude:function(){m.shift()}}}(e),c=100,i=3e3,s=0,r=function(){return Math.random()*Math.min(i,c*Math.pow(2,s++))},o=new Set,[n.current(),function(y,m){var g,w=m instanceof Error?m.message:"";if(w===dt||w===pt)n.exclude(),g=0;else if(w===Oe)n.exclude();else if(w===xe){var F=Date.now()-y.getTime()<50,M=n.current();M&&F&&!o.has(M)&&(o.add(M),g=0),n.postpone()}else n.postpone();var V=n.current();return V===void 0?void 0:[V,g!=null?g:y.getTime()+r()-Date.now()]}]),u=a[0],d=a[1];if(u===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var p=function(y){var m=new Date,g=function(F){return f.push({url:y,startedAt:m,finishedAt:new Date,error:F})},w=t(y);return w.then(function(){return g()},g),w.catch(function(F){if(l!=null||(l=F),f.length>=5)throw l;var M=d(m,F);if(!M)throw l;var V,Re=M[0],Pe=M[1];return(V=Pe,new Promise(function(Ee){return setTimeout(Ee,V)})).then(function(){return p(Re)})})};return p(u).then(function(y){return[y,f]})}var mt="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",yt=mt;function gt(e){var t;e.scriptUrlPattern;var n=e.token,r=e.apiKey,o=r===void 0?n:r,c=ut(e,["scriptUrlPattern","token","apiKey"]),i=(t=Kn(e,"scriptUrlPattern"))!==null&&t!==void 0?t:mt,s=function(){var a=[],u=function(){a.push({time:new Date,state:document.visibilityState})},d=function(p,y,m,g){return p.addEventListener(y,m,g),function(){return p.removeEventListener(y,m,g)}}(document,"visibilitychange",u);return u(),[a,d]}(),l=s[0],f=s[1];return Promise.resolve().then(function(){if(!o||typeof o!="string")throw new Error(Qn);var a=function(u,d){return(Array.isArray(u)?u:[u]).map(function(p){return function(y,m){var g=encodeURIComponent;return y.replace(/<[^<>]+>/g,function(w){return w==="<version>"?"3":w==="<apiKey>"?g(m):w==="<loaderVersion>"?g(er):w})}(String(p),d)})}(i,o);return tr(a,nr)}).catch(function(a){throw f(),function(u){return u instanceof Error&&u.message===Oe?new Error(xe):u}(a)}).then(function(a){var u=a[0],d=a[1];return f(),u.load(X(X({},c),{ldi:{attempts:d,visibilityStates:l}}))})}function nr(e){return qn(e,function(){return function(t){return new Promise(function(n,r){if(function(s){if(URL.prototype)try{return new URL(s,location.href),!1}catch(l){if(l instanceof Error&&l.name==="TypeError")return!0;throw l}}(t))throw new Error(pt);var o=document.createElement("script"),c=function(){var s;return(s=o.parentNode)===null||s===void 0?void 0:s.removeChild(o)},i=document.head||document.getElementsByTagName("head")[0];o.onload=function(){c(),n()},o.onerror=function(){c(),r(new Error(xe))},o.async=!0,o.src=t,i.appendChild(o)})}(e)},function(){throw new Error(dt)}).then(rr)}function rr(){var e=window,t="__fpjs_p_l_b",n=e[t];if(function(r,o){var c,i=(c=Object.getOwnPropertyDescriptor)===null||c===void 0?void 0:c.call(Object,r,o);i!=null&&i.configurable?delete r[o]:i&&!i.writable||(r[o]=void 0)}(e,t),typeof(n==null?void 0:n.load)!="function")throw new Error(Oe);return n}var bt=st(ke());function L(){return typeof crypto!="undefined"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var ur="https://analytics.stitch.money/query",Me={loggingUrl:ur},ue={};function Le(e={}){let r=e,{loggingUrl:t}=r,n=at(r,["loggingUrl"]);typeof t=="string"&&t.length>0&&(Me.loggingUrl=t),ue=R(R({sessionId:L()},ue),n)}function wt(){var e,t,n;return((t=(e=window==null?void 0:window.location)==null?void 0:e.ancestorOrigins)==null?void 0:t.length)>0?Object.values((n=window==null?void 0:window.location)==null?void 0:n.ancestorOrigins).join(","):(document==null?void 0:document.referrer)||void 0}function Ne(e,t){return h(this,null,function*(){try{yield fetch(Me.loggingUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"LOG_EVENT",event:{message:e,metadata:R(R({hostname:wt()},ue),t)}})})}catch(n){try{yield P("[logEvent] Error logging event",n,t)}catch(r){}}})}function P(e,t,n){return h(this,null,function*(){try{yield fetch(Me.loggingUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"LOG_ERROR",error:{message:e,error:(0,bt.serializeError)(t),metadata:R(R({hostname:wt()},ue),n)}})})}catch(r){}})}var cn=st(ke());var Fe;function le(e,t=0){let n=typeof e=="string"?(Fe!=null?Fe:Fe=new TextEncoder).encode(e):e,r=n,o=t+374761393&4294967295,c=0;if(r.length>=16){let s=[t+2654435761+2246822519&4294967295,t+2246822519&4294967295,t+0&4294967295,t-2654435761&4294967295],l=n,f=l.length-16,a=0;for(c=0;(c&4294967280)<=f;c+=4){let u=c,d=l[u+0]+(l[u+1]<<8),p=l[u+2]+(l[u+3]<<8),y=d*2246822519+(p*2246822519<<16),m=s[a]+y&4294967295;m=m<<13|m>>>19;let g=m&65535,w=m>>>16;s[a]=g*2654435761+(w*2654435761<<16)&4294967295,a=a+1&3}o=(s[0]<<1|s[0]>>>31)+(s[1]<<7|s[1]>>>25)+(s[2]<<12|s[2]>>>20)+(s[3]<<18|s[3]>>>14)&4294967295}o=o+n.length&4294967295;let i=n.length-4;for(;c<=i;c+=4){let s=c,l=r[s+0]+(r[s+1]<<8),f=r[s+2]+(r[s+3]<<8),a=l*3266489917+(f*3266489917<<16);o=o+a&4294967295,o=o<<17|o>>>15,o=(o&65535)*668265263+((o>>>16)*668265263<<16)&4294967295}for(;c<r.length;++c){let s=r[c];o=o+s*374761393,o=o<<11|o>>>21,o=(o&65535)*2654435761+((o>>>16)*2654435761<<16)&4294967295}return o=o^o>>>15,o=((o&65535)*2246822519&4294967295)+((o>>>16)*2246822519<<16),o=o^o>>>13,o=((o&65535)*3266489917&4294967295)+((o>>>16)*3266489917<<16),o=o^o>>>16,o<0?o+4294967296:o}function vt(e){let t={};if(e===null||typeof e!="object")return t;for(let[n,r]of Object.entries(e)){if(r===null||typeof r!="object")continue;let{value:o}=r;if(o!==void 0){if(typeof o=="string"||typeof o=="number"){t[n]=o.toString();continue}try{let c=JSON.stringify(o);if(c===void 0)continue;t[n]=le(c,0).toString()}catch(c){continue}}}return t}var St="stitch-fp-session-id";function Rt(){try{let e=localStorage.getItem(St);return e||(e=L(),localStorage.setItem(St,e)),e}catch(e){return}}var Be,Je,Xe;function sn(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="";for(let r=0;r<e;r++)n+=t.charAt(Math.floor(Math.random()*t.length));return n}function di(e){var r;let t=e.cause,n=t!=null?typeof t=="object"&&"message"in t?t.message:typeof t=="object"?"Unknown cause":String(t):void 0;return R(R(R({message:(r=e.message)!=null?r:"Unknown error",name:e.name},typeof e.code=="string"&&{code:e.code}),typeof e.requestId=="string"&&{requestId:e.requestId}),n&&{cause:n})}function un(t){return h(this,arguments,function*({config:e}){let n={apiKey:e.publicKey,endpoint:[e.endpoint,ft],scriptUrlPattern:[e.scriptUrlPattern,yt],region:"eu"},r=gt(n);if(e.ossEnabled!==!0)return{proAgent:yield r};let[o,c]=yield Promise.all([r,Promise.resolve().then(()=>(an(),on)).then(i=>i.load()).catch(i=>{P("OSS fingerprint agent load failed",i,{source:"fingerprint-stitch"})})]);return R({proAgent:o},c!==void 0&&{ossAgent:c})})}function ln(c){return h(this,arguments,function*({config:e,clientId:t,agent:n,payerId:r,sdkVersion:o}){let i=(e==null?void 0:e.ossEnabled)===!0;if((e==null?void 0:e.disabled)===!0){let l={disabled:!0,emulated:!1,fingerprintDetails:{timestamp:new Date().toISOString(),requestId:"",visitorId:""}};return btoa(JSON.stringify(l))}if((e==null?void 0:e.disabled)===!1&&(e!=null&&e.useEmulation)&&(t!=null&&t.startsWith("test"))){let l=R({disabled:!1,emulated:!0,fingerprintDetails:{timestamp:new Date().toISOString(),requestId:`${Date.now()}.${sn(6)}`,visitorId:sn(20)}},i&&{oss:{fingerprintHash:L().replace(/-/g,"").slice(0,8),rawSignals:{},sessionId:L(),source:"stitch-oss-web"}});return btoa(JSON.stringify(l))}if(n!==void 0&&(e==null?void 0:e.disabled)===!1){let l=Date.now();if(Be!==void 0&&Je!==void 0&&Xe!==void 0&&Xe.ossEnabled===i&&l-Je<e.cacheDurationInSeconds*1e3)return btoa(JSON.stringify(Be));try{let f={linkedId:t,tag:{payerId:r}},a,u;if(i&&n.ossAgent!==void 0){let[y,m]=yield Promise.allSettled([n.proAgent.get(f),n.ossAgent.get()]);if(y.status==="rejected")throw y.reason;a=y.value,m.status==="fulfilled"?u=m.value:P("OSS fingerprint collection failed",m.reason,{source:"fingerprint-stitch"})}else a=yield n.proAgent.get(f);let d;if(u!==void 0)try{if(typeof u.visitorId!="string"||u.visitorId.length===0)throw new Error("OSS fingerprint payload missing visitorId");d={fingerprintHash:u.visitorId,rawSignals:vt(u.components),sessionId:Rt(),source:"stitch-oss-web"}}catch(y){P("OSS fingerprint payload construction failed",y,{source:"fingerprint-stitch"})}let p=R({disabled:!1,emulated:!1,fingerprintDetails:{timestamp:new Date().toISOString(),requestId:a.requestId,visitorId:a.visitorId}},d!==void 0&&{oss:d});return Be=p,Je=l,Xe={ossEnabled:i},btoa(JSON.stringify(p))}catch(f){let a=di((0,cn.serializeError)(f)),u=a.name&&a.name!=="Error"?`${a.name}: ${a.message}`:a.message,d={error:R(R(R(R({outcome:"Failed",message:u||"Unknown error"},a.code&&{code:a.code}),a.cause&&{cause:a.cause}),a.requestId&&{requestId:a.requestId}),o&&{sdkVersion:o})};return btoa(JSON.stringify(d))}}let s={error:R({outcome:"Failed",message:"Attempted to get fingerprint data but either runtime config or the agent are not present"},o&&{sdkVersion:o})};return btoa(JSON.stringify(s))})}function pi(e){return typeof e=="number"}function mi(e){return typeof e=="string"}function yi(e){return typeof e=="bigint"}function dn(e){return!!e&&Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e)}function pn(e){return e!=null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"}var mn=new WeakSet;function ee(e){return mn.add(e),e}function yn(e,t){return ee({type:"object",fields:e,text:t})}function gi(e,t){return ee({type:"array",items:e,text:t})}function be(e,t){return ee({type:"opaque",value:e,text:t})}function hi(e,t){return ee({type:"scalar",value:e,text:t})}function gn(e,t){return t!==void 0?ee(it(R({},e),{text:t})):e}function hn(e,t){let n=new Map([...e.fields,...t]);return yn(n,e.text)}function bn(e){return mn.has(e)}function bi(e,t,n){n.add(e);let r=[];for(let o of e)r.push(Qe(o,void 0,n));return gi(r,t)}function wn(e,t,n){n.add(e);let r=new Map;for(let o of Object.keys(e)){let c=e[o];r.set(o,Qe(c,void 0,n))}return yn(r,t)}function Qe(e,t,n){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e.getMonth=="function"?hi(e,t):bn(e)?gn(e,t):Array.isArray(e)?n.has(e)?be("<circular ref>",t):bi(e,t,n):pn(e)?n.has(e)?be("<circular ref>",t):wn(e,t,n):be(typeof e=="function"?"<function>":"???",t)}function G(e,t){return Qe(e,t,new WeakSet)}function vn(e,t){return wn(e,t,new WeakSet)}var W=" ";function Ke(e){return e.indexOf(`
15
+ `)>=0}function et(e,t=W){return Ke(e)?e.split(`
16
+ `).map(n=>`${t}${n}`).join(`
17
+ `):`${t}${e}`}var wi=/'/g;function z(e){return typeof e=="string"?"'"+e.replace(wi,"\\'")+"'":JSON.stringify(e)}function we(e,t=[]){let n=[];if(e.type==="array"){let c=e.items,i=0;for(let s of c)for(let l of we(s,[...t,i++]))n.push(l)}else if(e.type==="object"){let c=e.fields;for(let[i,s]of c)for(let l of we(s,[...t,i]))n.push(l)}let r=e.text;if(!r)return n;let o;return t.length===0?o="":t.length===1?o=typeof t[0]=="number"?`Value at index ${t[0]}: `:`Value at key ${z(t[0])}: `:o=`Value at keypath ${z(t.map(String).join("."))}: `,[...n,`${o}${r}`]}function vi(e,t=80){let n=JSON.stringify(e);if(n.length<=t)return n;let r=`${e.substring(0,t-15)}...`;return n=`${JSON.stringify(r)} [truncated]`,n}function Si(e,t){let{items:n}=e;if(n.length===0)return"[]";let r=[];for(let o of n){let[c,i]=tt(o,`${t}${W}`);r.push(`${t}${W}${c},`),i!==void 0&&r.push(et(i,`${t}${W}`))}return["[",...r,`${t}]`].join(`
18
+ `)}function Ri(e,t){let{fields:n}=e;if(n.size===0)return"{}";let r=[];for(let[o,c]of n){let i=Sn(o),s=`${t}${W}${" ".repeat(i.length+2)}`,[l,f]=tt(c,`${t}${W}`);r.push(`${t}${W}${i}: ${l},`),f!==void 0&&r.push(et(f,s))}return["{",...r,`${t}}`].join(`
19
+ `)}function Sn(e){return typeof e=="string"?vi(e):typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"?e.toString():e===null?"null":e===void 0?"undefined":dn(e)?`new Date(${z(e.toISOString())})`:e instanceof Date?"(Invalid Date)":"(unserializable)"}function tt(e,t=""){let n;e.type==="array"?n=Si(e,t):e.type==="object"?n=Ri(e,t):e.type==="scalar"?n=Sn(e.value):n=e.value;let r=e.text;if(r!==void 0){let o="^".repeat(Ke(n)?1:n.length);return[n,[o,r].join(Ke(r)?`
20
+ `:" ")]}else return[n,void 0]}function Pi(e){let[t,n]=tt(e);return n!==void 0?`${t}
21
+ ${n}`:t}function Ei(e){return we(e,[]).join(`
22
+ `)}function Rn(e){return{ok:!0,value:e,error:void 0}}function Pn(e){return{ok:!1,value:void 0,error:e}}function _i(e){return t=>{try{let n=e(t);return Rn(n)}catch(n){return Pn(G(t,n instanceof Error?n.message:String(n)))}}}function Ii(e,t){let n=t(e);if(typeof n=="string"){let r=new Error(`
23
+ ${n}`);return r.name="Decoding error",r}else return n}function _(e){function t(a){return e(a,Rn,u=>Pn(bn(u)?u:G(a,u)))}function n(a,u=Pi){let d=t(a);if(d.ok)return d.value;throw Ii(d.error,u)}function r(a){return t(a).value}function o(a){return i(_i(a))}function c(a,u){return l(d=>a(d)?null:u)}function i(a){return _((u,d,p)=>{let y=t(u);if(!y.ok)return y;let m=fn(a)?a:a(y.value,d,p);return fn(m)?m.decode(y.value):m})}function s(a){return i(a)}function l(a){return i((u,d,p)=>{let y=a(u);return y===null?d(u):p(typeof y=="string"?G(u,y):y)})}function f(a){return _((u,d,p)=>{let y=t(u);return y.ok?y:p(G(y.error,a))})}return xi({verify:n,value:r,decode:t,transform:o,refine:c,reject:l,describe:f,then:i,pipe:s})}var En=new WeakSet;function xi(e){return En.add(e),e}function fn(e){return En.has(e)}var Oi=_((e,t,n)=>Array.isArray(e)?t(e):n("Must be an array"));function Ai(e,t,n,r){let o=[];for(let c=0;c<e.length;++c){let i=e[c];if(i.ok)o.push(i.value);else{let s=i.error,l=t.slice();return l.splice(c,1,G(s,s.text?`${s.text} (at index ${c})`:`index ${c}`)),r(G(l))}}return n(o)}function Ci(e){let t=e.decode;return Oi.then((n,r,o)=>{let c=n.map(t);return Ai(c,n,r,o)})}function Ti(e){return _((t,n,r)=>t instanceof e?n(t):r(`Must be ${e.name} instance`))}function _n(e){return _(t=>e().decode(t))}function ki(e,t){let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}var In=_((e,t,n)=>pn(e)?t(e):n("Must be an object"));function te(e){let t=new Set(Object.keys(e));return In.then((n,r,o)=>{let c=new Set(Object.keys(n)),i=ki(t,c),s={},l=null;for(let f of Object.keys(e)){let a=e[f],u=n[f],d=a.decode(u);if(d.ok){let p=d.value;p!==void 0&&(s[f]=p),i.delete(f)}else{let p=d.error;u===void 0?i.add(f):(l===null&&(l=new Map),l.set(f,p))}}if(l||i.size>0){let f=vn(n);if(l&&(f=hn(f,l)),i.size>0){let a=Array.from(i).map(z).join(", "),u=i.size>1?"keys":"key";f=gn(f,`Missing ${u}: ${a}`)}return o(f)}return r(s)})}var qe=`Either:
24
+ `;function Mi(e){return`-${et(e).substring(1)}`}function Li(e){return e.startsWith(qe)?e.substring(qe.length):Mi(e)}function ve(...e){if(e.length===0)throw new Error("Pass at least one decoder to either()");return _((t,n,r)=>{let o=[];for(let i=0;i<e.length;i++){let s=e[i].decode(t);if(s.ok)return s;o.push(s.error)}let c=qe+o.map(i=>Li(we(i).join(`
13
25
  `))).join(`
14
- `);return n(s)})}var tr=qe(null),Tr=qe(void 0),Cr=R((e,t,r)=>e==null?t(e):r("Must be undefined or null"));function qe(e){return R((t,r,n)=>t===e?r(e):n(`Must be ${typeof e=="symbol"?String(e):T(e)}`))}var xr=R((e,t,r)=>t(e));var K=R((e,t,r)=>typeof e=="boolean"?t(e):r("Must be boolean")),Nr=R((e,t,r)=>t(!!e));function rr(e,t){let r=t!==void 0?e:void 0,n=t!==void 0?t:e;return Ye.then((i,s,o)=>{var c;let u={},a=new Map;for(let l of Object.keys(i)){let f=i[l],p=r==null?void 0:r.decode(l);if((p==null?void 0:p.ok)===!1)return o(O(i,`Invalid key ${T(l)}: ${Kt(p.error)}`));let y=(c=p==null?void 0:p.value)!=null?c:l,d=n.decode(f);d.ok?a.size===0&&(u[y]=d.value):(a.set(l,d.error),u={})}return a.size>0?o(Ue(Ge(i),a)):s(u)})}var nr=/^([A-Za-z]{3,9}(?:[+][A-Za-z]{3,9})?):\/\/(?:([-;:&=+$,\w]+)@)?(?:([A-Za-z0-9.-]+)(?::([0-9]{2,5}))?)(\/(?:[-+~%/.,\w]*)?(?:\?[-+=&;%@.,/\w]*)?(?:#[.,!/\w]*)?)?$/,He=R((e,t,r)=>Mt(e)?t(e):r("Must be string")),C=v(/\S/,"Must be non-empty string");function v(e,t){return He.refine(r=>e.test(r),t)}var Dr=v(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"Must be email"),ir=fe(v(nr,"Must be URL").transform(e=>new URL(e)),Xt(URL)),Mr=ir.refine(e=>e.protocol==="https:","Must be an HTTPS URL"),jr=v(/^[a-z_][a-z0-9_]*$/i,"Must be valid identifier");var We=v(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,"Must be uuid"),kr=We.refine(e=>e[14]==="1","Must be uuidv1"),$r=We.refine(e=>e[14]==="4","Must be uuidv4"),or=v(/^[0-9]+$/,"Must only contain digits"),Ur=v(/^[0-9a-f]+$/i,"Must only contain hexadecimal digits"),Fr=or.transform(Number),ar=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:[.]\d+)?(?:Z|[+-]\d{2}:?\d{2})$/,sr=R((e,t,r)=>De(e)?t(e):r("Must be a Date")),ur=v(ar,"Must be ISO8601 format").transform(e=>{let t=new Date(e);if(isNaN(t.getTime()))throw new Error("Must be valid date/time value");return t}),Lr=fe(sr,ur).describe("Must be a Date or date string"),cr=R((e,t,r)=>Dt(e)?t(e):r("Must be number")),k=cr.refine(e=>Number.isFinite(e),"Number must be finite"),lr=k.refine(e=>Number.isInteger(e),"Number must be an integer"),Xe=k.refine(e=>e>=0&&!Object.is(e,-0),"Number must be positive"),Gr=lr.refine(e=>e>=0&&!Object.is(e,-0),"Number must be positive"),Vr=R((e,t,r)=>jt(e)?t(e):r("Must be bigint")),fr=Je(()=>rr(Ze)),pr=Je(()=>Wt(Ze)),Ze=fe(tr,He,k,K,fr,pr).describe("Must be valid JSON value");var B=3,Qe=500,dr=j({analytics:j({changeEventDebounceDelayMs:Xe}),evervault:j({teamId:C,appId:C}),fingerprint:j({disabled:K,useEmulation:K,publicKey:C,endpoint:C,scriptUrlPattern:C,cacheDurationInSeconds:k})});function $(e,t){return m(this,null,function*(){try{let r=0;for(;r<B;)try{let n=yield fetch(`https://public-keys.stitch.money/${e}`,{signal:t});if(n.ok)return{type:"success",runtimeConfig:dr.verify(yield n.json())};if(r++,r===B)return{type:"error",error:new Error(`[${$.name}] Failed to retrieve runtime config after ${B} attempts. public-keys worker returned ${n.status} response`)};yield new Promise(i=>setTimeout(i,Qe))}catch(n){if(r++,r===B)throw n;yield new Promise(i=>setTimeout(i,Qe))}return{type:"error",error:new Error(`[${$.name}] Failed to retrieve runtime config`)}}catch(r){return r instanceof Error?{type:"error",error:r}:typeof r=="string"?{type:"error",error:new Error(r)}:{type:"error",error:new Error(`[${$.name}] Failed to retrieve runtime config. Unknown error thrown`)}}})}import{v4 as mr}from"uuid";var yr="9ba67dd8d5b247cfb3f76e",U={version:"2",serviceId:yr,protocol:"PROTOCOL_3DS",allowedBrands:["visa","mastercard"]};function et(){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:["CRYPTOGRAM_3DS"],allowedCardNetworks:["VISA","MASTERCARD"]}}]}}function tt(e){return m(this,null,function*(){if(!window.ApplePaySession)return!1;let t=ApplePaySession;if(t.applePayCapabilities&&e)try{return(yield t.applePayCapabilities(e)).paymentCredentialStatus!=="applePayUnsupported"}catch(r){S("[determineApplePaySupport] failed to get applePayCapabilities, falling back to canMakePayments",r,{merchantIdentifier:e})}return t.canMakePayments()})}function rt(){if(!window.ApplePaySession)return-1;let t=r=>r===0?-1:ApplePaySession.supportsVersion(r)?r:t(r-1);return t(14)}function nt(e){return m(this,null,function*(){if(!e)return!1;try{return(yield e.isReadyToPay(et())).result}catch(t){return!1}})}function it(e){return m(this,null,function*(){if(!e)return!1;try{return(yield e.isReadyToPay(U)).result}catch(t){return!1}})}var P=class extends Error{constructor(t){super(t),this.name="SessionError"}};var F=e=>e instanceof Error?e.toString():JSON.stringify(e);var ot="3.8.0";var hr="[onvalidatemerchant]",at="[onpaymentauthorized]",x="[onClickSamsungPaySessionHandler]",pe="[onClickGooglePaySessionHandler]",st=class{constructor(t){E(this,"onCancelPayment");E(this,"clientId");E(this,"gatewayMerchantId");E(this,"applePayIsSupported",!1);E(this,"samsungPayIsSupported",!1);E(this,"googlePayIsSupported",!1);E(this,"runtimeConfig");E(this,"fingerprintAgent");E(this,"googlePayClient");E(this,"samsungPayClient");var o,u,a;ie({source:"wallets-client",version:ot});let{onCancelPayment:r,clientId:n,gatewayMerchantId:i}=t,s=(a=(u=(o=globalThis.google)==null?void 0:o.payments)==null?void 0:u.api)==null?void 0:a.PaymentsClient;this.googlePayClient=s?new s({environment:n!=null&&n.startsWith("test-")?"TEST":"PRODUCTION"}):void 0,this.samsungPayClient=window.SamsungPay?new window.SamsungPay.PaymentClient({environment:n!=null&&n.startsWith("test-")?"STAGE":"PRODUCTION",nonce:mr()}):void 0,this.onCancelPayment=r!=null?r:()=>{},this.clientId=n,this.gatewayMerchantId=i,this.loadFingerprintAgent()}loadRuntimeConfig(){return m(this,null,function*(){var t,r;if(this.runtimeConfig===void 0&&this.clientId){let n=yield $(this.clientId);if(n.type==="error"){let i=(r=(t=n.error)==null?void 0:t.message)!=null?r:"Failed to load runtime configuration";throw S(i,n.error,{clientId:this.clientId}),n.error?n.error:new Error(i)}this.runtimeConfig=n.runtimeConfig}})}loadFingerprintAgent(){return m(this,null,function*(){this.fingerprintAgent===void 0&&(this.runtimeConfig===void 0&&(yield this.loadRuntimeConfig()),this.runtimeConfig!==void 0&&!this.runtimeConfig.fingerprint.disabled&&(this.fingerprintAgent=yield Oe({config:this.runtimeConfig.fingerprint})))})}fingerprint(){return m(this,null,function*(){var r;let t=yield Ie({config:(r=this.runtimeConfig)==null?void 0:r.fingerprint,agent:this.fingerprintAgent,clientId:this.clientId});return ie({fingerprint:t}),t})}supportedPaymentMethods(){return m(this,null,function*(){let t=[];return this.applePayIsSupported=yield tt(this.gatewayMerchantId),this.applePayIsSupported&&t.push("APPLE_PAY"),this.samsungPayIsSupported=yield it(this.samsungPayClient),this.samsungPayIsSupported&&t.push("SAMSUNG_PAY"),this.googlePayIsSupported=yield nt(this.googlePayClient),this.googlePayIsSupported&&t.push("GOOGLE_PAY"),t})}onClickApplePaySessionHandler(t,r,n,i,s,o){let u=rt();return()=>{var l,f;let a={countryCode:"ZA",currencyCode:t,supportedNetworks:["visa","masterCard"],merchantCapabilities:["supports3DS"],total:{label:n,amount:r.toString()}};o&&(a.recurringPaymentRequest={paymentDescription:n,billingAgreement:o.billingAgreement,regularBilling:{label:n,amount:((l=o.recurringAmount)!=null?l:r).toString(),paymentTiming:"recurring",recurringPaymentIntervalUnit:o.recurringIntervalUnit,recurringPaymentIntervalCount:(f=o.recurringIntervalCount)!=null?f:1},managementURL:o.managementUrl});let c;try{c=new ApplePaySession(u,a)}catch(p){S("Failed to create Apple Pay session",p,{clientId:this.clientId});return}c.onvalidatemerchant=p=>m(this,null,function*(){try{let y=yield i(p.validationURL);c==null||c.completeMerchantValidation(y)}catch(y){throw S(`${hr} Failed to complete merchant validation`,y,{clientId:this.clientId}),new P(`Failed to complete merchant validation: ${F(y)}`)}}),c.onpaymentauthorized=p=>m(this,null,function*(){try{let y=p.payment.token,d=yield this.fingerprint(),g=yield s(y,d);switch(g.status){case"TransactionPending":case"TransactionSuccess":{c==null||c.completePayment(ApplePaySession.STATUS_SUCCESS);break}case"TransactionFailure":{c==null||c.completePayment(ApplePaySession.STATUS_FAILURE);break}default:{let h="Invalid transaction status",b=new P(`${h} ${g.status}`);throw S(`${at} Invalid transaction status`,b,{clientId:this.clientId}),b}}}catch(y){throw c==null||c.completePayment(ApplePaySession.STATUS_FAILURE),S(`${at} Failed to create payment`,y,{clientId:this.clientId}),new P(`Failed to create payment: ${F(y)}`)}}),c.oncancel=()=>{this.onCancelPayment()},c.begin()}}onClickSamsungPaySessionHandler(t,r,n,i,s,o,u){return()=>m(this,null,function*(){if(!this.samsungPayClient){let a="Samsung Pay client not initialized",c=new Error(a);throw S(`${x} ${a}`,c,{clientId:this.clientId}),c}try{let a={orderNumber:i,merchant:{name:n,url:s,id:o,countryCode:"ZA"},amount:{option:"FORMAT_TOTAL_PRICE_ONLY",currency:t,total:r}},c=yield this.fingerprint();oe(`${x} Loading payment sheet`,{clientId:this.clientId,type:"SAMSUNG_PAY",samsungPay:{paymentMethods:U,transactionDetail:a}});let l=yield this.samsungPayClient.loadPaymentSheet(U,a);oe(`${x} Received payment credential`,{clientId:this.clientId,type:"SAMSUNG_PAY",samsungPay:{paymentCredential:l}});let f=yield u(l,c);switch(f.status){case"TransactionPending":break;case"TransactionFailure":{this.samsungPayClient.notify({status:"REJECTED"});break}case"TransactionSuccess":{this.samsungPayClient.notify({status:"CHARGED"});break}default:{this.samsungPayClient.notify({status:"ERRED"});let p=`${x} Invalid transaction status: ${f.status}`,y=new P(p);throw S(p,y,{clientId:this.clientId,type:"SAMSUNG_PAY"}),y}}}catch(a){throw S(`${x} Failed to create payment`,a,{clientId:this.clientId,type:"SAMSUNG_PAY"}),new P(`${x} Failed to create payment: ${F(a)}`)}})}onClickGooglePaySessionHandler(t){return r=>m(this,null,function*(){try{let n=yield this.fingerprint(),i=yield t(r.paymentMethodData.tokenizationData.token,n);switch(i.status){case"TransactionPending":case"TransactionFailure":case"TransactionSuccess":break;default:{let s=`${pe} Invalid transaction status: ${i.status}`,o=new P(s);throw S(s,o,{clientId:this.clientId}),o}}}catch(n){throw S(`${pe} Failed to create payment`,n,{clientId:this.clientId}),new P(`${pe} Failed to create payment: ${F(n)}`)}})}};export{st as StitchWalletClientSdk,me as WalletType};
26
+ `);return r(c)})}function Ni(e){return typeof e=="function"?e():e}var Fi=On(null),Di=On(void 0),_a=_((e,t,n)=>e==null?t(e):n("Must be undefined or null"));function xn(e,t){let n=ve(Di,e);return arguments.length>=2?n.transform(r=>r!=null?r:Ni(t)):n}function On(e){return _((t,n,r)=>t===e?n(e):r(`Must be ${typeof e=="symbol"?String(e):z(e)}`))}var Ia=_((e,t,n)=>t(e));var ne=_((e,t,n)=>typeof e=="boolean"?t(e):n("Must be boolean")),xa=_((e,t,n)=>t(!!e));function ji(e,t){let n=t!==void 0?e:void 0,r=t!==void 0?t:e;return In.then((o,c,i)=>{var f;let s={},l=new Map;for(let a of Object.keys(o)){let u=o[a],d=n==null?void 0:n.decode(a);if((d==null?void 0:d.ok)===!1)return i(G(o,`Invalid key ${z(a)}: ${Ei(d.error)}`));let p=(f=d==null?void 0:d.value)!=null?f:a,y=r.decode(u);y.ok?l.size===0&&(s[p]=y.value):(l.set(a,y.error),s={})}return l.size>0?i(hn(vn(o),l)):c(s)})}var Vi=/^([A-Za-z]{3,9}(?:[+][A-Za-z]{3,9})?):\/\/(?:([-;:&=+$,\w]+)@)?(?:([A-Za-z0-9.-]+)(?::([0-9]{2,5}))?)(\/(?:[-+~%/.,\w]*)?(?:\?[-+=&;%@.,/\w]*)?(?:#[.,!/\w]*)?)?$/,An=_((e,t,n)=>mi(e)?t(e):n("Must be string")),B=j(/\S/,"Must be non-empty string");function j(e,t){return An.refine(n=>e.test(n),t)}var Oa=j(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"Must be email"),Gi=ve(j(Vi,"Must be URL").transform(e=>new URL(e)),Ti(URL)),Aa=Gi.refine(e=>e.protocol==="https:","Must be an HTTPS URL"),Ca=j(/^[a-z_][a-z0-9_]*$/i,"Must be valid identifier");var Cn=j(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,"Must be uuid"),Ta=Cn.refine(e=>e[14]==="1","Must be uuidv1"),ka=Cn.refine(e=>e[14]==="4","Must be uuidv4"),Wi=j(/^[0-9]+$/,"Must only contain digits"),Ma=j(/^[0-9a-f]+$/i,"Must only contain hexadecimal digits"),La=Wi.transform(Number),$i=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:[.]\d+)?(?:Z|[+-]\d{2}:?\d{2})$/,Ui=_((e,t,n)=>dn(e)?t(e):n("Must be a Date")),Zi=j($i,"Must be ISO8601 format").transform(e=>{let t=new Date(e);if(isNaN(t.getTime()))throw new Error("Must be valid date/time value");return t}),Na=ve(Ui,Zi).describe("Must be a Date or date string"),Yi=_((e,t,n)=>pi(e)?t(e):n("Must be number")),re=Yi.refine(e=>Number.isFinite(e),"Number must be finite"),Hi=re.refine(e=>Number.isInteger(e),"Number must be an integer"),Tn=re.refine(e=>e>=0&&!Object.is(e,-0),"Number must be positive"),Fa=Hi.refine(e=>e>=0&&!Object.is(e,-0),"Number must be positive"),Da=_((e,t,n)=>yi(e)?t(e):n("Must be bigint")),zi=_n(()=>ji(kn)),Bi=_n(()=>Ci(kn)),kn=ve(Fi,An,re,ne,zi,Bi).describe("Must be valid JSON value");var Se=3,Mn=500,Ji=te({analytics:te({changeEventDebounceDelayMs:Tn}),evervault:te({teamId:B,appId:B}),fingerprint:te({disabled:ne,useEmulation:ne,ossEnabled:xn(ne),publicKey:B,endpoint:B,scriptUrlPattern:B,cacheDurationInSeconds:re})});function oe(e,t){return h(this,null,function*(){try{let n=0;for(;n<Se;)try{let r=yield fetch(`https://public-keys.stitch.money/${e}`,{signal:t});if(r.ok)return{type:"success",runtimeConfig:Ji.verify(yield r.json())};if(n++,n===Se)return{type:"error",error:new Error(`[${oe.name}] Failed to retrieve runtime config after ${Se} attempts. public-keys worker returned ${r.status} response`)};yield new Promise(o=>setTimeout(o,Mn))}catch(r){if(n++,n===Se)throw r;yield new Promise(o=>setTimeout(o,Mn))}return{type:"error",error:new Error(`[${oe.name}] Failed to retrieve runtime config`)}}catch(n){return n instanceof Error?{type:"error",error:n}:typeof n=="string"?{type:"error",error:new Error(n)}:{type:"error",error:new Error(`[${oe.name}] Failed to retrieve runtime config. Unknown error thrown`)}}})}import{v4 as qi}from"uuid";var Xi="9ba67dd8d5b247cfb3f76e",ie={version:"2",serviceId:Xi,protocol:"PROTOCOL_3DS",allowedBrands:["visa","mastercard"]};function Ln(){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:["CRYPTOGRAM_3DS"],allowedCardNetworks:["VISA","MASTERCARD"]}}]}}function Nn(e){return h(this,null,function*(){if(!window.ApplePaySession)return!1;let t=ApplePaySession;if(t.applePayCapabilities&&e)try{return(yield t.applePayCapabilities(e)).paymentCredentialStatus!=="applePayUnsupported"}catch(n){P("[determineApplePaySupport] failed to get applePayCapabilities, falling back to canMakePayments",n,{merchantIdentifier:e})}return t.canMakePayments()})}function Fn(){if(!window.ApplePaySession)return-1;let t=n=>n===0?-1:ApplePaySession.supportsVersion(n)?n:t(n-1);return t(14)}function Dn(e){return h(this,null,function*(){if(!e)return!1;try{return(yield e.isReadyToPay(Ln())).result}catch(t){return!1}})}function jn(e){return h(this,null,function*(){if(!e)return!1;try{return(yield e.isReadyToPay(ie)).result}catch(t){return!1}})}var k=class extends Error{constructor(t){super(t),this.name="SessionError"}};var ae=e=>e instanceof Error?e.toString():JSON.stringify(e);var nt="3.9.0";var Qi="[onvalidatemerchant]",Vn="[onpaymentauthorized]",J="[onClickSamsungPaySessionHandler]",rt="[onClickGooglePaySessionHandler]",Gn=class{constructor(t){C(this,"onCancelPayment");C(this,"clientId");C(this,"gatewayMerchantId");C(this,"applePayIsSupported",!1);C(this,"samsungPayIsSupported",!1);C(this,"googlePayIsSupported",!1);C(this,"runtimeConfig");C(this,"fingerprintAgent");C(this,"googlePayClient");C(this,"samsungPayClient");var i,s,l;Le({source:"wallets-client",version:nt});let{onCancelPayment:n,clientId:r,gatewayMerchantId:o}=t,c=(l=(s=(i=globalThis.google)==null?void 0:i.payments)==null?void 0:s.api)==null?void 0:l.PaymentsClient;this.googlePayClient=c?new c({environment:r!=null&&r.startsWith("test-")?"TEST":"PRODUCTION"}):void 0,this.samsungPayClient=window.SamsungPay?new window.SamsungPay.PaymentClient({environment:r!=null&&r.startsWith("test-")?"STAGE":"PRODUCTION",nonce:qi()}):void 0,this.onCancelPayment=n!=null?n:()=>{},this.clientId=r,this.gatewayMerchantId=o,this.loadFingerprintAgent()}loadRuntimeConfig(){return h(this,null,function*(){var t,n;if(this.runtimeConfig===void 0&&this.clientId){let r=yield oe(this.clientId);if(r.type==="error"){let o=(n=(t=r.error)==null?void 0:t.message)!=null?n:"Failed to load runtime configuration";throw P(o,r.error,{clientId:this.clientId}),r.error?r.error:new Error(o)}this.runtimeConfig=r.runtimeConfig}})}loadFingerprintAgent(){return h(this,null,function*(){this.fingerprintAgent===void 0&&(this.runtimeConfig===void 0&&(yield this.loadRuntimeConfig()),this.runtimeConfig!==void 0&&!this.runtimeConfig.fingerprint.disabled&&(this.fingerprintAgent=yield un({config:this.runtimeConfig.fingerprint})))})}fingerprint(){return h(this,null,function*(){var n;let t=yield ln({config:(n=this.runtimeConfig)==null?void 0:n.fingerprint,agent:this.fingerprintAgent,clientId:this.clientId,sdkVersion:nt});return Le({fingerprint:t}),t})}supportedPaymentMethods(){return h(this,null,function*(){let t=[];return this.applePayIsSupported=yield Nn(this.gatewayMerchantId),this.applePayIsSupported&&t.push("APPLE_PAY"),this.samsungPayIsSupported=yield jn(this.samsungPayClient),this.samsungPayIsSupported&&t.push("SAMSUNG_PAY"),this.googlePayIsSupported=yield Dn(this.googlePayClient),this.googlePayIsSupported&&t.push("GOOGLE_PAY"),t})}onClickApplePaySessionHandler(t,n,r,o,c,i){let s=Fn();return()=>{var a,u;let l={countryCode:"ZA",currencyCode:t,supportedNetworks:["visa","masterCard"],merchantCapabilities:["supports3DS"],total:{label:r,amount:n.toString()}};i&&(l.recurringPaymentRequest={paymentDescription:r,billingAgreement:i.billingAgreement,regularBilling:{label:r,amount:((a=i.recurringAmount)!=null?a:n).toString(),paymentTiming:"recurring",recurringPaymentIntervalUnit:i.recurringIntervalUnit,recurringPaymentIntervalCount:(u=i.recurringIntervalCount)!=null?u:1},managementURL:i.managementUrl});let f;try{f=new ApplePaySession(s,l)}catch(d){P("Failed to create Apple Pay session",d,{clientId:this.clientId});return}f.onvalidatemerchant=d=>h(this,null,function*(){try{let p=yield o(d.validationURL);if(!f)throw new Error("ApplePaySession is missing");if(p==null||typeof p!="object")throw new Error(`verifyCallbackResponse is not an object: ${JSON.stringify(p)}`);if(Object.keys(p).length===0)throw new Error(`verifyCallbackResponse is an empty object: ${JSON.stringify(p)}`);f.completeMerchantValidation(p)}catch(p){throw P(`${Qi} Failed to complete merchant validation`,p,{clientId:this.clientId}),new k(`Failed to complete merchant validation: ${ae(p)}`)}}),f.onpaymentauthorized=d=>h(this,null,function*(){try{let p=d.payment.token,y=yield this.fingerprint(),m=yield c(p,y);switch(m.status){case"TransactionPending":case"TransactionSuccess":{f==null||f.completePayment(ApplePaySession.STATUS_SUCCESS);break}case"TransactionFailure":{f==null||f.completePayment(ApplePaySession.STATUS_FAILURE);break}default:{let g="Invalid transaction status",w=new k(`${g} ${m.status}`);throw P(`${Vn} Invalid transaction status`,w,{clientId:this.clientId}),w}}}catch(p){throw f==null||f.completePayment(ApplePaySession.STATUS_FAILURE),P(`${Vn} Failed to create payment`,p,{clientId:this.clientId}),new k(`Failed to create payment: ${ae(p)}`)}}),f.oncancel=()=>{this.onCancelPayment()},f.begin()}}onClickSamsungPaySessionHandler(t,n,r,o,c,i,s){return()=>h(this,null,function*(){if(!this.samsungPayClient){let l="Samsung Pay client not initialized",f=new Error(l);throw P(`${J} ${l}`,f,{clientId:this.clientId}),f}try{let l={orderNumber:o,merchant:{name:r,url:c,id:i,countryCode:"ZA"},amount:{option:"FORMAT_TOTAL_PRICE_ONLY",currency:t,total:n}},f=yield this.fingerprint();Ne(`${J} Loading payment sheet`,{clientId:this.clientId,type:"SAMSUNG_PAY",samsungPay:{paymentMethods:ie,transactionDetail:l}});let a=yield this.samsungPayClient.loadPaymentSheet(ie,l);Ne(`${J} Received payment credential`,{clientId:this.clientId,type:"SAMSUNG_PAY",samsungPay:{paymentCredential:a}});let u=yield s(a,f);switch(u.status){case"TransactionPending":break;case"TransactionFailure":{this.samsungPayClient.notify({status:"REJECTED"});break}case"TransactionSuccess":{this.samsungPayClient.notify({status:"CHARGED"});break}default:{this.samsungPayClient.notify({status:"ERRED"});let d=`${J} Invalid transaction status: ${u.status}`,p=new k(d);throw P(d,p,{clientId:this.clientId,type:"SAMSUNG_PAY"}),p}}}catch(l){throw P(`${J} Failed to create payment`,l,{clientId:this.clientId,type:"SAMSUNG_PAY"}),new k(`${J} Failed to create payment: ${ae(l)}`)}})}onClickGooglePaySessionHandler(t){return n=>h(this,null,function*(){try{let r=yield this.fingerprint(),o=yield t(n.paymentMethodData.tokenizationData.token,r);switch(o.status){case"TransactionPending":case"TransactionFailure":case"TransactionSuccess":break;default:{let c=`${rt} Invalid transaction status: ${o.status}`,i=new k(c);throw P(c,i,{clientId:this.clientId}),i}}}catch(r){throw P(`${rt} Failed to create payment`,r,{clientId:this.clientId}),new k(`${rt} Failed to create payment: ${ae(r)}`)}})}};export{Gn as StitchWalletClientSdk,ct as WalletType};
15
27
  //# sourceMappingURL=index.js.map