UNPKG

@bynn-intelligence/agemin-sdk

Version:

agemin.com SDK for age verification

1 lines 83.7 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Agemin={})}(this,function(e){"use strict";function t(e,t,n){const i=document.createElement(e);return t&&Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)}),n&&(i.style.cssText=n),i}const n='"5.7.1"',i={baseUrl:"https://verify.agemin.com",theme:"auto",locale:"auto",debug:!1,allowSearchEngineBypass:!1,searchEngineDetection:"ua"},r={overlay:"\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: 999998;\n display: flex;\n align-items: center;\n justify-content: center;\n backdrop-filter: blur(20px);\n animation: agemin-fade-in 0.3s ease-out;\n ",modal:"\n position: relative;\n width: 90%;\n max-width: 500px;\n height: auto;\n min-height: 400px;\n max-height: 90vh;\n background: white;\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n overflow: hidden;\n z-index: 999999;\n animation: agemin-slide-up 0.3s ease-out;\n transition: height 0.3s ease-out;\n ",closeButton:"\n position: absolute;\n top: 16px;\n right: 16px;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n background: rgba(0, 0, 0, 0.1);\n border: none;\n font-size: 20px;\n cursor: pointer;\n z-index: 1000000;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s;\n ",iframe:"\n width: 100%;\n height: 100%;\n border: none;\n "},o={overlay:"\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n background: white;\n z-index: 999998;\n ",modal:"\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n background: white;\n overflow: hidden;\n z-index: 999999;\n ",closeButton:"\n position: absolute;\n top: 16px;\n right: 16px;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n background: rgba(0, 0, 0, 0.05);\n border: none;\n font-size: 20px;\n cursor: pointer;\n z-index: 1000001;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s;\n ",iframe:"\n width: 100%;\n height: 100%;\n border: none;\n "},a={container:"\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1000002;\n ",spinner:"\n width: 48px;\n height: 48px;\n border: 4px solid rgba(255, 255, 255, 0.3);\n border-top-color: white;\n border-radius: 50%;\n animation: agemin-spin 1s linear infinite;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n ",spinnerMobile:"\n width: 56px;\n height: 56px;\n border: 4px solid rgba(0, 0, 0, 0.1);\n border-top-color: #3b82f6;\n border-radius: 50%;\n animation: agemin-spin 1s linear infinite;\n "};function s(){const e=window.innerWidth<768,t="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,n=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),i=window.innerWidth<1024&&t;return e||t&&n||i}function c(){return"undefined"!=typeof window&&"function"==typeof window.postMessage&&"function"==typeof window.addEventListener}function d(){return"undefined"!=typeof navigator&&0===navigator.plugins.length||"undefined"!=typeof navigator&&(!navigator.languages||Array.isArray(navigator.languages)&&0===navigator.languages.length||""===navigator.languages)||function(){if("undefined"==typeof document)return!1;try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!(t&&t instanceof WebGLRenderingContext))return!1;const n=t.getExtension("WEBGL_debug_renderer_info");if(!n)return!1;const i=t.getParameter(n.UNMASKED_VENDOR_WEBGL),r=t.getParameter(n.UNMASKED_RENDERER_WEBGL);return"Brian Paul"===i&&"Mesa OffScreen"===r||"Google Inc."===i&&"Google SwiftShader"===r}catch(e){return!1}}()}function l(){if("undefined"==typeof document)return!0;try{document.cookie="agemin_test=1; path=/";const e=-1!==document.cookie.indexOf("agemin_test=");return e&&(document.cookie="agemin_test=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"),e}catch(e){return!0}}function u(){if("undefined"==typeof navigator||!navigator.userAgent)return!1;const e=navigator.userAgent.toLowerCase();return["googlebot","adsbot-google","mediapartners-google","google-inspectiontool","googlesecurityscanner","bingbot","bingpreview","msnbot","adidxbot","baiduspider","baidu","yandexbot","yandex","duckduckbot","duckduckgo","slurp","facebookexternalhit","facebookcatalog","twitterbot","linkedinbot","whatsapp","telegrambot","discordbot","slackbot","applebot","ahrefsbot","semrushbot","dotbot","rogerbot","seznambot","petalbot","mj12bot","blexbot","serpstatbot","screaming frog","bot","crawler","spider","scraper"].some(t=>e.includes(t))}let f=null;function h(e="ua"){if(f&&f.mode===e&&Date.now()-f.timestamp<6e4)return f.result;let t=!1;switch(e){case"ua":default:t=u();break;case"headless":t=d();break;case"cookies":t=!l();break;case"combined":t=u()||d()||!l();break;case"strict":t=u()&&(d()||!l())}return f={mode:e,result:t,timestamp:Date.now()},t}class m{constructor(){this.verificationWindow=null,this.escKeyHandler=null,this.loadingSpinner=null,this.setupStyles()}setupStyles(){!function(e,n){if(!document.getElementById(e)){const i=t("style",{id:e});i.textContent=n,document.head.appendChild(i)}}("agemin-styles","\n @keyframes agemin-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes agemin-slide-up {\n from { transform: translateY(20px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n }\n @keyframes agemin-fade-out {\n from { opacity: 1; }\n to { opacity: 0; }\n }\n @keyframes agemin-slide-down {\n from { transform: translateY(0); opacity: 1; }\n to { transform: translateY(20px); opacity: 0; }\n }\n @keyframes agemin-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n")}openIframe(e,n){if(document.getElementById("agemin-iframe"))return;const i=s(),c=i?o:r,d=t("div",{id:"agemin-overlay"},c.overlay);this.loadingSpinner=t("div",{id:"agemin-spinner-container"},a.container);const l=t("div",{id:"agemin-spinner"},i?a.spinnerMobile:a.spinner);if(this.loadingSpinner.appendChild(l),i){const i=t("button",{id:"agemin-close-btn"},c.closeButton);i.innerHTML="✕",i.onmouseover=()=>i.style.background="rgba(0, 0, 0, 0.1)",i.onmouseout=()=>i.style.background="rgba(0, 0, 0, 0.05)",i.onclick=()=>{this.close(),n&&n()};const r=t("iframe",{id:"agemin-iframe",src:e,allow:"camera; microphone"},c.iframe+"opacity: 0; transition: opacity 0.3s ease-out;");this.verificationWindow=r,d.appendChild(r),d.appendChild(this.loadingSpinner),d.appendChild(i),document.body.appendChild(d),document.body.style.overflow="hidden"}else{const i=t("div",{id:"agemin-modal"},c.modal),r=t("button",{},c.closeButton);r.innerHTML="✕",r.onmouseover=()=>r.style.background="rgba(0, 0, 0, 0.2)",r.onmouseout=()=>r.style.background="rgba(0, 0, 0, 0.1)",r.onclick=()=>{this.close(),n&&n()};const o=t("iframe",{id:"agemin-iframe",src:e,allow:"camera; microphone"},c.iframe+"opacity: 0; transition: opacity 0.3s ease-out;");this.verificationWindow=o,i.appendChild(r),i.appendChild(o),i.appendChild(this.loadingSpinner),d.appendChild(i),document.body.appendChild(d)}i||(this.escKeyHandler=e=>{"Escape"===e.key&&(this.close(),n&&n())},document.addEventListener("keydown",this.escKeyHandler))}close(){const e=document.getElementById("agemin-overlay"),t=document.getElementById("agemin-modal");e&&t?(e.style.animation="agemin-fade-out 0.3s ease-out",t.style.animation="agemin-slide-down 0.3s ease-out",setTimeout(()=>{this.cleanup()},300)):this.cleanup()}cleanup(){!function(e){const t=document.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}("agemin-overlay"),document.body.style.overflow="",this.escKeyHandler&&(document.removeEventListener("keydown",this.escKeyHandler),this.escKeyHandler=null),this.verificationWindow=null}getWindow(){return this.verificationWindow}isOpen(){return null!==document.getElementById("agemin-iframe")}updateHeight(e){if(s())return;const t=document.getElementById("agemin-modal");if(t){const n=400,i=.9*window.innerHeight,r=Math.min(Math.max(e,n),i);t.style.height=`${r}px`}}hideLoading(){this.loadingSpinner&&(this.loadingSpinner.style.opacity="0",this.loadingSpinner.style.transition="opacity 0.3s ease-out",setTimeout(()=>{this.loadingSpinner&&this.loadingSpinner.parentNode&&(this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),this.loadingSpinner=null)},300));const e=document.getElementById("agemin-iframe");e&&(e.style.opacity="1")}}var p;function g(e,t,n){let i="";if(null===n||0===n)i="";else if(n>0){const e=new Date;e.setTime(e.getTime()+1e3*n),i="; expires="+e.toUTCString()}const r=window.location.hostname,o=r.split(".");let a="";"localhost"===r||/^[\d.]+$/.test(r)?a="":o.length>=2&&(a="; domain=."+o.slice(-2).join("."));const s=e+"="+encodeURIComponent(t)+i+a+"; path=/; SameSite=Lax";"https:"===window.location.protocol?document.cookie=s+"; Secure":document.cookie=s}e.MessageType=void 0,(p=e.MessageType||(e.MessageType={})).SUCCESS="agemin:verification:success",p.ERROR="agemin:verification:error",p.CANCEL="agemin:verification:cancel",p.CLOSE="agemin:verification:close",p.READY="agemin:verification:ready",p.RESIZE="agemin:verification:resize",p.APP_READY="agemin:app:ready",p.APP_ERROR="agemin:app:error",p.PROGRESS="agemin:verification:progress",p.STATE_CHANGE="agemin:state:change",p.USER_ACTION="agemin:user:action",p.CONFIG_RECEIVED="agemin:config:received";const y=new TextEncoder,w=new TextDecoder;function v(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function b(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64("string"==typeof e?e:w.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=w.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return v(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}class _ extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class E extends _{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(e,t,n="unspecified",i="unspecified"){super(e,{cause:{claim:n,reason:i,payload:t}}),this.claim=n,this.reason=i,this.payload=t}}class S extends _{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(e,t,n="unspecified",i="unspecified"){super(e,{cause:{claim:n,reason:i,payload:t}}),this.claim=n,this.reason=i,this.payload=t}}class A extends _{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"}class I extends _{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class k extends _{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class R extends _{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class C extends _{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(e="signature verification failed",t){super(e,t)}}function L(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function M(e,t){return e.name===t}function P(e){return parseInt(e.name.slice(4),10)}function W(e,t,n){switch(t){case"HS256":case"HS384":case"HS512":{if(!M(e.algorithm,"HMAC"))throw L("HMAC");const n=parseInt(t.slice(2),10);if(P(e.algorithm.hash)!==n)throw L(`SHA-${n}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!M(e.algorithm,"RSASSA-PKCS1-v1_5"))throw L("RSASSA-PKCS1-v1_5");const n=parseInt(t.slice(2),10);if(P(e.algorithm.hash)!==n)throw L(`SHA-${n}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!M(e.algorithm,"RSA-PSS"))throw L("RSA-PSS");const n=parseInt(t.slice(2),10);if(P(e.algorithm.hash)!==n)throw L(`SHA-${n}`,"algorithm.hash");break}case"Ed25519":case"EdDSA":if(!M(e.algorithm,"Ed25519"))throw L("Ed25519");break;case"ES256":case"ES384":case"ES512":{if(!M(e.algorithm,"ECDSA"))throw L("ECDSA");const n=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==n)throw L(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}!function(e,t){if(!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}(e,n)}function x(e,t,...n){if((n=n.filter(Boolean)).length>2){const t=n.pop();e+=`one of type ${n.join(", ")}, or ${t}.`}else 2===n.length?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}function G(e,t,...n){return x(`Key for the ${e} algorithm must be `,t,...n)}function N(e){return"CryptoKey"===e?.[Symbol.toStringTag]}function T(e){return"KeyObject"===e?.[Symbol.toStringTag]}var V=e=>N(e)||T(e);var H=e=>{if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n};const O=async(e,t,n,i)=>{let r,o;switch(n){case"PS256":case"PS384":case"PS512":r={name:"RSA-PSS",hash:`SHA-${n.slice(-3)}`},o=["verify"];break;case"RS256":case"RS384":case"RS512":r={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${n.slice(-3)}`},o=["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":r={name:"RSA-OAEP",hash:`SHA-${parseInt(n.slice(-3),10)||1}`},o=["encrypt","wrapKey"];break;case"ES256":case"ES384":case"ES512":r={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[n]},o=["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const e=(e=>{const t=Object.entries({"P-256":[6,8,42,134,72,206,61,3,1,7],"P-384":[6,5,43,129,4,0,34],"P-521":[6,5,43,129,4,0,35]}),n=Math.max(...t.map(([,e])=>e.length));for(let i=0;i<=e.byteLength-n;i++)for(const[n,r]of t)if(i<=e.byteLength-r.length&&e.subarray(i,i+r.length).every((e,t)=>e===r[t]))return n})(t);r=e?{name:"ECDH",namedCurve:e}:{name:"X25519"},o=[];break}case"Ed25519":case"EdDSA":r={name:"Ed25519"},o=["verify"];break;default:throw new I('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,r,!0,o)};var j=async e=>{if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:t,keyUsages:n}=function(e){let t,n;switch(e.kty){case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},n=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new I('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},n=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},n=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new I('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new I('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new I('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:n}}(e),i={...e};return delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,t,e.ext??!e.d,e.key_ops??n)};async function D(e,t,n){if(0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw new TypeError('"spki" must be SPKI formatted string');return((e,t)=>{const n=v(e.replace(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,""));return O("spki",n,t)})(e,t)}function J(e){return H(e)&&"string"==typeof e.kty}let F;const U=async(e,t,n,i=!1)=>{F||=new WeakMap;let r=F.get(e);if(r?.[n])return r[n];const o=await j({...t,alg:n});return i&&Object.freeze(e),r?r[n]=o:F.set(e,{[n]:o}),o};var Z=async(e,t)=>{if(e instanceof Uint8Array)return e;if(N(e))return e;if(T(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{F||=new WeakMap;let n=F.get(e);if(n?.[t])return n[t];const i="public"===e.type,r=!!i;let o;if("x25519"===e.asymmetricKeyType){switch(t){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}o=e.toCryptoKey(e.asymmetricKeyType,r,i?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw new TypeError("given KeyObject instance cannot be used for this algorithm");o=e.toCryptoKey(e.asymmetricKeyType,r,[i?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let n;switch(t){case"RSA-OAEP":n="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":n="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":n="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":n="SHA-512";break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:n},r,i?["encrypt"]:["decrypt"]);o=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:n},r,[i?"verify":"sign"])}if("ec"===e.asymmetricKeyType){const n=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!n)throw new TypeError("given KeyObject instance cannot be used for this algorithm");"ES256"===t&&"P-256"===n&&(o=e.toCryptoKey({name:"ECDSA",namedCurve:n},r,[i?"verify":"sign"])),"ES384"===t&&"P-384"===n&&(o=e.toCryptoKey({name:"ECDSA",namedCurve:n},r,[i?"verify":"sign"])),"ES512"===t&&"P-521"===n&&(o=e.toCryptoKey({name:"ECDSA",namedCurve:n},r,[i?"verify":"sign"])),t.startsWith("ECDH-ES")&&(o=e.toCryptoKey({name:"ECDH",namedCurve:n},r,i?[]:["deriveBits"]))}if(!o)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return n?n[t]=o:F.set(e,{[t]:o}),o})(e,t)}catch(e){if(e instanceof TypeError)throw e}let n=e.export({format:"jwk"});return U(e,n,t)}if(J(e))return e.k?b(e.k):U(e,e,t,!0);throw new Error("unreachable")};const K=e=>e?.[Symbol.toStringTag],B=(e,t,n)=>{if(void 0!==t.use){let e;switch(n){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw new TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(void 0!==t.alg&&t.alg!==e)throw new TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`);if(Array.isArray(t.key_ops)){let i;switch(!0){case"verify"===n:case"dir"===e:case e.includes("CBC-HS"):i=n;break;case e.startsWith("PBES2"):i="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):i=!e.includes("GCM")&&e.endsWith("KW")?"unwrapKey":n;break;case"encrypt"===n:i="wrapKey";break;case"decrypt"===n:i=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(i&&!1===t.key_ops?.includes?.(i))throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${i}" when present`)}return!0};var Y=(e,t,n)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(e)||/^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(e)?((e,t,n)=>{if(!(t instanceof Uint8Array)){if(J(t)){if(function(e){return"oct"===e.kty&&"string"==typeof e.k}(t)&&B(e,t,n))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!V(t))throw new TypeError(G(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw new TypeError(`${K(t)} instances for symmetric algorithms must be of type "secret"`)}})(e,t,n):((e,t,n)=>{if(J(t))switch(n){case"decrypt":case"sign":if(function(e){return"oct"!==e.kty&&"string"==typeof e.d}(t)&&B(e,t,n))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(function(e){return"oct"!==e.kty&&void 0===e.d}(t)&&B(e,t,n))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!V(t))throw new TypeError(G(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw new TypeError(`${K(t)} instances for asymmetric algorithms must not be of type "secret"`);if("public"===t.type)switch(n){case"sign":throw new TypeError(`${K(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw new TypeError(`${K(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if("private"===t.type)switch(n){case"verify":throw new TypeError(`${K(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw new TypeError(`${K(t)} instances for asymmetric algorithm encryption must be of type "public"`)}})(e,t,n)},X=async(e,t,n)=>{if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(((e,...t)=>x("Key must be ",e,...t))(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[n])}return W(t,e,n),t},z=async(e,t,n,i)=>{const r=await X(e,t,"verify");((e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if("number"!=typeof n||n<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}})(e,r);const o=((e,t)=>{const n=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};default:throw new I(`alg ${e} is not supported either by JOSE or your javascript runtime`)}})(e,r.algorithm);try{return await crypto.subtle.verify(o,r,n,i)}catch{return!1}};async function $(e,t,n){if(!H(e))throw new k("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new k('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new k("JWS Protected Header incorrect type");if(void 0===e.payload)throw new k("JWS Payload missing");if("string"!=typeof e.signature)throw new k("JWS Signature missing or incorrect type");if(void 0!==e.header&&!H(e.header))throw new k("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=b(e.protected);i=JSON.parse(w.decode(t))}catch{throw new k("JWS Protected Header is invalid")}if(!((...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let n;for(const e of t){const t=Object.keys(e);if(n&&0!==n.size)for(const e of t){if(n.has(e))return!1;n.add(e)}else n=new Set(t)}return!0})(i,e.header))throw new k("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...i,...e.header},o=((e,t,n,i,r)=>{if(void 0!==r.crit&&void 0===i?.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!i||void 0===i.crit)return new Set;if(!Array.isArray(i.crit)||0===i.crit.length||i.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==n?new Map([...Object.entries(n),...t.entries()]):t;for(const t of i.crit){if(!o.has(t))throw new I(`Extension Header Parameter "${t}" is not recognized`);if(void 0===r[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(o.get(t)&&void 0===i[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(i.crit)})(k,new Map([["b64",!0]]),n?.crit,i,r);let a=!0;if(o.has("b64")&&(a=i.b64,"boolean"!=typeof a))throw new k('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=r;if("string"!=typeof s||!s)throw new k('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=n&&((e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)})("algorithms",n.algorithms);if(c&&!c.has(s))throw new A('"alg" (Algorithm) Header Parameter value not allowed');if(a){if("string"!=typeof e.payload)throw new k("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new k("JWS Payload must be a string or an Uint8Array instance");let d=!1;"function"==typeof t&&(t=await t(i,e),d=!0),Y(s,t,"verify");const l=function(...e){const t=e.reduce((e,{length:t})=>e+t,0),n=new Uint8Array(t);let i=0;for(const t of e)n.set(t,i),i+=t.length;return n}(y.encode(e.protected??""),y.encode("."),"string"==typeof e.payload?y.encode(e.payload):e.payload);let u;try{u=b(e.signature)}catch{throw new k("Failed to base64url decode the signature")}const f=await Z(t,s);if(!await z(s,f,u,l))throw new C;let h;if(a)try{h=b(e.payload)}catch{throw new k("Failed to base64url decode the payload")}else h="string"==typeof e.payload?y.encode(e.payload):e.payload;const m={payload:h};return void 0!==e.protected&&(m.protectedHeader=i),void 0!==e.header&&(m.unprotectedHeader=e.header),d?{...m,key:f}:m}const Q=86400,q=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;var ee=e=>{const t=q.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const n=parseFloat(t[2]);let i;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":i=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":i=Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":i=Math.round(3600*n);break;case"day":case"days":case"d":i=Math.round(n*Q);break;case"week":case"weeks":case"w":i=Math.round(604800*n);break;default:i=Math.round(31557600*n)}return"-"===t[1]||"ago"===t[4]?-i:i};const te=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`;function ne(e,t,n={}){let i;try{i=JSON.parse(w.decode(t))}catch{}if(!H(i))throw new R("JWT Claims Set must be a top-level JSON object");const{typ:r}=n;if(r&&("string"!=typeof e.typ||te(e.typ)!==te(r)))throw new E('unexpected "typ" JWT header value',i,"typ","check_failed");const{requiredClaims:o=[],issuer:a,subject:s,audience:c,maxTokenAge:d}=n,l=[...o];void 0!==d&&l.push("iat"),void 0!==c&&l.push("aud"),void 0!==s&&l.push("sub"),void 0!==a&&l.push("iss");for(const e of new Set(l.reverse()))if(!(e in i))throw new E(`missing required "${e}" claim`,i,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(i.iss))throw new E('unexpected "iss" claim value',i,"iss","check_failed");if(s&&i.sub!==s)throw new E('unexpected "sub" claim value',i,"sub","check_failed");if(c&&(u=i.aud,f="string"==typeof c?[c]:c,!("string"==typeof u?f.includes(u):Array.isArray(u)&&f.some(Set.prototype.has.bind(new Set(u))))))throw new E('unexpected "aud" claim value',i,"aud","check_failed");var u,f;let h;switch(typeof n.clockTolerance){case"string":h=ee(n.clockTolerance);break;case"number":h=n.clockTolerance;break;case"undefined":h=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:m}=n,p=(g=m||new Date,Math.floor(g.getTime()/1e3));var g;if((void 0!==i.iat||d)&&"number"!=typeof i.iat)throw new E('"iat" claim must be a number',i,"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new E('"nbf" claim must be a number',i,"nbf","invalid");if(i.nbf>p+h)throw new E('"nbf" claim timestamp check failed',i,"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new E('"exp" claim must be a number',i,"exp","invalid");if(i.exp<=p-h)throw new S('"exp" claim timestamp check failed',i,"exp","check_failed")}if(d){const e=p-i.iat;if(e-h>("number"==typeof d?d:ee(d)))throw new S('"iat" claim timestamp check failed (too far in the past)',i,"iat","check_failed");if(e<0-h)throw new E('"iat" claim timestamp check failed (it should be in the past)',i,"iat","check_failed")}return i}async function ie(e,t,n){const i=await async function(e,t,n){if(e instanceof Uint8Array&&(e=w.decode(e)),"string"!=typeof e)throw new k("Compact JWS must be a string or Uint8Array");const{0:i,1:r,2:o,length:a}=e.split(".");if(3!==a)throw new k("Invalid Compact JWS");const s=await $({payload:r,protected:i,signature:o},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...c,key:s.key}:c}(e,t,n);if(i.protectedHeader.crit?.includes("b64")&&!1===i.protectedHeader.b64)throw new R("JWTs MUST NOT use unencoded payload");const r={payload:ne(i.protectedHeader,i.payload,n),protectedHeader:i.protectedHeader};return"function"==typeof t?{...r,key:i.key}:r}var re=function(){return re=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},re.apply(this,arguments)};function oe(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((i=i.apply(e,t||[])).next())})}function ae(e,t){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function se(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var ce="4.6.2";function de(e,t){return new Promise(function(n){return setTimeout(n,e,t)})}function le(e){return!!e&&"function"==typeof e.then}function ue(e,t){try{var n=e();le(n)?n.then(function(e){return t(!0,e)},function(e){return t(!1,e)}):t(!0,n)}catch(e){t(!1,e)}}function fe(e,t,n){return void 0===n&&(n=16),oe(this,void 0,void 0,function(){var i,r,o,a;return ae(this,function(s){switch(s.label){case 0:i=Array(e.length),r=Date.now(),o=0,s.label=1;case 1:return o<e.length?(i[o]=t(e[o],o),(a=Date.now())>=r+n?(r=a,[4,new Promise(function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)})]):[3,3]):[3,4];case 2:s.sent(),s.label=3;case 3:return++o,[3,1];case 4:return[2,i]}})})}function he(e){return e.then(void 0,function(){}),e}function me(e){return parseInt(e)}function pe(e){return parseFloat(e)}function ge(e,t){return"number"==typeof e&&isNaN(e)?t:e}function ye(e){return e.reduce(function(e,t){return e+(t?1:0)},0)}function we(e,t){if(void 0===t&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function ve(e,t){var n=e[0]>>>16,i=65535&e[0],r=e[1]>>>16,o=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,d=0,l=0,u=0,f=0;u+=(f+=o+(65535&t[1]))>>>16,f&=65535,l+=(u+=r+c)>>>16,u&=65535,d+=(l+=i+s)>>>16,l&=65535,d+=n+a,d&=65535,e[0]=d<<16|l,e[1]=u<<16|f}function be(e,t){var n=e[0]>>>16,i=65535&e[0],r=e[1]>>>16,o=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,d=65535&t[1],l=0,u=0,f=0,h=0;f+=(h+=o*d)>>>16,h&=65535,u+=(f+=r*d)>>>16,f&=65535,u+=(f+=o*c)>>>16,f&=65535,l+=(u+=i*d)>>>16,u&=65535,l+=(u+=r*c)>>>16,u&=65535,l+=(u+=o*s)>>>16,u&=65535,l+=n*d+i*c+r*s+o*a,l&=65535,e[0]=l<<16|u,e[1]=f<<16|h}function _e(e,t){var n=e[0];32===(t%=64)?(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 Ee(e,t){0!==(t%=64)&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function Se(e,t){e[0]^=t[0],e[1]^=t[1]}var Ae=[4283543511,3981806797],Ie=[3301882366,444984403];function ke(e){var t=[0,e[0]>>>1];Se(e,t),be(e,Ae),t[1]=e[0]>>>1,Se(e,t),be(e,Ie),t[1]=e[0]>>>1,Se(e,t)}var Re=[2277735313,289559509],Ce=[1291169091,658871167],Le=[0,5],Me=[0,1390208809],Pe=[0,944331445];function We(e,t){var n=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i>127)return(new TextEncoder).encode(e);t[n]=i}return t}(e);t=t||0;var i,r=[0,n.length],o=r[1]%16,a=r[1]-o,s=[0,t],c=[0,t],d=[0,0],l=[0,0];for(i=0;i<a;i+=16)d[0]=n[i+4]|n[i+5]<<8|n[i+6]<<16|n[i+7]<<24,d[1]=n[i]|n[i+1]<<8|n[i+2]<<16|n[i+3]<<24,l[0]=n[i+12]|n[i+13]<<8|n[i+14]<<16|n[i+15]<<24,l[1]=n[i+8]|n[i+9]<<8|n[i+10]<<16|n[i+11]<<24,be(d,Re),_e(d,31),be(d,Ce),Se(s,d),_e(s,27),ve(s,c),be(s,Le),ve(s,Me),be(l,Ce),_e(l,33),be(l,Re),Se(c,l),_e(c,31),ve(c,s),be(c,Le),ve(c,Pe);d[0]=0,d[1]=0,l[0]=0,l[1]=0;var u=[0,0];switch(o){case 15:u[1]=n[i+14],Ee(u,48),Se(l,u);case 14:u[1]=n[i+13],Ee(u,40),Se(l,u);case 13:u[1]=n[i+12],Ee(u,32),Se(l,u);case 12:u[1]=n[i+11],Ee(u,24),Se(l,u);case 11:u[1]=n[i+10],Ee(u,16),Se(l,u);case 10:u[1]=n[i+9],Ee(u,8),Se(l,u);case 9:u[1]=n[i+8],Se(l,u),be(l,Ce),_e(l,33),be(l,Re),Se(c,l);case 8:u[1]=n[i+7],Ee(u,56),Se(d,u);case 7:u[1]=n[i+6],Ee(u,48),Se(d,u);case 6:u[1]=n[i+5],Ee(u,40),Se(d,u);case 5:u[1]=n[i+4],Ee(u,32),Se(d,u);case 4:u[1]=n[i+3],Ee(u,24),Se(d,u);case 3:u[1]=n[i+2],Ee(u,16),Se(d,u);case 2:u[1]=n[i+1],Ee(u,8),Se(d,u);case 1:u[1]=n[i],Se(d,u),be(d,Re),_e(d,31),be(d,Ce),Se(s,d)}return Se(s,r),Se(c,r),ve(s,c),ve(c,s),ke(s),ke(c),ve(s,c),ve(c,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(c[0]>>>0).toString(16)).slice(-8)+("00000000"+(c[1]>>>0).toString(16)).slice(-8)}function xe(e,t,n,i){var r=Object.keys(e).filter(function(e){return!function(e,t){for(var n=0,i=e.length;n<i;++n)if(e[n]===t)return!0;return!1}(n,e)}),o=he(fe(r,function(n){return function(e,t){var n=he(new Promise(function(n){var i=Date.now();ue(e.bind(null,t),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Date.now()-i;if(!e[0])return n(function(){return{error:e[1],duration:r}});var o=e[1];if(function(e){return"function"!=typeof e}(o))return n(function(){return{value:o,duration:r}});n(function(){return new Promise(function(e){var t=Date.now();ue(o,function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=r+Date.now()-t;if(!n[0])return e({error:n[1],duration:o});e({value:n[1],duration:o})})})})})}));return function(){return n.then(function(e){return e()})}}(e[n],t)},i));return function(){return oe(this,void 0,void 0,function(){var e,t,n,a;return ae(this,function(s){switch(s.label){case 0:return[4,o];case 1:return[4,fe(s.sent(),function(e){return he(e())},i)];case 2:return e=s.sent(),[4,Promise.all(e)];case 3:for(t=s.sent(),n={},a=0;a<r.length;++a)n[r[a]]=t[a];return[2,n]}})})}}function Ge(){var e=window,t=navigator;return ye(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Ne(){var e=window,t=navigator;return ye(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===(t.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function Te(){var e=window;return ye(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function Ve(){var e=window,t=e.HTMLElement,n=e.Document;return ye(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function He(){var e,t=window;return e=t.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))&&"[object WebPageNamespace]"===String(t.browser)}function Oe(){var e,t,n=window;return ye(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function je(){var e=window,t=navigator,n=e.CSS,i=e.HTMLButtonElement;return ye([!("getStorageUpdates"in t),i&&"popover"in i.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function De(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Je(){var e=Ne(),t=Oe(),n=window,i=navigator,r="connection";return e?ye([!("SharedWorker"in n),i[r]&&"ontypechange"in i[r],!("sinkId"in new Audio)])>=2:!!t&&ye(["onorientationchange"in n,"orientation"in n,/android/i.test(i.appVersion)])>=2}function Fe(e){var t=new Error(e);return t.name=e,t}function Ue(e,t,n){var i,r,o;return void 0===n&&(n=50),oe(this,void 0,void 0,function(){var a,s;return ae(this,function(c){switch(c.label){case 0:a=document,c.label=1;case 1:return a.body?[3,3]:[4,de(n)];case 2:return c.sent(),[3,1];case 3:s=a.createElement("iframe"),c.label=4;case 4:return c.trys.push([4,,10,11]),[4,new Promise(function(e,n){var i=!1,r=function(){i=!0,e()};s.onload=r,s.onerror=function(e){i=!0,n(e)};var o=s.style;o.setProperty("display","block","important"),o.position="absolute",o.top="0",o.left="0",o.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",a.body.appendChild(s);var c=function(){var e,t;i||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?r():setTimeout(c,10))};c()})];case 5:c.sent(),c.label=6;case 6:return(null===(r=null===(i=s.contentWindow)||void 0===i?void 0:i.document)||void 0===r?void 0:r.body)?[3,8]:[4,de(n)];case 7:return c.sent(),[3,6];case 8:return[4,e(s,s.contentWindow)];case 9:return[2,c.sent()];case 10:return null===(o=s.parentNode)||void 0===o||o.removeChild(s),[7];case 11:return[2]}})})}function Ze(e){for(var t=function(e){for(var t,n,i="Unexpected syntax '".concat(e,"'"),r=/^\s*([a-z-]*)(.*)$/i.exec(e),o=r[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=function(e,t){a[e]=a[e]||[],a[e].push(t)};;){var d=s.exec(r[2]);if(!d)break;var l=d[0];switch(l[0]){case".":c("class",l.slice(1));break;case"#":c("id",l.slice(1));break;case"[":var u=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(l);if(!u)throw new Error(i);c(u[1],null!==(n=null!==(t=u[4])&&void 0!==t?t:u[5])&&void 0!==n?n:"");break;default:throw new Error(i)}}return[o,a]}(e),n=t[0],i=t[1],r=document.createElement(null!=n?n:"div"),o=0,a=Object.keys(i);o<a.length;o++){var s=a[o],c=i[s].join(" ");"style"===s?Ke(r.style,c):r.setAttribute(s,c)}return r}function Ke(e,t){for(var n=0,i=t.split(";");n<i.length;n++){var r=i[n],o=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(r);if(o){var a=o[1],s=o[2],c=o[4];e.setProperty(a,s,c||"")}}}var Be=["monospace","sans-serif","serif"],Ye=["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"];function Xe(e){return e.toDataURL()}var ze,$e;function Qe(){var e=this;return function(){if(void 0===$e){var e=function(){var t=qe();et(t)?$e=setTimeout(e,2500):(ze=t,$e=void 0)};e()}}(),function(){return oe(e,void 0,void 0,function(){var e;return ae(this,function(t){switch(t.label){case 0:return et(e=qe())?ze?[2,se([],ze,!0)]:(n=document).fullscreenElement||n.msFullscreenElement||n.mozFullScreenElement||n.webkitFullscreenElement?[4,De()]:[3,2]:[3,2];case 1:t.sent(),e=qe(),t.label=2;case 2:return et(e)||(ze=e),[2,e]}var n})})}}function qe(){var e=screen;return[ge(pe(e.availTop),null),ge(pe(e.width)-pe(e.availWidth)-ge(pe(e.availLeft),0),null),ge(pe(e.height)-pe(e.availHeight)-ge(pe(e.availTop),0),null),ge(pe(e.availLeft),null)]}function et(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function tt(e){var t;return oe(this,void 0,void 0,function(){var n,i,r,o,a,s,c;return ae(this,function(d){switch(d.label){case 0:for(n=document,i=n.createElement("div"),r=new Array(e.length),o={},nt(i),c=0;c<e.length;++c)"DIALOG"===(a=Ze(e[c])).tagName&&a.show(),nt(s=n.createElement("div")),s.appendChild(a),i.appendChild(s),r[c]=a;d.label=1;case 1:return n.body?[3,3]:[4,de(50)];case 2:return d.sent(),[3,1];case 3:n.body.appendChild(i);try{for(c=0;c<e.length;++c)r[c].offsetParent||(o[e[c]]=!0)}finally{null===(t=i.parentNode)||void 0===t||t.removeChild(i)}return[2,o]}})})}function nt(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function it(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function rt(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}function ot(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function at(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function st(e){return matchMedia("(prefers-reduced-transparency: ".concat(e,")")).matches}function ct(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var dt=Math,lt=function(){return 0};var ut={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};var ft=function(){for(var e=window;;){var t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(e){if(e instanceof Error&&"SecurityError"===e.name)return!0;throw e}e=t}};var ht=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]),mt=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),pt=["FRAGMENT_SHADER","VERTEX_SHADER"],gt=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],yt="WEBGL_debug_renderer_info";function wt(e){if(e.webgl)return e.webgl.context;var t,n=document.createElement("canvas");n.addEventListener("webglCreateContextError",function(){return t=void 0});for(var i=0,r=["webgl","experimental-webgl"];i<r.length;i++){var o=r[i];try{t=n.getContext(o)}catch(e){}if(t)break}return e.webgl={context:t},t}function vt(e,t,n){var i=e.getShaderPrecisionFormat(e[t],e[n]);return i?[i.rangeMin,i.rangeMax,i.precision]:[]}function bt(e){return Object.keys(e.__proto__).filter(_t)}function _t(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function Et(){return Oe()}function St(){return Ne()||Te()}function At(e){return"function"==typeof e.getParameter}var It={fonts:function(){var e=this;return Ue(function(t,n){var i=n.document;return oe(e,void 0,void 0,function(){var e,t,n,r,o,a,s,c,d,l,u;return ae(this,function(f){for((e=i.body).style.fontSize="48px",(t=i.createElement("div")).style.setProperty("visibility","hidden","important"),n={},r={},o=function(e){var n=i.createElement("span"),r=n.style;return r.position="absolute",r.top="0",r.left="0",r.fontFamily=e,n.textContent="mmMwWLliI0O&1",t.appendChild(n),n},a=function(e,t){return o("'".concat(e,"',").concat(t))},s=function(){for(var e={},t=function(t){e[t]=Be.map(function(e){return a(t,e)})},n=0,i=Ye;n<i.length;n++){t(i[n])}return e},c=function(e){return Be.some(function(t,i){return e[i].offsetWidth!==n[t]||e[i].offsetHeight!==r[t]})},d=function(){return Be.map(o)}(),l=s(),e.appendChild(t),u=0;u<Be.length;u++)n[Be[u]]=d[u].offsetWidth,r[Be[u]]=d[u].offsetHeight;return[2,Ye.filter(function(e){return c(l[e])})]})})})},domBlockers:function(e){var t=(void 0===e?{}:e).debug;return oe(this,void 0,void 0,function(){var e,n,i,r,o;return ae(this,function(a){switch(a.label){case 0:return Te()||Je()?(s=atob,e={abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',s("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",s("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",s("LnNwb25zb3JpdA=="),".ylamainos",s("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",s("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",s("LmhlYWRlci1ibG9ja2VkLWFk"),s("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",s("I2FkXzMwMFgyNTA="),s("I2Jhbm5lcmZsb2F0MjI="),s("I2NhbXBhaWduLWJhbm5lcg=="),s("I0FkLUNvbnRlbnQ=")],adGuardChinese:[s("LlppX2FkX2FfSA=="),s("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",s("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),s("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",s("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",s("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",s("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),s("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),s("LmFkZ29vZ2xl"),s("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[s("YW1wLWF1dG8tYWRz"),s("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",s("I2FkX2ludmlld19hcmVh")],adGuardRussian:[s("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),s("LnJlY2xhbWE="),'div[id^="smi2adblock"]',s("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[s("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),s("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",s("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),s("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),s("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",s("I3Jla2xhbWk="),s("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),s("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),s("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[s("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",s("LndpZGdldF9wb19hZHNfd2lkZ2V0"),s("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",s("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[s("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),s("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",s("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",s("I3Jla2xhbW5pLWJveA=="),s("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",s("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[s("I2FkdmVydGVudGll"),s("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",s("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",s("LnNwb25zb3JsaW5rZ3J1ZW4="),s("I3dlcmJ1bmdza3k="),s("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),s("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListIta