@spot-flow/checkout-inline-js 0.3.3 → 0.3.4

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.
@@ -1,5 +1,5 @@
1
- (function(Ze,Ue){typeof exports=="object"&&typeof module<"u"?Ue(exports):typeof define=="function"&&define.amd?define(["exports"],Ue):(Ze=typeof globalThis<"u"?globalThis:Ze||self,Ue(Ze.SpotflowCheckout={}))})(this,function(Ze){"use strict";var Ru=Object.defineProperty;var Nu=(Ze,Ue,Xt)=>Ue in Ze?Ru(Ze,Ue,{enumerable:!0,configurable:!0,writable:!0,value:Xt}):Ze[Ue]=Xt;var d=(Ze,Ue,Xt)=>Nu(Ze,typeof Ue!="symbol"?Ue+"":Ue,Xt);var Ue=document.createElement("style");Ue.textContent=`*:where(#checkout-modal,#checkout-modal *),:before:where(#checkout-modal,#checkout-modal *),:after:where(#checkout-modal,#checkout-modal *){box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before:where(#checkout-modal,#checkout-modal *),:after:where(#checkout-modal,#checkout-modal *){--tw-content: ""}#checkout-modal{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:IBM Plex Sans,Inter,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}#checkout-modal{margin:0;line-height:inherit}hr:where(#checkout-modal,#checkout-modal *){height:0;color:inherit;border-top-width:1px}abbr:where([title]):where(#checkout-modal,#checkout-modal *){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1:where(#checkout-modal,#checkout-modal *),h2:where(#checkout-modal,#checkout-modal *),h3:where(#checkout-modal,#checkout-modal *),h4:where(#checkout-modal,#checkout-modal *),h5:where(#checkout-modal,#checkout-modal *),h6:where(#checkout-modal,#checkout-modal *){font-size:inherit;font-weight:inherit}a:where(#checkout-modal,#checkout-modal *){color:inherit;text-decoration:inherit}b:where(#checkout-modal,#checkout-modal *),strong:where(#checkout-modal,#checkout-modal *){font-weight:bolder}code:where(#checkout-modal,#checkout-modal *),kbd:where(#checkout-modal,#checkout-modal *),samp:where(#checkout-modal,#checkout-modal *),pre:where(#checkout-modal,#checkout-modal *){font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small:where(#checkout-modal,#checkout-modal *){font-size:80%}sub:where(#checkout-modal,#checkout-modal *),sup:where(#checkout-modal,#checkout-modal *){font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub:where(#checkout-modal,#checkout-modal *){bottom:-.25em}sup:where(#checkout-modal,#checkout-modal *){top:-.5em}table:where(#checkout-modal,#checkout-modal *){text-indent:0;border-color:inherit;border-collapse:collapse}button:where(#checkout-modal,#checkout-modal *),input:where(#checkout-modal,#checkout-modal *),optgroup:where(#checkout-modal,#checkout-modal *),select:where(#checkout-modal,#checkout-modal *),textarea:where(#checkout-modal,#checkout-modal *){font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button:where(#checkout-modal,#checkout-modal *),select:where(#checkout-modal,#checkout-modal *){text-transform:none}button:where(#checkout-modal,#checkout-modal *),input:where([type=button]):where(#checkout-modal,#checkout-modal *),input:where([type=reset]):where(#checkout-modal,#checkout-modal *),input:where([type=submit]):where(#checkout-modal,#checkout-modal *){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring:where(#checkout-modal,#checkout-modal *){outline:auto}:-moz-ui-invalid:where(#checkout-modal,#checkout-modal *){box-shadow:none}progress:where(#checkout-modal,#checkout-modal *){vertical-align:baseline}::-webkit-inner-spin-button:where(#checkout-modal,#checkout-modal *),::-webkit-outer-spin-button:where(#checkout-modal,#checkout-modal *){height:auto}[type=search]:where(#checkout-modal,#checkout-modal *){-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration:where(#checkout-modal,#checkout-modal *){-webkit-appearance:none}::-webkit-file-upload-button:where(#checkout-modal,#checkout-modal *){-webkit-appearance:button;font:inherit}summary:where(#checkout-modal,#checkout-modal *){display:list-item}blockquote:where(#checkout-modal,#checkout-modal *),dl:where(#checkout-modal,#checkout-modal *),dd:where(#checkout-modal,#checkout-modal *),h1:where(#checkout-modal,#checkout-modal *),h2:where(#checkout-modal,#checkout-modal *),h3:where(#checkout-modal,#checkout-modal *),h4:where(#checkout-modal,#checkout-modal *),h5:where(#checkout-modal,#checkout-modal *),h6:where(#checkout-modal,#checkout-modal *),hr:where(#checkout-modal,#checkout-modal *),figure:where(#checkout-modal,#checkout-modal *),p:where(#checkout-modal,#checkout-modal *),pre:where(#checkout-modal,#checkout-modal *){margin:0}fieldset:where(#checkout-modal,#checkout-modal *){margin:0;padding:0}legend:where(#checkout-modal,#checkout-modal *){padding:0}ol:where(#checkout-modal,#checkout-modal *),ul:where(#checkout-modal,#checkout-modal *),menu:where(#checkout-modal,#checkout-modal *){list-style:none;margin:0;padding:0}dialog:where(#checkout-modal,#checkout-modal *){padding:0}textarea:where(#checkout-modal,#checkout-modal *){resize:vertical}input::-moz-placeholder:where(#checkout-modal,#checkout-modal *),textarea::-moz-placeholder:where(#checkout-modal,#checkout-modal *){opacity:1;color:#9ca3af}input::placeholder:where(#checkout-modal,#checkout-modal *),textarea::placeholder:where(#checkout-modal,#checkout-modal *){opacity:1;color:#9ca3af}button:where(#checkout-modal,#checkout-modal *),[role=button]:where(#checkout-modal,#checkout-modal *){cursor:pointer}:disabled:where(#checkout-modal,#checkout-modal *){cursor:default}img:where(#checkout-modal,#checkout-modal *),svg:where(#checkout-modal,#checkout-modal *),video:where(#checkout-modal,#checkout-modal *),canvas:where(#checkout-modal,#checkout-modal *),audio:where(#checkout-modal,#checkout-modal *),iframe:where(#checkout-modal,#checkout-modal *),embed:where(#checkout-modal,#checkout-modal *),object:where(#checkout-modal,#checkout-modal *){display:block;vertical-align:middle}img:where(#checkout-modal,#checkout-modal *),video:where(#checkout-modal,#checkout-modal *){max-width:100%;height:auto}[hidden]:where(#checkout-modal,#checkout-modal *){display:none}:root{--primary: 264, 52%, 6%;--primary-light: 266, 21%, 76%;--primary-10: 240, 39%, 86%, 1;--primary-lighter: 240, 100%, 98%;--primary-dark: 240, 39%, 52%;--primary-darker: 240, 100%, 28%;--primary-900: 240, 4%, 9%;--alphablack-10: 250, 22%, 22%;--success: 151, 58%, 46%;--error: 0, 74%, 48%;--error-dark: 19, 100%, 37%;--common: 60, 4%, 43%;--tone-10: 240, 2%, 90%;--tone-40: 202, 6%, 82%;--tone-50: 202, 4%, 68%;--tone-60: 260, 4%, 43%, 1;--tone-70: 266, 3%, 53%;--tone-80: 265, 10%, 24%, 1;--tone-90: 266, 18%, 15%;--tone-100: 266, 54%, 6%;--grey: 218, 15%, 65%;--grey-100: 270, 3%, 62%;--grey-200: 264, 3%, 72%;--grey-300: 260, 3%, 81%;--grey-400: 264, 6%, 34%;--grey-500: 217, 24%, 27%;--grey-600: 265, 10%, 24%;--grey-700: 260, 4%, 43%;--grey-800: 265, 21%, 76%;--grey-faint: 240, 7%, 97%;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}input:focus,button:focus{outline:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.container-center{display:flex;align-items:center;justify-content:center}.hide-scrollbar::-webkit-scrollbar{display:none!important}.hide-scrollbar{-ms-overflow-style:none!important;scrollbar-width:none!important}.container-between{display:flex;align-items:center;justify-content:space-between}.align-center{display:flex;align-items:center}.box-container{padding-left:0;padding-right:0;padding-top:1rem;padding-bottom:1rem}@media (min-width: 768px){.box-container{padding:1.75rem 1.25rem}}@media (min-width: 1024px){.box-container{padding-left:1.75rem;padding-right:1.75rem}}.button-fill{display:flex;height:2.5rem;align-items:center;justify-content:center;border-radius:.5rem;background-color:hsl(var(--primary));font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.button-outline{display:flex;height:2.5rem;align-items:center;justify-content:center;border-radius:.5rem;border-width:1px;border-color:hsl(var(--tone-100));font-size:.875rem;line-height:1.25rem;font-weight:600;color:hsl(var(--tone-100))}.payment-options{display:flex;width:100%;flex-direction:column;overflow:hidden}.tab{margin-bottom:.75rem;display:flex;align-items:center;justify-content:flex-start;text-align:left}.tab-button{display:flex;width:100%;flex-grow:1;align-items:center;border-radius:.5rem;border-width:1px;border-color:hsl(var(--grey-100));padding:.75rem 1.25rem;text-align:center;color:hsl(var(--primary))}.tab-button:disabled{cursor:not-allowed;opacity:.4}.tab-button:hover:disabled{border-color:#11032666;color:hsl(var(--primary) / .4)}@media (min-width: 768px){.tab-button{display:flex;justify-content:center;padding-left:.75rem;padding-right:.75rem}.tab-button:hover{border-color:hsl(var(--primary))}}.tab-button.active{border-width:2px;border-color:hsl(var(--primary))}.tab-button.active span{font-weight:700}.tab-button span{margin-top:.25rem;margin-bottom:.25rem;display:flex;flex-shrink:0;justify-content:center}@media (min-width: 768px){.tab-button span{font-size:.875rem;line-height:1.25rem}}@media (min-width: 1024px){.tab-button span{justify-content:flex-start}}.main{max-height:98dvh;width:100%;overflow:auto}@media (min-width: 768px){.main{padding-top:1rem;padding-bottom:1rem}}@media (min-width: 1024px){.main{width:calc(100% - 250px);padding-left:1rem;padding-right:1rem}}.header-container{border-radius:.75rem;padding:2.5rem 1rem;color:hsl(var(--primary))}@media (min-width: 768px){.header-container{padding:1.25rem 2.25rem}}.tooltip{position:absolute;left:-3rem;top:20px;margin-bottom:1.25rem;display:none;width:auto;flex-direction:column;align-items:center}.group:hover .tooltip{display:flex}@media (min-width: 768px){.tooltip{left:0}}.tooltip-textbox{position:relative;z-index:10;border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:.5rem;font-size:.75rem;line-height:1rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media (min-width: 768px){.tooltip-textbox{padding:.75rem 1rem}}.tooltip-text{font-size:13px;line-height:17.4px;letter-spacing:.025em;color:hsl(var(--grey))}.details-input-container{width:100%;border-width:1px;border-style:none;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));font-weight:600;color:hsl(var(--tone-100))}.details-input-container::-moz-placeholder{font-size:.875rem;line-height:1.25rem;color:hsl(var(--tone-100))}.details-input-container::placeholder{font-size:.875rem;line-height:1.25rem;color:hsl(var(--tone-100))}.details-input-container:focus{outline:2px solid transparent;outline-offset:2px}.details-input-container:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.avs-input-container{width:100%;border-radius:.25rem;border-width:1px;border-color:hsl(var(--tone-40));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:1.5rem .75rem .5rem;color:hsl(var(--tone-100))}.avs-input-container:focus{border-color:hsl(var(--grey-100));outline:2px solid transparent;outline-offset:2px}.avs-input-container:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.mm-input-container{width:100%;border-radius:.5rem;border-width:1px;border-color:hsl(var(--tone-40));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:1.5rem .75rem .5rem;color:hsl(var(--tone-100))}.mm-input-container::-moz-placeholder{color:hsl(var(--tone-50))}.mm-input-container::placeholder{color:hsl(var(--tone-50))}.mm-input-container:focus{border-color:hsl(var(--grey-100));outline:2px solid transparent;outline-offset:2px}.mm-input-container:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.details-form-button{display:inline-flex;height:50px;width:100%;align-items:center;justify-content:center;border-radius:.5rem;background-color:hsl(var(--primary));font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.details-form-button:focus{outline:2px solid transparent;outline-offset:2px}.details-form-button:disabled{background-color:hsl(var(--grey-100));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.pin-input{height:3.5rem;width:4rem;border-radius:.5rem;border-width:1px;border-color:hsla(var(--tone-90));text-align:center;font-size:1.125rem;line-height:1.75rem}.pin-input:focus{border-color:hsl(var(--primary));outline:2px solid transparent;outline-offset:2px}@media (min-width: 768px){.pin-input{height:3.5rem;width:6rem}}.otp-input{width:100%;border-radius:.5rem;border-width:1px;border-color:hsla(var(--tone-90));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:.75rem;font-size:1.5rem;line-height:2rem;font-weight:700}.otp-input:focus{outline:2px solid transparent;outline-offset:2px}.otp-button{height:3.5rem;width:100%;border-radius:.5rem;background-color:hsl(var(--tone-100));padding-left:1.5rem;padding-right:1.5rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.otp-button:disabled{background-color:hsl(var(--grey-100))}.warning-text,.success-text{margin-top:1rem;margin-bottom:1rem;margin-left:auto;margin-right:auto;text-align:center;font-weight:600;color:hsl(var(--grey-400))}.warning-list{margin-left:auto;margin-right:auto;margin-top:.25rem}@media (min-width: 768px){.warning-list{margin-top:.5rem}}.warning-button,.success-button{margin-bottom:1rem;width:100%;border-radius:.5rem;border-width:1px;border-color:hsl(var(--grey-800));padding:1rem;text-align:center;font-size:.875rem;line-height:1.25rem;font-weight:600;color:hsl(var(--grey-400))}#bank-search-input{width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:2px solid transparent;outline-offset:2px}#bank-select-container{display:flex;gap:.75rem;border-radius:.5rem;border-width:1px;border-color:hsl(var(--primary-light));padding:1rem}#bank-code-span{border-radius:.25rem;background-color:hsla(var(--primary-10));padding:.25rem;color:hsla(var(--tone-60))}.spinner{margin-right:.75rem;height:2rem;width:2rem}.spinner{animation:spin 1s linear infinite;fill:#fff}.transaction-issues-input{display:flex;height:3.5rem;width:100%;-webkit-user-select:all;-moz-user-select:all;user-select:all;border-radius:.5rem;border-width:1px;border-style:none;--tw-bg-opacity: 1;background-color:rgb(247 248 251 / var(--tw-bg-opacity));padding-left:1rem;padding-right:1rem;padding-top:1.25rem;padding-bottom:0;color:hsl(var(--tone-100));outline:2px solid transparent!important;outline-offset:2px!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transaction-issues-input:disabled{cursor:not-allowed;opacity:.5}.active-tab{border-bottom-width:2px;border-color:hsl(var(--tone-100));padding-bottom:.25rem;font-weight:500;color:hsl(var(--tone-100))}.transaction-issues-input-placeholder{pointer-events:none;position:absolute;top:1rem;bottom:1rem;left:.75rem;z-index:20;margin:0;display:flex;height:-moz-fit-content;height:fit-content;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;padding-left:.25rem;padding-right:.25rem;font-size:.625rem;color:hsla(var(--tone-70));transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.peer:-moz-placeholder-shown~.transaction-issues-input-placeholder{margin:auto;--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding-left:0;padding-right:0;font-size:.875rem;line-height:1.25rem}.peer:placeholder-shown~.transaction-issues-input-placeholder{margin:auto;--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding-left:0;padding-right:0;font-size:.875rem;line-height:1.25rem}.peer:focus~.transaction-issues-input-placeholder{margin:0;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding-left:.25rem;padding-right:.25rem;font-size:.625rem}#checkout-modal .visible{visibility:visible}#checkout-modal .static{position:static}#checkout-modal .fixed{position:fixed}#checkout-modal .absolute{position:absolute}#checkout-modal .relative{position:relative}#checkout-modal .inset-0{top:0;right:0;bottom:0;left:0}#checkout-modal .inset-y-4{top:1rem;bottom:1rem}#checkout-modal .left-0{left:0}#checkout-modal .right-4{right:1rem}#checkout-modal .top-0{top:0}#checkout-modal .top-1{top:.25rem}#checkout-modal .top-1\\/2{top:50%}#checkout-modal .top-5{top:1.25rem}#checkout-modal .z-30{z-index:30}#checkout-modal .z-50{z-index:50}#checkout-modal .mx-5{margin-left:1.25rem;margin-right:1.25rem}#checkout-modal .mx-auto{margin-left:auto;margin-right:auto}#checkout-modal .my-3{margin-top:.75rem;margin-bottom:.75rem}#checkout-modal .mb-1{margin-bottom:.25rem}#checkout-modal .mb-2{margin-bottom:.5rem}#checkout-modal .mb-3{margin-bottom:.75rem}#checkout-modal .mb-4{margin-bottom:1rem}#checkout-modal .mb-5{margin-bottom:1.25rem}#checkout-modal .mb-8{margin-bottom:2rem}#checkout-modal .ml-1{margin-left:.25rem}#checkout-modal .ml-20{margin-left:5rem}#checkout-modal .ml-9{margin-left:2.25rem}#checkout-modal .ml-auto{margin-left:auto}#checkout-modal .mr-1{margin-right:.25rem}#checkout-modal .mr-11{margin-right:2.75rem}#checkout-modal .mt-1{margin-top:.25rem}#checkout-modal .mt-10{margin-top:2.5rem}#checkout-modal .mt-2{margin-top:.5rem}#checkout-modal .mt-3{margin-top:.75rem}#checkout-modal .mt-4{margin-top:1rem}#checkout-modal .mt-5{margin-top:1.25rem}#checkout-modal .mt-6{margin-top:1.5rem}#checkout-modal .mt-7{margin-top:1.75rem}#checkout-modal .mt-8{margin-top:2rem}#checkout-modal .block{display:block}#checkout-modal .inline-block{display:inline-block}#checkout-modal .flex{display:flex}#checkout-modal .grid{display:grid}#checkout-modal .contents{display:contents}#checkout-modal .hidden{display:none}#checkout-modal .h-12{height:3rem}#checkout-modal .h-14{height:3.5rem}#checkout-modal .h-4{height:1rem}#checkout-modal .h-6{height:1.5rem}#checkout-modal .h-8{height:2rem}#checkout-modal .h-\\[130px\\]{height:130px}#checkout-modal .h-\\[22px\\]{height:22px}#checkout-modal .h-\\[40dvh\\]{height:40dvh}#checkout-modal .h-\\[40vh\\]{height:40vh}#checkout-modal .h-\\[50px\\]{height:50px}#checkout-modal .h-auto{height:auto}#checkout-modal .h-full{height:100%}#checkout-modal .max-h-screen{max-height:100vh}#checkout-modal .min-h-\\[20dvh\\]{min-height:20dvh}#checkout-modal .min-h-\\[30dvh\\]{min-height:30dvh}#checkout-modal .min-h-\\[40dvh\\]{min-height:40dvh}#checkout-modal .min-h-full{min-height:100%}#checkout-modal .min-h-screen{min-height:100vh}#checkout-modal .w-0{width:0px}#checkout-modal .w-11{width:2.75rem}#checkout-modal .w-11\\/12{width:91.666667%}#checkout-modal .w-12{width:3rem}#checkout-modal .w-14{width:3.5rem}#checkout-modal .w-16{width:4rem}#checkout-modal .w-4\\/5{width:80%}#checkout-modal .w-60{width:15rem}#checkout-modal .w-8{width:2rem}#checkout-modal .w-9\\/12{width:75%}#checkout-modal .w-\\[147px\\]{width:147px}#checkout-modal .w-full{width:100%}#checkout-modal .min-w-\\[15rem\\]{min-width:15rem}#checkout-modal .max-w-\\[200px\\]{max-width:200px}#checkout-modal .flex-1{flex:1 1 0%}#checkout-modal .flex-shrink{flex-shrink:1}#checkout-modal .flex-shrink-0{flex-shrink:0}#checkout-modal .flex-grow,#checkout-modal .grow{flex-grow:1}#checkout-modal .-translate-y-2\\/4{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .translate-x-\\[-45\\%\\]{--tw-translate-x: -45%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .translate-x-\\[0\\%\\]{--tw-translate-x: 0%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}#checkout-modal .animate-spin{animation:spin 1s linear infinite}#checkout-modal .cursor-pointer{cursor:pointer}#checkout-modal .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}#checkout-modal .grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}#checkout-modal .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#checkout-modal .grid-cols-\\[1fr_auto\\]{grid-template-columns:1fr auto}#checkout-modal .grid-rows-1{grid-template-rows:repeat(1,minmax(0,1fr))}#checkout-modal .grid-rows-\\[auto_1fr\\]{grid-template-rows:auto 1fr}#checkout-modal .flex-col{flex-direction:column}#checkout-modal .flex-col-reverse{flex-direction:column-reverse}#checkout-modal .items-start{align-items:flex-start}#checkout-modal .items-end{align-items:flex-end}#checkout-modal .items-center{align-items:center}#checkout-modal .justify-center{justify-content:center}#checkout-modal .justify-between{justify-content:space-between}#checkout-modal .gap-1{gap:.25rem}#checkout-modal .gap-1\\.5{gap:.375rem}#checkout-modal .gap-2{gap:.5rem}#checkout-modal .gap-3{gap:.75rem}#checkout-modal .gap-4{gap:1rem}#checkout-modal .gap-5{gap:1.25rem}#checkout-modal .gap-6{gap:1.5rem}#checkout-modal .gap-7{gap:1.75rem}#checkout-modal .gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}#checkout-modal .self-start{align-self:flex-start}#checkout-modal .justify-self-center{justify-self:center}#checkout-modal .overflow-hidden{overflow:hidden}#checkout-modal .overflow-y-auto{overflow-y:auto}#checkout-modal .whitespace-normal{white-space:normal}#checkout-modal .whitespace-nowrap{white-space:nowrap}#checkout-modal .break-words{overflow-wrap:break-word}#checkout-modal .rounded-2xl{border-radius:1rem}#checkout-modal .rounded-\\[20px\\]{border-radius:20px}#checkout-modal .rounded-\\[40px\\]{border-radius:40px}#checkout-modal .rounded-lg{border-radius:.5rem}#checkout-modal .rounded-md{border-radius:.375rem}#checkout-modal .border{border-width:1px}#checkout-modal .border-b{border-bottom-width:1px}#checkout-modal .border-r{border-right-width:1px}#checkout-modal .border-dashed{border-style:dashed}#checkout-modal .border-none{border-style:none}#checkout-modal .border-\\[\\#D0D5DD\\]{--tw-border-opacity: 1;border-color:rgb(208 213 221 / var(--tw-border-opacity))}#checkout-modal .border-\\[\\#D62020\\]{--tw-border-opacity: 1;border-color:rgb(214 32 32 / var(--tw-border-opacity))}#checkout-modal .border-alphablack-10{border-color:hsla(var(--alphablack),.1)}#checkout-modal .border-grey-100{border-color:hsl(var(--grey-100))}#checkout-modal .border-tone-10{border-color:hsl(var(--tone-10))}#checkout-modal .border-tone-40{border-color:hsl(var(--tone-40))}#checkout-modal .border-tone-50{border-color:hsl(var(--tone-50))}#checkout-modal .border-tone-70{border-color:hsla(var(--tone-70))}#checkout-modal .border-b-grey-faint{border-bottom-color:hsl(var(--grey-faint))}#checkout-modal .bg-\\[\\#F7F8FB\\]{--tw-bg-opacity: 1;background-color:rgb(247 248 251 / var(--tw-bg-opacity))}#checkout-modal .bg-\\[\\#FBF2CB\\]{--tw-bg-opacity: 1;background-color:rgb(251 242 203 / var(--tw-bg-opacity))}#checkout-modal .bg-\\[\\#FEF7ED\\]{--tw-bg-opacity: 1;background-color:rgb(254 247 237 / var(--tw-bg-opacity))}#checkout-modal .bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}#checkout-modal .bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}#checkout-modal .bg-primary{background-color:hsl(var(--primary))}#checkout-modal .bg-tone-10{background-color:hsl(var(--tone-10))}#checkout-modal .bg-tone-100{background-color:hsl(var(--tone-100))}#checkout-modal .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}#checkout-modal .bg-opacity-30{--tw-bg-opacity: .3}#checkout-modal .object-contain{-o-object-fit:contain;object-fit:contain}#checkout-modal .p-0{padding:0}#checkout-modal .p-1{padding:.25rem}#checkout-modal .p-2{padding:.5rem}#checkout-modal .p-3{padding:.75rem}#checkout-modal .p-4{padding:1rem}#checkout-modal .px-0{padding-left:0;padding-right:0}#checkout-modal .px-2{padding-left:.5rem;padding-right:.5rem}#checkout-modal .px-3{padding-left:.75rem;padding-right:.75rem}#checkout-modal .px-3\\.5{padding-left:.875rem;padding-right:.875rem}#checkout-modal .px-4{padding-left:1rem;padding-right:1rem}#checkout-modal .px-6{padding-left:1.5rem;padding-right:1.5rem}#checkout-modal .py-1{padding-top:.25rem;padding-bottom:.25rem}#checkout-modal .py-10{padding-top:2.5rem;padding-bottom:2.5rem}#checkout-modal .py-2{padding-top:.5rem;padding-bottom:.5rem}#checkout-modal .py-3{padding-top:.75rem;padding-bottom:.75rem}#checkout-modal .py-4{padding-top:1rem;padding-bottom:1rem}#checkout-modal .py-5{padding-top:1.25rem;padding-bottom:1.25rem}#checkout-modal .pb-0{padding-bottom:0}#checkout-modal .pb-1{padding-bottom:.25rem}#checkout-modal .pb-3{padding-bottom:.75rem}#checkout-modal .pb-4{padding-bottom:1rem}#checkout-modal .pb-5{padding-bottom:1.25rem}#checkout-modal .pl-4{padding-left:1rem}#checkout-modal .pr-2{padding-right:.5rem}#checkout-modal .pr-7{padding-right:1.75rem}#checkout-modal .pt-0{padding-top:0}#checkout-modal .pt-1{padding-top:.25rem}#checkout-modal .pt-3{padding-top:.75rem}#checkout-modal .pt-5{padding-top:1.25rem}#checkout-modal .pt-6{padding-top:1.5rem}#checkout-modal .text-left{text-align:left}#checkout-modal .text-center{text-align:center}#checkout-modal .text-2xl{font-size:1.5rem;line-height:2rem}#checkout-modal .text-\\[10px\\]{font-size:10px}#checkout-modal .text-\\[11px\\]{font-size:11px}#checkout-modal .text-base{font-size:1rem;line-height:1.5rem}#checkout-modal .text-lg{font-size:1.125rem;line-height:1.75rem}#checkout-modal .text-sm{font-size:.875rem;line-height:1.25rem}#checkout-modal .text-xl{font-size:1.25rem;line-height:1.75rem}#checkout-modal .text-xs{font-size:.75rem;line-height:1rem}#checkout-modal .text-xxs{font-size:.625rem}#checkout-modal .font-bold{font-weight:700}#checkout-modal .font-medium{font-weight:500}#checkout-modal .font-normal{font-weight:400}#checkout-modal .font-semibold{font-weight:600}#checkout-modal .uppercase{text-transform:uppercase}#checkout-modal .lowercase{text-transform:lowercase}#checkout-modal .tracking-\\[0\\.5px\\]{letter-spacing:.5px}#checkout-modal .text-\\[\\#816039\\]{--tw-text-opacity: 1;color:rgb(129 96 57 / var(--tw-text-opacity))}#checkout-modal .text-\\[\\#98A2B3\\]{--tw-text-opacity: 1;color:rgb(152 162 179 / var(--tw-text-opacity))}#checkout-modal .text-\\[\\#C8811A\\]{--tw-text-opacity: 1;color:rgb(200 129 26 / var(--tw-text-opacity))}#checkout-modal .text-\\[\\#D62020\\]{--tw-text-opacity: 1;color:rgb(214 32 32 / var(--tw-text-opacity))}#checkout-modal .text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}#checkout-modal .text-error{color:hsl(var(--error))}#checkout-modal .text-error-dark{color:hsl(var(--error-dark))}#checkout-modal .text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}#checkout-modal .text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}#checkout-modal .text-grey-100{color:hsl(var(--grey-100))}#checkout-modal .text-grey-400{color:hsl(var(--grey-400))}#checkout-modal .text-primary-900{color:hsl(var(--primary-900))}#checkout-modal .text-tone-100{color:hsl(var(--tone-100))}#checkout-modal .text-tone-40{color:hsl(var(--tone-40))}#checkout-modal .text-tone-50{color:hsl(var(--tone-50))}#checkout-modal .text-tone-60{color:hsla(var(--tone-60))}#checkout-modal .text-tone-70{color:hsla(var(--tone-70))}#checkout-modal .text-tone-80{color:hsla(var(--tone-80))}#checkout-modal .text-tone-90{color:hsla(var(--tone-90))}#checkout-modal .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#checkout-modal .opacity-0{opacity:0}#checkout-modal .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#checkout-modal .shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#checkout-modal .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#checkout-modal .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .duration-200{transition-duration:.2s}#checkout-modal .duration-500{transition-duration:.5s}#checkout-modal .duration-700{transition-duration:.7s}#checkout-modal .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}#checkout-modal *::-webkit-scrollbar{height:.2em;width:.4em;cursor:pointer;--tw-bg-opacity: 1;background-color:rgb(244 244 244 / var(--tw-bg-opacity))}#checkout-modal *::-webkit-scrollbar-track{border-radius:100vh;--tw-bg-opacity: 1;background-color:rgb(153 146 146 / var(--tw-bg-opacity))}#checkout-modal *::-webkit-scrollbar-thumb{cursor:pointer;border-radius:100vh;border-width:3px;--tw-border-opacity: 1;border-color:rgb(112 112 112 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(224 203 203 / var(--tw-bg-opacity))}#checkout-modal *::-webkit-scrollbar-thumb:hover{background:#53b6ed}@font-face{font-family:IBM Plex Sans;src:url("https://d104jydf2tp7hm.cloudfront.net/IBM Plex Sans/IBMPlexSans-Regular.ttf");font-weight:400;font-display:swap}@font-face{font-family:IBM Plex Sans;src:url("https://d104jydf2tp7hm.cloudfront.net/IBM Plex Sans/IBMPlexSans-SemiBold.ttf");font-weight:600;font-display:swap}@font-face{font-family:IBM Plex Sans;src:url("https://d104jydf2tp7hm.cloudfront.net/IBM Plex Sans/IBMPlexSans-Bold.ttf");font-weight:700;font-display:swap}.tab-button.active:after{animation:text-underline-animation .3s linear forwards}#toast-container{width:100%;margin:0 auto}.toast{display:flex;align-items:center;padding:15px;margin-bottom:10px;border-radius:5px;opacity:0;transform:translateY(-50px);transition:opacity .5s,transform .5s;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a}.toast.show{opacity:1;transform:translateY(0)}.toast.success{background-color:hsl(var(--success));color:#fff}.toast.error{background-color:hsl(var(--error));color:#fff}.toast .close-btn{margin-left:auto;cursor:pointer;color:#fff}.progress-container{width:100%;height:10px;background-color:#f3f3f3;border-radius:5px;overflow:hidden;position:relative}.progress-bar{height:100%;background-color:#4caf50;width:0;position:absolute;top:0;left:0;animation:progress 1s linear infinite}@keyframes progress{0%{width:0px}to{width:100%}}#checkout-modal{font-family:IBM Plex Sans,Inter,sans-serif!important;color:hsla(var(--tone-80))}#test-cards-link{cursor:pointer;transition:color .2s ease}a{color:inherit}@media (min-width: 768px){.md\\:container-center{display:flex;align-items:center;justify-content:center}}#checkout-modal .placeholder\\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}#checkout-modal .placeholder\\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}#checkout-modal .placeholder\\:text-tone-50::-moz-placeholder{color:hsl(var(--tone-50))}#checkout-modal .placeholder\\:text-tone-50::placeholder{color:hsl(var(--tone-50))}#checkout-modal .before\\:absolute:before{content:var(--tw-content);position:absolute}#checkout-modal .before\\:-top-0:before{content:var(--tw-content);top:-0px}#checkout-modal .before\\:left-0:before{content:var(--tw-content);left:0}#checkout-modal .before\\:h-4:before{content:var(--tw-content);height:1rem}#checkout-modal .before\\:w-4:before{content:var(--tw-content);width:1rem}#checkout-modal .before\\:-translate-y-1:before{content:var(--tw-content);--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:translate-x-\\[-45\\%\\]:before{content:var(--tw-content);--tw-translate-x: -45%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:translate-x-\\[0\\%\\]:before{content:var(--tw-content);--tw-translate-x: 0%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:rotate-45:before{content:var(--tw-content);--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:bg-white:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}#checkout-modal .hover\\:block:hover{display:block}#checkout-modal .hover\\:w-full:hover{width:100%}#checkout-modal .hover\\:rotate-0:hover{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .hover\\:font-bold:hover{font-weight:700}#checkout-modal .hover\\:text-black:hover{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}#checkout-modal .hover\\:underline:hover{text-decoration-line:underline}#checkout-modal .hover\\:opacity-100:hover{opacity:1}#checkout-modal .hover\\:opacity-80:hover{opacity:.8}#checkout-modal :is(.group:hover .group-hover\\:block){display:block}#checkout-modal :is(.group:hover .group-hover\\:w-4\\/5){width:80%}#checkout-modal :is(.group:hover .group-hover\\:w-full){width:100%}#checkout-modal :is(.group:hover .group-hover\\:rotate-0){--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width: 640px){#checkout-modal .sm\\:my-8{margin-top:2rem;margin-bottom:2rem}#checkout-modal .sm\\:items-center{align-items:center}}@media (min-width: 768px){#checkout-modal .md\\:mb-5{margin-bottom:1.25rem}#checkout-modal .md\\:mt-6{margin-top:1.5rem}#checkout-modal .md\\:mt-8{margin-top:2rem}#checkout-modal .md\\:block{display:block}#checkout-modal .md\\:flex{display:flex}#checkout-modal .md\\:hidden{display:none}#checkout-modal .md\\:min-h-\\[70\\%\\]{min-height:70%}#checkout-modal .md\\:w-16{width:4rem}#checkout-modal .md\\:w-20{width:5rem}#checkout-modal .md\\:w-3\\/5{width:60%}#checkout-modal .md\\:w-4\\/5{width:80%}#checkout-modal .md\\:w-4\\/6{width:66.666667%}#checkout-modal .md\\:min-w-\\[18rem\\]{min-width:18rem}#checkout-modal .md\\:max-w-\\[600px\\]{max-width:600px}#checkout-modal .md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#checkout-modal .md\\:flex-col{flex-direction:column}#checkout-modal .md\\:justify-between{justify-content:space-between}#checkout-modal .md\\:gap-6{gap:1.5rem}#checkout-modal .md\\:gap-9{gap:2.25rem}#checkout-modal .md\\:rounded-lg{border-radius:.5rem}#checkout-modal .md\\:px-5{padding-left:1.25rem;padding-right:1.25rem}#checkout-modal .md\\:px-7{padding-left:1.75rem;padding-right:1.75rem}#checkout-modal .md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}#checkout-modal .md\\:py-4{padding-top:1rem;padding-bottom:1rem}#checkout-modal .md\\:text-xs{font-size:.75rem;line-height:1rem}}@media (min-width: 1024px){#checkout-modal .lg\\:block{display:block}#checkout-modal .lg\\:max-w-\\[20rem\\]{max-width:20rem}#checkout-modal .lg\\:px-7{padding-left:1.75rem;padding-right:1.75rem}#checkout-modal .lg\\:px-8{padding-left:2rem;padding-right:2rem}}
2
- `,document.head.appendChild(Ue);const Xt=`<div id="checkout-modal">
1
+ (function(Ze,Ve){typeof exports=="object"&&typeof module<"u"?Ve(exports):typeof define=="function"&&define.amd?define(["exports"],Ve):(Ze=typeof globalThis<"u"?globalThis:Ze||self,Ve(Ze.SpotflowCheckout={}))})(this,function(Ze){"use strict";var Ru=Object.defineProperty;var Nu=(Ze,Ve,Xt)=>Ve in Ze?Ru(Ze,Ve,{enumerable:!0,configurable:!0,writable:!0,value:Xt}):Ze[Ve]=Xt;var d=(Ze,Ve,Xt)=>Nu(Ze,typeof Ve!="symbol"?Ve+"":Ve,Xt);var Ve=document.createElement("style");Ve.textContent=`*:where(#checkout-modal,#checkout-modal *),:before:where(#checkout-modal,#checkout-modal *),:after:where(#checkout-modal,#checkout-modal *){box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before:where(#checkout-modal,#checkout-modal *),:after:where(#checkout-modal,#checkout-modal *){--tw-content: ""}#checkout-modal{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:IBM Plex Sans,Inter,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}#checkout-modal{margin:0;line-height:inherit}hr:where(#checkout-modal,#checkout-modal *){height:0;color:inherit;border-top-width:1px}abbr:where([title]):where(#checkout-modal,#checkout-modal *){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1:where(#checkout-modal,#checkout-modal *),h2:where(#checkout-modal,#checkout-modal *),h3:where(#checkout-modal,#checkout-modal *),h4:where(#checkout-modal,#checkout-modal *),h5:where(#checkout-modal,#checkout-modal *),h6:where(#checkout-modal,#checkout-modal *){font-size:inherit;font-weight:inherit}a:where(#checkout-modal,#checkout-modal *){color:inherit;text-decoration:inherit}b:where(#checkout-modal,#checkout-modal *),strong:where(#checkout-modal,#checkout-modal *){font-weight:bolder}code:where(#checkout-modal,#checkout-modal *),kbd:where(#checkout-modal,#checkout-modal *),samp:where(#checkout-modal,#checkout-modal *),pre:where(#checkout-modal,#checkout-modal *){font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small:where(#checkout-modal,#checkout-modal *){font-size:80%}sub:where(#checkout-modal,#checkout-modal *),sup:where(#checkout-modal,#checkout-modal *){font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub:where(#checkout-modal,#checkout-modal *){bottom:-.25em}sup:where(#checkout-modal,#checkout-modal *){top:-.5em}table:where(#checkout-modal,#checkout-modal *){text-indent:0;border-color:inherit;border-collapse:collapse}button:where(#checkout-modal,#checkout-modal *),input:where(#checkout-modal,#checkout-modal *),optgroup:where(#checkout-modal,#checkout-modal *),select:where(#checkout-modal,#checkout-modal *),textarea:where(#checkout-modal,#checkout-modal *){font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button:where(#checkout-modal,#checkout-modal *),select:where(#checkout-modal,#checkout-modal *){text-transform:none}button:where(#checkout-modal,#checkout-modal *),input:where([type=button]):where(#checkout-modal,#checkout-modal *),input:where([type=reset]):where(#checkout-modal,#checkout-modal *),input:where([type=submit]):where(#checkout-modal,#checkout-modal *){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring:where(#checkout-modal,#checkout-modal *){outline:auto}:-moz-ui-invalid:where(#checkout-modal,#checkout-modal *){box-shadow:none}progress:where(#checkout-modal,#checkout-modal *){vertical-align:baseline}::-webkit-inner-spin-button:where(#checkout-modal,#checkout-modal *),::-webkit-outer-spin-button:where(#checkout-modal,#checkout-modal *){height:auto}[type=search]:where(#checkout-modal,#checkout-modal *){-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration:where(#checkout-modal,#checkout-modal *){-webkit-appearance:none}::-webkit-file-upload-button:where(#checkout-modal,#checkout-modal *){-webkit-appearance:button;font:inherit}summary:where(#checkout-modal,#checkout-modal *){display:list-item}blockquote:where(#checkout-modal,#checkout-modal *),dl:where(#checkout-modal,#checkout-modal *),dd:where(#checkout-modal,#checkout-modal *),h1:where(#checkout-modal,#checkout-modal *),h2:where(#checkout-modal,#checkout-modal *),h3:where(#checkout-modal,#checkout-modal *),h4:where(#checkout-modal,#checkout-modal *),h5:where(#checkout-modal,#checkout-modal *),h6:where(#checkout-modal,#checkout-modal *),hr:where(#checkout-modal,#checkout-modal *),figure:where(#checkout-modal,#checkout-modal *),p:where(#checkout-modal,#checkout-modal *),pre:where(#checkout-modal,#checkout-modal *){margin:0}fieldset:where(#checkout-modal,#checkout-modal *){margin:0;padding:0}legend:where(#checkout-modal,#checkout-modal *){padding:0}ol:where(#checkout-modal,#checkout-modal *),ul:where(#checkout-modal,#checkout-modal *),menu:where(#checkout-modal,#checkout-modal *){list-style:none;margin:0;padding:0}dialog:where(#checkout-modal,#checkout-modal *){padding:0}textarea:where(#checkout-modal,#checkout-modal *){resize:vertical}input::-moz-placeholder:where(#checkout-modal,#checkout-modal *),textarea::-moz-placeholder:where(#checkout-modal,#checkout-modal *){opacity:1;color:#9ca3af}input::placeholder:where(#checkout-modal,#checkout-modal *),textarea::placeholder:where(#checkout-modal,#checkout-modal *){opacity:1;color:#9ca3af}button:where(#checkout-modal,#checkout-modal *),[role=button]:where(#checkout-modal,#checkout-modal *){cursor:pointer}:disabled:where(#checkout-modal,#checkout-modal *){cursor:default}img:where(#checkout-modal,#checkout-modal *),svg:where(#checkout-modal,#checkout-modal *),video:where(#checkout-modal,#checkout-modal *),canvas:where(#checkout-modal,#checkout-modal *),audio:where(#checkout-modal,#checkout-modal *),iframe:where(#checkout-modal,#checkout-modal *),embed:where(#checkout-modal,#checkout-modal *),object:where(#checkout-modal,#checkout-modal *){display:block;vertical-align:middle}img:where(#checkout-modal,#checkout-modal *),video:where(#checkout-modal,#checkout-modal *){max-width:100%;height:auto}[hidden]:where(#checkout-modal,#checkout-modal *){display:none}:root{--primary: 264, 52%, 6%;--primary-light: 266, 21%, 76%;--primary-10: 240, 39%, 86%, 1;--primary-lighter: 240, 100%, 98%;--primary-dark: 240, 39%, 52%;--primary-darker: 240, 100%, 28%;--primary-900: 240, 4%, 9%;--alphablack-10: 250, 22%, 22%;--success: 151, 58%, 46%;--error: 0, 74%, 48%;--error-dark: 19, 100%, 37%;--common: 60, 4%, 43%;--tone-10: 240, 2%, 90%;--tone-40: 202, 6%, 82%;--tone-50: 202, 4%, 68%;--tone-60: 260, 4%, 43%, 1;--tone-70: 266, 3%, 53%;--tone-80: 265, 10%, 24%, 1;--tone-90: 266, 18%, 15%;--tone-100: 266, 54%, 6%;--grey: 218, 15%, 65%;--grey-100: 270, 3%, 62%;--grey-200: 264, 3%, 72%;--grey-300: 260, 3%, 81%;--grey-400: 264, 6%, 34%;--grey-500: 217, 24%, 27%;--grey-600: 265, 10%, 24%;--grey-700: 260, 4%, 43%;--grey-800: 265, 21%, 76%;--grey-faint: 240, 7%, 97%;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}input:focus,button:focus{outline:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.container-center{display:flex;align-items:center;justify-content:center}.hide-scrollbar::-webkit-scrollbar{display:none!important}.hide-scrollbar{-ms-overflow-style:none!important;scrollbar-width:none!important}.container-between{display:flex;align-items:center;justify-content:space-between}.align-center{display:flex;align-items:center}.box-container{padding-left:0;padding-right:0;padding-top:1rem;padding-bottom:1rem}@media (min-width: 768px){.box-container{padding:1.75rem 1.25rem}}@media (min-width: 1024px){.box-container{padding-left:1.75rem;padding-right:1.75rem}}.button-fill{display:flex;height:2.5rem;align-items:center;justify-content:center;border-radius:.5rem;background-color:hsl(var(--primary));font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.button-outline{display:flex;height:2.5rem;align-items:center;justify-content:center;border-radius:.5rem;border-width:1px;border-color:hsl(var(--tone-100));font-size:.875rem;line-height:1.25rem;font-weight:600;color:hsl(var(--tone-100))}.payment-options{display:flex;width:100%;flex-direction:column;overflow:hidden}.tab{margin-bottom:.75rem;display:flex;align-items:center;justify-content:flex-start;text-align:left}.tab-button{display:flex;width:100%;flex-grow:1;align-items:center;border-radius:.5rem;border-width:1px;border-color:hsl(var(--grey-100));padding:.75rem 1.25rem;text-align:center;color:hsl(var(--primary))}.tab-button:disabled{cursor:not-allowed;opacity:.4}.tab-button:hover:disabled{border-color:#11032666;color:hsl(var(--primary) / .4)}@media (min-width: 768px){.tab-button{display:flex;justify-content:center;padding-left:.75rem;padding-right:.75rem}.tab-button:hover{border-color:hsl(var(--primary))}}.tab-button.active{border-width:2px;border-color:hsl(var(--primary))}.tab-button.active span{font-weight:700}.tab-button span{margin-top:.25rem;margin-bottom:.25rem;display:flex;flex-shrink:0;justify-content:center}@media (min-width: 768px){.tab-button span{font-size:.875rem;line-height:1.25rem}}@media (min-width: 1024px){.tab-button span{justify-content:flex-start}}.main{max-height:98dvh;width:100%;overflow:auto}@media (min-width: 768px){.main{padding-top:1rem;padding-bottom:1rem}}@media (min-width: 1024px){.main{width:calc(100% - 250px);padding-left:1rem;padding-right:1rem}}.header-container{border-radius:.75rem;padding:2.5rem 1rem;color:hsl(var(--primary))}@media (min-width: 768px){.header-container{padding:1.25rem 2.25rem}}.tooltip{position:absolute;left:-3rem;top:20px;margin-bottom:1.25rem;display:none;width:auto;flex-direction:column;align-items:center}.group:hover .tooltip{display:flex}@media (min-width: 768px){.tooltip{left:0}}.tooltip-textbox{position:relative;z-index:10;border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:.5rem;font-size:.75rem;line-height:1rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media (min-width: 768px){.tooltip-textbox{padding:.75rem 1rem}}.tooltip-text{font-size:13px;line-height:17.4px;letter-spacing:.025em;color:hsl(var(--grey))}.details-input-container{width:100%;border-width:1px;border-style:none;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));font-weight:600;color:hsl(var(--tone-100))}.details-input-container::-moz-placeholder{font-size:.875rem;line-height:1.25rem;color:hsl(var(--tone-100))}.details-input-container::placeholder{font-size:.875rem;line-height:1.25rem;color:hsl(var(--tone-100))}.details-input-container:focus{outline:2px solid transparent;outline-offset:2px}.details-input-container:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.avs-input-container{width:100%;border-radius:.25rem;border-width:1px;border-color:hsl(var(--tone-40));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:1.5rem .75rem .5rem;color:hsl(var(--tone-100))}.avs-input-container:focus{border-color:hsl(var(--grey-100));outline:2px solid transparent;outline-offset:2px}.avs-input-container:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.mm-input-container{width:100%;border-radius:.5rem;border-width:1px;border-color:hsl(var(--tone-40));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:1.5rem .75rem .5rem;color:hsl(var(--tone-100))}.mm-input-container::-moz-placeholder{color:hsl(var(--tone-50))}.mm-input-container::placeholder{color:hsl(var(--tone-50))}.mm-input-container:focus{border-color:hsl(var(--grey-100));outline:2px solid transparent;outline-offset:2px}.mm-input-container:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.details-form-button{display:inline-flex;height:50px;width:100%;align-items:center;justify-content:center;border-radius:.5rem;background-color:hsl(var(--primary));font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.details-form-button:focus{outline:2px solid transparent;outline-offset:2px}.details-form-button:disabled{background-color:hsl(var(--grey-100));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.pin-input{height:3.5rem;width:4rem;border-radius:.5rem;border-width:1px;border-color:hsla(var(--tone-90));text-align:center;font-size:1.125rem;line-height:1.75rem}.pin-input:focus{border-color:hsl(var(--primary));outline:2px solid transparent;outline-offset:2px}@media (min-width: 768px){.pin-input{height:3.5rem;width:6rem}}.otp-input{width:100%;border-radius:.5rem;border-width:1px;border-color:hsla(var(--tone-90));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:.75rem;font-size:1.5rem;line-height:2rem;font-weight:700}.otp-input:focus{outline:2px solid transparent;outline-offset:2px}.otp-button{height:3.5rem;width:100%;border-radius:.5rem;background-color:hsl(var(--tone-100));padding-left:1.5rem;padding-right:1.5rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.otp-button:disabled{background-color:hsl(var(--grey-100))}.warning-text,.success-text{margin-top:1rem;margin-bottom:1rem;margin-left:auto;margin-right:auto;text-align:center;font-weight:600;color:hsl(var(--grey-400))}.warning-list{margin-left:auto;margin-right:auto;margin-top:.25rem}@media (min-width: 768px){.warning-list{margin-top:.5rem}}.warning-button,.success-button{margin-bottom:1rem;width:100%;border-radius:.5rem;border-width:1px;border-color:hsl(var(--grey-800));padding:1rem;text-align:center;font-size:.875rem;line-height:1.25rem;font-weight:600;color:hsl(var(--grey-400))}#bank-search-input{width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:2px solid transparent;outline-offset:2px}#bank-select-container{display:flex;gap:.75rem;border-radius:.5rem;border-width:1px;border-color:hsl(var(--primary-light));padding:1rem}#bank-code-span{border-radius:.25rem;background-color:hsla(var(--primary-10));padding:.25rem;color:hsla(var(--tone-60))}.spinner{margin-right:.75rem;height:2rem;width:2rem}.spinner{animation:spin 1s linear infinite;fill:#fff}.transaction-issues-input{display:flex;height:3.5rem;width:100%;-webkit-user-select:all;-moz-user-select:all;user-select:all;border-radius:.5rem;border-width:1px;border-style:none;--tw-bg-opacity: 1;background-color:rgb(247 248 251 / var(--tw-bg-opacity));padding-left:1rem;padding-right:1rem;padding-top:1.25rem;padding-bottom:0;color:hsl(var(--tone-100));outline:2px solid transparent!important;outline-offset:2px!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transaction-issues-input:disabled{cursor:not-allowed;opacity:.5}.active-tab{border-bottom-width:2px;border-color:hsl(var(--tone-100));padding-bottom:.25rem;font-weight:500;color:hsl(var(--tone-100))}.transaction-issues-input-placeholder{pointer-events:none;position:absolute;top:1rem;bottom:1rem;left:.75rem;z-index:20;margin:0;display:flex;height:-moz-fit-content;height:fit-content;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;padding-left:.25rem;padding-right:.25rem;font-size:.625rem;color:hsla(var(--tone-70));transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.peer:-moz-placeholder-shown~.transaction-issues-input-placeholder{margin:auto;--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding-left:0;padding-right:0;font-size:.875rem;line-height:1.25rem}.peer:placeholder-shown~.transaction-issues-input-placeholder{margin:auto;--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding-left:0;padding-right:0;font-size:.875rem;line-height:1.25rem}.peer:focus~.transaction-issues-input-placeholder{margin:0;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding-left:.25rem;padding-right:.25rem;font-size:.625rem}#checkout-modal .visible{visibility:visible}#checkout-modal .static{position:static}#checkout-modal .fixed{position:fixed}#checkout-modal .absolute{position:absolute}#checkout-modal .relative{position:relative}#checkout-modal .inset-0{top:0;right:0;bottom:0;left:0}#checkout-modal .inset-y-4{top:1rem;bottom:1rem}#checkout-modal .left-0{left:0}#checkout-modal .right-4{right:1rem}#checkout-modal .top-0{top:0}#checkout-modal .top-1{top:.25rem}#checkout-modal .top-1\\/2{top:50%}#checkout-modal .top-5{top:1.25rem}#checkout-modal .z-30{z-index:30}#checkout-modal .z-50{z-index:50}#checkout-modal .mx-5{margin-left:1.25rem;margin-right:1.25rem}#checkout-modal .mx-auto{margin-left:auto;margin-right:auto}#checkout-modal .my-3{margin-top:.75rem;margin-bottom:.75rem}#checkout-modal .mb-1{margin-bottom:.25rem}#checkout-modal .mb-2{margin-bottom:.5rem}#checkout-modal .mb-3{margin-bottom:.75rem}#checkout-modal .mb-4{margin-bottom:1rem}#checkout-modal .mb-5{margin-bottom:1.25rem}#checkout-modal .mb-8{margin-bottom:2rem}#checkout-modal .ml-1{margin-left:.25rem}#checkout-modal .ml-20{margin-left:5rem}#checkout-modal .ml-9{margin-left:2.25rem}#checkout-modal .ml-auto{margin-left:auto}#checkout-modal .mr-1{margin-right:.25rem}#checkout-modal .mr-11{margin-right:2.75rem}#checkout-modal .mt-1{margin-top:.25rem}#checkout-modal .mt-10{margin-top:2.5rem}#checkout-modal .mt-2{margin-top:.5rem}#checkout-modal .mt-3{margin-top:.75rem}#checkout-modal .mt-4{margin-top:1rem}#checkout-modal .mt-5{margin-top:1.25rem}#checkout-modal .mt-6{margin-top:1.5rem}#checkout-modal .mt-7{margin-top:1.75rem}#checkout-modal .mt-8{margin-top:2rem}#checkout-modal .block{display:block}#checkout-modal .inline-block{display:inline-block}#checkout-modal .flex{display:flex}#checkout-modal .grid{display:grid}#checkout-modal .contents{display:contents}#checkout-modal .hidden{display:none}#checkout-modal .h-12{height:3rem}#checkout-modal .h-14{height:3.5rem}#checkout-modal .h-4{height:1rem}#checkout-modal .h-6{height:1.5rem}#checkout-modal .h-8{height:2rem}#checkout-modal .h-\\[130px\\]{height:130px}#checkout-modal .h-\\[22px\\]{height:22px}#checkout-modal .h-\\[40dvh\\]{height:40dvh}#checkout-modal .h-\\[40vh\\]{height:40vh}#checkout-modal .h-\\[50px\\]{height:50px}#checkout-modal .h-auto{height:auto}#checkout-modal .h-full{height:100%}#checkout-modal .max-h-screen{max-height:100vh}#checkout-modal .min-h-\\[20dvh\\]{min-height:20dvh}#checkout-modal .min-h-\\[30dvh\\]{min-height:30dvh}#checkout-modal .min-h-\\[40dvh\\]{min-height:40dvh}#checkout-modal .min-h-full{min-height:100%}#checkout-modal .min-h-screen{min-height:100vh}#checkout-modal .w-0{width:0px}#checkout-modal .w-11{width:2.75rem}#checkout-modal .w-11\\/12{width:91.666667%}#checkout-modal .w-12{width:3rem}#checkout-modal .w-14{width:3.5rem}#checkout-modal .w-16{width:4rem}#checkout-modal .w-4\\/5{width:80%}#checkout-modal .w-60{width:15rem}#checkout-modal .w-8{width:2rem}#checkout-modal .w-9\\/12{width:75%}#checkout-modal .w-\\[147px\\]{width:147px}#checkout-modal .w-full{width:100%}#checkout-modal .min-w-\\[15rem\\]{min-width:15rem}#checkout-modal .max-w-\\[200px\\]{max-width:200px}#checkout-modal .flex-1{flex:1 1 0%}#checkout-modal .flex-shrink{flex-shrink:1}#checkout-modal .flex-shrink-0{flex-shrink:0}#checkout-modal .flex-grow,#checkout-modal .grow{flex-grow:1}#checkout-modal .-translate-y-2\\/4{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .translate-x-\\[-45\\%\\]{--tw-translate-x: -45%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .translate-x-\\[0\\%\\]{--tw-translate-x: 0%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}#checkout-modal .animate-spin{animation:spin 1s linear infinite}#checkout-modal .cursor-pointer{cursor:pointer}#checkout-modal .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}#checkout-modal .grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}#checkout-modal .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#checkout-modal .grid-cols-\\[1fr_auto\\]{grid-template-columns:1fr auto}#checkout-modal .grid-rows-1{grid-template-rows:repeat(1,minmax(0,1fr))}#checkout-modal .grid-rows-\\[auto_1fr\\]{grid-template-rows:auto 1fr}#checkout-modal .flex-col{flex-direction:column}#checkout-modal .flex-col-reverse{flex-direction:column-reverse}#checkout-modal .items-start{align-items:flex-start}#checkout-modal .items-end{align-items:flex-end}#checkout-modal .items-center{align-items:center}#checkout-modal .justify-center{justify-content:center}#checkout-modal .justify-between{justify-content:space-between}#checkout-modal .gap-1{gap:.25rem}#checkout-modal .gap-1\\.5{gap:.375rem}#checkout-modal .gap-2{gap:.5rem}#checkout-modal .gap-3{gap:.75rem}#checkout-modal .gap-4{gap:1rem}#checkout-modal .gap-5{gap:1.25rem}#checkout-modal .gap-6{gap:1.5rem}#checkout-modal .gap-7{gap:1.75rem}#checkout-modal .gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}#checkout-modal .self-start{align-self:flex-start}#checkout-modal .justify-self-center{justify-self:center}#checkout-modal .overflow-hidden{overflow:hidden}#checkout-modal .overflow-y-auto{overflow-y:auto}#checkout-modal .whitespace-normal{white-space:normal}#checkout-modal .whitespace-nowrap{white-space:nowrap}#checkout-modal .break-words{overflow-wrap:break-word}#checkout-modal .rounded-2xl{border-radius:1rem}#checkout-modal .rounded-\\[20px\\]{border-radius:20px}#checkout-modal .rounded-\\[40px\\]{border-radius:40px}#checkout-modal .rounded-lg{border-radius:.5rem}#checkout-modal .rounded-md{border-radius:.375rem}#checkout-modal .border{border-width:1px}#checkout-modal .border-b{border-bottom-width:1px}#checkout-modal .border-r{border-right-width:1px}#checkout-modal .border-dashed{border-style:dashed}#checkout-modal .border-none{border-style:none}#checkout-modal .border-\\[\\#D0D5DD\\]{--tw-border-opacity: 1;border-color:rgb(208 213 221 / var(--tw-border-opacity))}#checkout-modal .border-\\[\\#D62020\\]{--tw-border-opacity: 1;border-color:rgb(214 32 32 / var(--tw-border-opacity))}#checkout-modal .border-alphablack-10{border-color:hsla(var(--alphablack),.1)}#checkout-modal .border-grey-100{border-color:hsl(var(--grey-100))}#checkout-modal .border-tone-10{border-color:hsl(var(--tone-10))}#checkout-modal .border-tone-40{border-color:hsl(var(--tone-40))}#checkout-modal .border-tone-50{border-color:hsl(var(--tone-50))}#checkout-modal .border-tone-70{border-color:hsla(var(--tone-70))}#checkout-modal .border-b-grey-faint{border-bottom-color:hsl(var(--grey-faint))}#checkout-modal .bg-\\[\\#F7F8FB\\]{--tw-bg-opacity: 1;background-color:rgb(247 248 251 / var(--tw-bg-opacity))}#checkout-modal .bg-\\[\\#FBF2CB\\]{--tw-bg-opacity: 1;background-color:rgb(251 242 203 / var(--tw-bg-opacity))}#checkout-modal .bg-\\[\\#FEF7ED\\]{--tw-bg-opacity: 1;background-color:rgb(254 247 237 / var(--tw-bg-opacity))}#checkout-modal .bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}#checkout-modal .bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}#checkout-modal .bg-primary{background-color:hsl(var(--primary))}#checkout-modal .bg-tone-10{background-color:hsl(var(--tone-10))}#checkout-modal .bg-tone-100{background-color:hsl(var(--tone-100))}#checkout-modal .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}#checkout-modal .bg-opacity-30{--tw-bg-opacity: .3}#checkout-modal .object-contain{-o-object-fit:contain;object-fit:contain}#checkout-modal .p-0{padding:0}#checkout-modal .p-1{padding:.25rem}#checkout-modal .p-2{padding:.5rem}#checkout-modal .p-3{padding:.75rem}#checkout-modal .p-4{padding:1rem}#checkout-modal .px-0{padding-left:0;padding-right:0}#checkout-modal .px-2{padding-left:.5rem;padding-right:.5rem}#checkout-modal .px-3{padding-left:.75rem;padding-right:.75rem}#checkout-modal .px-3\\.5{padding-left:.875rem;padding-right:.875rem}#checkout-modal .px-4{padding-left:1rem;padding-right:1rem}#checkout-modal .px-6{padding-left:1.5rem;padding-right:1.5rem}#checkout-modal .py-1{padding-top:.25rem;padding-bottom:.25rem}#checkout-modal .py-10{padding-top:2.5rem;padding-bottom:2.5rem}#checkout-modal .py-2{padding-top:.5rem;padding-bottom:.5rem}#checkout-modal .py-3{padding-top:.75rem;padding-bottom:.75rem}#checkout-modal .py-4{padding-top:1rem;padding-bottom:1rem}#checkout-modal .py-5{padding-top:1.25rem;padding-bottom:1.25rem}#checkout-modal .pb-0{padding-bottom:0}#checkout-modal .pb-1{padding-bottom:.25rem}#checkout-modal .pb-3{padding-bottom:.75rem}#checkout-modal .pb-4{padding-bottom:1rem}#checkout-modal .pb-5{padding-bottom:1.25rem}#checkout-modal .pl-4{padding-left:1rem}#checkout-modal .pr-2{padding-right:.5rem}#checkout-modal .pr-7{padding-right:1.75rem}#checkout-modal .pt-0{padding-top:0}#checkout-modal .pt-1{padding-top:.25rem}#checkout-modal .pt-3{padding-top:.75rem}#checkout-modal .pt-5{padding-top:1.25rem}#checkout-modal .pt-6{padding-top:1.5rem}#checkout-modal .text-left{text-align:left}#checkout-modal .text-center{text-align:center}#checkout-modal .text-2xl{font-size:1.5rem;line-height:2rem}#checkout-modal .text-\\[10px\\]{font-size:10px}#checkout-modal .text-\\[11px\\]{font-size:11px}#checkout-modal .text-base{font-size:1rem;line-height:1.5rem}#checkout-modal .text-lg{font-size:1.125rem;line-height:1.75rem}#checkout-modal .text-sm{font-size:.875rem;line-height:1.25rem}#checkout-modal .text-xl{font-size:1.25rem;line-height:1.75rem}#checkout-modal .text-xs{font-size:.75rem;line-height:1rem}#checkout-modal .text-xxs{font-size:.625rem}#checkout-modal .font-bold{font-weight:700}#checkout-modal .font-medium{font-weight:500}#checkout-modal .font-normal{font-weight:400}#checkout-modal .font-semibold{font-weight:600}#checkout-modal .uppercase{text-transform:uppercase}#checkout-modal .lowercase{text-transform:lowercase}#checkout-modal .tracking-\\[0\\.5px\\]{letter-spacing:.5px}#checkout-modal .text-\\[\\#816039\\]{--tw-text-opacity: 1;color:rgb(129 96 57 / var(--tw-text-opacity))}#checkout-modal .text-\\[\\#98A2B3\\]{--tw-text-opacity: 1;color:rgb(152 162 179 / var(--tw-text-opacity))}#checkout-modal .text-\\[\\#C8811A\\]{--tw-text-opacity: 1;color:rgb(200 129 26 / var(--tw-text-opacity))}#checkout-modal .text-\\[\\#D62020\\]{--tw-text-opacity: 1;color:rgb(214 32 32 / var(--tw-text-opacity))}#checkout-modal .text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}#checkout-modal .text-error{color:hsl(var(--error))}#checkout-modal .text-error-dark{color:hsl(var(--error-dark))}#checkout-modal .text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}#checkout-modal .text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}#checkout-modal .text-grey-100{color:hsl(var(--grey-100))}#checkout-modal .text-grey-400{color:hsl(var(--grey-400))}#checkout-modal .text-primary-900{color:hsl(var(--primary-900))}#checkout-modal .text-tone-100{color:hsl(var(--tone-100))}#checkout-modal .text-tone-40{color:hsl(var(--tone-40))}#checkout-modal .text-tone-50{color:hsl(var(--tone-50))}#checkout-modal .text-tone-60{color:hsla(var(--tone-60))}#checkout-modal .text-tone-70{color:hsla(var(--tone-70))}#checkout-modal .text-tone-80{color:hsla(var(--tone-80))}#checkout-modal .text-tone-90{color:hsla(var(--tone-90))}#checkout-modal .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#checkout-modal .opacity-0{opacity:0}#checkout-modal .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#checkout-modal .shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#checkout-modal .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#checkout-modal .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .duration-200{transition-duration:.2s}#checkout-modal .duration-500{transition-duration:.5s}#checkout-modal .duration-700{transition-duration:.7s}#checkout-modal .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}#checkout-modal *::-webkit-scrollbar{height:.2em;width:.4em;cursor:pointer;--tw-bg-opacity: 1;background-color:rgb(244 244 244 / var(--tw-bg-opacity))}#checkout-modal *::-webkit-scrollbar-track{border-radius:100vh;--tw-bg-opacity: 1;background-color:rgb(153 146 146 / var(--tw-bg-opacity))}#checkout-modal *::-webkit-scrollbar-thumb{cursor:pointer;border-radius:100vh;border-width:3px;--tw-border-opacity: 1;border-color:rgb(112 112 112 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(224 203 203 / var(--tw-bg-opacity))}#checkout-modal *::-webkit-scrollbar-thumb:hover{background:#53b6ed}@font-face{font-family:IBM Plex Sans;src:url("https://d104jydf2tp7hm.cloudfront.net/IBM Plex Sans/IBMPlexSans-Regular.ttf");font-weight:400;font-display:swap}@font-face{font-family:IBM Plex Sans;src:url("https://d104jydf2tp7hm.cloudfront.net/IBM Plex Sans/IBMPlexSans-SemiBold.ttf");font-weight:600;font-display:swap}@font-face{font-family:IBM Plex Sans;src:url("https://d104jydf2tp7hm.cloudfront.net/IBM Plex Sans/IBMPlexSans-Bold.ttf");font-weight:700;font-display:swap}.tab-button.active:after{animation:text-underline-animation .3s linear forwards}#toast-container{width:100%;margin:0 auto}.toast{display:flex;align-items:center;padding:15px;margin-bottom:10px;border-radius:5px;opacity:0;transform:translateY(-50px);transition:opacity .5s,transform .5s;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a}.toast.show{opacity:1;transform:translateY(0)}.toast.success{background-color:hsl(var(--success));color:#fff}.toast.error{background-color:hsl(var(--error));color:#fff}.toast .close-btn{margin-left:auto;cursor:pointer;color:#fff}.progress-container{width:100%;height:10px;background-color:#f3f3f3;border-radius:5px;overflow:hidden;position:relative}.progress-bar{height:100%;background-color:#4caf50;width:0;position:absolute;top:0;left:0;animation:progress 1s linear infinite}@keyframes progress{0%{width:0px}to{width:100%}}#checkout-modal{font-family:IBM Plex Sans,Inter,sans-serif!important;color:hsla(var(--tone-80))}#test-cards-link{cursor:pointer;transition:color .2s ease}a{color:inherit}@media (min-width: 768px){.md\\:container-center{display:flex;align-items:center;justify-content:center}}#checkout-modal .placeholder\\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}#checkout-modal .placeholder\\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}#checkout-modal .placeholder\\:text-tone-50::-moz-placeholder{color:hsl(var(--tone-50))}#checkout-modal .placeholder\\:text-tone-50::placeholder{color:hsl(var(--tone-50))}#checkout-modal .before\\:absolute:before{content:var(--tw-content);position:absolute}#checkout-modal .before\\:-top-0:before{content:var(--tw-content);top:-0px}#checkout-modal .before\\:left-0:before{content:var(--tw-content);left:0}#checkout-modal .before\\:h-4:before{content:var(--tw-content);height:1rem}#checkout-modal .before\\:w-4:before{content:var(--tw-content);width:1rem}#checkout-modal .before\\:-translate-y-1:before{content:var(--tw-content);--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:translate-x-\\[-45\\%\\]:before{content:var(--tw-content);--tw-translate-x: -45%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:translate-x-\\[0\\%\\]:before{content:var(--tw-content);--tw-translate-x: 0%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:rotate-45:before{content:var(--tw-content);--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:bg-white:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}#checkout-modal .hover\\:block:hover{display:block}#checkout-modal .hover\\:w-full:hover{width:100%}#checkout-modal .hover\\:rotate-0:hover{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .hover\\:font-bold:hover{font-weight:700}#checkout-modal .hover\\:text-black:hover{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}#checkout-modal .hover\\:underline:hover{text-decoration-line:underline}#checkout-modal .hover\\:opacity-100:hover{opacity:1}#checkout-modal .hover\\:opacity-80:hover{opacity:.8}#checkout-modal :is(.group:hover .group-hover\\:block){display:block}#checkout-modal :is(.group:hover .group-hover\\:w-4\\/5){width:80%}#checkout-modal :is(.group:hover .group-hover\\:w-full){width:100%}#checkout-modal :is(.group:hover .group-hover\\:rotate-0){--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width: 640px){#checkout-modal .sm\\:my-8{margin-top:2rem;margin-bottom:2rem}#checkout-modal .sm\\:items-center{align-items:center}}@media (min-width: 768px){#checkout-modal .md\\:mb-5{margin-bottom:1.25rem}#checkout-modal .md\\:mt-6{margin-top:1.5rem}#checkout-modal .md\\:mt-8{margin-top:2rem}#checkout-modal .md\\:block{display:block}#checkout-modal .md\\:flex{display:flex}#checkout-modal .md\\:hidden{display:none}#checkout-modal .md\\:min-h-\\[70\\%\\]{min-height:70%}#checkout-modal .md\\:w-16{width:4rem}#checkout-modal .md\\:w-20{width:5rem}#checkout-modal .md\\:w-3\\/5{width:60%}#checkout-modal .md\\:w-4\\/5{width:80%}#checkout-modal .md\\:w-4\\/6{width:66.666667%}#checkout-modal .md\\:min-w-\\[18rem\\]{min-width:18rem}#checkout-modal .md\\:max-w-\\[600px\\]{max-width:600px}#checkout-modal .md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#checkout-modal .md\\:flex-col{flex-direction:column}#checkout-modal .md\\:justify-between{justify-content:space-between}#checkout-modal .md\\:gap-6{gap:1.5rem}#checkout-modal .md\\:gap-9{gap:2.25rem}#checkout-modal .md\\:rounded-lg{border-radius:.5rem}#checkout-modal .md\\:px-5{padding-left:1.25rem;padding-right:1.25rem}#checkout-modal .md\\:px-7{padding-left:1.75rem;padding-right:1.75rem}#checkout-modal .md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}#checkout-modal .md\\:py-4{padding-top:1rem;padding-bottom:1rem}#checkout-modal .md\\:text-xs{font-size:.75rem;line-height:1rem}}@media (min-width: 1024px){#checkout-modal .lg\\:block{display:block}#checkout-modal .lg\\:max-w-\\[20rem\\]{max-width:20rem}#checkout-modal .lg\\:px-7{padding-left:1.75rem;padding-right:1.75rem}#checkout-modal .lg\\:px-8{padding-left:2rem;padding-right:2rem}}
2
+ `,document.head.appendChild(Ve);const Xt=`<div id="checkout-modal">
3
3
  <div role="dialog" class="relative z-50" aria-labelledby="modal-title" aria-modal="true">
4
4
  <div class="fixed inset-0 bg-black bg-opacity-30 transition-opacity" aria-hidden="true"></div>
5
5
 
@@ -46,7 +46,7 @@
46
46
  </div>
47
47
  <!-- end of footer -->
48
48
  </div>
49
- </div>`,ue=(t,e)=>e||t;let N=class extends Error{constructor(e,n){super(e),this.status=n,this.name="FetchError"}},Le=class extends Error{constructor(e){super(e),this.name="AuthorizationError"}};const Be=(t,e,n)=>{if(!t)throw new Le("Missing authorization token");const i=new Headers;return n||i.append("Content-Type","application/json"),i.append("Authorization",`Bearer ${t}`),i.append("Origin","https://sdk.spotflow.co"),e&&i.append("Spotflow-Payment-Code",e),i},He="https://api.spotflow.co/api/v1",Ra=async(t,e,n,i)=>{try{const s=Be(t,n),o=await fetch(`${ue(He,i)}/payments`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const c=await o.json();throw c.message?c:new N("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},On=async(t,e,n,i)=>{try{const s=Be(t,n),o=await fetch(`${ue(He,i)}/payments/authorize`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const c=await o.json();throw c.message?c:new N("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},Hi=async(t,e,n,i)=>{try{const s=Be(t,n),o=await fetch(`${ue(He,i)}/payments`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const c=await o.json();throw c.message?c:new N("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},Na=async(t,e,n,i)=>{try{const s=Be(t,n),o=await fetch(`${ue(He,i)}/payments`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const c=await o.json();throw c.message?new N(c.message,o.status):new N("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`UnexpectedError: ${s}`),s}},Oa=async(t,e,n,i)=>{try{const s=Be(t,n),o=await fetch(`${ue(He,i)}/payments`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const c=await o.json();throw c.message?new N(c.message,o.status):new N("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`UnexpectedError: ${s}`),s}},Xe=async(t,e,n,i,s)=>{try{const o=Be(t,i),a=await fetch(`${ue(He,s)}/payments/verify?reference=${e}`,{method:"GET",headers:o,signal:n});if(!a.ok){const l=await a.json();throw l.message?new N(l.message,a.status):new N("Network response was not ok",a.status)}return{data:await a.json(),headers:a.headers}}catch(o){throw o instanceof N?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Le?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}};async function Ua(t,e,n,i,s){const o=Be(t,n);try{const a=await fetch(`${ue(He,i)}/mobile-money/providers?currency=${s||e}`,{headers:o,method:"GET"});if(!a.ok){const c=await a.json();throw c.message?new N(c.message,a.status):new N("Network response was not okay",a.status)}return await a.json()}catch(a){throw a instanceof N?console.error(`FetchError: ${a.message} (status: ${a.status})`):a instanceof Le?console.error(`AuthorizationError: ${a.message}`):console.error(`Unexpected error: ${a}`),a}}const Va=async(t,e,n,i)=>{try{const s=Be(t,n),o=await fetch(`${ue(He,i)}/payments/cancel`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const a=await o.json();throw a.message?new N(a.message,o.status):new N("Network response was not ok",o.status)}return{headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},Fa=async(t,e,n,i)=>{try{const s=Be(t,n,!0),o=await fetch(`${ue(He,i)}/disputes/upload-documents`,{method:"POST",headers:s,body:e});if(!o.ok){const a=await o.json();throw a.message?new N(a.message,o.status):new N("Network response was not ok",o.status)}return o.json()}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},Ka=async(t,e,n,i)=>{try{const s=Be(t,n),o=await fetch(`${ue(He,i)}/disputes/reference`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const a=await o.json();throw a.message?new N(a.message,o.status):new N("Network response was not ok",o.status)}return o.json()}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},$t=async(t,e,n,i)=>{try{const s=Be(t,n),o=await fetch(`${ue(He,i)}/payments/retry`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const c=await o.json();throw c.message?c:new N("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}};async function Ga(t,e,n,i,s){try{const o=Be(t,i),a=await fetch(`${ue(He,s)}/payments/tax-quotes?amount=${e||""}&currency=${n||""}`,{headers:o,method:"GET"});if(!a.ok){const c=await a.json();throw c.message?new N(c.message,a.status):new N("Network response was not ok",a.status)}return a.json()}catch(o){throw o instanceof N?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Le?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}}const ja=async(t,e,n,i)=>{try{const s=Be(t,n),o=await fetch(`${ue(He,i)}/payments/charge?reference=${e}`,{method:"POST",headers:s});if(!o.ok){const c=await o.json();throw c.message?new N(c.message,o.status):new N("Network response was not ok",o.status)}const a=await o.json();return{headers:o.headers,data:a}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},za=async t=>{try{const n=await fetch("https://translate.spotflow.co/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({q:t.text,source:(t==null?void 0:t.source)??"auto",target:t==null?void 0:t.target})});if(!n.ok){const s=await n.json();throw s.message?new N(s.message,n.status):new N("Network response was not ok",n.status)}return await n.json()}catch(e){throw e instanceof N?console.error(`FetchError: ${e.message} (status: ${e.status})`):e instanceof Le?console.error(`AuthorizationError: ${e.message}`):console.error(`Unexpected error: ${e}`),e}},qa=async(t,e,n)=>{try{const i=Be(t,e),s=await fetch(`${ue(He,n)}/stablecoins/assets`,{method:"GET",headers:i});if(!s.ok){const o=await s.json();throw o.message?new N(o.message,s.status):new N("Network response was not ok",s.status)}return s.json()}catch(i){throw i instanceof N?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Le?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}},Za=async(t,e,n)=>{try{const i=Be(t,e),s=await fetch(`${ue(He,n)}/stablecoins/chains`,{method:"GET",headers:i});if(!s.ok){const o=await s.json();throw o.message?new N(o.message,s.status):new N("Network response was not ok",s.status)}return s.json()}catch(i){throw i instanceof N?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Le?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}},Te=(t,e)=>{const n=new Intl.NumberFormat("ng-NG",{style:"decimal",maximumFractionDigits:e||0,minimumFractionDigits:e||0});return isNaN(parseFloat(n.format(t)))?"-":n.format(t)},ne={card:{key:"card",label:"Pay with Card",icon:`<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
49
+ </div>`,ue=(t,e)=>e||t;let N=class extends Error{constructor(e,n){super(e),this.status=n,this.name="FetchError"}},Le=class extends Error{constructor(e){super(e),this.name="AuthorizationError"}};const He=(t,e,n)=>{if(!t)throw new Le("Missing authorization token");const i=new Headers;return n||i.append("Content-Type","application/json"),i.append("Authorization",`Bearer ${t}`),i.append("Origin","https://sdk.spotflow.co"),e&&i.append("Spotflow-Payment-Code",e),i},Re="https://api.spotflow.co/api/v1",Ra=async(t,e,n,i)=>{try{const s=He(t,n),o=await fetch(`${ue(Re,i)}/payments`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const c=await o.json();throw c.message?c:new N("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},On=async(t,e,n,i)=>{try{const s=He(t,n),o=await fetch(`${ue(Re,i)}/payments/authorize`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const c=await o.json();throw c.message?c:new N("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},Hi=async(t,e,n,i)=>{try{const s=He(t,n),o=await fetch(`${ue(Re,i)}/payments`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const c=await o.json();throw c.message?c:new N("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},Na=async(t,e,n,i)=>{try{const s=He(t,n),o=await fetch(`${ue(Re,i)}/payments`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const c=await o.json();throw c.message?new N(c.message,o.status):new N("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`UnexpectedError: ${s}`),s}},Oa=async(t,e,n,i)=>{try{const s=He(t,n),o=await fetch(`${ue(Re,i)}/payments`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const c=await o.json();throw c.message?new N(c.message,o.status):new N("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`UnexpectedError: ${s}`),s}},Xe=async(t,e,n,i,s)=>{try{const o=He(t,i),a=await fetch(`${ue(Re,s)}/payments/verify?reference=${e}`,{method:"GET",headers:o,signal:n});if(!a.ok){const l=await a.json();throw l.message?new N(l.message,a.status):new N("Network response was not ok",a.status)}return{data:await a.json(),headers:a.headers}}catch(o){throw o instanceof N?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Le?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}};async function Ua(t,e,n,i,s){const o=He(t,n);try{const a=await fetch(`${ue(Re,i)}/mobile-money/providers?currency=${s||e}`,{headers:o,method:"GET"});if(!a.ok){const c=await a.json();throw c.message?new N(c.message,a.status):new N("Network response was not okay",a.status)}return await a.json()}catch(a){throw a instanceof N?console.error(`FetchError: ${a.message} (status: ${a.status})`):a instanceof Le?console.error(`AuthorizationError: ${a.message}`):console.error(`Unexpected error: ${a}`),a}}const Va=async(t,e,n,i)=>{try{const s=He(t,n),o=await fetch(`${ue(Re,i)}/payments/cancel`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const a=await o.json();throw a.message?new N(a.message,o.status):new N("Network response was not ok",o.status)}return{headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},Fa=async(t,e,n,i)=>{try{const s=He(t,n,!0),o=await fetch(`${ue(Re,i)}/disputes/upload-documents`,{method:"POST",headers:s,body:e});if(!o.ok){const a=await o.json();throw a.message?new N(a.message,o.status):new N("Network response was not ok",o.status)}return o.json()}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},Ka=async(t,e,n,i)=>{try{const s=He(t,n),o=await fetch(`${ue(Re,i)}/disputes/reference`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const a=await o.json();throw a.message?new N(a.message,o.status):new N("Network response was not ok",o.status)}return o.json()}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},$t=async(t,e,n,i)=>{try{const s=He(t,n),o=await fetch(`${ue(Re,i)}/payments/retry`,{method:"POST",headers:s,body:JSON.stringify(e)});if(!o.ok){const c=await o.json();throw c.message?c:new N("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}};async function Ga(t,e,n,i,s){try{const o=He(t,i),a=await fetch(`${ue(Re,s)}/payments/tax-quotes?amount=${e||""}&currency=${n||""}`,{headers:o,method:"GET"});if(!a.ok){const c=await a.json();throw c.message?new N(c.message,a.status):new N("Network response was not ok",a.status)}return a.json()}catch(o){throw o instanceof N?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Le?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}}const ja=async(t,e,n,i)=>{try{const s=He(t,n),o=await fetch(`${ue(Re,i)}/payments/charge?reference=${e}`,{method:"POST",headers:s});if(!o.ok){const c=await o.json();throw c.message?new N(c.message,o.status):new N("Network response was not ok",o.status)}const a=await o.json();return{headers:o.headers,data:a}}catch(s){throw s instanceof N?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Le?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}},za=async t=>{try{const n=await fetch("https://translate.spotflow.co/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({q:t.text,source:(t==null?void 0:t.source)??"auto",target:t==null?void 0:t.target})});if(!n.ok){const s=await n.json();throw s.message?new N(s.message,n.status):new N("Network response was not ok",n.status)}return await n.json()}catch(e){throw e instanceof N?console.error(`FetchError: ${e.message} (status: ${e.status})`):e instanceof Le?console.error(`AuthorizationError: ${e.message}`):console.error(`Unexpected error: ${e}`),e}},qa=async(t,e,n)=>{try{const i=He(t,e),s=await fetch(`${ue(Re,n)}/stablecoins/assets`,{method:"GET",headers:i});if(!s.ok){const o=await s.json();throw o.message?new N(o.message,s.status):new N("Network response was not ok",s.status)}return s.json()}catch(i){throw i instanceof N?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Le?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}},Za=async(t,e,n)=>{try{const i=He(t,e),s=await fetch(`${ue(Re,n)}/stablecoins/chains`,{method:"GET",headers:i});if(!s.ok){const o=await s.json();throw o.message?new N(o.message,s.status):new N("Network response was not ok",s.status)}return s.json()}catch(i){throw i instanceof N?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Le?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}},Te=(t,e)=>{const n=new Intl.NumberFormat("ng-NG",{style:"decimal",maximumFractionDigits:e||0,minimumFractionDigits:e||0});return isNaN(parseFloat(n.format(t)))?"-":n.format(t)},ne={card:{key:"card",label:"Pay with Card",icon:`<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
50
50
  <path d="M1.83398 6.16992H15.1673" stroke="currentColor" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
51
51
  <path d="M4.5 11.5034H5.83333" stroke="currentColor" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
52
52
  <path d="M7.5 11.5034H10.1667" stroke="currentColor" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
@@ -616,7 +616,7 @@
616
616
  d="M2.80944 12.6864L7.40177 4.11968C8.13226 2.75698 10.1359 2.75698 10.8664 4.11968L15.4587 12.6864C16.1374 13.9525 15.1936 15.4677 13.7264 15.4677H4.54174C3.0745 15.4677 2.13075 13.9525 2.80944 12.6864ZM9.13406 5.28061C9.53593 5.28061 9.86171 5.60639 9.86171 6.00826V11.1018C9.86171 11.5037 9.53593 11.8295 9.13406 11.8295C8.73219 11.8295 8.40641 11.5037 8.40641 11.1018V6.00826C8.40641 5.60639 8.73219 5.28061 9.13406 5.28061ZM8.2245 13.1029C8.2245 13.6052 8.63172 14.0124 9.13406 14.0124C9.6364 14.0124 10.0436 13.6052 10.0436 13.1029C10.0436 12.6005 9.6364 12.1933 9.13406 12.1933C8.63172 12.1933 8.2245 12.6005 8.2245 13.1029Z"
617
617
  fill="white" />
618
618
  </svg>
619
- <span id="custom-toast-msg">${e}</span>`:e,i.appendChild(s);const o=document.createElement("span");return o.textContent="×",o.classList.add("close-btn","opacity-0"),o.onclick=()=>Rt.removeToast(i),i.appendChild(o),i}),d(Rt,"showToast",(e,n,i=3e3)=>{const s=document.getElementById("toast-container");if(s){const o=Rt.createToast(e,n);s.appendChild(o),o.offsetHeight,o.classList.add("show"),setTimeout(()=>Rt.removeToast(o),i)}}),d(Rt,"removeToast",e=>{e.classList.remove("show"),e.addEventListener("transitionend",()=>{e.parentElement&&e.parentElement.removeChild(e)})});let Vn=Rt;function Ms(t){return typeof t!="string"?null:t.includes("test")?"test":t.includes("live")?"live":null}function nr(t,e){return t.filter(i=>i===e).length>1}const Ls={select_payment_method_text:"Select your preferred payment method",powered:"Powered by",terms:"Terms",privacy:"Privacy",contact:"Contact","error-occured":"An error occurred","transaction-limit":"Transaction limit reached","merchant-email-required":"Merchant key or email is required","no-local-currency":"Local currency is required for USD transactions","rate-not-found":"Rate not found","error-description":"We're having trouble loading this page. Please check your connection or try again.","something-wrong":"Something went wrong","merchant-back":"Go back to Merchant","test-card":"Test Cards",amount:"Amount","to-pay":"To pay",translating:"Translating"},Ri={"pay-card":"Pay with Card","pay-transfer":"Pay with Transfer","pay-momo":"Pay with Mobile Money","pay-eft":"Pay with EFT","pay-with-opay":"Pay with Opay","pay-stablecoin":"Pay with Stablecoin"},Ts={"try-again":"Try again","confirming-txn-status":"We are confirming transaction status.","few-minutes":"This can take a few minutes.","please-wait-for":"Please wait for",minutes:"minutes","what-is-this":"What is this?","rate-reflect-note":"This rate reflects the current exchange rate for converting United States Dollars (USD) to","rate-please-note":"Please note that exchange rates are subject to change and may vary slightly at the time of the transaction.","we-processed":"We've processed your",charge:"charge","payment-success":"Payment Successful","payment-failed":"Payment failed","error-with-payment":"Error with Payment","maximum-retries":"Maximum retries","maximum-retries-desc":"You have reached the maximum number of retries allowed. Go back to merchant website to start the payment process again.",copy:"Copy",copied:"Copied!","copy-fail":"Failed to copy","long-processing":"Your transaction is being processed and is taking longer than usual to confirm. You don't need to stay on this page","once-confirmed":"we will notify you once it is confirmed","verify-payment":"Verifying Payment"},_s={"enter-card-details":"Enter your card details",certified:"Certified","card-confirmation-one":"By confirming this payment, you allow","card-confirmation-two":"to charge your card for this payment and future payments in accordance with their terms.","card-holder-name":"Card holder name","card-number":"Card number","continue-to":"Continue to pay","card-number-invalid":"Your card number is invalid","invalid-issue-card":"Invalid card. Only locally issued cards are accepted.","card-expired":"Your card has expired","enable-popup":"Please enable popups for this site to complete the authentication.","enter-otp":"Please enter your OTP sent to your phone","enter-pin":"Please enter your 4-digit card pin to authorize this payment","cancel-payment":"Cancel payment",authorize:"Authorize",card:"Card","proceed-3ds":"Proceed to 3D Secure"},Es={expiry:"Expiry","no-auth":"No auth",address:"Address",city:"City",state:"State",country:"Country",number:"Number",zip:"Zip"},Ps={"bank-name":"Bank name",beneficiary:"Beneficiary","account-details":"Account details","error-fetching":"Error fetching bank details","account-expired":"Account Expired","account-expired-desc":" Looks like your account is not valid. Please confirm and try again","transfer-header":"Make a single bank transfer from your bank to this account before it expires.","account-number":"Account Number","made-transfer":"I have made this bank transfer","expiration-text":"This account is for this transaction only and expires in"},Is={"header-text":"Please enter your Mobile Money details to begin payment",network:"Network","cancel-payment":"Cancel payment","generate-otp":"Please generate the OTP code by dialing #144*82#, then enter the OTP below",certified:"Certified","select-network":"Select Network","enter-otp":"Enter OTP","enter-number":"Enter your mobile number","continue-to":"Continue to pay","unable-fetch":"Unable to fetch network providers at this time.","valid-number-message":"Please enter a valid phone number. You can remove the leading zero if it exists.","enter-phone-otp":"Please enter your OTP sent to your phone",authorize:"Authorize","please-wait":"Please wait"},Ds={"unable-redirect-url":"Unable to get redirect URL","payment-cancelled":"Payment Cancelled","cancel-payment-desc":"You have cancelled the payment. Go back to merchant website to start the payment process again.","authenticate-request":"Please click the button below to authenticate your payment",authenticate:"Authenticate"},Bs={"unable-redirect-url":"Unable to get redirect URL","payment-cancelled":"Payment Cancelled","cancel-payment-desc":"You have cancelled the payment. Go back to merchant website to start the payment process again.","authenticate-request":"Please click the button below to authenticate your payment",authenticate:"Authenticate"},Hs={"payment-text":"Send {amount} to the Wallet address below to complete the transaction","wallet-address":"Wallet address","copy-text":"copy","copied-text":"copied!","payment-confirmation":"I have completed the payment","select-chain":"Select chain type","select-asset":"Select asset"};let wn={};const Ni=(t,e)=>{const n=At.find(i=>i.name===(e||t));return wn=n||At[0],n};class ir{constructor(e={}){d(this,"options");d(this,"activeSections",new Set);d(this,"loadingElements",new Map);d(this,"sectionConfigs",new Map);this.options={defaultStyle:e.defaultStyle||"skeleton",skeletonClass:e.skeletonClass||"skeleton-loading",shimmerClass:e.shimmerClass||"shimmer-loading"},this.injectStyles()}registerSection(e){this.sectionConfigs.set(e.sectionId,e)}async translateSection(e){const n=this.sectionConfigs.get(e);if(!n){console.warn(`Section ${e} not registered`);return}this.startSectionLoading(e,n.style);try{await Promise.all(n.translateFunctions.map(i=>i())),this.updateSectionUI(e)}catch(i){console.error(`Translation failed for section ${e}:`,i)}finally{this.stopSectionLoading(e)}}startSectionLoading(e,n){this.activeSections.add(e);const i=document.getElementById(e);if(!i)return;i.querySelectorAll("[data-translate], [data-translate-placeholder], [data-translate-container], [data-section]").forEach(o=>{this.applyLoadingStyle(o,n)})}stopSectionLoading(e){this.activeSections.delete(e);const n=document.getElementById(e);if(!n)return;n.querySelectorAll("[data-translate], [data-translate-placeholder], [data-translate-container], [data-section]").forEach(s=>{this.removeLoadingStyle(s)})}updateSectionUI(e){const n=document.getElementById(e);if(!n)return;const i=new CustomEvent("section-translations-updated",{detail:{sectionId:e}});n.dispatchEvent(i)}applyLoadingStyle(e,n=this.options.defaultStyle){switch(this.loadingElements.set(e,n),n){case"skeleton":this.applySkeletonLoading(e);break;case"shimmer":this.applyShimmerLoading(e);break;case"spinner":this.applySpinnerLoading(e);break}e.setAttribute("data-loading","true")}removeLoadingStyle(e){const n=this.loadingElements.get(e);if(n){switch(n){case"skeleton":e.classList.remove(this.options.skeletonClass),e.removeAttribute("data-original-content");break;case"shimmer":e.classList.remove(this.options.shimmerClass);break;case"spinner":this.removeSpinner(e);break;case"fade":e.style.opacity="1";break}e.removeAttribute("data-loading"),this.loadingElements.delete(e)}}applySkeletonLoading(e){e.classList.add(this.options.skeletonClass),e.hasAttribute("data-original-content")||e.setAttribute("data-original-content",e.textContent||"")}applyShimmerLoading(e){e.classList.add(this.options.shimmerClass)}applySpinnerLoading(e){const n=e,i=document.createElement("span");i.className="spinner-overlay",i.setAttribute("data-spinner-overlay","true");const s=document.createElement("span");s.className="inline-spinner",i.appendChild(s);const o=n.style.position;if(n.setAttribute("data-original-position",o||"static"),window.getComputedStyle(n).position==="static"&&(n.style.position="relative"),n.classList.add("spinner-loading-active"),n instanceof HTMLButtonElement||n instanceof HTMLAnchorElement){if(n instanceof HTMLButtonElement){const c=n.disabled;n.disabled=!0,n.setAttribute("data-was-disabled",String(c))}n.style.pointerEvents="none",n.setAttribute("data-original-pointer-events",window.getComputedStyle(n).pointerEvents)}e.appendChild(i)}removeSpinner(e){const n=e,i=e.querySelector("[data-spinner-overlay]");i&&i.remove(),n.classList.remove("spinner-loading-active");const s=e.getAttribute("data-original-position");if(s&&(n.style.position=s==="static"?"":s,e.removeAttribute("data-original-position")),n instanceof HTMLButtonElement){const a=e.getAttribute("data-was-disabled");n.disabled=a==="true",e.removeAttribute("data-was-disabled")}const o=e.getAttribute("data-original-pointer-events");o&&(n.style.pointerEvents=o==="auto"?"":o,e.removeAttribute("data-original-pointer-events"))}startGlobalLoading(e){document.querySelectorAll("[data-translate], [data-translate-placeholder], [data-translate-container], [data-section]").forEach(i=>{this.applyLoadingStyle(i,e)})}stopGlobalLoading(){Array.from(this.loadingElements.keys()).forEach(n=>{this.removeLoadingStyle(n)})}applyCustomLoading(e,n){document.querySelectorAll(e).forEach(s=>{this.applyLoadingStyle(s,n)})}removeCustomLoading(e){document.querySelectorAll(e).forEach(i=>{this.removeLoadingStyle(i)})}startSmartLoading(e){const n={headings:(e==null?void 0:e.headings)||"skeleton",paragraphs:(e==null?void 0:e.paragraphs)||"shimmer",buttons:(e==null?void 0:e.buttons)||"fade",inputs:(e==null?void 0:e.inputs)||"fade",default:(e==null?void 0:e.default)||"skeleton",container:(e==null?void 0:e.container)||"spinner"};document.querySelectorAll("h1[data-translate], h2[data-translate], h3[data-translate] h3[data-translate]").forEach(s=>this.applyLoadingStyle(s,n.headings)),document.querySelectorAll("p[data-translate], span[data-translate]:not(button span), a[data-translate]").forEach(s=>this.applyLoadingStyle(s,n.paragraphs)),document.querySelectorAll("button[data-translate]").forEach(s=>this.applyLoadingStyle(s,n.buttons)),document.querySelectorAll("button span[data-translate]").forEach(s=>this.applyLoadingStyle(s,n.buttons)),document.querySelectorAll("input[data-translate-placeholder], textarea[data-translate-placeholder]").forEach(s=>this.applyLoadingStyle(s,n.inputs)),document.querySelectorAll("div[data-translate-container], div[data-section]").forEach(s=>this.applyLoadingStyle(s,n.container)),document.querySelectorAll("[data-translate]").forEach(s=>{this.loadingElements.has(s)||this.applyLoadingStyle(s,n.default)})}injectStyles(){if(document.getElementById("smart-loading-styles"))return;const e=document.createElement("style");e.id="smart-loading-styles",e.textContent=`
619
+ <span id="custom-toast-msg">${e}</span>`:e,i.appendChild(s);const o=document.createElement("span");return o.textContent="×",o.classList.add("close-btn","opacity-0"),o.onclick=()=>Rt.removeToast(i),i.appendChild(o),i}),d(Rt,"showToast",(e,n,i=3e3)=>{const s=document.getElementById("toast-container");if(s){const o=Rt.createToast(e,n);s.appendChild(o),o.offsetHeight,o.classList.add("show"),setTimeout(()=>Rt.removeToast(o),i)}}),d(Rt,"removeToast",e=>{e.classList.remove("show"),e.addEventListener("transitionend",()=>{e.parentElement&&e.parentElement.removeChild(e)})});let Vn=Rt;function Ms(t){return typeof t!="string"?null:t.includes("test")?"test":t.includes("live")?"live":null}function nr(t,e){return t.filter(i=>i===e).length>1}const Ls={select_payment_method_text:"Select your preferred payment method",powered:"Powered by",terms:"Terms",privacy:"Privacy",contact:"Contact","error-occured":"An error occurred","transaction-limit":"Transaction limit reached","merchant-email-required":"Merchant key or email is required","no-local-currency":"Local currency is required for USD transactions","rate-not-found":"Rate not found","error-description":"We're having trouble loading this page. Please check your connection or try again.","something-wrong":"Something went wrong","merchant-back":"Go back to Merchant","test-card":"Test Cards",amount:"Amount","to-pay":"To pay",translating:"Translating"},Ri={"pay-card":"Pay with Card","pay-transfer":"Pay with Transfer","pay-momo":"Pay with Mobile Money","pay-eft":"Pay with EFT","pay-with-opay":"Pay with Opay","pay-stablecoin":"Pay with Stablecoin"},Ts={"try-again":"Try again","confirming-txn-status":"We are confirming transaction status.","few-minutes":"This can take a few minutes.","please-wait-for":"Please wait for",minutes:"minutes","what-is-this":"What is this?","rate-reflect-note":"This rate reflects the current exchange rate for converting United States Dollars (USD) to","rate-please-note":"Please note that exchange rates are subject to change and may vary slightly at the time of the transaction.","we-processed":"We've processed your",charge:"charge","payment-success":"Payment Successful","payment-failed":"Payment failed","error-with-payment":"Error with Payment","maximum-retries":"Maximum retries","maximum-retries-desc":"You have reached the maximum number of retries allowed. Go back to merchant website to start the payment process again.",copy:"Copy",copied:"Copied!","copy-fail":"Failed to copy","long-processing":"Your transaction is being processed and is taking longer than usual to confirm. You don't need to stay on this page","once-confirmed":"we will notify you once it is confirmed","verify-payment":"Verifying Payment"},_s={"enter-card-details":"Enter your card details",certified:"Certified","card-confirmation-one":"By confirming this payment, you allow","card-confirmation-two":"to charge your card for this payment and future payments in accordance with their terms.","card-holder-name":"Card holder name","card-number":"Card number","continue-to":"Continue to pay","card-number-invalid":"Your card number is invalid","invalid-issue-card":"Invalid card. Only locally issued cards are accepted.","card-expired":"Your card has expired","enable-popup":"Please enable popups for this site to complete the authentication.","enter-otp":"Please enter your OTP sent to your phone","enter-pin":"Please enter your 4-digit card pin to authorize this payment","cancel-payment":"Cancel payment",authorize:"Authorize",card:"Card","proceed-3ds":"Proceed to 3D Secure"},Es={expiry:"Expiry","no-auth":"No auth",address:"Address",city:"City",state:"State",country:"Country",number:"Number",zip:"Zip"},Ps={"bank-name":"Bank name",beneficiary:"Beneficiary","account-details":"Account details","error-fetching":"Error fetching bank details","account-expired":"Account Expired","account-expired-desc":" Looks like your account is not valid. Please confirm and try again","transfer-header-1":"Please make a single bank transfer of the","transfer-header-2":"exact amount shown","transfer-header-3":"before the account expires to complete your payment successfully.","account-number":"Account Number","made-transfer":"I have made this bank transfer","expiration-text":"This account is for this transaction only and expires in"},Is={"header-text":"Please enter your Mobile Money details to begin payment",network:"Network","cancel-payment":"Cancel payment","generate-otp":"Please generate the OTP code by dialing #144*82#, then enter the OTP below",certified:"Certified","select-network":"Select Network","enter-otp":"Enter OTP","enter-number":"Enter your mobile number","continue-to":"Continue to pay","unable-fetch":"Unable to fetch network providers at this time.","valid-number-message":"Please enter a valid phone number. You can remove the leading zero if it exists.","enter-phone-otp":"Please enter your OTP sent to your phone",authorize:"Authorize","please-wait":"Please wait"},Ds={"unable-redirect-url":"Unable to get redirect URL","payment-cancelled":"Payment Cancelled","cancel-payment-desc":"You have cancelled the payment. Go back to merchant website to start the payment process again.","authenticate-request":"Please click the button below to authenticate your payment",authenticate:"Authenticate"},Bs={"unable-redirect-url":"Unable to get redirect URL","payment-cancelled":"Payment Cancelled","cancel-payment-desc":"You have cancelled the payment. Go back to merchant website to start the payment process again.","authenticate-request":"Please click the button below to authenticate your payment",authenticate:"Authenticate"},Hs={"payment-text":"Send {amount} to the Wallet address below to complete the transaction","wallet-address":"Wallet address","copy-text":"copy","copied-text":"copied!","payment-confirmation":"I have completed the payment","select-chain":"Select chain type","select-asset":"Select asset"};let wn={};const Ni=(t,e)=>{const n=At.find(i=>i.name===(e||t));return wn=n||At[0],n};class ir{constructor(e={}){d(this,"options");d(this,"activeSections",new Set);d(this,"loadingElements",new Map);d(this,"sectionConfigs",new Map);this.options={defaultStyle:e.defaultStyle||"skeleton",skeletonClass:e.skeletonClass||"skeleton-loading",shimmerClass:e.shimmerClass||"shimmer-loading"},this.injectStyles()}registerSection(e){this.sectionConfigs.set(e.sectionId,e)}async translateSection(e){const n=this.sectionConfigs.get(e);if(!n){console.warn(`Section ${e} not registered`);return}this.startSectionLoading(e,n.style);try{await Promise.all(n.translateFunctions.map(i=>i())),this.updateSectionUI(e)}catch(i){console.error(`Translation failed for section ${e}:`,i)}finally{this.stopSectionLoading(e)}}startSectionLoading(e,n){this.activeSections.add(e);const i=document.getElementById(e);if(!i)return;i.querySelectorAll("[data-translate], [data-translate-placeholder], [data-translate-container], [data-section]").forEach(o=>{this.applyLoadingStyle(o,n)})}stopSectionLoading(e){this.activeSections.delete(e);const n=document.getElementById(e);if(!n)return;n.querySelectorAll("[data-translate], [data-translate-placeholder], [data-translate-container], [data-section]").forEach(s=>{this.removeLoadingStyle(s)})}updateSectionUI(e){const n=document.getElementById(e);if(!n)return;const i=new CustomEvent("section-translations-updated",{detail:{sectionId:e}});n.dispatchEvent(i)}applyLoadingStyle(e,n=this.options.defaultStyle){switch(this.loadingElements.set(e,n),n){case"skeleton":this.applySkeletonLoading(e);break;case"shimmer":this.applyShimmerLoading(e);break;case"spinner":this.applySpinnerLoading(e);break}e.setAttribute("data-loading","true")}removeLoadingStyle(e){const n=this.loadingElements.get(e);if(n){switch(n){case"skeleton":e.classList.remove(this.options.skeletonClass),e.removeAttribute("data-original-content");break;case"shimmer":e.classList.remove(this.options.shimmerClass);break;case"spinner":this.removeSpinner(e);break;case"fade":e.style.opacity="1";break}e.removeAttribute("data-loading"),this.loadingElements.delete(e)}}applySkeletonLoading(e){e.classList.add(this.options.skeletonClass),e.hasAttribute("data-original-content")||e.setAttribute("data-original-content",e.textContent||"")}applyShimmerLoading(e){e.classList.add(this.options.shimmerClass)}applySpinnerLoading(e){const n=e,i=document.createElement("span");i.className="spinner-overlay",i.setAttribute("data-spinner-overlay","true");const s=document.createElement("span");s.className="inline-spinner",i.appendChild(s);const o=n.style.position;if(n.setAttribute("data-original-position",o||"static"),window.getComputedStyle(n).position==="static"&&(n.style.position="relative"),n.classList.add("spinner-loading-active"),n instanceof HTMLButtonElement||n instanceof HTMLAnchorElement){if(n instanceof HTMLButtonElement){const c=n.disabled;n.disabled=!0,n.setAttribute("data-was-disabled",String(c))}n.style.pointerEvents="none",n.setAttribute("data-original-pointer-events",window.getComputedStyle(n).pointerEvents)}e.appendChild(i)}removeSpinner(e){const n=e,i=e.querySelector("[data-spinner-overlay]");i&&i.remove(),n.classList.remove("spinner-loading-active");const s=e.getAttribute("data-original-position");if(s&&(n.style.position=s==="static"?"":s,e.removeAttribute("data-original-position")),n instanceof HTMLButtonElement){const a=e.getAttribute("data-was-disabled");n.disabled=a==="true",e.removeAttribute("data-was-disabled")}const o=e.getAttribute("data-original-pointer-events");o&&(n.style.pointerEvents=o==="auto"?"":o,e.removeAttribute("data-original-pointer-events"))}startGlobalLoading(e){document.querySelectorAll("[data-translate], [data-translate-placeholder], [data-translate-container], [data-section]").forEach(i=>{this.applyLoadingStyle(i,e)})}stopGlobalLoading(){Array.from(this.loadingElements.keys()).forEach(n=>{this.removeLoadingStyle(n)})}applyCustomLoading(e,n){document.querySelectorAll(e).forEach(s=>{this.applyLoadingStyle(s,n)})}removeCustomLoading(e){document.querySelectorAll(e).forEach(i=>{this.removeLoadingStyle(i)})}startSmartLoading(e){const n={headings:(e==null?void 0:e.headings)||"skeleton",paragraphs:(e==null?void 0:e.paragraphs)||"shimmer",buttons:(e==null?void 0:e.buttons)||"fade",inputs:(e==null?void 0:e.inputs)||"fade",default:(e==null?void 0:e.default)||"skeleton",container:(e==null?void 0:e.container)||"spinner"};document.querySelectorAll("h1[data-translate], h2[data-translate], h3[data-translate] h3[data-translate]").forEach(s=>this.applyLoadingStyle(s,n.headings)),document.querySelectorAll("p[data-translate], span[data-translate]:not(button span), a[data-translate]").forEach(s=>this.applyLoadingStyle(s,n.paragraphs)),document.querySelectorAll("button[data-translate]").forEach(s=>this.applyLoadingStyle(s,n.buttons)),document.querySelectorAll("button span[data-translate]").forEach(s=>this.applyLoadingStyle(s,n.buttons)),document.querySelectorAll("input[data-translate-placeholder], textarea[data-translate-placeholder]").forEach(s=>this.applyLoadingStyle(s,n.inputs)),document.querySelectorAll("div[data-translate-container], div[data-section]").forEach(s=>this.applyLoadingStyle(s,n.container)),document.querySelectorAll("[data-translate]").forEach(s=>{this.loadingElements.has(s)||this.applyLoadingStyle(s,n.default)})}injectStyles(){if(document.getElementById("smart-loading-styles"))return;const e=document.createElement("style");e.id="smart-loading-styles",e.textContent=`
620
620
  /* Skeleton Loading */
621
621
  .${this.options.skeletonClass} {
622
622
  position: relative;
@@ -750,7 +750,7 @@
750
750
  }
751
751
 
752
752
 
753
- `,document.head.appendChild(e)}isLoading(){return this.activeSections.size>0||this.loadingElements.size>0}getLoadingSections(){return Array.from(this.activeSections)}clearAll(){this.stopGlobalLoading(),this.activeSections.clear()}}const Rs=new ir({defaultStyle:"skeleton",fadeOpacity:.5}),Ae=(()=>{let t=navigator==null?void 0:navigator.language.split("-")[0].toLowerCase(),e=new Map,n=[],i=0,s=[],o=!1;const a=f=>{t!==f&&(t=f,o=!1,c())},c=()=>{n.forEach(f=>f(t))},l=()=>{s.forEach(f=>f(i>0))},m=f=>(n.push(f),()=>{n=n.filter(k=>k!==f)}),p=async(f,k=t,x="static")=>{if(o)return Array.isArray(f)?f:[f];if(k==="en"&&x==="static")return Array.isArray(f)?f:[f];i+=1,l();const M=Array.isArray(f)?`[${f.join("|")}]:${k}`:`${f}:${k}`;if(e.has(M))return i-=1,l(),e.get(M);try{const E=await za({text:f,target:k||"en"});return e.set(M,E.translatedText??(Array.isArray(f)?f:[f])),E.translatedText??(Array.isArray(f)?f:[f])}catch(E){return console.error("Translation failed:",E),a("en"),o=!0,Array.isArray(f)?f:[f]}finally{i-=1,l()}};return{setLanguage:a,getLanguage:()=>t,translate:p,translateRecord:async(f,k=t)=>{if(k==="en"||o)return f;const x=Object.keys(f),A=Object.values(f);return(await p(A,k)).reduce((D,F,W)=>(D[x[W]]=F,D),{})},subscribe:m,subscribeToLoading:f=>(s.push(f),()=>{s=s.filter(k=>k!==f)}),getIsLoading:()=>i>0,getTranslationError:()=>o}})(),mt=navigator==null?void 0:navigator.language.split("-")[0].toLowerCase();let Ns=mt;const nn=t=>{Ns=t},H=()=>Ns,sr=(t,e)=>{const n=Ni(t,e),i=n==null?void 0:n.language,s=Ae.getTranslationError();i&&i!==mt?nn(s?"en":mt):i&&i===mt?nn(i):!mt&&!i&&nn("en")},z=async(t,e)=>{const n=await Ae.translate(t,e,"dynamic");return typeof n=="string"?n:n[0]};let at=Ri;const Os=async t=>(at=await Ae.translateRecord(Ri,t),at);let q=Ls;const Us=async t=>{q=await Ae.translateRecord(Ls,t)};let P=Ts;const Vs=async t=>{P=await Ae.translateRecord(Ts,t)};let pe=_s;const Fs=async t=>{pe=await Ae.translateRecord(_s,t)};let $e=Es;const Ks=async t=>{$e=await Ae.translateRecord(Es,t)};let Ve=Ps;const Gs=async t=>{Ve=await Ae.translateRecord(Ps,t)};let Me=Is;const js=async t=>{Me=await Ae.translateRecord(Is,t)};let Mt=Ds;const zs=async t=>{Mt=await Ae.translateRecord(Ds,t)};let Fe=Hs;const qs=async t=>{Fe=await Ae.translateRecord(Hs,t)};let Lt=Bs;const Zs=async t=>{Lt=await Ae.translateRecord(Bs,t)};function Ws(t){if(t in q)return q[t];if(t in P)return P[t];if(t in at)return at[t];if(t in pe)return pe[t];if(t in $e)return $e[t];if(t in Ve)return Ve[t];if(t in Me)return Me[t];if(t in Mt)return Mt[t];if(t in Lt)return Lt[t];if(t in Fe)return Fe[t]}function Oi(){document.querySelectorAll("[data-translate]").forEach(t=>{const e=t.getAttribute("data-translate");if(!e)return;const n=Ws(e);n&&(t.textContent=n)}),document.querySelectorAll("[data-translate-placeholder]").forEach(t=>{const e=t.getAttribute("data-translate-placeholder");if(!e)return;const n=Ws(e);n&&(t.placeholder=n)})}Ae.subscribe(async t=>{Rs.startSmartLoading({});try{await Promise.all([Us(t),Vs(t),Os(t),(()=>{const e=or();if(e){if(e==="card")return Fs(t);e==="transfer"?Gs(t):e==="mobile_money"?js(t):e==="eft"?zs(t):e==="opay"?Zs(t):e==="test_cards"?Ks(t):e==="stablecoin"&&qs(t)}return Promise.resolve()})()]),Oi()}catch(e){console.error("Translation error:",e),Oi()}finally{Rs.stopGlobalLoading()}Oi()});function or(){const t=Array.from(document.querySelectorAll("[data-section]")).map(e=>e.dataset.section);for(const e of t)return e;return null}class Qs{constructor(e){d(this,"container");d(this,"onAction");d(this,"cardDetailsValues");d(this,"creditCardTypes");d(this,"merchantName");d(this,"currency");this.container=e.container,this.onAction=e.onAction,this.creditCardTypes=[...As],this.cardDetailsValues={number:"",expiry:"",cvv:"",name:""},this.merchantName=e.merchantName,this.currency=e.currency}attachListener(){const e=document.querySelector("#pci-dss");e&&e.classList.remove("hidden");const n=document.querySelector('input[name="number"]'),i=document.querySelector('input[name="expiry"]'),s=document.querySelector('input[name="cvv"]'),o=document.querySelector('input[name="name"]'),a=document.querySelector(".details-form-button"),c=document.querySelector("#checkoutcard"),l=this.container.querySelector("#enter-details-text"),m=this.container.querySelector("#certified-text"),p=this.container.querySelector("#card-confirmation-text-one"),y=this.container.querySelector("#card-confirmation-text-two");l&&(l.innerHTML=pe["enter-card-details"]),m&&(m.innerHTML=pe.certified),p&&(p.innerHTML=pe["card-confirmation-one"]),y&&(y.innerHTML=pe["card-confirmation-two"]),n&&(n.setAttribute("placeholder",pe["card-number"]),n.addEventListener("input",b=>this.handleInputChange(b,a))),i&&i.addEventListener("input",b=>this.handleInputChange(b,a)),s&&s.addEventListener("input",b=>this.handleInputChange(b,a)),o&&(o.setAttribute("placeholder",pe["card-holder-name"]),o.addEventListener("input",b=>this.handleInputChange(b,a))),c&&c.addEventListener("submit",b=>{var g,w,f;b.preventDefault(),this.onAction(b)({pan:Ja(this.cardDetailsValues.number),cvv:this.cardDetailsValues.cvv,expiryMonth:(g=this.cardDetailsValues)==null?void 0:g.expiry.split("/")[0].trim(),expiryYear:(w=this.cardDetailsValues)==null?void 0:w.expiry.split("/")[1].trim(),...this.currency==="ZAR"&&{cardHolderName:(f=this.cardDetailsValues)==null?void 0:f.name}})})}validateCreditCard(e){if(e=e.replace(/\D/g,""),!e||e.length===0||e.length<13||e.length>19)return!1;const n=e.split("").map(s=>parseInt(s,10));for(let s=n.length-2;s>=0;s-=2){let o=n[s]*2;o>9&&(o-=9),n[s]=o}return n.reduce((s,o)=>s+o,0)%10===0}handleInputChange(e,n){var c,l,m;const i=e.target,{name:s,value:o}=i;let a=o;if(o.trim()===""){this.emptyCardState(i,s);return}if(s==="number"){a=Ya(o);const p=a.replace(/\s+/g,""),y=this.validateCreditCard(p);this.filterCreditCardType(o);const b=(c=this.creditCardTypes[0])==null?void 0:c.name;b&&At.map(g=>{if(g.name===this.currency)if(g.cardTypes.includes(b)){const w=tr[b];if(w.length>1){const f=w.some(k=>p.length===k);this.checkInputValidity(y,i,f,"card-number-invalid")}else p.length===w[0]&&this.checkInputValidity(y,i,p.length>=14&&p.length<=19,"card-number-invalid")}else this.checkInputValidity(!1,i,o.trim().length>=14&&o.trim().length<=19,"invalid-issue-card")})}else if(s==="expiry"){const p=new Date;a=$a(o);const y=a.split("/"),b=(l=y[0])==null?void 0:l.trim(),g=(m=y[1])==null?void 0:m.trim(),w=new Date().getFullYear()%100,f=p.getMonth()+1;let k=!0;(parseInt(g)===w&&parseInt(b)<f||parseInt(g)<w)&&(k=!1),(g==null?void 0:g.length)===2&&this.checkInputValidity(k,i,y.join("").length===4,"card-expired")}else s==="cvv"?a=Xa(o):s==="name"&&(a=o);if(this.cardDetailsValues={...this.cardDetailsValues,[s]:a},i.value=a,this.validateCard())n&&n.removeAttribute("disabled");else if(n){if(n.disabled)return;n.setAttribute("disabled","")}}hideCardHolderInput(){const e=document.querySelector("#card-name");this.currency==="ZAR"?e&&(e.style.display="block"):e&&(e.style.display="none")}validateCard(){if(this.cardDetailsValues.expiry.split("/").length===2){const e=this.cardDetailsValues.expiry.split("/")[1].trim();return!!this.cardDetailsValues.number&&this.cardDetailsValues.number.length>15&&!!this.cardDetailsValues.expiry&&this.cardDetailsValues.expiry.length>3&&!!this.cardDetailsValues.cvv&&this.cardDetailsValues.cvv.length>2&&e.length===2&&(this.currency==="ZAR"?this.cardDetailsValues.name.trim()!=="":!0)}}displayCardTypes(){requestAnimationFrame(()=>{const e=this.container.querySelector("#card-type");e.innerHTML="",this.creditCardTypes.length>0?this.creditCardTypes.forEach(n=>{const i=document.createElement("div");i.classList.add("card-type"),i.innerHTML=n.icon,e.appendChild(i)}):e.innerHTML=`<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg">
753
+ `,document.head.appendChild(e)}isLoading(){return this.activeSections.size>0||this.loadingElements.size>0}getLoadingSections(){return Array.from(this.activeSections)}clearAll(){this.stopGlobalLoading(),this.activeSections.clear()}}const Rs=new ir({defaultStyle:"skeleton",fadeOpacity:.5}),Ae=(()=>{let t=navigator==null?void 0:navigator.language.split("-")[0].toLowerCase(),e=new Map,n=[],i=0,s=[],o=!1;const a=f=>{t!==f&&(t=f,o=!1,c())},c=()=>{n.forEach(f=>f(t))},l=()=>{s.forEach(f=>f(i>0))},m=f=>(n.push(f),()=>{n=n.filter(k=>k!==f)}),p=async(f,k=t,x="static")=>{if(o)return Array.isArray(f)?f:[f];if(k==="en"&&x==="static")return Array.isArray(f)?f:[f];i+=1,l();const M=Array.isArray(f)?`[${f.join("|")}]:${k}`:`${f}:${k}`;if(e.has(M))return i-=1,l(),e.get(M);try{const E=await za({text:f,target:k||"en"});return e.set(M,E.translatedText??(Array.isArray(f)?f:[f])),E.translatedText??(Array.isArray(f)?f:[f])}catch(E){return console.error("Translation failed:",E),a("en"),o=!0,Array.isArray(f)?f:[f]}finally{i-=1,l()}};return{setLanguage:a,getLanguage:()=>t,translate:p,translateRecord:async(f,k=t)=>{if(k==="en"||o)return f;const x=Object.keys(f),A=Object.values(f);return(await p(A,k)).reduce((D,F,W)=>(D[x[W]]=F,D),{})},subscribe:m,subscribeToLoading:f=>(s.push(f),()=>{s=s.filter(k=>k!==f)}),getIsLoading:()=>i>0,getTranslationError:()=>o}})(),mt=navigator==null?void 0:navigator.language.split("-")[0].toLowerCase();let Ns=mt;const nn=t=>{Ns=t},H=()=>Ns,sr=(t,e)=>{const n=Ni(t,e),i=n==null?void 0:n.language,s=Ae.getTranslationError();i&&i!==mt?nn(s?"en":mt):i&&i===mt?nn(i):!mt&&!i&&nn("en")},z=async(t,e)=>{const n=await Ae.translate(t,e,"dynamic");return typeof n=="string"?n:n[0]};let at=Ri;const Os=async t=>(at=await Ae.translateRecord(Ri,t),at);let q=Ls;const Us=async t=>{q=await Ae.translateRecord(Ls,t)};let P=Ts;const Vs=async t=>{P=await Ae.translateRecord(Ts,t)};let pe=_s;const Fs=async t=>{pe=await Ae.translateRecord(_s,t)};let $e=Es;const Ks=async t=>{$e=await Ae.translateRecord(Es,t)};let Pe=Ps;const Gs=async t=>{Pe=await Ae.translateRecord(Ps,t)};let Me=Is;const js=async t=>{Me=await Ae.translateRecord(Is,t)};let Mt=Ds;const zs=async t=>{Mt=await Ae.translateRecord(Ds,t)};let Fe=Hs;const qs=async t=>{Fe=await Ae.translateRecord(Hs,t)};let Lt=Bs;const Zs=async t=>{Lt=await Ae.translateRecord(Bs,t)};function Ws(t){if(t in q)return q[t];if(t in P)return P[t];if(t in at)return at[t];if(t in pe)return pe[t];if(t in $e)return $e[t];if(t in Pe)return Pe[t];if(t in Me)return Me[t];if(t in Mt)return Mt[t];if(t in Lt)return Lt[t];if(t in Fe)return Fe[t]}function Oi(){document.querySelectorAll("[data-translate]").forEach(t=>{const e=t.getAttribute("data-translate");if(!e)return;const n=Ws(e);n&&(t.textContent=n)}),document.querySelectorAll("[data-translate-placeholder]").forEach(t=>{const e=t.getAttribute("data-translate-placeholder");if(!e)return;const n=Ws(e);n&&(t.placeholder=n)})}Ae.subscribe(async t=>{Rs.startSmartLoading({});try{await Promise.all([Us(t),Vs(t),Os(t),(()=>{const e=or();if(e){if(e==="card")return Fs(t);e==="transfer"?Gs(t):e==="mobile_money"?js(t):e==="eft"?zs(t):e==="opay"?Zs(t):e==="test_cards"?Ks(t):e==="stablecoin"&&qs(t)}return Promise.resolve()})()]),Oi()}catch(e){console.error("Translation error:",e),Oi()}finally{Rs.stopGlobalLoading()}Oi()});function or(){const t=Array.from(document.querySelectorAll("[data-section]")).map(e=>e.dataset.section);for(const e of t)return e;return null}class Qs{constructor(e){d(this,"container");d(this,"onAction");d(this,"cardDetailsValues");d(this,"creditCardTypes");d(this,"merchantName");d(this,"currency");this.container=e.container,this.onAction=e.onAction,this.creditCardTypes=[...As],this.cardDetailsValues={number:"",expiry:"",cvv:"",name:""},this.merchantName=e.merchantName,this.currency=e.currency}attachListener(){const e=document.querySelector("#pci-dss");e&&e.classList.remove("hidden");const n=document.querySelector('input[name="number"]'),i=document.querySelector('input[name="expiry"]'),s=document.querySelector('input[name="cvv"]'),o=document.querySelector('input[name="name"]'),a=document.querySelector(".details-form-button"),c=document.querySelector("#checkoutcard"),l=this.container.querySelector("#enter-details-text"),m=this.container.querySelector("#certified-text"),p=this.container.querySelector("#card-confirmation-text-one"),y=this.container.querySelector("#card-confirmation-text-two");l&&(l.innerHTML=pe["enter-card-details"]),m&&(m.innerHTML=pe.certified),p&&(p.innerHTML=pe["card-confirmation-one"]),y&&(y.innerHTML=pe["card-confirmation-two"]),n&&(n.setAttribute("placeholder",pe["card-number"]),n.addEventListener("input",b=>this.handleInputChange(b,a))),i&&i.addEventListener("input",b=>this.handleInputChange(b,a)),s&&s.addEventListener("input",b=>this.handleInputChange(b,a)),o&&(o.setAttribute("placeholder",pe["card-holder-name"]),o.addEventListener("input",b=>this.handleInputChange(b,a))),c&&c.addEventListener("submit",b=>{var g,w,f;b.preventDefault(),this.onAction(b)({pan:Ja(this.cardDetailsValues.number),cvv:this.cardDetailsValues.cvv,expiryMonth:(g=this.cardDetailsValues)==null?void 0:g.expiry.split("/")[0].trim(),expiryYear:(w=this.cardDetailsValues)==null?void 0:w.expiry.split("/")[1].trim(),...this.currency==="ZAR"&&{cardHolderName:(f=this.cardDetailsValues)==null?void 0:f.name}})})}validateCreditCard(e){if(e=e.replace(/\D/g,""),!e||e.length===0||e.length<13||e.length>19)return!1;const n=e.split("").map(s=>parseInt(s,10));for(let s=n.length-2;s>=0;s-=2){let o=n[s]*2;o>9&&(o-=9),n[s]=o}return n.reduce((s,o)=>s+o,0)%10===0}handleInputChange(e,n){var c,l,m;const i=e.target,{name:s,value:o}=i;let a=o;if(o.trim()===""){this.emptyCardState(i,s);return}if(s==="number"){a=Ya(o);const p=a.replace(/\s+/g,""),y=this.validateCreditCard(p);this.filterCreditCardType(o);const b=(c=this.creditCardTypes[0])==null?void 0:c.name;b&&At.map(g=>{if(g.name===this.currency)if(g.cardTypes.includes(b)){const w=tr[b];if(w.length>1){const f=w.some(k=>p.length===k);this.checkInputValidity(y,i,f,"card-number-invalid")}else p.length===w[0]&&this.checkInputValidity(y,i,p.length>=14&&p.length<=19,"card-number-invalid")}else this.checkInputValidity(!1,i,o.trim().length>=14&&o.trim().length<=19,"invalid-issue-card")})}else if(s==="expiry"){const p=new Date;a=$a(o);const y=a.split("/"),b=(l=y[0])==null?void 0:l.trim(),g=(m=y[1])==null?void 0:m.trim(),w=new Date().getFullYear()%100,f=p.getMonth()+1;let k=!0;(parseInt(g)===w&&parseInt(b)<f||parseInt(g)<w)&&(k=!1),(g==null?void 0:g.length)===2&&this.checkInputValidity(k,i,y.join("").length===4,"card-expired")}else s==="cvv"?a=Xa(o):s==="name"&&(a=o);if(this.cardDetailsValues={...this.cardDetailsValues,[s]:a},i.value=a,this.validateCard())n&&n.removeAttribute("disabled");else if(n){if(n.disabled)return;n.setAttribute("disabled","")}}hideCardHolderInput(){const e=document.querySelector("#card-name");this.currency==="ZAR"?e&&(e.style.display="block"):e&&(e.style.display="none")}validateCard(){if(this.cardDetailsValues.expiry.split("/").length===2){const e=this.cardDetailsValues.expiry.split("/")[1].trim();return!!this.cardDetailsValues.number&&this.cardDetailsValues.number.length>15&&!!this.cardDetailsValues.expiry&&this.cardDetailsValues.expiry.length>3&&!!this.cardDetailsValues.cvv&&this.cardDetailsValues.cvv.length>2&&e.length===2&&(this.currency==="ZAR"?this.cardDetailsValues.name.trim()!=="":!0)}}displayCardTypes(){requestAnimationFrame(()=>{const e=this.container.querySelector("#card-type");e.innerHTML="",this.creditCardTypes.length>0?this.creditCardTypes.forEach(n=>{const i=document.createElement("div");i.classList.add("card-type"),i.innerHTML=n.icon,e.appendChild(i)}):e.innerHTML=`<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg">
754
754
  <path
755
755
  d="M24.5827 6.33333V14.6667C24.5827 14.8877 24.4554 15.0996 24.2288 15.2559C24.0022 15.4122 23.6948 15.5 23.3743 15.5H1.62435C1.30388 15.5 0.996535 15.4122 0.769928 15.2559C0.543322 15.0996 0.416016 14.8877 0.416016 14.6667V6.33333H24.5827ZM24.5827 4.66667H0.416016V1.33333C0.416016 1.11232 0.543322 0.900358 0.769928 0.744078C0.996535 0.587797 1.30388 0.5 1.62435 0.5H23.3743C23.6948 0.5 24.0022 0.587797 24.2288 0.744078C24.4554 0.900358 24.5827 1.11232 24.5827 1.33333V4.66667ZM16.1243 11.3333V13H20.9577V11.3333H16.1243Z"
756
756
  fill="#B6B4B9" />
@@ -1195,7 +1195,7 @@
1195
1195
  stroke-linejoin="round" />
1196
1196
  </svg>`),g.innerHTML=`<span class="bg-primary text-white text-sm font-semibold py-2 px-3 rounded-md" id="upload-btn-text">
1197
1197
  Upload
1198
- </span>`,p&&(p.textContent="Tap to Upload"),y&&(y.textContent="PDF, PNG, JPG | 10MB max."))})}else return}),f&&f.addEventListener("submit",A=>{var E;A.preventDefault();const{reason:M}=this.formValues;this.onAction({transactionReference:(E=this.paymentResponse)==null?void 0:E.reference,reportingReason:M,disputeSource:"CUSTOMER",supportingDocuments:this.documents})})}handleInputChange(e,n){const i=e.target,{name:s,value:o}=i;if(this.formValues={...this.formValues,[s]:o},this.validateForm())n&&n.removeAttribute("disabled");else if(n){if(n.disabled)return;n.setAttribute("disabled","")}}validateForm(){return Object.values(this.formValues).every(n=>!!n)}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return fr}}function Pe(t,e,n){const s=e.get("spf-redirect-url")||n;s&&setTimeout(()=>{const o=new URL(s);o.searchParams.append("status",t.status),o.searchParams.append("reference",t.reference),window.location.href=o.toString()},1800)}class sn{constructor(e){d(this,"container");d(this,"transactionIssuesForm");d(this,"_currentStep");d(this,"onAction");d(this,"url");d(this,"token");d(this,"rdtCode");d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"callbackUrl");this.container=e.container,this._currentStep=1,this.onAction=e.onAction,this.url=e.url||"",this.token=e.token,this.rdtCode=e.rdtCode||"",this.paymentResponse=e.paymentResponse,this.paymentResponseHeaders=e.paymentResponseHeaders,this.callbackUrl=e.callBackUrl}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderTransactionIssuesComponent()}attachListener(){const e=this.container.querySelector("#back"),n=document.querySelector("#main-header"),i=document.querySelector("#main-content"),s=document.querySelector("#main-footer");e&&e.addEventListener("click",()=>{this.onAction(),n.style.display="block",i.classList.add("box-container"),s.style.display="block"})}uploadEvidenceFile(e){const n=new FormData;return n.append("file",e),Fa(this.token,n,this.rdtCode,this.url).then(i=>({message:"Upload successfully",status:"success",url:i.data})).catch(i=>({message:"Error uploading file. Please try again",status:"error",url:""}))}submitDisputeForm(e){Ka(this.token,e,this.rdtCode,this.url).then(i=>{this.container.innerHTML=this.renderSuccessComponent();const s=document.querySelector("#go-back-merchant");s&&s.addEventListener("click",()=>{Pe(this.paymentResponse,this.paymentResponseHeaders,this.callbackUrl)})}).catch(i=>{this.container.innerHTML=this.renderErrorComponent();const s=document.querySelector("#go-back-merchant");s&&s.addEventListener("click",()=>{Pe(this.paymentResponse,this.paymentResponseHeaders,this.callbackUrl)})})}renderSuccessComponent(){return`<div id="paymentSuccess">
1198
+ </span>`,p&&(p.textContent="Tap to Upload"),y&&(y.textContent="PDF, PNG, JPG | 10MB max."))})}else return}),f&&f.addEventListener("submit",A=>{var E;A.preventDefault();const{reason:M}=this.formValues;this.onAction({transactionReference:(E=this.paymentResponse)==null?void 0:E.reference,reportingReason:M,disputeSource:"CUSTOMER",supportingDocuments:this.documents})})}handleInputChange(e,n){const i=e.target,{name:s,value:o}=i;if(this.formValues={...this.formValues,[s]:o},this.validateForm())n&&n.removeAttribute("disabled");else if(n){if(n.disabled)return;n.setAttribute("disabled","")}}validateForm(){return Object.values(this.formValues).every(n=>!!n)}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return fr}}function Ie(t,e,n){const s=e.get("spf-redirect-url")||n;s&&setTimeout(()=>{const o=new URL(s);o.searchParams.append("status",t.status),o.searchParams.append("reference",t.reference),window.location.href=o.toString()},1800)}class sn{constructor(e){d(this,"container");d(this,"transactionIssuesForm");d(this,"_currentStep");d(this,"onAction");d(this,"url");d(this,"token");d(this,"rdtCode");d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"callbackUrl");this.container=e.container,this._currentStep=1,this.onAction=e.onAction,this.url=e.url||"",this.token=e.token,this.rdtCode=e.rdtCode||"",this.paymentResponse=e.paymentResponse,this.paymentResponseHeaders=e.paymentResponseHeaders,this.callbackUrl=e.callBackUrl}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderTransactionIssuesComponent()}attachListener(){const e=this.container.querySelector("#back"),n=document.querySelector("#main-header"),i=document.querySelector("#main-content"),s=document.querySelector("#main-footer");e&&e.addEventListener("click",()=>{this.onAction(),n.style.display="block",i.classList.add("box-container"),s.style.display="block"})}uploadEvidenceFile(e){const n=new FormData;return n.append("file",e),Fa(this.token,n,this.rdtCode,this.url).then(i=>({message:"Upload successfully",status:"success",url:i.data})).catch(i=>({message:"Error uploading file. Please try again",status:"error",url:""}))}submitDisputeForm(e){Ka(this.token,e,this.rdtCode,this.url).then(i=>{this.container.innerHTML=this.renderSuccessComponent();const s=document.querySelector("#go-back-merchant");s&&s.addEventListener("click",()=>{Ie(this.paymentResponse,this.paymentResponseHeaders,this.callbackUrl)})}).catch(i=>{this.container.innerHTML=this.renderErrorComponent();const s=document.querySelector("#go-back-merchant");s&&s.addEventListener("click",()=>{Ie(this.paymentResponse,this.paymentResponseHeaders,this.callbackUrl)})})}renderSuccessComponent(){return`<div id="paymentSuccess">
1199
1199
  <div class="container-center min-h-[40dvh]">
1200
1200
  <div>
1201
1201
  <div class="container-center mb-5">
@@ -1236,9 +1236,9 @@
1236
1236
 
1237
1237
  </div>
1238
1238
  </div>
1239
- </div>`}renderTransactionIssuesComponent(){const e=document.querySelector("#main-header"),n=document.querySelector("#main-content"),i=document.querySelector("#main-footer");switch(e&&(e.style.display="none"),n&&n.classList.remove("box-container"),i&&(i.style.display="none"),this.currentStep){case 1:this.transactionIssuesForm=new gr({container:this.container,uploadEvidenceFile:this.uploadEvidenceFile.bind(this),onAction:this.submitDisputeForm.bind(this),paymentResponse:this.paymentResponse}),this.transactionIssuesForm.renderComponent();break}this.attachListener()}}var ve;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(ve||(ve={}));function yr(t){return t.nodeType===t.ELEMENT_NODE}function kn(t){const e=t==null?void 0:t.host;return(e==null?void 0:e.shadowRoot)===t}function Sn(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function Cr(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t}function wr(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return t.layerName===""?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}function Fn(t){try{const e=t.rules||t.cssRules;return e?Cr(Array.from(e,Ys).join("")):null}catch{return null}}function Ys(t){let e;if(Sr(t))try{e=Fn(t.styleSheet)||wr(t)}catch{}else if(xr(t)&&t.selectorText.includes(":"))return kr(t.cssText);return e||t.cssText}function kr(t){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function Sr(t){return"styleSheet"in t}function xr(t){return"selectorText"in t}class Xs{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var n;if(!e)return-1;const i=(n=this.getMeta(e))===null||n===void 0?void 0:n.id;return i??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(i=>this.removeNodeFromMap(i))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){const i=n.id;this.idNodeMap.set(i,e),this.nodeMetaMap.set(e,n)}replace(e,n){const i=this.getNode(e);if(i){const s=this.nodeMetaMap.get(i);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Ar(){return new Xs}function Ui({element:t,maskInputOptions:e,tagName:n,type:i,value:s,maskInputFn:o}){let a=s||"";const c=i&&Ft(i);return(e[n.toLowerCase()]||c&&e[c])&&(o?a=o(a,t):a="*".repeat(a.length)),a}function Ft(t){return t.toLowerCase()}const $s="__rrweb_original__";function Mr(t){const e=t.getContext("2d");if(!e)return!0;const n=50;for(let i=0;i<t.width;i+=n)for(let s=0;s<t.height;s+=n){const o=e.getImageData,a=$s in o?o[$s]:o;if(new Uint32Array(a.call(e,i,s,Math.min(n,t.width-i),Math.min(n,t.height-s)).data.buffer).some(l=>l!==0))return!1}return!0}function Vi(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Ft(e):null}function eo(t,e){var n;let i;try{i=new URL(t,e??window.location.href)}catch{return null}const s=/\.([0-9a-z]+)(?:$)/i,o=i.pathname.match(s);return(n=o==null?void 0:o[1])!==null&&n!==void 0?n:null}let Lr=1;const Tr=new RegExp("[^a-z0-9-_:]"),xn=-2;function to(){return Lr++}function _r(t){if(t instanceof HTMLFormElement)return"form";const e=Ft(t.tagName);return Tr.test(e)?"div":e}function Er(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}let on,no;const Pr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ir=/^(?:[a-z+]+:)?\/\//i,Dr=/^www\..*/i,Br=/^(data:)([^,]*),(.*)/i;function Kn(t,e){return(t||"").replace(Pr,(n,i,s,o,a,c)=>{const l=s||a||c,m=i||o||"";if(!l)return n;if(Ir.test(l)||Dr.test(l))return`url(${m}${l}${m})`;if(Br.test(l))return`url(${m}${l}${m})`;if(l[0]==="/")return`url(${m}${Er(e)+l}${m})`;const p=e.split("/"),y=l.split("/");p.pop();for(const b of y)b!=="."&&(b===".."?p.pop():p.push(b));return`url(${m}${p.join("/")}${m})`})}const Hr=/^[^ \t\n\r\u000c]+/,Rr=/^[, \t\n\r\u000c]+/;function Nr(t,e){if(e.trim()==="")return e;let n=0;function i(o){let a;const c=o.exec(e.substring(n));return c?(a=c[0],n+=a.length,a):""}const s=[];for(;i(Rr),!(n>=e.length);){let o=i(Hr);if(o.slice(-1)===",")o=an(t,o.substring(0,o.length-1)),s.push(o);else{let a="";o=an(t,o);let c=!1;for(;;){const l=e.charAt(n);if(l===""){s.push((o+a).trim());break}else if(c)l===")"&&(c=!1);else if(l===","){n+=1,s.push((o+a).trim());break}else l==="("&&(c=!0);a+=l,n+=1}}}return s.join(", ")}function an(t,e){if(!e||e.trim()==="")return e;const n=t.createElement("a");return n.href=e,n.href}function Or(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function Fi(){const t=document.createElement("a");return t.href="",t.href}function io(t,e,n,i){return i&&(n==="src"||n==="href"&&!(e==="use"&&i[0]==="#")||n==="xlink:href"&&i[0]!=="#"||n==="background"&&(e==="table"||e==="td"||e==="th")?an(t,i):n==="srcset"?Nr(t,i):n==="style"?Kn(i,Fi()):e==="object"&&n==="data"?an(t,i):i)}function so(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function Ur(t,e,n){try{if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(let i=t.classList.length;i--;){const s=t.classList[i];if(e.test(s))return!0}if(n)return t.matches(n)}catch{}return!1}function Gn(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return n?Gn(t.parentNode,e,n):!1;for(let i=t.classList.length;i--;){const s=t.classList[i];if(e.test(s))return!0}return n?Gn(t.parentNode,e,n):!1}function oo(t,e,n,i){try{const s=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(s===null)return!1;if(typeof e=="string"){if(i){if(s.closest(`.${e}`))return!0}else if(s.classList.contains(e))return!0}else if(Gn(s,e,i))return!0;if(n){if(i){if(s.closest(n))return!0}else if(s.matches(n))return!0}}catch{}return!1}function Vr(t,e,n){const i=t.contentWindow;if(!i)return;let s=!1,o;try{o=i.document.readyState}catch{return}if(o!=="complete"){const c=setTimeout(()=>{s||(e(),s=!0)},n);t.addEventListener("load",()=>{clearTimeout(c),s=!0,e()});return}const a="about:blank";if(i.location.href!==a||t.src===a||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function Fr(t,e,n){let i=!1,s;try{s=t.sheet}catch{return}if(s)return;const o=setTimeout(()=>{i||(e(),i=!0)},n);t.addEventListener("load",()=>{clearTimeout(o),i=!0,e()})}function Kr(t,e){const{doc:n,mirror:i,blockClass:s,blockSelector:o,needsMask:a,inlineStylesheet:c,maskInputOptions:l={},maskTextFn:m,maskInputFn:p,dataURLOptions:y={},inlineImages:b,recordCanvas:g,keepIframeSrcFn:w,newlyAddedElement:f=!1}=e,k=Gr(n,i);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:ve.Document,childNodes:[],compatMode:t.compatMode}:{type:ve.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:ve.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return zr(t,{doc:n,blockClass:s,blockSelector:o,inlineStylesheet:c,maskInputOptions:l,maskInputFn:p,dataURLOptions:y,inlineImages:b,recordCanvas:g,keepIframeSrcFn:w,newlyAddedElement:f,rootId:k});case t.TEXT_NODE:return jr(t,{needsMask:a,maskTextFn:m,rootId:k});case t.CDATA_SECTION_NODE:return{type:ve.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:ve.Comment,textContent:t.textContent||"",rootId:k};default:return!1}}function Gr(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return n===1?void 0:n}function jr(t,e){var n;const{needsMask:i,maskTextFn:s,rootId:o}=e,a=t.parentNode&&t.parentNode.tagName;let c=t.textContent;const l=a==="STYLE"?!0:void 0,m=a==="SCRIPT"?!0:void 0;if(l&&c){try{t.nextSibling||t.previousSibling||!((n=t.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(c=Fn(t.parentNode.sheet))}catch(p){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${p}`,t)}c=Kn(c,Fi())}return m&&(c="SCRIPT_PLACEHOLDER"),!l&&!m&&c&&i&&(c=s?s(c,t.parentElement):c.replace(/[\S]/g,"*")),{type:ve.Text,textContent:c||"",isStyle:l,rootId:o}}function zr(t,e){const{doc:n,blockClass:i,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:c,dataURLOptions:l={},inlineImages:m,recordCanvas:p,keepIframeSrcFn:y,newlyAddedElement:b=!1,rootId:g}=e,w=Ur(t,i,s),f=_r(t);let k={};const x=t.attributes.length;for(let M=0;M<x;M++){const E=t.attributes[M];so(f,E.name,E.value)||(k[E.name]=io(n,f,Ft(E.name),E.value))}if(f==="link"&&o){const M=Array.from(n.styleSheets).find(D=>D.href===t.href);let E=null;M&&(E=Fn(M)),E&&(delete k.rel,delete k.href,k._cssText=Kn(E,M.href))}if(f==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const M=Fn(t.sheet);M&&(k._cssText=Kn(M,Fi()))}if(f==="input"||f==="textarea"||f==="select"){const M=t.value,E=t.checked;k.type!=="radio"&&k.type!=="checkbox"&&k.type!=="submit"&&k.type!=="button"&&M?k.value=Ui({element:t,type:Vi(t),tagName:f,value:M,maskInputOptions:a,maskInputFn:c}):E&&(k.checked=E)}if(f==="option"&&(t.selected&&!a.select?k.selected=!0:delete k.selected),f==="canvas"&&p){if(t.__context==="2d")Mr(t)||(k.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){const M=t.toDataURL(l.type,l.quality),E=document.createElement("canvas");E.width=t.width,E.height=t.height;const D=E.toDataURL(l.type,l.quality);M!==D&&(k.rr_dataURL=M)}}if(f==="img"&&m){on||(on=n.createElement("canvas"),no=on.getContext("2d"));const M=t,E=M.crossOrigin;M.crossOrigin="anonymous";const D=()=>{M.removeEventListener("load",D);try{on.width=M.naturalWidth,on.height=M.naturalHeight,no.drawImage(M,0,0),k.rr_dataURL=on.toDataURL(l.type,l.quality)}catch(F){console.warn(`Cannot inline img src=${M.currentSrc}! Error: ${F}`)}E?k.crossOrigin=E:M.removeAttribute("crossorigin")};M.complete&&M.naturalWidth!==0?D():M.addEventListener("load",D)}if(f==="audio"||f==="video"){const M=k;M.rr_mediaState=t.paused?"paused":"played",M.rr_mediaCurrentTime=t.currentTime,M.rr_mediaPlaybackRate=t.playbackRate,M.rr_mediaMuted=t.muted,M.rr_mediaLoop=t.loop,M.rr_mediaVolume=t.volume}if(b||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),w){const{width:M,height:E}=t.getBoundingClientRect();k={class:k.class,rr_width:`${M}px`,rr_height:`${E}px`}}f==="iframe"&&!y(k.src)&&(t.contentDocument||(k.rr_src=k.src),delete k.src);let A;try{customElements.get(f)&&(A=!0)}catch{}return{type:ve.Element,tagName:f,attributes:k,childNodes:[],isSVG:Or(t)||void 0,needBlock:w,rootId:g,isCustom:A}}function ae(t){return t==null?"":t.toLowerCase()}function qr(t,e){if(e.comment&&t.type===ve.Comment)return!0;if(t.type===ve.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")&&t.attributes.as==="script"||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&eo(t.attributes.href)==="js"))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(ae(t.attributes.name).match(/^msapplication-tile(image|color)$/)||ae(t.attributes.name)==="application-name"||ae(t.attributes.rel)==="icon"||ae(t.attributes.rel)==="apple-touch-icon"||ae(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&ae(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ae(t.attributes.property).match(/^(og|twitter|fb):/)||ae(t.attributes.name).match(/^(og|twitter):/)||ae(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(ae(t.attributes.name)==="robots"||ae(t.attributes.name)==="googlebot"||ae(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(ae(t.attributes.name)==="author"||ae(t.attributes.name)==="generator"||ae(t.attributes.name)==="framework"||ae(t.attributes.name)==="publisher"||ae(t.attributes.name)==="progid"||ae(t.attributes.property).match(/^article:/)||ae(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(ae(t.attributes.name)==="google-site-verification"||ae(t.attributes.name)==="yandex-verification"||ae(t.attributes.name)==="csrf-token"||ae(t.attributes.name)==="p:domain_verify"||ae(t.attributes.name)==="verify-v1"||ae(t.attributes.name)==="verification"||ae(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function rn(t,e){const{doc:n,mirror:i,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,skipChild:l=!1,inlineStylesheet:m=!0,maskInputOptions:p={},maskTextFn:y,maskInputFn:b,slimDOMOptions:g,dataURLOptions:w={},inlineImages:f=!1,recordCanvas:k=!1,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M=5e3,onStylesheetLoad:E,stylesheetLoadTimeout:D=5e3,keepIframeSrcFn:F=()=>!1,newlyAddedElement:W=!1}=e;let{needsMask:G}=e,{preserveWhiteSpace:Q=!0}=e;!G&&t.childNodes&&(G=oo(t,a,c,G===void 0));const de=Kr(t,{doc:n,mirror:i,blockClass:s,blockSelector:o,needsMask:G,inlineStylesheet:m,maskInputOptions:p,maskTextFn:y,maskInputFn:b,dataURLOptions:w,inlineImages:f,recordCanvas:k,keepIframeSrcFn:F,newlyAddedElement:W});if(!de)return console.warn(t,"not serialized"),null;let _e;i.hasNode(t)?_e=i.getId(t):qr(de,g)||!Q&&de.type===ve.Text&&!de.isStyle&&!de.textContent.replace(/^\s+|\s+$/gm,"").length?_e=xn:_e=to();const j=Object.assign(de,{id:_e});if(i.add(t,j),_e===xn)return null;x&&x(t);let Oe=!l;if(j.type===ve.Element){Oe=Oe&&!j.needBlock,delete j.needBlock;const ge=t.shadowRoot;ge&&Sn(ge)&&(j.isShadowHost=!0)}if((j.type===ve.Document||j.type===ve.Element)&&Oe){g.headWhitespace&&j.type===ve.Element&&j.tagName==="head"&&(Q=!1);const ge={doc:n,mirror:i,blockClass:s,blockSelector:o,needsMask:G,maskTextClass:a,maskTextSelector:c,skipChild:l,inlineStylesheet:m,maskInputOptions:p,maskTextFn:y,maskInputFn:b,slimDOMOptions:g,dataURLOptions:w,inlineImages:f,recordCanvas:k,preserveWhiteSpace:Q,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:F};if(!(j.type===ve.Element&&j.tagName==="textarea"&&j.attributes.value!==void 0))for(const Ge of Array.from(t.childNodes)){const Se=rn(Ge,ge);Se&&j.childNodes.push(Se)}if(yr(t)&&t.shadowRoot)for(const Ge of Array.from(t.shadowRoot.childNodes)){const Se=rn(Ge,ge);Se&&(Sn(t.shadowRoot)&&(Se.isShadow=!0),j.childNodes.push(Se))}}return t.parentNode&&kn(t.parentNode)&&Sn(t.parentNode)&&(j.isShadow=!0),j.type===ve.Element&&j.tagName==="iframe"&&Vr(t,()=>{const ge=t.contentDocument;if(ge&&A){const Ge=rn(ge,{doc:ge,mirror:i,blockClass:s,blockSelector:o,needsMask:G,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:m,maskInputOptions:p,maskTextFn:y,maskInputFn:b,slimDOMOptions:g,dataURLOptions:w,inlineImages:f,recordCanvas:k,preserveWhiteSpace:Q,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:F});Ge&&A(t,Ge)}},M),j.type===ve.Element&&j.tagName==="link"&&typeof j.attributes.rel=="string"&&(j.attributes.rel==="stylesheet"||j.attributes.rel==="preload"&&typeof j.attributes.href=="string"&&eo(j.attributes.href)==="css")&&Fr(t,()=>{if(E){const ge=rn(t,{doc:n,mirror:i,blockClass:s,blockSelector:o,needsMask:G,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:m,maskInputOptions:p,maskTextFn:y,maskInputFn:b,slimDOMOptions:g,dataURLOptions:w,inlineImages:f,recordCanvas:k,preserveWhiteSpace:Q,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:F});ge&&E(t,ge)}},D),j}function Zr(t,e){const{mirror:n=new Xs,blockClass:i="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:c=!0,inlineImages:l=!1,recordCanvas:m=!1,maskAllInputs:p=!1,maskTextFn:y,maskInputFn:b,slimDOM:g=!1,dataURLOptions:w,preserveWhiteSpace:f,onSerialize:k,onIframeLoad:x,iframeLoadTimeout:A,onStylesheetLoad:M,stylesheetLoadTimeout:E,keepIframeSrcFn:D=()=>!1}=e||{};return rn(t,{doc:t,mirror:n,blockClass:i,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p===!1?{password:!0}:p,maskTextFn:y,maskInputFn:b,slimDOMOptions:g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:g==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:g===!1?{}:g,dataURLOptions:w,inlineImages:l,recordCanvas:m,preserveWhiteSpace:f,onSerialize:k,onIframeLoad:x,iframeLoadTimeout:A,onStylesheetLoad:M,stylesheetLoadTimeout:E,keepIframeSrcFn:D,newlyAddedElement:!1})}function Re(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>n.removeEventListener(t,e,i)}const ln=`Please stop import mirror directly. Instead of that,\r
1239
+ </div>`}renderTransactionIssuesComponent(){const e=document.querySelector("#main-header"),n=document.querySelector("#main-content"),i=document.querySelector("#main-footer");switch(e&&(e.style.display="none"),n&&n.classList.remove("box-container"),i&&(i.style.display="none"),this.currentStep){case 1:this.transactionIssuesForm=new gr({container:this.container,uploadEvidenceFile:this.uploadEvidenceFile.bind(this),onAction:this.submitDisputeForm.bind(this),paymentResponse:this.paymentResponse}),this.transactionIssuesForm.renderComponent();break}this.attachListener()}}var ve;(function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"})(ve||(ve={}));function yr(t){return t.nodeType===t.ELEMENT_NODE}function kn(t){const e=t==null?void 0:t.host;return(e==null?void 0:e.shadowRoot)===t}function Sn(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function Cr(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t}function wr(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return t.layerName===""?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}function Fn(t){try{const e=t.rules||t.cssRules;return e?Cr(Array.from(e,Ys).join("")):null}catch{return null}}function Ys(t){let e;if(Sr(t))try{e=Fn(t.styleSheet)||wr(t)}catch{}else if(xr(t)&&t.selectorText.includes(":"))return kr(t.cssText);return e||t.cssText}function kr(t){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function Sr(t){return"styleSheet"in t}function xr(t){return"selectorText"in t}class Xs{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var n;if(!e)return-1;const i=(n=this.getMeta(e))===null||n===void 0?void 0:n.id;return i??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(i=>this.removeNodeFromMap(i))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){const i=n.id;this.idNodeMap.set(i,e),this.nodeMetaMap.set(e,n)}replace(e,n){const i=this.getNode(e);if(i){const s=this.nodeMetaMap.get(i);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Ar(){return new Xs}function Ui({element:t,maskInputOptions:e,tagName:n,type:i,value:s,maskInputFn:o}){let a=s||"";const c=i&&Ft(i);return(e[n.toLowerCase()]||c&&e[c])&&(o?a=o(a,t):a="*".repeat(a.length)),a}function Ft(t){return t.toLowerCase()}const $s="__rrweb_original__";function Mr(t){const e=t.getContext("2d");if(!e)return!0;const n=50;for(let i=0;i<t.width;i+=n)for(let s=0;s<t.height;s+=n){const o=e.getImageData,a=$s in o?o[$s]:o;if(new Uint32Array(a.call(e,i,s,Math.min(n,t.width-i),Math.min(n,t.height-s)).data.buffer).some(l=>l!==0))return!1}return!0}function Vi(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Ft(e):null}function eo(t,e){var n;let i;try{i=new URL(t,e??window.location.href)}catch{return null}const s=/\.([0-9a-z]+)(?:$)/i,o=i.pathname.match(s);return(n=o==null?void 0:o[1])!==null&&n!==void 0?n:null}let Lr=1;const Tr=new RegExp("[^a-z0-9-_:]"),xn=-2;function to(){return Lr++}function _r(t){if(t instanceof HTMLFormElement)return"form";const e=Ft(t.tagName);return Tr.test(e)?"div":e}function Er(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}let on,no;const Pr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ir=/^(?:[a-z+]+:)?\/\//i,Dr=/^www\..*/i,Br=/^(data:)([^,]*),(.*)/i;function Kn(t,e){return(t||"").replace(Pr,(n,i,s,o,a,c)=>{const l=s||a||c,m=i||o||"";if(!l)return n;if(Ir.test(l)||Dr.test(l))return`url(${m}${l}${m})`;if(Br.test(l))return`url(${m}${l}${m})`;if(l[0]==="/")return`url(${m}${Er(e)+l}${m})`;const p=e.split("/"),y=l.split("/");p.pop();for(const b of y)b!=="."&&(b===".."?p.pop():p.push(b));return`url(${m}${p.join("/")}${m})`})}const Hr=/^[^ \t\n\r\u000c]+/,Rr=/^[, \t\n\r\u000c]+/;function Nr(t,e){if(e.trim()==="")return e;let n=0;function i(o){let a;const c=o.exec(e.substring(n));return c?(a=c[0],n+=a.length,a):""}const s=[];for(;i(Rr),!(n>=e.length);){let o=i(Hr);if(o.slice(-1)===",")o=an(t,o.substring(0,o.length-1)),s.push(o);else{let a="";o=an(t,o);let c=!1;for(;;){const l=e.charAt(n);if(l===""){s.push((o+a).trim());break}else if(c)l===")"&&(c=!1);else if(l===","){n+=1,s.push((o+a).trim());break}else l==="("&&(c=!0);a+=l,n+=1}}}return s.join(", ")}function an(t,e){if(!e||e.trim()==="")return e;const n=t.createElement("a");return n.href=e,n.href}function Or(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function Fi(){const t=document.createElement("a");return t.href="",t.href}function io(t,e,n,i){return i&&(n==="src"||n==="href"&&!(e==="use"&&i[0]==="#")||n==="xlink:href"&&i[0]!=="#"||n==="background"&&(e==="table"||e==="td"||e==="th")?an(t,i):n==="srcset"?Nr(t,i):n==="style"?Kn(i,Fi()):e==="object"&&n==="data"?an(t,i):i)}function so(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function Ur(t,e,n){try{if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(let i=t.classList.length;i--;){const s=t.classList[i];if(e.test(s))return!0}if(n)return t.matches(n)}catch{}return!1}function Gn(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return n?Gn(t.parentNode,e,n):!1;for(let i=t.classList.length;i--;){const s=t.classList[i];if(e.test(s))return!0}return n?Gn(t.parentNode,e,n):!1}function oo(t,e,n,i){try{const s=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(s===null)return!1;if(typeof e=="string"){if(i){if(s.closest(`.${e}`))return!0}else if(s.classList.contains(e))return!0}else if(Gn(s,e,i))return!0;if(n){if(i){if(s.closest(n))return!0}else if(s.matches(n))return!0}}catch{}return!1}function Vr(t,e,n){const i=t.contentWindow;if(!i)return;let s=!1,o;try{o=i.document.readyState}catch{return}if(o!=="complete"){const c=setTimeout(()=>{s||(e(),s=!0)},n);t.addEventListener("load",()=>{clearTimeout(c),s=!0,e()});return}const a="about:blank";if(i.location.href!==a||t.src===a||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function Fr(t,e,n){let i=!1,s;try{s=t.sheet}catch{return}if(s)return;const o=setTimeout(()=>{i||(e(),i=!0)},n);t.addEventListener("load",()=>{clearTimeout(o),i=!0,e()})}function Kr(t,e){const{doc:n,mirror:i,blockClass:s,blockSelector:o,needsMask:a,inlineStylesheet:c,maskInputOptions:l={},maskTextFn:m,maskInputFn:p,dataURLOptions:y={},inlineImages:b,recordCanvas:g,keepIframeSrcFn:w,newlyAddedElement:f=!1}=e,k=Gr(n,i);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:ve.Document,childNodes:[],compatMode:t.compatMode}:{type:ve.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:ve.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return zr(t,{doc:n,blockClass:s,blockSelector:o,inlineStylesheet:c,maskInputOptions:l,maskInputFn:p,dataURLOptions:y,inlineImages:b,recordCanvas:g,keepIframeSrcFn:w,newlyAddedElement:f,rootId:k});case t.TEXT_NODE:return jr(t,{needsMask:a,maskTextFn:m,rootId:k});case t.CDATA_SECTION_NODE:return{type:ve.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:ve.Comment,textContent:t.textContent||"",rootId:k};default:return!1}}function Gr(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return n===1?void 0:n}function jr(t,e){var n;const{needsMask:i,maskTextFn:s,rootId:o}=e,a=t.parentNode&&t.parentNode.tagName;let c=t.textContent;const l=a==="STYLE"?!0:void 0,m=a==="SCRIPT"?!0:void 0;if(l&&c){try{t.nextSibling||t.previousSibling||!((n=t.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(c=Fn(t.parentNode.sheet))}catch(p){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${p}`,t)}c=Kn(c,Fi())}return m&&(c="SCRIPT_PLACEHOLDER"),!l&&!m&&c&&i&&(c=s?s(c,t.parentElement):c.replace(/[\S]/g,"*")),{type:ve.Text,textContent:c||"",isStyle:l,rootId:o}}function zr(t,e){const{doc:n,blockClass:i,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:c,dataURLOptions:l={},inlineImages:m,recordCanvas:p,keepIframeSrcFn:y,newlyAddedElement:b=!1,rootId:g}=e,w=Ur(t,i,s),f=_r(t);let k={};const x=t.attributes.length;for(let M=0;M<x;M++){const E=t.attributes[M];so(f,E.name,E.value)||(k[E.name]=io(n,f,Ft(E.name),E.value))}if(f==="link"&&o){const M=Array.from(n.styleSheets).find(D=>D.href===t.href);let E=null;M&&(E=Fn(M)),E&&(delete k.rel,delete k.href,k._cssText=Kn(E,M.href))}if(f==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const M=Fn(t.sheet);M&&(k._cssText=Kn(M,Fi()))}if(f==="input"||f==="textarea"||f==="select"){const M=t.value,E=t.checked;k.type!=="radio"&&k.type!=="checkbox"&&k.type!=="submit"&&k.type!=="button"&&M?k.value=Ui({element:t,type:Vi(t),tagName:f,value:M,maskInputOptions:a,maskInputFn:c}):E&&(k.checked=E)}if(f==="option"&&(t.selected&&!a.select?k.selected=!0:delete k.selected),f==="canvas"&&p){if(t.__context==="2d")Mr(t)||(k.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){const M=t.toDataURL(l.type,l.quality),E=document.createElement("canvas");E.width=t.width,E.height=t.height;const D=E.toDataURL(l.type,l.quality);M!==D&&(k.rr_dataURL=M)}}if(f==="img"&&m){on||(on=n.createElement("canvas"),no=on.getContext("2d"));const M=t,E=M.crossOrigin;M.crossOrigin="anonymous";const D=()=>{M.removeEventListener("load",D);try{on.width=M.naturalWidth,on.height=M.naturalHeight,no.drawImage(M,0,0),k.rr_dataURL=on.toDataURL(l.type,l.quality)}catch(F){console.warn(`Cannot inline img src=${M.currentSrc}! Error: ${F}`)}E?k.crossOrigin=E:M.removeAttribute("crossorigin")};M.complete&&M.naturalWidth!==0?D():M.addEventListener("load",D)}if(f==="audio"||f==="video"){const M=k;M.rr_mediaState=t.paused?"paused":"played",M.rr_mediaCurrentTime=t.currentTime,M.rr_mediaPlaybackRate=t.playbackRate,M.rr_mediaMuted=t.muted,M.rr_mediaLoop=t.loop,M.rr_mediaVolume=t.volume}if(b||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),w){const{width:M,height:E}=t.getBoundingClientRect();k={class:k.class,rr_width:`${M}px`,rr_height:`${E}px`}}f==="iframe"&&!y(k.src)&&(t.contentDocument||(k.rr_src=k.src),delete k.src);let A;try{customElements.get(f)&&(A=!0)}catch{}return{type:ve.Element,tagName:f,attributes:k,childNodes:[],isSVG:Or(t)||void 0,needBlock:w,rootId:g,isCustom:A}}function ae(t){return t==null?"":t.toLowerCase()}function qr(t,e){if(e.comment&&t.type===ve.Comment)return!0;if(t.type===ve.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")&&t.attributes.as==="script"||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&eo(t.attributes.href)==="js"))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(ae(t.attributes.name).match(/^msapplication-tile(image|color)$/)||ae(t.attributes.name)==="application-name"||ae(t.attributes.rel)==="icon"||ae(t.attributes.rel)==="apple-touch-icon"||ae(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&ae(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ae(t.attributes.property).match(/^(og|twitter|fb):/)||ae(t.attributes.name).match(/^(og|twitter):/)||ae(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(ae(t.attributes.name)==="robots"||ae(t.attributes.name)==="googlebot"||ae(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(ae(t.attributes.name)==="author"||ae(t.attributes.name)==="generator"||ae(t.attributes.name)==="framework"||ae(t.attributes.name)==="publisher"||ae(t.attributes.name)==="progid"||ae(t.attributes.property).match(/^article:/)||ae(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(ae(t.attributes.name)==="google-site-verification"||ae(t.attributes.name)==="yandex-verification"||ae(t.attributes.name)==="csrf-token"||ae(t.attributes.name)==="p:domain_verify"||ae(t.attributes.name)==="verify-v1"||ae(t.attributes.name)==="verification"||ae(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function rn(t,e){const{doc:n,mirror:i,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,skipChild:l=!1,inlineStylesheet:m=!0,maskInputOptions:p={},maskTextFn:y,maskInputFn:b,slimDOMOptions:g,dataURLOptions:w={},inlineImages:f=!1,recordCanvas:k=!1,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M=5e3,onStylesheetLoad:E,stylesheetLoadTimeout:D=5e3,keepIframeSrcFn:F=()=>!1,newlyAddedElement:W=!1}=e;let{needsMask:G}=e,{preserveWhiteSpace:Q=!0}=e;!G&&t.childNodes&&(G=oo(t,a,c,G===void 0));const de=Kr(t,{doc:n,mirror:i,blockClass:s,blockSelector:o,needsMask:G,inlineStylesheet:m,maskInputOptions:p,maskTextFn:y,maskInputFn:b,dataURLOptions:w,inlineImages:f,recordCanvas:k,keepIframeSrcFn:F,newlyAddedElement:W});if(!de)return console.warn(t,"not serialized"),null;let _e;i.hasNode(t)?_e=i.getId(t):qr(de,g)||!Q&&de.type===ve.Text&&!de.isStyle&&!de.textContent.replace(/^\s+|\s+$/gm,"").length?_e=xn:_e=to();const j=Object.assign(de,{id:_e});if(i.add(t,j),_e===xn)return null;x&&x(t);let Ue=!l;if(j.type===ve.Element){Ue=Ue&&!j.needBlock,delete j.needBlock;const ge=t.shadowRoot;ge&&Sn(ge)&&(j.isShadowHost=!0)}if((j.type===ve.Document||j.type===ve.Element)&&Ue){g.headWhitespace&&j.type===ve.Element&&j.tagName==="head"&&(Q=!1);const ge={doc:n,mirror:i,blockClass:s,blockSelector:o,needsMask:G,maskTextClass:a,maskTextSelector:c,skipChild:l,inlineStylesheet:m,maskInputOptions:p,maskTextFn:y,maskInputFn:b,slimDOMOptions:g,dataURLOptions:w,inlineImages:f,recordCanvas:k,preserveWhiteSpace:Q,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:F};if(!(j.type===ve.Element&&j.tagName==="textarea"&&j.attributes.value!==void 0))for(const Ge of Array.from(t.childNodes)){const Se=rn(Ge,ge);Se&&j.childNodes.push(Se)}if(yr(t)&&t.shadowRoot)for(const Ge of Array.from(t.shadowRoot.childNodes)){const Se=rn(Ge,ge);Se&&(Sn(t.shadowRoot)&&(Se.isShadow=!0),j.childNodes.push(Se))}}return t.parentNode&&kn(t.parentNode)&&Sn(t.parentNode)&&(j.isShadow=!0),j.type===ve.Element&&j.tagName==="iframe"&&Vr(t,()=>{const ge=t.contentDocument;if(ge&&A){const Ge=rn(ge,{doc:ge,mirror:i,blockClass:s,blockSelector:o,needsMask:G,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:m,maskInputOptions:p,maskTextFn:y,maskInputFn:b,slimDOMOptions:g,dataURLOptions:w,inlineImages:f,recordCanvas:k,preserveWhiteSpace:Q,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:F});Ge&&A(t,Ge)}},M),j.type===ve.Element&&j.tagName==="link"&&typeof j.attributes.rel=="string"&&(j.attributes.rel==="stylesheet"||j.attributes.rel==="preload"&&typeof j.attributes.href=="string"&&eo(j.attributes.href)==="css")&&Fr(t,()=>{if(E){const ge=rn(t,{doc:n,mirror:i,blockClass:s,blockSelector:o,needsMask:G,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:m,maskInputOptions:p,maskTextFn:y,maskInputFn:b,slimDOMOptions:g,dataURLOptions:w,inlineImages:f,recordCanvas:k,preserveWhiteSpace:Q,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:F});ge&&E(t,ge)}},D),j}function Zr(t,e){const{mirror:n=new Xs,blockClass:i="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:c=!0,inlineImages:l=!1,recordCanvas:m=!1,maskAllInputs:p=!1,maskTextFn:y,maskInputFn:b,slimDOM:g=!1,dataURLOptions:w,preserveWhiteSpace:f,onSerialize:k,onIframeLoad:x,iframeLoadTimeout:A,onStylesheetLoad:M,stylesheetLoadTimeout:E,keepIframeSrcFn:D=()=>!1}=e||{};return rn(t,{doc:t,mirror:n,blockClass:i,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p===!1?{password:!0}:p,maskTextFn:y,maskInputFn:b,slimDOMOptions:g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:g==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:g===!1?{}:g,dataURLOptions:w,inlineImages:l,recordCanvas:m,preserveWhiteSpace:f,onSerialize:k,onIframeLoad:x,iframeLoadTimeout:A,onStylesheetLoad:M,stylesheetLoadTimeout:E,keepIframeSrcFn:D,newlyAddedElement:!1})}function Ne(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>n.removeEventListener(t,e,i)}const ln=`Please stop import mirror directly. Instead of that,\r
1240
1240
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
1241
- or you can use record.mirror to access the mirror instance during recording.`;let ao={map:{},getId(){return console.error(ln),-1},getNode(){return console.error(ln),null},removeNodeFromMap(){console.error(ln)},has(){return console.error(ln),!1},reset(){console.error(ln)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ao=new Proxy(ao,{get(t,e,n){return e==="map"&&console.error(ln),Reflect.get(t,e,n)}}));function An(t,e,n={}){let i=null,s=0;return function(...o){const a=Date.now();!s&&n.leading===!1&&(s=a);const c=e-(a-s),l=this;c<=0||c>e?(i&&(clearTimeout(i),i=null),s=a,t.apply(l,o)):!i&&n.trailing!==!1&&(i=setTimeout(()=>{s=n.leading===!1?0:Date.now(),i=null,t.apply(l,o)},c))}}function jn(t,e,n,i,s=window){const o=s.Object.getOwnPropertyDescriptor(t,e);return s.Object.defineProperty(t,e,i?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>jn(t,e,o||{},!0)}function cn(t,e,n){try{if(!(e in t))return()=>{};const i=t[e],s=n(i);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=s,()=>{t[e]=i}}catch{return()=>{}}}let zn=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(zn=()=>new Date().getTime());function ro(t){var e,n,i,s,o,a;const c=t.document;return{left:c.scrollingElement?c.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:(c==null?void 0:c.documentElement.scrollLeft)||((n=(e=c==null?void 0:c.body)===null||e===void 0?void 0:e.parentElement)===null||n===void 0?void 0:n.scrollLeft)||((i=c==null?void 0:c.body)===null||i===void 0?void 0:i.scrollLeft)||0,top:c.scrollingElement?c.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:(c==null?void 0:c.documentElement.scrollTop)||((o=(s=c==null?void 0:c.body)===null||s===void 0?void 0:s.parentElement)===null||o===void 0?void 0:o.scrollTop)||((a=c==null?void 0:c.body)===null||a===void 0?void 0:a.scrollTop)||0}}function lo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function co(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function uo(t){return t?t.nodeType===t.ELEMENT_NODE?t:t.parentElement:null}function Ne(t,e,n,i){if(!t)return!1;const s=uo(t);if(!s)return!1;try{if(typeof e=="string"){if(s.classList.contains(e)||i&&s.closest("."+e)!==null)return!0}else if(Gn(s,e,i))return!0}catch{}return!!(n&&(s.matches(n)||i&&s.closest(n)!==null))}function Wr(t,e){return e.getId(t)!==-1}function Ki(t,e){return e.getId(t)===xn}function ho(t,e){if(kn(t))return!1;const n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?ho(t.parentNode,e):!0:!0}function Gi(t){return!!t.changedTouches}function Qr(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let n=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function mo(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function po(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function ji(t){return!!(t!=null&&t.shadowRoot)}class Jr{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var n;return(n=this.styleIDMap.get(e))!==null&&n!==void 0?n:-1}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let i;return n===void 0?i=this.id++:i=n,this.styleIDMap.set(e,i),this.idStyleMap.set(i,e),i}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function vo(t){var e,n;let i=null;return((n=(e=t.getRootNode)===null||e===void 0?void 0:e.call(t))===null||n===void 0?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(i=t.getRootNode().host),i}function Yr(t){let e=t,n;for(;n=vo(e);)e=n;return e}function Xr(t){const e=t.ownerDocument;if(!e)return!1;const n=Yr(t);return e.contains(n)}function bo(t){const e=t.ownerDocument;return e?e.contains(t)||Xr(t):!1}var X=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(X||{}),J=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(J||{}),Ke=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Ke||{}),pt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(pt||{}),dn=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(dn||{});function fo(t){return"__ln"in t}class $r{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let i=0;i<e;i++)n=(n==null?void 0:n.next)||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&fo(e.previousSibling)){const i=e.previousSibling.__ln.next;n.next=i,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,i&&(i.previous=n)}else if(e.nextSibling&&fo(e.nextSibling)&&e.nextSibling.__ln.previous){const i=e.nextSibling.__ln.previous;n.previous=i,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,i&&(i.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(e){const n=e.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const go=(t,e)=>`${t}@${e}`;class el{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,i=new $r,s=l=>{let m=l,p=xn;for(;p===xn;)m=m&&m.nextSibling,p=m&&this.mirror.getId(m);return p},o=l=>{if(!l.parentNode||!bo(l)||l.parentNode.tagName==="TEXTAREA")return;const m=kn(l.parentNode)?this.mirror.getId(vo(l)):this.mirror.getId(l.parentNode),p=s(l);if(m===-1||p===-1)return i.addNode(l);const y=rn(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:b=>{mo(b,this.mirror)&&this.iframeManager.addIframe(b),po(b,this.mirror)&&this.stylesheetManager.trackLinkElement(b),ji(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(b,g)=>{this.iframeManager.attachIframe(b,g),this.shadowDomManager.observeAttachShadow(b)},onStylesheetLoad:(b,g)=>{this.stylesheetManager.attachLinkElement(b,g)}});y&&(e.push({parentId:m,nextId:p,node:y}),n.add(y.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)yo(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(const l of this.addedSet)!wo(this.droppedSet,l)&&!yo(this.removes,l,this.mirror)||wo(this.movedSet,l)?o(l):this.droppedSet.add(l);let a=null;for(;i.length;){let l=null;if(a){const m=this.mirror.getId(a.value.parentNode),p=s(a.value);m!==-1&&p!==-1&&(l=a)}if(!l){let m=i.tail;for(;m;){const p=m;if(m=m.previous,p){const y=this.mirror.getId(p.value.parentNode);if(s(p.value)===-1)continue;if(y!==-1){l=p;break}else{const g=p.value;if(g.parentNode&&g.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const w=g.parentNode.host;if(this.mirror.getId(w)!==-1){l=p;break}}}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}a=l.previous,i.removeNode(l.value),o(l.value)}const c={texts:this.texts.map(l=>{const m=l.node;return m.parentNode&&m.parentNode.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m.parentNode),{id:this.mirror.getId(m),value:l.value}}).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:m}=l;if(typeof m.style=="string"){const p=JSON.stringify(l.styleDiff),y=JSON.stringify(l._unchangedStyles);p.length<m.style.length&&(p+y).split("var(").length===m.style.split("var(").length&&(m.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:m}}).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:e};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(c))},this.genTextAreaValueMutation=e=>{let n=this.attributeMap.get(e);n||(n={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e,n)),n.attributes.value=Array.from(e.childNodes,i=>i.textContent||"").join("")},this.processMutation=e=>{if(!Ki(e.target,this.mirror))switch(e.type){case"characterData":{const n=e.target.textContent;!Ne(e.target,this.blockClass,this.blockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:oo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,uo(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let i=e.attributeName,s=e.target.getAttribute(i);if(i==="value"){const a=Vi(n);s=Ui({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:a,value:s,maskInputFn:this.maskInputFn})}if(Ne(e.target,this.blockClass,this.blockSelector,!1)||s===e.oldValue)return;let o=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&i==="src"&&!this.keepIframeSrcFn(s))if(!n.contentDocument)i="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),i==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!so(n.tagName,i)&&(o.attributes[i]=io(this.doc,Ft(n.tagName),Ft(i),s),i==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(const c of Array.from(n.style)){const l=n.style.getPropertyValue(c),m=n.style.getPropertyPriority(c);l!==a.style.getPropertyValue(c)||m!==a.style.getPropertyPriority(c)?m===""?o.styleDiff[c]=l:o.styleDiff[c]=[l,m]:o._unchangedStyles[c]=[l,m]}for(const c of Array.from(a.style))n.style.getPropertyValue(c)===""&&(o.styleDiff[c]=!1)}break}case"childList":{if(Ne(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const i=this.mirror.getId(n),s=kn(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Ne(e.target,this.blockClass,this.blockSelector,!1)||Ki(n,this.mirror)||!Wr(n,this.mirror)||(this.addedSet.has(n)?(zi(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&i===-1||ho(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[go(i,s)]?zi(this.movedSet,n):this.removes.push({parentId:s,id:i,isShadow:kn(e.target)&&Sn(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Ki(e,this.mirror))return;this.movedSet.add(e);let i=null;n&&this.mirror.hasNode(n)&&(i=this.mirror.getId(n)),i&&i!==-1&&(this.movedMap[go(this.mirror.getId(e),i)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ne(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach(i=>this.genAdds(i)),ji(e)&&e.shadowRoot.childNodes.forEach(i=>{this.processedNodeManager.add(i,this),this.genAdds(i,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function zi(t,e){t.delete(e),e.childNodes.forEach(n=>zi(t,n))}function yo(t,e,n){return t.length===0?!1:Co(t,e,n)}function Co(t,e,n){const{parentNode:i}=e;if(!i)return!1;const s=n.getId(i);return t.some(o=>o.id===s)?!0:Co(t,i,n)}function wo(t,e){return t.size===0?!1:ko(t,e)}function ko(t,e){const{parentNode:n}=e;return n?t.has(n)?!0:ko(t,n):!1}let Mn;function tl(t){Mn=t}function nl(){Mn=void 0}const Y=t=>Mn?(...n)=>{try{return t(...n)}catch(i){if(Mn&&Mn(i)===!0)return;throw i}}:t,Kt=[];function Ln(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function So(t,e){var n,i;const s=new el;Kt.push(s),s.init(t);let o=window.MutationObserver||window.__rrMutationObserver;const a=(i=(n=window==null?void 0:window.Zone)===null||n===void 0?void 0:n.__symbol__)===null||i===void 0?void 0:i.call(n,"MutationObserver");a&&window[a]&&(o=window[a]);const c=new o(Y(s.processMutations.bind(s)));return c.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),c}function il({mousemoveCb:t,sampling:e,doc:n,mirror:i}){if(e.mousemove===!1)return()=>{};const s=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let a=[],c;const l=An(Y(y=>{const b=Date.now()-c;t(a.map(g=>(g.timeOffset-=b,g)),y),a=[],c=null}),o),m=Y(An(Y(y=>{const b=Ln(y),{clientX:g,clientY:w}=Gi(y)?y.changedTouches[0]:y;c||(c=zn()),a.push({x:g,y:w,id:i.getId(b),timeOffset:zn()-c}),l(typeof DragEvent<"u"&&y instanceof DragEvent?J.Drag:y instanceof MouseEvent?J.MouseMove:J.TouchMove)}),s,{trailing:!1})),p=[Re("mousemove",m,n),Re("touchmove",m,n),Re("drag",m,n)];return Y(()=>{p.forEach(y=>y())})}function sl({mouseInteractionCb:t,doc:e,mirror:n,blockClass:i,blockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[];let l=null;const m=p=>y=>{const b=Ln(y);if(Ne(b,i,s,!0))return;let g=null,w=p;if("pointerType"in y){switch(y.pointerType){case"mouse":g=pt.Mouse;break;case"touch":g=pt.Touch;break;case"pen":g=pt.Pen;break}g===pt.Touch?Ke[p]===Ke.MouseDown?w="TouchStart":Ke[p]===Ke.MouseUp&&(w="TouchEnd"):pt.Pen}else Gi(y)&&(g=pt.Touch);g!==null?(l=g,(w.startsWith("Touch")&&g===pt.Touch||w.startsWith("Mouse")&&g===pt.Mouse)&&(g=null)):Ke[p]===Ke.Click&&(g=l,l=null);const f=Gi(y)?y.changedTouches[0]:y;if(!f)return;const k=n.getId(b),{clientX:x,clientY:A}=f;Y(t)(Object.assign({type:Ke[w],id:k,x,y:A},g!==null&&{pointerType:g}))};return Object.keys(Ke).filter(p=>Number.isNaN(Number(p))&&!p.endsWith("_Departed")&&a[p]!==!1).forEach(p=>{let y=Ft(p);const b=m(p);if(window.PointerEvent)switch(Ke[p]){case Ke.MouseDown:case Ke.MouseUp:y=y.replace("mouse","pointer");break;case Ke.TouchStart:case Ke.TouchEnd:return}c.push(Re(y,b,e))}),Y(()=>{c.forEach(p=>p())})}function xo({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:s,sampling:o}){const a=Y(An(Y(c=>{const l=Ln(c);if(!l||Ne(l,i,s,!0))return;const m=n.getId(l);if(l===e&&e.defaultView){const p=ro(e.defaultView);t({id:m,x:p.left,y:p.top})}else t({id:m,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return Re("scroll",a,e)}function ol({viewportResizeCb:t},{win:e}){let n=-1,i=-1;const s=Y(An(Y(()=>{const o=lo(),a=co();(n!==o||i!==a)&&(t({width:Number(a),height:Number(o)}),n=o,i=a)}),200));return Re("resize",s,e)}const al=["INPUT","TEXTAREA","SELECT"],Ao=new WeakMap;function rl({inputCb:t,doc:e,mirror:n,blockClass:i,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:l,sampling:m,userTriggeredOnInput:p}){function y(A){let M=Ln(A);const E=A.isTrusted,D=M&&M.tagName;if(M&&D==="OPTION"&&(M=M.parentElement),!M||!D||al.indexOf(D)<0||Ne(M,i,s,!0)||M.classList.contains(o)||a&&M.matches(a))return;let F=M.value,W=!1;const G=Vi(M)||"";G==="radio"||G==="checkbox"?W=M.checked:(c[D.toLowerCase()]||c[G])&&(F=Ui({element:M,maskInputOptions:c,tagName:D,type:G,value:F,maskInputFn:l})),b(M,p?{text:F,isChecked:W,userTriggered:E}:{text:F,isChecked:W});const Q=M.name;G==="radio"&&Q&&W&&e.querySelectorAll(`input[type="radio"][name="${Q}"]`).forEach(de=>{if(de!==M){const _e=de.value;b(de,p?{text:_e,isChecked:!W,userTriggered:!1}:{text:_e,isChecked:!W})}})}function b(A,M){const E=Ao.get(A);if(!E||E.text!==M.text||E.isChecked!==M.isChecked){Ao.set(A,M);const D=n.getId(A);Y(t)(Object.assign(Object.assign({},M),{id:D}))}}const w=(m.input==="last"?["change"]:["input","change"]).map(A=>Re(A,Y(y),e)),f=e.defaultView;if(!f)return()=>{w.forEach(A=>A())};const k=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),x=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return k&&k.set&&w.push(...x.map(A=>jn(A[0],A[1],{set(){Y(y)({target:this,isTrusted:!1})}},!1,f))),Y(()=>{w.forEach(A=>A())})}function qn(t){const e=[];function n(i,s){if(Zn("CSSGroupingRule")&&i.parentRule instanceof CSSGroupingRule||Zn("CSSMediaRule")&&i.parentRule instanceof CSSMediaRule||Zn("CSSSupportsRule")&&i.parentRule instanceof CSSSupportsRule||Zn("CSSConditionRule")&&i.parentRule instanceof CSSConditionRule){const a=Array.from(i.parentRule.cssRules).indexOf(i);s.unshift(a)}else if(i.parentStyleSheet){const a=Array.from(i.parentStyleSheet.cssRules).indexOf(i);s.unshift(a)}return s}return n(t,e)}function Tt(t,e,n){let i,s;return t?(t.ownerNode?i=e.getId(t.ownerNode):s=n.getId(t),{styleId:s,id:i}):{}}function ll({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:i}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Y((p,y,b)=>{const[g,w]=b,{id:f,styleId:k}=Tt(y,e,n.styleMirror);return(f&&f!==-1||k&&k!==-1)&&t({id:f,styleId:k,adds:[{rule:g,index:w}]}),p.apply(y,b)})});const o=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Y((p,y,b)=>{const[g]=b,{id:w,styleId:f}=Tt(y,e,n.styleMirror);return(w&&w!==-1||f&&f!==-1)&&t({id:w,styleId:f,removes:[{index:g}]}),p.apply(y,b)})});let a;i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Y((p,y,b)=>{const[g]=b,{id:w,styleId:f}=Tt(y,e,n.styleMirror);return(w&&w!==-1||f&&f!==-1)&&t({id:w,styleId:f,replace:g}),p.apply(y,b)})}));let c;i.CSSStyleSheet.prototype.replaceSync&&(c=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:Y((p,y,b)=>{const[g]=b,{id:w,styleId:f}=Tt(y,e,n.styleMirror);return(w&&w!==-1||f&&f!==-1)&&t({id:w,styleId:f,replaceSync:g}),p.apply(y,b)})}));const l={};Wn("CSSGroupingRule")?l.CSSGroupingRule=i.CSSGroupingRule:(Wn("CSSMediaRule")&&(l.CSSMediaRule=i.CSSMediaRule),Wn("CSSConditionRule")&&(l.CSSConditionRule=i.CSSConditionRule),Wn("CSSSupportsRule")&&(l.CSSSupportsRule=i.CSSSupportsRule));const m={};return Object.entries(l).forEach(([p,y])=>{m[p]={insertRule:y.prototype.insertRule,deleteRule:y.prototype.deleteRule},y.prototype.insertRule=new Proxy(m[p].insertRule,{apply:Y((b,g,w)=>{const[f,k]=w,{id:x,styleId:A}=Tt(g.parentStyleSheet,e,n.styleMirror);return(x&&x!==-1||A&&A!==-1)&&t({id:x,styleId:A,adds:[{rule:f,index:[...qn(g),k||0]}]}),b.apply(g,w)})}),y.prototype.deleteRule=new Proxy(m[p].deleteRule,{apply:Y((b,g,w)=>{const[f]=w,{id:k,styleId:x}=Tt(g.parentStyleSheet,e,n.styleMirror);return(k&&k!==-1||x&&x!==-1)&&t({id:k,styleId:x,removes:[{index:[...qn(g),f]}]}),b.apply(g,w)})})}),Y(()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=o,a&&(i.CSSStyleSheet.prototype.replace=a),c&&(i.CSSStyleSheet.prototype.replaceSync=c),Object.entries(l).forEach(([p,y])=>{y.prototype.insertRule=m[p].insertRule,y.prototype.deleteRule=m[p].deleteRule})})}function Mo({mirror:t,stylesheetManager:e},n){var i,s,o;let a=null;n.nodeName==="#document"?a=t.getId(n):a=t.getId(n.host);const c=n.nodeName==="#document"?(i=n.defaultView)===null||i===void 0?void 0:i.Document:(o=(s=n.ownerDocument)===null||s===void 0?void 0:s.defaultView)===null||o===void 0?void 0:o.ShadowRoot,l=c!=null&&c.prototype?Object.getOwnPropertyDescriptor(c==null?void 0:c.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!c||!l?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var m;return(m=l.get)===null||m===void 0?void 0:m.call(this)},set(m){var p;const y=(p=l.set)===null||p===void 0?void 0:p.call(this,m);if(a!==null&&a!==-1)try{e.adoptStyleSheets(m,a)}catch{}return y}}),Y(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function cl({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:i},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Y((c,l,m)=>{var p;const[y,b,g]=m;if(n.has(y))return o.apply(l,[y,b,g]);const{id:w,styleId:f}=Tt((p=l.parentRule)===null||p===void 0?void 0:p.parentStyleSheet,e,i.styleMirror);return(w&&w!==-1||f&&f!==-1)&&t({id:w,styleId:f,set:{property:y,value:b,priority:g},index:qn(l.parentRule)}),c.apply(l,m)})});const a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Y((c,l,m)=>{var p;const[y]=m;if(n.has(y))return a.apply(l,[y]);const{id:b,styleId:g}=Tt((p=l.parentRule)===null||p===void 0?void 0:p.parentStyleSheet,e,i.styleMirror);return(b&&b!==-1||g&&g!==-1)&&t({id:b,styleId:g,remove:{property:y},index:qn(l.parentRule)}),c.apply(l,m)})}),Y(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a})}function dl({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:s,doc:o}){const a=Y(l=>An(Y(m=>{const p=Ln(m);if(!p||Ne(p,e,n,!0))return;const{currentTime:y,volume:b,muted:g,playbackRate:w,loop:f}=p;t({type:l,id:i.getId(p),currentTime:y,volume:b,muted:g,playbackRate:w,loop:f})}),s.media||500)),c=[Re("play",a(0),o),Re("pause",a(1),o),Re("seeked",a(2),o),Re("volumechange",a(3),o),Re("ratechange",a(4),o)];return Y(()=>{c.forEach(l=>l())})}function ul({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const i=[],s=new WeakMap,o=n.FontFace;n.FontFace=function(l,m,p){const y=new o(l,m,p);return s.set(y,{family:l,buffer:typeof m!="string",descriptors:p,fontSource:typeof m=="string"?m:JSON.stringify(Array.from(new Uint8Array(m)))}),y};const a=cn(e.fonts,"add",function(c){return function(l){return setTimeout(Y(()=>{const m=s.get(l);m&&(t(m),s.delete(l))}),0),c.apply(this,[l])}});return i.push(()=>{n.FontFace=o}),i.push(a),Y(()=>{i.forEach(c=>c())})}function hl(t){const{doc:e,mirror:n,blockClass:i,blockSelector:s,selectionCb:o}=t;let a=!0;const c=Y(()=>{const l=e.getSelection();if(!l||a&&(l!=null&&l.isCollapsed))return;a=l.isCollapsed||!1;const m=[],p=l.rangeCount||0;for(let y=0;y<p;y++){const b=l.getRangeAt(y),{startContainer:g,startOffset:w,endContainer:f,endOffset:k}=b;Ne(g,i,s,!0)||Ne(f,i,s,!0)||m.push({start:n.getId(g),startOffset:w,end:n.getId(f),endOffset:k})}o({ranges:m})});return c(),Re("selectionchange",c)}function ml({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:cn(n.customElements,"define",function(s){return function(o,a,c){try{e({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return s.apply(this,[o,a,c])}})}function pl(t,e){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:c,mediaInteractionCb:l,styleSheetRuleCb:m,styleDeclarationCb:p,canvasMutationCb:y,fontCb:b,selectionCb:g,customElementCb:w}=t;t.mutationCb=(...f)=>{e.mutation&&e.mutation(...f),n(...f)},t.mousemoveCb=(...f)=>{e.mousemove&&e.mousemove(...f),i(...f)},t.mouseInteractionCb=(...f)=>{e.mouseInteraction&&e.mouseInteraction(...f),s(...f)},t.scrollCb=(...f)=>{e.scroll&&e.scroll(...f),o(...f)},t.viewportResizeCb=(...f)=>{e.viewportResize&&e.viewportResize(...f),a(...f)},t.inputCb=(...f)=>{e.input&&e.input(...f),c(...f)},t.mediaInteractionCb=(...f)=>{e.mediaInteaction&&e.mediaInteaction(...f),l(...f)},t.styleSheetRuleCb=(...f)=>{e.styleSheetRule&&e.styleSheetRule(...f),m(...f)},t.styleDeclarationCb=(...f)=>{e.styleDeclaration&&e.styleDeclaration(...f),p(...f)},t.canvasMutationCb=(...f)=>{e.canvasMutation&&e.canvasMutation(...f),y(...f)},t.fontCb=(...f)=>{e.font&&e.font(...f),b(...f)},t.selectionCb=(...f)=>{e.selection&&e.selection(...f),g(...f)},t.customElementCb=(...f)=>{e.customElement&&e.customElement(...f),w(...f)}}function vl(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};pl(t,e);let i;t.recordDOM&&(i=So(t,t.doc));const s=il(t),o=sl(t),a=xo(t),c=ol(t,{win:n}),l=rl(t),m=dl(t);let p=()=>{},y=()=>{},b=()=>{},g=()=>{};t.recordDOM&&(p=ll(t,{win:n}),y=Mo(t,t.doc),b=cl(t,{win:n}),t.collectFonts&&(g=ul(t)));const w=hl(t),f=ml(t),k=[];for(const x of t.plugins)k.push(x.observer(x.callback,n,x.options));return Y(()=>{Kt.forEach(x=>x.reset()),i==null||i.disconnect(),s(),o(),a(),c(),l(),m(),p(),y(),b(),g(),w(),f(),k.forEach(x=>x())})}function Zn(t){return typeof window[t]<"u"}function Wn(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Lo{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,i,s){const o=i||this.getIdToRemoteIdMap(e),a=s||this.getRemoteIdToIdMap(e);let c=o.get(n);return c||(c=this.generateIdFn(),o.set(n,c),a.set(c,n)),c}getIds(e,n){const i=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return n.map(o=>this.getId(e,o,i,s))}getRemoteId(e,n,i){const s=i||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const o=s.get(n);return o||-1}getRemoteIds(e,n){const i=this.getRemoteIdToIdMap(e);return n.map(s=>this.getRemoteId(e,s,i))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}class bl{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Lo(to),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Lo(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){var i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(i=this.loadListener)===null||i===void 0||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const o=this.transformCrossOriginEvent(s,n.data.event);o&&this.wrappedEmit(o,n.data.isCheckout)}transformCrossOriginEvent(e,n){var i;switch(n.type){case X.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:X.IncrementalSnapshot,data:{source:J.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case X.Meta:case X.Load:case X.DomContentLoaded:return!1;case X.Plugin:return n;case X.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case X.IncrementalSnapshot:switch(n.data.source){case J.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(s.node,o)}),n.data.removes.forEach(s=>{this.replaceIds(s,e,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,e,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case J.Drag:case J.TouchMove:case J.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case J.ViewportResize:return!1;case J.MediaInteraction:case J.MouseInteraction:case J.Scroll:case J.CanvasMutation:case J.Input:return this.replaceIds(n.data,e,["id"]),n;case J.StyleSheetRule:case J.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case J.Font:return n;case J.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,e,["start","end"])}),n;case J.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),(i=n.data.styles)===null||i===void 0||i.forEach(s=>{this.replaceStyleIds(s,e,["styleId"])}),n}}return!1}replace(e,n,i,s){for(const o of s)!Array.isArray(n[o])&&typeof n[o]!="number"||(Array.isArray(n[o])?n[o]=e.getIds(i,n[o]):n[o]=e.getId(i,n[o]));return n}replaceIds(e,n,i){return this.replace(this.crossOriginIframeMirror,e,n,i)}replaceStyleIds(e,n,i){return this.replace(this.crossOriginIframeStyleMirror,e,n,i)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(i=>{this.replaceIdOnNode(i,n)})}patchRootIdOnNode(e,n){e.type!==ve.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(i=>{this.patchRootIdOnNode(i,n)})}}class fl{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!Sn(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const i=So(Object.assign(Object.assign({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>i.disconnect()),this.restoreHandlers.push(xo(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(Mo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,n){const i=this;this.restoreHandlers.push(cn(e.prototype,"attachShadow",function(s){return function(o){const a=s.call(this,o);return this.shadowRoot&&bo(this)&&i.addShadowRoot(this.shadowRoot,n),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
1241
+ or you can use record.mirror to access the mirror instance during recording.`;let ao={map:{},getId(){return console.error(ln),-1},getNode(){return console.error(ln),null},removeNodeFromMap(){console.error(ln)},has(){return console.error(ln),!1},reset(){console.error(ln)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ao=new Proxy(ao,{get(t,e,n){return e==="map"&&console.error(ln),Reflect.get(t,e,n)}}));function An(t,e,n={}){let i=null,s=0;return function(...o){const a=Date.now();!s&&n.leading===!1&&(s=a);const c=e-(a-s),l=this;c<=0||c>e?(i&&(clearTimeout(i),i=null),s=a,t.apply(l,o)):!i&&n.trailing!==!1&&(i=setTimeout(()=>{s=n.leading===!1?0:Date.now(),i=null,t.apply(l,o)},c))}}function jn(t,e,n,i,s=window){const o=s.Object.getOwnPropertyDescriptor(t,e);return s.Object.defineProperty(t,e,i?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>jn(t,e,o||{},!0)}function cn(t,e,n){try{if(!(e in t))return()=>{};const i=t[e],s=n(i);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=s,()=>{t[e]=i}}catch{return()=>{}}}let zn=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(zn=()=>new Date().getTime());function ro(t){var e,n,i,s,o,a;const c=t.document;return{left:c.scrollingElement?c.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:(c==null?void 0:c.documentElement.scrollLeft)||((n=(e=c==null?void 0:c.body)===null||e===void 0?void 0:e.parentElement)===null||n===void 0?void 0:n.scrollLeft)||((i=c==null?void 0:c.body)===null||i===void 0?void 0:i.scrollLeft)||0,top:c.scrollingElement?c.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:(c==null?void 0:c.documentElement.scrollTop)||((o=(s=c==null?void 0:c.body)===null||s===void 0?void 0:s.parentElement)===null||o===void 0?void 0:o.scrollTop)||((a=c==null?void 0:c.body)===null||a===void 0?void 0:a.scrollTop)||0}}function lo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function co(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function uo(t){return t?t.nodeType===t.ELEMENT_NODE?t:t.parentElement:null}function Oe(t,e,n,i){if(!t)return!1;const s=uo(t);if(!s)return!1;try{if(typeof e=="string"){if(s.classList.contains(e)||i&&s.closest("."+e)!==null)return!0}else if(Gn(s,e,i))return!0}catch{}return!!(n&&(s.matches(n)||i&&s.closest(n)!==null))}function Wr(t,e){return e.getId(t)!==-1}function Ki(t,e){return e.getId(t)===xn}function ho(t,e){if(kn(t))return!1;const n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?ho(t.parentNode,e):!0:!0}function Gi(t){return!!t.changedTouches}function Qr(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let n=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function mo(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function po(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function ji(t){return!!(t!=null&&t.shadowRoot)}class Jr{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var n;return(n=this.styleIDMap.get(e))!==null&&n!==void 0?n:-1}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let i;return n===void 0?i=this.id++:i=n,this.styleIDMap.set(e,i),this.idStyleMap.set(i,e),i}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function vo(t){var e,n;let i=null;return((n=(e=t.getRootNode)===null||e===void 0?void 0:e.call(t))===null||n===void 0?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(i=t.getRootNode().host),i}function Yr(t){let e=t,n;for(;n=vo(e);)e=n;return e}function Xr(t){const e=t.ownerDocument;if(!e)return!1;const n=Yr(t);return e.contains(n)}function bo(t){const e=t.ownerDocument;return e?e.contains(t)||Xr(t):!1}var X=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(X||{}),J=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(J||{}),Ke=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Ke||{}),pt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(pt||{}),dn=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(dn||{});function fo(t){return"__ln"in t}class $r{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let i=0;i<e;i++)n=(n==null?void 0:n.next)||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&fo(e.previousSibling)){const i=e.previousSibling.__ln.next;n.next=i,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,i&&(i.previous=n)}else if(e.nextSibling&&fo(e.nextSibling)&&e.nextSibling.__ln.previous){const i=e.nextSibling.__ln.previous;n.previous=i,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,i&&(i.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(e){const n=e.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const go=(t,e)=>`${t}@${e}`;class el{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,i=new $r,s=l=>{let m=l,p=xn;for(;p===xn;)m=m&&m.nextSibling,p=m&&this.mirror.getId(m);return p},o=l=>{if(!l.parentNode||!bo(l)||l.parentNode.tagName==="TEXTAREA")return;const m=kn(l.parentNode)?this.mirror.getId(vo(l)):this.mirror.getId(l.parentNode),p=s(l);if(m===-1||p===-1)return i.addNode(l);const y=rn(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:b=>{mo(b,this.mirror)&&this.iframeManager.addIframe(b),po(b,this.mirror)&&this.stylesheetManager.trackLinkElement(b),ji(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(b,g)=>{this.iframeManager.attachIframe(b,g),this.shadowDomManager.observeAttachShadow(b)},onStylesheetLoad:(b,g)=>{this.stylesheetManager.attachLinkElement(b,g)}});y&&(e.push({parentId:m,nextId:p,node:y}),n.add(y.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)yo(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(const l of this.addedSet)!wo(this.droppedSet,l)&&!yo(this.removes,l,this.mirror)||wo(this.movedSet,l)?o(l):this.droppedSet.add(l);let a=null;for(;i.length;){let l=null;if(a){const m=this.mirror.getId(a.value.parentNode),p=s(a.value);m!==-1&&p!==-1&&(l=a)}if(!l){let m=i.tail;for(;m;){const p=m;if(m=m.previous,p){const y=this.mirror.getId(p.value.parentNode);if(s(p.value)===-1)continue;if(y!==-1){l=p;break}else{const g=p.value;if(g.parentNode&&g.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const w=g.parentNode.host;if(this.mirror.getId(w)!==-1){l=p;break}}}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}a=l.previous,i.removeNode(l.value),o(l.value)}const c={texts:this.texts.map(l=>{const m=l.node;return m.parentNode&&m.parentNode.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m.parentNode),{id:this.mirror.getId(m),value:l.value}}).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:m}=l;if(typeof m.style=="string"){const p=JSON.stringify(l.styleDiff),y=JSON.stringify(l._unchangedStyles);p.length<m.style.length&&(p+y).split("var(").length===m.style.split("var(").length&&(m.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:m}}).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:e};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(c))},this.genTextAreaValueMutation=e=>{let n=this.attributeMap.get(e);n||(n={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e,n)),n.attributes.value=Array.from(e.childNodes,i=>i.textContent||"").join("")},this.processMutation=e=>{if(!Ki(e.target,this.mirror))switch(e.type){case"characterData":{const n=e.target.textContent;!Oe(e.target,this.blockClass,this.blockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:oo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,uo(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let i=e.attributeName,s=e.target.getAttribute(i);if(i==="value"){const a=Vi(n);s=Ui({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:a,value:s,maskInputFn:this.maskInputFn})}if(Oe(e.target,this.blockClass,this.blockSelector,!1)||s===e.oldValue)return;let o=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&i==="src"&&!this.keepIframeSrcFn(s))if(!n.contentDocument)i="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),i==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!so(n.tagName,i)&&(o.attributes[i]=io(this.doc,Ft(n.tagName),Ft(i),s),i==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(const c of Array.from(n.style)){const l=n.style.getPropertyValue(c),m=n.style.getPropertyPriority(c);l!==a.style.getPropertyValue(c)||m!==a.style.getPropertyPriority(c)?m===""?o.styleDiff[c]=l:o.styleDiff[c]=[l,m]:o._unchangedStyles[c]=[l,m]}for(const c of Array.from(a.style))n.style.getPropertyValue(c)===""&&(o.styleDiff[c]=!1)}break}case"childList":{if(Oe(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const i=this.mirror.getId(n),s=kn(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Oe(e.target,this.blockClass,this.blockSelector,!1)||Ki(n,this.mirror)||!Wr(n,this.mirror)||(this.addedSet.has(n)?(zi(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&i===-1||ho(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[go(i,s)]?zi(this.movedSet,n):this.removes.push({parentId:s,id:i,isShadow:kn(e.target)&&Sn(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Ki(e,this.mirror))return;this.movedSet.add(e);let i=null;n&&this.mirror.hasNode(n)&&(i=this.mirror.getId(n)),i&&i!==-1&&(this.movedMap[go(this.mirror.getId(e),i)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Oe(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach(i=>this.genAdds(i)),ji(e)&&e.shadowRoot.childNodes.forEach(i=>{this.processedNodeManager.add(i,this),this.genAdds(i,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function zi(t,e){t.delete(e),e.childNodes.forEach(n=>zi(t,n))}function yo(t,e,n){return t.length===0?!1:Co(t,e,n)}function Co(t,e,n){const{parentNode:i}=e;if(!i)return!1;const s=n.getId(i);return t.some(o=>o.id===s)?!0:Co(t,i,n)}function wo(t,e){return t.size===0?!1:ko(t,e)}function ko(t,e){const{parentNode:n}=e;return n?t.has(n)?!0:ko(t,n):!1}let Mn;function tl(t){Mn=t}function nl(){Mn=void 0}const Y=t=>Mn?(...n)=>{try{return t(...n)}catch(i){if(Mn&&Mn(i)===!0)return;throw i}}:t,Kt=[];function Ln(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function So(t,e){var n,i;const s=new el;Kt.push(s),s.init(t);let o=window.MutationObserver||window.__rrMutationObserver;const a=(i=(n=window==null?void 0:window.Zone)===null||n===void 0?void 0:n.__symbol__)===null||i===void 0?void 0:i.call(n,"MutationObserver");a&&window[a]&&(o=window[a]);const c=new o(Y(s.processMutations.bind(s)));return c.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),c}function il({mousemoveCb:t,sampling:e,doc:n,mirror:i}){if(e.mousemove===!1)return()=>{};const s=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let a=[],c;const l=An(Y(y=>{const b=Date.now()-c;t(a.map(g=>(g.timeOffset-=b,g)),y),a=[],c=null}),o),m=Y(An(Y(y=>{const b=Ln(y),{clientX:g,clientY:w}=Gi(y)?y.changedTouches[0]:y;c||(c=zn()),a.push({x:g,y:w,id:i.getId(b),timeOffset:zn()-c}),l(typeof DragEvent<"u"&&y instanceof DragEvent?J.Drag:y instanceof MouseEvent?J.MouseMove:J.TouchMove)}),s,{trailing:!1})),p=[Ne("mousemove",m,n),Ne("touchmove",m,n),Ne("drag",m,n)];return Y(()=>{p.forEach(y=>y())})}function sl({mouseInteractionCb:t,doc:e,mirror:n,blockClass:i,blockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[];let l=null;const m=p=>y=>{const b=Ln(y);if(Oe(b,i,s,!0))return;let g=null,w=p;if("pointerType"in y){switch(y.pointerType){case"mouse":g=pt.Mouse;break;case"touch":g=pt.Touch;break;case"pen":g=pt.Pen;break}g===pt.Touch?Ke[p]===Ke.MouseDown?w="TouchStart":Ke[p]===Ke.MouseUp&&(w="TouchEnd"):pt.Pen}else Gi(y)&&(g=pt.Touch);g!==null?(l=g,(w.startsWith("Touch")&&g===pt.Touch||w.startsWith("Mouse")&&g===pt.Mouse)&&(g=null)):Ke[p]===Ke.Click&&(g=l,l=null);const f=Gi(y)?y.changedTouches[0]:y;if(!f)return;const k=n.getId(b),{clientX:x,clientY:A}=f;Y(t)(Object.assign({type:Ke[w],id:k,x,y:A},g!==null&&{pointerType:g}))};return Object.keys(Ke).filter(p=>Number.isNaN(Number(p))&&!p.endsWith("_Departed")&&a[p]!==!1).forEach(p=>{let y=Ft(p);const b=m(p);if(window.PointerEvent)switch(Ke[p]){case Ke.MouseDown:case Ke.MouseUp:y=y.replace("mouse","pointer");break;case Ke.TouchStart:case Ke.TouchEnd:return}c.push(Ne(y,b,e))}),Y(()=>{c.forEach(p=>p())})}function xo({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:s,sampling:o}){const a=Y(An(Y(c=>{const l=Ln(c);if(!l||Oe(l,i,s,!0))return;const m=n.getId(l);if(l===e&&e.defaultView){const p=ro(e.defaultView);t({id:m,x:p.left,y:p.top})}else t({id:m,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return Ne("scroll",a,e)}function ol({viewportResizeCb:t},{win:e}){let n=-1,i=-1;const s=Y(An(Y(()=>{const o=lo(),a=co();(n!==o||i!==a)&&(t({width:Number(a),height:Number(o)}),n=o,i=a)}),200));return Ne("resize",s,e)}const al=["INPUT","TEXTAREA","SELECT"],Ao=new WeakMap;function rl({inputCb:t,doc:e,mirror:n,blockClass:i,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:l,sampling:m,userTriggeredOnInput:p}){function y(A){let M=Ln(A);const E=A.isTrusted,D=M&&M.tagName;if(M&&D==="OPTION"&&(M=M.parentElement),!M||!D||al.indexOf(D)<0||Oe(M,i,s,!0)||M.classList.contains(o)||a&&M.matches(a))return;let F=M.value,W=!1;const G=Vi(M)||"";G==="radio"||G==="checkbox"?W=M.checked:(c[D.toLowerCase()]||c[G])&&(F=Ui({element:M,maskInputOptions:c,tagName:D,type:G,value:F,maskInputFn:l})),b(M,p?{text:F,isChecked:W,userTriggered:E}:{text:F,isChecked:W});const Q=M.name;G==="radio"&&Q&&W&&e.querySelectorAll(`input[type="radio"][name="${Q}"]`).forEach(de=>{if(de!==M){const _e=de.value;b(de,p?{text:_e,isChecked:!W,userTriggered:!1}:{text:_e,isChecked:!W})}})}function b(A,M){const E=Ao.get(A);if(!E||E.text!==M.text||E.isChecked!==M.isChecked){Ao.set(A,M);const D=n.getId(A);Y(t)(Object.assign(Object.assign({},M),{id:D}))}}const w=(m.input==="last"?["change"]:["input","change"]).map(A=>Ne(A,Y(y),e)),f=e.defaultView;if(!f)return()=>{w.forEach(A=>A())};const k=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),x=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return k&&k.set&&w.push(...x.map(A=>jn(A[0],A[1],{set(){Y(y)({target:this,isTrusted:!1})}},!1,f))),Y(()=>{w.forEach(A=>A())})}function qn(t){const e=[];function n(i,s){if(Zn("CSSGroupingRule")&&i.parentRule instanceof CSSGroupingRule||Zn("CSSMediaRule")&&i.parentRule instanceof CSSMediaRule||Zn("CSSSupportsRule")&&i.parentRule instanceof CSSSupportsRule||Zn("CSSConditionRule")&&i.parentRule instanceof CSSConditionRule){const a=Array.from(i.parentRule.cssRules).indexOf(i);s.unshift(a)}else if(i.parentStyleSheet){const a=Array.from(i.parentStyleSheet.cssRules).indexOf(i);s.unshift(a)}return s}return n(t,e)}function Tt(t,e,n){let i,s;return t?(t.ownerNode?i=e.getId(t.ownerNode):s=n.getId(t),{styleId:s,id:i}):{}}function ll({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:i}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Y((p,y,b)=>{const[g,w]=b,{id:f,styleId:k}=Tt(y,e,n.styleMirror);return(f&&f!==-1||k&&k!==-1)&&t({id:f,styleId:k,adds:[{rule:g,index:w}]}),p.apply(y,b)})});const o=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Y((p,y,b)=>{const[g]=b,{id:w,styleId:f}=Tt(y,e,n.styleMirror);return(w&&w!==-1||f&&f!==-1)&&t({id:w,styleId:f,removes:[{index:g}]}),p.apply(y,b)})});let a;i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Y((p,y,b)=>{const[g]=b,{id:w,styleId:f}=Tt(y,e,n.styleMirror);return(w&&w!==-1||f&&f!==-1)&&t({id:w,styleId:f,replace:g}),p.apply(y,b)})}));let c;i.CSSStyleSheet.prototype.replaceSync&&(c=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:Y((p,y,b)=>{const[g]=b,{id:w,styleId:f}=Tt(y,e,n.styleMirror);return(w&&w!==-1||f&&f!==-1)&&t({id:w,styleId:f,replaceSync:g}),p.apply(y,b)})}));const l={};Wn("CSSGroupingRule")?l.CSSGroupingRule=i.CSSGroupingRule:(Wn("CSSMediaRule")&&(l.CSSMediaRule=i.CSSMediaRule),Wn("CSSConditionRule")&&(l.CSSConditionRule=i.CSSConditionRule),Wn("CSSSupportsRule")&&(l.CSSSupportsRule=i.CSSSupportsRule));const m={};return Object.entries(l).forEach(([p,y])=>{m[p]={insertRule:y.prototype.insertRule,deleteRule:y.prototype.deleteRule},y.prototype.insertRule=new Proxy(m[p].insertRule,{apply:Y((b,g,w)=>{const[f,k]=w,{id:x,styleId:A}=Tt(g.parentStyleSheet,e,n.styleMirror);return(x&&x!==-1||A&&A!==-1)&&t({id:x,styleId:A,adds:[{rule:f,index:[...qn(g),k||0]}]}),b.apply(g,w)})}),y.prototype.deleteRule=new Proxy(m[p].deleteRule,{apply:Y((b,g,w)=>{const[f]=w,{id:k,styleId:x}=Tt(g.parentStyleSheet,e,n.styleMirror);return(k&&k!==-1||x&&x!==-1)&&t({id:k,styleId:x,removes:[{index:[...qn(g),f]}]}),b.apply(g,w)})})}),Y(()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=o,a&&(i.CSSStyleSheet.prototype.replace=a),c&&(i.CSSStyleSheet.prototype.replaceSync=c),Object.entries(l).forEach(([p,y])=>{y.prototype.insertRule=m[p].insertRule,y.prototype.deleteRule=m[p].deleteRule})})}function Mo({mirror:t,stylesheetManager:e},n){var i,s,o;let a=null;n.nodeName==="#document"?a=t.getId(n):a=t.getId(n.host);const c=n.nodeName==="#document"?(i=n.defaultView)===null||i===void 0?void 0:i.Document:(o=(s=n.ownerDocument)===null||s===void 0?void 0:s.defaultView)===null||o===void 0?void 0:o.ShadowRoot,l=c!=null&&c.prototype?Object.getOwnPropertyDescriptor(c==null?void 0:c.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!c||!l?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var m;return(m=l.get)===null||m===void 0?void 0:m.call(this)},set(m){var p;const y=(p=l.set)===null||p===void 0?void 0:p.call(this,m);if(a!==null&&a!==-1)try{e.adoptStyleSheets(m,a)}catch{}return y}}),Y(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function cl({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:i},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Y((c,l,m)=>{var p;const[y,b,g]=m;if(n.has(y))return o.apply(l,[y,b,g]);const{id:w,styleId:f}=Tt((p=l.parentRule)===null||p===void 0?void 0:p.parentStyleSheet,e,i.styleMirror);return(w&&w!==-1||f&&f!==-1)&&t({id:w,styleId:f,set:{property:y,value:b,priority:g},index:qn(l.parentRule)}),c.apply(l,m)})});const a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Y((c,l,m)=>{var p;const[y]=m;if(n.has(y))return a.apply(l,[y]);const{id:b,styleId:g}=Tt((p=l.parentRule)===null||p===void 0?void 0:p.parentStyleSheet,e,i.styleMirror);return(b&&b!==-1||g&&g!==-1)&&t({id:b,styleId:g,remove:{property:y},index:qn(l.parentRule)}),c.apply(l,m)})}),Y(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a})}function dl({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:s,doc:o}){const a=Y(l=>An(Y(m=>{const p=Ln(m);if(!p||Oe(p,e,n,!0))return;const{currentTime:y,volume:b,muted:g,playbackRate:w,loop:f}=p;t({type:l,id:i.getId(p),currentTime:y,volume:b,muted:g,playbackRate:w,loop:f})}),s.media||500)),c=[Ne("play",a(0),o),Ne("pause",a(1),o),Ne("seeked",a(2),o),Ne("volumechange",a(3),o),Ne("ratechange",a(4),o)];return Y(()=>{c.forEach(l=>l())})}function ul({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const i=[],s=new WeakMap,o=n.FontFace;n.FontFace=function(l,m,p){const y=new o(l,m,p);return s.set(y,{family:l,buffer:typeof m!="string",descriptors:p,fontSource:typeof m=="string"?m:JSON.stringify(Array.from(new Uint8Array(m)))}),y};const a=cn(e.fonts,"add",function(c){return function(l){return setTimeout(Y(()=>{const m=s.get(l);m&&(t(m),s.delete(l))}),0),c.apply(this,[l])}});return i.push(()=>{n.FontFace=o}),i.push(a),Y(()=>{i.forEach(c=>c())})}function hl(t){const{doc:e,mirror:n,blockClass:i,blockSelector:s,selectionCb:o}=t;let a=!0;const c=Y(()=>{const l=e.getSelection();if(!l||a&&(l!=null&&l.isCollapsed))return;a=l.isCollapsed||!1;const m=[],p=l.rangeCount||0;for(let y=0;y<p;y++){const b=l.getRangeAt(y),{startContainer:g,startOffset:w,endContainer:f,endOffset:k}=b;Oe(g,i,s,!0)||Oe(f,i,s,!0)||m.push({start:n.getId(g),startOffset:w,end:n.getId(f),endOffset:k})}o({ranges:m})});return c(),Ne("selectionchange",c)}function ml({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:cn(n.customElements,"define",function(s){return function(o,a,c){try{e({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return s.apply(this,[o,a,c])}})}function pl(t,e){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:c,mediaInteractionCb:l,styleSheetRuleCb:m,styleDeclarationCb:p,canvasMutationCb:y,fontCb:b,selectionCb:g,customElementCb:w}=t;t.mutationCb=(...f)=>{e.mutation&&e.mutation(...f),n(...f)},t.mousemoveCb=(...f)=>{e.mousemove&&e.mousemove(...f),i(...f)},t.mouseInteractionCb=(...f)=>{e.mouseInteraction&&e.mouseInteraction(...f),s(...f)},t.scrollCb=(...f)=>{e.scroll&&e.scroll(...f),o(...f)},t.viewportResizeCb=(...f)=>{e.viewportResize&&e.viewportResize(...f),a(...f)},t.inputCb=(...f)=>{e.input&&e.input(...f),c(...f)},t.mediaInteractionCb=(...f)=>{e.mediaInteaction&&e.mediaInteaction(...f),l(...f)},t.styleSheetRuleCb=(...f)=>{e.styleSheetRule&&e.styleSheetRule(...f),m(...f)},t.styleDeclarationCb=(...f)=>{e.styleDeclaration&&e.styleDeclaration(...f),p(...f)},t.canvasMutationCb=(...f)=>{e.canvasMutation&&e.canvasMutation(...f),y(...f)},t.fontCb=(...f)=>{e.font&&e.font(...f),b(...f)},t.selectionCb=(...f)=>{e.selection&&e.selection(...f),g(...f)},t.customElementCb=(...f)=>{e.customElement&&e.customElement(...f),w(...f)}}function vl(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};pl(t,e);let i;t.recordDOM&&(i=So(t,t.doc));const s=il(t),o=sl(t),a=xo(t),c=ol(t,{win:n}),l=rl(t),m=dl(t);let p=()=>{},y=()=>{},b=()=>{},g=()=>{};t.recordDOM&&(p=ll(t,{win:n}),y=Mo(t,t.doc),b=cl(t,{win:n}),t.collectFonts&&(g=ul(t)));const w=hl(t),f=ml(t),k=[];for(const x of t.plugins)k.push(x.observer(x.callback,n,x.options));return Y(()=>{Kt.forEach(x=>x.reset()),i==null||i.disconnect(),s(),o(),a(),c(),l(),m(),p(),y(),b(),g(),w(),f(),k.forEach(x=>x())})}function Zn(t){return typeof window[t]<"u"}function Wn(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Lo{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,i,s){const o=i||this.getIdToRemoteIdMap(e),a=s||this.getRemoteIdToIdMap(e);let c=o.get(n);return c||(c=this.generateIdFn(),o.set(n,c),a.set(c,n)),c}getIds(e,n){const i=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return n.map(o=>this.getId(e,o,i,s))}getRemoteId(e,n,i){const s=i||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const o=s.get(n);return o||-1}getRemoteIds(e,n){const i=this.getRemoteIdToIdMap(e);return n.map(s=>this.getRemoteId(e,s,i))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}class bl{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Lo(to),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Lo(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){var i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(i=this.loadListener)===null||i===void 0||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const o=this.transformCrossOriginEvent(s,n.data.event);o&&this.wrappedEmit(o,n.data.isCheckout)}transformCrossOriginEvent(e,n){var i;switch(n.type){case X.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:X.IncrementalSnapshot,data:{source:J.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case X.Meta:case X.Load:case X.DomContentLoaded:return!1;case X.Plugin:return n;case X.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case X.IncrementalSnapshot:switch(n.data.source){case J.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(s.node,o)}),n.data.removes.forEach(s=>{this.replaceIds(s,e,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,e,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case J.Drag:case J.TouchMove:case J.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case J.ViewportResize:return!1;case J.MediaInteraction:case J.MouseInteraction:case J.Scroll:case J.CanvasMutation:case J.Input:return this.replaceIds(n.data,e,["id"]),n;case J.StyleSheetRule:case J.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case J.Font:return n;case J.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,e,["start","end"])}),n;case J.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),(i=n.data.styles)===null||i===void 0||i.forEach(s=>{this.replaceStyleIds(s,e,["styleId"])}),n}}return!1}replace(e,n,i,s){for(const o of s)!Array.isArray(n[o])&&typeof n[o]!="number"||(Array.isArray(n[o])?n[o]=e.getIds(i,n[o]):n[o]=e.getId(i,n[o]));return n}replaceIds(e,n,i){return this.replace(this.crossOriginIframeMirror,e,n,i)}replaceStyleIds(e,n,i){return this.replace(this.crossOriginIframeStyleMirror,e,n,i)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(i=>{this.replaceIdOnNode(i,n)})}patchRootIdOnNode(e,n){e.type!==ve.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(i=>{this.patchRootIdOnNode(i,n)})}}class fl{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!Sn(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const i=So(Object.assign(Object.assign({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>i.disconnect()),this.restoreHandlers.push(xo(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(Mo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,n){const i=this;this.restoreHandlers.push(cn(e.prototype,"attachShadow",function(s){return function(o){const a=s.call(this,o);return this.shadowRoot&&bo(this)&&i.addShadowRoot(this.shadowRoot,n),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
1242
1242
  Copyright (c) Microsoft Corporation.
1243
1243
 
1244
1244
  Permission to use, copy, modify, and/or distribute this software for any
@@ -1251,7 +1251,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1251
1251
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1252
1252
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1253
1253
  PERFORMANCE OF THIS SOFTWARE.
1254
- ***************************************************************************** */function gl(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]]);return n}function yl(t,e,n,i){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function c(p){try{m(i.next(p))}catch(y){a(y)}}function l(p){try{m(i.throw(p))}catch(y){a(y)}}function m(p){p.done?o(p.value):s(p.value).then(c,l)}m((i=i.apply(t,[])).next())})}for(var un="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cl=typeof Uint8Array>"u"?[]:new Uint8Array(256),Qn=0;Qn<un.length;Qn++)Cl[un.charCodeAt(Qn)]=Qn;var wl=function(t){var e=new Uint8Array(t),n,i=e.length,s="";for(n=0;n<i;n+=3)s+=un[e[n]>>2],s+=un[(e[n]&3)<<4|e[n+1]>>4],s+=un[(e[n+1]&15)<<2|e[n+2]>>6],s+=un[e[n+2]&63];return i%3===2?s=s.substring(0,s.length-1)+"=":i%3===1&&(s=s.substring(0,s.length-2)+"=="),s};const To=new Map;function kl(t,e){let n=To.get(t);return n||(n=new Map,To.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}const _o=(t,e,n)=>{if(!t||!(Po(t,e)||typeof t=="object"))return;const i=t.constructor.name,s=kl(n,i);let o=s.indexOf(t);return o===-1&&(o=s.length,s.push(t)),o};function Jn(t,e,n){if(t instanceof Array)return t.map(i=>Jn(i,e,n));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){const i=t.constructor.name,s=wl(t);return{rr_type:i,base64:s}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Jn(t.buffer,e,n),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const i=t.constructor.name,{src:s}=t;return{rr_type:i,src:s}}else if(t instanceof HTMLCanvasElement){const i="HTMLImageElement",s=t.toDataURL();return{rr_type:i,src:s}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[Jn(t.data,e,n),t.width,t.height]};if(Po(t,e)||typeof t=="object"){const i=t.constructor.name,s=_o(t,e,n);return{rr_type:i,index:s}}}}return t}const Eo=(t,e,n)=>t.map(i=>Jn(i,e,n)),Po=(t,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof e[s]=="function").find(s=>t instanceof e[s]);function Sl(t,e,n,i){const s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of o)try{if(typeof e.CanvasRenderingContext2D.prototype[a]!="function")continue;const c=cn(e.CanvasRenderingContext2D.prototype,a,function(l){return function(...m){return Ne(this.canvas,n,i,!0)||setTimeout(()=>{const p=Eo(m,e,this);t(this.canvas,{type:dn["2D"],property:a,args:p})},0),l.apply(this,m)}});s.push(c)}catch{const l=jn(e.CanvasRenderingContext2D.prototype,a,{set(m){t(this.canvas,{type:dn["2D"],property:a,args:[m],setter:!0})}});s.push(l)}return()=>{s.forEach(a=>a())}}function xl(t){return t==="experimental-webgl"?"webgl":t}function Io(t,e,n,i){const s=[];try{const o=cn(t.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...l){if(!Ne(this,e,n,!0)){const m=xl(c);if("__context"in this||(this.__context=m),i&&["webgl","webgl2"].includes(m))if(l[0]&&typeof l[0]=="object"){const p=l[0];p.preserveDrawingBuffer||(p.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[c,...l])}});s.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(o=>o())}}function Do(t,e,n,i,s,o,a){const c=[],l=Object.getOwnPropertyNames(t);for(const m of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(m))try{if(typeof t[m]!="function")continue;const p=cn(t,m,function(y){return function(...b){const g=y.apply(this,b);if(_o(g,a,this),"tagName"in this.canvas&&!Ne(this.canvas,i,s,!0)){const w=Eo(b,a,this),f={type:e,property:m,args:w};n(this.canvas,f)}return g}});c.push(p)}catch{const y=jn(t,m,{set(b){n(this.canvas,{type:e,property:m,args:[b],setter:!0})}});c.push(y)}return c}function Al(t,e,n,i,s){const o=[];return o.push(...Do(e.WebGLRenderingContext.prototype,dn.WebGL,t,n,i,s,e)),typeof e.WebGL2RenderingContext<"u"&&o.push(...Do(e.WebGL2RenderingContext.prototype,dn.WebGL2,t,n,i,s,e)),()=>{o.forEach(a=>a())}}function Ml(t,e){var n=t.toString(),i=n.split(`
1254
+ ***************************************************************************** */function gl(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]]);return n}function yl(t,e,n,i){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function c(p){try{m(i.next(p))}catch(y){a(y)}}function l(p){try{m(i.throw(p))}catch(y){a(y)}}function m(p){p.done?o(p.value):s(p.value).then(c,l)}m((i=i.apply(t,[])).next())})}for(var un="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cl=typeof Uint8Array>"u"?[]:new Uint8Array(256),Qn=0;Qn<un.length;Qn++)Cl[un.charCodeAt(Qn)]=Qn;var wl=function(t){var e=new Uint8Array(t),n,i=e.length,s="";for(n=0;n<i;n+=3)s+=un[e[n]>>2],s+=un[(e[n]&3)<<4|e[n+1]>>4],s+=un[(e[n+1]&15)<<2|e[n+2]>>6],s+=un[e[n+2]&63];return i%3===2?s=s.substring(0,s.length-1)+"=":i%3===1&&(s=s.substring(0,s.length-2)+"=="),s};const To=new Map;function kl(t,e){let n=To.get(t);return n||(n=new Map,To.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}const _o=(t,e,n)=>{if(!t||!(Po(t,e)||typeof t=="object"))return;const i=t.constructor.name,s=kl(n,i);let o=s.indexOf(t);return o===-1&&(o=s.length,s.push(t)),o};function Jn(t,e,n){if(t instanceof Array)return t.map(i=>Jn(i,e,n));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){const i=t.constructor.name,s=wl(t);return{rr_type:i,base64:s}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Jn(t.buffer,e,n),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const i=t.constructor.name,{src:s}=t;return{rr_type:i,src:s}}else if(t instanceof HTMLCanvasElement){const i="HTMLImageElement",s=t.toDataURL();return{rr_type:i,src:s}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[Jn(t.data,e,n),t.width,t.height]};if(Po(t,e)||typeof t=="object"){const i=t.constructor.name,s=_o(t,e,n);return{rr_type:i,index:s}}}}return t}const Eo=(t,e,n)=>t.map(i=>Jn(i,e,n)),Po=(t,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof e[s]=="function").find(s=>t instanceof e[s]);function Sl(t,e,n,i){const s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of o)try{if(typeof e.CanvasRenderingContext2D.prototype[a]!="function")continue;const c=cn(e.CanvasRenderingContext2D.prototype,a,function(l){return function(...m){return Oe(this.canvas,n,i,!0)||setTimeout(()=>{const p=Eo(m,e,this);t(this.canvas,{type:dn["2D"],property:a,args:p})},0),l.apply(this,m)}});s.push(c)}catch{const l=jn(e.CanvasRenderingContext2D.prototype,a,{set(m){t(this.canvas,{type:dn["2D"],property:a,args:[m],setter:!0})}});s.push(l)}return()=>{s.forEach(a=>a())}}function xl(t){return t==="experimental-webgl"?"webgl":t}function Io(t,e,n,i){const s=[];try{const o=cn(t.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...l){if(!Oe(this,e,n,!0)){const m=xl(c);if("__context"in this||(this.__context=m),i&&["webgl","webgl2"].includes(m))if(l[0]&&typeof l[0]=="object"){const p=l[0];p.preserveDrawingBuffer||(p.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[c,...l])}});s.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(o=>o())}}function Do(t,e,n,i,s,o,a){const c=[],l=Object.getOwnPropertyNames(t);for(const m of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(m))try{if(typeof t[m]!="function")continue;const p=cn(t,m,function(y){return function(...b){const g=y.apply(this,b);if(_o(g,a,this),"tagName"in this.canvas&&!Oe(this.canvas,i,s,!0)){const w=Eo(b,a,this),f={type:e,property:m,args:w};n(this.canvas,f)}return g}});c.push(p)}catch{const y=jn(t,m,{set(b){n(this.canvas,{type:e,property:m,args:[b],setter:!0})}});c.push(y)}return c}function Al(t,e,n,i,s){const o=[];return o.push(...Do(e.WebGLRenderingContext.prototype,dn.WebGL,t,n,i,s,e)),typeof e.WebGL2RenderingContext<"u"&&o.push(...Do(e.WebGL2RenderingContext.prototype,dn.WebGL2,t,n,i,s,e)),()=>{o.forEach(a=>a())}}function Ml(t,e){var n=t.toString(),i=n.split(`
1255
1255
  `);i.pop(),i.shift();for(var s=i[0].search(/\S/),o=/(['"])__worker_loader_strict__(['"])/g,a=0,c=i.length;a<c;++a)i[a]=i[a].substring(s).replace(o,"$1use strict$2")+`
1256
1256
  `;return i}function Ll(t,e){var n=Ml(t),i=new Blob(n,{type:"application/javascript"});return URL.createObjectURL(i)}function Tl(t,e){var n;return function(s){return n=n||Ll(t),new Worker(n,s)}}var _l=Tl(function(){(function(){"__worker_loader_strict__";/*! *****************************************************************************
1257
1257
  Copyright (c) Microsoft Corporation.
@@ -1266,13 +1266,13 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1266
1266
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1267
1267
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1268
1268
  PERFORMANCE OF THIS SOFTWARE.
1269
- ***************************************************************************** */function t(m,p,y,b){function g(w){return w instanceof y?w:new y(function(f){f(w)})}return new(y||(y=Promise))(function(w,f){function k(M){try{A(b.next(M))}catch(E){f(E)}}function x(M){try{A(b.throw(M))}catch(E){f(E)}}function A(M){M.done?w(M.value):g(M.value).then(k,x)}A((b=b.apply(m,[])).next())})}for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=typeof Uint8Array>"u"?[]:new Uint8Array(256),i=0;i<e.length;i++)n[e.charCodeAt(i)]=i;var s=function(m){var p=new Uint8Array(m),y,b=p.length,g="";for(y=0;y<b;y+=3)g+=e[p[y]>>2],g+=e[(p[y]&3)<<4|p[y+1]>>4],g+=e[(p[y+1]&15)<<2|p[y+2]>>6],g+=e[p[y+2]&63];return b%3===2?g=g.substring(0,g.length-1)+"=":b%3===1&&(g=g.substring(0,g.length-2)+"=="),g};const o=new Map,a=new Map;function c(m,p,y){return t(this,void 0,void 0,function*(){const b=`${m}-${p}`;if("OffscreenCanvas"in globalThis){if(a.has(b))return a.get(b);const g=new OffscreenCanvas(m,p);g.getContext("2d");const f=yield(yield g.convertToBlob(y)).arrayBuffer(),k=s(f);return a.set(b,k),k}else return""})}const l=self;l.onmessage=function(m){return t(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:p,bitmap:y,width:b,height:g,dataURLOptions:w}=m.data,f=c(b,g,w),k=new OffscreenCanvas(b,g);k.getContext("2d").drawImage(y,0,0),y.close();const A=yield k.convertToBlob(w),M=A.type,E=yield A.arrayBuffer(),D=s(E);if(!o.has(p)&&(yield f)===D)return o.set(p,D),l.postMessage({id:p});if(o.get(p)===D)return l.postMessage({id:p});l.postMessage({id:p,type:M,base64:D,width:b,height:g}),o.set(p,D)}else return l.postMessage({id:m.data.id})})}})()});class El{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,m)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(m)};const{sampling:n="all",win:i,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:c}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&n==="all"&&this.initCanvasMutationObserver(i,s,o),a&&typeof n=="number"&&this.initCanvasFPSObserver(n,i,s,o,{dataURLOptions:c})}initCanvasFPSObserver(e,n,i,s,o){const a=Io(n,i,s,!0),c=new Map,l=new _l;l.onmessage=w=>{const{id:f}=w.data;if(c.set(f,!1),!("base64"in w.data))return;const{base64:k,type:x,width:A,height:M}=w.data;this.mutationCb({id:f,type:dn["2D"],commands:[{property:"clearRect",args:[0,0,A,M]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:k}],type:x}]},0,0]}]})};const m=1e3/e;let p=0,y;const b=()=>{const w=[];return n.document.querySelectorAll("canvas").forEach(f=>{Ne(f,i,s,!0)||w.push(f)}),w},g=w=>{if(p&&w-p<m){y=requestAnimationFrame(g);return}p=w,b().forEach(f=>yl(this,void 0,void 0,function*(){var k;const x=this.mirror.getId(f);if(c.get(x)||f.width===0||f.height===0)return;if(c.set(x,!0),["webgl","webgl2"].includes(f.__context)){const M=f.getContext(f.__context);((k=M==null?void 0:M.getContextAttributes())===null||k===void 0?void 0:k.preserveDrawingBuffer)===!1&&M.clear(M.COLOR_BUFFER_BIT)}const A=yield createImageBitmap(f);l.postMessage({id:x,bitmap:A,width:f.width,height:f.height,dataURLOptions:o.dataURLOptions},[A])})),y=requestAnimationFrame(g)};y=requestAnimationFrame(g),this.resetObservers=()=>{a(),cancelAnimationFrame(y)}}initCanvasMutationObserver(e,n,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=Io(e,n,i,!1),o=Sl(this.processMutation.bind(this),e,n,i),a=Al(this.processMutation.bind(this),e,n,i,this.mirror);this.resetObservers=()=>{s(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=n=>{this.rafStamps.latestId=n,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,n)=>{const i=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,i)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,n){if(this.frozen||this.locked)return;const i=this.pendingCanvasMutations.get(e);if(!i||n===-1)return;const s=i.map(a=>gl(a,["type"])),{type:o}=i[0];this.mutationCb({id:n,type:o,commands:s}),this.pendingCanvasMutations.delete(e)}}class Pl{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Jr,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const i={id:n,styleIds:[]},s=[];for(const o of e){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),s.push({styleId:a,rules:Array.from(o.rules||CSSRule,(c,l)=>({rule:Ys(c),index:l}))})),i.styleIds.push(a)}s.length>0&&(i.styles=s),this.adoptedStyleSheetCb(i)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Il{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(e,n){const i=this.nodeMap.get(e);return i&&Array.from(i).some(s=>s!==n)}add(e,n){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function be(t){return Object.assign(Object.assign({},t),{timestamp:zn()})}let he,Yn,qi,Xn=!1;const tt=Ar();function Tn(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:l="rr-mask",maskTextSelector:m=null,inlineStylesheet:p=!0,maskAllInputs:y,maskInputOptions:b,slimDOMOptions:g,maskInputFn:w,maskTextFn:f,hooks:k,packFn:x,sampling:A={},dataURLOptions:M={},mousemoveWait:E,recordDOM:D=!0,recordCanvas:F=!1,recordCrossOriginIframes:W=!1,recordAfter:G=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:Q=!1,collectFonts:de=!1,inlineImages:_e=!1,plugins:j,keepIframeSrcFn:Oe=()=>!1,ignoreCSSAttributes:ge=new Set([]),errorHandler:Ge}=t;tl(Ge);const Se=W?window.parent===window:!0;let yt=!1;if(!Se)try{window.parent.document&&(yt=!1)}catch{yt=!0}if(Se&&!e)throw new Error("emit function is required");E!==void 0&&A.mousemove===void 0&&(A.mousemove=E),tt.reset();const dt=y===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:b!==void 0?b:{password:!0},Ct=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all"}:g||{};Qr();let qt,Nt=0;const je=R=>{for(const ye of j||[])ye.eventProcessor&&(R=ye.eventProcessor(R));return x&&!yt&&(R=x(R)),R};he=(R,ye)=>{var ie;if(!((ie=Kt[0])===null||ie===void 0)&&ie.isFrozen()&&R.type!==X.FullSnapshot&&!(R.type===X.IncrementalSnapshot&&R.data.source===J.Mutation)&&Kt.forEach(Ce=>Ce.unfreeze()),Se)e==null||e(je(R),ye);else if(yt){const Ce={type:"rrweb",event:je(R),origin:window.location.origin,isCheckout:ye};window.parent.postMessage(Ce,"*")}if(R.type===X.FullSnapshot)qt=R,Nt=0;else if(R.type===X.IncrementalSnapshot){if(R.data.source===J.Mutation&&R.data.isAttachIframe)return;Nt++;const Ce=i&&Nt>=i,qe=n&&R.timestamp-qt.timestamp>n;(Ce||qe)&&Yn(!0)}};const wt=R=>{he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Mutation},R)}))},Zt=R=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Scroll},R)})),me=R=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.CanvasMutation},R)})),xe=R=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.AdoptedStyleSheet},R)})),Qe=new Pl({mutationCb:wt,adoptedStyleSheetCb:xe}),ze=new bl({mirror:tt,mutationCb:wt,stylesheetManager:Qe,recordCrossOriginIframes:W,wrappedEmit:he});for(const R of j||[])R.getMirror&&R.getMirror({nodeMirror:tt,crossOriginIframeMirror:ze.crossOriginIframeMirror,crossOriginIframeStyleMirror:ze.crossOriginIframeStyleMirror});const De=new Il;qi=new El({recordCanvas:F,mutationCb:me,win:window,blockClass:s,blockSelector:o,mirror:tt,sampling:A.canvas,dataURLOptions:M});const ut=new fl({mutationCb:wt,scrollCb:Zt,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:m,inlineStylesheet:p,maskInputOptions:dt,dataURLOptions:M,maskTextFn:f,maskInputFn:w,recordCanvas:F,inlineImages:_e,sampling:A,slimDOMOptions:Ct,iframeManager:ze,stylesheetManager:Qe,canvasManager:qi,keepIframeSrcFn:Oe,processedNodeManager:De},mirror:tt});Yn=(R=!1)=>{if(!D)return;he(be({type:X.Meta,data:{href:window.location.href,width:co(),height:lo()}}),R),Qe.reset(),ut.init(),Kt.forEach(ie=>ie.lock());const ye=Zr(document,{mirror:tt,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:m,inlineStylesheet:p,maskAllInputs:dt,maskTextFn:f,slimDOM:Ct,dataURLOptions:M,recordCanvas:F,inlineImages:_e,onSerialize:ie=>{mo(ie,tt)&&ze.addIframe(ie),po(ie,tt)&&Qe.trackLinkElement(ie),ji(ie)&&ut.addShadowRoot(ie.shadowRoot,document)},onIframeLoad:(ie,Ce)=>{ze.attachIframe(ie,Ce),ut.observeAttachShadow(ie)},onStylesheetLoad:(ie,Ce)=>{Qe.attachLinkElement(ie,Ce)},keepIframeSrcFn:Oe});if(!ye)return console.warn("Failed to snapshot the document");he(be({type:X.FullSnapshot,data:{node:ye,initialOffset:ro(window)}}),R),Kt.forEach(ie=>ie.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Qe.adoptStyleSheets(document.adoptedStyleSheets,tt.getId(document))};try{const R=[],ye=Ce=>{var qe;return Y(vl)({mutationCb:wt,mousemoveCb:(te,Ot)=>he(be({type:X.IncrementalSnapshot,data:{source:Ot,positions:te}})),mouseInteractionCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.MouseInteraction},te)})),scrollCb:Zt,viewportResizeCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.ViewportResize},te)})),inputCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Input},te)})),mediaInteractionCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.MediaInteraction},te)})),styleSheetRuleCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.StyleSheetRule},te)})),styleDeclarationCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.StyleDeclaration},te)})),canvasMutationCb:me,fontCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Font},te)})),selectionCb:te=>{he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Selection},te)}))},customElementCb:te=>{he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.CustomElement},te)}))},blockClass:s,ignoreClass:a,ignoreSelector:c,maskTextClass:l,maskTextSelector:m,maskInputOptions:dt,inlineStylesheet:p,sampling:A,recordDOM:D,recordCanvas:F,inlineImages:_e,userTriggeredOnInput:Q,collectFonts:de,doc:Ce,maskInputFn:w,maskTextFn:f,keepIframeSrcFn:Oe,blockSelector:o,slimDOMOptions:Ct,dataURLOptions:M,mirror:tt,iframeManager:ze,stylesheetManager:Qe,shadowDomManager:ut,processedNodeManager:De,canvasManager:qi,ignoreCSSAttributes:ge,plugins:((qe=j==null?void 0:j.filter(te=>te.observer))===null||qe===void 0?void 0:qe.map(te=>({observer:te.observer,options:te.options,callback:Ot=>he(be({type:X.Plugin,data:{plugin:te.name,payload:Ot}}))})))||[]},k)};ze.addLoadListener(Ce=>{try{R.push(ye(Ce.contentDocument))}catch(qe){console.warn(qe)}});const ie=()=>{Yn(),R.push(ye(document)),Xn=!0};return document.readyState==="interactive"||document.readyState==="complete"?ie():(R.push(Re("DOMContentLoaded",()=>{he(be({type:X.DomContentLoaded,data:{}})),G==="DOMContentLoaded"&&ie()})),R.push(Re("load",()=>{he(be({type:X.Load,data:{}})),G==="load"&&ie()},window))),()=>{R.forEach(Ce=>Ce()),De.destroy(),Xn=!1,nl()}}catch(R){console.warn(R)}}Tn.addCustomEvent=(t,e)=>{if(!Xn)throw new Error("please add custom event after start recording");he(be({type:X.Custom,data:{tag:t,payload:e}}))},Tn.freezePage=()=>{Kt.forEach(t=>t.freeze())},Tn.takeFullSnapshot=t=>{if(!Xn)throw new Error("please take full snapshot after start recording");Yn(t)},Tn.mirror=tt;var Bo=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Bo||{}),rt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(rt||{}),vt={DEBUG:!1,LIB_VERSION:"2.55.1"},O;if(typeof window>"u"){var Ho={hostname:""};O={navigator:{userAgent:"",onLine:!0},document:{location:Ho,referrer:""},screen:{width:0,height:0},location:Ho}}else O=window;var _n=24*60*60*1e3,Zi=8*1e3,$n=Array.prototype,Dl=Function.prototype,Ro=Object.prototype,_t=$n.slice,En=Ro.toString,ei=Ro.hasOwnProperty,fe=O.console,Et=O.navigator,oe=O.document,ti=O.opera,ni=O.screen,lt=Et.userAgent,Wi=Dl.bind,No=$n.forEach,Oo=$n.indexOf,Uo=$n.map,Bl=Array.isArray,Qi={},v={trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},ee={log:function(){if(vt.DEBUG&&!v.isUndefined(fe)&&fe)try{fe.log.apply(fe,arguments)}catch{v.each(arguments,function(e){fe.log(e)})}},warn:function(){if(vt.DEBUG&&!v.isUndefined(fe)&&fe){var t=["Mixpanel warning:"].concat(v.toArray(arguments));try{fe.warn.apply(fe,t)}catch{v.each(t,function(n){fe.warn(n)})}}},error:function(){if(vt.DEBUG&&!v.isUndefined(fe)&&fe){var t=["Mixpanel error:"].concat(v.toArray(arguments));try{fe.error.apply(fe,t)}catch{v.each(t,function(n){fe.error(n)})}}},critical:function(){if(!v.isUndefined(fe)&&fe){var t=["Mixpanel error:"].concat(v.toArray(arguments));try{fe.error.apply(fe,t)}catch{v.each(t,function(n){fe.error(n)})}}}},Ji=function(t,e){return function(){return arguments[0]="["+e+"] "+arguments[0],t.apply(ee,arguments)}},ii=function(t){return{log:Ji(ee.log,t),error:Ji(ee.error,t),critical:Ji(ee.critical,t)}};v.bind=function(t,e){var n,i;if(Wi&&t.bind===Wi)return Wi.apply(t,_t.call(arguments,1));if(!v.isFunction(t))throw new TypeError;return n=_t.call(arguments,2),i=function(){if(!(this instanceof i))return t.apply(e,n.concat(_t.call(arguments)));var s={};s.prototype=t.prototype;var o=new s;s.prototype=null;var a=t.apply(o,n.concat(_t.call(arguments)));return Object(a)===a?a:o},i},v.each=function(t,e,n){if(t!=null){if(No&&t.forEach===No)t.forEach(e,n);else if(t.length===+t.length){for(var i=0,s=t.length;i<s;i++)if(i in t&&e.call(n,t[i],i,t)===Qi)return}else for(var o in t)if(ei.call(t,o)&&e.call(n,t[o],o,t)===Qi)return}},v.extend=function(t){return v.each(_t.call(arguments,1),function(e){for(var n in e)e[n]!==void 0&&(t[n]=e[n])}),t},v.isArray=Bl||function(t){return En.call(t)==="[object Array]"},v.isFunction=function(t){try{return/^\s*\bfunction\b/.test(t)}catch{return!1}},v.isArguments=function(t){return!!(t&&ei.call(t,"callee"))},v.toArray=function(t){return t?t.toArray?t.toArray():v.isArray(t)||v.isArguments(t)?_t.call(t):v.values(t):[]},v.map=function(t,e,n){if(Uo&&t.map===Uo)return t.map(e,n);var i=[];return v.each(t,function(s){i.push(e.call(n,s))}),i},v.keys=function(t){var e=[];return t===null||v.each(t,function(n,i){e[e.length]=i}),e},v.values=function(t){var e=[];return t===null||v.each(t,function(n){e[e.length]=n}),e},v.include=function(t,e){var n=!1;return t===null?n:Oo&&t.indexOf===Oo?t.indexOf(e)!=-1:(v.each(t,function(i){if(n||(n=i===e))return Qi}),n)},v.includes=function(t,e){return t.indexOf(e)!==-1},v.inherit=function(t,e){return t.prototype=new e,t.prototype.constructor=t,t.superclass=e.prototype,t},v.isObject=function(t){return t===Object(t)&&!v.isArray(t)},v.isEmptyObject=function(t){if(v.isObject(t)){for(var e in t)if(ei.call(t,e))return!1;return!0}return!1},v.isUndefined=function(t){return t===void 0},v.isString=function(t){return En.call(t)=="[object String]"},v.isDate=function(t){return En.call(t)=="[object Date]"},v.isNumber=function(t){return En.call(t)=="[object Number]"},v.isElement=function(t){return!!(t&&t.nodeType===1)},v.encodeDates=function(t){return v.each(t,function(e,n){v.isDate(e)?t[n]=v.formatDate(e):v.isObject(e)&&(t[n]=v.encodeDates(e))}),t},v.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},v.formatDate=function(t){function e(n){return n<10?"0"+n:n}return t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())},v.strip_empty_properties=function(t){var e={};return v.each(t,function(n,i){v.isString(n)&&n.length>0&&(e[i]=n)}),e},v.truncate=function(t,e){var n;return typeof t=="string"?n=t.slice(0,e):v.isArray(t)?(n=[],v.each(t,function(i){n.push(v.truncate(i,e))})):v.isObject(t)?(n={},v.each(t,function(i,s){n[s]=v.truncate(i,e)})):n=t,n},v.JSONEncode=function(){return function(t){var e=t,n=function(s){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(s)?'"'+s.replace(o,function(c){var l=a[c];return typeof l=="string"?l:"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+s+'"'},i=function(s,o){var a="",c=" ",l=0,m="",p="",y=0,b=a,g=[],w=o[s];switch(w&&typeof w=="object"&&typeof w.toJSON=="function"&&(w=w.toJSON(s)),typeof w){case"string":return n(w);case"number":return isFinite(w)?String(w):"null";case"boolean":case"null":return String(w);case"object":if(!w)return"null";if(a+=c,g=[],En.apply(w)==="[object Array]"){for(y=w.length,l=0;l<y;l+=1)g[l]=i(l,w)||"null";return p=g.length===0?"[]":a?`[
1269
+ ***************************************************************************** */function t(m,p,y,b){function g(w){return w instanceof y?w:new y(function(f){f(w)})}return new(y||(y=Promise))(function(w,f){function k(M){try{A(b.next(M))}catch(E){f(E)}}function x(M){try{A(b.throw(M))}catch(E){f(E)}}function A(M){M.done?w(M.value):g(M.value).then(k,x)}A((b=b.apply(m,[])).next())})}for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=typeof Uint8Array>"u"?[]:new Uint8Array(256),i=0;i<e.length;i++)n[e.charCodeAt(i)]=i;var s=function(m){var p=new Uint8Array(m),y,b=p.length,g="";for(y=0;y<b;y+=3)g+=e[p[y]>>2],g+=e[(p[y]&3)<<4|p[y+1]>>4],g+=e[(p[y+1]&15)<<2|p[y+2]>>6],g+=e[p[y+2]&63];return b%3===2?g=g.substring(0,g.length-1)+"=":b%3===1&&(g=g.substring(0,g.length-2)+"=="),g};const o=new Map,a=new Map;function c(m,p,y){return t(this,void 0,void 0,function*(){const b=`${m}-${p}`;if("OffscreenCanvas"in globalThis){if(a.has(b))return a.get(b);const g=new OffscreenCanvas(m,p);g.getContext("2d");const f=yield(yield g.convertToBlob(y)).arrayBuffer(),k=s(f);return a.set(b,k),k}else return""})}const l=self;l.onmessage=function(m){return t(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:p,bitmap:y,width:b,height:g,dataURLOptions:w}=m.data,f=c(b,g,w),k=new OffscreenCanvas(b,g);k.getContext("2d").drawImage(y,0,0),y.close();const A=yield k.convertToBlob(w),M=A.type,E=yield A.arrayBuffer(),D=s(E);if(!o.has(p)&&(yield f)===D)return o.set(p,D),l.postMessage({id:p});if(o.get(p)===D)return l.postMessage({id:p});l.postMessage({id:p,type:M,base64:D,width:b,height:g}),o.set(p,D)}else return l.postMessage({id:m.data.id})})}})()});class El{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,m)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(m)};const{sampling:n="all",win:i,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:c}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&n==="all"&&this.initCanvasMutationObserver(i,s,o),a&&typeof n=="number"&&this.initCanvasFPSObserver(n,i,s,o,{dataURLOptions:c})}initCanvasFPSObserver(e,n,i,s,o){const a=Io(n,i,s,!0),c=new Map,l=new _l;l.onmessage=w=>{const{id:f}=w.data;if(c.set(f,!1),!("base64"in w.data))return;const{base64:k,type:x,width:A,height:M}=w.data;this.mutationCb({id:f,type:dn["2D"],commands:[{property:"clearRect",args:[0,0,A,M]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:k}],type:x}]},0,0]}]})};const m=1e3/e;let p=0,y;const b=()=>{const w=[];return n.document.querySelectorAll("canvas").forEach(f=>{Oe(f,i,s,!0)||w.push(f)}),w},g=w=>{if(p&&w-p<m){y=requestAnimationFrame(g);return}p=w,b().forEach(f=>yl(this,void 0,void 0,function*(){var k;const x=this.mirror.getId(f);if(c.get(x)||f.width===0||f.height===0)return;if(c.set(x,!0),["webgl","webgl2"].includes(f.__context)){const M=f.getContext(f.__context);((k=M==null?void 0:M.getContextAttributes())===null||k===void 0?void 0:k.preserveDrawingBuffer)===!1&&M.clear(M.COLOR_BUFFER_BIT)}const A=yield createImageBitmap(f);l.postMessage({id:x,bitmap:A,width:f.width,height:f.height,dataURLOptions:o.dataURLOptions},[A])})),y=requestAnimationFrame(g)};y=requestAnimationFrame(g),this.resetObservers=()=>{a(),cancelAnimationFrame(y)}}initCanvasMutationObserver(e,n,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=Io(e,n,i,!1),o=Sl(this.processMutation.bind(this),e,n,i),a=Al(this.processMutation.bind(this),e,n,i,this.mirror);this.resetObservers=()=>{s(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=n=>{this.rafStamps.latestId=n,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,n)=>{const i=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,i)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,n){if(this.frozen||this.locked)return;const i=this.pendingCanvasMutations.get(e);if(!i||n===-1)return;const s=i.map(a=>gl(a,["type"])),{type:o}=i[0];this.mutationCb({id:n,type:o,commands:s}),this.pendingCanvasMutations.delete(e)}}class Pl{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Jr,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const i={id:n,styleIds:[]},s=[];for(const o of e){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),s.push({styleId:a,rules:Array.from(o.rules||CSSRule,(c,l)=>({rule:Ys(c),index:l}))})),i.styleIds.push(a)}s.length>0&&(i.styles=s),this.adoptedStyleSheetCb(i)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Il{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(e,n){const i=this.nodeMap.get(e);return i&&Array.from(i).some(s=>s!==n)}add(e,n){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function be(t){return Object.assign(Object.assign({},t),{timestamp:zn()})}let he,Yn,qi,Xn=!1;const tt=Ar();function Tn(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:l="rr-mask",maskTextSelector:m=null,inlineStylesheet:p=!0,maskAllInputs:y,maskInputOptions:b,slimDOMOptions:g,maskInputFn:w,maskTextFn:f,hooks:k,packFn:x,sampling:A={},dataURLOptions:M={},mousemoveWait:E,recordDOM:D=!0,recordCanvas:F=!1,recordCrossOriginIframes:W=!1,recordAfter:G=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:Q=!1,collectFonts:de=!1,inlineImages:_e=!1,plugins:j,keepIframeSrcFn:Ue=()=>!1,ignoreCSSAttributes:ge=new Set([]),errorHandler:Ge}=t;tl(Ge);const Se=W?window.parent===window:!0;let yt=!1;if(!Se)try{window.parent.document&&(yt=!1)}catch{yt=!0}if(Se&&!e)throw new Error("emit function is required");E!==void 0&&A.mousemove===void 0&&(A.mousemove=E),tt.reset();const dt=y===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:b!==void 0?b:{password:!0},Ct=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all"}:g||{};Qr();let qt,Nt=0;const je=R=>{for(const ye of j||[])ye.eventProcessor&&(R=ye.eventProcessor(R));return x&&!yt&&(R=x(R)),R};he=(R,ye)=>{var ie;if(!((ie=Kt[0])===null||ie===void 0)&&ie.isFrozen()&&R.type!==X.FullSnapshot&&!(R.type===X.IncrementalSnapshot&&R.data.source===J.Mutation)&&Kt.forEach(Ce=>Ce.unfreeze()),Se)e==null||e(je(R),ye);else if(yt){const Ce={type:"rrweb",event:je(R),origin:window.location.origin,isCheckout:ye};window.parent.postMessage(Ce,"*")}if(R.type===X.FullSnapshot)qt=R,Nt=0;else if(R.type===X.IncrementalSnapshot){if(R.data.source===J.Mutation&&R.data.isAttachIframe)return;Nt++;const Ce=i&&Nt>=i,qe=n&&R.timestamp-qt.timestamp>n;(Ce||qe)&&Yn(!0)}};const wt=R=>{he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Mutation},R)}))},Zt=R=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Scroll},R)})),me=R=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.CanvasMutation},R)})),xe=R=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.AdoptedStyleSheet},R)})),Qe=new Pl({mutationCb:wt,adoptedStyleSheetCb:xe}),ze=new bl({mirror:tt,mutationCb:wt,stylesheetManager:Qe,recordCrossOriginIframes:W,wrappedEmit:he});for(const R of j||[])R.getMirror&&R.getMirror({nodeMirror:tt,crossOriginIframeMirror:ze.crossOriginIframeMirror,crossOriginIframeStyleMirror:ze.crossOriginIframeStyleMirror});const Be=new Il;qi=new El({recordCanvas:F,mutationCb:me,win:window,blockClass:s,blockSelector:o,mirror:tt,sampling:A.canvas,dataURLOptions:M});const ut=new fl({mutationCb:wt,scrollCb:Zt,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:m,inlineStylesheet:p,maskInputOptions:dt,dataURLOptions:M,maskTextFn:f,maskInputFn:w,recordCanvas:F,inlineImages:_e,sampling:A,slimDOMOptions:Ct,iframeManager:ze,stylesheetManager:Qe,canvasManager:qi,keepIframeSrcFn:Ue,processedNodeManager:Be},mirror:tt});Yn=(R=!1)=>{if(!D)return;he(be({type:X.Meta,data:{href:window.location.href,width:co(),height:lo()}}),R),Qe.reset(),ut.init(),Kt.forEach(ie=>ie.lock());const ye=Zr(document,{mirror:tt,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:m,inlineStylesheet:p,maskAllInputs:dt,maskTextFn:f,slimDOM:Ct,dataURLOptions:M,recordCanvas:F,inlineImages:_e,onSerialize:ie=>{mo(ie,tt)&&ze.addIframe(ie),po(ie,tt)&&Qe.trackLinkElement(ie),ji(ie)&&ut.addShadowRoot(ie.shadowRoot,document)},onIframeLoad:(ie,Ce)=>{ze.attachIframe(ie,Ce),ut.observeAttachShadow(ie)},onStylesheetLoad:(ie,Ce)=>{Qe.attachLinkElement(ie,Ce)},keepIframeSrcFn:Ue});if(!ye)return console.warn("Failed to snapshot the document");he(be({type:X.FullSnapshot,data:{node:ye,initialOffset:ro(window)}}),R),Kt.forEach(ie=>ie.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Qe.adoptStyleSheets(document.adoptedStyleSheets,tt.getId(document))};try{const R=[],ye=Ce=>{var qe;return Y(vl)({mutationCb:wt,mousemoveCb:(te,Ot)=>he(be({type:X.IncrementalSnapshot,data:{source:Ot,positions:te}})),mouseInteractionCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.MouseInteraction},te)})),scrollCb:Zt,viewportResizeCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.ViewportResize},te)})),inputCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Input},te)})),mediaInteractionCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.MediaInteraction},te)})),styleSheetRuleCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.StyleSheetRule},te)})),styleDeclarationCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.StyleDeclaration},te)})),canvasMutationCb:me,fontCb:te=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Font},te)})),selectionCb:te=>{he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Selection},te)}))},customElementCb:te=>{he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.CustomElement},te)}))},blockClass:s,ignoreClass:a,ignoreSelector:c,maskTextClass:l,maskTextSelector:m,maskInputOptions:dt,inlineStylesheet:p,sampling:A,recordDOM:D,recordCanvas:F,inlineImages:_e,userTriggeredOnInput:Q,collectFonts:de,doc:Ce,maskInputFn:w,maskTextFn:f,keepIframeSrcFn:Ue,blockSelector:o,slimDOMOptions:Ct,dataURLOptions:M,mirror:tt,iframeManager:ze,stylesheetManager:Qe,shadowDomManager:ut,processedNodeManager:Be,canvasManager:qi,ignoreCSSAttributes:ge,plugins:((qe=j==null?void 0:j.filter(te=>te.observer))===null||qe===void 0?void 0:qe.map(te=>({observer:te.observer,options:te.options,callback:Ot=>he(be({type:X.Plugin,data:{plugin:te.name,payload:Ot}}))})))||[]},k)};ze.addLoadListener(Ce=>{try{R.push(ye(Ce.contentDocument))}catch(qe){console.warn(qe)}});const ie=()=>{Yn(),R.push(ye(document)),Xn=!0};return document.readyState==="interactive"||document.readyState==="complete"?ie():(R.push(Ne("DOMContentLoaded",()=>{he(be({type:X.DomContentLoaded,data:{}})),G==="DOMContentLoaded"&&ie()})),R.push(Ne("load",()=>{he(be({type:X.Load,data:{}})),G==="load"&&ie()},window))),()=>{R.forEach(Ce=>Ce()),Be.destroy(),Xn=!1,nl()}}catch(R){console.warn(R)}}Tn.addCustomEvent=(t,e)=>{if(!Xn)throw new Error("please add custom event after start recording");he(be({type:X.Custom,data:{tag:t,payload:e}}))},Tn.freezePage=()=>{Kt.forEach(t=>t.freeze())},Tn.takeFullSnapshot=t=>{if(!Xn)throw new Error("please take full snapshot after start recording");Yn(t)},Tn.mirror=tt;var Bo=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Bo||{}),rt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(rt||{}),vt={DEBUG:!1,LIB_VERSION:"2.55.1"},O;if(typeof window>"u"){var Ho={hostname:""};O={navigator:{userAgent:"",onLine:!0},document:{location:Ho,referrer:""},screen:{width:0,height:0},location:Ho}}else O=window;var _n=24*60*60*1e3,Zi=8*1e3,$n=Array.prototype,Dl=Function.prototype,Ro=Object.prototype,_t=$n.slice,En=Ro.toString,ei=Ro.hasOwnProperty,fe=O.console,Et=O.navigator,oe=O.document,ti=O.opera,ni=O.screen,lt=Et.userAgent,Wi=Dl.bind,No=$n.forEach,Oo=$n.indexOf,Uo=$n.map,Bl=Array.isArray,Qi={},v={trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},ee={log:function(){if(vt.DEBUG&&!v.isUndefined(fe)&&fe)try{fe.log.apply(fe,arguments)}catch{v.each(arguments,function(e){fe.log(e)})}},warn:function(){if(vt.DEBUG&&!v.isUndefined(fe)&&fe){var t=["Mixpanel warning:"].concat(v.toArray(arguments));try{fe.warn.apply(fe,t)}catch{v.each(t,function(n){fe.warn(n)})}}},error:function(){if(vt.DEBUG&&!v.isUndefined(fe)&&fe){var t=["Mixpanel error:"].concat(v.toArray(arguments));try{fe.error.apply(fe,t)}catch{v.each(t,function(n){fe.error(n)})}}},critical:function(){if(!v.isUndefined(fe)&&fe){var t=["Mixpanel error:"].concat(v.toArray(arguments));try{fe.error.apply(fe,t)}catch{v.each(t,function(n){fe.error(n)})}}}},Ji=function(t,e){return function(){return arguments[0]="["+e+"] "+arguments[0],t.apply(ee,arguments)}},ii=function(t){return{log:Ji(ee.log,t),error:Ji(ee.error,t),critical:Ji(ee.critical,t)}};v.bind=function(t,e){var n,i;if(Wi&&t.bind===Wi)return Wi.apply(t,_t.call(arguments,1));if(!v.isFunction(t))throw new TypeError;return n=_t.call(arguments,2),i=function(){if(!(this instanceof i))return t.apply(e,n.concat(_t.call(arguments)));var s={};s.prototype=t.prototype;var o=new s;s.prototype=null;var a=t.apply(o,n.concat(_t.call(arguments)));return Object(a)===a?a:o},i},v.each=function(t,e,n){if(t!=null){if(No&&t.forEach===No)t.forEach(e,n);else if(t.length===+t.length){for(var i=0,s=t.length;i<s;i++)if(i in t&&e.call(n,t[i],i,t)===Qi)return}else for(var o in t)if(ei.call(t,o)&&e.call(n,t[o],o,t)===Qi)return}},v.extend=function(t){return v.each(_t.call(arguments,1),function(e){for(var n in e)e[n]!==void 0&&(t[n]=e[n])}),t},v.isArray=Bl||function(t){return En.call(t)==="[object Array]"},v.isFunction=function(t){try{return/^\s*\bfunction\b/.test(t)}catch{return!1}},v.isArguments=function(t){return!!(t&&ei.call(t,"callee"))},v.toArray=function(t){return t?t.toArray?t.toArray():v.isArray(t)||v.isArguments(t)?_t.call(t):v.values(t):[]},v.map=function(t,e,n){if(Uo&&t.map===Uo)return t.map(e,n);var i=[];return v.each(t,function(s){i.push(e.call(n,s))}),i},v.keys=function(t){var e=[];return t===null||v.each(t,function(n,i){e[e.length]=i}),e},v.values=function(t){var e=[];return t===null||v.each(t,function(n){e[e.length]=n}),e},v.include=function(t,e){var n=!1;return t===null?n:Oo&&t.indexOf===Oo?t.indexOf(e)!=-1:(v.each(t,function(i){if(n||(n=i===e))return Qi}),n)},v.includes=function(t,e){return t.indexOf(e)!==-1},v.inherit=function(t,e){return t.prototype=new e,t.prototype.constructor=t,t.superclass=e.prototype,t},v.isObject=function(t){return t===Object(t)&&!v.isArray(t)},v.isEmptyObject=function(t){if(v.isObject(t)){for(var e in t)if(ei.call(t,e))return!1;return!0}return!1},v.isUndefined=function(t){return t===void 0},v.isString=function(t){return En.call(t)=="[object String]"},v.isDate=function(t){return En.call(t)=="[object Date]"},v.isNumber=function(t){return En.call(t)=="[object Number]"},v.isElement=function(t){return!!(t&&t.nodeType===1)},v.encodeDates=function(t){return v.each(t,function(e,n){v.isDate(e)?t[n]=v.formatDate(e):v.isObject(e)&&(t[n]=v.encodeDates(e))}),t},v.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},v.formatDate=function(t){function e(n){return n<10?"0"+n:n}return t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())},v.strip_empty_properties=function(t){var e={};return v.each(t,function(n,i){v.isString(n)&&n.length>0&&(e[i]=n)}),e},v.truncate=function(t,e){var n;return typeof t=="string"?n=t.slice(0,e):v.isArray(t)?(n=[],v.each(t,function(i){n.push(v.truncate(i,e))})):v.isObject(t)?(n={},v.each(t,function(i,s){n[s]=v.truncate(i,e)})):n=t,n},v.JSONEncode=function(){return function(t){var e=t,n=function(s){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(s)?'"'+s.replace(o,function(c){var l=a[c];return typeof l=="string"?l:"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+s+'"'},i=function(s,o){var a="",c=" ",l=0,m="",p="",y=0,b=a,g=[],w=o[s];switch(w&&typeof w=="object"&&typeof w.toJSON=="function"&&(w=w.toJSON(s)),typeof w){case"string":return n(w);case"number":return isFinite(w)?String(w):"null";case"boolean":case"null":return String(w);case"object":if(!w)return"null";if(a+=c,g=[],En.apply(w)==="[object Array]"){for(y=w.length,l=0;l<y;l+=1)g[l]=i(l,w)||"null";return p=g.length===0?"[]":a?`[
1270
1270
  `+a+g.join(`,
1271
1271
  `+a)+`
1272
1272
  `+b+"]":"["+g.join(",")+"]",a=b,p}for(m in w)ei.call(w,m)&&(p=i(m,w),p&&g.push(n(m)+(a?": ":":")+p));return p=g.length===0?"{}":a?"{"+g.join(",")+b+"}":"{"+g.join(",")+"}",a=b,p}};return i("",{"":e})}}(),v.JSONDecode=function(){var t,e,n={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
1273
1273
  `,r:"\r",t:" "},i,s=function(g){var w=new SyntaxError(g);throw w.at=t,w.text=i,w},o=function(g){return g&&g!==e&&s("Expected '"+g+"' instead of '"+e+"'"),e=i.charAt(t),t+=1,e},a=function(){var g,w="";for(e==="-"&&(w="-",o("-"));e>="0"&&e<="9";)w+=e,o();if(e===".")for(w+=".";o()&&e>="0"&&e<="9";)w+=e;if(e==="e"||e==="E")for(w+=e,o(),(e==="-"||e==="+")&&(w+=e,o());e>="0"&&e<="9";)w+=e,o();if(g=+w,!isFinite(g))s("Bad number");else return g},c=function(){var g,w,f="",k;if(e==='"')for(;o();){if(e==='"')return o(),f;if(e==="\\")if(o(),e==="u"){for(k=0,w=0;w<4&&(g=parseInt(o(),16),!!isFinite(g));w+=1)k=k*16+g;f+=String.fromCharCode(k)}else if(typeof n[e]=="string")f+=n[e];else break;else f+=e}s("Bad string")},l=function(){for(;e&&e<=" ";)o()},m=function(){switch(e){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}s('Unexpected "'+e+'"')},p,y=function(){var g=[];if(e==="["){if(o("["),l(),e==="]")return o("]"),g;for(;e;){if(g.push(p()),l(),e==="]")return o("]"),g;o(","),l()}}s("Bad array")},b=function(){var g,w={};if(e==="{"){if(o("{"),l(),e==="}")return o("}"),w;for(;e;){if(g=c(),l(),o(":"),Object.hasOwnProperty.call(w,g)&&s('Duplicate key "'+g+'"'),w[g]=p(),l(),e==="}")return o("}"),w;o(","),l()}}s("Bad object")};return p=function(){switch(l(),e){case"{":return b();case"[":return y();case'"':return c();case"-":return a();default:return e>="0"&&e<="9"?a():m()}},function(g){var w;return i=g,t=0,e=" ",w=p(),l(),e&&s("Syntax error"),w}}(),v.base64Encode=function(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n,i,s,o,a,c,l,m,p=0,y=0,b="",g=[];if(!t)return t;t=v.utf8Encode(t);do n=t.charCodeAt(p++),i=t.charCodeAt(p++),s=t.charCodeAt(p++),m=n<<16|i<<8|s,o=m>>18&63,a=m>>12&63,c=m>>6&63,l=m&63,g[y++]=e.charAt(o)+e.charAt(a)+e.charAt(c)+e.charAt(l);while(p<t.length);switch(b=g.join(""),t.length%3){case 1:b=b.slice(0,-2)+"==";break;case 2:b=b.slice(0,-1)+"=";break}return b},v.utf8Encode=function(t){t=(t+"").replace(/\r\n/g,`
1274
1274
  `).replace(/\r/g,`
1275
- `);var e="",n,i,s=0,o;for(n=i=0,s=t.length,o=0;o<s;o++){var a=t.charCodeAt(o),c=null;a<128?i++:a>127&&a<2048?c=String.fromCharCode(a>>6|192,a&63|128):c=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),c!==null&&(i>n&&(e+=t.substring(n,i)),e+=c,n=i=o+1)}return i>n&&(e+=t.substring(n,t.length)),e},v.UUID=function(){var t=function(){var i=1*new Date,s;if(O.performance&&O.performance.now)s=O.performance.now();else for(s=0;i==1*new Date;)s++;return i.toString(16)+Math.floor(s).toString(16)},e=function(){return Math.random().toString(16).replace(".","")},n=function(){var i=lt,s,o,a=[],c=0;function l(m,p){var y,b=0;for(y=0;y<p.length;y++)b|=a[y]<<y*8;return m^b}for(s=0;s<i.length;s++)o=i.charCodeAt(s),a.unshift(o&255),a.length>=4&&(c=l(c,a),a=[]);return a.length>0&&(c=l(c,a)),c.toString(16)};return function(){var i=(ni.height*ni.width).toString(16);return t()+"-"+e()+"-"+n()+"-"+i+"-"+t()}}();var Vo=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];v.isBlockedUA=function(t){var e;for(t=t.toLowerCase(),e=0;e<Vo.length;e++)if(t.indexOf(Vo[e])!==-1)return!0;return!1},v.HTTPBuildQuery=function(t,e){var n,i,s=[];return v.isUndefined(e)&&(e="&"),v.each(t,function(o,a){n=encodeURIComponent(o.toString()),i=encodeURIComponent(a),s[s.length]=i+"="+n}),s.join(e)},v.getQueryParam=function(t,e){e=e.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var n="[\\?&]"+e+"=([^&#]*)",i=new RegExp(n),s=i.exec(t);if(s===null||s&&typeof s[1]!="string"&&s[1].length)return"";var o=s[1];try{o=decodeURIComponent(o)}catch{ee.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},v.cookie={get:function(t){for(var e=t+"=",n=oe.cookie.split(";"),i=0;i<n.length;i++){for(var s=n[i];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}return null},parse:function(t){var e;try{e=v.JSONDecode(v.cookie.get(t))||{}}catch{}return e},set_seconds:function(t,e,n,i,s,o,a){var c="",l="",m="";if(a)c="; domain="+a;else if(i){var p=Fo(oe.location.hostname);c=p?"; domain=."+p:""}if(n){var y=new Date;y.setTime(y.getTime()+n*1e3),l="; expires="+y.toGMTString()}o&&(s=!0,m="; SameSite=None"),s&&(m+="; secure"),oe.cookie=t+"="+encodeURIComponent(e)+l+"; path=/"+c+m},set:function(t,e,n,i,s,o,a){var c="",l="",m="";if(a)c="; domain="+a;else if(i){var p=Fo(oe.location.hostname);c=p?"; domain=."+p:""}if(n){var y=new Date;y.setTime(y.getTime()+n*24*60*60*1e3),l="; expires="+y.toGMTString()}o&&(s=!0,m="; SameSite=None"),s&&(m+="; secure");var b=t+"="+encodeURIComponent(e)+l+"; path=/"+c+m;return oe.cookie=b,b},remove:function(t,e,n){v.cookie.set(t,"",-1,e,!1,!1,n)}};var Yi=null,si=function(t,e){if(Yi!==null&&!e)return Yi;var n=!0;try{t=t||window.localStorage;var i="__mplss_"+Xi(8),s="xyz";t.setItem(i,s),t.getItem(i)!==s&&(n=!1),t.removeItem(i)}catch{n=!1}return Yi=n,n};v.localStorage={is_supported:function(t){var e=si(null,t);return e||ee.error("localStorage unsupported; falling back to cookie store"),e},error:function(t){ee.error("localStorage error: "+t)},get:function(t){try{return window.localStorage.getItem(t)}catch(e){v.localStorage.error(e)}return null},parse:function(t){try{return v.JSONDecode(v.localStorage.get(t))||{}}catch{}return null},set:function(t,e){try{window.localStorage.setItem(t,e)}catch(n){v.localStorage.error(n)}},remove:function(t){try{window.localStorage.removeItem(t)}catch(e){v.localStorage.error(e)}}},v.register_event=function(){var t=function(i,s,o,a,c){if(!i){ee.error("No valid element provided to register_event");return}if(i.addEventListener&&!a)i.addEventListener(s,o,!!c);else{var l="on"+s,m=i[l];i[l]=e(i,o,m)}};function e(i,s,o){var a=function(c){if(c=c||n(window.event),!!c){var l=!0,m,p;return v.isFunction(o)&&(m=o(c)),p=s.call(i,c),(m===!1||p===!1)&&(l=!1),l}};return a}function n(i){return i&&(i.preventDefault=n.preventDefault,i.stopPropagation=n.stopPropagation),i}return n.preventDefault=function(){this.returnValue=!1},n.stopPropagation=function(){this.cancelBubble=!0},t}();var Hl=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');v.dom_query=function(){function t(s){return s.all?s.all:s.getElementsByTagName("*")}var e=/[\t\r\n]/g;function n(s,o){var a=" "+o+" ";return(" "+s.className+" ").replace(e," ").indexOf(a)>=0}function i(s){if(!oe.getElementsByTagName)return[];var o=s.split(" "),a,c,l,m,p,y,b,g,w,f,k=[oe];for(y=0;y<o.length;y++){if(a=o[y].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){c=a.split("#"),l=c[0];var x=c[1],A=oe.getElementById(x);if(!A||l&&A.nodeName.toLowerCase()!=l)return[];k=[A];continue}if(a.indexOf(".")>-1){c=a.split("."),l=c[0];var M=c[1];for(l||(l="*"),m=[],p=0,b=0;b<k.length;b++)for(l=="*"?w=t(k[b]):w=k[b].getElementsByTagName(l),g=0;g<w.length;g++)m[p++]=w[g];for(k=[],f=0,b=0;b<m.length;b++)m[b].className&&v.isString(m[b].className)&&n(m[b],M)&&(k[f++]=m[b]);continue}var E=a.match(Hl);if(E){l=E[1];var D=E[2],F=E[3],W=E[4];for(l||(l="*"),m=[],p=0,b=0;b<k.length;b++)for(l=="*"?w=t(k[b]):w=k[b].getElementsByTagName(l),g=0;g<w.length;g++)m[p++]=w[g];k=[],f=0;var G;switch(F){case"=":G=function(Q){return Q.getAttribute(D)==W};break;case"~":G=function(Q){return Q.getAttribute(D).match(new RegExp("\\b"+W+"\\b"))};break;case"|":G=function(Q){return Q.getAttribute(D).match(new RegExp("^"+W+"-?"))};break;case"^":G=function(Q){return Q.getAttribute(D).indexOf(W)===0};break;case"$":G=function(Q){return Q.getAttribute(D).lastIndexOf(W)==Q.getAttribute(D).length-W.length};break;case"*":G=function(Q){return Q.getAttribute(D).indexOf(W)>-1};break;default:G=function(Q){return Q.getAttribute(D)}}for(k=[],f=0,b=0;b<m.length;b++)G(m[b])&&(k[f++]=m[b]);continue}for(l=a,m=[],p=0,b=0;b<k.length;b++)for(w=k[b].getElementsByTagName(l),g=0;g<w.length;g++)m[p++]=w[g];k=m}return k}return function(s){return v.isElement(s)?[s]:v.isObject(s)&&!v.isUndefined(s.length)?s:i.call(this,s)}}();var Rl=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],Nl=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];v.info={campaignParams:function(t){var e="",n={};return v.each(Rl,function(i){e=v.getQueryParam(oe.URL,i),e.length?n[i]=e:t!==void 0&&(n[i]=t)}),n},clickParams:function(){var t="",e={};return v.each(Nl,function(n){t=v.getQueryParam(oe.URL,n),t.length&&(e[n]=t)}),e},marketingParams:function(){return v.extend(v.info.campaignParams(),v.info.clickParams())},searchEngine:function(t){return t.search("https?://(.*)google.([^/?]*)")===0?"google":t.search("https?://(.*)bing.com")===0?"bing":t.search("https?://(.*)yahoo.com")===0?"yahoo":t.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(t){var e=v.info.searchEngine(t),n=e!="yahoo"?"q":"p",i={};if(e!==null){i.$search_engine=e;var s=v.getQueryParam(t,n);s.length&&(i.mp_keyword=s)}return i},browser:function(t,e,n){return e=e||"",n||v.includes(t," OPR/")?v.includes(t,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":v.includes(t,"IEMobile")||v.includes(t,"WPDesktop")?"Internet Explorer Mobile":v.includes(t,"SamsungBrowser/")?"Samsung Internet":v.includes(t,"Edge")||v.includes(t,"Edg/")?"Microsoft Edge":v.includes(t,"FBIOS")?"Facebook Mobile":v.includes(t,"Chrome")?"Chrome":v.includes(t,"CriOS")?"Chrome iOS":v.includes(t,"UCWEB")||v.includes(t,"UCBrowser")?"UC Browser":v.includes(t,"FxiOS")?"Firefox iOS":v.includes(e,"Apple")?v.includes(t,"Mobile")?"Mobile Safari":"Safari":v.includes(t,"Android")?"Android Mobile":v.includes(t,"Konqueror")?"Konqueror":v.includes(t,"Firefox")?"Firefox":v.includes(t,"MSIE")||v.includes(t,"Trident/")?"Internet Explorer":v.includes(t,"Gecko")?"Mozilla":""},browserVersion:function(t,e,n){var i=v.info.browser(t,e,n),s={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},o=s[i];if(o===void 0)return null;var a=t.match(o);return a?parseFloat(a[a.length-2]):null},os:function(){var t=lt;return/Windows/i.test(t)?/Phone/.test(t)||/WPDesktop/.test(t)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(t)?"iOS":/Android/.test(t)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":/Mac/i.test(t)?"Mac OS X":/Linux/.test(t)?"Linux":/CrOS/.test(t)?"Chrome OS":""},device:function(t){return/Windows Phone/i.test(t)||/WPDesktop/.test(t)?"Windows Phone":/iPad/.test(t)?"iPad":/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":/Android/.test(t)?"Android":""},referringDomain:function(t){var e=t.split("/");return e.length>=3?e[2]:""},currentUrl:function(){return O.location.href},properties:function(t){return typeof t!="object"&&(t={}),v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(lt,Et.vendor,ti),$referrer:oe.referrer,$referring_domain:v.info.referringDomain(oe.referrer),$device:v.info.device(lt)}),{$current_url:v.info.currentUrl(),$browser_version:v.info.browserVersion(lt,Et.vendor,ti),$screen_height:ni.height,$screen_width:ni.width,mp_lib:"web",$lib_version:vt.LIB_VERSION,$insert_id:Xi(),time:v.timestamp()/1e3},v.strip_empty_properties(t))},people_properties:function(){return v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(lt,Et.vendor,ti)}),{$browser_version:v.info.browserVersion(lt,Et.vendor,ti)})},mpPageViewProperties:function(){return v.strip_empty_properties({current_page_title:oe.title,current_domain:O.location.hostname,current_url_path:O.location.pathname,current_url_protocol:O.location.protocol,current_url_search:O.location.search})}};var Xi=function(t){var e=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return t?e.substring(0,t):e},Ol=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Ul=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Fo=function(t){var e=Ul,n=t.split("."),i=n[n.length-1];(i.length>4||i==="com"||i==="org")&&(e=Ol);var s=t.match(e);return s?s[0]:""},Vl=function(){var t=O.navigator.onLine;return v.isUndefined(t)||t},oi=null,ai=null;typeof JSON<"u"&&(oi=JSON.stringify,ai=JSON.parse),oi=oi||v.JSONEncode,ai=ai||v.JSONDecode,v.toArray=v.toArray,v.isObject=v.isObject,v.JSONEncode=v.JSONEncode,v.JSONDecode=v.JSONDecode,v.isBlockedUA=v.isBlockedUA,v.isEmptyObject=v.isEmptyObject,v.info=v.info,v.info.device=v.info.device,v.info.browser=v.info.browser,v.info.browserVersion=v.info.browserVersion,v.info.properties=v.info.properties;var Fl="__mp_opt_in_out_";function Kl(t,e){jo(!0,t,e)}function Gl(t,e){jo(!1,t,e)}function jl(t,e){return Go(t,e)==="1"}function Ko(t,e){if(ql(e))return ee.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var n=Go(t,e)==="0";return n&&ee.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function Pt(t){return ts(t,function(e){return this.get_config(e)})}function It(t){return ts(t,function(e){return this._get_config(e)})}function hn(t){return ts(t,function(e){return this._get_config(e)})}function zl(t,e){e=e||{},$i(e).remove(es(t,e),!!e.crossSubdomainCookie,e.cookieDomain)}function $i(t){return t=t||{},t.persistenceType==="localStorage"?v.localStorage:v.cookie}function es(t,e){return e=e||{},(e.persistencePrefix||Fl)+t}function Go(t,e){return $i(e).get(es(t,e))}function ql(t){if(t&&t.ignoreDnt)return!1;var e=t&&t.window||O,n=e.navigator||{},i=!1;return v.each([n.doNotTrack,n.msDoNotTrack,e.doNotTrack],function(s){v.includes([!0,1,"1","yes"],s)&&(i=!0)}),i}function jo(t,e,n){if(!v.isString(e)||!e.length){ee.error("gdpr."+(t?"optIn":"optOut")+" called with an invalid token");return}n=n||{},$i(n).set(es(e,n),t?1:0,v.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&t&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})}function ts(t,e){return function(){var n=!1;try{var i=e.call(this,"token"),s=e.call(this,"ignore_dnt"),o=e.call(this,"opt_out_tracking_persistence_type"),a=e.call(this,"opt_out_tracking_cookie_prefix"),c=e.call(this,"window");i&&(n=Ko(i,{ignoreDnt:s,persistenceType:o,persistencePrefix:a,window:c}))}catch(m){ee.error("Unexpected error when checking tracking opt-out status: "+m)}if(!n)return t.apply(this,arguments);var l=arguments[arguments.length-1];typeof l=="function"&&l(0)}}var Zl=ii("lock"),zo=function(t,e){e=e||{},this.storageKey=t,this.storage=e.storage||window.localStorage,this.pollIntervalMS=e.pollIntervalMS||100,this.timeoutMS=e.timeoutMS||2e3};zo.prototype.withLock=function(t,e,n){!n&&typeof e!="function"&&(n=e,e=null);var i=n||new Date().getTime()+"|"+Math.random(),s=new Date().getTime(),o=this.storageKey,a=this.pollIntervalMS,c=this.timeoutMS,l=this.storage,m=o+":X",p=o+":Y",y=o+":Z",b=function(A){e&&e(A)},g=function(A){if(new Date().getTime()-s>c){Zl.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+i+"]"),l.removeItem(y),l.removeItem(p),k();return}setTimeout(function(){try{A()}catch(M){b(M)}},a*(Math.random()+.1))},w=function(A,M){A()?M():g(function(){w(A,M)})},f=function(){var A=l.getItem(p);if(A&&A!==i)return!1;if(l.setItem(p,i),l.getItem(p)===i)return!0;if(!si(l,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},k=function(){l.setItem(m,i),w(f,function(){if(l.getItem(m)===i){x();return}g(function(){if(l.getItem(p)!==i){k();return}w(function(){return!l.getItem(y)},x)})})},x=function(){l.setItem(y,"1");try{t()}finally{l.removeItem(y),l.getItem(p)===i&&l.removeItem(p),l.getItem(m)===i&&l.removeItem(m)}};try{if(si(l,!0))k();else throw new Error("localStorage support check failed")}catch(A){b(A)}};var qo=ii("batch"),Dt=function(t,e){e=e||{},this.storageKey=t,this.storage=e.storage||window.localStorage,this.reportError=e.errorReporter||v.bind(qo.error,qo),this.lock=new zo(t,{storage:this.storage}),this.usePersistence=e.usePersistence,this.pid=e.pid||null,this.memQueue=[]};Dt.prototype.enqueue=function(t,e,n){var i={id:Xi(),flushAfter:new Date().getTime()+e*2,payload:t};this.usePersistence?this.lock.withLock(v.bind(function(){var o;try{var a=this.readFromStorage();a.push(i),o=this.saveToStorage(a),o&&this.memQueue.push(i)}catch{this.reportError("Error enqueueing item",t),o=!1}n&&n(o)},this),v.bind(function(o){this.reportError("Error acquiring storage lock",o),n&&n(!1)},this),this.pid):(this.memQueue.push(i),n&&n(!0))},Dt.prototype.fillBatch=function(t){var e=this.memQueue.slice(0,t);if(this.usePersistence&&e.length<t){var n=this.readFromStorage();if(n.length){var i={};v.each(e,function(a){i[a.id]=!0});for(var s=0;s<n.length;s++){var o=n[s];if(new Date().getTime()>o.flushAfter&&!i[o.id]&&(o.orphaned=!0,e.push(o),e.length>=t))break}}}return e};var Zo=function(t,e){var n=[];return v.each(t,function(i){i.id&&!e[i.id]&&n.push(i)}),n};Dt.prototype.removeItemsByID=function(t,e){var n={};if(v.each(t,function(s){n[s]=!0}),this.memQueue=Zo(this.memQueue,n),!this.usePersistence)e&&e(!0);else{var i=v.bind(function(){var s;try{var o=this.readFromStorage();if(o=Zo(o,n),s=this.saveToStorage(o),s){o=this.readFromStorage();for(var a=0;a<o.length;a++){var c=o[a];if(c.id&&n[c.id])return this.reportError("Item not removed from storage"),!1}}}catch{this.reportError("Error removing items",t),s=!1}return s},this);this.lock.withLock(function(){var o=i();e&&e(o)},v.bind(function(o){var a=!1;if(this.reportError("Error acquiring storage lock",o),!si(this.storage,!0)&&(a=i(),!a))try{this.storage.removeItem(this.storageKey)}catch(c){this.reportError("Error clearing queue",c)}e&&e(a)},this),this.pid)}};var Wo=function(t,e){var n=[];return v.each(t,function(i){var s=i.id;if(s in e){var o=e[s];o!==null&&(i.payload=o,n.push(i))}else n.push(i)}),n};Dt.prototype.updatePayloads=function(t,e){this.memQueue=Wo(this.memQueue,t),this.usePersistence?this.lock.withLock(v.bind(function(){var i;try{var s=this.readFromStorage();s=Wo(s,t),i=this.saveToStorage(s)}catch{this.reportError("Error updating items",t),i=!1}e&&e(i)},this),v.bind(function(i){this.reportError("Error acquiring storage lock",i),e&&e(!1)},this),this.pid):e&&e(!0)},Dt.prototype.readFromStorage=function(){var t;try{t=this.storage.getItem(this.storageKey),t&&(t=ai(t),v.isArray(t)||(this.reportError("Invalid storage entry:",t),t=null))}catch(e){this.reportError("Error retrieving queue",e),t=null}return t||[]},Dt.prototype.saveToStorage=function(t){try{return this.storage.setItem(this.storageKey,oi(t)),!0}catch(e){return this.reportError("Error saving queue",e),!1}},Dt.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var Wl=10*60*1e3,Pn=ii("batch"),nt=function(t,e){this.errorReporter=e.errorReporter,this.queue=new Dt(t,{errorReporter:v.bind(this.reportError,this),storage:e.storage,usePersistence:e.usePersistence}),this.libConfig=e.libConfig,this.sendRequest=e.sendRequestFunc,this.beforeSendHook=e.beforeSendHook,this.stopAllBatching=e.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=e.flushOnlyOnInterval||!1};nt.prototype.enqueue=function(t,e){this.queue.enqueue(t,this.flushInterval,e)},nt.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},nt.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},nt.prototype.clear=function(){this.queue.clear()},nt.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},nt.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},nt.prototype.scheduleFlush=function(t){this.flushInterval=t,this.stopped||(this.timeoutID=setTimeout(v.bind(function(){this.stopped||this.flush()},this),this.flushInterval))},nt.prototype.flush=function(t){try{if(this.requestInProgress){Pn.log("Flush: Request already in progress");return}t=t||{};var e=this.libConfig.batch_request_timeout_ms,n=new Date().getTime(),i=this.batchSize,s=this.queue.fillBatch(i),o=s.length===i,a=[],c={};if(v.each(s,function(p){var y=p.payload;if(this.beforeSendHook&&!p.orphaned&&(y=this.beforeSendHook(y)),y){y.event&&y.properties&&(y.properties=v.extend({},y.properties,{mp_sent_by_lib_version:vt.LIB_VERSION}));var b=!0,g=p.id;g?(this.itemIdsSentSuccessfully[g]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:p,batchSize:s.length,timesSent:this.itemIdsSentSuccessfully[g]}),b=!1):this.reportError("[dupe] found item with no ID",{item:p}),b&&a.push(y)}c[p.id]=y},this),a.length<1){this.resetFlush();return}this.requestInProgress=!0;var l=v.bind(function(p){this.requestInProgress=!1;try{var y=!1;if(t.unloading)this.queue.updatePayloads(c);else if(v.isObject(p)&&p.error==="timeout"&&new Date().getTime()-n>=e)this.reportError("Network timeout; retrying"),this.flush();else if(v.isObject(p)&&(p.httpStatusCode>=500||p.httpStatusCode===429||p.httpStatusCode<=0&&!Vl()||p.error==="timeout")){var b=this.flushInterval*2;p.retryAfter&&(b=parseInt(p.retryAfter,10)*1e3||b),b=Math.min(Wl,b),this.reportError("Error; retry in "+b+" ms"),this.scheduleFlush(b)}else if(v.isObject(p)&&p.httpStatusCode===413)if(s.length>1){var g=Math.max(1,Math.floor(i/2));this.batchSize=Math.min(this.batchSize,g,s.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",s),this.resetBatchSize(),y=!0;else y=!0;y&&(this.queue.removeItemsByID(v.map(s,function(w){return w.id}),v.bind(function(w){w?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?this.resetFlush():this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this)),v.each(s,v.bind(function(w){var f=w.id;f?(this.itemIdsSentSuccessfully[f]=this.itemIdsSentSuccessfully[f]||0,this.itemIdsSentSuccessfully[f]++,this.itemIdsSentSuccessfully[f]>5&&this.reportError("[dupe] item ID sent too many times",{item:w,batchSize:s.length,timesSent:this.itemIdsSentSuccessfully[f]})):this.reportError("[dupe] found item with no ID while removing",{item:w})},this)))}catch(w){this.reportError("Error handling API response",w),this.resetFlush()}},this),m={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:e};t.unloading&&(m.transport="sendBeacon"),Pn.log("MIXPANEL REQUEST:",a),this.sendRequest(a,m,l)}catch(p){this.reportError("Error flushing request queue",p),this.resetFlush()}},nt.prototype.reportError=function(t,e){if(Pn.error.apply(Pn.error,arguments),this.errorReporter)try{e instanceof Error||(e=new Error(t)),this.errorReporter(t,e)}catch(n){Pn.error(n)}};var Gt=ii("recorder"),Qo=O.CompressionStream,Ql={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},Jl=new Set([rt.MouseMove,rt.MouseInteraction,rt.Scroll,rt.ViewportResize,rt.Input,rt.TouchMove,rt.MediaInteraction,rt.Drag,rt.Selection]);function Yl(t){return t.type===Bo.IncrementalSnapshot&&Jl.has(t.data.source)}var it=function(t){this._mixpanel=t,this._stopRecording=null,this.recEvents=[],this.seqNo=0,this.replayId=null,this.replayStartTime=null,this.sendBatchId=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=_n,this.recordMinMs=0,this._initBatcher()};it.prototype._initBatcher=function(){this.batcher=new nt("__mprec",{libConfig:Ql,sendRequestFunc:v.bind(this.flushEventsWithOptOut,this),errorReporter:v.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},it.prototype.get_config=function(t){return this._mixpanel.get_config(t)},it.prototype.startRecording=function(t){if(this._stopRecording!==null){Gt.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>_n&&(this.recordMaxMs=_n,Gt.critical("record_max_ms cannot be greater than "+_n+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>Zi&&(this.recordMinMs=Zi,Gt.critical("record_min_ms cannot be greater than "+Zi+"ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=new Date().getTime(),this.replayId=v.UUID(),t||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var e=v.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(v.bind(function(){Gt.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),this.get_config("record_idle_timeout_ms"))},this),n=this.get_config("record_block_selector");(n===""||n===null)&&(n=void 0),this._stopRecording=Tn({emit:v.bind(function(i){this.batcher.enqueue(i),Yl(i)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),e())},this),blockClass:this.get_config("record_block_class"),blockSelector:n,collectFonts:this.get_config("record_collect_fonts"),inlineImages:this.get_config("record_inline_images"),maskAllInputs:!0,maskTextClass:this.get_config("record_mask_text_class"),maskTextSelector:this.get_config("record_mask_text_selector")}),e(),this.maxTimeoutId=setTimeout(v.bind(this.resetRecording,this),this.recordMaxMs)},it.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},it.prototype.stopRecording=function(){this._stopRecording!==null&&(this._stopRecording(),this._stopRecording=null),this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),this.replayId=null,clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},it.prototype.flushEventsWithOptOut=function(t,e,n){this._flushEvents(t,e,n,v.bind(this._onOptOut,this))},it.prototype._onOptOut=function(t){t===0&&(this.recEvents=[],this.stopRecording())},it.prototype._sendRequest=function(t,e,n,i){var s=v.bind(function(o,a){o.status===200&&this.replayId===t&&this.seqNo++,i({status:0,httpStatusCode:o.status,responseBody:a,retryAfter:o.headers.get("Retry-After")})},this);O.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(e),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:n}).then(function(o){o.json().then(function(a){s(o,a)}).catch(function(a){i({error:a})})}).catch(function(o){i({error:o,httpStatusCode:0})})},it.prototype._flushEvents=Pt(function(t,e,n){const i=t.length;if(i>0){var s=this.replayId,o=t[0].timestamp;(this.seqNo===0||!this.replayStartTime)&&(this.seqNo!==0&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=o);var a=t[i-1].timestamp-this.replayStartTime,c={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo,batch_start_time:o/1e3,replay_id:s,replay_length_ms:a,replay_start_time:this.replayStartTime/1e3},l=v.JSONEncode(t),m=this._mixpanel.get_property("$device_id");m&&(c.$device_id=m);var p=this._mixpanel.get_property("$user_id");if(p&&(c.$user_id=p),Qo){var y=new Blob([l],{type:"application/json"}).stream(),b=y.pipeThrough(new Qo("gzip"));new Response(b).blob().then(v.bind(function(g){c.format="gzip",this._sendRequest(s,c,g,n)},this))}else c.format="body",this._sendRequest(s,c,l,n)}}),it.prototype.reportError=function(t,e){Gt.error.apply(Gt.error,arguments);try{!e&&!(t instanceof Error)&&(t=new Error(t)),this.get_config("error_reporter")(t,e)}catch(n){Gt.error(n)}},O.__mp_recorder=it;var bt=function(){};bt.prototype.create_properties=function(){},bt.prototype.event_handler=function(){},bt.prototype.after_track_handler=function(){},bt.prototype.init=function(t){return this.mp=t,this},bt.prototype.track=function(t,e,n,i){var s=this,o=v.dom_query(t);if(o.length===0){ee.error("The DOM query ("+t+") returned 0 elements");return}return v.each(o,function(a){v.register_event(a,this.override_event,function(c){var l={},m=s.create_properties(n,this),p=s.mp.get_config("track_links_timeout");s.event_handler(c,this,l),window.setTimeout(s.track_callback(i,m,l,!0),p),s.mp.track(e,m,s.track_callback(i,m,l))})},this),!0},bt.prototype.track_callback=function(t,e,n,i){i=i||!1;var s=this;return function(){n.callback_fired||(n.callback_fired=!0,!(t&&t(i,e)===!1)&&s.after_track_handler(e,n,i))}},bt.prototype.create_properties=function(t,e){var n;return typeof t=="function"?n=t(e):n=v.extend({},t),n};var mn=function(){this.override_event="click"};v.inherit(mn,bt),mn.prototype.create_properties=function(t,e){var n=mn.superclass.create_properties.apply(this,arguments);return e.href&&(n.url=e.href),n},mn.prototype.event_handler=function(t,e,n){n.new_tab=t.which===2||t.metaKey||t.ctrlKey||e.target==="_blank",n.href=e.href,n.new_tab||t.preventDefault()},mn.prototype.after_track_handler=function(t,e){e.new_tab||setTimeout(function(){window.location=e.href},0)};var ri=function(){this.override_event="submit"};v.inherit(ri,bt),ri.prototype.event_handler=function(t,e,n){n.element=e,t.preventDefault()},ri.prototype.after_track_handler=function(t,e){setTimeout(function(){e.element.submit()},0)};var Bt="$set",pn="$set_once",st="$unset",jt="$add",ct="$append",zt="$union",ft="$remove",Xl="$delete",Jo={set_action:function(t,e){var n={},i={};return v.isObject(t)?v.each(t,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[t]=e,n[Bt]=i,n},unset_action:function(t){var e={},n=[];return v.isArray(t)||(t=[t]),v.each(t,function(i){this._is_reserved_property(i)||n.push(i)},this),e[st]=n,e},set_once_action:function(t,e){var n={},i={};return v.isObject(t)?v.each(t,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[t]=e,n[pn]=i,n},union_action:function(t,e){var n={},i={};return v.isObject(t)?v.each(t,function(s,o){this._is_reserved_property(o)||(i[o]=v.isArray(s)?s:[s])},this):i[t]=v.isArray(e)?e:[e],n[zt]=i,n},append_action:function(t,e){var n={},i={};return v.isObject(t)?v.each(t,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[t]=e,n[ct]=i,n},remove_action:function(t,e){var n={},i={};return v.isObject(t)?v.each(t,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[t]=e,n[ft]=i,n},delete_action:function(){var t={};return t[Xl]="",t}},le=function(){};v.extend(le.prototype,Jo),le.prototype._init=function(t,e,n){this._mixpanel=t,this._group_key=e,this._group_id=n},le.prototype.set=hn(function(t,e,n){var i=this.set_action(t,e);return v.isObject(t)&&(n=e),this._send_request(i,n)}),le.prototype.set_once=hn(function(t,e,n){var i=this.set_once_action(t,e);return v.isObject(t)&&(n=e),this._send_request(i,n)}),le.prototype.unset=hn(function(t,e){var n=this.unset_action(t);return this._send_request(n,e)}),le.prototype.union=hn(function(t,e,n){v.isObject(t)&&(n=e);var i=this.union_action(t,e);return this._send_request(i,n)}),le.prototype.delete=hn(function(t){var e=this.delete_action();return this._send_request(e,t)}),le.prototype.remove=hn(function(t,e,n){var i=this.remove_action(t,e);return this._send_request(i,n)}),le.prototype._send_request=function(t,e){t.$group_key=this._group_key,t.$group_id=this._group_id,t.$token=this._get_config("token");var n=v.encodeDates(t);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},e)},le.prototype._is_reserved_property=function(t){return t==="$group_key"||t==="$group_id"},le.prototype._get_config=function(t){return this._mixpanel.get_config(t)},le.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},le.prototype.remove=le.prototype.remove,le.prototype.set=le.prototype.set,le.prototype.set_once=le.prototype.set_once,le.prototype.union=le.prototype.union,le.prototype.unset=le.prototype.unset,le.prototype.toString=le.prototype.toString;var U=function(){};v.extend(U.prototype,Jo),U.prototype._init=function(t){this._mixpanel=t},U.prototype.set=It(function(t,e,n){var i=this.set_action(t,e);return v.isObject(t)&&(n=e),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),i[Bt]=v.extend({},v.info.people_properties(),i[Bt]),this._send_request(i,n)}),U.prototype.set_once=It(function(t,e,n){var i=this.set_once_action(t,e);return v.isObject(t)&&(n=e),this._send_request(i,n)}),U.prototype.unset=It(function(t,e){var n=this.unset_action(t);return this._send_request(n,e)}),U.prototype.increment=It(function(t,e,n){var i={},s={};return v.isObject(t)?(v.each(t,function(o,a){if(!this._is_reserved_property(a))if(isNaN(parseFloat(o))){ee.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else s[a]=o},this),n=e):(v.isUndefined(e)&&(e=1),s[t]=e),i[jt]=s,this._send_request(i,n)}),U.prototype.append=It(function(t,e,n){v.isObject(t)&&(n=e);var i=this.append_action(t,e);return this._send_request(i,n)}),U.prototype.remove=It(function(t,e,n){v.isObject(t)&&(n=e);var i=this.remove_action(t,e);return this._send_request(i,n)}),U.prototype.union=It(function(t,e,n){v.isObject(t)&&(n=e);var i=this.union_action(t,e);return this._send_request(i,n)}),U.prototype.track_charge=It(function(t,e,n){if(!v.isNumber(t)&&(t=parseFloat(t),isNaN(t))){ee.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",v.extend({$amount:t},e),n)}),U.prototype.clear_charges=function(t){return this.set("$transactions",[],t)},U.prototype.delete_user=function(){if(!this._identify_called()){ee.error("mixpanel.people.delete_user() requires you to call identify() first");return}var t={$delete:this._mixpanel.get_distinct_id()};return this._send_request(t)},U.prototype.toString=function(){return this._mixpanel.toString()+".people"},U.prototype._send_request=function(t,e){t.$token=this._get_config("token"),t.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),i=this._mixpanel.get_property("$user_id"),s=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(t.$device_id=n),i&&(t.$user_id=i),s&&(t.$had_persisted_distinct_id=s);var o=v.encodeDates(t);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},e):(this._enqueue(t),v.isUndefined(e)||(this._get_config("verbose")?e({status:-1,error:null}):e(-1)),v.truncate(o,255))},U.prototype._get_config=function(t){return this._mixpanel.get_config(t)},U.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},U.prototype._enqueue=function(t){Bt in t?this._mixpanel.persistence._add_to_people_queue(Bt,t):pn in t?this._mixpanel.persistence._add_to_people_queue(pn,t):st in t?this._mixpanel.persistence._add_to_people_queue(st,t):jt in t?this._mixpanel.persistence._add_to_people_queue(jt,t):ct in t?this._mixpanel.persistence._add_to_people_queue(ct,t):ft in t?this._mixpanel.persistence._add_to_people_queue(ft,t):zt in t?this._mixpanel.persistence._add_to_people_queue(zt,t):ee.error("Invalid call to _enqueue():",t)},U.prototype._flush_one_queue=function(t,e,n,i){var s=this,o=v.extend({},this._mixpanel.persistence.load_queue(t)),a=o;!v.isUndefined(o)&&v.isObject(o)&&!v.isEmptyObject(o)&&(s._mixpanel.persistence._pop_from_people_queue(t,o),s._mixpanel.persistence.save(),i&&(a=i(o)),e.call(s,a,function(c,l){c===0&&s._mixpanel.persistence._add_to_people_queue(t,o),v.isUndefined(n)||n(c,l)}))},U.prototype._flush=function(t,e,n,i,s,o,a){var c=this;this._flush_one_queue(Bt,this.set,t),this._flush_one_queue(pn,this.set_once,i),this._flush_one_queue(st,this.unset,o,function(k){return v.keys(k)}),this._flush_one_queue(jt,this.increment,e),this._flush_one_queue(zt,this.union,s);var l=this._mixpanel.persistence.load_queue(ct);if(!v.isUndefined(l)&&v.isArray(l)&&l.length)for(var m,p=function(k,x){k===0&&c._mixpanel.persistence._add_to_people_queue(ct,m),v.isUndefined(n)||n(k,x)},y=l.length-1;y>=0;y--)l=this._mixpanel.persistence.load_queue(ct),m=l.pop(),c._mixpanel.persistence.save(),v.isEmptyObject(m)||c.append(m,p);var b=this._mixpanel.persistence.load_queue(ft);if(!v.isUndefined(b)&&v.isArray(b)&&b.length)for(var g,w=function(k,x){k===0&&c._mixpanel.persistence._add_to_people_queue(ft,g),v.isUndefined(a)||a(k,x)},f=b.length-1;f>=0;f--)b=this._mixpanel.persistence.load_queue(ft),g=b.pop(),c._mixpanel.persistence.save(),v.isEmptyObject(g)||c.remove(g,w)},U.prototype._is_reserved_property=function(t){return t==="$distinct_id"||t==="$token"||t==="$device_id"||t==="$user_id"||t==="$had_persisted_distinct_id"},U.prototype.set=U.prototype.set,U.prototype.set_once=U.prototype.set_once,U.prototype.unset=U.prototype.unset,U.prototype.increment=U.prototype.increment,U.prototype.append=U.prototype.append,U.prototype.remove=U.prototype.remove,U.prototype.union=U.prototype.union,U.prototype.track_charge=U.prototype.track_charge,U.prototype.clear_charges=U.prototype.clear_charges,U.prototype.delete_user=U.prototype.delete_user,U.prototype.toString=U.prototype.toString;var ns="__mps",is="__mpso",ss="__mpus",os="__mpa",as="__mpap",rs="__mpr",ls="__mpu",Yo="$people_distinct_id",li="__alias",In="__timers",$l=[ns,is,ss,os,as,rs,ls,Yo,li,In],Z=function(t){this.props={},this.campaign_params_saved=!1,t.persistence_name?this.name="mp_"+t.persistence_name:this.name="mp_"+t.token+"_mixpanel";var e=t.persistence;e!=="cookie"&&e!=="localStorage"&&(ee.critical("Unknown persistence type "+e+"; falling back to cookie"),e=t.persistence="cookie"),e==="localStorage"&&v.localStorage.is_supported()?this.storage=v.localStorage:this.storage=v.cookie,this.load(),this.update_config(t),this.upgrade(),this.save()};Z.prototype.properties=function(){var t={};return this.load(),v.each(this.props,function(e,n){v.include($l,n)||(t[n]=e)}),t},Z.prototype.load=function(){if(!this.disabled){var t=this.storage.parse(this.name);t&&(this.props=v.extend({},t))}},Z.prototype.upgrade=function(){var t,e;this.storage===v.localStorage?(t=v.cookie.parse(this.name),v.cookie.remove(this.name),v.cookie.remove(this.name,!0),t&&this.register_once(t)):this.storage===v.cookie&&(e=v.localStorage.parse(this.name),v.localStorage.remove(this.name),e&&this.register_once(e))},Z.prototype.save=function(){this.disabled||this.storage.set(this.name,v.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Z.prototype.load_prop=function(t){return this.load(),this.props[t]},Z.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Z.prototype.clear=function(){this.remove(),this.props={}},Z.prototype.register_once=function(t,e,n){return v.isObject(t)?(typeof e>"u"&&(e="None"),this.expire_days=typeof n>"u"?this.default_expiry:n,this.load(),v.each(t,function(i,s){(!this.props.hasOwnProperty(s)||this.props[s]===e)&&(this.props[s]=i)},this),this.save(),!0):!1},Z.prototype.register=function(t,e){return v.isObject(t)?(this.expire_days=typeof e>"u"?this.default_expiry:e,this.load(),v.extend(this.props,t),this.save(),!0):!1},Z.prototype.unregister=function(t){this.load(),t in this.props&&(delete this.props[t],this.save())},Z.prototype.update_search_keyword=function(t){this.register(v.info.searchInfo(t))},Z.prototype.update_referrer_info=function(t){this.register_once({$initial_referrer:t||"$direct",$initial_referring_domain:v.info.referringDomain(t)||"$direct"},"")},Z.prototype.get_referrer_info=function(){return v.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Z.prototype.update_config=function(t){this.default_expiry=this.expire_days=t.cookie_expiration,this.set_disabled(t.disable_persistence),this.set_cookie_domain(t.cookie_domain),this.set_cross_site(t.cross_site_cookie),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie)},Z.prototype.set_disabled=function(t){this.disabled=t,this.disabled?this.remove():this.save()},Z.prototype.set_cookie_domain=function(t){t!==this.cookie_domain&&(this.remove(),this.cookie_domain=t,this.save())},Z.prototype.set_cross_site=function(t){t!==this.cross_site&&(this.cross_site=t,this.remove(),this.save())},Z.prototype.set_cross_subdomain=function(t){t!==this.cross_subdomain&&(this.cross_subdomain=t,this.remove(),this.save())},Z.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Z.prototype.set_secure=function(t){t!==this.secure&&(this.secure=!!t,this.remove(),this.save())},Z.prototype._add_to_people_queue=function(t,e){var n=this._get_queue_key(t),i=e[t],s=this._get_or_create_queue(Bt),o=this._get_or_create_queue(pn),a=this._get_or_create_queue(st),c=this._get_or_create_queue(jt),l=this._get_or_create_queue(zt),m=this._get_or_create_queue(ft,[]),p=this._get_or_create_queue(ct,[]);n===ns?(v.extend(s,i),this._pop_from_people_queue(jt,i),this._pop_from_people_queue(zt,i),this._pop_from_people_queue(st,i)):n===is?(v.each(i,function(y,b){b in o||(o[b]=y)}),this._pop_from_people_queue(st,i)):n===ss?v.each(i,function(y){v.each([s,o,c,l],function(b){y in b&&delete b[y]}),v.each(p,function(b){y in b&&delete b[y]}),a[y]=!0}):n===os?(v.each(i,function(y,b){b in s?s[b]+=y:(b in c||(c[b]=0),c[b]+=y)},this),this._pop_from_people_queue(st,i)):n===ls?(v.each(i,function(y,b){v.isArray(y)&&(b in l||(l[b]=[]),l[b]=l[b].concat(y))}),this._pop_from_people_queue(st,i)):n===rs?(m.push(i),this._pop_from_people_queue(ct,i)):n===as&&(p.push(i),this._pop_from_people_queue(st,i)),ee.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),ee.log(e),this.save()},Z.prototype._pop_from_people_queue=function(t,e){var n=this.props[this._get_queue_key(t)];v.isUndefined(n)||v.each(e,function(i,s){t===ct||t===ft?v.each(n,function(o){o[s]===i&&delete o[s]}):delete n[s]},this)},Z.prototype.load_queue=function(t){return this.load_prop(this._get_queue_key(t))},Z.prototype._get_queue_key=function(t){if(t===Bt)return ns;if(t===pn)return is;if(t===st)return ss;if(t===jt)return os;if(t===ct)return as;if(t===ft)return rs;if(t===zt)return ls;ee.error("Invalid queue:",t)},Z.prototype._get_or_create_queue=function(t,e){var n=this._get_queue_key(t);return e=v.isUndefined(e)?{}:e,this.props[n]||(this.props[n]=e)},Z.prototype.set_event_timer=function(t,e){var n=this.load_prop(In)||{};n[t]=e,this.props[In]=n,this.save()},Z.prototype.remove_event_timer=function(t){var e=this.load_prop(In)||{},n=e[t];return v.isUndefined(n)||(delete this.props[In][t],this.save()),n};var cs,Xo=function(t,e){throw new Error(t+" not available in this build.")},Ie,$o=0,ec=1,tc=function(t){return t},Dn=function(){},We="mixpanel",ea="base64",nc="json",ds="$device:",vn=O.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,ta=!vn&&lt.indexOf("MSIE")===-1&&lt.indexOf("Mozilla")===-1,ci=null;Et.sendBeacon&&(ci=function(){return Et.sendBeacon.apply(Et,arguments)});var na={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},ia={api_host:"https://api-js.mixpanel.com",api_routes:na,api_method:"POST",api_transport:"XHR",api_payload_format:ea,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Dn,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Dn,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_collect_fonts:!1,record_idle_timeout_ms:30*60*1e3,record_inline_images:!1,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:_n,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},sa=!1,L=function(){},us=function(t,e,n){var i,s=n===We?Ie:Ie[n];if(s&&cs===$o)i=s;else{if(s&&!v.isArray(s)){ee.error("You have already initialized "+n);return}i=new L}if(i._cached_groups={},i._init(t,e,n),i.people=new U,i.people._init(i),!i.get_config("skip_first_touch_marketing")){var o=v.info.campaignParams(null),a={},c=!1;v.each(o,function(l,m){a["initial_"+m]=l,l&&(c=!0)}),c&&i.people.set_once(a)}return vt.DEBUG=vt.DEBUG||i.get_config("debug"),!v.isUndefined(s)&&v.isArray(s)&&(i._execute_array.call(i.people,s.people),i._execute_array(s)),i};L.prototype.init=function(t,e,n){if(v.isUndefined(n)){this.report_error("You must name your new library: init(token, config, name)");return}if(n===We){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var i=us(t,e,n);return Ie[n]=i,i._loaded(),i},L.prototype._init=function(t,e,n){e=e||{},this.__loaded=!0,this.config={};var i={};if(!("api_payload_format"in e)){var s=e.api_host||ia.api_host;s.match(/\.mixpanel\.com/)&&(i.api_payload_format=nc)}if(this.set_config(v.extend({},ia,i,e,{name:n,token:t,callback_fn:(n===We?n:We+"."+n)+"._jsc"})),this._jsc=Dn,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!v.localStorage.is_supported(!0)||!vn)this._batch_requests=!1,ee.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),v.each(this.get_batcher_configs(),function(l){ee.log("Clearing batch queue "+l.queue_key),v.localStorage.remove(l.queue_key)});else if(this.init_batchers(),ci&&O.addEventListener){var o=v.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);O.addEventListener("pagehide",function(l){l.persisted&&o()}),O.addEventListener("visibilitychange",function(){oe.visibilityState==="hidden"&&o()})}}this.persistence=this.cookie=new Z(this.config),this.unpersisted_superprops={},this._gdpr_init();var a=v.UUID();this.get_distinct_id()||this.register_once({distinct_id:ds+a,$device_id:a},"");var c=this.get_config("track_pageview");c&&this._init_url_change_tracking(c),this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent")&&this.start_session_recording()},L.prototype.start_session_recording=Pt(function(){if(!O.MutationObserver){ee.critical("Browser does not support MutationObserver; skipping session recording");return}var t=v.bind(function(){this._recorder=this._recorder||new O.__mp_recorder(this),this._recorder.startRecording()},this);v.isUndefined(O.__mp_recorder)?Xo(this.get_config("recorder_src"),t):t()}),L.prototype.stop_session_recording=function(){this._recorder?this._recorder.stopRecording():ee.critical("Session recorder module not loaded")},L.prototype.get_session_recording_properties=function(){var t={};if(this._recorder){var e=this._recorder.replayId;e&&(t.$mp_replay_id=e)}return t},L.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var t=v.info.campaignParams(null);v.each(t,(function(e,n){this.unregister(n)}).bind(this))}},L.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(oe.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(v.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(oe.referrer)},L.prototype._dom_loaded=function(){v.each(this.__dom_loaded_queue,function(t){this._track_dom.apply(this,t)},this),this.has_opted_out_tracking()||v.each(this.__request_queue,function(t){this._send_request.apply(this,t)},this),delete this.__dom_loaded_queue,delete this.__request_queue},L.prototype._track_dom=function(t,e){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!sa)return this.__dom_loaded_queue.push([t,e]),!1;var n=new t().init(this);return n.track.apply(n,e)},L.prototype._init_url_change_tracking=function(t){var e="",n=this.track_pageview();if(n&&(e=v.info.currentUrl()),v.include(["full-url","url-with-path-and-query-string","url-with-path"],t)){O.addEventListener("popstate",function(){O.dispatchEvent(new Event("mp_locationchange"))}),O.addEventListener("hashchange",function(){O.dispatchEvent(new Event("mp_locationchange"))});var i=O.history.pushState;typeof i=="function"&&(O.history.pushState=function(o,a,c){i.call(O.history,o,a,c),O.dispatchEvent(new Event("mp_locationchange"))});var s=O.history.replaceState;typeof s=="function"&&(O.history.replaceState=function(o,a,c){s.call(O.history,o,a,c),O.dispatchEvent(new Event("mp_locationchange"))}),O.addEventListener("mp_locationchange",(function(){var o=v.info.currentUrl(),a=!1;if(t==="full-url"?a=o!==e:t==="url-with-path-and-query-string"?a=o.split("#")[0]!==e.split("#")[0]:t==="url-with-path"&&(a=o.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0]),a){var c=this.track_pageview();c&&(e=o)}}).bind(this))}},L.prototype._prepare_callback=function(t,e){if(v.isUndefined(t))return null;if(vn){var n=function(a){t(a,e)};return n}else{var i=this._jsc,s=""+Math.floor(Math.random()*1e8),o=this.get_config("callback_fn")+"["+s+"]";return i[s]=function(a){delete i[s],t(a,e)},o}},L.prototype._send_request=function(t,e,n,i){var s=!0;if(ta)return this.__request_queue.push(arguments),s;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},a=null;!i&&(v.isFunction(n)||typeof n=="string")&&(i=n,n=null),n=v.extend(o,n||{}),vn||(n.method="GET");var c=n.method==="POST",l=ci&&c&&n.transport.toLowerCase()==="sendbeacon",m=n.verbose;e.verbose&&(m=!0),this.get_config("test")&&(e.test=1),m&&(e.verbose=1),this.get_config("img")&&(e.img=1),vn||(i?e.callback=i:(m||this.get_config("test"))&&(e.callback="(function(){})")),e.ip=this.get_config("ip")?1:0,e._=new Date().getTime().toString(),c&&(a="data="+encodeURIComponent(e.data),delete e.data),t+="?"+v.HTTPBuildQuery(e);var p=this;if("img"in e){var y=oe.createElement("img");y.src=t,oe.body.appendChild(y)}else if(l){try{s=ci(t,a)}catch(x){p.report_error(x),s=!1}try{i&&i(s?1:0)}catch(x){p.report_error(x)}}else if(vn)try{var b=new XMLHttpRequest;b.open(n.method,t,!0);var g=this.get_config("xhr_headers");if(c&&(g["Content-Type"]="application/x-www-form-urlencoded"),v.each(g,function(x,A){b.setRequestHeader(A,x)}),n.timeout_ms&&typeof b.timeout<"u"){b.timeout=n.timeout_ms;var w=new Date().getTime()}b.withCredentials=!0,b.onreadystatechange=function(){if(b.readyState===4)if(b.status===200){if(i)if(m){var x;try{x=v.JSONDecode(b.responseText)}catch(E){if(p.report_error(E),n.ignore_json_errors)x=b.responseText;else return}i(x)}else i(Number(b.responseText))}else{var A;if(b.timeout&&!b.status&&new Date().getTime()-w>=b.timeout?A="timeout":A="Bad HTTP status: "+b.status+" "+b.statusText,p.report_error(A),i)if(m){var M=b.responseHeaders||{};i({status:0,httpStatusCode:b.status,error:A,retryAfter:M["Retry-After"]})}else i(0)}},b.send(a)}catch(x){p.report_error(x),s=!1}else{var f=oe.createElement("script");f.type="text/javascript",f.async=!0,f.defer=!0,f.src=t;var k=oe.getElementsByTagName("script")[0];k.parentNode.insertBefore(f,k)}return s},L.prototype._execute_array=function(t){var e,n=[],i=[],s=[];v.each(t,function(a){a&&(e=a[0],v.isArray(e)?s.push(a):typeof a=="function"?a.call(this):v.isArray(a)&&e==="alias"?n.push(a):v.isArray(a)&&e.indexOf("track")!==-1&&typeof this[e]=="function"?s.push(a):i.push(a))},this);var o=function(a,c){v.each(a,function(l){if(v.isArray(l[0])){var m=c;v.each(l,function(p){m=m[p[0]].apply(m,p.slice(1))})}else this[l[0]].apply(this,l.slice(1))},c)};o(n,this),o(i,this),o(s,this)},L.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},L.prototype.get_batcher_configs=function(){var t="__mpq_"+this.get_config("token"),e=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+e.track,queue_key:t+"_ev"},people:{type:"people",endpoint:"/"+e.engage,queue_key:t+"_pp"},groups:{type:"groups",endpoint:"/"+e.groups,queue_key:t+"_gr"}},this._batcher_configs},L.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var t=v.bind(function(n){return new nt(n.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:v.bind(function(i,s,o){this._send_request(this.get_config("api_host")+n.endpoint,this._encode_data_for_request(i),s,this._prepare_callback(o,i))},this),beforeSendHook:v.bind(function(i){return this._run_hook("before_send_"+n.type,i)},this),stopAllBatchingFunc:v.bind(this.stop_batch_senders,this),usePersistence:!0})},this),e=this.get_batcher_configs();this.request_batchers={events:t(e.events),people:t(e.people),groups:t(e.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},L.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,v.each(this.request_batchers,function(t){t.start()}))},L.prototype.stop_batch_senders=function(){this._batch_requests=!1,v.each(this.request_batchers,function(t){t.stop(),t.clear()})},L.prototype.push=function(t){this._execute_array([t])},L.prototype.disable=function(t){typeof t>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(t)},L.prototype._encode_data_for_request=function(t){var e=v.JSONEncode(t);return this.get_config("api_payload_format")===ea&&(e=v.base64Encode(e)),{data:e}},L.prototype._track_or_batch=function(t,e){var n=v.truncate(t.data,255),i=t.endpoint,s=t.batcher,o=t.should_send_immediately,a=t.send_request_options||{};e=e||Dn;var c=!0,l=v.bind(function(){return a.skip_hooks||(n=this._run_hook("before_send_"+t.type,n)),n?(ee.log("MIXPANEL REQUEST:"),ee.log(n),this._send_request(i,this._encode_data_for_request(n),a,this._prepare_callback(e,n))):null},this);return this._batch_requests&&!o?s.enqueue(n,function(m){m?e(1,n):l()}):c=l(),c&&n},L.prototype.track=Pt(function(t,e,n,i){!i&&typeof n=="function"&&(i=n,n=null),n=n||{};var s=n.transport;s&&(n.transport=s);var o=n.send_immediately;if(typeof i!="function"&&(i=Dn),v.isUndefined(t)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(t)){i(0);return}e=v.extend({},e),e.token=this.get_config("token");var a=this.persistence.remove_event_timer(t);if(!v.isUndefined(a)){var c=new Date().getTime()-a;e.$duration=parseFloat((c/1e3).toFixed(3))}this._set_default_superprops();var l=this.get_config("track_marketing")?v.info.marketingParams():{};e=v.extend({},v.info.properties({mp_loader:this.get_config("mp_loader")}),l,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),e);var m=this.get_config("property_blacklist");v.isArray(m)?v.each(m,function(b){delete e[b]}):this.report_error("Invalid value for property_blacklist config: "+m);var p={event:t,properties:e},y=this._track_or_batch({type:"events",data:p,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:n},i);return y}),L.prototype.set_group=Pt(function(t,e,n){v.isArray(e)||(e=[e]);var i={};return i[t]=e,this.register(i),this.people.set(t,e,n)}),L.prototype.add_group=Pt(function(t,e,n){var i=this.get_property(t),s={};return i===void 0?(s[t]=[e],this.register(s)):i.indexOf(e)===-1&&(i.push(e),s[t]=i,this.register(s)),this.people.union(t,e,n)}),L.prototype.remove_group=Pt(function(t,e,n){var i=this.get_property(t);if(i!==void 0){var s=i.indexOf(e);s>-1&&(i.splice(s,1),this.register({group_key:i})),i.length===0&&this.unregister(t)}return this.people.remove(t,e,n)}),L.prototype.track_with_groups=Pt(function(t,e,n,i){var s=v.extend({},e||{});return v.each(n,function(o,a){o!=null&&(s[a]=o)}),this.track(t,s,i)}),L.prototype._create_map_key=function(t,e){return t+"_"+JSON.stringify(e)},L.prototype._remove_group_from_cache=function(t,e){delete this._cached_groups[this._create_map_key(t,e)]},L.prototype.get_group=function(t,e){var n=this._create_map_key(t,e),i=this._cached_groups[n];return(i===void 0||i._group_key!==t||i._group_id!==e)&&(i=new le,i._init(this,t,e),this._cached_groups[n]=i),i},L.prototype.track_pageview=Pt(function(t,e){typeof t!="object"&&(t={}),e=e||{};var n=e.event_name||"$mp_web_page_view",i=v.extend(v.info.mpPageViewProperties(),v.info.campaignParams(),v.info.clickParams()),s=v.extend({},i,t);return this.track(n,s)}),L.prototype.track_links=function(){return this._track_dom.call(this,mn,arguments)},L.prototype.track_forms=function(){return this._track_dom.call(this,ri,arguments)},L.prototype.time_event=function(t){if(v.isUndefined(t)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(t)||this.persistence.set_event_timer(t,new Date().getTime())};var ic={persistent:!0},hs=function(t){var e;return v.isObject(t)?e=t:v.isUndefined(t)?e={}:e={days:t},v.extend({},ic,e)};L.prototype.register=function(t,e){var n=hs(e);n.persistent?this.persistence.register(t,n.days):v.extend(this.unpersisted_superprops,t)},L.prototype.register_once=function(t,e,n){var i=hs(n);i.persistent?this.persistence.register_once(t,e,i.days):(typeof e>"u"&&(e="None"),v.each(t,function(s,o){(!this.unpersisted_superprops.hasOwnProperty(o)||this.unpersisted_superprops[o]===e)&&(this.unpersisted_superprops[o]=s)},this))},L.prototype.unregister=function(t,e){e=hs(e),e.persistent?this.persistence.unregister(t):delete this.unpersisted_superprops[t]},L.prototype._register_single=function(t,e){var n={};n[t]=e,this.register(n)},L.prototype.identify=function(t,e,n,i,s,o,a,c){var l=this.get_distinct_id();if(t&&l!==t){if(typeof t=="string"&&t.indexOf(ds)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:t})}if(!this.get_property("$device_id")){var m=l;this.register_once({$had_persisted_distinct_id:!0,$device_id:m},"")}t!==l&&t!==this.get_property(li)&&(this.unregister(li),this.register({distinct_id:t})),this._flags.identify_called=!0,this.people._flush(e,n,i,s,o,a,c),t!==l&&this.track("$identify",{distinct_id:t,$anon_distinct_id:l},{skip_hooks:!0})},L.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var t=v.UUID();this.register_once({distinct_id:ds+t,$device_id:t},"")},L.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},L.prototype.alias=function(t,e){if(t===this.get_property(Yo))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return v.isUndefined(e)&&(e=this.get_distinct_id()),t!==e?(this._register_single(li,t),this.track("$create_alias",{alias:t,distinct_id:e},{skip_hooks:!0},function(){n.identify(t)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(t),-1)},L.prototype.name_tag=function(t){this._register_single("mp_name_tag",t)},L.prototype.set_config=function(t){if(v.isObject(t)){v.extend(this.config,t);var e=t.batch_size;e&&v.each(this.request_batchers,function(n){n.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),vt.DEBUG=vt.DEBUG||this.get_config("debug")}},L.prototype.get_config=function(t){return this.config[t]},L.prototype._run_hook=function(t){var e=(this.config.hooks[t]||tc).apply(this,_t.call(arguments,1));return typeof e>"u"&&(this.report_error(t+" hook did not return a value"),e=null),e},L.prototype.get_property=function(t){return this.persistence.load_prop([t])},L.prototype.toString=function(){var t=this.get_config("name");return t!==We&&(t=We+"."+t),t},L.prototype._event_is_disabled=function(t){return v.isBlockedUA(lt)||this._flags.disable_all_events||v.include(this.__disabled_events,t)},L.prototype._gdpr_init=function(){var t=this.get_config("opt_out_tracking_persistence_type")==="localStorage";t&&v.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||v.cookie.get("mp_optout"))&&(v.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},L.prototype._gdpr_update_persistence=function(t){var e;if(t&&t.clear_persistence)e=!0;else if(t&&t.enable_persistence)e=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==e&&this.persistence.set_disabled(e),e?this.stop_batch_senders():this._batchers_were_started&&this.start_batch_senders()},L.prototype._gdpr_call_func=function(t,e){return e=v.extend({track:v.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},e),v.localStorage.is_supported()||(e.persistence_type="cookie"),t(this.get_config("token"),{track:e.track,trackEventName:e.track_event_name,trackProperties:e.track_properties,persistenceType:e.persistence_type,persistencePrefix:e.cookie_prefix,cookieDomain:e.cookie_domain,cookieExpiration:e.cookie_expiration,crossSiteCookie:e.cross_site_cookie,crossSubdomainCookie:e.cross_subdomain_cookie,secureCookie:e.secure_cookie,ignoreDnt:e.ignore_dnt})},L.prototype.opt_in_tracking=function(t){t=v.extend({enable_persistence:!0},t),this._gdpr_call_func(Kl,t),this._gdpr_update_persistence(t)},L.prototype.opt_out_tracking=function(t){t=v.extend({clear_persistence:!0,delete_user:!0},t),t.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(Gl,t),this._gdpr_update_persistence(t)},L.prototype.has_opted_in_tracking=function(t){return this._gdpr_call_func(jl,t)},L.prototype.has_opted_out_tracking=function(t){return this._gdpr_call_func(Ko,t)},L.prototype.clear_opt_in_out_tracking=function(t){t=v.extend({enable_persistence:!0},t),this._gdpr_call_func(zl,t),this._gdpr_update_persistence(t)},L.prototype.report_error=function(t,e){ee.error.apply(ee.error,arguments);try{!e&&!(t instanceof Error)&&(t=new Error(t)),this.get_config("error_reporter")(t,e)}catch(n){ee.error(n)}},L.prototype.init=L.prototype.init,L.prototype.reset=L.prototype.reset,L.prototype.disable=L.prototype.disable,L.prototype.time_event=L.prototype.time_event,L.prototype.track=L.prototype.track,L.prototype.track_links=L.prototype.track_links,L.prototype.track_forms=L.prototype.track_forms,L.prototype.track_pageview=L.prototype.track_pageview,L.prototype.register=L.prototype.register,L.prototype.register_once=L.prototype.register_once,L.prototype.unregister=L.prototype.unregister,L.prototype.identify=L.prototype.identify,L.prototype.alias=L.prototype.alias,L.prototype.name_tag=L.prototype.name_tag,L.prototype.set_config=L.prototype.set_config,L.prototype.get_config=L.prototype.get_config,L.prototype.get_property=L.prototype.get_property,L.prototype.get_distinct_id=L.prototype.get_distinct_id,L.prototype.toString=L.prototype.toString,L.prototype.opt_out_tracking=L.prototype.opt_out_tracking,L.prototype.opt_in_tracking=L.prototype.opt_in_tracking,L.prototype.has_opted_out_tracking=L.prototype.has_opted_out_tracking,L.prototype.has_opted_in_tracking=L.prototype.has_opted_in_tracking,L.prototype.clear_opt_in_out_tracking=L.prototype.clear_opt_in_out_tracking,L.prototype.get_group=L.prototype.get_group,L.prototype.set_group=L.prototype.set_group,L.prototype.add_group=L.prototype.add_group,L.prototype.remove_group=L.prototype.remove_group,L.prototype.track_with_groups=L.prototype.track_with_groups,L.prototype.start_batch_senders=L.prototype.start_batch_senders,L.prototype.stop_batch_senders=L.prototype.stop_batch_senders,L.prototype.start_session_recording=L.prototype.start_session_recording,L.prototype.stop_session_recording=L.prototype.stop_session_recording,L.prototype.get_session_recording_properties=L.prototype.get_session_recording_properties,L.prototype.DEFAULT_API_ROUTES=na,Z.prototype.properties=Z.prototype.properties,Z.prototype.update_search_keyword=Z.prototype.update_search_keyword,Z.prototype.update_referrer_info=Z.prototype.update_referrer_info,Z.prototype.get_cross_subdomain=Z.prototype.get_cross_subdomain,Z.prototype.clear=Z.prototype.clear;var bn={},sc=function(){v.each(bn,function(t,e){e!==We&&(Ie[e]=t)}),Ie._=v},oc=function(){Ie.init=function(t,e,n){if(n)return Ie[n]||(Ie[n]=bn[n]=us(t,e,n),Ie[n]._loaded()),Ie[n];var i=Ie;bn[We]?i=bn[We]:t&&(i=us(t,e,We),i._loaded(),bn[We]=i),Ie=i,cs===ec&&(O[We]=Ie),sc()}},ac=function(){function t(){t.done||(t.done=!0,sa=!0,ta=!1,v.each(bn,function(i){i._dom_loaded()}))}function e(){try{oe.documentElement.doScroll("left")}catch{setTimeout(e,1);return}t()}if(oe.addEventListener)oe.readyState==="complete"?t():oe.addEventListener("DOMContentLoaded",t,!1);else if(oe.attachEvent){oe.attachEvent("onreadystatechange",t);var n=!1;try{n=O.frameElement===null}catch{}oe.documentElement.doScroll&&n&&e()}v.register_event(O,"load",t,!0)};function rc(t){return Xo=t,cs=$o,Ie=new L,oc(),Ie.init(),ac(),Ie}function lc(t,e){e()}var _=rc(lc);const cc=`<div id="checkoutConfirmationEnd" data-section="transfer">
1275
+ `);var e="",n,i,s=0,o;for(n=i=0,s=t.length,o=0;o<s;o++){var a=t.charCodeAt(o),c=null;a<128?i++:a>127&&a<2048?c=String.fromCharCode(a>>6|192,a&63|128):c=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),c!==null&&(i>n&&(e+=t.substring(n,i)),e+=c,n=i=o+1)}return i>n&&(e+=t.substring(n,t.length)),e},v.UUID=function(){var t=function(){var i=1*new Date,s;if(O.performance&&O.performance.now)s=O.performance.now();else for(s=0;i==1*new Date;)s++;return i.toString(16)+Math.floor(s).toString(16)},e=function(){return Math.random().toString(16).replace(".","")},n=function(){var i=lt,s,o,a=[],c=0;function l(m,p){var y,b=0;for(y=0;y<p.length;y++)b|=a[y]<<y*8;return m^b}for(s=0;s<i.length;s++)o=i.charCodeAt(s),a.unshift(o&255),a.length>=4&&(c=l(c,a),a=[]);return a.length>0&&(c=l(c,a)),c.toString(16)};return function(){var i=(ni.height*ni.width).toString(16);return t()+"-"+e()+"-"+n()+"-"+i+"-"+t()}}();var Vo=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];v.isBlockedUA=function(t){var e;for(t=t.toLowerCase(),e=0;e<Vo.length;e++)if(t.indexOf(Vo[e])!==-1)return!0;return!1},v.HTTPBuildQuery=function(t,e){var n,i,s=[];return v.isUndefined(e)&&(e="&"),v.each(t,function(o,a){n=encodeURIComponent(o.toString()),i=encodeURIComponent(a),s[s.length]=i+"="+n}),s.join(e)},v.getQueryParam=function(t,e){e=e.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var n="[\\?&]"+e+"=([^&#]*)",i=new RegExp(n),s=i.exec(t);if(s===null||s&&typeof s[1]!="string"&&s[1].length)return"";var o=s[1];try{o=decodeURIComponent(o)}catch{ee.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},v.cookie={get:function(t){for(var e=t+"=",n=oe.cookie.split(";"),i=0;i<n.length;i++){for(var s=n[i];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}return null},parse:function(t){var e;try{e=v.JSONDecode(v.cookie.get(t))||{}}catch{}return e},set_seconds:function(t,e,n,i,s,o,a){var c="",l="",m="";if(a)c="; domain="+a;else if(i){var p=Fo(oe.location.hostname);c=p?"; domain=."+p:""}if(n){var y=new Date;y.setTime(y.getTime()+n*1e3),l="; expires="+y.toGMTString()}o&&(s=!0,m="; SameSite=None"),s&&(m+="; secure"),oe.cookie=t+"="+encodeURIComponent(e)+l+"; path=/"+c+m},set:function(t,e,n,i,s,o,a){var c="",l="",m="";if(a)c="; domain="+a;else if(i){var p=Fo(oe.location.hostname);c=p?"; domain=."+p:""}if(n){var y=new Date;y.setTime(y.getTime()+n*24*60*60*1e3),l="; expires="+y.toGMTString()}o&&(s=!0,m="; SameSite=None"),s&&(m+="; secure");var b=t+"="+encodeURIComponent(e)+l+"; path=/"+c+m;return oe.cookie=b,b},remove:function(t,e,n){v.cookie.set(t,"",-1,e,!1,!1,n)}};var Yi=null,si=function(t,e){if(Yi!==null&&!e)return Yi;var n=!0;try{t=t||window.localStorage;var i="__mplss_"+Xi(8),s="xyz";t.setItem(i,s),t.getItem(i)!==s&&(n=!1),t.removeItem(i)}catch{n=!1}return Yi=n,n};v.localStorage={is_supported:function(t){var e=si(null,t);return e||ee.error("localStorage unsupported; falling back to cookie store"),e},error:function(t){ee.error("localStorage error: "+t)},get:function(t){try{return window.localStorage.getItem(t)}catch(e){v.localStorage.error(e)}return null},parse:function(t){try{return v.JSONDecode(v.localStorage.get(t))||{}}catch{}return null},set:function(t,e){try{window.localStorage.setItem(t,e)}catch(n){v.localStorage.error(n)}},remove:function(t){try{window.localStorage.removeItem(t)}catch(e){v.localStorage.error(e)}}},v.register_event=function(){var t=function(i,s,o,a,c){if(!i){ee.error("No valid element provided to register_event");return}if(i.addEventListener&&!a)i.addEventListener(s,o,!!c);else{var l="on"+s,m=i[l];i[l]=e(i,o,m)}};function e(i,s,o){var a=function(c){if(c=c||n(window.event),!!c){var l=!0,m,p;return v.isFunction(o)&&(m=o(c)),p=s.call(i,c),(m===!1||p===!1)&&(l=!1),l}};return a}function n(i){return i&&(i.preventDefault=n.preventDefault,i.stopPropagation=n.stopPropagation),i}return n.preventDefault=function(){this.returnValue=!1},n.stopPropagation=function(){this.cancelBubble=!0},t}();var Hl=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');v.dom_query=function(){function t(s){return s.all?s.all:s.getElementsByTagName("*")}var e=/[\t\r\n]/g;function n(s,o){var a=" "+o+" ";return(" "+s.className+" ").replace(e," ").indexOf(a)>=0}function i(s){if(!oe.getElementsByTagName)return[];var o=s.split(" "),a,c,l,m,p,y,b,g,w,f,k=[oe];for(y=0;y<o.length;y++){if(a=o[y].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){c=a.split("#"),l=c[0];var x=c[1],A=oe.getElementById(x);if(!A||l&&A.nodeName.toLowerCase()!=l)return[];k=[A];continue}if(a.indexOf(".")>-1){c=a.split("."),l=c[0];var M=c[1];for(l||(l="*"),m=[],p=0,b=0;b<k.length;b++)for(l=="*"?w=t(k[b]):w=k[b].getElementsByTagName(l),g=0;g<w.length;g++)m[p++]=w[g];for(k=[],f=0,b=0;b<m.length;b++)m[b].className&&v.isString(m[b].className)&&n(m[b],M)&&(k[f++]=m[b]);continue}var E=a.match(Hl);if(E){l=E[1];var D=E[2],F=E[3],W=E[4];for(l||(l="*"),m=[],p=0,b=0;b<k.length;b++)for(l=="*"?w=t(k[b]):w=k[b].getElementsByTagName(l),g=0;g<w.length;g++)m[p++]=w[g];k=[],f=0;var G;switch(F){case"=":G=function(Q){return Q.getAttribute(D)==W};break;case"~":G=function(Q){return Q.getAttribute(D).match(new RegExp("\\b"+W+"\\b"))};break;case"|":G=function(Q){return Q.getAttribute(D).match(new RegExp("^"+W+"-?"))};break;case"^":G=function(Q){return Q.getAttribute(D).indexOf(W)===0};break;case"$":G=function(Q){return Q.getAttribute(D).lastIndexOf(W)==Q.getAttribute(D).length-W.length};break;case"*":G=function(Q){return Q.getAttribute(D).indexOf(W)>-1};break;default:G=function(Q){return Q.getAttribute(D)}}for(k=[],f=0,b=0;b<m.length;b++)G(m[b])&&(k[f++]=m[b]);continue}for(l=a,m=[],p=0,b=0;b<k.length;b++)for(w=k[b].getElementsByTagName(l),g=0;g<w.length;g++)m[p++]=w[g];k=m}return k}return function(s){return v.isElement(s)?[s]:v.isObject(s)&&!v.isUndefined(s.length)?s:i.call(this,s)}}();var Rl=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],Nl=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];v.info={campaignParams:function(t){var e="",n={};return v.each(Rl,function(i){e=v.getQueryParam(oe.URL,i),e.length?n[i]=e:t!==void 0&&(n[i]=t)}),n},clickParams:function(){var t="",e={};return v.each(Nl,function(n){t=v.getQueryParam(oe.URL,n),t.length&&(e[n]=t)}),e},marketingParams:function(){return v.extend(v.info.campaignParams(),v.info.clickParams())},searchEngine:function(t){return t.search("https?://(.*)google.([^/?]*)")===0?"google":t.search("https?://(.*)bing.com")===0?"bing":t.search("https?://(.*)yahoo.com")===0?"yahoo":t.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(t){var e=v.info.searchEngine(t),n=e!="yahoo"?"q":"p",i={};if(e!==null){i.$search_engine=e;var s=v.getQueryParam(t,n);s.length&&(i.mp_keyword=s)}return i},browser:function(t,e,n){return e=e||"",n||v.includes(t," OPR/")?v.includes(t,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":v.includes(t,"IEMobile")||v.includes(t,"WPDesktop")?"Internet Explorer Mobile":v.includes(t,"SamsungBrowser/")?"Samsung Internet":v.includes(t,"Edge")||v.includes(t,"Edg/")?"Microsoft Edge":v.includes(t,"FBIOS")?"Facebook Mobile":v.includes(t,"Chrome")?"Chrome":v.includes(t,"CriOS")?"Chrome iOS":v.includes(t,"UCWEB")||v.includes(t,"UCBrowser")?"UC Browser":v.includes(t,"FxiOS")?"Firefox iOS":v.includes(e,"Apple")?v.includes(t,"Mobile")?"Mobile Safari":"Safari":v.includes(t,"Android")?"Android Mobile":v.includes(t,"Konqueror")?"Konqueror":v.includes(t,"Firefox")?"Firefox":v.includes(t,"MSIE")||v.includes(t,"Trident/")?"Internet Explorer":v.includes(t,"Gecko")?"Mozilla":""},browserVersion:function(t,e,n){var i=v.info.browser(t,e,n),s={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},o=s[i];if(o===void 0)return null;var a=t.match(o);return a?parseFloat(a[a.length-2]):null},os:function(){var t=lt;return/Windows/i.test(t)?/Phone/.test(t)||/WPDesktop/.test(t)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(t)?"iOS":/Android/.test(t)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":/Mac/i.test(t)?"Mac OS X":/Linux/.test(t)?"Linux":/CrOS/.test(t)?"Chrome OS":""},device:function(t){return/Windows Phone/i.test(t)||/WPDesktop/.test(t)?"Windows Phone":/iPad/.test(t)?"iPad":/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":/Android/.test(t)?"Android":""},referringDomain:function(t){var e=t.split("/");return e.length>=3?e[2]:""},currentUrl:function(){return O.location.href},properties:function(t){return typeof t!="object"&&(t={}),v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(lt,Et.vendor,ti),$referrer:oe.referrer,$referring_domain:v.info.referringDomain(oe.referrer),$device:v.info.device(lt)}),{$current_url:v.info.currentUrl(),$browser_version:v.info.browserVersion(lt,Et.vendor,ti),$screen_height:ni.height,$screen_width:ni.width,mp_lib:"web",$lib_version:vt.LIB_VERSION,$insert_id:Xi(),time:v.timestamp()/1e3},v.strip_empty_properties(t))},people_properties:function(){return v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(lt,Et.vendor,ti)}),{$browser_version:v.info.browserVersion(lt,Et.vendor,ti)})},mpPageViewProperties:function(){return v.strip_empty_properties({current_page_title:oe.title,current_domain:O.location.hostname,current_url_path:O.location.pathname,current_url_protocol:O.location.protocol,current_url_search:O.location.search})}};var Xi=function(t){var e=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return t?e.substring(0,t):e},Ol=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Ul=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Fo=function(t){var e=Ul,n=t.split("."),i=n[n.length-1];(i.length>4||i==="com"||i==="org")&&(e=Ol);var s=t.match(e);return s?s[0]:""},Vl=function(){var t=O.navigator.onLine;return v.isUndefined(t)||t},oi=null,ai=null;typeof JSON<"u"&&(oi=JSON.stringify,ai=JSON.parse),oi=oi||v.JSONEncode,ai=ai||v.JSONDecode,v.toArray=v.toArray,v.isObject=v.isObject,v.JSONEncode=v.JSONEncode,v.JSONDecode=v.JSONDecode,v.isBlockedUA=v.isBlockedUA,v.isEmptyObject=v.isEmptyObject,v.info=v.info,v.info.device=v.info.device,v.info.browser=v.info.browser,v.info.browserVersion=v.info.browserVersion,v.info.properties=v.info.properties;var Fl="__mp_opt_in_out_";function Kl(t,e){jo(!0,t,e)}function Gl(t,e){jo(!1,t,e)}function jl(t,e){return Go(t,e)==="1"}function Ko(t,e){if(ql(e))return ee.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var n=Go(t,e)==="0";return n&&ee.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function Pt(t){return ts(t,function(e){return this.get_config(e)})}function It(t){return ts(t,function(e){return this._get_config(e)})}function hn(t){return ts(t,function(e){return this._get_config(e)})}function zl(t,e){e=e||{},$i(e).remove(es(t,e),!!e.crossSubdomainCookie,e.cookieDomain)}function $i(t){return t=t||{},t.persistenceType==="localStorage"?v.localStorage:v.cookie}function es(t,e){return e=e||{},(e.persistencePrefix||Fl)+t}function Go(t,e){return $i(e).get(es(t,e))}function ql(t){if(t&&t.ignoreDnt)return!1;var e=t&&t.window||O,n=e.navigator||{},i=!1;return v.each([n.doNotTrack,n.msDoNotTrack,e.doNotTrack],function(s){v.includes([!0,1,"1","yes"],s)&&(i=!0)}),i}function jo(t,e,n){if(!v.isString(e)||!e.length){ee.error("gdpr."+(t?"optIn":"optOut")+" called with an invalid token");return}n=n||{},$i(n).set(es(e,n),t?1:0,v.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&t&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})}function ts(t,e){return function(){var n=!1;try{var i=e.call(this,"token"),s=e.call(this,"ignore_dnt"),o=e.call(this,"opt_out_tracking_persistence_type"),a=e.call(this,"opt_out_tracking_cookie_prefix"),c=e.call(this,"window");i&&(n=Ko(i,{ignoreDnt:s,persistenceType:o,persistencePrefix:a,window:c}))}catch(m){ee.error("Unexpected error when checking tracking opt-out status: "+m)}if(!n)return t.apply(this,arguments);var l=arguments[arguments.length-1];typeof l=="function"&&l(0)}}var Zl=ii("lock"),zo=function(t,e){e=e||{},this.storageKey=t,this.storage=e.storage||window.localStorage,this.pollIntervalMS=e.pollIntervalMS||100,this.timeoutMS=e.timeoutMS||2e3};zo.prototype.withLock=function(t,e,n){!n&&typeof e!="function"&&(n=e,e=null);var i=n||new Date().getTime()+"|"+Math.random(),s=new Date().getTime(),o=this.storageKey,a=this.pollIntervalMS,c=this.timeoutMS,l=this.storage,m=o+":X",p=o+":Y",y=o+":Z",b=function(A){e&&e(A)},g=function(A){if(new Date().getTime()-s>c){Zl.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+i+"]"),l.removeItem(y),l.removeItem(p),k();return}setTimeout(function(){try{A()}catch(M){b(M)}},a*(Math.random()+.1))},w=function(A,M){A()?M():g(function(){w(A,M)})},f=function(){var A=l.getItem(p);if(A&&A!==i)return!1;if(l.setItem(p,i),l.getItem(p)===i)return!0;if(!si(l,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},k=function(){l.setItem(m,i),w(f,function(){if(l.getItem(m)===i){x();return}g(function(){if(l.getItem(p)!==i){k();return}w(function(){return!l.getItem(y)},x)})})},x=function(){l.setItem(y,"1");try{t()}finally{l.removeItem(y),l.getItem(p)===i&&l.removeItem(p),l.getItem(m)===i&&l.removeItem(m)}};try{if(si(l,!0))k();else throw new Error("localStorage support check failed")}catch(A){b(A)}};var qo=ii("batch"),Dt=function(t,e){e=e||{},this.storageKey=t,this.storage=e.storage||window.localStorage,this.reportError=e.errorReporter||v.bind(qo.error,qo),this.lock=new zo(t,{storage:this.storage}),this.usePersistence=e.usePersistence,this.pid=e.pid||null,this.memQueue=[]};Dt.prototype.enqueue=function(t,e,n){var i={id:Xi(),flushAfter:new Date().getTime()+e*2,payload:t};this.usePersistence?this.lock.withLock(v.bind(function(){var o;try{var a=this.readFromStorage();a.push(i),o=this.saveToStorage(a),o&&this.memQueue.push(i)}catch{this.reportError("Error enqueueing item",t),o=!1}n&&n(o)},this),v.bind(function(o){this.reportError("Error acquiring storage lock",o),n&&n(!1)},this),this.pid):(this.memQueue.push(i),n&&n(!0))},Dt.prototype.fillBatch=function(t){var e=this.memQueue.slice(0,t);if(this.usePersistence&&e.length<t){var n=this.readFromStorage();if(n.length){var i={};v.each(e,function(a){i[a.id]=!0});for(var s=0;s<n.length;s++){var o=n[s];if(new Date().getTime()>o.flushAfter&&!i[o.id]&&(o.orphaned=!0,e.push(o),e.length>=t))break}}}return e};var Zo=function(t,e){var n=[];return v.each(t,function(i){i.id&&!e[i.id]&&n.push(i)}),n};Dt.prototype.removeItemsByID=function(t,e){var n={};if(v.each(t,function(s){n[s]=!0}),this.memQueue=Zo(this.memQueue,n),!this.usePersistence)e&&e(!0);else{var i=v.bind(function(){var s;try{var o=this.readFromStorage();if(o=Zo(o,n),s=this.saveToStorage(o),s){o=this.readFromStorage();for(var a=0;a<o.length;a++){var c=o[a];if(c.id&&n[c.id])return this.reportError("Item not removed from storage"),!1}}}catch{this.reportError("Error removing items",t),s=!1}return s},this);this.lock.withLock(function(){var o=i();e&&e(o)},v.bind(function(o){var a=!1;if(this.reportError("Error acquiring storage lock",o),!si(this.storage,!0)&&(a=i(),!a))try{this.storage.removeItem(this.storageKey)}catch(c){this.reportError("Error clearing queue",c)}e&&e(a)},this),this.pid)}};var Wo=function(t,e){var n=[];return v.each(t,function(i){var s=i.id;if(s in e){var o=e[s];o!==null&&(i.payload=o,n.push(i))}else n.push(i)}),n};Dt.prototype.updatePayloads=function(t,e){this.memQueue=Wo(this.memQueue,t),this.usePersistence?this.lock.withLock(v.bind(function(){var i;try{var s=this.readFromStorage();s=Wo(s,t),i=this.saveToStorage(s)}catch{this.reportError("Error updating items",t),i=!1}e&&e(i)},this),v.bind(function(i){this.reportError("Error acquiring storage lock",i),e&&e(!1)},this),this.pid):e&&e(!0)},Dt.prototype.readFromStorage=function(){var t;try{t=this.storage.getItem(this.storageKey),t&&(t=ai(t),v.isArray(t)||(this.reportError("Invalid storage entry:",t),t=null))}catch(e){this.reportError("Error retrieving queue",e),t=null}return t||[]},Dt.prototype.saveToStorage=function(t){try{return this.storage.setItem(this.storageKey,oi(t)),!0}catch(e){return this.reportError("Error saving queue",e),!1}},Dt.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var Wl=10*60*1e3,Pn=ii("batch"),nt=function(t,e){this.errorReporter=e.errorReporter,this.queue=new Dt(t,{errorReporter:v.bind(this.reportError,this),storage:e.storage,usePersistence:e.usePersistence}),this.libConfig=e.libConfig,this.sendRequest=e.sendRequestFunc,this.beforeSendHook=e.beforeSendHook,this.stopAllBatching=e.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=e.flushOnlyOnInterval||!1};nt.prototype.enqueue=function(t,e){this.queue.enqueue(t,this.flushInterval,e)},nt.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},nt.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},nt.prototype.clear=function(){this.queue.clear()},nt.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},nt.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},nt.prototype.scheduleFlush=function(t){this.flushInterval=t,this.stopped||(this.timeoutID=setTimeout(v.bind(function(){this.stopped||this.flush()},this),this.flushInterval))},nt.prototype.flush=function(t){try{if(this.requestInProgress){Pn.log("Flush: Request already in progress");return}t=t||{};var e=this.libConfig.batch_request_timeout_ms,n=new Date().getTime(),i=this.batchSize,s=this.queue.fillBatch(i),o=s.length===i,a=[],c={};if(v.each(s,function(p){var y=p.payload;if(this.beforeSendHook&&!p.orphaned&&(y=this.beforeSendHook(y)),y){y.event&&y.properties&&(y.properties=v.extend({},y.properties,{mp_sent_by_lib_version:vt.LIB_VERSION}));var b=!0,g=p.id;g?(this.itemIdsSentSuccessfully[g]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:p,batchSize:s.length,timesSent:this.itemIdsSentSuccessfully[g]}),b=!1):this.reportError("[dupe] found item with no ID",{item:p}),b&&a.push(y)}c[p.id]=y},this),a.length<1){this.resetFlush();return}this.requestInProgress=!0;var l=v.bind(function(p){this.requestInProgress=!1;try{var y=!1;if(t.unloading)this.queue.updatePayloads(c);else if(v.isObject(p)&&p.error==="timeout"&&new Date().getTime()-n>=e)this.reportError("Network timeout; retrying"),this.flush();else if(v.isObject(p)&&(p.httpStatusCode>=500||p.httpStatusCode===429||p.httpStatusCode<=0&&!Vl()||p.error==="timeout")){var b=this.flushInterval*2;p.retryAfter&&(b=parseInt(p.retryAfter,10)*1e3||b),b=Math.min(Wl,b),this.reportError("Error; retry in "+b+" ms"),this.scheduleFlush(b)}else if(v.isObject(p)&&p.httpStatusCode===413)if(s.length>1){var g=Math.max(1,Math.floor(i/2));this.batchSize=Math.min(this.batchSize,g,s.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",s),this.resetBatchSize(),y=!0;else y=!0;y&&(this.queue.removeItemsByID(v.map(s,function(w){return w.id}),v.bind(function(w){w?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?this.resetFlush():this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this)),v.each(s,v.bind(function(w){var f=w.id;f?(this.itemIdsSentSuccessfully[f]=this.itemIdsSentSuccessfully[f]||0,this.itemIdsSentSuccessfully[f]++,this.itemIdsSentSuccessfully[f]>5&&this.reportError("[dupe] item ID sent too many times",{item:w,batchSize:s.length,timesSent:this.itemIdsSentSuccessfully[f]})):this.reportError("[dupe] found item with no ID while removing",{item:w})},this)))}catch(w){this.reportError("Error handling API response",w),this.resetFlush()}},this),m={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:e};t.unloading&&(m.transport="sendBeacon"),Pn.log("MIXPANEL REQUEST:",a),this.sendRequest(a,m,l)}catch(p){this.reportError("Error flushing request queue",p),this.resetFlush()}},nt.prototype.reportError=function(t,e){if(Pn.error.apply(Pn.error,arguments),this.errorReporter)try{e instanceof Error||(e=new Error(t)),this.errorReporter(t,e)}catch(n){Pn.error(n)}};var Gt=ii("recorder"),Qo=O.CompressionStream,Ql={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},Jl=new Set([rt.MouseMove,rt.MouseInteraction,rt.Scroll,rt.ViewportResize,rt.Input,rt.TouchMove,rt.MediaInteraction,rt.Drag,rt.Selection]);function Yl(t){return t.type===Bo.IncrementalSnapshot&&Jl.has(t.data.source)}var it=function(t){this._mixpanel=t,this._stopRecording=null,this.recEvents=[],this.seqNo=0,this.replayId=null,this.replayStartTime=null,this.sendBatchId=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=_n,this.recordMinMs=0,this._initBatcher()};it.prototype._initBatcher=function(){this.batcher=new nt("__mprec",{libConfig:Ql,sendRequestFunc:v.bind(this.flushEventsWithOptOut,this),errorReporter:v.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},it.prototype.get_config=function(t){return this._mixpanel.get_config(t)},it.prototype.startRecording=function(t){if(this._stopRecording!==null){Gt.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>_n&&(this.recordMaxMs=_n,Gt.critical("record_max_ms cannot be greater than "+_n+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>Zi&&(this.recordMinMs=Zi,Gt.critical("record_min_ms cannot be greater than "+Zi+"ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=new Date().getTime(),this.replayId=v.UUID(),t||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var e=v.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(v.bind(function(){Gt.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),this.get_config("record_idle_timeout_ms"))},this),n=this.get_config("record_block_selector");(n===""||n===null)&&(n=void 0),this._stopRecording=Tn({emit:v.bind(function(i){this.batcher.enqueue(i),Yl(i)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),e())},this),blockClass:this.get_config("record_block_class"),blockSelector:n,collectFonts:this.get_config("record_collect_fonts"),inlineImages:this.get_config("record_inline_images"),maskAllInputs:!0,maskTextClass:this.get_config("record_mask_text_class"),maskTextSelector:this.get_config("record_mask_text_selector")}),e(),this.maxTimeoutId=setTimeout(v.bind(this.resetRecording,this),this.recordMaxMs)},it.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},it.prototype.stopRecording=function(){this._stopRecording!==null&&(this._stopRecording(),this._stopRecording=null),this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),this.replayId=null,clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},it.prototype.flushEventsWithOptOut=function(t,e,n){this._flushEvents(t,e,n,v.bind(this._onOptOut,this))},it.prototype._onOptOut=function(t){t===0&&(this.recEvents=[],this.stopRecording())},it.prototype._sendRequest=function(t,e,n,i){var s=v.bind(function(o,a){o.status===200&&this.replayId===t&&this.seqNo++,i({status:0,httpStatusCode:o.status,responseBody:a,retryAfter:o.headers.get("Retry-After")})},this);O.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(e),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:n}).then(function(o){o.json().then(function(a){s(o,a)}).catch(function(a){i({error:a})})}).catch(function(o){i({error:o,httpStatusCode:0})})},it.prototype._flushEvents=Pt(function(t,e,n){const i=t.length;if(i>0){var s=this.replayId,o=t[0].timestamp;(this.seqNo===0||!this.replayStartTime)&&(this.seqNo!==0&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=o);var a=t[i-1].timestamp-this.replayStartTime,c={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo,batch_start_time:o/1e3,replay_id:s,replay_length_ms:a,replay_start_time:this.replayStartTime/1e3},l=v.JSONEncode(t),m=this._mixpanel.get_property("$device_id");m&&(c.$device_id=m);var p=this._mixpanel.get_property("$user_id");if(p&&(c.$user_id=p),Qo){var y=new Blob([l],{type:"application/json"}).stream(),b=y.pipeThrough(new Qo("gzip"));new Response(b).blob().then(v.bind(function(g){c.format="gzip",this._sendRequest(s,c,g,n)},this))}else c.format="body",this._sendRequest(s,c,l,n)}}),it.prototype.reportError=function(t,e){Gt.error.apply(Gt.error,arguments);try{!e&&!(t instanceof Error)&&(t=new Error(t)),this.get_config("error_reporter")(t,e)}catch(n){Gt.error(n)}},O.__mp_recorder=it;var bt=function(){};bt.prototype.create_properties=function(){},bt.prototype.event_handler=function(){},bt.prototype.after_track_handler=function(){},bt.prototype.init=function(t){return this.mp=t,this},bt.prototype.track=function(t,e,n,i){var s=this,o=v.dom_query(t);if(o.length===0){ee.error("The DOM query ("+t+") returned 0 elements");return}return v.each(o,function(a){v.register_event(a,this.override_event,function(c){var l={},m=s.create_properties(n,this),p=s.mp.get_config("track_links_timeout");s.event_handler(c,this,l),window.setTimeout(s.track_callback(i,m,l,!0),p),s.mp.track(e,m,s.track_callback(i,m,l))})},this),!0},bt.prototype.track_callback=function(t,e,n,i){i=i||!1;var s=this;return function(){n.callback_fired||(n.callback_fired=!0,!(t&&t(i,e)===!1)&&s.after_track_handler(e,n,i))}},bt.prototype.create_properties=function(t,e){var n;return typeof t=="function"?n=t(e):n=v.extend({},t),n};var mn=function(){this.override_event="click"};v.inherit(mn,bt),mn.prototype.create_properties=function(t,e){var n=mn.superclass.create_properties.apply(this,arguments);return e.href&&(n.url=e.href),n},mn.prototype.event_handler=function(t,e,n){n.new_tab=t.which===2||t.metaKey||t.ctrlKey||e.target==="_blank",n.href=e.href,n.new_tab||t.preventDefault()},mn.prototype.after_track_handler=function(t,e){e.new_tab||setTimeout(function(){window.location=e.href},0)};var ri=function(){this.override_event="submit"};v.inherit(ri,bt),ri.prototype.event_handler=function(t,e,n){n.element=e,t.preventDefault()},ri.prototype.after_track_handler=function(t,e){setTimeout(function(){e.element.submit()},0)};var Bt="$set",pn="$set_once",st="$unset",jt="$add",ct="$append",zt="$union",ft="$remove",Xl="$delete",Jo={set_action:function(t,e){var n={},i={};return v.isObject(t)?v.each(t,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[t]=e,n[Bt]=i,n},unset_action:function(t){var e={},n=[];return v.isArray(t)||(t=[t]),v.each(t,function(i){this._is_reserved_property(i)||n.push(i)},this),e[st]=n,e},set_once_action:function(t,e){var n={},i={};return v.isObject(t)?v.each(t,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[t]=e,n[pn]=i,n},union_action:function(t,e){var n={},i={};return v.isObject(t)?v.each(t,function(s,o){this._is_reserved_property(o)||(i[o]=v.isArray(s)?s:[s])},this):i[t]=v.isArray(e)?e:[e],n[zt]=i,n},append_action:function(t,e){var n={},i={};return v.isObject(t)?v.each(t,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[t]=e,n[ct]=i,n},remove_action:function(t,e){var n={},i={};return v.isObject(t)?v.each(t,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[t]=e,n[ft]=i,n},delete_action:function(){var t={};return t[Xl]="",t}},le=function(){};v.extend(le.prototype,Jo),le.prototype._init=function(t,e,n){this._mixpanel=t,this._group_key=e,this._group_id=n},le.prototype.set=hn(function(t,e,n){var i=this.set_action(t,e);return v.isObject(t)&&(n=e),this._send_request(i,n)}),le.prototype.set_once=hn(function(t,e,n){var i=this.set_once_action(t,e);return v.isObject(t)&&(n=e),this._send_request(i,n)}),le.prototype.unset=hn(function(t,e){var n=this.unset_action(t);return this._send_request(n,e)}),le.prototype.union=hn(function(t,e,n){v.isObject(t)&&(n=e);var i=this.union_action(t,e);return this._send_request(i,n)}),le.prototype.delete=hn(function(t){var e=this.delete_action();return this._send_request(e,t)}),le.prototype.remove=hn(function(t,e,n){var i=this.remove_action(t,e);return this._send_request(i,n)}),le.prototype._send_request=function(t,e){t.$group_key=this._group_key,t.$group_id=this._group_id,t.$token=this._get_config("token");var n=v.encodeDates(t);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},e)},le.prototype._is_reserved_property=function(t){return t==="$group_key"||t==="$group_id"},le.prototype._get_config=function(t){return this._mixpanel.get_config(t)},le.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},le.prototype.remove=le.prototype.remove,le.prototype.set=le.prototype.set,le.prototype.set_once=le.prototype.set_once,le.prototype.union=le.prototype.union,le.prototype.unset=le.prototype.unset,le.prototype.toString=le.prototype.toString;var U=function(){};v.extend(U.prototype,Jo),U.prototype._init=function(t){this._mixpanel=t},U.prototype.set=It(function(t,e,n){var i=this.set_action(t,e);return v.isObject(t)&&(n=e),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),i[Bt]=v.extend({},v.info.people_properties(),i[Bt]),this._send_request(i,n)}),U.prototype.set_once=It(function(t,e,n){var i=this.set_once_action(t,e);return v.isObject(t)&&(n=e),this._send_request(i,n)}),U.prototype.unset=It(function(t,e){var n=this.unset_action(t);return this._send_request(n,e)}),U.prototype.increment=It(function(t,e,n){var i={},s={};return v.isObject(t)?(v.each(t,function(o,a){if(!this._is_reserved_property(a))if(isNaN(parseFloat(o))){ee.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else s[a]=o},this),n=e):(v.isUndefined(e)&&(e=1),s[t]=e),i[jt]=s,this._send_request(i,n)}),U.prototype.append=It(function(t,e,n){v.isObject(t)&&(n=e);var i=this.append_action(t,e);return this._send_request(i,n)}),U.prototype.remove=It(function(t,e,n){v.isObject(t)&&(n=e);var i=this.remove_action(t,e);return this._send_request(i,n)}),U.prototype.union=It(function(t,e,n){v.isObject(t)&&(n=e);var i=this.union_action(t,e);return this._send_request(i,n)}),U.prototype.track_charge=It(function(t,e,n){if(!v.isNumber(t)&&(t=parseFloat(t),isNaN(t))){ee.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",v.extend({$amount:t},e),n)}),U.prototype.clear_charges=function(t){return this.set("$transactions",[],t)},U.prototype.delete_user=function(){if(!this._identify_called()){ee.error("mixpanel.people.delete_user() requires you to call identify() first");return}var t={$delete:this._mixpanel.get_distinct_id()};return this._send_request(t)},U.prototype.toString=function(){return this._mixpanel.toString()+".people"},U.prototype._send_request=function(t,e){t.$token=this._get_config("token"),t.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),i=this._mixpanel.get_property("$user_id"),s=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(t.$device_id=n),i&&(t.$user_id=i),s&&(t.$had_persisted_distinct_id=s);var o=v.encodeDates(t);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},e):(this._enqueue(t),v.isUndefined(e)||(this._get_config("verbose")?e({status:-1,error:null}):e(-1)),v.truncate(o,255))},U.prototype._get_config=function(t){return this._mixpanel.get_config(t)},U.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},U.prototype._enqueue=function(t){Bt in t?this._mixpanel.persistence._add_to_people_queue(Bt,t):pn in t?this._mixpanel.persistence._add_to_people_queue(pn,t):st in t?this._mixpanel.persistence._add_to_people_queue(st,t):jt in t?this._mixpanel.persistence._add_to_people_queue(jt,t):ct in t?this._mixpanel.persistence._add_to_people_queue(ct,t):ft in t?this._mixpanel.persistence._add_to_people_queue(ft,t):zt in t?this._mixpanel.persistence._add_to_people_queue(zt,t):ee.error("Invalid call to _enqueue():",t)},U.prototype._flush_one_queue=function(t,e,n,i){var s=this,o=v.extend({},this._mixpanel.persistence.load_queue(t)),a=o;!v.isUndefined(o)&&v.isObject(o)&&!v.isEmptyObject(o)&&(s._mixpanel.persistence._pop_from_people_queue(t,o),s._mixpanel.persistence.save(),i&&(a=i(o)),e.call(s,a,function(c,l){c===0&&s._mixpanel.persistence._add_to_people_queue(t,o),v.isUndefined(n)||n(c,l)}))},U.prototype._flush=function(t,e,n,i,s,o,a){var c=this;this._flush_one_queue(Bt,this.set,t),this._flush_one_queue(pn,this.set_once,i),this._flush_one_queue(st,this.unset,o,function(k){return v.keys(k)}),this._flush_one_queue(jt,this.increment,e),this._flush_one_queue(zt,this.union,s);var l=this._mixpanel.persistence.load_queue(ct);if(!v.isUndefined(l)&&v.isArray(l)&&l.length)for(var m,p=function(k,x){k===0&&c._mixpanel.persistence._add_to_people_queue(ct,m),v.isUndefined(n)||n(k,x)},y=l.length-1;y>=0;y--)l=this._mixpanel.persistence.load_queue(ct),m=l.pop(),c._mixpanel.persistence.save(),v.isEmptyObject(m)||c.append(m,p);var b=this._mixpanel.persistence.load_queue(ft);if(!v.isUndefined(b)&&v.isArray(b)&&b.length)for(var g,w=function(k,x){k===0&&c._mixpanel.persistence._add_to_people_queue(ft,g),v.isUndefined(a)||a(k,x)},f=b.length-1;f>=0;f--)b=this._mixpanel.persistence.load_queue(ft),g=b.pop(),c._mixpanel.persistence.save(),v.isEmptyObject(g)||c.remove(g,w)},U.prototype._is_reserved_property=function(t){return t==="$distinct_id"||t==="$token"||t==="$device_id"||t==="$user_id"||t==="$had_persisted_distinct_id"},U.prototype.set=U.prototype.set,U.prototype.set_once=U.prototype.set_once,U.prototype.unset=U.prototype.unset,U.prototype.increment=U.prototype.increment,U.prototype.append=U.prototype.append,U.prototype.remove=U.prototype.remove,U.prototype.union=U.prototype.union,U.prototype.track_charge=U.prototype.track_charge,U.prototype.clear_charges=U.prototype.clear_charges,U.prototype.delete_user=U.prototype.delete_user,U.prototype.toString=U.prototype.toString;var ns="__mps",is="__mpso",ss="__mpus",os="__mpa",as="__mpap",rs="__mpr",ls="__mpu",Yo="$people_distinct_id",li="__alias",In="__timers",$l=[ns,is,ss,os,as,rs,ls,Yo,li,In],Z=function(t){this.props={},this.campaign_params_saved=!1,t.persistence_name?this.name="mp_"+t.persistence_name:this.name="mp_"+t.token+"_mixpanel";var e=t.persistence;e!=="cookie"&&e!=="localStorage"&&(ee.critical("Unknown persistence type "+e+"; falling back to cookie"),e=t.persistence="cookie"),e==="localStorage"&&v.localStorage.is_supported()?this.storage=v.localStorage:this.storage=v.cookie,this.load(),this.update_config(t),this.upgrade(),this.save()};Z.prototype.properties=function(){var t={};return this.load(),v.each(this.props,function(e,n){v.include($l,n)||(t[n]=e)}),t},Z.prototype.load=function(){if(!this.disabled){var t=this.storage.parse(this.name);t&&(this.props=v.extend({},t))}},Z.prototype.upgrade=function(){var t,e;this.storage===v.localStorage?(t=v.cookie.parse(this.name),v.cookie.remove(this.name),v.cookie.remove(this.name,!0),t&&this.register_once(t)):this.storage===v.cookie&&(e=v.localStorage.parse(this.name),v.localStorage.remove(this.name),e&&this.register_once(e))},Z.prototype.save=function(){this.disabled||this.storage.set(this.name,v.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Z.prototype.load_prop=function(t){return this.load(),this.props[t]},Z.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Z.prototype.clear=function(){this.remove(),this.props={}},Z.prototype.register_once=function(t,e,n){return v.isObject(t)?(typeof e>"u"&&(e="None"),this.expire_days=typeof n>"u"?this.default_expiry:n,this.load(),v.each(t,function(i,s){(!this.props.hasOwnProperty(s)||this.props[s]===e)&&(this.props[s]=i)},this),this.save(),!0):!1},Z.prototype.register=function(t,e){return v.isObject(t)?(this.expire_days=typeof e>"u"?this.default_expiry:e,this.load(),v.extend(this.props,t),this.save(),!0):!1},Z.prototype.unregister=function(t){this.load(),t in this.props&&(delete this.props[t],this.save())},Z.prototype.update_search_keyword=function(t){this.register(v.info.searchInfo(t))},Z.prototype.update_referrer_info=function(t){this.register_once({$initial_referrer:t||"$direct",$initial_referring_domain:v.info.referringDomain(t)||"$direct"},"")},Z.prototype.get_referrer_info=function(){return v.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Z.prototype.update_config=function(t){this.default_expiry=this.expire_days=t.cookie_expiration,this.set_disabled(t.disable_persistence),this.set_cookie_domain(t.cookie_domain),this.set_cross_site(t.cross_site_cookie),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie)},Z.prototype.set_disabled=function(t){this.disabled=t,this.disabled?this.remove():this.save()},Z.prototype.set_cookie_domain=function(t){t!==this.cookie_domain&&(this.remove(),this.cookie_domain=t,this.save())},Z.prototype.set_cross_site=function(t){t!==this.cross_site&&(this.cross_site=t,this.remove(),this.save())},Z.prototype.set_cross_subdomain=function(t){t!==this.cross_subdomain&&(this.cross_subdomain=t,this.remove(),this.save())},Z.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Z.prototype.set_secure=function(t){t!==this.secure&&(this.secure=!!t,this.remove(),this.save())},Z.prototype._add_to_people_queue=function(t,e){var n=this._get_queue_key(t),i=e[t],s=this._get_or_create_queue(Bt),o=this._get_or_create_queue(pn),a=this._get_or_create_queue(st),c=this._get_or_create_queue(jt),l=this._get_or_create_queue(zt),m=this._get_or_create_queue(ft,[]),p=this._get_or_create_queue(ct,[]);n===ns?(v.extend(s,i),this._pop_from_people_queue(jt,i),this._pop_from_people_queue(zt,i),this._pop_from_people_queue(st,i)):n===is?(v.each(i,function(y,b){b in o||(o[b]=y)}),this._pop_from_people_queue(st,i)):n===ss?v.each(i,function(y){v.each([s,o,c,l],function(b){y in b&&delete b[y]}),v.each(p,function(b){y in b&&delete b[y]}),a[y]=!0}):n===os?(v.each(i,function(y,b){b in s?s[b]+=y:(b in c||(c[b]=0),c[b]+=y)},this),this._pop_from_people_queue(st,i)):n===ls?(v.each(i,function(y,b){v.isArray(y)&&(b in l||(l[b]=[]),l[b]=l[b].concat(y))}),this._pop_from_people_queue(st,i)):n===rs?(m.push(i),this._pop_from_people_queue(ct,i)):n===as&&(p.push(i),this._pop_from_people_queue(st,i)),ee.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),ee.log(e),this.save()},Z.prototype._pop_from_people_queue=function(t,e){var n=this.props[this._get_queue_key(t)];v.isUndefined(n)||v.each(e,function(i,s){t===ct||t===ft?v.each(n,function(o){o[s]===i&&delete o[s]}):delete n[s]},this)},Z.prototype.load_queue=function(t){return this.load_prop(this._get_queue_key(t))},Z.prototype._get_queue_key=function(t){if(t===Bt)return ns;if(t===pn)return is;if(t===st)return ss;if(t===jt)return os;if(t===ct)return as;if(t===ft)return rs;if(t===zt)return ls;ee.error("Invalid queue:",t)},Z.prototype._get_or_create_queue=function(t,e){var n=this._get_queue_key(t);return e=v.isUndefined(e)?{}:e,this.props[n]||(this.props[n]=e)},Z.prototype.set_event_timer=function(t,e){var n=this.load_prop(In)||{};n[t]=e,this.props[In]=n,this.save()},Z.prototype.remove_event_timer=function(t){var e=this.load_prop(In)||{},n=e[t];return v.isUndefined(n)||(delete this.props[In][t],this.save()),n};var cs,Xo=function(t,e){throw new Error(t+" not available in this build.")},De,$o=0,ec=1,tc=function(t){return t},Dn=function(){},We="mixpanel",ea="base64",nc="json",ds="$device:",vn=O.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,ta=!vn&&lt.indexOf("MSIE")===-1&&lt.indexOf("Mozilla")===-1,ci=null;Et.sendBeacon&&(ci=function(){return Et.sendBeacon.apply(Et,arguments)});var na={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},ia={api_host:"https://api-js.mixpanel.com",api_routes:na,api_method:"POST",api_transport:"XHR",api_payload_format:ea,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Dn,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Dn,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_collect_fonts:!1,record_idle_timeout_ms:30*60*1e3,record_inline_images:!1,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:_n,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},sa=!1,L=function(){},us=function(t,e,n){var i,s=n===We?De:De[n];if(s&&cs===$o)i=s;else{if(s&&!v.isArray(s)){ee.error("You have already initialized "+n);return}i=new L}if(i._cached_groups={},i._init(t,e,n),i.people=new U,i.people._init(i),!i.get_config("skip_first_touch_marketing")){var o=v.info.campaignParams(null),a={},c=!1;v.each(o,function(l,m){a["initial_"+m]=l,l&&(c=!0)}),c&&i.people.set_once(a)}return vt.DEBUG=vt.DEBUG||i.get_config("debug"),!v.isUndefined(s)&&v.isArray(s)&&(i._execute_array.call(i.people,s.people),i._execute_array(s)),i};L.prototype.init=function(t,e,n){if(v.isUndefined(n)){this.report_error("You must name your new library: init(token, config, name)");return}if(n===We){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var i=us(t,e,n);return De[n]=i,i._loaded(),i},L.prototype._init=function(t,e,n){e=e||{},this.__loaded=!0,this.config={};var i={};if(!("api_payload_format"in e)){var s=e.api_host||ia.api_host;s.match(/\.mixpanel\.com/)&&(i.api_payload_format=nc)}if(this.set_config(v.extend({},ia,i,e,{name:n,token:t,callback_fn:(n===We?n:We+"."+n)+"._jsc"})),this._jsc=Dn,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!v.localStorage.is_supported(!0)||!vn)this._batch_requests=!1,ee.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),v.each(this.get_batcher_configs(),function(l){ee.log("Clearing batch queue "+l.queue_key),v.localStorage.remove(l.queue_key)});else if(this.init_batchers(),ci&&O.addEventListener){var o=v.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);O.addEventListener("pagehide",function(l){l.persisted&&o()}),O.addEventListener("visibilitychange",function(){oe.visibilityState==="hidden"&&o()})}}this.persistence=this.cookie=new Z(this.config),this.unpersisted_superprops={},this._gdpr_init();var a=v.UUID();this.get_distinct_id()||this.register_once({distinct_id:ds+a,$device_id:a},"");var c=this.get_config("track_pageview");c&&this._init_url_change_tracking(c),this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent")&&this.start_session_recording()},L.prototype.start_session_recording=Pt(function(){if(!O.MutationObserver){ee.critical("Browser does not support MutationObserver; skipping session recording");return}var t=v.bind(function(){this._recorder=this._recorder||new O.__mp_recorder(this),this._recorder.startRecording()},this);v.isUndefined(O.__mp_recorder)?Xo(this.get_config("recorder_src"),t):t()}),L.prototype.stop_session_recording=function(){this._recorder?this._recorder.stopRecording():ee.critical("Session recorder module not loaded")},L.prototype.get_session_recording_properties=function(){var t={};if(this._recorder){var e=this._recorder.replayId;e&&(t.$mp_replay_id=e)}return t},L.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var t=v.info.campaignParams(null);v.each(t,(function(e,n){this.unregister(n)}).bind(this))}},L.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(oe.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(v.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(oe.referrer)},L.prototype._dom_loaded=function(){v.each(this.__dom_loaded_queue,function(t){this._track_dom.apply(this,t)},this),this.has_opted_out_tracking()||v.each(this.__request_queue,function(t){this._send_request.apply(this,t)},this),delete this.__dom_loaded_queue,delete this.__request_queue},L.prototype._track_dom=function(t,e){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!sa)return this.__dom_loaded_queue.push([t,e]),!1;var n=new t().init(this);return n.track.apply(n,e)},L.prototype._init_url_change_tracking=function(t){var e="",n=this.track_pageview();if(n&&(e=v.info.currentUrl()),v.include(["full-url","url-with-path-and-query-string","url-with-path"],t)){O.addEventListener("popstate",function(){O.dispatchEvent(new Event("mp_locationchange"))}),O.addEventListener("hashchange",function(){O.dispatchEvent(new Event("mp_locationchange"))});var i=O.history.pushState;typeof i=="function"&&(O.history.pushState=function(o,a,c){i.call(O.history,o,a,c),O.dispatchEvent(new Event("mp_locationchange"))});var s=O.history.replaceState;typeof s=="function"&&(O.history.replaceState=function(o,a,c){s.call(O.history,o,a,c),O.dispatchEvent(new Event("mp_locationchange"))}),O.addEventListener("mp_locationchange",(function(){var o=v.info.currentUrl(),a=!1;if(t==="full-url"?a=o!==e:t==="url-with-path-and-query-string"?a=o.split("#")[0]!==e.split("#")[0]:t==="url-with-path"&&(a=o.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0]),a){var c=this.track_pageview();c&&(e=o)}}).bind(this))}},L.prototype._prepare_callback=function(t,e){if(v.isUndefined(t))return null;if(vn){var n=function(a){t(a,e)};return n}else{var i=this._jsc,s=""+Math.floor(Math.random()*1e8),o=this.get_config("callback_fn")+"["+s+"]";return i[s]=function(a){delete i[s],t(a,e)},o}},L.prototype._send_request=function(t,e,n,i){var s=!0;if(ta)return this.__request_queue.push(arguments),s;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},a=null;!i&&(v.isFunction(n)||typeof n=="string")&&(i=n,n=null),n=v.extend(o,n||{}),vn||(n.method="GET");var c=n.method==="POST",l=ci&&c&&n.transport.toLowerCase()==="sendbeacon",m=n.verbose;e.verbose&&(m=!0),this.get_config("test")&&(e.test=1),m&&(e.verbose=1),this.get_config("img")&&(e.img=1),vn||(i?e.callback=i:(m||this.get_config("test"))&&(e.callback="(function(){})")),e.ip=this.get_config("ip")?1:0,e._=new Date().getTime().toString(),c&&(a="data="+encodeURIComponent(e.data),delete e.data),t+="?"+v.HTTPBuildQuery(e);var p=this;if("img"in e){var y=oe.createElement("img");y.src=t,oe.body.appendChild(y)}else if(l){try{s=ci(t,a)}catch(x){p.report_error(x),s=!1}try{i&&i(s?1:0)}catch(x){p.report_error(x)}}else if(vn)try{var b=new XMLHttpRequest;b.open(n.method,t,!0);var g=this.get_config("xhr_headers");if(c&&(g["Content-Type"]="application/x-www-form-urlencoded"),v.each(g,function(x,A){b.setRequestHeader(A,x)}),n.timeout_ms&&typeof b.timeout<"u"){b.timeout=n.timeout_ms;var w=new Date().getTime()}b.withCredentials=!0,b.onreadystatechange=function(){if(b.readyState===4)if(b.status===200){if(i)if(m){var x;try{x=v.JSONDecode(b.responseText)}catch(E){if(p.report_error(E),n.ignore_json_errors)x=b.responseText;else return}i(x)}else i(Number(b.responseText))}else{var A;if(b.timeout&&!b.status&&new Date().getTime()-w>=b.timeout?A="timeout":A="Bad HTTP status: "+b.status+" "+b.statusText,p.report_error(A),i)if(m){var M=b.responseHeaders||{};i({status:0,httpStatusCode:b.status,error:A,retryAfter:M["Retry-After"]})}else i(0)}},b.send(a)}catch(x){p.report_error(x),s=!1}else{var f=oe.createElement("script");f.type="text/javascript",f.async=!0,f.defer=!0,f.src=t;var k=oe.getElementsByTagName("script")[0];k.parentNode.insertBefore(f,k)}return s},L.prototype._execute_array=function(t){var e,n=[],i=[],s=[];v.each(t,function(a){a&&(e=a[0],v.isArray(e)?s.push(a):typeof a=="function"?a.call(this):v.isArray(a)&&e==="alias"?n.push(a):v.isArray(a)&&e.indexOf("track")!==-1&&typeof this[e]=="function"?s.push(a):i.push(a))},this);var o=function(a,c){v.each(a,function(l){if(v.isArray(l[0])){var m=c;v.each(l,function(p){m=m[p[0]].apply(m,p.slice(1))})}else this[l[0]].apply(this,l.slice(1))},c)};o(n,this),o(i,this),o(s,this)},L.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},L.prototype.get_batcher_configs=function(){var t="__mpq_"+this.get_config("token"),e=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+e.track,queue_key:t+"_ev"},people:{type:"people",endpoint:"/"+e.engage,queue_key:t+"_pp"},groups:{type:"groups",endpoint:"/"+e.groups,queue_key:t+"_gr"}},this._batcher_configs},L.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var t=v.bind(function(n){return new nt(n.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:v.bind(function(i,s,o){this._send_request(this.get_config("api_host")+n.endpoint,this._encode_data_for_request(i),s,this._prepare_callback(o,i))},this),beforeSendHook:v.bind(function(i){return this._run_hook("before_send_"+n.type,i)},this),stopAllBatchingFunc:v.bind(this.stop_batch_senders,this),usePersistence:!0})},this),e=this.get_batcher_configs();this.request_batchers={events:t(e.events),people:t(e.people),groups:t(e.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},L.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,v.each(this.request_batchers,function(t){t.start()}))},L.prototype.stop_batch_senders=function(){this._batch_requests=!1,v.each(this.request_batchers,function(t){t.stop(),t.clear()})},L.prototype.push=function(t){this._execute_array([t])},L.prototype.disable=function(t){typeof t>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(t)},L.prototype._encode_data_for_request=function(t){var e=v.JSONEncode(t);return this.get_config("api_payload_format")===ea&&(e=v.base64Encode(e)),{data:e}},L.prototype._track_or_batch=function(t,e){var n=v.truncate(t.data,255),i=t.endpoint,s=t.batcher,o=t.should_send_immediately,a=t.send_request_options||{};e=e||Dn;var c=!0,l=v.bind(function(){return a.skip_hooks||(n=this._run_hook("before_send_"+t.type,n)),n?(ee.log("MIXPANEL REQUEST:"),ee.log(n),this._send_request(i,this._encode_data_for_request(n),a,this._prepare_callback(e,n))):null},this);return this._batch_requests&&!o?s.enqueue(n,function(m){m?e(1,n):l()}):c=l(),c&&n},L.prototype.track=Pt(function(t,e,n,i){!i&&typeof n=="function"&&(i=n,n=null),n=n||{};var s=n.transport;s&&(n.transport=s);var o=n.send_immediately;if(typeof i!="function"&&(i=Dn),v.isUndefined(t)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(t)){i(0);return}e=v.extend({},e),e.token=this.get_config("token");var a=this.persistence.remove_event_timer(t);if(!v.isUndefined(a)){var c=new Date().getTime()-a;e.$duration=parseFloat((c/1e3).toFixed(3))}this._set_default_superprops();var l=this.get_config("track_marketing")?v.info.marketingParams():{};e=v.extend({},v.info.properties({mp_loader:this.get_config("mp_loader")}),l,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),e);var m=this.get_config("property_blacklist");v.isArray(m)?v.each(m,function(b){delete e[b]}):this.report_error("Invalid value for property_blacklist config: "+m);var p={event:t,properties:e},y=this._track_or_batch({type:"events",data:p,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:n},i);return y}),L.prototype.set_group=Pt(function(t,e,n){v.isArray(e)||(e=[e]);var i={};return i[t]=e,this.register(i),this.people.set(t,e,n)}),L.prototype.add_group=Pt(function(t,e,n){var i=this.get_property(t),s={};return i===void 0?(s[t]=[e],this.register(s)):i.indexOf(e)===-1&&(i.push(e),s[t]=i,this.register(s)),this.people.union(t,e,n)}),L.prototype.remove_group=Pt(function(t,e,n){var i=this.get_property(t);if(i!==void 0){var s=i.indexOf(e);s>-1&&(i.splice(s,1),this.register({group_key:i})),i.length===0&&this.unregister(t)}return this.people.remove(t,e,n)}),L.prototype.track_with_groups=Pt(function(t,e,n,i){var s=v.extend({},e||{});return v.each(n,function(o,a){o!=null&&(s[a]=o)}),this.track(t,s,i)}),L.prototype._create_map_key=function(t,e){return t+"_"+JSON.stringify(e)},L.prototype._remove_group_from_cache=function(t,e){delete this._cached_groups[this._create_map_key(t,e)]},L.prototype.get_group=function(t,e){var n=this._create_map_key(t,e),i=this._cached_groups[n];return(i===void 0||i._group_key!==t||i._group_id!==e)&&(i=new le,i._init(this,t,e),this._cached_groups[n]=i),i},L.prototype.track_pageview=Pt(function(t,e){typeof t!="object"&&(t={}),e=e||{};var n=e.event_name||"$mp_web_page_view",i=v.extend(v.info.mpPageViewProperties(),v.info.campaignParams(),v.info.clickParams()),s=v.extend({},i,t);return this.track(n,s)}),L.prototype.track_links=function(){return this._track_dom.call(this,mn,arguments)},L.prototype.track_forms=function(){return this._track_dom.call(this,ri,arguments)},L.prototype.time_event=function(t){if(v.isUndefined(t)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(t)||this.persistence.set_event_timer(t,new Date().getTime())};var ic={persistent:!0},hs=function(t){var e;return v.isObject(t)?e=t:v.isUndefined(t)?e={}:e={days:t},v.extend({},ic,e)};L.prototype.register=function(t,e){var n=hs(e);n.persistent?this.persistence.register(t,n.days):v.extend(this.unpersisted_superprops,t)},L.prototype.register_once=function(t,e,n){var i=hs(n);i.persistent?this.persistence.register_once(t,e,i.days):(typeof e>"u"&&(e="None"),v.each(t,function(s,o){(!this.unpersisted_superprops.hasOwnProperty(o)||this.unpersisted_superprops[o]===e)&&(this.unpersisted_superprops[o]=s)},this))},L.prototype.unregister=function(t,e){e=hs(e),e.persistent?this.persistence.unregister(t):delete this.unpersisted_superprops[t]},L.prototype._register_single=function(t,e){var n={};n[t]=e,this.register(n)},L.prototype.identify=function(t,e,n,i,s,o,a,c){var l=this.get_distinct_id();if(t&&l!==t){if(typeof t=="string"&&t.indexOf(ds)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:t})}if(!this.get_property("$device_id")){var m=l;this.register_once({$had_persisted_distinct_id:!0,$device_id:m},"")}t!==l&&t!==this.get_property(li)&&(this.unregister(li),this.register({distinct_id:t})),this._flags.identify_called=!0,this.people._flush(e,n,i,s,o,a,c),t!==l&&this.track("$identify",{distinct_id:t,$anon_distinct_id:l},{skip_hooks:!0})},L.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var t=v.UUID();this.register_once({distinct_id:ds+t,$device_id:t},"")},L.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},L.prototype.alias=function(t,e){if(t===this.get_property(Yo))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return v.isUndefined(e)&&(e=this.get_distinct_id()),t!==e?(this._register_single(li,t),this.track("$create_alias",{alias:t,distinct_id:e},{skip_hooks:!0},function(){n.identify(t)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(t),-1)},L.prototype.name_tag=function(t){this._register_single("mp_name_tag",t)},L.prototype.set_config=function(t){if(v.isObject(t)){v.extend(this.config,t);var e=t.batch_size;e&&v.each(this.request_batchers,function(n){n.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),vt.DEBUG=vt.DEBUG||this.get_config("debug")}},L.prototype.get_config=function(t){return this.config[t]},L.prototype._run_hook=function(t){var e=(this.config.hooks[t]||tc).apply(this,_t.call(arguments,1));return typeof e>"u"&&(this.report_error(t+" hook did not return a value"),e=null),e},L.prototype.get_property=function(t){return this.persistence.load_prop([t])},L.prototype.toString=function(){var t=this.get_config("name");return t!==We&&(t=We+"."+t),t},L.prototype._event_is_disabled=function(t){return v.isBlockedUA(lt)||this._flags.disable_all_events||v.include(this.__disabled_events,t)},L.prototype._gdpr_init=function(){var t=this.get_config("opt_out_tracking_persistence_type")==="localStorage";t&&v.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||v.cookie.get("mp_optout"))&&(v.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},L.prototype._gdpr_update_persistence=function(t){var e;if(t&&t.clear_persistence)e=!0;else if(t&&t.enable_persistence)e=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==e&&this.persistence.set_disabled(e),e?this.stop_batch_senders():this._batchers_were_started&&this.start_batch_senders()},L.prototype._gdpr_call_func=function(t,e){return e=v.extend({track:v.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},e),v.localStorage.is_supported()||(e.persistence_type="cookie"),t(this.get_config("token"),{track:e.track,trackEventName:e.track_event_name,trackProperties:e.track_properties,persistenceType:e.persistence_type,persistencePrefix:e.cookie_prefix,cookieDomain:e.cookie_domain,cookieExpiration:e.cookie_expiration,crossSiteCookie:e.cross_site_cookie,crossSubdomainCookie:e.cross_subdomain_cookie,secureCookie:e.secure_cookie,ignoreDnt:e.ignore_dnt})},L.prototype.opt_in_tracking=function(t){t=v.extend({enable_persistence:!0},t),this._gdpr_call_func(Kl,t),this._gdpr_update_persistence(t)},L.prototype.opt_out_tracking=function(t){t=v.extend({clear_persistence:!0,delete_user:!0},t),t.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(Gl,t),this._gdpr_update_persistence(t)},L.prototype.has_opted_in_tracking=function(t){return this._gdpr_call_func(jl,t)},L.prototype.has_opted_out_tracking=function(t){return this._gdpr_call_func(Ko,t)},L.prototype.clear_opt_in_out_tracking=function(t){t=v.extend({enable_persistence:!0},t),this._gdpr_call_func(zl,t),this._gdpr_update_persistence(t)},L.prototype.report_error=function(t,e){ee.error.apply(ee.error,arguments);try{!e&&!(t instanceof Error)&&(t=new Error(t)),this.get_config("error_reporter")(t,e)}catch(n){ee.error(n)}},L.prototype.init=L.prototype.init,L.prototype.reset=L.prototype.reset,L.prototype.disable=L.prototype.disable,L.prototype.time_event=L.prototype.time_event,L.prototype.track=L.prototype.track,L.prototype.track_links=L.prototype.track_links,L.prototype.track_forms=L.prototype.track_forms,L.prototype.track_pageview=L.prototype.track_pageview,L.prototype.register=L.prototype.register,L.prototype.register_once=L.prototype.register_once,L.prototype.unregister=L.prototype.unregister,L.prototype.identify=L.prototype.identify,L.prototype.alias=L.prototype.alias,L.prototype.name_tag=L.prototype.name_tag,L.prototype.set_config=L.prototype.set_config,L.prototype.get_config=L.prototype.get_config,L.prototype.get_property=L.prototype.get_property,L.prototype.get_distinct_id=L.prototype.get_distinct_id,L.prototype.toString=L.prototype.toString,L.prototype.opt_out_tracking=L.prototype.opt_out_tracking,L.prototype.opt_in_tracking=L.prototype.opt_in_tracking,L.prototype.has_opted_out_tracking=L.prototype.has_opted_out_tracking,L.prototype.has_opted_in_tracking=L.prototype.has_opted_in_tracking,L.prototype.clear_opt_in_out_tracking=L.prototype.clear_opt_in_out_tracking,L.prototype.get_group=L.prototype.get_group,L.prototype.set_group=L.prototype.set_group,L.prototype.add_group=L.prototype.add_group,L.prototype.remove_group=L.prototype.remove_group,L.prototype.track_with_groups=L.prototype.track_with_groups,L.prototype.start_batch_senders=L.prototype.start_batch_senders,L.prototype.stop_batch_senders=L.prototype.stop_batch_senders,L.prototype.start_session_recording=L.prototype.start_session_recording,L.prototype.stop_session_recording=L.prototype.stop_session_recording,L.prototype.get_session_recording_properties=L.prototype.get_session_recording_properties,L.prototype.DEFAULT_API_ROUTES=na,Z.prototype.properties=Z.prototype.properties,Z.prototype.update_search_keyword=Z.prototype.update_search_keyword,Z.prototype.update_referrer_info=Z.prototype.update_referrer_info,Z.prototype.get_cross_subdomain=Z.prototype.get_cross_subdomain,Z.prototype.clear=Z.prototype.clear;var bn={},sc=function(){v.each(bn,function(t,e){e!==We&&(De[e]=t)}),De._=v},oc=function(){De.init=function(t,e,n){if(n)return De[n]||(De[n]=bn[n]=us(t,e,n),De[n]._loaded()),De[n];var i=De;bn[We]?i=bn[We]:t&&(i=us(t,e,We),i._loaded(),bn[We]=i),De=i,cs===ec&&(O[We]=De),sc()}},ac=function(){function t(){t.done||(t.done=!0,sa=!0,ta=!1,v.each(bn,function(i){i._dom_loaded()}))}function e(){try{oe.documentElement.doScroll("left")}catch{setTimeout(e,1);return}t()}if(oe.addEventListener)oe.readyState==="complete"?t():oe.addEventListener("DOMContentLoaded",t,!1);else if(oe.attachEvent){oe.attachEvent("onreadystatechange",t);var n=!1;try{n=O.frameElement===null}catch{}oe.documentElement.doScroll&&n&&e()}v.register_event(O,"load",t,!0)};function rc(t){return Xo=t,cs=$o,De=new L,oc(),De.init(),ac(),De}function lc(t,e){e()}var _=rc(lc);const cc=`<div id="checkoutConfirmationEnd" data-section="transfer">
1276
1276
  <div class="w-full">
1277
1277
  <div id="otp-content" class=" grid gap-4">
1278
1278
  <h5 class="text-black" id="otp-message">
@@ -1298,7 +1298,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1298
1298
  </div>
1299
1299
  </div>
1300
1300
  </div>
1301
- </div>`;class oa{constructor(e){d(this,"container");d(this,"onAction");d(this,"callBackUrl");d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"paymentMethod");this.container=e.container,this.onAction=e.onAction,this.callBackUrl=e.callBackUrl,this.paymentResponse=e.paymentResponse,this.paymentResponseHeaders=e.paymentResponseHeaders,this.paymentMethod=e.paymentMethod}attachListeners(){const e=this.container.querySelector("#goback-to-merchant"),n=this.container.querySelector("#transfer-button-text"),i=this.container.querySelector("#long-processing-text"),s=this.container.querySelector("#confirmed-text");i&&(i.innerHTML=P["long-processing"]),s&&(s.innerHTML=P["once-confirmed"]),n&&(n.innerHTML=q["merchant-back"]),e&&e.addEventListener("click",()=>{var o;_.track("redirect_to_merchant",{payment_method:this.paymentMethod,status:(o=this.paymentResponse)==null?void 0:o.status}),Pe(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)})}renderComponent(){var e;this.container.innerHTML=this.render(),_.track("payment_timeout",{payment_method:this.paymentMethod,status:(e=this.paymentResponse)==null?void 0:e.status}),this.attachListeners()}render(){return cc}}const dc=`<div id="confirmationProgress">
1301
+ </div>`;class oa{constructor(e){d(this,"container");d(this,"onAction");d(this,"callBackUrl");d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"paymentMethod");this.container=e.container,this.onAction=e.onAction,this.callBackUrl=e.callBackUrl,this.paymentResponse=e.paymentResponse,this.paymentResponseHeaders=e.paymentResponseHeaders,this.paymentMethod=e.paymentMethod}attachListeners(){const e=this.container.querySelector("#goback-to-merchant"),n=this.container.querySelector("#transfer-button-text"),i=this.container.querySelector("#long-processing-text"),s=this.container.querySelector("#confirmed-text");i&&(i.innerHTML=P["long-processing"]),s&&(s.innerHTML=P["once-confirmed"]),n&&(n.innerHTML=q["merchant-back"]),e&&e.addEventListener("click",()=>{var o;_.track("redirect_to_merchant",{payment_method:this.paymentMethod,status:(o=this.paymentResponse)==null?void 0:o.status}),Ie(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)})}renderComponent(){var e;this.container.innerHTML=this.render(),_.track("payment_timeout",{payment_method:this.paymentMethod,status:(e=this.paymentResponse)==null?void 0:e.status}),this.attachListeners()}render(){return cc}}const dc=`<div id="confirmationProgress">
1302
1302
  <div class="min-h-[20dvh]">
1303
1303
  <div>
1304
1304
  <div class="grid grid-rows-[auto_1fr] gap-4 mx-5">
@@ -1682,8 +1682,10 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1682
1682
  <img src="" alt="loader gif" />
1683
1683
  </div>
1684
1684
  <div id="details-content" class="grid gap-5">
1685
- <h5 class="text-sm text-tone-100 text-center font-semibold md:w-4/5 mx-auto" id="transfer-header-text" data-translate="transfer-header">
1686
-
1685
+ <h5 class="text-sm text-tone-100 text-center md:w-4/5 mx-auto">
1686
+ <span id="transfer-header-1" class="font-medium" data-translate="transfer-header-1"></span>
1687
+ <span class="font-bold" id="transfer-header-2" data-translate="transfer-header-2"></span>
1688
+ <span id="transfer-header-3" class="font-medium" data-translate="transfer-header-3"></span>
1687
1689
  </h5>
1688
1690
  <div class="border border-grey-100 rounded-lg text-black px-6 py-5 grid gap-4">
1689
1691
  <div class="text-sm grid grid-cols-[1fr_auto] gap-3">
@@ -1753,7 +1755,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1753
1755
  <p class="font-semibold" id="account-name"></p>
1754
1756
  </div>
1755
1757
  </div>
1756
-
1758
+
1757
1759
  <div class="mt-3">
1758
1760
  <button type="button" id="transfer-button" data-translate="made-transfer" class="details-form-button"></button>
1759
1761
  </div>
@@ -1772,8 +1774,8 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1772
1774
  *
1773
1775
  * Copyright 2020, Pusher
1774
1776
  * Released under the MIT licence.
1775
- */(function(t,e){(function(i,s){t.exports=s()})(window,function(){return function(n){var i={};function s(o){if(i[o])return i[o].exports;var a=i[o]={i:o,l:!1,exports:{}};return n[o].call(a.exports,a,a.exports,s),a.l=!0,a.exports}return s.m=n,s.c=i,s.d=function(o,a,c){s.o(o,a)||Object.defineProperty(o,a,{enumerable:!0,get:c})},s.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},s.t=function(o,a){if(a&1&&(o=s(o)),a&8||a&4&&typeof o=="object"&&o&&o.__esModule)return o;var c=Object.create(null);if(s.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:o}),a&2&&typeof o!="string")for(var l in o)s.d(c,l,(function(m){return o[m]}).bind(null,l));return c},s.n=function(o){var a=o&&o.__esModule?function(){return o.default}:function(){return o};return s.d(a,"a",a),a},s.o=function(o,a){return Object.prototype.hasOwnProperty.call(o,a)},s.p="",s(s.s=2)}([function(n,i,s){var o=this&&this.__extends||function(){var f=function(k,x){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,M){A.__proto__=M}||function(A,M){for(var E in M)M.hasOwnProperty(E)&&(A[E]=M[E])},f(k,x)};return function(k,x){f(k,x);function A(){this.constructor=k}k.prototype=x===null?Object.create(x):(A.prototype=x.prototype,new A)}}();Object.defineProperty(i,"__esModule",{value:!0});var a=256,c=function(){function f(k){k===void 0&&(k="="),this._paddingCharacter=k}return f.prototype.encodedLength=function(k){return this._paddingCharacter?(k+2)/3*4|0:(k*8+5)/6|0},f.prototype.encode=function(k){for(var x="",A=0;A<k.length-2;A+=3){var M=k[A]<<16|k[A+1]<<8|k[A+2];x+=this._encodeByte(M>>>3*6&63),x+=this._encodeByte(M>>>2*6&63),x+=this._encodeByte(M>>>1*6&63),x+=this._encodeByte(M>>>0*6&63)}var E=k.length-A;if(E>0){var M=k[A]<<16|(E===2?k[A+1]<<8:0);x+=this._encodeByte(M>>>3*6&63),x+=this._encodeByte(M>>>2*6&63),E===2?x+=this._encodeByte(M>>>1*6&63):x+=this._paddingCharacter||"",x+=this._paddingCharacter||""}return x},f.prototype.maxDecodedLength=function(k){return this._paddingCharacter?k/4*3|0:(k*6+7)/8|0},f.prototype.decodedLength=function(k){return this.maxDecodedLength(k.length-this._getPaddingLength(k))},f.prototype.decode=function(k){if(k.length===0)return new Uint8Array(0);for(var x=this._getPaddingLength(k),A=k.length-x,M=new Uint8Array(this.maxDecodedLength(A)),E=0,D=0,F=0,W=0,G=0,Q=0,de=0;D<A-4;D+=4)W=this._decodeChar(k.charCodeAt(D+0)),G=this._decodeChar(k.charCodeAt(D+1)),Q=this._decodeChar(k.charCodeAt(D+2)),de=this._decodeChar(k.charCodeAt(D+3)),M[E++]=W<<2|G>>>4,M[E++]=G<<4|Q>>>2,M[E++]=Q<<6|de,F|=W&a,F|=G&a,F|=Q&a,F|=de&a;if(D<A-1&&(W=this._decodeChar(k.charCodeAt(D)),G=this._decodeChar(k.charCodeAt(D+1)),M[E++]=W<<2|G>>>4,F|=W&a,F|=G&a),D<A-2&&(Q=this._decodeChar(k.charCodeAt(D+2)),M[E++]=G<<4|Q>>>2,F|=Q&a),D<A-3&&(de=this._decodeChar(k.charCodeAt(D+3)),M[E++]=Q<<6|de,F|=de&a),F!==0)throw new Error("Base64Coder: incorrect characters for decoding");return M},f.prototype._encodeByte=function(k){var x=k;return x+=65,x+=25-k>>>8&6,x+=51-k>>>8&-75,x+=61-k>>>8&-15,x+=62-k>>>8&3,String.fromCharCode(x)},f.prototype._decodeChar=function(k){var x=a;return x+=(42-k&k-44)>>>8&-a+k-43+62,x+=(46-k&k-48)>>>8&-a+k-47+63,x+=(47-k&k-58)>>>8&-a+k-48+52,x+=(64-k&k-91)>>>8&-a+k-65+0,x+=(96-k&k-123)>>>8&-a+k-97+26,x},f.prototype._getPaddingLength=function(k){var x=0;if(this._paddingCharacter){for(var A=k.length-1;A>=0&&k[A]===this._paddingCharacter;A--)x++;if(k.length<4||x>2)throw new Error("Base64Coder: incorrect padding")}return x},f}();i.Coder=c;var l=new c;function m(f){return l.encode(f)}i.encode=m;function p(f){return l.decode(f)}i.decode=p;var y=function(f){o(k,f);function k(){return f!==null&&f.apply(this,arguments)||this}return k.prototype._encodeByte=function(x){var A=x;return A+=65,A+=25-x>>>8&6,A+=51-x>>>8&-75,A+=61-x>>>8&-13,A+=62-x>>>8&49,String.fromCharCode(A)},k.prototype._decodeChar=function(x){var A=a;return A+=(44-x&x-46)>>>8&-a+x-45+62,A+=(94-x&x-96)>>>8&-a+x-95+63,A+=(47-x&x-58)>>>8&-a+x-48+52,A+=(64-x&x-91)>>>8&-a+x-65+0,A+=(96-x&x-123)>>>8&-a+x-97+26,A},k}(c);i.URLSafeCoder=y;var b=new y;function g(f){return b.encode(f)}i.encodeURLSafe=g;function w(f){return b.decode(f)}i.decodeURLSafe=w,i.encodedLength=function(f){return l.encodedLength(f)},i.maxDecodedLength=function(f){return l.maxDecodedLength(f)},i.decodedLength=function(f){return l.decodedLength(f)}},function(n,i,s){Object.defineProperty(i,"__esModule",{value:!0});var o="utf8: invalid string",a="utf8: invalid source encoding";function c(p){for(var y=new Uint8Array(l(p)),b=0,g=0;g<p.length;g++){var w=p.charCodeAt(g);w<128?y[b++]=w:w<2048?(y[b++]=192|w>>6,y[b++]=128|w&63):w<55296?(y[b++]=224|w>>12,y[b++]=128|w>>6&63,y[b++]=128|w&63):(g++,w=(w&1023)<<10,w|=p.charCodeAt(g)&1023,w+=65536,y[b++]=240|w>>18,y[b++]=128|w>>12&63,y[b++]=128|w>>6&63,y[b++]=128|w&63)}return y}i.encode=c;function l(p){for(var y=0,b=0;b<p.length;b++){var g=p.charCodeAt(b);if(g<128)y+=1;else if(g<2048)y+=2;else if(g<55296)y+=3;else if(g<=57343){if(b>=p.length-1)throw new Error(o);b++,y+=4}else throw new Error(o)}return y}i.encodedLength=l;function m(p){for(var y=[],b=0;b<p.length;b++){var g=p[b];if(g&128){var w=void 0;if(g<224){if(b>=p.length)throw new Error(a);var f=p[++b];if((f&192)!==128)throw new Error(a);g=(g&31)<<6|f&63,w=128}else if(g<240){if(b>=p.length-1)throw new Error(a);var f=p[++b],k=p[++b];if((f&192)!==128||(k&192)!==128)throw new Error(a);g=(g&15)<<12|(f&63)<<6|k&63,w=2048}else if(g<248){if(b>=p.length-2)throw new Error(a);var f=p[++b],k=p[++b],x=p[++b];if((f&192)!==128||(k&192)!==128||(x&192)!==128)throw new Error(a);g=(g&15)<<18|(f&63)<<12|(k&63)<<6|x&63,w=65536}else throw new Error(a);if(g<w||g>=55296&&g<=57343)throw new Error(a);if(g>=65536){if(g>1114111)throw new Error(a);g-=65536,y.push(String.fromCharCode(55296|g>>10)),g=56320|g&1023}}y.push(String.fromCharCode(g))}return y.join("")}i.decode=m},function(n,i,s){n.exports=s(3).default},function(n,i,s){s.r(i);class o{constructor(r,u){this.lastId=0,this.prefix=r,this.name=u}create(r){this.lastId++;var u=this.lastId,C=this.prefix+u,S=this.name+"["+u+"]",T=!1,I=function(){T||(r.apply(null,arguments),T=!0)};return this[u]=I,{number:u,id:C,name:S,callback:I}}remove(r){delete this[r.number]}}var a=new o("_pusher_script_","Pusher.ScriptReceivers"),c={VERSION:"8.4.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},l=c;class m{constructor(r){this.options=r,this.receivers=r.receivers||a,this.loading={}}load(r,u,C){var S=this;if(S.loading[r]&&S.loading[r].length>0)S.loading[r].push(C);else{S.loading[r]=[C];var T=K.createScriptRequest(S.getPath(r,u)),I=S.receivers.create(function(B){if(S.receivers.remove(I),S.loading[r]){var V=S.loading[r];delete S.loading[r];for(var $=function(we){we||T.cleanup()},se=0;se<V.length;se++)V[se](B,$)}});T.send(I)}}getRoot(r){var u,C=K.getDocument().location.protocol;return r&&r.useTLS||C==="https:"?u=this.options.cdn_https:u=this.options.cdn_http,u.replace(/\/*$/,"")+"/"+this.options.version}getPath(r,u){return this.getRoot(u)+"/"+r+this.options.suffix+".js"}}var p=new o("_pusher_dependencies","Pusher.DependenciesReceivers"),y=new m({cdn_http:l.cdn_http,cdn_https:l.cdn_https,version:l.VERSION,suffix:l.dependency_suffix,receivers:p});const b={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var w={buildLogSuffix:function(h){const r="See:",u=b.urls[h];if(!u)return"";let C;return u.fullUrl?C=u.fullUrl:u.path&&(C=b.baseUrl+u.path),C?`${r} ${C}`:""}},f;(function(h){h.UserAuthentication="user-authentication",h.ChannelAuthorization="channel-authorization"})(f||(f={}));class k extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class x extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class A extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class M extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class E extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class D extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class F extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class W extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class G extends Error{constructor(r,u){super(u),this.status=r,Object.setPrototypeOf(this,new.target.prototype)}}var de=function(h,r,u,C,S){const T=K.createXHR();T.open("POST",u.endpoint,!0),T.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var I in u.headers)T.setRequestHeader(I,u.headers[I]);if(u.headersProvider!=null){let B=u.headersProvider();for(var I in B)T.setRequestHeader(I,B[I])}return T.onreadystatechange=function(){if(T.readyState===4)if(T.status===200){let B,V=!1;try{B=JSON.parse(T.responseText),V=!0}catch{S(new G(200,`JSON returned from ${C.toString()} endpoint was invalid, yet status code was 200. Data was: ${T.responseText}`),null)}V&&S(null,B)}else{let B="";switch(C){case f.UserAuthentication:B=w.buildLogSuffix("authenticationEndpoint");break;case f.ChannelAuthorization:B=`Clients must be authorized to join private or presence channels. ${w.buildLogSuffix("authorizationEndpoint")}`;break}S(new G(T.status,`Unable to retrieve auth string from ${C.toString()} endpoint - received status: ${T.status} from ${u.endpoint}. ${B}`),null)}},T.send(r),T};function _e(h){return yt(Ge(h))}var j=String.fromCharCode,Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ge=function(h){var r=h.charCodeAt(0);return r<128?h:r<2048?j(192|r>>>6)+j(128|r&63):j(224|r>>>12&15)+j(128|r>>>6&63)+j(128|r&63)},Ge=function(h){return h.replace(/[^\x00-\x7F]/g,ge)},Se=function(h){var r=[0,2,1][h.length%3],u=h.charCodeAt(0)<<16|(h.length>1?h.charCodeAt(1):0)<<8|(h.length>2?h.charCodeAt(2):0),C=[Oe.charAt(u>>>18),Oe.charAt(u>>>12&63),r>=2?"=":Oe.charAt(u>>>6&63),r>=1?"=":Oe.charAt(u&63)];return C.join("")},yt=window.btoa||function(h){return h.replace(/[\s\S]{1,3}/g,Se)};class dt{constructor(r,u,C,S){this.clear=u,this.timer=r(()=>{this.timer&&(this.timer=S(this.timer))},C)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var Ct=dt;function qt(h){window.clearTimeout(h)}function Nt(h){window.clearInterval(h)}class je extends Ct{constructor(r,u){super(setTimeout,qt,r,function(C){return u(),null})}}class wt extends Ct{constructor(r,u){super(setInterval,Nt,r,function(C){return u(),C})}}var Zt={now(){return Date.now?Date.now():new Date().valueOf()},defer(h){return new je(0,h)},method(h,...r){var u=Array.prototype.slice.call(arguments,1);return function(C){return C[h].apply(C,u.concat(arguments))}}},me=Zt;function xe(h,...r){for(var u=0;u<r.length;u++){var C=r[u];for(var S in C)C[S]&&C[S].constructor&&C[S].constructor===Object?h[S]=xe(h[S]||{},C[S]):h[S]=C[S]}return h}function Qe(){for(var h=["Pusher"],r=0;r<arguments.length;r++)typeof arguments[r]=="string"?h.push(arguments[r]):h.push(Wt(arguments[r]));return h.join(" : ")}function ze(h,r){var u=Array.prototype.indexOf;if(h===null)return-1;if(u&&h.indexOf===u)return h.indexOf(r);for(var C=0,S=h.length;C<S;C++)if(h[C]===r)return C;return-1}function De(h,r){for(var u in h)Object.prototype.hasOwnProperty.call(h,u)&&r(h[u],u,h)}function ut(h){var r=[];return De(h,function(u,C){r.push(C)}),r}function R(h){var r=[];return De(h,function(u){r.push(u)}),r}function ye(h,r,u){for(var C=0;C<h.length;C++)r.call(u||window,h[C],C,h)}function ie(h,r){for(var u=[],C=0;C<h.length;C++)u.push(r(h[C],C,h,u));return u}function Ce(h,r){var u={};return De(h,function(C,S){u[S]=r(C)}),u}function qe(h,r){r=r||function(S){return!!S};for(var u=[],C=0;C<h.length;C++)r(h[C],C,h,u)&&u.push(h[C]);return u}function te(h,r){var u={};return De(h,function(C,S){(r&&r(C,S,h,u)||C)&&(u[S]=C)}),u}function Ot(h){var r=[];return De(h,function(u,C){r.push([C,u])}),r}function Bn(h,r){for(var u=0;u<h.length;u++)if(r(h[u],u,h))return!0;return!1}function hi(h,r){for(var u=0;u<h.length;u++)if(!r(h[u],u,h))return!1;return!0}function mi(h){return Ce(h,function(r){return typeof r=="object"&&(r=Wt(r)),encodeURIComponent(_e(r.toString()))})}function pi(h){var r=te(h,function(C){return C!==void 0}),u=ie(Ot(mi(r)),me.method("join","=")).join("&");return u}function vi(h){var r=[],u=[];return function C(S,T){var I,B,V;switch(typeof S){case"object":if(!S)return null;for(I=0;I<r.length;I+=1)if(r[I]===S)return{$ref:u[I]};if(r.push(S),u.push(T),Object.prototype.toString.apply(S)==="[object Array]")for(V=[],I=0;I<S.length;I+=1)V[I]=C(S[I],T+"["+I+"]");else{V={};for(B in S)Object.prototype.hasOwnProperty.call(S,B)&&(V[B]=C(S[B],T+"["+JSON.stringify(B)+"]"))}return V;case"number":case"string":case"boolean":return S}}(h,"$")}function Wt(h){try{return JSON.stringify(h)}catch{return JSON.stringify(vi(h))}}class bi{constructor(){this.globalLog=r=>{window.console&&window.console.log&&window.console.log(r)}}debug(...r){this.log(this.globalLog,r)}warn(...r){this.log(this.globalLogWarn,r)}error(...r){this.log(this.globalLogError,r)}globalLogWarn(r){window.console&&window.console.warn?window.console.warn(r):this.globalLog(r)}globalLogError(r){window.console&&window.console.error?window.console.error(r):this.globalLogWarn(r)}log(r,...u){var C=Qe.apply(this,arguments);ks.log?ks.log(C):ks.logToConsole&&r.bind(this)(C)}}var re=new bi,fi=function(h,r,u,C,S){(u.headers!==void 0||u.headersProvider!=null)&&re.warn(`To send headers with the ${C.toString()} request, you must use AJAX, rather than JSONP.`);var T=h.nextAuthCallbackID.toString();h.nextAuthCallbackID++;var I=h.getDocument(),B=I.createElement("script");h.auth_callbacks[T]=function(se){S(null,se)};var V="Pusher.auth_callbacks['"+T+"']";B.src=u.endpoint+"?callback="+encodeURIComponent(V)+"&"+r;var $=I.getElementsByTagName("head")[0]||I.documentElement;$.insertBefore(B,$.firstChild)},gi=fi;class yi{constructor(r){this.src=r}send(r){var u=this,C="Error loading "+u.src;u.script=document.createElement("script"),u.script.id=r.id,u.script.src=u.src,u.script.type="text/javascript",u.script.charset="UTF-8",u.script.addEventListener?(u.script.onerror=function(){r.callback(C)},u.script.onload=function(){r.callback(null)}):u.script.onreadystatechange=function(){(u.script.readyState==="loaded"||u.script.readyState==="complete")&&r.callback(null)},u.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(u.errorScript=document.createElement("script"),u.errorScript.id=r.id+"_error",u.errorScript.text=r.name+"('"+C+"');",u.script.async=u.errorScript.async=!1):u.script.async=!0;var S=document.getElementsByTagName("head")[0];S.insertBefore(u.script,S.firstChild),u.errorScript&&S.insertBefore(u.errorScript,u.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class Ci{constructor(r,u){this.url=r,this.data=u}send(r){if(!this.request){var u=pi(this.data),C=this.url+"/"+r.number+"?"+u;this.request=K.createScriptRequest(C),this.request.send(r)}}cleanup(){this.request&&this.request.cleanup()}}var wi=function(h,r){return function(u,C){var S="http"+(r?"s":"")+"://",T=S+(h.host||h.options.host)+h.options.path,I=K.createJSONPRequest(T,u),B=K.ScriptReceivers.create(function(V,$){a.remove(B),I.cleanup(),$&&$.host&&(h.host=$.host),C&&C(V,$)});I.send(B)}},ki={name:"jsonp",getAgent:wi},Si=ki;function gn(h,r,u){var C=h+(r.useTLS?"s":""),S=r.useTLS?r.hostTLS:r.hostNonTLS;return C+"://"+S+u}function yn(h,r){var u="/app/"+h,C="?protocol="+l.PROTOCOL+"&client=js&version="+l.VERSION+(r?"&"+r:"");return u+C}var xi={getInitial:function(h,r){var u=(r.httpPath||"")+yn(h,"flash=false");return gn("ws",r,u)}},Ai={getInitial:function(h,r){var u=(r.httpPath||"/pusher")+yn(h);return gn("http",r,u)}},Mi={getInitial:function(h,r){return gn("http",r,r.httpPath||"/pusher")},getPath:function(h,r){return yn(h)}};class Li{constructor(){this._callbacks={}}get(r){return this._callbacks[Cn(r)]}add(r,u,C){var S=Cn(r);this._callbacks[S]=this._callbacks[S]||[],this._callbacks[S].push({fn:u,context:C})}remove(r,u,C){if(!r&&!u&&!C){this._callbacks={};return}var S=r?[Cn(r)]:ut(this._callbacks);u||C?this.removeCallback(S,u,C):this.removeAllCallbacks(S)}removeCallback(r,u,C){ye(r,function(S){this._callbacks[S]=qe(this._callbacks[S]||[],function(T){return u&&u!==T.fn||C&&C!==T.context}),this._callbacks[S].length===0&&delete this._callbacks[S]},this)}removeAllCallbacks(r){ye(r,function(u){delete this._callbacks[u]},this)}}function Cn(h){return"_"+h}class Je{constructor(r){this.callbacks=new Li,this.global_callbacks=[],this.failThrough=r}bind(r,u,C){return this.callbacks.add(r,u,C),this}bind_global(r){return this.global_callbacks.push(r),this}unbind(r,u,C){return this.callbacks.remove(r,u,C),this}unbind_global(r){return r?(this.global_callbacks=qe(this.global_callbacks||[],u=>u!==r),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(r,u,C){for(var S=0;S<this.global_callbacks.length;S++)this.global_callbacks[S](r,u);var T=this.callbacks.get(r),I=[];if(C?I.push(u,C):u&&I.push(u),T&&T.length>0)for(var S=0;S<T.length;S++)T[S].fn.apply(T[S].context||window,I);else this.failThrough&&this.failThrough(r,u);return this}}class Ti extends Je{constructor(r,u,C,S,T){super(),this.initialize=K.transportConnectionInitializer,this.hooks=r,this.name=u,this.priority=C,this.key=S,this.options=T,this.state="new",this.timeline=T.timeline,this.activityTimeout=T.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var r=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(r,this.options)}catch(u){return me.defer(()=>{this.onError(u),this.changeState("closed")}),!1}return this.bindListeners(),re.debug("Connecting",{transport:this.name,url:r}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(r){return this.state==="open"?(me.defer(()=>{this.socket&&this.socket.send(r)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(r){this.emit("error",{type:"WebSocketError",error:r}),this.timeline.error(this.buildTimelineMessage({error:r.toString()}))}onClose(r){r?this.changeState("closed",{code:r.code,reason:r.reason,wasClean:r.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(r){this.emit("message",r)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=r=>{this.onError(r)},this.socket.onclose=r=>{this.onClose(r)},this.socket.onmessage=r=>{this.onMessage(r)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(r,u){this.state=r,this.timeline.info(this.buildTimelineMessage({state:r,params:u})),this.emit(r,u)}buildTimelineMessage(r){return xe({cid:this.id},r)}}class kt{constructor(r){this.hooks=r}isSupported(r){return this.hooks.isSupported(r)}createConnection(r,u,C,S){return new Ti(this.hooks,r,u,C,S)}}var _i=new kt({urls:xi,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!K.getWebSocketAPI()},isSupported:function(){return!!K.getWebSocketAPI()},getSocket:function(h){return K.createWebSocket(h)}}),Hn={urls:Ai,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},ot=xe({getSocket:function(h){return K.HTTPFactory.createStreamingSocket(h)}},Hn),Ut=xe({getSocket:function(h){return K.HTTPFactory.createPollingSocket(h)}},Hn),St={isSupported:function(){return K.isXHRSupported()}},ga=new kt(xe({},ot,St)),ya=new kt(xe({},Ut,St)),Ye={ws:_i,xhr_streaming:ga,xhr_polling:ya},ht=Ye,Ei=new kt({file:"sockjs",urls:Mi,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(h,r){return new window.SockJS(h,null,{js_path:y.getPath("sockjs",{useTLS:r.useTLS}),ignore_null_origin:r.ignoreNullOrigin})},beforeOpen:function(h,r){h.send(JSON.stringify({path:r}))}}),Pi={isSupported:function(h){var r=K.isXDRSupported(h.useTLS);return r}},ld=new kt(xe({},ot,Pi)),cd=new kt(xe({},Ut,Pi));ht.xdr_streaming=ld,ht.xdr_polling=cd,ht.sockjs=Ei;var dd=ht;class ud extends Je{constructor(){super();var r=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){r.emit("online")},!1),window.addEventListener("offline",function(){r.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var hd=new ud;class md{constructor(r,u,C){this.manager=r,this.transport=u,this.minPingDelay=C.minPingDelay,this.maxPingDelay=C.maxPingDelay,this.pingDelay=void 0}createConnection(r,u,C,S){S=xe({},S,{activityTimeout:this.pingDelay});var T=this.transport.createConnection(r,u,C,S),I=null,B=function(){T.unbind("open",B),T.bind("closed",V),I=me.now()},V=$=>{if(T.unbind("closed",V),$.code===1002||$.code===1003)this.manager.reportDeath();else if(!$.wasClean&&I){var se=me.now()-I;se<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(se/2,this.minPingDelay))}};return T.bind("open",B),T}isSupported(r){return this.manager.isAlive()&&this.transport.isSupported(r)}}const Ca={decodeMessage:function(h){try{var r=JSON.parse(h.data),u=r.data;if(typeof u=="string")try{u=JSON.parse(r.data)}catch{}var C={event:r.event,channel:r.channel,data:u};return r.user_id&&(C.user_id=r.user_id),C}catch(S){throw{type:"MessageParseError",error:S,data:h.data}}},encodeMessage:function(h){return JSON.stringify(h)},processHandshake:function(h){var r=Ca.decodeMessage(h);if(r.event==="pusher:connection_established"){if(!r.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:r.data.socket_id,activityTimeout:r.data.activity_timeout*1e3}}else{if(r.event==="pusher:error")return{action:this.getCloseAction(r.data),error:this.getCloseError(r.data)};throw"Invalid handshake"}},getCloseAction:function(h){return h.code<4e3?h.code>=1002&&h.code<=1004?"backoff":null:h.code===4e3?"tls_only":h.code<4100?"refused":h.code<4200?"backoff":h.code<4300?"retry":"refused"},getCloseError:function(h){return h.code!==1e3&&h.code!==1001?{type:"PusherError",data:{code:h.code,message:h.reason||h.message}}:null}};var Qt=Ca;class pd extends Je{constructor(r,u){super(),this.id=r,this.transport=u,this.activityTimeout=u.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(r){return this.transport.send(r)}send_event(r,u,C){var S={event:r,data:u};return C&&(S.channel=C),re.debug("Event sent",S),this.send(Qt.encodeMessage(S))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var r={message:C=>{var S;try{S=Qt.decodeMessage(C)}catch(T){this.emit("error",{type:"MessageParseError",error:T,data:C.data})}if(S!==void 0){switch(re.debug("Event recd",S),S.event){case"pusher:error":this.emit("error",{type:"PusherError",data:S.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",S)}},activity:()=>{this.emit("activity")},error:C=>{this.emit("error",C)},closed:C=>{u(),C&&C.code&&this.handleCloseEvent(C),this.transport=null,this.emit("closed")}},u=()=>{De(r,(C,S)=>{this.transport.unbind(S,C)})};De(r,(C,S)=>{this.transport.bind(S,C)})}handleCloseEvent(r){var u=Qt.getCloseAction(r),C=Qt.getCloseError(r);C&&this.emit("error",C),u&&this.emit(u,{action:u,error:C})}}class vd{constructor(r,u){this.transport=r,this.callback=u,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=r=>{this.unbindListeners();var u;try{u=Qt.processHandshake(r)}catch(C){this.finish("error",{error:C}),this.transport.close();return}u.action==="connected"?this.finish("connected",{connection:new pd(u.id,this.transport),activityTimeout:u.activityTimeout}):(this.finish(u.action,{error:u.error}),this.transport.close())},this.onClosed=r=>{this.unbindListeners();var u=Qt.getCloseAction(r)||"backoff",C=Qt.getCloseError(r);this.finish(u,{error:C})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(r,u){this.callback(xe({transport:this.transport,action:r},u))}}class bd{constructor(r,u){this.timeline=r,this.options=u||{}}send(r,u){this.timeline.isEmpty()||this.timeline.send(K.TimelineTransport.getAgent(this,r),u)}}class vs extends Je{constructor(r,u){super(function(C,S){re.debug("No callbacks on "+r+" for "+C)}),this.name=r,this.pusher=u,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(r,u){return u(null,{auth:""})}trigger(r,u){if(r.indexOf("client-")!==0)throw new k("Event '"+r+"' does not start with 'client-'");if(!this.subscribed){var C=w.buildLogSuffix("triggeringClientEvents");re.warn(`Client event triggered before channel 'subscription_succeeded' event . ${C}`)}return this.pusher.send_event(r,u,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(r){var u=r.event,C=r.data;if(u==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(r);else if(u==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(r);else if(u.indexOf("pusher_internal:")!==0){var S={};this.emit(u,C,S)}}handleSubscriptionSucceededEvent(r){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",r.data)}handleSubscriptionCountEvent(r){r.data.subscription_count&&(this.subscriptionCount=r.data.subscription_count),this.emit("pusher:subscription_count",r.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(r,u)=>{r?(this.subscriptionPending=!1,re.error(r.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:r.message},r instanceof G?{status:r.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:u.auth,channel_data:u.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class bs extends vs{authorize(r,u){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:r},u)}}class fd{constructor(){this.reset()}get(r){return Object.prototype.hasOwnProperty.call(this.members,r)?{id:r,info:this.members[r]}:null}each(r){De(this.members,(u,C)=>{r(this.get(C))})}setMyID(r){this.myID=r}onSubscription(r){this.members=r.presence.hash,this.count=r.presence.count,this.me=this.get(this.myID)}addMember(r){return this.get(r.user_id)===null&&this.count++,this.members[r.user_id]=r.user_info,this.get(r.user_id)}removeMember(r){var u=this.get(r.user_id);return u&&(delete this.members[r.user_id],this.count--),u}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var gd=function(h,r,u,C){function S(T){return T instanceof u?T:new u(function(I){I(T)})}return new(u||(u=Promise))(function(T,I){function B(se){try{$(C.next(se))}catch(we){I(we)}}function V(se){try{$(C.throw(se))}catch(we){I(we)}}function $(se){se.done?T(se.value):S(se.value).then(B,V)}$((C=C.apply(h,r||[])).next())})};class yd extends bs{constructor(r,u){super(r,u),this.members=new fd}authorize(r,u){super.authorize(r,(C,S)=>gd(this,void 0,void 0,function*(){if(!C)if(S=S,S.channel_data!=null){var T=JSON.parse(S.channel_data);this.members.setMyID(T.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let I=w.buildLogSuffix("authorizationEndpoint");re.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${I}, or the user should be signed in.`),u("Invalid auth response");return}u(C,S)}))}handleEvent(r){var u=r.event;if(u.indexOf("pusher_internal:")===0)this.handleInternalEvent(r);else{var C=r.data,S={};r.user_id&&(S.user_id=r.user_id),this.emit(u,C,S)}}handleInternalEvent(r){var u=r.event,C=r.data;switch(u){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(r);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(r);break;case"pusher_internal:member_added":var S=this.members.addMember(C);this.emit("pusher:member_added",S);break;case"pusher_internal:member_removed":var T=this.members.removeMember(C);T&&this.emit("pusher:member_removed",T);break}}handleSubscriptionSucceededEvent(r){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(r.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var Cd=s(1),fs=s(0);class wd extends bs{constructor(r,u,C){super(r,u),this.key=null,this.nacl=C}authorize(r,u){super.authorize(r,(C,S)=>{if(C){u(C,S);return}let T=S.shared_secret;if(!T){u(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(fs.decode)(T),delete S.shared_secret,u(null,S)})}trigger(r,u){throw new D("Client events are not currently supported for encrypted channels")}handleEvent(r){var u=r.event,C=r.data;if(u.indexOf("pusher_internal:")===0||u.indexOf("pusher:")===0){super.handleEvent(r);return}this.handleEncryptedEvent(u,C)}handleEncryptedEvent(r,u){if(!this.key){re.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!u.ciphertext||!u.nonce){re.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+u);return}let C=Object(fs.decode)(u.ciphertext);if(C.length<this.nacl.secretbox.overheadLength){re.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${C.length}`);return}let S=Object(fs.decode)(u.nonce);if(S.length<this.nacl.secretbox.nonceLength){re.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${S.length}`);return}let T=this.nacl.secretbox.open(C,S,this.key);if(T===null){re.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(I,B)=>{if(I){re.error(`Failed to make a request to the authEndpoint: ${B}. Unable to fetch new key, so dropping encrypted event`);return}if(T=this.nacl.secretbox.open(C,S,this.key),T===null){re.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(r,this.getDataToEmit(T))});return}this.emit(r,this.getDataToEmit(T))}getDataToEmit(r){let u=Object(Cd.decode)(r);try{return JSON.parse(u)}catch{return u}}}class kd extends Je{constructor(r,u){super(),this.state="initialized",this.connection=null,this.key=r,this.options=u,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var C=K.getNetwork();C.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),C.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(r){return this.connection?this.connection.send(r):!1}send_event(r,u,C){return this.connection?this.connection.send_event(r,u,C):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var r=(u,C)=>{u?this.runner=this.strategy.connect(0,r):C.action==="error"?(this.emit("error",{type:"HandshakeError",error:C.error}),this.timeline.error({handshakeError:C.error})):(this.abortConnecting(),this.handshakeCallbacks[C.action](C))};this.runner=this.strategy.connect(0,r)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var r=this.abandonConnection();r.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(r){this.timeline.info({action:"retry",delay:r}),r>0&&this.emit("connecting_in",Math.round(r/1e3)),this.retryTimer=new je(r||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new je(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new je(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new je(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(r){return xe({},r,{message:u=>{this.resetActivityCheck(),this.emit("message",u)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:u=>{this.emit("error",u)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(r){return xe({},r,{connected:u=>{this.activityTimeout=Math.min(this.options.activityTimeout,u.activityTimeout,u.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(u.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let r=u=>C=>{C.error&&this.emit("error",{type:"WebSocketError",error:C.error}),u(C)};return{tls_only:r(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:r(()=>{this.disconnect()}),backoff:r(()=>{this.retryIn(1e3)}),retry:r(()=>{this.retryIn(0)})}}setConnection(r){this.connection=r;for(var u in this.connectionCallbacks)this.connection.bind(u,this.connectionCallbacks[u]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var r in this.connectionCallbacks)this.connection.unbind(r,this.connectionCallbacks[r]);var u=this.connection;return this.connection=null,u}}updateState(r,u){var C=this.state;if(this.state=r,C!==r){var S=r;S==="connected"&&(S+=" with new socket ID "+u.socket_id),re.debug("State changed",C+" -> "+S),this.timeline.info({state:r,params:u}),this.emit("state_change",{previous:C,current:r}),this.emit(r,u)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Sd{constructor(){this.channels={}}add(r,u){return this.channels[r]||(this.channels[r]=xd(r,u)),this.channels[r]}all(){return R(this.channels)}find(r){return this.channels[r]}remove(r){var u=this.channels[r];return delete this.channels[r],u}disconnect(){De(this.channels,function(r){r.disconnect()})}}function xd(h,r){if(h.indexOf("private-encrypted-")===0){if(r.config.nacl)return xt.createEncryptedChannel(h,r,r.config.nacl);let u="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",C=w.buildLogSuffix("encryptedChannelSupport");throw new D(`${u}. ${C}`)}else{if(h.indexOf("private-")===0)return xt.createPrivateChannel(h,r);if(h.indexOf("presence-")===0)return xt.createPresenceChannel(h,r);if(h.indexOf("#")===0)throw new x('Cannot create a channel with name "'+h+'".');return xt.createChannel(h,r)}}var Ad={createChannels(){return new Sd},createConnectionManager(h,r){return new kd(h,r)},createChannel(h,r){return new vs(h,r)},createPrivateChannel(h,r){return new bs(h,r)},createPresenceChannel(h,r){return new yd(h,r)},createEncryptedChannel(h,r,u){return new wd(h,r,u)},createTimelineSender(h,r){return new bd(h,r)},createHandshake(h,r){return new vd(h,r)},createAssistantToTheTransportManager(h,r,u){return new md(h,r,u)}},xt=Ad;class wa{constructor(r){this.options=r||{},this.livesLeft=this.options.lives||1/0}getAssistant(r){return xt.createAssistantToTheTransportManager(this,r,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Jt{constructor(r,u){this.strategies=r,this.loop=!!u.loop,this.failFast=!!u.failFast,this.timeout=u.timeout,this.timeoutLimit=u.timeoutLimit}isSupported(){return Bn(this.strategies,me.method("isSupported"))}connect(r,u){var C=this.strategies,S=0,T=this.timeout,I=null,B=(V,$)=>{$?u(null,$):(S=S+1,this.loop&&(S=S%C.length),S<C.length?(T&&(T=T*2,this.timeoutLimit&&(T=Math.min(T,this.timeoutLimit))),I=this.tryStrategy(C[S],r,{timeout:T,failFast:this.failFast},B)):u(!0))};return I=this.tryStrategy(C[S],r,{timeout:T,failFast:this.failFast},B),{abort:function(){I.abort()},forceMinPriority:function(V){r=V,I&&I.forceMinPriority(V)}}}tryStrategy(r,u,C,S){var T=null,I=null;return C.timeout>0&&(T=new je(C.timeout,function(){I.abort(),S(!0)})),I=r.connect(u,function(B,V){B&&T&&T.isRunning()&&!C.failFast||(T&&T.ensureAborted(),S(B,V))}),{abort:function(){T&&T.ensureAborted(),I.abort()},forceMinPriority:function(B){I.forceMinPriority(B)}}}}class gs{constructor(r){this.strategies=r}isSupported(){return Bn(this.strategies,me.method("isSupported"))}connect(r,u){return Md(this.strategies,r,function(C,S){return function(T,I){if(S[C].error=T,T){Ld(S)&&u(!0);return}ye(S,function(B){B.forceMinPriority(I.transport.priority)}),u(null,I)}})}}function Md(h,r,u){var C=ie(h,function(S,T,I,B){return S.connect(r,u(T,B))});return{abort:function(){ye(C,Td)},forceMinPriority:function(S){ye(C,function(T){T.forceMinPriority(S)})}}}function Ld(h){return hi(h,function(r){return!!r.error})}function Td(h){!h.error&&!h.aborted&&(h.abort(),h.aborted=!0)}class _d{constructor(r,u,C){this.strategy=r,this.transports=u,this.ttl=C.ttl||1800*1e3,this.usingTLS=C.useTLS,this.timeline=C.timeline}isSupported(){return this.strategy.isSupported()}connect(r,u){var C=this.usingTLS,S=Ed(C),T=S&&S.cacheSkipCount?S.cacheSkipCount:0,I=[this.strategy];if(S&&S.timestamp+this.ttl>=me.now()){var B=this.transports[S.transport];B&&(["ws","wss"].includes(S.transport)||T>3?(this.timeline.info({cached:!0,transport:S.transport,latency:S.latency}),I.push(new Jt([B],{timeout:S.latency*2+1e3,failFast:!0}))):T++)}var V=me.now(),$=I.pop().connect(r,function se(we,Bi){we?(ka(C),I.length>0?(V=me.now(),$=I.pop().connect(r,se)):u(we)):(Pd(C,Bi.transport.name,me.now()-V,T),u(null,Bi))});return{abort:function(){$.abort()},forceMinPriority:function(se){r=se,$&&$.forceMinPriority(se)}}}}function ys(h){return"pusherTransport"+(h?"TLS":"NonTLS")}function Ed(h){var r=K.getLocalStorage();if(r)try{var u=r[ys(h)];if(u)return JSON.parse(u)}catch{ka(h)}return null}function Pd(h,r,u,C){var S=K.getLocalStorage();if(S)try{S[ys(h)]=Wt({timestamp:me.now(),transport:r,latency:u,cacheSkipCount:C})}catch{}}function ka(h){var r=K.getLocalStorage();if(r)try{delete r[ys(h)]}catch{}}class Ii{constructor(r,{delay:u}){this.strategy=r,this.options={delay:u}}isSupported(){return this.strategy.isSupported()}connect(r,u){var C=this.strategy,S,T=new je(this.options.delay,function(){S=C.connect(r,u)});return{abort:function(){T.ensureAborted(),S&&S.abort()},forceMinPriority:function(I){r=I,S&&S.forceMinPriority(I)}}}}class Rn{constructor(r,u,C){this.test=r,this.trueBranch=u,this.falseBranch=C}isSupported(){var r=this.test()?this.trueBranch:this.falseBranch;return r.isSupported()}connect(r,u){var C=this.test()?this.trueBranch:this.falseBranch;return C.connect(r,u)}}class Id{constructor(r){this.strategy=r}isSupported(){return this.strategy.isSupported()}connect(r,u){var C=this.strategy.connect(r,function(S,T){T&&C.abort(),u(S,T)});return C}}function Nn(h){return function(){return h.isSupported()}}var Dd=function(h,r,u){var C={};function S(Da,Iu,Du,Bu,Hu){var Ba=u(h,Da,Iu,Du,Bu,Hu);return C[Da]=Ba,Ba}var T=Object.assign({},r,{hostNonTLS:h.wsHost+":"+h.wsPort,hostTLS:h.wsHost+":"+h.wssPort,httpPath:h.wsPath}),I=Object.assign({},T,{useTLS:!0}),B=Object.assign({},r,{hostNonTLS:h.httpHost+":"+h.httpPort,hostTLS:h.httpHost+":"+h.httpsPort,httpPath:h.httpPath}),V={loop:!0,timeout:15e3,timeoutLimit:6e4},$=new wa({minPingDelay:1e4,maxPingDelay:h.activityTimeout}),se=new wa({lives:2,minPingDelay:1e4,maxPingDelay:h.activityTimeout}),we=S("ws","ws",3,T,$),Bi=S("wss","ws",3,I,$),Lu=S("sockjs","sockjs",1,B),La=S("xhr_streaming","xhr_streaming",1,B,se),Tu=S("xdr_streaming","xdr_streaming",1,B,se),Ta=S("xhr_polling","xhr_polling",1,B),_u=S("xdr_polling","xdr_polling",1,B),_a=new Jt([we],V),Eu=new Jt([Bi],V),Pu=new Jt([Lu],V),Ea=new Jt([new Rn(Nn(La),La,Tu)],V),Pa=new Jt([new Rn(Nn(Ta),Ta,_u)],V),Ia=new Jt([new Rn(Nn(Ea),new gs([Ea,new Ii(Pa,{delay:4e3})]),Pa)],V),Ss=new Rn(Nn(Ia),Ia,Pu),xs;return r.useTLS?xs=new gs([_a,new Ii(Ss,{delay:2e3})]):xs=new gs([_a,new Ii(Eu,{delay:2e3}),new Ii(Ss,{delay:5e3})]),new _d(new Id(new Rn(Nn(we),xs,Ss)),C,{ttl:18e5,timeline:r.timeline,useTLS:r.useTLS})},Bd=Dd,Hd=function(){var h=this;h.timeline.info(h.buildTimelineMessage({transport:h.name+(h.options.useTLS?"s":"")})),h.hooks.isInitialized()?h.changeState("initialized"):h.hooks.file?(h.changeState("initializing"),y.load(h.hooks.file,{useTLS:h.options.useTLS},function(r,u){h.hooks.isInitialized()?(h.changeState("initialized"),u(!0)):(r&&h.onError(r),h.onClose(),u(!1))})):h.onClose()},Rd={getRequest:function(h){var r=new window.XDomainRequest;return r.ontimeout=function(){h.emit("error",new A),h.close()},r.onerror=function(u){h.emit("error",u),h.close()},r.onprogress=function(){r.responseText&&r.responseText.length>0&&h.onChunk(200,r.responseText)},r.onload=function(){r.responseText&&r.responseText.length>0&&h.onChunk(200,r.responseText),h.emit("finished",200),h.close()},r},abortRequest:function(h){h.ontimeout=h.onerror=h.onprogress=h.onload=null,h.abort()}},Nd=Rd;const Od=256*1024;class Ud extends Je{constructor(r,u,C){super(),this.hooks=r,this.method=u,this.url=C}start(r){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},K.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(r)}close(){this.unloader&&(K.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(r,u){for(;;){var C=this.advanceBuffer(u);if(C)this.emit("chunk",{status:r,data:C});else break}this.isBufferTooLong(u)&&this.emit("buffer_too_long")}advanceBuffer(r){var u=r.slice(this.position),C=u.indexOf(`
1776
- `);return C!==-1?(this.position+=C+1,u.slice(0,C)):null}isBufferTooLong(r){return this.position===r.length&&r.length>Od}}var Cs;(function(h){h[h.CONNECTING=0]="CONNECTING",h[h.OPEN=1]="OPEN",h[h.CLOSED=3]="CLOSED"})(Cs||(Cs={}));var Yt=Cs,Vd=1;class Fd{constructor(r,u){this.hooks=r,this.session=xa(1e3)+"/"+zd(8),this.location=Kd(u),this.readyState=Yt.CONNECTING,this.openStream()}send(r){return this.sendRaw(JSON.stringify([r]))}ping(){this.hooks.sendHeartbeat(this)}close(r,u){this.onClose(r,u,!0)}sendRaw(r){if(this.readyState===Yt.OPEN)try{return K.createSocketRequest("POST",Sa(Gd(this.location,this.session))).start(r),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(r,u,C){this.closeStream(),this.readyState=Yt.CLOSED,this.onclose&&this.onclose({code:r,reason:u,wasClean:C})}onChunk(r){if(r.status===200){this.readyState===Yt.OPEN&&this.onActivity();var u,C=r.data.slice(0,1);switch(C){case"o":u=JSON.parse(r.data.slice(1)||"{}"),this.onOpen(u);break;case"a":u=JSON.parse(r.data.slice(1)||"[]");for(var S=0;S<u.length;S++)this.onEvent(u[S]);break;case"m":u=JSON.parse(r.data.slice(1)||"null"),this.onEvent(u);break;case"h":this.hooks.onHeartbeat(this);break;case"c":u=JSON.parse(r.data.slice(1)||"[]"),this.onClose(u[0],u[1],!0);break}}}onOpen(r){this.readyState===Yt.CONNECTING?(r&&r.hostname&&(this.location.base=jd(this.location.base,r.hostname)),this.readyState=Yt.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(r){this.readyState===Yt.OPEN&&this.onmessage&&this.onmessage({data:r})}onActivity(){this.onactivity&&this.onactivity()}onError(r){this.onerror&&this.onerror(r)}openStream(){this.stream=K.createSocketRequest("POST",Sa(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",r=>{this.onChunk(r)}),this.stream.bind("finished",r=>{this.hooks.onFinished(this,r)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(r){me.defer(()=>{this.onError(r),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function Kd(h){var r=/([^\?]*)\/*(\??.*)/.exec(h);return{base:r[1],queryString:r[2]}}function Gd(h,r){return h.base+"/"+r+"/xhr_send"}function Sa(h){var r=h.indexOf("?")===-1?"?":"&";return h+r+"t="+ +new Date+"&n="+Vd++}function jd(h,r){var u=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(h);return u[1]+r+u[3]}function xa(h){return K.randomInt(h)}function zd(h){for(var r=[],u=0;u<h;u++)r.push(xa(32).toString(32));return r.join("")}var qd=Fd,Zd={getReceiveURL:function(h,r){return h.base+"/"+r+"/xhr_streaming"+h.queryString},onHeartbeat:function(h){h.sendRaw("[]")},sendHeartbeat:function(h){h.sendRaw("[]")},onFinished:function(h,r){h.onClose(1006,"Connection interrupted ("+r+")",!1)}},Wd=Zd,Qd={getReceiveURL:function(h,r){return h.base+"/"+r+"/xhr"+h.queryString},onHeartbeat:function(){},sendHeartbeat:function(h){h.sendRaw("[]")},onFinished:function(h,r){r===200?h.reconnect():h.onClose(1006,"Connection interrupted ("+r+")",!1)}},Jd=Qd,Yd={getRequest:function(h){var r=K.getXHRAPI(),u=new r;return u.onreadystatechange=u.onprogress=function(){switch(u.readyState){case 3:u.responseText&&u.responseText.length>0&&h.onChunk(u.status,u.responseText);break;case 4:u.responseText&&u.responseText.length>0&&h.onChunk(u.status,u.responseText),h.emit("finished",u.status),h.close();break}},u},abortRequest:function(h){h.onreadystatechange=null,h.abort()}},Xd=Yd,$d={createStreamingSocket(h){return this.createSocket(Wd,h)},createPollingSocket(h){return this.createSocket(Jd,h)},createSocket(h,r){return new qd(h,r)},createXHR(h,r){return this.createRequest(Xd,h,r)},createRequest(h,r,u){return new Ud(h,r,u)}},Aa=$d;Aa.createXDR=function(h,r){return this.createRequest(Nd,h,r)};var eu=Aa,tu={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:a,DependenciesReceivers:p,getDefaultStrategy:Bd,Transports:dd,transportConnectionInitializer:Hd,HTTPFactory:eu,TimelineTransport:Si,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(h){window.Pusher=h;var r=()=>{this.onDocumentBody(h.ready)};window.JSON?r():y.load("json2",{},r)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:de,jsonp:gi}},onDocumentBody(h){document.body?h():setTimeout(()=>{this.onDocumentBody(h)},0)},createJSONPRequest(h,r){return new Ci(h,r)},createScriptRequest(h){return new yi(h)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var h=this.getXHRAPI();return new h},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return hd},createWebSocket(h){var r=this.getWebSocketAPI();return new r(h)},createSocketRequest(h,r){if(this.isXHRSupported())return this.HTTPFactory.createXHR(h,r);if(this.isXDRSupported(r.indexOf("https:")===0))return this.HTTPFactory.createXDR(h,r);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var h=this.getXHRAPI();return!!h&&new h().withCredentials!==void 0},isXDRSupported(h){var r=h?"https:":"http:",u=this.getProtocol();return!!window.XDomainRequest&&u===r},addUnloadListener(h){window.addEventListener!==void 0?window.addEventListener("unload",h,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",h)},removeUnloadListener(h){window.addEventListener!==void 0?window.removeEventListener("unload",h,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",h)},randomInt(h){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*h)}},K=tu,ws;(function(h){h[h.ERROR=3]="ERROR",h[h.INFO=6]="INFO",h[h.DEBUG=7]="DEBUG"})(ws||(ws={}));var Di=ws;class nu{constructor(r,u,C){this.key=r,this.session=u,this.events=[],this.options=C||{},this.sent=0,this.uniqueID=0}log(r,u){r<=this.options.level&&(this.events.push(xe({},u,{timestamp:me.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(r){this.log(Di.ERROR,r)}info(r){this.log(Di.INFO,r)}debug(r){this.log(Di.DEBUG,r)}isEmpty(){return this.events.length===0}send(r,u){var C=xe({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],r(C,(S,T)=>{S||this.sent++,u&&u(S,T)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class iu{constructor(r,u,C,S){this.name=r,this.priority=u,this.transport=C,this.options=S||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(r,u){if(this.isSupported()){if(this.priority<r)return Ma(new M,u)}else return Ma(new W,u);var C=!1,S=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),T=null,I=function(){S.unbind("initialized",I),S.connect()},B=function(){T=xt.createHandshake(S,function(we){C=!0,se(),u(null,we)})},V=function(we){se(),u(we)},$=function(){se();var we;we=Wt(S),u(new E(we))},se=function(){S.unbind("initialized",I),S.unbind("open",B),S.unbind("error",V),S.unbind("closed",$)};return S.bind("initialized",I),S.bind("open",B),S.bind("error",V),S.bind("closed",$),S.initialize(),{abort:()=>{C||(se(),T?T.close():S.close())},forceMinPriority:we=>{C||this.priority<we&&(T?T.close():S.close())}}}}function Ma(h,r){return me.defer(function(){r(h)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:su}=K;var ou=function(h,r,u,C,S,T){var I=su[u];if(!I)throw new F(u);var B=(!h.enabledTransports||ze(h.enabledTransports,r)!==-1)&&(!h.disabledTransports||ze(h.disabledTransports,r)===-1),V;return B?(S=Object.assign({ignoreNullOrigin:h.ignoreNullOrigin},S),V=new iu(r,C,T?T.getAssistant(I):I,S)):V=au,V},au={isSupported:function(){return!1},connect:function(h,r){var u=me.defer(function(){r(new W)});return{abort:function(){u.ensureAborted()},forceMinPriority:function(){}}}};function ru(h){if(h==null)throw"You must pass an options object";if(h.cluster==null)throw"Options object must provide a cluster";"disableStats"in h&&re.warn("The disableStats option is deprecated in favor of enableStats")}const lu=(h,r)=>{var u="socket_id="+encodeURIComponent(h.socketId);for(var C in r.params)u+="&"+encodeURIComponent(C)+"="+encodeURIComponent(r.params[C]);if(r.paramsProvider!=null){let S=r.paramsProvider();for(var C in S)u+="&"+encodeURIComponent(C)+"="+encodeURIComponent(S[C])}return u};var cu=h=>{if(typeof K.getAuthorizers()[h.transport]>"u")throw`'${h.transport}' is not a recognized auth transport`;return(r,u)=>{const C=lu(r,h);K.getAuthorizers()[h.transport](K,C,h,f.UserAuthentication,u)}};const du=(h,r)=>{var u="socket_id="+encodeURIComponent(h.socketId);u+="&channel_name="+encodeURIComponent(h.channelName);for(var C in r.params)u+="&"+encodeURIComponent(C)+"="+encodeURIComponent(r.params[C]);if(r.paramsProvider!=null){let S=r.paramsProvider();for(var C in S)u+="&"+encodeURIComponent(C)+"="+encodeURIComponent(S[C])}return u};var uu=h=>{if(typeof K.getAuthorizers()[h.transport]>"u")throw`'${h.transport}' is not a recognized auth transport`;return(r,u)=>{const C=du(r,h);K.getAuthorizers()[h.transport](K,C,h,f.ChannelAuthorization,u)}};const hu=(h,r,u)=>{const C={authTransport:r.transport,authEndpoint:r.endpoint,auth:{params:r.params,headers:r.headers}};return(S,T)=>{const I=h.channel(S.channelName);u(I,C).authorize(S.socketId,T)}};function mu(h,r){let u={activityTimeout:h.activityTimeout||l.activityTimeout,cluster:h.cluster,httpPath:h.httpPath||l.httpPath,httpPort:h.httpPort||l.httpPort,httpsPort:h.httpsPort||l.httpsPort,pongTimeout:h.pongTimeout||l.pongTimeout,statsHost:h.statsHost||l.stats_host,unavailableTimeout:h.unavailableTimeout||l.unavailableTimeout,wsPath:h.wsPath||l.wsPath,wsPort:h.wsPort||l.wsPort,wssPort:h.wssPort||l.wssPort,enableStats:gu(h),httpHost:pu(h),useTLS:fu(h),wsHost:vu(h),userAuthenticator:yu(h),channelAuthorizer:wu(h,r)};return"disabledTransports"in h&&(u.disabledTransports=h.disabledTransports),"enabledTransports"in h&&(u.enabledTransports=h.enabledTransports),"ignoreNullOrigin"in h&&(u.ignoreNullOrigin=h.ignoreNullOrigin),"timelineParams"in h&&(u.timelineParams=h.timelineParams),"nacl"in h&&(u.nacl=h.nacl),u}function pu(h){return h.httpHost?h.httpHost:h.cluster?`sockjs-${h.cluster}.pusher.com`:l.httpHost}function vu(h){return h.wsHost?h.wsHost:bu(h.cluster)}function bu(h){return`ws-${h}.pusher.com`}function fu(h){return K.getProtocol()==="https:"?!0:h.forceTLS!==!1}function gu(h){return"enableStats"in h?h.enableStats:"disableStats"in h?!h.disableStats:!1}function yu(h){const r=Object.assign(Object.assign({},l.userAuthentication),h.userAuthentication);return"customHandler"in r&&r.customHandler!=null?r.customHandler:cu(r)}function Cu(h,r){let u;return"channelAuthorization"in h?u=Object.assign(Object.assign({},l.channelAuthorization),h.channelAuthorization):(u={transport:h.authTransport||l.authTransport,endpoint:h.authEndpoint||l.authEndpoint},"auth"in h&&("params"in h.auth&&(u.params=h.auth.params),"headers"in h.auth&&(u.headers=h.auth.headers)),"authorizer"in h&&(u.customHandler=hu(r,u,h.authorizer))),u}function wu(h,r){const u=Cu(h,r);return"customHandler"in u&&u.customHandler!=null?u.customHandler:uu(u)}class ku extends Je{constructor(r){super(function(u,C){re.debug(`No callbacks on watchlist events for ${u}`)}),this.pusher=r,this.bindWatchlistInternalEvent()}handleEvent(r){r.data.events.forEach(u=>{this.emit(u.name,u)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",r=>{var u=r.event;u==="pusher_internal:watchlist_events"&&this.handleEvent(r)})}}function Su(){let h,r;return{promise:new Promise((C,S)=>{h=C,r=S}),resolve:h,reject:r}}var xu=Su;class Au extends Je{constructor(r){super(function(u,C){re.debug("No callbacks on user for "+u)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(u,C)=>{if(u){re.warn(`Error during signin: ${u}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:C.auth,user_data:C.user_data})},this.pusher=r,this.pusher.connection.bind("state_change",({previous:u,current:C})=>{u!=="connected"&&C==="connected"&&this._signin(),u==="connected"&&C!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new ku(r),this.pusher.connection.bind("message",u=>{var C=u.event;C==="pusher:signin_success"&&this._onSigninSuccess(u.data),this.serverToUserChannel&&this.serverToUserChannel.name===u.channel&&this.serverToUserChannel.handleEvent(u)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(r){try{this.user_data=JSON.parse(r.user_data)}catch{re.error(`Failed parsing user data after signin: ${r.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){re.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const r=u=>{u.subscriptionPending&&u.subscriptionCancelled?u.reinstateSubscription():!u.subscriptionPending&&this.pusher.connection.state==="connected"&&u.subscribe()};this.serverToUserChannel=new vs(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((u,C)=>{u.indexOf("pusher_internal:")===0||u.indexOf("pusher:")===0||this.emit(u,C)}),r(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:r,resolve:u,reject:C}=xu();r.done=!1;const S=()=>{r.done=!0};r.then(S).catch(S),this.signinDonePromise=r,this._signinDoneResolve=u}}class Ee{static ready(){Ee.isReady=!0;for(var r=0,u=Ee.instances.length;r<u;r++)Ee.instances[r].connect()}static getClientFeatures(){return ut(te({ws:K.Transports.ws},function(r){return r.isSupported({})}))}constructor(r,u){Mu(r),ru(u),this.key=r,this.config=mu(u,this),this.channels=xt.createChannels(),this.global_emitter=new Je,this.sessionID=K.randomInt(1e9),this.timeline=new nu(this.key,this.sessionID,{cluster:this.config.cluster,features:Ee.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Di.INFO,version:l.VERSION}),this.config.enableStats&&(this.timelineSender=xt.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+K.TimelineTransport.name}));var C=S=>K.getDefaultStrategy(this.config,S,ou);this.connection=xt.createConnectionManager(this.key,{getStrategy:C,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",S=>{var T=S.event,I=T.indexOf("pusher_internal:")===0;if(S.channel){var B=this.channel(S.channel);B&&B.handleEvent(S)}I||this.global_emitter.emit(S.event,S.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",S=>{re.warn(S)}),Ee.instances.push(this),this.timeline.info({instances:Ee.instances.length}),this.user=new Au(this),Ee.isReady&&this.connect()}channel(r){return this.channels.find(r)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var r=this.connection.isUsingTLS(),u=this.timelineSender;this.timelineSenderTimer=new wt(6e4,function(){u.send(r)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(r,u,C){return this.global_emitter.bind(r,u,C),this}unbind(r,u,C){return this.global_emitter.unbind(r,u,C),this}bind_global(r){return this.global_emitter.bind_global(r),this}unbind_global(r){return this.global_emitter.unbind_global(r),this}unbind_all(r){return this.global_emitter.unbind_all(),this}subscribeAll(){var r;for(r in this.channels.channels)this.channels.channels.hasOwnProperty(r)&&this.subscribe(r)}subscribe(r){var u=this.channels.add(r,this);return u.subscriptionPending&&u.subscriptionCancelled?u.reinstateSubscription():!u.subscriptionPending&&this.connection.state==="connected"&&u.subscribe(),u}unsubscribe(r){var u=this.channels.find(r);u&&u.subscriptionPending?u.cancelSubscription():(u=this.channels.remove(r),u&&u.subscribed&&u.unsubscribe())}send_event(r,u,C){return this.connection.send_event(r,u,C)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}Ee.instances=[],Ee.isReady=!1,Ee.logToConsole=!1,Ee.Runtime=K,Ee.ScriptReceivers=K.ScriptReceivers,Ee.DependenciesReceivers=K.DependenciesReceivers,Ee.auth_callbacks=K.auth_callbacks;var ks=i.default=Ee;function Mu(h){if(h==null)throw"You must pass your app key when you instantiate Pusher."}K.setup(Ee)}])})})(la);var gc=la.exports;const yc=fc(gc);class ca{constructor(e){d(this,"container");d(this,"onAction");d(this,"onFail");d(this,"initialTime");d(this,"timeLeft");d(this,"timerId");d(this,"payment");this.container=e.container,this.onAction=e.onAction,this.onFail=e.onFail,this.initialTime=1800,this.timeLeft=this.initialTime,this.timerId=null}attachListener(){const e=this.container.querySelector("#transfer-acn"),n=this.container.querySelector("#transfer-bank"),i=this.container.querySelector("#copy-acn"),s=this.container.querySelector("#acn-tooltip"),o=this.container.querySelector("#transfer-amount"),a=this.container.querySelector("#copy-amount"),c=this.container.querySelector("#amount-tooltip"),l=this.container.querySelector("#transfer-button"),m=this.container.querySelector("#transfer-header-text"),p=this.container.querySelector("#bank-name-text"),y=this.container.querySelector("#beneficiary-text"),b=this.container.querySelector("#amount-text"),g=this.container.querySelectorAll(".copy-text"),w=this.container.querySelector("#account-number-text"),f=this.container.querySelector("#expiration-text");m&&(m.innerHTML=Ve["transfer-header"]),b&&(b.innerHTML=q.amount),g.forEach(k=>{k.innerHTML=P.copy}),w&&(w.innerHTML=Ve["account-number"]),p&&(p.innerHTML=Ve["bank-name"]),y&&(y.innerHTML=Ve.beneficiary),f&&(f.innerHTML=Ve["expiration-text"]),i&&e&&i.addEventListener("click",()=>{s&&(n&&_.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Started",account_number:e.innerHTML,bank_name:n.innerHTML}),this.copyToClipboard(e.innerHTML,s))}),a&&o&&a.addEventListener("click",()=>{c&&(_.track("copy_transferAmount",{payment_method:"Transfer",amount:o.innerHTML.split(" ")[1].replace(/,/g,"")}),this.copyToClipboard(o.innerHTML.split(" ")[1].replace(/,/g,""),c))}),l&&(l.innerHTML=Ve["made-transfer"],l.addEventListener("click",()=>{this.onAction(5),_.track("initiate_payment_verification",{payment_method:"Transfer"})}))}startTimer(e){this.stopTimer(),this.timerId=window.setInterval(()=>{if(this.timeLeft>0){this.timeLeft-=1;const n=this.container.querySelector("#time-left");n&&(n.innerHTML=tn(this.timeLeft))}else this.stopTimer(),e==="check"&&this.onAction(2)},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}copyToClipboard(e,n){navigator.clipboard.writeText(e).then(()=>{n.innerHTML=P.copied}).catch(()=>{n.innerHTML=P["copy-fail"]})}renderComponent(e){var y,b,g,w,f,k;e&&(this.payment=e),this.container.innerHTML=this.render();const n=this.container.querySelector("#transfer-amount"),i=this.container.querySelector("#transfer-bank"),s=this.container.querySelector("#account-name"),o=this.container.querySelector("#transfer-acn"),a=this.container.querySelector("#time-left"),c=((y=this.payment)==null?void 0:y.currency)||"USD",l=c==="USD"?(b=this.payment)==null?void 0:b.localCurrency:c;if(n&&(n.innerHTML=`${l} ${Te(this.payment.totalTaxAmount?this.payment.totalLocalAmount:c==="USD"?(g=this.payment)==null?void 0:g.localAmount:(w=this.payment)==null?void 0:w.amount,2)}`),i&&this.payment.bankDetails&&(i.innerHTML=(f=this.payment.bankDetails)==null?void 0:f.bankName),s&&this.payment.bankDetails&&(s.innerHTML=(k=this.payment.bankDetails)==null?void 0:k.accountName),o&&this.payment.bankDetails&&(o.innerHTML=this.payment.bankDetails.accountNumber),a&&(a.innerHTML=tn(this.initialTime)),this.startTimer("poll"),e.status==="inProgress"){const x="45654f3ce4c9512ea9a4",A="us2";var m=new yc(x,{cluster:A}),p=m.subscribe(e.reference);p.bind("payment_status",M=>{M.status==="successful"?(clearInterval(this.timerId||void 0),this.onAction(6),_.track("verify_payment",{payment_method:"Transfer",verification_status:"Success"}),M!=null&&M.redirectUrl&&setTimeout(()=>{const E=new URL(M.redirectUrl);E.searchParams.append("status",M.status),E.searchParams.append("reference",M.reference),window.location.href=E.toString()},1800)):M.status==="failed"&&(clearInterval(this.timerId||void 0),this.onFail(7,"Transfer failed"),_.track("verify_payment",{payment_method:"Transfer",verification_status:"Failed"}))})}this.attachListener()}render(){return bc}}const Cc=`<div id="trasferConfirmationProgress" data-section="transfer">
1777
+ */(function(t,e){(function(i,s){t.exports=s()})(window,function(){return function(n){var i={};function s(o){if(i[o])return i[o].exports;var a=i[o]={i:o,l:!1,exports:{}};return n[o].call(a.exports,a,a.exports,s),a.l=!0,a.exports}return s.m=n,s.c=i,s.d=function(o,a,c){s.o(o,a)||Object.defineProperty(o,a,{enumerable:!0,get:c})},s.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},s.t=function(o,a){if(a&1&&(o=s(o)),a&8||a&4&&typeof o=="object"&&o&&o.__esModule)return o;var c=Object.create(null);if(s.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:o}),a&2&&typeof o!="string")for(var l in o)s.d(c,l,(function(m){return o[m]}).bind(null,l));return c},s.n=function(o){var a=o&&o.__esModule?function(){return o.default}:function(){return o};return s.d(a,"a",a),a},s.o=function(o,a){return Object.prototype.hasOwnProperty.call(o,a)},s.p="",s(s.s=2)}([function(n,i,s){var o=this&&this.__extends||function(){var f=function(k,x){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,M){A.__proto__=M}||function(A,M){for(var E in M)M.hasOwnProperty(E)&&(A[E]=M[E])},f(k,x)};return function(k,x){f(k,x);function A(){this.constructor=k}k.prototype=x===null?Object.create(x):(A.prototype=x.prototype,new A)}}();Object.defineProperty(i,"__esModule",{value:!0});var a=256,c=function(){function f(k){k===void 0&&(k="="),this._paddingCharacter=k}return f.prototype.encodedLength=function(k){return this._paddingCharacter?(k+2)/3*4|0:(k*8+5)/6|0},f.prototype.encode=function(k){for(var x="",A=0;A<k.length-2;A+=3){var M=k[A]<<16|k[A+1]<<8|k[A+2];x+=this._encodeByte(M>>>3*6&63),x+=this._encodeByte(M>>>2*6&63),x+=this._encodeByte(M>>>1*6&63),x+=this._encodeByte(M>>>0*6&63)}var E=k.length-A;if(E>0){var M=k[A]<<16|(E===2?k[A+1]<<8:0);x+=this._encodeByte(M>>>3*6&63),x+=this._encodeByte(M>>>2*6&63),E===2?x+=this._encodeByte(M>>>1*6&63):x+=this._paddingCharacter||"",x+=this._paddingCharacter||""}return x},f.prototype.maxDecodedLength=function(k){return this._paddingCharacter?k/4*3|0:(k*6+7)/8|0},f.prototype.decodedLength=function(k){return this.maxDecodedLength(k.length-this._getPaddingLength(k))},f.prototype.decode=function(k){if(k.length===0)return new Uint8Array(0);for(var x=this._getPaddingLength(k),A=k.length-x,M=new Uint8Array(this.maxDecodedLength(A)),E=0,D=0,F=0,W=0,G=0,Q=0,de=0;D<A-4;D+=4)W=this._decodeChar(k.charCodeAt(D+0)),G=this._decodeChar(k.charCodeAt(D+1)),Q=this._decodeChar(k.charCodeAt(D+2)),de=this._decodeChar(k.charCodeAt(D+3)),M[E++]=W<<2|G>>>4,M[E++]=G<<4|Q>>>2,M[E++]=Q<<6|de,F|=W&a,F|=G&a,F|=Q&a,F|=de&a;if(D<A-1&&(W=this._decodeChar(k.charCodeAt(D)),G=this._decodeChar(k.charCodeAt(D+1)),M[E++]=W<<2|G>>>4,F|=W&a,F|=G&a),D<A-2&&(Q=this._decodeChar(k.charCodeAt(D+2)),M[E++]=G<<4|Q>>>2,F|=Q&a),D<A-3&&(de=this._decodeChar(k.charCodeAt(D+3)),M[E++]=Q<<6|de,F|=de&a),F!==0)throw new Error("Base64Coder: incorrect characters for decoding");return M},f.prototype._encodeByte=function(k){var x=k;return x+=65,x+=25-k>>>8&6,x+=51-k>>>8&-75,x+=61-k>>>8&-15,x+=62-k>>>8&3,String.fromCharCode(x)},f.prototype._decodeChar=function(k){var x=a;return x+=(42-k&k-44)>>>8&-a+k-43+62,x+=(46-k&k-48)>>>8&-a+k-47+63,x+=(47-k&k-58)>>>8&-a+k-48+52,x+=(64-k&k-91)>>>8&-a+k-65+0,x+=(96-k&k-123)>>>8&-a+k-97+26,x},f.prototype._getPaddingLength=function(k){var x=0;if(this._paddingCharacter){for(var A=k.length-1;A>=0&&k[A]===this._paddingCharacter;A--)x++;if(k.length<4||x>2)throw new Error("Base64Coder: incorrect padding")}return x},f}();i.Coder=c;var l=new c;function m(f){return l.encode(f)}i.encode=m;function p(f){return l.decode(f)}i.decode=p;var y=function(f){o(k,f);function k(){return f!==null&&f.apply(this,arguments)||this}return k.prototype._encodeByte=function(x){var A=x;return A+=65,A+=25-x>>>8&6,A+=51-x>>>8&-75,A+=61-x>>>8&-13,A+=62-x>>>8&49,String.fromCharCode(A)},k.prototype._decodeChar=function(x){var A=a;return A+=(44-x&x-46)>>>8&-a+x-45+62,A+=(94-x&x-96)>>>8&-a+x-95+63,A+=(47-x&x-58)>>>8&-a+x-48+52,A+=(64-x&x-91)>>>8&-a+x-65+0,A+=(96-x&x-123)>>>8&-a+x-97+26,A},k}(c);i.URLSafeCoder=y;var b=new y;function g(f){return b.encode(f)}i.encodeURLSafe=g;function w(f){return b.decode(f)}i.decodeURLSafe=w,i.encodedLength=function(f){return l.encodedLength(f)},i.maxDecodedLength=function(f){return l.maxDecodedLength(f)},i.decodedLength=function(f){return l.decodedLength(f)}},function(n,i,s){Object.defineProperty(i,"__esModule",{value:!0});var o="utf8: invalid string",a="utf8: invalid source encoding";function c(p){for(var y=new Uint8Array(l(p)),b=0,g=0;g<p.length;g++){var w=p.charCodeAt(g);w<128?y[b++]=w:w<2048?(y[b++]=192|w>>6,y[b++]=128|w&63):w<55296?(y[b++]=224|w>>12,y[b++]=128|w>>6&63,y[b++]=128|w&63):(g++,w=(w&1023)<<10,w|=p.charCodeAt(g)&1023,w+=65536,y[b++]=240|w>>18,y[b++]=128|w>>12&63,y[b++]=128|w>>6&63,y[b++]=128|w&63)}return y}i.encode=c;function l(p){for(var y=0,b=0;b<p.length;b++){var g=p.charCodeAt(b);if(g<128)y+=1;else if(g<2048)y+=2;else if(g<55296)y+=3;else if(g<=57343){if(b>=p.length-1)throw new Error(o);b++,y+=4}else throw new Error(o)}return y}i.encodedLength=l;function m(p){for(var y=[],b=0;b<p.length;b++){var g=p[b];if(g&128){var w=void 0;if(g<224){if(b>=p.length)throw new Error(a);var f=p[++b];if((f&192)!==128)throw new Error(a);g=(g&31)<<6|f&63,w=128}else if(g<240){if(b>=p.length-1)throw new Error(a);var f=p[++b],k=p[++b];if((f&192)!==128||(k&192)!==128)throw new Error(a);g=(g&15)<<12|(f&63)<<6|k&63,w=2048}else if(g<248){if(b>=p.length-2)throw new Error(a);var f=p[++b],k=p[++b],x=p[++b];if((f&192)!==128||(k&192)!==128||(x&192)!==128)throw new Error(a);g=(g&15)<<18|(f&63)<<12|(k&63)<<6|x&63,w=65536}else throw new Error(a);if(g<w||g>=55296&&g<=57343)throw new Error(a);if(g>=65536){if(g>1114111)throw new Error(a);g-=65536,y.push(String.fromCharCode(55296|g>>10)),g=56320|g&1023}}y.push(String.fromCharCode(g))}return y.join("")}i.decode=m},function(n,i,s){n.exports=s(3).default},function(n,i,s){s.r(i);class o{constructor(r,u){this.lastId=0,this.prefix=r,this.name=u}create(r){this.lastId++;var u=this.lastId,C=this.prefix+u,S=this.name+"["+u+"]",T=!1,I=function(){T||(r.apply(null,arguments),T=!0)};return this[u]=I,{number:u,id:C,name:S,callback:I}}remove(r){delete this[r.number]}}var a=new o("_pusher_script_","Pusher.ScriptReceivers"),c={VERSION:"8.4.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},l=c;class m{constructor(r){this.options=r,this.receivers=r.receivers||a,this.loading={}}load(r,u,C){var S=this;if(S.loading[r]&&S.loading[r].length>0)S.loading[r].push(C);else{S.loading[r]=[C];var T=K.createScriptRequest(S.getPath(r,u)),I=S.receivers.create(function(B){if(S.receivers.remove(I),S.loading[r]){var V=S.loading[r];delete S.loading[r];for(var $=function(we){we||T.cleanup()},se=0;se<V.length;se++)V[se](B,$)}});T.send(I)}}getRoot(r){var u,C=K.getDocument().location.protocol;return r&&r.useTLS||C==="https:"?u=this.options.cdn_https:u=this.options.cdn_http,u.replace(/\/*$/,"")+"/"+this.options.version}getPath(r,u){return this.getRoot(u)+"/"+r+this.options.suffix+".js"}}var p=new o("_pusher_dependencies","Pusher.DependenciesReceivers"),y=new m({cdn_http:l.cdn_http,cdn_https:l.cdn_https,version:l.VERSION,suffix:l.dependency_suffix,receivers:p});const b={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var w={buildLogSuffix:function(h){const r="See:",u=b.urls[h];if(!u)return"";let C;return u.fullUrl?C=u.fullUrl:u.path&&(C=b.baseUrl+u.path),C?`${r} ${C}`:""}},f;(function(h){h.UserAuthentication="user-authentication",h.ChannelAuthorization="channel-authorization"})(f||(f={}));class k extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class x extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class A extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class M extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class E extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class D extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class F extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class W extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class G extends Error{constructor(r,u){super(u),this.status=r,Object.setPrototypeOf(this,new.target.prototype)}}var de=function(h,r,u,C,S){const T=K.createXHR();T.open("POST",u.endpoint,!0),T.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var I in u.headers)T.setRequestHeader(I,u.headers[I]);if(u.headersProvider!=null){let B=u.headersProvider();for(var I in B)T.setRequestHeader(I,B[I])}return T.onreadystatechange=function(){if(T.readyState===4)if(T.status===200){let B,V=!1;try{B=JSON.parse(T.responseText),V=!0}catch{S(new G(200,`JSON returned from ${C.toString()} endpoint was invalid, yet status code was 200. Data was: ${T.responseText}`),null)}V&&S(null,B)}else{let B="";switch(C){case f.UserAuthentication:B=w.buildLogSuffix("authenticationEndpoint");break;case f.ChannelAuthorization:B=`Clients must be authorized to join private or presence channels. ${w.buildLogSuffix("authorizationEndpoint")}`;break}S(new G(T.status,`Unable to retrieve auth string from ${C.toString()} endpoint - received status: ${T.status} from ${u.endpoint}. ${B}`),null)}},T.send(r),T};function _e(h){return yt(Ge(h))}var j=String.fromCharCode,Ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ge=function(h){var r=h.charCodeAt(0);return r<128?h:r<2048?j(192|r>>>6)+j(128|r&63):j(224|r>>>12&15)+j(128|r>>>6&63)+j(128|r&63)},Ge=function(h){return h.replace(/[^\x00-\x7F]/g,ge)},Se=function(h){var r=[0,2,1][h.length%3],u=h.charCodeAt(0)<<16|(h.length>1?h.charCodeAt(1):0)<<8|(h.length>2?h.charCodeAt(2):0),C=[Ue.charAt(u>>>18),Ue.charAt(u>>>12&63),r>=2?"=":Ue.charAt(u>>>6&63),r>=1?"=":Ue.charAt(u&63)];return C.join("")},yt=window.btoa||function(h){return h.replace(/[\s\S]{1,3}/g,Se)};class dt{constructor(r,u,C,S){this.clear=u,this.timer=r(()=>{this.timer&&(this.timer=S(this.timer))},C)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var Ct=dt;function qt(h){window.clearTimeout(h)}function Nt(h){window.clearInterval(h)}class je extends Ct{constructor(r,u){super(setTimeout,qt,r,function(C){return u(),null})}}class wt extends Ct{constructor(r,u){super(setInterval,Nt,r,function(C){return u(),C})}}var Zt={now(){return Date.now?Date.now():new Date().valueOf()},defer(h){return new je(0,h)},method(h,...r){var u=Array.prototype.slice.call(arguments,1);return function(C){return C[h].apply(C,u.concat(arguments))}}},me=Zt;function xe(h,...r){for(var u=0;u<r.length;u++){var C=r[u];for(var S in C)C[S]&&C[S].constructor&&C[S].constructor===Object?h[S]=xe(h[S]||{},C[S]):h[S]=C[S]}return h}function Qe(){for(var h=["Pusher"],r=0;r<arguments.length;r++)typeof arguments[r]=="string"?h.push(arguments[r]):h.push(Wt(arguments[r]));return h.join(" : ")}function ze(h,r){var u=Array.prototype.indexOf;if(h===null)return-1;if(u&&h.indexOf===u)return h.indexOf(r);for(var C=0,S=h.length;C<S;C++)if(h[C]===r)return C;return-1}function Be(h,r){for(var u in h)Object.prototype.hasOwnProperty.call(h,u)&&r(h[u],u,h)}function ut(h){var r=[];return Be(h,function(u,C){r.push(C)}),r}function R(h){var r=[];return Be(h,function(u){r.push(u)}),r}function ye(h,r,u){for(var C=0;C<h.length;C++)r.call(u||window,h[C],C,h)}function ie(h,r){for(var u=[],C=0;C<h.length;C++)u.push(r(h[C],C,h,u));return u}function Ce(h,r){var u={};return Be(h,function(C,S){u[S]=r(C)}),u}function qe(h,r){r=r||function(S){return!!S};for(var u=[],C=0;C<h.length;C++)r(h[C],C,h,u)&&u.push(h[C]);return u}function te(h,r){var u={};return Be(h,function(C,S){(r&&r(C,S,h,u)||C)&&(u[S]=C)}),u}function Ot(h){var r=[];return Be(h,function(u,C){r.push([C,u])}),r}function Bn(h,r){for(var u=0;u<h.length;u++)if(r(h[u],u,h))return!0;return!1}function hi(h,r){for(var u=0;u<h.length;u++)if(!r(h[u],u,h))return!1;return!0}function mi(h){return Ce(h,function(r){return typeof r=="object"&&(r=Wt(r)),encodeURIComponent(_e(r.toString()))})}function pi(h){var r=te(h,function(C){return C!==void 0}),u=ie(Ot(mi(r)),me.method("join","=")).join("&");return u}function vi(h){var r=[],u=[];return function C(S,T){var I,B,V;switch(typeof S){case"object":if(!S)return null;for(I=0;I<r.length;I+=1)if(r[I]===S)return{$ref:u[I]};if(r.push(S),u.push(T),Object.prototype.toString.apply(S)==="[object Array]")for(V=[],I=0;I<S.length;I+=1)V[I]=C(S[I],T+"["+I+"]");else{V={};for(B in S)Object.prototype.hasOwnProperty.call(S,B)&&(V[B]=C(S[B],T+"["+JSON.stringify(B)+"]"))}return V;case"number":case"string":case"boolean":return S}}(h,"$")}function Wt(h){try{return JSON.stringify(h)}catch{return JSON.stringify(vi(h))}}class bi{constructor(){this.globalLog=r=>{window.console&&window.console.log&&window.console.log(r)}}debug(...r){this.log(this.globalLog,r)}warn(...r){this.log(this.globalLogWarn,r)}error(...r){this.log(this.globalLogError,r)}globalLogWarn(r){window.console&&window.console.warn?window.console.warn(r):this.globalLog(r)}globalLogError(r){window.console&&window.console.error?window.console.error(r):this.globalLogWarn(r)}log(r,...u){var C=Qe.apply(this,arguments);ks.log?ks.log(C):ks.logToConsole&&r.bind(this)(C)}}var re=new bi,fi=function(h,r,u,C,S){(u.headers!==void 0||u.headersProvider!=null)&&re.warn(`To send headers with the ${C.toString()} request, you must use AJAX, rather than JSONP.`);var T=h.nextAuthCallbackID.toString();h.nextAuthCallbackID++;var I=h.getDocument(),B=I.createElement("script");h.auth_callbacks[T]=function(se){S(null,se)};var V="Pusher.auth_callbacks['"+T+"']";B.src=u.endpoint+"?callback="+encodeURIComponent(V)+"&"+r;var $=I.getElementsByTagName("head")[0]||I.documentElement;$.insertBefore(B,$.firstChild)},gi=fi;class yi{constructor(r){this.src=r}send(r){var u=this,C="Error loading "+u.src;u.script=document.createElement("script"),u.script.id=r.id,u.script.src=u.src,u.script.type="text/javascript",u.script.charset="UTF-8",u.script.addEventListener?(u.script.onerror=function(){r.callback(C)},u.script.onload=function(){r.callback(null)}):u.script.onreadystatechange=function(){(u.script.readyState==="loaded"||u.script.readyState==="complete")&&r.callback(null)},u.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(u.errorScript=document.createElement("script"),u.errorScript.id=r.id+"_error",u.errorScript.text=r.name+"('"+C+"');",u.script.async=u.errorScript.async=!1):u.script.async=!0;var S=document.getElementsByTagName("head")[0];S.insertBefore(u.script,S.firstChild),u.errorScript&&S.insertBefore(u.errorScript,u.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class Ci{constructor(r,u){this.url=r,this.data=u}send(r){if(!this.request){var u=pi(this.data),C=this.url+"/"+r.number+"?"+u;this.request=K.createScriptRequest(C),this.request.send(r)}}cleanup(){this.request&&this.request.cleanup()}}var wi=function(h,r){return function(u,C){var S="http"+(r?"s":"")+"://",T=S+(h.host||h.options.host)+h.options.path,I=K.createJSONPRequest(T,u),B=K.ScriptReceivers.create(function(V,$){a.remove(B),I.cleanup(),$&&$.host&&(h.host=$.host),C&&C(V,$)});I.send(B)}},ki={name:"jsonp",getAgent:wi},Si=ki;function gn(h,r,u){var C=h+(r.useTLS?"s":""),S=r.useTLS?r.hostTLS:r.hostNonTLS;return C+"://"+S+u}function yn(h,r){var u="/app/"+h,C="?protocol="+l.PROTOCOL+"&client=js&version="+l.VERSION+(r?"&"+r:"");return u+C}var xi={getInitial:function(h,r){var u=(r.httpPath||"")+yn(h,"flash=false");return gn("ws",r,u)}},Ai={getInitial:function(h,r){var u=(r.httpPath||"/pusher")+yn(h);return gn("http",r,u)}},Mi={getInitial:function(h,r){return gn("http",r,r.httpPath||"/pusher")},getPath:function(h,r){return yn(h)}};class Li{constructor(){this._callbacks={}}get(r){return this._callbacks[Cn(r)]}add(r,u,C){var S=Cn(r);this._callbacks[S]=this._callbacks[S]||[],this._callbacks[S].push({fn:u,context:C})}remove(r,u,C){if(!r&&!u&&!C){this._callbacks={};return}var S=r?[Cn(r)]:ut(this._callbacks);u||C?this.removeCallback(S,u,C):this.removeAllCallbacks(S)}removeCallback(r,u,C){ye(r,function(S){this._callbacks[S]=qe(this._callbacks[S]||[],function(T){return u&&u!==T.fn||C&&C!==T.context}),this._callbacks[S].length===0&&delete this._callbacks[S]},this)}removeAllCallbacks(r){ye(r,function(u){delete this._callbacks[u]},this)}}function Cn(h){return"_"+h}class Je{constructor(r){this.callbacks=new Li,this.global_callbacks=[],this.failThrough=r}bind(r,u,C){return this.callbacks.add(r,u,C),this}bind_global(r){return this.global_callbacks.push(r),this}unbind(r,u,C){return this.callbacks.remove(r,u,C),this}unbind_global(r){return r?(this.global_callbacks=qe(this.global_callbacks||[],u=>u!==r),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(r,u,C){for(var S=0;S<this.global_callbacks.length;S++)this.global_callbacks[S](r,u);var T=this.callbacks.get(r),I=[];if(C?I.push(u,C):u&&I.push(u),T&&T.length>0)for(var S=0;S<T.length;S++)T[S].fn.apply(T[S].context||window,I);else this.failThrough&&this.failThrough(r,u);return this}}class Ti extends Je{constructor(r,u,C,S,T){super(),this.initialize=K.transportConnectionInitializer,this.hooks=r,this.name=u,this.priority=C,this.key=S,this.options=T,this.state="new",this.timeline=T.timeline,this.activityTimeout=T.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var r=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(r,this.options)}catch(u){return me.defer(()=>{this.onError(u),this.changeState("closed")}),!1}return this.bindListeners(),re.debug("Connecting",{transport:this.name,url:r}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(r){return this.state==="open"?(me.defer(()=>{this.socket&&this.socket.send(r)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(r){this.emit("error",{type:"WebSocketError",error:r}),this.timeline.error(this.buildTimelineMessage({error:r.toString()}))}onClose(r){r?this.changeState("closed",{code:r.code,reason:r.reason,wasClean:r.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(r){this.emit("message",r)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=r=>{this.onError(r)},this.socket.onclose=r=>{this.onClose(r)},this.socket.onmessage=r=>{this.onMessage(r)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(r,u){this.state=r,this.timeline.info(this.buildTimelineMessage({state:r,params:u})),this.emit(r,u)}buildTimelineMessage(r){return xe({cid:this.id},r)}}class kt{constructor(r){this.hooks=r}isSupported(r){return this.hooks.isSupported(r)}createConnection(r,u,C,S){return new Ti(this.hooks,r,u,C,S)}}var _i=new kt({urls:xi,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!K.getWebSocketAPI()},isSupported:function(){return!!K.getWebSocketAPI()},getSocket:function(h){return K.createWebSocket(h)}}),Hn={urls:Ai,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},ot=xe({getSocket:function(h){return K.HTTPFactory.createStreamingSocket(h)}},Hn),Ut=xe({getSocket:function(h){return K.HTTPFactory.createPollingSocket(h)}},Hn),St={isSupported:function(){return K.isXHRSupported()}},ga=new kt(xe({},ot,St)),ya=new kt(xe({},Ut,St)),Ye={ws:_i,xhr_streaming:ga,xhr_polling:ya},ht=Ye,Ei=new kt({file:"sockjs",urls:Mi,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(h,r){return new window.SockJS(h,null,{js_path:y.getPath("sockjs",{useTLS:r.useTLS}),ignore_null_origin:r.ignoreNullOrigin})},beforeOpen:function(h,r){h.send(JSON.stringify({path:r}))}}),Pi={isSupported:function(h){var r=K.isXDRSupported(h.useTLS);return r}},ld=new kt(xe({},ot,Pi)),cd=new kt(xe({},Ut,Pi));ht.xdr_streaming=ld,ht.xdr_polling=cd,ht.sockjs=Ei;var dd=ht;class ud extends Je{constructor(){super();var r=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){r.emit("online")},!1),window.addEventListener("offline",function(){r.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var hd=new ud;class md{constructor(r,u,C){this.manager=r,this.transport=u,this.minPingDelay=C.minPingDelay,this.maxPingDelay=C.maxPingDelay,this.pingDelay=void 0}createConnection(r,u,C,S){S=xe({},S,{activityTimeout:this.pingDelay});var T=this.transport.createConnection(r,u,C,S),I=null,B=function(){T.unbind("open",B),T.bind("closed",V),I=me.now()},V=$=>{if(T.unbind("closed",V),$.code===1002||$.code===1003)this.manager.reportDeath();else if(!$.wasClean&&I){var se=me.now()-I;se<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(se/2,this.minPingDelay))}};return T.bind("open",B),T}isSupported(r){return this.manager.isAlive()&&this.transport.isSupported(r)}}const Ca={decodeMessage:function(h){try{var r=JSON.parse(h.data),u=r.data;if(typeof u=="string")try{u=JSON.parse(r.data)}catch{}var C={event:r.event,channel:r.channel,data:u};return r.user_id&&(C.user_id=r.user_id),C}catch(S){throw{type:"MessageParseError",error:S,data:h.data}}},encodeMessage:function(h){return JSON.stringify(h)},processHandshake:function(h){var r=Ca.decodeMessage(h);if(r.event==="pusher:connection_established"){if(!r.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:r.data.socket_id,activityTimeout:r.data.activity_timeout*1e3}}else{if(r.event==="pusher:error")return{action:this.getCloseAction(r.data),error:this.getCloseError(r.data)};throw"Invalid handshake"}},getCloseAction:function(h){return h.code<4e3?h.code>=1002&&h.code<=1004?"backoff":null:h.code===4e3?"tls_only":h.code<4100?"refused":h.code<4200?"backoff":h.code<4300?"retry":"refused"},getCloseError:function(h){return h.code!==1e3&&h.code!==1001?{type:"PusherError",data:{code:h.code,message:h.reason||h.message}}:null}};var Qt=Ca;class pd extends Je{constructor(r,u){super(),this.id=r,this.transport=u,this.activityTimeout=u.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(r){return this.transport.send(r)}send_event(r,u,C){var S={event:r,data:u};return C&&(S.channel=C),re.debug("Event sent",S),this.send(Qt.encodeMessage(S))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var r={message:C=>{var S;try{S=Qt.decodeMessage(C)}catch(T){this.emit("error",{type:"MessageParseError",error:T,data:C.data})}if(S!==void 0){switch(re.debug("Event recd",S),S.event){case"pusher:error":this.emit("error",{type:"PusherError",data:S.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",S)}},activity:()=>{this.emit("activity")},error:C=>{this.emit("error",C)},closed:C=>{u(),C&&C.code&&this.handleCloseEvent(C),this.transport=null,this.emit("closed")}},u=()=>{Be(r,(C,S)=>{this.transport.unbind(S,C)})};Be(r,(C,S)=>{this.transport.bind(S,C)})}handleCloseEvent(r){var u=Qt.getCloseAction(r),C=Qt.getCloseError(r);C&&this.emit("error",C),u&&this.emit(u,{action:u,error:C})}}class vd{constructor(r,u){this.transport=r,this.callback=u,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=r=>{this.unbindListeners();var u;try{u=Qt.processHandshake(r)}catch(C){this.finish("error",{error:C}),this.transport.close();return}u.action==="connected"?this.finish("connected",{connection:new pd(u.id,this.transport),activityTimeout:u.activityTimeout}):(this.finish(u.action,{error:u.error}),this.transport.close())},this.onClosed=r=>{this.unbindListeners();var u=Qt.getCloseAction(r)||"backoff",C=Qt.getCloseError(r);this.finish(u,{error:C})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(r,u){this.callback(xe({transport:this.transport,action:r},u))}}class bd{constructor(r,u){this.timeline=r,this.options=u||{}}send(r,u){this.timeline.isEmpty()||this.timeline.send(K.TimelineTransport.getAgent(this,r),u)}}class vs extends Je{constructor(r,u){super(function(C,S){re.debug("No callbacks on "+r+" for "+C)}),this.name=r,this.pusher=u,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(r,u){return u(null,{auth:""})}trigger(r,u){if(r.indexOf("client-")!==0)throw new k("Event '"+r+"' does not start with 'client-'");if(!this.subscribed){var C=w.buildLogSuffix("triggeringClientEvents");re.warn(`Client event triggered before channel 'subscription_succeeded' event . ${C}`)}return this.pusher.send_event(r,u,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(r){var u=r.event,C=r.data;if(u==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(r);else if(u==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(r);else if(u.indexOf("pusher_internal:")!==0){var S={};this.emit(u,C,S)}}handleSubscriptionSucceededEvent(r){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",r.data)}handleSubscriptionCountEvent(r){r.data.subscription_count&&(this.subscriptionCount=r.data.subscription_count),this.emit("pusher:subscription_count",r.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(r,u)=>{r?(this.subscriptionPending=!1,re.error(r.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:r.message},r instanceof G?{status:r.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:u.auth,channel_data:u.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class bs extends vs{authorize(r,u){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:r},u)}}class fd{constructor(){this.reset()}get(r){return Object.prototype.hasOwnProperty.call(this.members,r)?{id:r,info:this.members[r]}:null}each(r){Be(this.members,(u,C)=>{r(this.get(C))})}setMyID(r){this.myID=r}onSubscription(r){this.members=r.presence.hash,this.count=r.presence.count,this.me=this.get(this.myID)}addMember(r){return this.get(r.user_id)===null&&this.count++,this.members[r.user_id]=r.user_info,this.get(r.user_id)}removeMember(r){var u=this.get(r.user_id);return u&&(delete this.members[r.user_id],this.count--),u}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var gd=function(h,r,u,C){function S(T){return T instanceof u?T:new u(function(I){I(T)})}return new(u||(u=Promise))(function(T,I){function B(se){try{$(C.next(se))}catch(we){I(we)}}function V(se){try{$(C.throw(se))}catch(we){I(we)}}function $(se){se.done?T(se.value):S(se.value).then(B,V)}$((C=C.apply(h,r||[])).next())})};class yd extends bs{constructor(r,u){super(r,u),this.members=new fd}authorize(r,u){super.authorize(r,(C,S)=>gd(this,void 0,void 0,function*(){if(!C)if(S=S,S.channel_data!=null){var T=JSON.parse(S.channel_data);this.members.setMyID(T.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let I=w.buildLogSuffix("authorizationEndpoint");re.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${I}, or the user should be signed in.`),u("Invalid auth response");return}u(C,S)}))}handleEvent(r){var u=r.event;if(u.indexOf("pusher_internal:")===0)this.handleInternalEvent(r);else{var C=r.data,S={};r.user_id&&(S.user_id=r.user_id),this.emit(u,C,S)}}handleInternalEvent(r){var u=r.event,C=r.data;switch(u){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(r);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(r);break;case"pusher_internal:member_added":var S=this.members.addMember(C);this.emit("pusher:member_added",S);break;case"pusher_internal:member_removed":var T=this.members.removeMember(C);T&&this.emit("pusher:member_removed",T);break}}handleSubscriptionSucceededEvent(r){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(r.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var Cd=s(1),fs=s(0);class wd extends bs{constructor(r,u,C){super(r,u),this.key=null,this.nacl=C}authorize(r,u){super.authorize(r,(C,S)=>{if(C){u(C,S);return}let T=S.shared_secret;if(!T){u(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(fs.decode)(T),delete S.shared_secret,u(null,S)})}trigger(r,u){throw new D("Client events are not currently supported for encrypted channels")}handleEvent(r){var u=r.event,C=r.data;if(u.indexOf("pusher_internal:")===0||u.indexOf("pusher:")===0){super.handleEvent(r);return}this.handleEncryptedEvent(u,C)}handleEncryptedEvent(r,u){if(!this.key){re.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!u.ciphertext||!u.nonce){re.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+u);return}let C=Object(fs.decode)(u.ciphertext);if(C.length<this.nacl.secretbox.overheadLength){re.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${C.length}`);return}let S=Object(fs.decode)(u.nonce);if(S.length<this.nacl.secretbox.nonceLength){re.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${S.length}`);return}let T=this.nacl.secretbox.open(C,S,this.key);if(T===null){re.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(I,B)=>{if(I){re.error(`Failed to make a request to the authEndpoint: ${B}. Unable to fetch new key, so dropping encrypted event`);return}if(T=this.nacl.secretbox.open(C,S,this.key),T===null){re.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(r,this.getDataToEmit(T))});return}this.emit(r,this.getDataToEmit(T))}getDataToEmit(r){let u=Object(Cd.decode)(r);try{return JSON.parse(u)}catch{return u}}}class kd extends Je{constructor(r,u){super(),this.state="initialized",this.connection=null,this.key=r,this.options=u,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var C=K.getNetwork();C.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),C.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(r){return this.connection?this.connection.send(r):!1}send_event(r,u,C){return this.connection?this.connection.send_event(r,u,C):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var r=(u,C)=>{u?this.runner=this.strategy.connect(0,r):C.action==="error"?(this.emit("error",{type:"HandshakeError",error:C.error}),this.timeline.error({handshakeError:C.error})):(this.abortConnecting(),this.handshakeCallbacks[C.action](C))};this.runner=this.strategy.connect(0,r)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var r=this.abandonConnection();r.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(r){this.timeline.info({action:"retry",delay:r}),r>0&&this.emit("connecting_in",Math.round(r/1e3)),this.retryTimer=new je(r||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new je(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new je(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new je(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(r){return xe({},r,{message:u=>{this.resetActivityCheck(),this.emit("message",u)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:u=>{this.emit("error",u)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(r){return xe({},r,{connected:u=>{this.activityTimeout=Math.min(this.options.activityTimeout,u.activityTimeout,u.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(u.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let r=u=>C=>{C.error&&this.emit("error",{type:"WebSocketError",error:C.error}),u(C)};return{tls_only:r(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:r(()=>{this.disconnect()}),backoff:r(()=>{this.retryIn(1e3)}),retry:r(()=>{this.retryIn(0)})}}setConnection(r){this.connection=r;for(var u in this.connectionCallbacks)this.connection.bind(u,this.connectionCallbacks[u]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var r in this.connectionCallbacks)this.connection.unbind(r,this.connectionCallbacks[r]);var u=this.connection;return this.connection=null,u}}updateState(r,u){var C=this.state;if(this.state=r,C!==r){var S=r;S==="connected"&&(S+=" with new socket ID "+u.socket_id),re.debug("State changed",C+" -> "+S),this.timeline.info({state:r,params:u}),this.emit("state_change",{previous:C,current:r}),this.emit(r,u)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Sd{constructor(){this.channels={}}add(r,u){return this.channels[r]||(this.channels[r]=xd(r,u)),this.channels[r]}all(){return R(this.channels)}find(r){return this.channels[r]}remove(r){var u=this.channels[r];return delete this.channels[r],u}disconnect(){Be(this.channels,function(r){r.disconnect()})}}function xd(h,r){if(h.indexOf("private-encrypted-")===0){if(r.config.nacl)return xt.createEncryptedChannel(h,r,r.config.nacl);let u="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",C=w.buildLogSuffix("encryptedChannelSupport");throw new D(`${u}. ${C}`)}else{if(h.indexOf("private-")===0)return xt.createPrivateChannel(h,r);if(h.indexOf("presence-")===0)return xt.createPresenceChannel(h,r);if(h.indexOf("#")===0)throw new x('Cannot create a channel with name "'+h+'".');return xt.createChannel(h,r)}}var Ad={createChannels(){return new Sd},createConnectionManager(h,r){return new kd(h,r)},createChannel(h,r){return new vs(h,r)},createPrivateChannel(h,r){return new bs(h,r)},createPresenceChannel(h,r){return new yd(h,r)},createEncryptedChannel(h,r,u){return new wd(h,r,u)},createTimelineSender(h,r){return new bd(h,r)},createHandshake(h,r){return new vd(h,r)},createAssistantToTheTransportManager(h,r,u){return new md(h,r,u)}},xt=Ad;class wa{constructor(r){this.options=r||{},this.livesLeft=this.options.lives||1/0}getAssistant(r){return xt.createAssistantToTheTransportManager(this,r,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Jt{constructor(r,u){this.strategies=r,this.loop=!!u.loop,this.failFast=!!u.failFast,this.timeout=u.timeout,this.timeoutLimit=u.timeoutLimit}isSupported(){return Bn(this.strategies,me.method("isSupported"))}connect(r,u){var C=this.strategies,S=0,T=this.timeout,I=null,B=(V,$)=>{$?u(null,$):(S=S+1,this.loop&&(S=S%C.length),S<C.length?(T&&(T=T*2,this.timeoutLimit&&(T=Math.min(T,this.timeoutLimit))),I=this.tryStrategy(C[S],r,{timeout:T,failFast:this.failFast},B)):u(!0))};return I=this.tryStrategy(C[S],r,{timeout:T,failFast:this.failFast},B),{abort:function(){I.abort()},forceMinPriority:function(V){r=V,I&&I.forceMinPriority(V)}}}tryStrategy(r,u,C,S){var T=null,I=null;return C.timeout>0&&(T=new je(C.timeout,function(){I.abort(),S(!0)})),I=r.connect(u,function(B,V){B&&T&&T.isRunning()&&!C.failFast||(T&&T.ensureAborted(),S(B,V))}),{abort:function(){T&&T.ensureAborted(),I.abort()},forceMinPriority:function(B){I.forceMinPriority(B)}}}}class gs{constructor(r){this.strategies=r}isSupported(){return Bn(this.strategies,me.method("isSupported"))}connect(r,u){return Md(this.strategies,r,function(C,S){return function(T,I){if(S[C].error=T,T){Ld(S)&&u(!0);return}ye(S,function(B){B.forceMinPriority(I.transport.priority)}),u(null,I)}})}}function Md(h,r,u){var C=ie(h,function(S,T,I,B){return S.connect(r,u(T,B))});return{abort:function(){ye(C,Td)},forceMinPriority:function(S){ye(C,function(T){T.forceMinPriority(S)})}}}function Ld(h){return hi(h,function(r){return!!r.error})}function Td(h){!h.error&&!h.aborted&&(h.abort(),h.aborted=!0)}class _d{constructor(r,u,C){this.strategy=r,this.transports=u,this.ttl=C.ttl||1800*1e3,this.usingTLS=C.useTLS,this.timeline=C.timeline}isSupported(){return this.strategy.isSupported()}connect(r,u){var C=this.usingTLS,S=Ed(C),T=S&&S.cacheSkipCount?S.cacheSkipCount:0,I=[this.strategy];if(S&&S.timestamp+this.ttl>=me.now()){var B=this.transports[S.transport];B&&(["ws","wss"].includes(S.transport)||T>3?(this.timeline.info({cached:!0,transport:S.transport,latency:S.latency}),I.push(new Jt([B],{timeout:S.latency*2+1e3,failFast:!0}))):T++)}var V=me.now(),$=I.pop().connect(r,function se(we,Bi){we?(ka(C),I.length>0?(V=me.now(),$=I.pop().connect(r,se)):u(we)):(Pd(C,Bi.transport.name,me.now()-V,T),u(null,Bi))});return{abort:function(){$.abort()},forceMinPriority:function(se){r=se,$&&$.forceMinPriority(se)}}}}function ys(h){return"pusherTransport"+(h?"TLS":"NonTLS")}function Ed(h){var r=K.getLocalStorage();if(r)try{var u=r[ys(h)];if(u)return JSON.parse(u)}catch{ka(h)}return null}function Pd(h,r,u,C){var S=K.getLocalStorage();if(S)try{S[ys(h)]=Wt({timestamp:me.now(),transport:r,latency:u,cacheSkipCount:C})}catch{}}function ka(h){var r=K.getLocalStorage();if(r)try{delete r[ys(h)]}catch{}}class Ii{constructor(r,{delay:u}){this.strategy=r,this.options={delay:u}}isSupported(){return this.strategy.isSupported()}connect(r,u){var C=this.strategy,S,T=new je(this.options.delay,function(){S=C.connect(r,u)});return{abort:function(){T.ensureAborted(),S&&S.abort()},forceMinPriority:function(I){r=I,S&&S.forceMinPriority(I)}}}}class Rn{constructor(r,u,C){this.test=r,this.trueBranch=u,this.falseBranch=C}isSupported(){var r=this.test()?this.trueBranch:this.falseBranch;return r.isSupported()}connect(r,u){var C=this.test()?this.trueBranch:this.falseBranch;return C.connect(r,u)}}class Id{constructor(r){this.strategy=r}isSupported(){return this.strategy.isSupported()}connect(r,u){var C=this.strategy.connect(r,function(S,T){T&&C.abort(),u(S,T)});return C}}function Nn(h){return function(){return h.isSupported()}}var Dd=function(h,r,u){var C={};function S(Da,Iu,Du,Bu,Hu){var Ba=u(h,Da,Iu,Du,Bu,Hu);return C[Da]=Ba,Ba}var T=Object.assign({},r,{hostNonTLS:h.wsHost+":"+h.wsPort,hostTLS:h.wsHost+":"+h.wssPort,httpPath:h.wsPath}),I=Object.assign({},T,{useTLS:!0}),B=Object.assign({},r,{hostNonTLS:h.httpHost+":"+h.httpPort,hostTLS:h.httpHost+":"+h.httpsPort,httpPath:h.httpPath}),V={loop:!0,timeout:15e3,timeoutLimit:6e4},$=new wa({minPingDelay:1e4,maxPingDelay:h.activityTimeout}),se=new wa({lives:2,minPingDelay:1e4,maxPingDelay:h.activityTimeout}),we=S("ws","ws",3,T,$),Bi=S("wss","ws",3,I,$),Lu=S("sockjs","sockjs",1,B),La=S("xhr_streaming","xhr_streaming",1,B,se),Tu=S("xdr_streaming","xdr_streaming",1,B,se),Ta=S("xhr_polling","xhr_polling",1,B),_u=S("xdr_polling","xdr_polling",1,B),_a=new Jt([we],V),Eu=new Jt([Bi],V),Pu=new Jt([Lu],V),Ea=new Jt([new Rn(Nn(La),La,Tu)],V),Pa=new Jt([new Rn(Nn(Ta),Ta,_u)],V),Ia=new Jt([new Rn(Nn(Ea),new gs([Ea,new Ii(Pa,{delay:4e3})]),Pa)],V),Ss=new Rn(Nn(Ia),Ia,Pu),xs;return r.useTLS?xs=new gs([_a,new Ii(Ss,{delay:2e3})]):xs=new gs([_a,new Ii(Eu,{delay:2e3}),new Ii(Ss,{delay:5e3})]),new _d(new Id(new Rn(Nn(we),xs,Ss)),C,{ttl:18e5,timeline:r.timeline,useTLS:r.useTLS})},Bd=Dd,Hd=function(){var h=this;h.timeline.info(h.buildTimelineMessage({transport:h.name+(h.options.useTLS?"s":"")})),h.hooks.isInitialized()?h.changeState("initialized"):h.hooks.file?(h.changeState("initializing"),y.load(h.hooks.file,{useTLS:h.options.useTLS},function(r,u){h.hooks.isInitialized()?(h.changeState("initialized"),u(!0)):(r&&h.onError(r),h.onClose(),u(!1))})):h.onClose()},Rd={getRequest:function(h){var r=new window.XDomainRequest;return r.ontimeout=function(){h.emit("error",new A),h.close()},r.onerror=function(u){h.emit("error",u),h.close()},r.onprogress=function(){r.responseText&&r.responseText.length>0&&h.onChunk(200,r.responseText)},r.onload=function(){r.responseText&&r.responseText.length>0&&h.onChunk(200,r.responseText),h.emit("finished",200),h.close()},r},abortRequest:function(h){h.ontimeout=h.onerror=h.onprogress=h.onload=null,h.abort()}},Nd=Rd;const Od=256*1024;class Ud extends Je{constructor(r,u,C){super(),this.hooks=r,this.method=u,this.url=C}start(r){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},K.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(r)}close(){this.unloader&&(K.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(r,u){for(;;){var C=this.advanceBuffer(u);if(C)this.emit("chunk",{status:r,data:C});else break}this.isBufferTooLong(u)&&this.emit("buffer_too_long")}advanceBuffer(r){var u=r.slice(this.position),C=u.indexOf(`
1778
+ `);return C!==-1?(this.position+=C+1,u.slice(0,C)):null}isBufferTooLong(r){return this.position===r.length&&r.length>Od}}var Cs;(function(h){h[h.CONNECTING=0]="CONNECTING",h[h.OPEN=1]="OPEN",h[h.CLOSED=3]="CLOSED"})(Cs||(Cs={}));var Yt=Cs,Vd=1;class Fd{constructor(r,u){this.hooks=r,this.session=xa(1e3)+"/"+zd(8),this.location=Kd(u),this.readyState=Yt.CONNECTING,this.openStream()}send(r){return this.sendRaw(JSON.stringify([r]))}ping(){this.hooks.sendHeartbeat(this)}close(r,u){this.onClose(r,u,!0)}sendRaw(r){if(this.readyState===Yt.OPEN)try{return K.createSocketRequest("POST",Sa(Gd(this.location,this.session))).start(r),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(r,u,C){this.closeStream(),this.readyState=Yt.CLOSED,this.onclose&&this.onclose({code:r,reason:u,wasClean:C})}onChunk(r){if(r.status===200){this.readyState===Yt.OPEN&&this.onActivity();var u,C=r.data.slice(0,1);switch(C){case"o":u=JSON.parse(r.data.slice(1)||"{}"),this.onOpen(u);break;case"a":u=JSON.parse(r.data.slice(1)||"[]");for(var S=0;S<u.length;S++)this.onEvent(u[S]);break;case"m":u=JSON.parse(r.data.slice(1)||"null"),this.onEvent(u);break;case"h":this.hooks.onHeartbeat(this);break;case"c":u=JSON.parse(r.data.slice(1)||"[]"),this.onClose(u[0],u[1],!0);break}}}onOpen(r){this.readyState===Yt.CONNECTING?(r&&r.hostname&&(this.location.base=jd(this.location.base,r.hostname)),this.readyState=Yt.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(r){this.readyState===Yt.OPEN&&this.onmessage&&this.onmessage({data:r})}onActivity(){this.onactivity&&this.onactivity()}onError(r){this.onerror&&this.onerror(r)}openStream(){this.stream=K.createSocketRequest("POST",Sa(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",r=>{this.onChunk(r)}),this.stream.bind("finished",r=>{this.hooks.onFinished(this,r)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(r){me.defer(()=>{this.onError(r),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function Kd(h){var r=/([^\?]*)\/*(\??.*)/.exec(h);return{base:r[1],queryString:r[2]}}function Gd(h,r){return h.base+"/"+r+"/xhr_send"}function Sa(h){var r=h.indexOf("?")===-1?"?":"&";return h+r+"t="+ +new Date+"&n="+Vd++}function jd(h,r){var u=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(h);return u[1]+r+u[3]}function xa(h){return K.randomInt(h)}function zd(h){for(var r=[],u=0;u<h;u++)r.push(xa(32).toString(32));return r.join("")}var qd=Fd,Zd={getReceiveURL:function(h,r){return h.base+"/"+r+"/xhr_streaming"+h.queryString},onHeartbeat:function(h){h.sendRaw("[]")},sendHeartbeat:function(h){h.sendRaw("[]")},onFinished:function(h,r){h.onClose(1006,"Connection interrupted ("+r+")",!1)}},Wd=Zd,Qd={getReceiveURL:function(h,r){return h.base+"/"+r+"/xhr"+h.queryString},onHeartbeat:function(){},sendHeartbeat:function(h){h.sendRaw("[]")},onFinished:function(h,r){r===200?h.reconnect():h.onClose(1006,"Connection interrupted ("+r+")",!1)}},Jd=Qd,Yd={getRequest:function(h){var r=K.getXHRAPI(),u=new r;return u.onreadystatechange=u.onprogress=function(){switch(u.readyState){case 3:u.responseText&&u.responseText.length>0&&h.onChunk(u.status,u.responseText);break;case 4:u.responseText&&u.responseText.length>0&&h.onChunk(u.status,u.responseText),h.emit("finished",u.status),h.close();break}},u},abortRequest:function(h){h.onreadystatechange=null,h.abort()}},Xd=Yd,$d={createStreamingSocket(h){return this.createSocket(Wd,h)},createPollingSocket(h){return this.createSocket(Jd,h)},createSocket(h,r){return new qd(h,r)},createXHR(h,r){return this.createRequest(Xd,h,r)},createRequest(h,r,u){return new Ud(h,r,u)}},Aa=$d;Aa.createXDR=function(h,r){return this.createRequest(Nd,h,r)};var eu=Aa,tu={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:a,DependenciesReceivers:p,getDefaultStrategy:Bd,Transports:dd,transportConnectionInitializer:Hd,HTTPFactory:eu,TimelineTransport:Si,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(h){window.Pusher=h;var r=()=>{this.onDocumentBody(h.ready)};window.JSON?r():y.load("json2",{},r)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:de,jsonp:gi}},onDocumentBody(h){document.body?h():setTimeout(()=>{this.onDocumentBody(h)},0)},createJSONPRequest(h,r){return new Ci(h,r)},createScriptRequest(h){return new yi(h)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var h=this.getXHRAPI();return new h},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return hd},createWebSocket(h){var r=this.getWebSocketAPI();return new r(h)},createSocketRequest(h,r){if(this.isXHRSupported())return this.HTTPFactory.createXHR(h,r);if(this.isXDRSupported(r.indexOf("https:")===0))return this.HTTPFactory.createXDR(h,r);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var h=this.getXHRAPI();return!!h&&new h().withCredentials!==void 0},isXDRSupported(h){var r=h?"https:":"http:",u=this.getProtocol();return!!window.XDomainRequest&&u===r},addUnloadListener(h){window.addEventListener!==void 0?window.addEventListener("unload",h,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",h)},removeUnloadListener(h){window.addEventListener!==void 0?window.removeEventListener("unload",h,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",h)},randomInt(h){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*h)}},K=tu,ws;(function(h){h[h.ERROR=3]="ERROR",h[h.INFO=6]="INFO",h[h.DEBUG=7]="DEBUG"})(ws||(ws={}));var Di=ws;class nu{constructor(r,u,C){this.key=r,this.session=u,this.events=[],this.options=C||{},this.sent=0,this.uniqueID=0}log(r,u){r<=this.options.level&&(this.events.push(xe({},u,{timestamp:me.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(r){this.log(Di.ERROR,r)}info(r){this.log(Di.INFO,r)}debug(r){this.log(Di.DEBUG,r)}isEmpty(){return this.events.length===0}send(r,u){var C=xe({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],r(C,(S,T)=>{S||this.sent++,u&&u(S,T)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class iu{constructor(r,u,C,S){this.name=r,this.priority=u,this.transport=C,this.options=S||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(r,u){if(this.isSupported()){if(this.priority<r)return Ma(new M,u)}else return Ma(new W,u);var C=!1,S=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),T=null,I=function(){S.unbind("initialized",I),S.connect()},B=function(){T=xt.createHandshake(S,function(we){C=!0,se(),u(null,we)})},V=function(we){se(),u(we)},$=function(){se();var we;we=Wt(S),u(new E(we))},se=function(){S.unbind("initialized",I),S.unbind("open",B),S.unbind("error",V),S.unbind("closed",$)};return S.bind("initialized",I),S.bind("open",B),S.bind("error",V),S.bind("closed",$),S.initialize(),{abort:()=>{C||(se(),T?T.close():S.close())},forceMinPriority:we=>{C||this.priority<we&&(T?T.close():S.close())}}}}function Ma(h,r){return me.defer(function(){r(h)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:su}=K;var ou=function(h,r,u,C,S,T){var I=su[u];if(!I)throw new F(u);var B=(!h.enabledTransports||ze(h.enabledTransports,r)!==-1)&&(!h.disabledTransports||ze(h.disabledTransports,r)===-1),V;return B?(S=Object.assign({ignoreNullOrigin:h.ignoreNullOrigin},S),V=new iu(r,C,T?T.getAssistant(I):I,S)):V=au,V},au={isSupported:function(){return!1},connect:function(h,r){var u=me.defer(function(){r(new W)});return{abort:function(){u.ensureAborted()},forceMinPriority:function(){}}}};function ru(h){if(h==null)throw"You must pass an options object";if(h.cluster==null)throw"Options object must provide a cluster";"disableStats"in h&&re.warn("The disableStats option is deprecated in favor of enableStats")}const lu=(h,r)=>{var u="socket_id="+encodeURIComponent(h.socketId);for(var C in r.params)u+="&"+encodeURIComponent(C)+"="+encodeURIComponent(r.params[C]);if(r.paramsProvider!=null){let S=r.paramsProvider();for(var C in S)u+="&"+encodeURIComponent(C)+"="+encodeURIComponent(S[C])}return u};var cu=h=>{if(typeof K.getAuthorizers()[h.transport]>"u")throw`'${h.transport}' is not a recognized auth transport`;return(r,u)=>{const C=lu(r,h);K.getAuthorizers()[h.transport](K,C,h,f.UserAuthentication,u)}};const du=(h,r)=>{var u="socket_id="+encodeURIComponent(h.socketId);u+="&channel_name="+encodeURIComponent(h.channelName);for(var C in r.params)u+="&"+encodeURIComponent(C)+"="+encodeURIComponent(r.params[C]);if(r.paramsProvider!=null){let S=r.paramsProvider();for(var C in S)u+="&"+encodeURIComponent(C)+"="+encodeURIComponent(S[C])}return u};var uu=h=>{if(typeof K.getAuthorizers()[h.transport]>"u")throw`'${h.transport}' is not a recognized auth transport`;return(r,u)=>{const C=du(r,h);K.getAuthorizers()[h.transport](K,C,h,f.ChannelAuthorization,u)}};const hu=(h,r,u)=>{const C={authTransport:r.transport,authEndpoint:r.endpoint,auth:{params:r.params,headers:r.headers}};return(S,T)=>{const I=h.channel(S.channelName);u(I,C).authorize(S.socketId,T)}};function mu(h,r){let u={activityTimeout:h.activityTimeout||l.activityTimeout,cluster:h.cluster,httpPath:h.httpPath||l.httpPath,httpPort:h.httpPort||l.httpPort,httpsPort:h.httpsPort||l.httpsPort,pongTimeout:h.pongTimeout||l.pongTimeout,statsHost:h.statsHost||l.stats_host,unavailableTimeout:h.unavailableTimeout||l.unavailableTimeout,wsPath:h.wsPath||l.wsPath,wsPort:h.wsPort||l.wsPort,wssPort:h.wssPort||l.wssPort,enableStats:gu(h),httpHost:pu(h),useTLS:fu(h),wsHost:vu(h),userAuthenticator:yu(h),channelAuthorizer:wu(h,r)};return"disabledTransports"in h&&(u.disabledTransports=h.disabledTransports),"enabledTransports"in h&&(u.enabledTransports=h.enabledTransports),"ignoreNullOrigin"in h&&(u.ignoreNullOrigin=h.ignoreNullOrigin),"timelineParams"in h&&(u.timelineParams=h.timelineParams),"nacl"in h&&(u.nacl=h.nacl),u}function pu(h){return h.httpHost?h.httpHost:h.cluster?`sockjs-${h.cluster}.pusher.com`:l.httpHost}function vu(h){return h.wsHost?h.wsHost:bu(h.cluster)}function bu(h){return`ws-${h}.pusher.com`}function fu(h){return K.getProtocol()==="https:"?!0:h.forceTLS!==!1}function gu(h){return"enableStats"in h?h.enableStats:"disableStats"in h?!h.disableStats:!1}function yu(h){const r=Object.assign(Object.assign({},l.userAuthentication),h.userAuthentication);return"customHandler"in r&&r.customHandler!=null?r.customHandler:cu(r)}function Cu(h,r){let u;return"channelAuthorization"in h?u=Object.assign(Object.assign({},l.channelAuthorization),h.channelAuthorization):(u={transport:h.authTransport||l.authTransport,endpoint:h.authEndpoint||l.authEndpoint},"auth"in h&&("params"in h.auth&&(u.params=h.auth.params),"headers"in h.auth&&(u.headers=h.auth.headers)),"authorizer"in h&&(u.customHandler=hu(r,u,h.authorizer))),u}function wu(h,r){const u=Cu(h,r);return"customHandler"in u&&u.customHandler!=null?u.customHandler:uu(u)}class ku extends Je{constructor(r){super(function(u,C){re.debug(`No callbacks on watchlist events for ${u}`)}),this.pusher=r,this.bindWatchlistInternalEvent()}handleEvent(r){r.data.events.forEach(u=>{this.emit(u.name,u)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",r=>{var u=r.event;u==="pusher_internal:watchlist_events"&&this.handleEvent(r)})}}function Su(){let h,r;return{promise:new Promise((C,S)=>{h=C,r=S}),resolve:h,reject:r}}var xu=Su;class Au extends Je{constructor(r){super(function(u,C){re.debug("No callbacks on user for "+u)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(u,C)=>{if(u){re.warn(`Error during signin: ${u}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:C.auth,user_data:C.user_data})},this.pusher=r,this.pusher.connection.bind("state_change",({previous:u,current:C})=>{u!=="connected"&&C==="connected"&&this._signin(),u==="connected"&&C!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new ku(r),this.pusher.connection.bind("message",u=>{var C=u.event;C==="pusher:signin_success"&&this._onSigninSuccess(u.data),this.serverToUserChannel&&this.serverToUserChannel.name===u.channel&&this.serverToUserChannel.handleEvent(u)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(r){try{this.user_data=JSON.parse(r.user_data)}catch{re.error(`Failed parsing user data after signin: ${r.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){re.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const r=u=>{u.subscriptionPending&&u.subscriptionCancelled?u.reinstateSubscription():!u.subscriptionPending&&this.pusher.connection.state==="connected"&&u.subscribe()};this.serverToUserChannel=new vs(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((u,C)=>{u.indexOf("pusher_internal:")===0||u.indexOf("pusher:")===0||this.emit(u,C)}),r(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:r,resolve:u,reject:C}=xu();r.done=!1;const S=()=>{r.done=!0};r.then(S).catch(S),this.signinDonePromise=r,this._signinDoneResolve=u}}class Ee{static ready(){Ee.isReady=!0;for(var r=0,u=Ee.instances.length;r<u;r++)Ee.instances[r].connect()}static getClientFeatures(){return ut(te({ws:K.Transports.ws},function(r){return r.isSupported({})}))}constructor(r,u){Mu(r),ru(u),this.key=r,this.config=mu(u,this),this.channels=xt.createChannels(),this.global_emitter=new Je,this.sessionID=K.randomInt(1e9),this.timeline=new nu(this.key,this.sessionID,{cluster:this.config.cluster,features:Ee.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Di.INFO,version:l.VERSION}),this.config.enableStats&&(this.timelineSender=xt.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+K.TimelineTransport.name}));var C=S=>K.getDefaultStrategy(this.config,S,ou);this.connection=xt.createConnectionManager(this.key,{getStrategy:C,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",S=>{var T=S.event,I=T.indexOf("pusher_internal:")===0;if(S.channel){var B=this.channel(S.channel);B&&B.handleEvent(S)}I||this.global_emitter.emit(S.event,S.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",S=>{re.warn(S)}),Ee.instances.push(this),this.timeline.info({instances:Ee.instances.length}),this.user=new Au(this),Ee.isReady&&this.connect()}channel(r){return this.channels.find(r)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var r=this.connection.isUsingTLS(),u=this.timelineSender;this.timelineSenderTimer=new wt(6e4,function(){u.send(r)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(r,u,C){return this.global_emitter.bind(r,u,C),this}unbind(r,u,C){return this.global_emitter.unbind(r,u,C),this}bind_global(r){return this.global_emitter.bind_global(r),this}unbind_global(r){return this.global_emitter.unbind_global(r),this}unbind_all(r){return this.global_emitter.unbind_all(),this}subscribeAll(){var r;for(r in this.channels.channels)this.channels.channels.hasOwnProperty(r)&&this.subscribe(r)}subscribe(r){var u=this.channels.add(r,this);return u.subscriptionPending&&u.subscriptionCancelled?u.reinstateSubscription():!u.subscriptionPending&&this.connection.state==="connected"&&u.subscribe(),u}unsubscribe(r){var u=this.channels.find(r);u&&u.subscriptionPending?u.cancelSubscription():(u=this.channels.remove(r),u&&u.subscribed&&u.unsubscribe())}send_event(r,u,C){return this.connection.send_event(r,u,C)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}Ee.instances=[],Ee.isReady=!1,Ee.logToConsole=!1,Ee.Runtime=K,Ee.ScriptReceivers=K.ScriptReceivers,Ee.DependenciesReceivers=K.DependenciesReceivers,Ee.auth_callbacks=K.auth_callbacks;var ks=i.default=Ee;function Mu(h){if(h==null)throw"You must pass your app key when you instantiate Pusher."}K.setup(Ee)}])})})(la);var gc=la.exports;const yc=fc(gc);class ca{constructor(e){d(this,"container");d(this,"onAction");d(this,"onFail");d(this,"initialTime");d(this,"timeLeft");d(this,"timerId");d(this,"payment");this.container=e.container,this.onAction=e.onAction,this.onFail=e.onFail,this.initialTime=1800,this.timeLeft=this.initialTime,this.timerId=null}attachListener(){const e=this.container.querySelector("#transfer-acn"),n=this.container.querySelector("#transfer-bank"),i=this.container.querySelector("#copy-acn"),s=this.container.querySelector("#acn-tooltip"),o=this.container.querySelector("#transfer-amount"),a=this.container.querySelector("#copy-amount"),c=this.container.querySelector("#amount-tooltip"),l=this.container.querySelector("#transfer-button"),m=this.container.querySelector("#transfer-header-1"),p=this.container.querySelector("#transfer-header-2"),y=this.container.querySelector("#transfer-header-3"),b=this.container.querySelector("#bank-name-text"),g=this.container.querySelector("#beneficiary-text"),w=this.container.querySelector("#amount-text"),f=this.container.querySelectorAll(".copy-text"),k=this.container.querySelector("#account-number-text"),x=this.container.querySelector("#expiration-text");m&&(m.innerHTML=Pe["transfer-header-1"]),p&&(p.innerHTML=Pe["transfer-header-2"]),y&&(y.innerHTML=Pe["transfer-header-3"]),w&&(w.innerHTML=q.amount),f.forEach(A=>{A.innerHTML=P.copy}),k&&(k.innerHTML=Pe["account-number"]),b&&(b.innerHTML=Pe["bank-name"]),g&&(g.innerHTML=Pe.beneficiary),x&&(x.innerHTML=Pe["expiration-text"]),i&&e&&i.addEventListener("click",()=>{s&&(n&&_.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Started",account_number:e.innerHTML,bank_name:n.innerHTML}),this.copyToClipboard(e.innerHTML,s))}),a&&o&&a.addEventListener("click",()=>{c&&(_.track("copy_transferAmount",{payment_method:"Transfer",amount:o.innerHTML.split(" ")[1].replace(/,/g,"")}),this.copyToClipboard(o.innerHTML.split(" ")[1].replace(/,/g,""),c))}),l&&(l.innerHTML=Pe["made-transfer"],l.addEventListener("click",()=>{this.onAction(5),_.track("initiate_payment_verification",{payment_method:"Transfer"})}))}startTimer(e){this.stopTimer(),this.timerId=window.setInterval(()=>{if(this.timeLeft>0){this.timeLeft-=1;const n=this.container.querySelector("#time-left");n&&(n.innerHTML=tn(this.timeLeft))}else this.stopTimer(),e==="check"&&this.onAction(2)},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}copyToClipboard(e,n){navigator.clipboard.writeText(e).then(()=>{n.innerHTML=P.copied}).catch(()=>{n.innerHTML=P["copy-fail"]})}renderComponent(e){var y,b,g,w,f,k;e&&(this.payment=e),this.container.innerHTML=this.render();const n=this.container.querySelector("#transfer-amount"),i=this.container.querySelector("#transfer-bank"),s=this.container.querySelector("#account-name"),o=this.container.querySelector("#transfer-acn"),a=this.container.querySelector("#time-left"),c=((y=this.payment)==null?void 0:y.currency)||"USD",l=c==="USD"?(b=this.payment)==null?void 0:b.localCurrency:c;if(n&&(n.innerHTML=`${l} ${Te(this.payment.totalTaxAmount?this.payment.totalLocalAmount:c==="USD"?(g=this.payment)==null?void 0:g.localAmount:(w=this.payment)==null?void 0:w.amount,2)}`),i&&this.payment.bankDetails&&(i.innerHTML=(f=this.payment.bankDetails)==null?void 0:f.bankName),s&&this.payment.bankDetails&&(s.innerHTML=(k=this.payment.bankDetails)==null?void 0:k.accountName),o&&this.payment.bankDetails&&(o.innerHTML=this.payment.bankDetails.accountNumber),a&&(a.innerHTML=tn(this.initialTime)),this.startTimer("poll"),e.status==="inProgress"){const x="45654f3ce4c9512ea9a4",A="us2";var m=new yc(x,{cluster:A}),p=m.subscribe(e.reference);p.bind("payment_status",M=>{M.status==="successful"?(clearInterval(this.timerId||void 0),this.onAction(6),_.track("verify_payment",{payment_method:"Transfer",verification_status:"Success"}),M!=null&&M.redirectUrl&&setTimeout(()=>{const E=new URL(M.redirectUrl);E.searchParams.append("status",M.status),E.searchParams.append("reference",M.reference),window.location.href=E.toString()},1800)):M.status==="failed"&&(clearInterval(this.timerId||void 0),this.onFail(7,"Transfer failed"),_.track("verify_payment",{payment_method:"Transfer",verification_status:"Failed"}))})}this.attachListener()}render(){return bc}}const Cc=`<div id="trasferConfirmationProgress" data-section="transfer">
1777
1779
  <div>
1778
1780
  <div>
1779
1781
  <div class=" grid grid-rows-[auto_1fr] gap-4 mx-5">
@@ -1856,7 +1858,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1856
1858
  </div>
1857
1859
  </div>
1858
1860
  </div>
1859
- </div>`;class wc{constructor(e){d(this,"container");d(this,"onAction");d(this,"ref");d(this,"token");d(this,"initialTime",300);d(this,"abortController");d(this,"timeLeft");d(this,"timer");d(this,"timerId",null);d(this,"rdtCode");d(this,"url");d(this,"callBackUrl");d(this,"payment");d(this,"setPaymentResponses");this.container=e.container,this.timeLeft=this.initialTime,this.onAction=e.onAction,this.ref=e.ref,this.token=e.token,this.rdtCode=e.rdtCode,this.url=e.url,this.callBackUrl=e.callBackUrl,this.setPaymentResponses=e.setPaymentResponses}attachListeners(){const e=this.container.querySelector("#confirming-txn-status"),n=this.container.querySelector("#confirming-txn-status-end-text"),i=this.container.querySelector("#account-details-text"),s=this.container.querySelector("#please-wait-text"),o=this.container.querySelector("#minutes-text"),a=this.container.querySelector("#bankname-text"),c=this.container.querySelector("#beneficiary-text"),l=this.container.querySelector("#transfer-bank"),m=this.container.querySelector("#transfer-acn-pr"),p=this.container.querySelector("#copy-acn-pr"),y=this.container.querySelector("#acn-tooltip-pr");e&&(e.innerHTML=P["confirming-txn-status"]),n&&(n.innerHTML=P["few-minutes"]),s&&(s.innerHTML=P["please-wait-for"]),o&&(o.innerHTML=P.minutes),a&&(a.innerHTML=Ve["bank-name"]),c&&(c.innerHTML=Ve.beneficiary),i&&(i.innerHTML=Ve["account-details"]);const b=this.container.querySelector("#show-acn");b&&b.addEventListener("click",()=>{this.onAction(1),clearTimeout(this.timer)}),p&&m&&p.addEventListener("click",()=>{_.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Verification",account_number:m.innerHTML,bank_name:l==null?void 0:l.innerHTML}),y&&(y.innerHTML=P.copy,this.copyToClipboard(m.innerHTML,y))}),this.initialTime=300,this.timeLeft=this.initialTime;const g=3e4;this.abortController=new AbortController,setTimeout(()=>{this.verifyTransfer(this.token,g,({data:w,headers:f})=>{this.onAction(6),this.redirectTo(w,f)})},5e3),this.startTimer()}updateProgressTimerContent(){const n=2*Math.PI*40,s=(this.initialTime-this.timeLeft)/this.initialTime*100/100*n,o=this.container.querySelector(".circle-progress");o&&(o.setAttribute("stroke-dasharray",`${n}`),o.setAttribute("stroke-dashoffset",`${s}`))}async verifyTransfer(e,n,i){let s=0,o=n,a=!0,c;this.abortController&&(c=this.abortController.signal);const l=async()=>{if(this.timeLeft<=0){a=!1,this.onAction(8);return}s+=1;try{const m=await Xe(e,this.ref,c,this.rdtCode,this.url);m.data.status==="inProgress"?(a&&(o=n*(s+1),this.timer=setTimeout(l,o)),this.setPaymentResponses(m.data,m.headers)):m.data.status==="successful"||m.data.status==="success"?(this.setPaymentResponses(m.data,m.headers),a=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),_.track("verify_payment",{payment_method:"Transfer",verification_status:"Success"}),i(m)):m.data.status==="failed"&&(this.setPaymentResponses(m.data,m.headers),a=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),this.onAction(7,"Transfer failed"),_.track("verify_payment",{payment_method:"Transfer",verification_status:"Failed"}))}catch{a&&(o=n*(s+1),this.timer=setTimeout(l,o))}};l()}redirectTo(e,n){const i=n.get("spf-redirect-url");this.callBackUrl=i||this.callBackUrl,this.callBackUrl&&setTimeout(()=>{const s=new URL(this.callBackUrl);s.searchParams.append("status",e.status),s.searchParams.append("reference",e.reference),window.location.href=s.toString()},1800)}startTimer(){const e=this.container.querySelector("#ctd-timer");this.stopTimer(),this.timerId=window.setInterval(()=>{this.timeLeft>0?(this.timeLeft-=1,e&&(e.innerHTML=tn(this.timeLeft),this.startTimer()),this.updateProgressTimerContent()):(this.stopTimer(),this.onAction(8))},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}renderTransferDetailsComponent(e){var o,a;e&&(this.payment=e),this.container.innerHTML=this.render();const n=this.container.querySelector("#transfer-bank"),i=this.container.querySelector("#transfer-acn-pr"),s=this.container.querySelector("#account-name");n&&e.bankDetails&&(n.innerHTML=(o=e.bankDetails)==null?void 0:o.bankName),i&&e.bankDetails&&(i.innerHTML=e.bankDetails.accountNumber),s&&e.bankDetails&&(s.innerHTML=(a=e.bankDetails)==null?void 0:a.accountName)}copyToClipboard(e,n){navigator.clipboard.writeText(e).then(()=>{n.innerHTML=P.copied}).catch(()=>{n.innerHTML=P["copy-fail"]})}renderComponent(e){this.container.innerHTML=this.render(),this.renderTransferDetailsComponent(e),this.attachListeners()}render(){return Cc}}const kc=`<div id="paymentExpired" data-section="transfer">
1861
+ </div>`;class wc{constructor(e){d(this,"container");d(this,"onAction");d(this,"ref");d(this,"token");d(this,"initialTime",300);d(this,"abortController");d(this,"timeLeft");d(this,"timer");d(this,"timerId",null);d(this,"rdtCode");d(this,"url");d(this,"callBackUrl");d(this,"payment");d(this,"setPaymentResponses");this.container=e.container,this.timeLeft=this.initialTime,this.onAction=e.onAction,this.ref=e.ref,this.token=e.token,this.rdtCode=e.rdtCode,this.url=e.url,this.callBackUrl=e.callBackUrl,this.setPaymentResponses=e.setPaymentResponses}attachListeners(){const e=this.container.querySelector("#confirming-txn-status"),n=this.container.querySelector("#confirming-txn-status-end-text"),i=this.container.querySelector("#account-details-text"),s=this.container.querySelector("#please-wait-text"),o=this.container.querySelector("#minutes-text"),a=this.container.querySelector("#bankname-text"),c=this.container.querySelector("#beneficiary-text"),l=this.container.querySelector("#transfer-bank"),m=this.container.querySelector("#transfer-acn-pr"),p=this.container.querySelector("#copy-acn-pr"),y=this.container.querySelector("#acn-tooltip-pr");e&&(e.innerHTML=P["confirming-txn-status"]),n&&(n.innerHTML=P["few-minutes"]),s&&(s.innerHTML=P["please-wait-for"]),o&&(o.innerHTML=P.minutes),a&&(a.innerHTML=Pe["bank-name"]),c&&(c.innerHTML=Pe.beneficiary),i&&(i.innerHTML=Pe["account-details"]);const b=this.container.querySelector("#show-acn");b&&b.addEventListener("click",()=>{this.onAction(1),clearTimeout(this.timer)}),p&&m&&p.addEventListener("click",()=>{_.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Verification",account_number:m.innerHTML,bank_name:l==null?void 0:l.innerHTML}),y&&(y.innerHTML=P.copy,this.copyToClipboard(m.innerHTML,y))}),this.initialTime=300,this.timeLeft=this.initialTime;const g=3e4;this.abortController=new AbortController,setTimeout(()=>{this.verifyTransfer(this.token,g,({data:w,headers:f})=>{this.onAction(6),this.redirectTo(w,f)})},5e3),this.startTimer()}updateProgressTimerContent(){const n=2*Math.PI*40,s=(this.initialTime-this.timeLeft)/this.initialTime*100/100*n,o=this.container.querySelector(".circle-progress");o&&(o.setAttribute("stroke-dasharray",`${n}`),o.setAttribute("stroke-dashoffset",`${s}`))}async verifyTransfer(e,n,i){let s=0,o=n,a=!0,c;this.abortController&&(c=this.abortController.signal);const l=async()=>{if(this.timeLeft<=0){a=!1,this.onAction(8);return}s+=1;try{const m=await Xe(e,this.ref,c,this.rdtCode,this.url);m.data.status==="inProgress"?(a&&(o=n*(s+1),this.timer=setTimeout(l,o)),this.setPaymentResponses(m.data,m.headers)):m.data.status==="successful"||m.data.status==="success"?(this.setPaymentResponses(m.data,m.headers),a=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),_.track("verify_payment",{payment_method:"Transfer",verification_status:"Success"}),i(m)):m.data.status==="failed"&&(this.setPaymentResponses(m.data,m.headers),a=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),this.onAction(7,"Transfer failed"),_.track("verify_payment",{payment_method:"Transfer",verification_status:"Failed"}))}catch{a&&(o=n*(s+1),this.timer=setTimeout(l,o))}};l()}redirectTo(e,n){const i=n.get("spf-redirect-url");this.callBackUrl=i||this.callBackUrl,this.callBackUrl&&setTimeout(()=>{const s=new URL(this.callBackUrl);s.searchParams.append("status",e.status),s.searchParams.append("reference",e.reference),window.location.href=s.toString()},1800)}startTimer(){const e=this.container.querySelector("#ctd-timer");this.stopTimer(),this.timerId=window.setInterval(()=>{this.timeLeft>0?(this.timeLeft-=1,e&&(e.innerHTML=tn(this.timeLeft),this.startTimer()),this.updateProgressTimerContent()):(this.stopTimer(),this.onAction(8))},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}renderTransferDetailsComponent(e){var o,a;e&&(this.payment=e),this.container.innerHTML=this.render();const n=this.container.querySelector("#transfer-bank"),i=this.container.querySelector("#transfer-acn-pr"),s=this.container.querySelector("#account-name");n&&e.bankDetails&&(n.innerHTML=(o=e.bankDetails)==null?void 0:o.bankName),i&&e.bankDetails&&(i.innerHTML=e.bankDetails.accountNumber),s&&e.bankDetails&&(s.innerHTML=(a=e.bankDetails)==null?void 0:a.accountName)}copyToClipboard(e,n){navigator.clipboard.writeText(e).then(()=>{n.innerHTML=P.copied}).catch(()=>{n.innerHTML=P["copy-fail"]})}renderComponent(e){this.container.innerHTML=this.render(),this.renderTransferDetailsComponent(e),this.attachListeners()}render(){return Cc}}const kc=`<div id="paymentExpired" data-section="transfer">
1860
1862
  <div class="container-center min-h-[30dvh]">
1861
1863
  <div>
1862
1864
  <div class="container-center mb-5">
@@ -1879,7 +1881,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1879
1881
  </div> -->
1880
1882
  </div>
1881
1883
  </div>
1882
- </div>`;class Sc{constructor(e){d(this,"container");this.container=e.container}attachListeners(){const e=this.container.querySelector("#payment-warning-text"),n=this.container.querySelector("#payment-warning-desc");e&&(e.innerHTML=Ve["account-expired"]),n&&(n.innerHTML=Ve["account-expired-desc"])}renderComponent(){this.container.innerHTML=this.render()}render(){return kc}}class xc{constructor({amount:e,totalAmount:n,closeModal:i,container:s,customer:o,token:a,currency:c,rdtCode:l,url:m,reference:p,callBackUrl:y,metadata:b,localCurrency:g,disablePaymentMethods:w,restartTransactionProcess:f,hidePaymentMethods:k,retryingPayment:x}){d(this,"container");d(this,"contents");d(this,"closeModal");d(this,"customer");d(this,"transferDetails");d(this,"transferConfirmationProgress");d(this,"transferConfirmationEnd");d(this,"transferExpired");d(this,"mainLoader");d(this,"warningScreen");d(this,"successScreen");d(this,"merchantPlanDetail",{});d(this,"token");d(this,"currency");d(this,"amount");d(this,"totalAmount");d(this,"rdtCode");d(this,"url");d(this,"reference");d(this,"_currentStep");d(this,"activeRef");d(this,"paymentResponse");d(this,"timerId");d(this,"abortController",null);d(this,"callBackUrl");d(this,"metadata");d(this,"localCurrency");d(this,"transactionIssuesScreen");d(this,"disablePaymentMethods");d(this,"paymentResponseHeaders");d(this,"restartTransactionProcess");d(this,"hidePaymentMethods");d(this,"retryingPayment");d(this,"isMaxRetriesReached");d(this,"isMobile",!1);d(this,"errorText");this.currency=c,this.container=s,this.contents=this.container.querySelector("#payment-content-view"),this.closeModal=i,this.token=a,this.customer=o,this.amount=e,this.totalAmount=n,this.rdtCode=l,this.url=m,this.reference=p,this._currentStep=1,this.callBackUrl=y,this.metadata=b,this.localCurrency=g,this.disablePaymentMethods=w,this.paymentResponse={},this.paymentResponseHeaders={},this.restartTransactionProcess=f,this.hidePaymentMethods=k,this.retryingPayment=x,this.isMaxRetriesReached=!1,this.renderTransferContent(),this.paymentResponse={},this.activeRef="",this.timerId=null,this.errorText="",this.mainLoader=new ke(this.contents),this.mainLoader.mountLoader("25dvh"),this.currentStep===1&&(this.abortController=new AbortController,this.createTransfer()),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderTransferContent(),e===1&&this.createTransfer()}attachInputListeners(){const e=this.container.querySelector("#transfer-try-again"),n=this.container.querySelector("#transfer-sent"),i=this.container.querySelector(".success-button");e&&e.addEventListener("click",()=>{this.currentStep=1}),n&&n.addEventListener("click",()=>{this.abortController&&(this.abortController.abort(),this.currentStep=5)}),i&&i.addEventListener("click",()=>{this.closeModal(),_.track("checkout_closes")})}onSentVerify(e){e!==2?this.abortController&&(this.abortController.abort(),this.currentStep=e):this.currentStep=2}async verifyTransfer(){try{const e=await Xe(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers}catch{this.currentStep=7}}async createTransfer(){requestAnimationFrame(()=>{const e=this.container.querySelector("#loader"),n=this.container.querySelector("#details-content");n&&(this.mainLoader=new ke(this.contents),this.mainLoader.mountLoader("25dvh"),n.classList.add("hidden")),_.track("start_payment",{payment_method:"Transfer"});const i=fn();(()=>{var o,a;if(this.retryingPayment){const c={channel:"bank_transfer",reference:this.reference};return $t(this.token,c,this.rdtCode,this.url)}else{const c={amount:this.amount,channel:"bank_transfer",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((o=this.merchantPlanDetail)==null?void 0:o.taxQuoteId)&&{taxQuoteId:(a=this.merchantPlanDetail)==null?void 0:a.taxQuoteId},deviceInformation:i};return Hi(this.token,c,this.rdtCode,this.url)}})().then(async({data:o,headers:a})=>{if(this.paymentResponse=o,this.paymentResponseHeaders=a,o.providerMessage){const c=await z(o.providerMessage,H());this.errorText=c}if(o.status==="failed")this.currentStep=7,_.track("stop_transferProcess",{payment_method:"Transfer",verification_status:"Failed"}),o.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(P["payment-failed"]),this.warningScreen.hideReportIssue();else if(e&&n&&(e.classList.add("hidden"),n.classList.remove("hidden")),this.activeRef=o.reference,this.paymentResponse=o,o.bankDetails&&o.bankDetails.accountNumber)this.transferDetails=new ca({container:this.contents,onAction:c=>{this.onSentVerify.bind(this)(c)},onFail:async(c,l)=>{if(this.currentStep=c,c===7&&l){const m=await z(l,H());this.errorText=m,this.warningScreen.setPaymentError(this.errorText)}}}),this.transferDetails.renderComponent(this.paymentResponse||o);else if(o.providerMessage){const c=await z(o.providerMessage,H());this.errorText=c,this.currentStep=7,this.warningScreen.setPaymentError(this.errorText)}else{const c=await z("Error fetching bank details",H());this.currentStep=7,this.warningScreen.setPaymentError(c)}}).catch(async o=>{if(_.track("verify_payment",{payment_method:"Transfer",verification_status:"Null"}),o.code==="payment_max_retry_attempts")this.isMaxRetriesReached=!0,this.verifyTransfer(),this.currentStep=7,_.track("max_retries_reached",{payment_method:"Transfer"}),this.warningScreen.setPaymentError(P["maximum-retries"],P["maximum-retries-desc"],q["merchant-back"]);else if(o!=null&&o.message){const a=await z(o.message,H());this.errorText=a,this.currentStep=7,this.warningScreen.setPaymentError(this.errorText)}else this.currentStep=7,this.warningScreen.setPaymentError(P["payment-failed"]);this.warningScreen.hideReportIssue()})})}goBackToMerchant(){Pe(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}renderTransferContent(e){var i;e&&(this.merchantPlanDetail=e);const n=document.getElementById("go-back");if(this.isMobile&&this.hidePaymentMethods(),this.currentStep!==1?(n==null||n.classList.add("hidden"),this.disablePaymentMethods("bank_transfer")):n==null||n.addEventListener("click",()=>{this.restartTransactionProcess()}),this.contents){switch(this.currentStep){case 1:this.transferDetails=new ca({container:this.contents,onAction:s=>{this.onSentVerify.bind(this)(s)},onFail:async(s,o)=>{if(this.currentStep=s,s===7&&o){const a=await z(o,H());this.errorText=a,this.warningScreen.setPaymentError(this.errorText)}}});break;case 2:this.transferExpired=new Sc({container:this.contents}),this.transferExpired.renderComponent();break;case 5:this.transferConfirmationProgress=new wc({container:this.contents,onAction:async(s,o)=>{if(this.currentStep=s,s===7&&o){const a=await z(o,H());this.errorText=a,this.warningScreen.setPaymentError(this.errorText)}},ref:this.activeRef,token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(s,o)=>{this.paymentResponse=s,this.paymentResponseHeaders=o}}),this.transferConfirmationProgress.renderComponent(this.paymentResponse);break;case 6:this.successScreen=new Vt({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(i=this.merchantPlanDetail)==null?void 0:i.rate.rate}),this.successScreen.renderComponent();break;case 7:this.warningScreen=new et({container:this.contents,onReportIssue:()=>this.currentStep=8,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this)}),this.contents.innerHTML=this.warningScreen.render();break;case 8:this.transferConfirmationEnd=new oa({container:this.contents,onAction:s=>{this.currentStep=s},ref:this.reference,token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders,paymentMethod:"Transfer"}),this.transferConfirmationEnd.renderComponent();break;case 9:this.transactionIssuesScreen=new sn({container:this.contents,onAction:async()=>{var s,o;if(this.currentStep=7,(s=this.paymentResponse)!=null&&s.providerMessage){const a=await z((o=this.paymentResponse)==null?void 0:o.providerMessage,H());this.errorText=a}this.warningScreen.setPaymentError(this.errorText||P["payment-failed"])},token:this.token,rdtCode:this.rdtCode,url:this.url,paymentChannel:"bank_transfer",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break}this.attachInputListeners()}}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}stopProgressBar(){const e=this.container.querySelector(".progress-bar");e&&(e.style.animationPlayState="paused")}copyToClipboard(e,n){navigator.clipboard.writeText(e).then(()=>{n.innerHTML=P.copied}).catch(()=>{n.innerHTML=P["copy-fail"]})}destroyTimer(){this.stopTimer()}stopPolling(){this.abortController&&this.abortController.abort()}}function da(){return function(t,e){let n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:()=>n,set:o=>{n=o}})}}class ce extends Error{constructor(e,n){super(e),this.status=n,this.name="FetchError"}}class gt extends Error{constructor(e){super(e),this.name="AuthorizationError"}}class ms{constructor(e){d(this,"token");d(this,"baseurl","https://api.spotflow.co/api/v1");d(this,"headers");d(this,"rdtCode");d(this,"url");d(this,"getHeaders",(e,n)=>{if(!e)throw new gt("Missing authorization token");const i=new Headers;return i.append("Content-Type","application/json"),i.append("Authorization",`Bearer ${e}`),i.append("Origin","https://sdk.spotflow.co"),n&&i.append("Spotflow-Payment-Code",n),i});this.token=e.token,this.rdtCode=e.rdtCode,this.url=e.url,this.headers=this.getHeaders(this.token,this.rdtCode)}}class ua extends ms{constructor(e){super(e)}async createCardPayment(e){try{const n=await fetch(`${ue(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!n.ok){const s=await n.json();throw s.message?new ce(s.message,n.status):new ce("Network response was not ok",n.status)}return await n.json()}catch(n){throw n instanceof ce?console.error(`FetchError: ${n.message} (status: ${n.status})`):n instanceof gt?console.error(`AuthorizationError: ${n.message}`):console.error(`Unexpected error: ${n}`),n}}async createUssdPayment(e){try{const n=await fetch(`${ue(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!n.ok){const s=await n.json();throw s.message?new ce(s.message,n.status):new ce("Network response was not ok",n.status)}return{data:await n.json(),headers:n.headers}}catch(n){throw n instanceof ce?console.error(`FetchError: ${n.message} (status: ${n.status})`):n instanceof gt?console.error(`AuthorizationError: ${n.message}`):console.error(`Unexpected error: ${n}`),n}}async validateCardPayment(e){try{const n=await fetch(`${ue(this.baseurl,this.url)}/payments/validate`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!n.ok){const s=await n.json();throw s.message?new ce(s.message,n.status):new ce("Network response was not ok",n.status)}return await n.json()}catch(n){throw n instanceof ce?console.error(`FetchError: ${n.message} (status: ${n.status})`):n instanceof gt?console.error(`AuthorizationError: ${n.message}`):console.error(`Unexpected error: ${n}`),n}}async authorizeCardPayment(e){try{const n=await fetch(`${ue(this.baseurl,this.url)}/payments/authorize`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!n.ok){const s=await n.json();throw s.message?new ce(s.message,n.status):new ce("Network response was not ok",n.status)}return await n.json()}catch(n){throw n instanceof ce?console.error(`FetchError: ${n.message} (status: ${n.status})`):n instanceof gt?console.error(`AuthorizationError: ${n.message}`):console.error(`Unexpected error: ${n}`),n}}async createTransferPayment(e){try{const n=await fetch(`${ue(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!n.ok){const s=await n.json();throw s.message?new ce(s.message,n.status):new ce("Network response was not ok",n.status)}return await n.json()}catch(n){throw n instanceof ce?console.error(`FetchError: ${n.message} (status: ${n.status})`):n instanceof gt?console.error(`AuthorizationError: ${n.message}`):console.error(`Unexpected error: ${n}`),n}}async verifyPayment(e,n){try{const i=await fetch(`${ue(this.baseurl,this.url)}/payments/verify?reference=${e}`,{method:"GET",headers:this.headers,signal:n});if(!i.ok){const o=await i.json();throw o.message?new ce(o.message,i.status):new ce("Network response was not ok",i.status)}return{data:await i.json(),headers:i.headers}}catch(i){throw i instanceof ce?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof gt?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}}}class Ac extends ms{constructor(e){super(e)}async getMerchantConfig(e,n,i){try{const s=new URLSearchParams;n&&s.append("currency",n),e&&s.append("planId",e),i&&s.append("subscriptionId",i);const o=await fetch(`${ue(this.baseurl,this.url)}/checkout-configurations?${s.toString()}`,{headers:this.headers,method:"GET"});if(!o.ok){const a=await o.json();throw a.message?new ce(a.message,o.status):new ce("Network response was not ok",o.status)}return o.json()}catch(s){throw s instanceof ce?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof gt?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}}}class Mc extends ms{constructor(e){super(e)}async getBankList(){try{const e=await fetch(`${ue(this.baseurl,this.url)}/banks?ussd=true`,{headers:this.headers,method:"GET"});if(!e.ok){const n=await e.json();throw n.message?new ce(n.message,e.status):new ce("Network response was not ok",e.status)}return e.json()}catch(e){throw e instanceof ce?(Vn.showToast(e.message,"error",9e3),console.error(`FetchError: ${e.message} (status: ${e.status})`)):e instanceof gt?console.error(`AuthorizationError: ${e.message}`):console.error(`Unexpected error: ${e}`),e}}}const Lc=`<form id="ussdBanks">
1884
+ </div>`;class Sc{constructor(e){d(this,"container");this.container=e.container}attachListeners(){const e=this.container.querySelector("#payment-warning-text"),n=this.container.querySelector("#payment-warning-desc");e&&(e.innerHTML=Pe["account-expired"]),n&&(n.innerHTML=Pe["account-expired-desc"])}renderComponent(){this.container.innerHTML=this.render()}render(){return kc}}class xc{constructor({amount:e,totalAmount:n,closeModal:i,container:s,customer:o,token:a,currency:c,rdtCode:l,url:m,reference:p,callBackUrl:y,metadata:b,localCurrency:g,disablePaymentMethods:w,restartTransactionProcess:f,hidePaymentMethods:k,retryingPayment:x}){d(this,"container");d(this,"contents");d(this,"closeModal");d(this,"customer");d(this,"transferDetails");d(this,"transferConfirmationProgress");d(this,"transferConfirmationEnd");d(this,"transferExpired");d(this,"mainLoader");d(this,"warningScreen");d(this,"successScreen");d(this,"merchantPlanDetail",{});d(this,"token");d(this,"currency");d(this,"amount");d(this,"totalAmount");d(this,"rdtCode");d(this,"url");d(this,"reference");d(this,"_currentStep");d(this,"activeRef");d(this,"paymentResponse");d(this,"timerId");d(this,"abortController",null);d(this,"callBackUrl");d(this,"metadata");d(this,"localCurrency");d(this,"transactionIssuesScreen");d(this,"disablePaymentMethods");d(this,"paymentResponseHeaders");d(this,"restartTransactionProcess");d(this,"hidePaymentMethods");d(this,"retryingPayment");d(this,"isMaxRetriesReached");d(this,"isMobile",!1);d(this,"errorText");this.currency=c,this.container=s,this.contents=this.container.querySelector("#payment-content-view"),this.closeModal=i,this.token=a,this.customer=o,this.amount=e,this.totalAmount=n,this.rdtCode=l,this.url=m,this.reference=p,this._currentStep=1,this.callBackUrl=y,this.metadata=b,this.localCurrency=g,this.disablePaymentMethods=w,this.paymentResponse={},this.paymentResponseHeaders={},this.restartTransactionProcess=f,this.hidePaymentMethods=k,this.retryingPayment=x,this.isMaxRetriesReached=!1,this.renderTransferContent(),this.paymentResponse={},this.activeRef="",this.timerId=null,this.errorText="",this.mainLoader=new ke(this.contents),this.mainLoader.mountLoader("25dvh"),this.currentStep===1&&(this.abortController=new AbortController,this.createTransfer()),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderTransferContent(),e===1&&this.createTransfer()}attachInputListeners(){const e=this.container.querySelector("#transfer-try-again"),n=this.container.querySelector("#transfer-sent"),i=this.container.querySelector(".success-button");e&&e.addEventListener("click",()=>{this.currentStep=1}),n&&n.addEventListener("click",()=>{this.abortController&&(this.abortController.abort(),this.currentStep=5)}),i&&i.addEventListener("click",()=>{this.closeModal(),_.track("checkout_closes")})}onSentVerify(e){e!==2?this.abortController&&(this.abortController.abort(),this.currentStep=e):this.currentStep=2}async verifyTransfer(){try{const e=await Xe(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers}catch{this.currentStep=7}}async createTransfer(){requestAnimationFrame(()=>{const e=this.container.querySelector("#loader"),n=this.container.querySelector("#details-content");n&&(this.mainLoader=new ke(this.contents),this.mainLoader.mountLoader("25dvh"),n.classList.add("hidden")),_.track("start_payment",{payment_method:"Transfer"});const i=fn();(()=>{var o,a;if(this.retryingPayment){const c={channel:"bank_transfer",reference:this.reference};return $t(this.token,c,this.rdtCode,this.url)}else{const c={amount:this.amount,channel:"bank_transfer",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((o=this.merchantPlanDetail)==null?void 0:o.taxQuoteId)&&{taxQuoteId:(a=this.merchantPlanDetail)==null?void 0:a.taxQuoteId},deviceInformation:i};return Hi(this.token,c,this.rdtCode,this.url)}})().then(async({data:o,headers:a})=>{if(this.paymentResponse=o,this.paymentResponseHeaders=a,o.providerMessage){const c=await z(o.providerMessage,H());this.errorText=c}if(o.status==="failed")this.currentStep=7,_.track("stop_transferProcess",{payment_method:"Transfer",verification_status:"Failed"}),o.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(P["payment-failed"]),this.warningScreen.hideReportIssue();else if(e&&n&&(e.classList.add("hidden"),n.classList.remove("hidden")),this.activeRef=o.reference,this.paymentResponse=o,o.bankDetails&&o.bankDetails.accountNumber)this.transferDetails=new ca({container:this.contents,onAction:c=>{this.onSentVerify.bind(this)(c)},onFail:async(c,l)=>{if(this.currentStep=c,c===7&&l){const m=await z(l,H());this.errorText=m,this.warningScreen.setPaymentError(this.errorText)}}}),this.transferDetails.renderComponent(this.paymentResponse||o);else if(o.providerMessage){const c=await z(o.providerMessage,H());this.errorText=c,this.currentStep=7,this.warningScreen.setPaymentError(this.errorText)}else{const c=await z("Error fetching bank details",H());this.currentStep=7,this.warningScreen.setPaymentError(c)}}).catch(async o=>{if(_.track("verify_payment",{payment_method:"Transfer",verification_status:"Null"}),o.code==="payment_max_retry_attempts")this.isMaxRetriesReached=!0,this.verifyTransfer(),this.currentStep=7,_.track("max_retries_reached",{payment_method:"Transfer"}),this.warningScreen.setPaymentError(P["maximum-retries"],P["maximum-retries-desc"],q["merchant-back"]);else if(o!=null&&o.message){const a=await z(o.message,H());this.errorText=a,this.currentStep=7,this.warningScreen.setPaymentError(this.errorText)}else this.currentStep=7,this.warningScreen.setPaymentError(P["payment-failed"]);this.warningScreen.hideReportIssue()})})}goBackToMerchant(){Ie(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}renderTransferContent(e){var i;e&&(this.merchantPlanDetail=e);const n=document.getElementById("go-back");if(this.isMobile&&this.hidePaymentMethods(),this.currentStep!==1?(n==null||n.classList.add("hidden"),this.disablePaymentMethods("bank_transfer")):n==null||n.addEventListener("click",()=>{this.restartTransactionProcess()}),this.contents){switch(this.currentStep){case 1:this.transferDetails=new ca({container:this.contents,onAction:s=>{this.onSentVerify.bind(this)(s)},onFail:async(s,o)=>{if(this.currentStep=s,s===7&&o){const a=await z(o,H());this.errorText=a,this.warningScreen.setPaymentError(this.errorText)}}});break;case 2:this.transferExpired=new Sc({container:this.contents}),this.transferExpired.renderComponent();break;case 5:this.transferConfirmationProgress=new wc({container:this.contents,onAction:async(s,o)=>{if(this.currentStep=s,s===7&&o){const a=await z(o,H());this.errorText=a,this.warningScreen.setPaymentError(this.errorText)}},ref:this.activeRef,token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(s,o)=>{this.paymentResponse=s,this.paymentResponseHeaders=o}}),this.transferConfirmationProgress.renderComponent(this.paymentResponse);break;case 6:this.successScreen=new Vt({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(i=this.merchantPlanDetail)==null?void 0:i.rate.rate}),this.successScreen.renderComponent();break;case 7:this.warningScreen=new et({container:this.contents,onReportIssue:()=>this.currentStep=8,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this)}),this.contents.innerHTML=this.warningScreen.render();break;case 8:this.transferConfirmationEnd=new oa({container:this.contents,onAction:s=>{this.currentStep=s},ref:this.reference,token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders,paymentMethod:"Transfer"}),this.transferConfirmationEnd.renderComponent();break;case 9:this.transactionIssuesScreen=new sn({container:this.contents,onAction:async()=>{var s,o;if(this.currentStep=7,(s=this.paymentResponse)!=null&&s.providerMessage){const a=await z((o=this.paymentResponse)==null?void 0:o.providerMessage,H());this.errorText=a}this.warningScreen.setPaymentError(this.errorText||P["payment-failed"])},token:this.token,rdtCode:this.rdtCode,url:this.url,paymentChannel:"bank_transfer",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break}this.attachInputListeners()}}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}stopProgressBar(){const e=this.container.querySelector(".progress-bar");e&&(e.style.animationPlayState="paused")}copyToClipboard(e,n){navigator.clipboard.writeText(e).then(()=>{n.innerHTML=P.copied}).catch(()=>{n.innerHTML=P["copy-fail"]})}destroyTimer(){this.stopTimer()}stopPolling(){this.abortController&&this.abortController.abort()}}function da(){return function(t,e){let n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:()=>n,set:o=>{n=o}})}}class ce extends Error{constructor(e,n){super(e),this.status=n,this.name="FetchError"}}class gt extends Error{constructor(e){super(e),this.name="AuthorizationError"}}class ms{constructor(e){d(this,"token");d(this,"baseurl","https://api.spotflow.co/api/v1");d(this,"headers");d(this,"rdtCode");d(this,"url");d(this,"getHeaders",(e,n)=>{if(!e)throw new gt("Missing authorization token");const i=new Headers;return i.append("Content-Type","application/json"),i.append("Authorization",`Bearer ${e}`),i.append("Origin","https://sdk.spotflow.co"),n&&i.append("Spotflow-Payment-Code",n),i});this.token=e.token,this.rdtCode=e.rdtCode,this.url=e.url,this.headers=this.getHeaders(this.token,this.rdtCode)}}class ua extends ms{constructor(e){super(e)}async createCardPayment(e){try{const n=await fetch(`${ue(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!n.ok){const s=await n.json();throw s.message?new ce(s.message,n.status):new ce("Network response was not ok",n.status)}return await n.json()}catch(n){throw n instanceof ce?console.error(`FetchError: ${n.message} (status: ${n.status})`):n instanceof gt?console.error(`AuthorizationError: ${n.message}`):console.error(`Unexpected error: ${n}`),n}}async createUssdPayment(e){try{const n=await fetch(`${ue(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!n.ok){const s=await n.json();throw s.message?new ce(s.message,n.status):new ce("Network response was not ok",n.status)}return{data:await n.json(),headers:n.headers}}catch(n){throw n instanceof ce?console.error(`FetchError: ${n.message} (status: ${n.status})`):n instanceof gt?console.error(`AuthorizationError: ${n.message}`):console.error(`Unexpected error: ${n}`),n}}async validateCardPayment(e){try{const n=await fetch(`${ue(this.baseurl,this.url)}/payments/validate`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!n.ok){const s=await n.json();throw s.message?new ce(s.message,n.status):new ce("Network response was not ok",n.status)}return await n.json()}catch(n){throw n instanceof ce?console.error(`FetchError: ${n.message} (status: ${n.status})`):n instanceof gt?console.error(`AuthorizationError: ${n.message}`):console.error(`Unexpected error: ${n}`),n}}async authorizeCardPayment(e){try{const n=await fetch(`${ue(this.baseurl,this.url)}/payments/authorize`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!n.ok){const s=await n.json();throw s.message?new ce(s.message,n.status):new ce("Network response was not ok",n.status)}return await n.json()}catch(n){throw n instanceof ce?console.error(`FetchError: ${n.message} (status: ${n.status})`):n instanceof gt?console.error(`AuthorizationError: ${n.message}`):console.error(`Unexpected error: ${n}`),n}}async createTransferPayment(e){try{const n=await fetch(`${ue(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!n.ok){const s=await n.json();throw s.message?new ce(s.message,n.status):new ce("Network response was not ok",n.status)}return await n.json()}catch(n){throw n instanceof ce?console.error(`FetchError: ${n.message} (status: ${n.status})`):n instanceof gt?console.error(`AuthorizationError: ${n.message}`):console.error(`Unexpected error: ${n}`),n}}async verifyPayment(e,n){try{const i=await fetch(`${ue(this.baseurl,this.url)}/payments/verify?reference=${e}`,{method:"GET",headers:this.headers,signal:n});if(!i.ok){const o=await i.json();throw o.message?new ce(o.message,i.status):new ce("Network response was not ok",i.status)}return{data:await i.json(),headers:i.headers}}catch(i){throw i instanceof ce?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof gt?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}}}class Ac extends ms{constructor(e){super(e)}async getMerchantConfig(e,n,i){try{const s=new URLSearchParams;n&&s.append("currency",n),e&&s.append("planId",e),i&&s.append("subscriptionId",i);const o=await fetch(`${ue(this.baseurl,this.url)}/checkout-configurations?${s.toString()}`,{headers:this.headers,method:"GET"});if(!o.ok){const a=await o.json();throw a.message?new ce(a.message,o.status):new ce("Network response was not ok",o.status)}return o.json()}catch(s){throw s instanceof ce?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof gt?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}}}class Mc extends ms{constructor(e){super(e)}async getBankList(){try{const e=await fetch(`${ue(this.baseurl,this.url)}/banks?ussd=true`,{headers:this.headers,method:"GET"});if(!e.ok){const n=await e.json();throw n.message?new ce(n.message,e.status):new ce("Network response was not ok",e.status)}return e.json()}catch(e){throw e instanceof ce?(Vn.showToast(e.message,"error",9e3),console.error(`FetchError: ${e.message} (status: ${e.status})`)):e instanceof gt?console.error(`AuthorizationError: ${e.message}`):console.error(`Unexpected error: ${e}`),e}}}const Lc=`<form id="ussdBanks">
1883
1885
  <div>
1884
1886
  <h5 class="text-grey-400 font-semibold text-sm">Please choose your bank to begin payment</h5>
1885
1887
  <div class="mt-2">
@@ -2099,7 +2101,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
2099
2101
  <!-- Tab options -->
2100
2102
  </div>
2101
2103
  </div>
2102
- </div>`;class Nc{constructor(e){d(this,"container");d(this,"email");d(this,"amount",0);d(this,"metadata");d(this,"currency");d(this,"localCurrency");d(this,"mainLoader");d(this,"trialAmount");d(this,"trial");d(this,"merchantDetail");d(this,"onAction");d(this,"isMobile");d(this,"onClose");d(this,"currentPaymentMethod");d(this,"countryCode");this.container=e.container,this.email=e.email,this.amount=e.amount||0,this.metadata=e.metadata,this.currency=e.currency,this.localCurrency=e.localCurrency,this.merchantDetail=e.merchantDetail,this.onAction=e.onAction,this.isMobile=e.isMobile,this.trial=e.trial,this.onClose=e.onClose,this.trialAmount=e.trialAmount,this.currentPaymentMethod=e.currentPaymentMethod,this.countryCode=this.countryCode=e.currency==="XOF"||e.currency==="XAF"||e.localCurrency==="XOF"||e.localCurrency==="XAF"?e.countryCode:""}attachListeners(){const e=this.container.querySelectorAll(".tab-button");Array.from(e).forEach(o=>{const a=o.dataset.name||"",c=o.querySelector(".tab-button-icon"),l=o.querySelector(".tab-button-label");c&&(c.innerHTML=ne[a].icon),l&&(l.textContent=ne[a].label),o.addEventListener("click",m=>{m.preventDefault(),this.onAction(a)})});const i=this.container.querySelector("#close-btn");i&&i.addEventListener("click",()=>{this.onClose(!0)});const s=document.getElementById("go-back");s==null||s.addEventListener("click",()=>{this.onAction("")})}renderComponent(){var Ct,qt,Nt,je,wt,Zt,me,xe,Qe,ze,De,ut,R,ye,ie,Ce,qe,te,Ot,Bn,hi,mi,pi,vi,Wt,bi,re,fi,gi,yi,Ci,wi,ki,Si,gn,yn,xi,Ai,Mi,Li,Cn,Je,Ti,kt,_i,Hn;this.container.innerHTML=this.render(),this.mainLoader=new ke(this.container),this.amount=this.amount;const e=this.container.querySelector("#merchant-logo-container"),n=this.container.querySelector("#merchant-logo"),i=this.container.querySelector("#merchant-email"),s=this.container.querySelector("#merchant-email-mob"),o=this.container.querySelector("#trial-info"),a=this.container.querySelector("#todays-total-amount"),c=this.container.querySelector("#plan-name"),l=this.container.querySelector("#plan-name-mob"),m=this.container.querySelector("#payment-fees"),p=this.container.querySelector("#currency-cursor"),y=this.container.querySelector("#currency-cursor-mob"),b=this.container.querySelector("#payment-rate-display"),g=this.container.querySelector("#payment-rate-display-mob"),w=this.container.querySelector("#designated-rate"),f=this.container.querySelector("#designated-rate-mob"),k=this.container.querySelector("#designated-rate-no-plan"),x=this.container.querySelector("#source-rate"),A=this.container.querySelector("#source-rate-mob"),M=this.container.querySelector("#tax-rate"),E=this.container.querySelector("#tax-rate-mob"),D=this.container.querySelector("#tooltip-localCurrency"),F=this.container.querySelector("#tooltip-localCurrency-mob"),W=this.container.querySelector("#select-payment-method-text"),G=this.container.querySelector("#amount-text"),Q=this.container.querySelector("#what-is-this"),de=this.container.querySelector("#reflect"),_e=this.container.querySelector("#please-note"),j=this.container.querySelector("#what-is-this-mob"),Oe=this.container.querySelector("#reflect-mob"),ge=this.container.querySelector("#please-note-mob"),Ge=this.container.querySelector("#to-pay-text"),Se=this.container.querySelector("#language-dropdown");if(Se){const ot=this.currency==="USD"?this.localCurrency:this.currency,Ut=(Ct=Ni(ot,this.countryCode))==null?void 0:Ct.language,St=new Set;St.add("en"),Ut&&Ut!=="en"&&St.add(Ut),Ae.getTranslationError()||mt&&!St.has(mt)&&St.add(mt),St.size===1?Se.classList.add("hidden"):Se.classList.remove("hidden"),St.forEach(Ye=>{const ht=new Option(Ye,Ye);ht.value=Ye,ht.text=Dc[Ye]||Ye,Ye===H()&&(ht.selected=!0),Se.appendChild(ht)}),Ae.subscribeToLoading(Ye=>{Se.disabled=Ye}),Se.addEventListener("change",async Ye=>{const Ei=Ye.target.value;nn(Ei);try{await Ae.setLanguage(Ei)}catch(Pi){console.error("Failed to change language:",Pi)}finally{}})}if(W&&(W.innerHTML=q.select_payment_method_text),G&&(G.innerHTML=`${q.amount}:`),Ge&&(Ge.innerHTML=`${q["to-pay"]}:`),Q&&(Q.innerHTML=P["what-is-this"]),de&&(de.innerHTML=P["rate-reflect-note"]),_e&&(_e.innerHTML=P["rate-please-note"]),j&&(j.innerHTML=P["what-is-this"]),Oe&&(Oe.innerHTML=P["rate-reflect-note"]),ge&&(ge.innerHTML=P["rate-please-note"]),(qt=this.merchantDetail)!=null&&qt.merchantLogo?n&&n.setAttribute("src",(Nt=this.merchantDetail)==null?void 0:Nt.merchantLogo):e&&(n==null||n.remove(),e.innerHTML=`<div class="font-semibold text-tone-100 rounded-2xl w-8 h-8 bg-tone-10 container-center uppercase">${this.merchantDetail.merchantName[0]}</div>`),i&&(i.innerHTML=this.email),s&&(s.innerHTML=this.email),c){if((wt=(je=this.merchantDetail)==null?void 0:je.plan)!=null&&wt.title){const ot=((me=(Zt=this.merchantDetail)==null?void 0:Zt.plan)==null?void 0:me.title)||"";c.textContent=ui(ot)}(xe=this.metadata)!=null&&xe.productName&&(c.textContent=ui(this.metadata.productName))}if(l){if((ze=(Qe=this.merchantDetail)==null?void 0:Qe.plan)!=null&&ze.title){const ot=((ut=(De=this.merchantDetail)==null?void 0:De.plan)==null?void 0:ut.title)||"";l.textContent=ui(ot)}(R=this.metadata)!=null&&R.productName&&(l.textContent=ui(this.metadata.productName))}if(p&&(this.currency==="USD"?b&&(b.innerHTML=`1 ${((ie=(ye=this.merchantDetail)==null?void 0:ye.rate)==null?void 0:ie.to)||"-"} = ${((qe=(Ce=this.merchantDetail)==null?void 0:Ce.rate)==null?void 0:qe.from)||"-"} ${Te(((te=this.merchantDetail.rate)==null?void 0:te.rate)||1,2)} `):p.innerHTML=""),y&&(this.currency==="USD"?g&&(g.innerHTML=`1 ${((Bn=(Ot=this.merchantDetail)==null?void 0:Ot.rate)==null?void 0:Bn.to)||"-"} = ${((mi=(hi=this.merchantDetail)==null?void 0:hi.rate)==null?void 0:mi.from)||"-"} ${Te(((pi=this.merchantDetail.rate)==null?void 0:pi.rate)||1,2)} `):y.innerHTML=""),(Wt=(vi=this.merchantDetail)==null?void 0:vi.plan)!=null&&Wt.title||(bi=this.metadata)!=null&&bi.productName?w&&(((fi=(re=this.merchantDetail)==null?void 0:re.plan)==null?void 0:fi.trial)?(o==null||o.classList.remove("hidden"),w.innerHTML=`${this.currency} ${Te(this.amount,2)}`):(w.innerHTML=`${this.currency} ${Te(this.amount,2)}`,o==null||o.classList.add("hidden"))):(k&&(k.innerHTML=`<span> ${this.currency} ${Te(this.amount,2)} </span>`),c&&l&&(c.remove(),l==null||l.remove()),this.localCurrency?w==null||w.remove():m&&m.remove()),f){const ot=(yi=(gi=this.merchantDetail)==null?void 0:gi.plan)==null?void 0:yi.trial,Ut=(Si=(ki=(wi=(Ci=this.merchantDetail)==null?void 0:Ci.plan)==null?void 0:wi.trial)==null?void 0:ki.pricingList[0])==null?void 0:Si.amount;ot&&a?(a.textContent=`${this.currency} ${Te(Ut,2)}`,f.innerHTML=`${this.currency} ${Te(this.amount,2)}`):f.innerHTML=`${this.currency} ${Te(this.amount,2)}`}x&&(this.localCurrency&&this.localCurrency!==this.currency?x.children[1].innerHTML=`${this.localCurrency} ${Te(this.amount*(((yn=(gn=this.merchantDetail)==null?void 0:gn.rate)==null?void 0:yn.rate)||1),2)}`:x.remove()),A&&(this.localCurrency&&this.localCurrency!==this.currency?A.children[1].innerHTML=`${this.localCurrency} ${Te(this.amount*(((Ai=(xi=this.merchantDetail)==null?void 0:xi.rate)==null?void 0:Ai.rate)||1),2)}`:A.remove());const yt=this.localCurrency!==this.currency?this.amount*(((Li=(Mi=this.merchantDetail)==null?void 0:Mi.rate)==null?void 0:Li.rate)||1):this.amount;M&&(Cn=this.merchantDetail)!=null&&Cn.taxQuoteId&&(Je=this.merchantDetail)!=null&&Je.totalAmount&&(M.classList.remove("hidden"),M.children[1].innerHTML=`${this.localCurrency!==this.currency?this.localCurrency:this.currency} ${Te(((Ti=this.merchantDetail)==null?void 0:Ti.totalAmount)-yt,2)}`),E&&(kt=this.merchantDetail)!=null&&kt.taxQuoteId&&(_i=this.merchantDetail)!=null&&_i.totalAmount&&(E.classList.remove("hidden"),E.children[1].innerHTML=`${this.localCurrency!==this.currency?this.localCurrency:this.currency} ${Te(((Hn=this.merchantDetail)==null?void 0:Hn.totalAmount)-yt,2)}`);const dt=Ic[this.localCurrency];D&&this.localCurrency&&(D.innerHTML=dt?`${dt} (${this.localCurrency})`:this.localCurrency),F&&this.localCurrency&&(F.innerHTML=dt?`${dt} (${this.localCurrency})`:this.localCurrency),this.renderPaymentOptions(this.container),this.attachListeners()}renderPaymentOptions(e){var s,o;const n=e.querySelector(".payment-options"),i=Ht(this.currency,this.localCurrency);if(n){const a=this.merchantDetail.plan&&!((s=this.metadata)!=null&&s.subscription_id)?[ne.mobile_money,ne.card]:this.merchantDetail.paymentMethods.filter(c=>c!=="ussd").filter(c=>!(i!=="USD"&&c==="stablecoin")).map(c=>ne[c]);if(this.merchantDetail.plan&&!((o=this.metadata)!=null&&o.subscription_id)&&i==="NGN"&&a.splice(0,a.length,ne.card),this.isMobile){let c='<div class="">';a.forEach(l=>{c+=`
2104
+ </div>`;class Nc{constructor(e){d(this,"container");d(this,"email");d(this,"amount",0);d(this,"metadata");d(this,"currency");d(this,"localCurrency");d(this,"mainLoader");d(this,"trialAmount");d(this,"trial");d(this,"merchantDetail");d(this,"onAction");d(this,"isMobile");d(this,"onClose");d(this,"currentPaymentMethod");d(this,"countryCode");this.container=e.container,this.email=e.email,this.amount=e.amount||0,this.metadata=e.metadata,this.currency=e.currency,this.localCurrency=e.localCurrency,this.merchantDetail=e.merchantDetail,this.onAction=e.onAction,this.isMobile=e.isMobile,this.trial=e.trial,this.onClose=e.onClose,this.trialAmount=e.trialAmount,this.currentPaymentMethod=e.currentPaymentMethod,this.countryCode=this.countryCode=e.currency==="XOF"||e.currency==="XAF"||e.localCurrency==="XOF"||e.localCurrency==="XAF"?e.countryCode:""}attachListeners(){const e=this.container.querySelectorAll(".tab-button");Array.from(e).forEach(o=>{const a=o.dataset.name||"",c=o.querySelector(".tab-button-icon"),l=o.querySelector(".tab-button-label");c&&(c.innerHTML=ne[a].icon),l&&(l.textContent=ne[a].label),o.addEventListener("click",m=>{m.preventDefault(),this.onAction(a)})});const i=this.container.querySelector("#close-btn");i&&i.addEventListener("click",()=>{this.onClose(!0)});const s=document.getElementById("go-back");s==null||s.addEventListener("click",()=>{this.onAction("")})}renderComponent(){var Ct,qt,Nt,je,wt,Zt,me,xe,Qe,ze,Be,ut,R,ye,ie,Ce,qe,te,Ot,Bn,hi,mi,pi,vi,Wt,bi,re,fi,gi,yi,Ci,wi,ki,Si,gn,yn,xi,Ai,Mi,Li,Cn,Je,Ti,kt,_i,Hn;this.container.innerHTML=this.render(),this.mainLoader=new ke(this.container),this.amount=this.amount;const e=this.container.querySelector("#merchant-logo-container"),n=this.container.querySelector("#merchant-logo"),i=this.container.querySelector("#merchant-email"),s=this.container.querySelector("#merchant-email-mob"),o=this.container.querySelector("#trial-info"),a=this.container.querySelector("#todays-total-amount"),c=this.container.querySelector("#plan-name"),l=this.container.querySelector("#plan-name-mob"),m=this.container.querySelector("#payment-fees"),p=this.container.querySelector("#currency-cursor"),y=this.container.querySelector("#currency-cursor-mob"),b=this.container.querySelector("#payment-rate-display"),g=this.container.querySelector("#payment-rate-display-mob"),w=this.container.querySelector("#designated-rate"),f=this.container.querySelector("#designated-rate-mob"),k=this.container.querySelector("#designated-rate-no-plan"),x=this.container.querySelector("#source-rate"),A=this.container.querySelector("#source-rate-mob"),M=this.container.querySelector("#tax-rate"),E=this.container.querySelector("#tax-rate-mob"),D=this.container.querySelector("#tooltip-localCurrency"),F=this.container.querySelector("#tooltip-localCurrency-mob"),W=this.container.querySelector("#select-payment-method-text"),G=this.container.querySelector("#amount-text"),Q=this.container.querySelector("#what-is-this"),de=this.container.querySelector("#reflect"),_e=this.container.querySelector("#please-note"),j=this.container.querySelector("#what-is-this-mob"),Ue=this.container.querySelector("#reflect-mob"),ge=this.container.querySelector("#please-note-mob"),Ge=this.container.querySelector("#to-pay-text"),Se=this.container.querySelector("#language-dropdown");if(Se){const ot=this.currency==="USD"?this.localCurrency:this.currency,Ut=(Ct=Ni(ot,this.countryCode))==null?void 0:Ct.language,St=new Set;St.add("en"),Ut&&Ut!=="en"&&St.add(Ut),Ae.getTranslationError()||mt&&!St.has(mt)&&St.add(mt),St.size===1?Se.classList.add("hidden"):Se.classList.remove("hidden"),St.forEach(Ye=>{const ht=new Option(Ye,Ye);ht.value=Ye,ht.text=Dc[Ye]||Ye,Ye===H()&&(ht.selected=!0),Se.appendChild(ht)}),Ae.subscribeToLoading(Ye=>{Se.disabled=Ye}),Se.addEventListener("change",async Ye=>{const Ei=Ye.target.value;nn(Ei);try{await Ae.setLanguage(Ei)}catch(Pi){console.error("Failed to change language:",Pi)}finally{}})}if(W&&(W.innerHTML=q.select_payment_method_text),G&&(G.innerHTML=`${q.amount}:`),Ge&&(Ge.innerHTML=`${q["to-pay"]}:`),Q&&(Q.innerHTML=P["what-is-this"]),de&&(de.innerHTML=P["rate-reflect-note"]),_e&&(_e.innerHTML=P["rate-please-note"]),j&&(j.innerHTML=P["what-is-this"]),Ue&&(Ue.innerHTML=P["rate-reflect-note"]),ge&&(ge.innerHTML=P["rate-please-note"]),(qt=this.merchantDetail)!=null&&qt.merchantLogo?n&&n.setAttribute("src",(Nt=this.merchantDetail)==null?void 0:Nt.merchantLogo):e&&(n==null||n.remove(),e.innerHTML=`<div class="font-semibold text-tone-100 rounded-2xl w-8 h-8 bg-tone-10 container-center uppercase">${this.merchantDetail.merchantName[0]}</div>`),i&&(i.innerHTML=this.email),s&&(s.innerHTML=this.email),c){if((wt=(je=this.merchantDetail)==null?void 0:je.plan)!=null&&wt.title){const ot=((me=(Zt=this.merchantDetail)==null?void 0:Zt.plan)==null?void 0:me.title)||"";c.textContent=ui(ot)}(xe=this.metadata)!=null&&xe.productName&&(c.textContent=ui(this.metadata.productName))}if(l){if((ze=(Qe=this.merchantDetail)==null?void 0:Qe.plan)!=null&&ze.title){const ot=((ut=(Be=this.merchantDetail)==null?void 0:Be.plan)==null?void 0:ut.title)||"";l.textContent=ui(ot)}(R=this.metadata)!=null&&R.productName&&(l.textContent=ui(this.metadata.productName))}if(p&&(this.currency==="USD"?b&&(b.innerHTML=`1 ${((ie=(ye=this.merchantDetail)==null?void 0:ye.rate)==null?void 0:ie.to)||"-"} = ${((qe=(Ce=this.merchantDetail)==null?void 0:Ce.rate)==null?void 0:qe.from)||"-"} ${Te(((te=this.merchantDetail.rate)==null?void 0:te.rate)||1,2)} `):p.innerHTML=""),y&&(this.currency==="USD"?g&&(g.innerHTML=`1 ${((Bn=(Ot=this.merchantDetail)==null?void 0:Ot.rate)==null?void 0:Bn.to)||"-"} = ${((mi=(hi=this.merchantDetail)==null?void 0:hi.rate)==null?void 0:mi.from)||"-"} ${Te(((pi=this.merchantDetail.rate)==null?void 0:pi.rate)||1,2)} `):y.innerHTML=""),(Wt=(vi=this.merchantDetail)==null?void 0:vi.plan)!=null&&Wt.title||(bi=this.metadata)!=null&&bi.productName?w&&(((fi=(re=this.merchantDetail)==null?void 0:re.plan)==null?void 0:fi.trial)?(o==null||o.classList.remove("hidden"),w.innerHTML=`${this.currency} ${Te(this.amount,2)}`):(w.innerHTML=`${this.currency} ${Te(this.amount,2)}`,o==null||o.classList.add("hidden"))):(k&&(k.innerHTML=`<span> ${this.currency} ${Te(this.amount,2)} </span>`),c&&l&&(c.remove(),l==null||l.remove()),this.localCurrency?w==null||w.remove():m&&m.remove()),f){const ot=(yi=(gi=this.merchantDetail)==null?void 0:gi.plan)==null?void 0:yi.trial,Ut=(Si=(ki=(wi=(Ci=this.merchantDetail)==null?void 0:Ci.plan)==null?void 0:wi.trial)==null?void 0:ki.pricingList[0])==null?void 0:Si.amount;ot&&a?(a.textContent=`${this.currency} ${Te(Ut,2)}`,f.innerHTML=`${this.currency} ${Te(this.amount,2)}`):f.innerHTML=`${this.currency} ${Te(this.amount,2)}`}x&&(this.localCurrency&&this.localCurrency!==this.currency?x.children[1].innerHTML=`${this.localCurrency} ${Te(this.amount*(((yn=(gn=this.merchantDetail)==null?void 0:gn.rate)==null?void 0:yn.rate)||1),2)}`:x.remove()),A&&(this.localCurrency&&this.localCurrency!==this.currency?A.children[1].innerHTML=`${this.localCurrency} ${Te(this.amount*(((Ai=(xi=this.merchantDetail)==null?void 0:xi.rate)==null?void 0:Ai.rate)||1),2)}`:A.remove());const yt=this.localCurrency!==this.currency?this.amount*(((Li=(Mi=this.merchantDetail)==null?void 0:Mi.rate)==null?void 0:Li.rate)||1):this.amount;M&&(Cn=this.merchantDetail)!=null&&Cn.taxQuoteId&&(Je=this.merchantDetail)!=null&&Je.totalAmount&&(M.classList.remove("hidden"),M.children[1].innerHTML=`${this.localCurrency!==this.currency?this.localCurrency:this.currency} ${Te(((Ti=this.merchantDetail)==null?void 0:Ti.totalAmount)-yt,2)}`),E&&(kt=this.merchantDetail)!=null&&kt.taxQuoteId&&(_i=this.merchantDetail)!=null&&_i.totalAmount&&(E.classList.remove("hidden"),E.children[1].innerHTML=`${this.localCurrency!==this.currency?this.localCurrency:this.currency} ${Te(((Hn=this.merchantDetail)==null?void 0:Hn.totalAmount)-yt,2)}`);const dt=Ic[this.localCurrency];D&&this.localCurrency&&(D.innerHTML=dt?`${dt} (${this.localCurrency})`:this.localCurrency),F&&this.localCurrency&&(F.innerHTML=dt?`${dt} (${this.localCurrency})`:this.localCurrency),this.renderPaymentOptions(this.container),this.attachListeners()}renderPaymentOptions(e){var s,o;const n=e.querySelector(".payment-options"),i=Ht(this.currency,this.localCurrency);if(n){const a=this.merchantDetail.plan&&!((s=this.metadata)!=null&&s.subscription_id)?[ne.mobile_money,ne.card]:this.merchantDetail.paymentMethods.filter(c=>c!=="ussd").filter(c=>!(i!=="USD"&&c==="stablecoin")).map(c=>ne[c]);if(this.merchantDetail.plan&&!((o=this.metadata)!=null&&o.subscription_id)&&i==="NGN"&&a.splice(0,a.length,ne.card),this.isMobile){let c='<div class="">';a.forEach(l=>{c+=`
2103
2105
  <div key=${l.key}>
2104
2106
  <button class="tab-button gap-2 mb-4 group" data-name="${l.key}">
2105
2107
  <div class="lg:block">${l.icon}</div>
@@ -2325,7 +2327,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
2325
2327
  </div>
2326
2328
  </div>
2327
2329
  </div>
2328
- </div>`;class zc{constructor(e){d(this,"container");d(this,"onAction");d(this,"callBackUrl");d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"paymentMethod");this.container=e.container,this.onAction=e.onAction,this.callBackUrl=e.callBackUrl,this.paymentResponse=e.paymentResponse,this.paymentResponseHeaders=e.paymentResponseHeaders,this.paymentMethod=e.paymentMethod}attachListeners(){const e=this.container.querySelector(".details-form-button"),n=this.container.querySelector("#mobile-money-button-text"),i=this.container.querySelector("#long-processing-text"),s=this.container.querySelector("#confirmed-text");i&&(i.innerHTML=P["long-processing"]),s&&(s.innerHTML=P["once-confirmed"]),n&&(n.innerHTML=q["merchant-back"]),e&&e.addEventListener("click",()=>{var o;_.track("redirect_to_merchant",{payment_method:this.paymentMethod,status:(o=this.paymentResponse)==null?void 0:o.status}),Pe(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)})}renderComponent(){var e;this.container.innerHTML=this.render(),_.track("payment_timeout",{payment_method:this.paymentMethod,status:(e=this.paymentResponse)==null?void 0:e.status}),this.attachListeners()}render(){return jc}}class qc{constructor({container:e,merchantKey:n,localCurrency:i,metadata:s,callBackUrl:o,rdtCode:a,reference:c,onSuccess:l,url:m,customer:p,amount:y,totalAmount:b,token:g,currency:w,disablePaymentMethods:f,hidePaymentMethods:k,showPaymentMethods:x,onClose:A,restartTransactionProcess:M,retryingPayment:E,countryCode:D,planId:F}){d(this,"contents");d(this,"mobileMoneyForm");d(this,"mobileMoneyValidationForm");d(this,"onSuccess");d(this,"mobileMoneyConfirmation");d(this,"mobileMoneyConfirmationEnd");d(this,"transactionIssuesScreen");d(this,"container");d(this,"pageLoader");d(this,"mainLoader");d(this,"_currentStep");d(this,"successScreen");d(this,"customer");d(this,"activeRef");d(this,"warningScreen");d(this,"amount");d(this,"totalAmount");d(this,"url");d(this,"reference");d(this,"metadata");d(this,"currency");d(this,"localCurrency");d(this,"token");d(this,"callBackUrl");d(this,"rdtCode");d(this,"planId","");d(this,"merchantDetails");d(this,"onClose");d(this,"hidePaymentMethods");d(this,"showPaymentMethods");d(this,"disablePaymentMethods");d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"restartTransactionProcess");d(this,"retryingPayment");d(this,"isMaxRetriesReached");d(this,"isMobile",!1);d(this,"countryCode");d(this,"errorText");d(this,"otpMessage");this.container=e,this.onSuccess=l||(()=>null),this.token=g,this.currency=w,this.amount=y,this.totalAmount=b,this.contents=this.container.querySelector("#payment-content-view"),this._currentStep=1,this.activeRef="",this.token=n,this.customer=p,this.metadata=s,this.localCurrency=i,this.callBackUrl=o,this.localCurrency=i,this.rdtCode=a,this.url=m,this.reference=c,this.planId=F,this.merchantDetails={},this.disablePaymentMethods=f,this.hidePaymentMethods=k,this.showPaymentMethods=x,this.onClose=A,this.paymentResponse={},this.paymentResponseHeaders={},this.restartTransactionProcess=M,this.retryingPayment=E,this.isMaxRetriesReached=!1,this.countryCode=D,this.errorText="",this.otpMessage="",_.track("mobile_money_opens",{payment_method:"Mobile Money"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderMobileMoneyContent()}attachInputListeners(){}async createMobileMoney(e,n){e.stopPropagation(),e.preventDefault();const i=this.container.querySelector(".spinner"),s=this.container.querySelector("#mobile-money-button-text");i&&s&&(i.classList.remove("hidden"),s.classList.add("hidden"));const o=fn();(()=>{var c,l,m,p;if(this.retryingPayment){const y={channel:"mobile_money",reference:this.reference,mobileMoney:{code:n.code,phoneNumber:n.phoneNumber,...n.otp&&{otp:n.otp}}};return $t(this.token,y,this.rdtCode,this.url)}else{const y={amount:this.amount,channel:"mobile_money",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:{...this.metadata,...((c=this.merchantDetails)==null?void 0:c.subscription_id)&&{subscription_id:(l=this.merchantDetails)==null?void 0:l.subscription_id}},mobileMoney:{code:n.code,phoneNumber:n.phoneNumber,...n.otp&&{otp:n.otp}},...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((m=this.merchantDetails)==null?void 0:m.taxQuoteId)&&{taxQuoteId:(p=this.merchantDetails)==null?void 0:p.taxQuoteId},...this.countryCode&&{countryCode:this.countryCode},...this.planId&&{planId:this.planId},deviceInformation:o};return Na(this.token,y,this.rdtCode,this.url)}})().then(async({data:c,headers:l})=>{var m,p;if(this.paymentResponse=c,this.paymentResponseHeaders=l,c.providerMessage){const y=await z(c.providerMessage,H());this.errorText=y}if(c.status==="failed"){if(c.providerMessage){const y=await z(c.providerMessage,H());this.currentStep=5,this.warningScreen.setPaymentError(y),this.warningScreen.hideReportIssue()}else this.currentStep=5,this.warningScreen.setPaymentError(P["payment-failed"]),this.warningScreen.hideReportIssue();_.track("start_payment_failed",{payment_method:"Mobile Money",verification_status:"Failed",payment_error:c.providerMessage||"Payment failed"});return}else if(c.status==="success"||c.status==="successful"){this.currentStep=4,_.track("start_payment_success",{payment_method:"Mobile Money",verification_status:"Success"}),Pe(c,l,c==null?void 0:c.callBackUrl);return}else if(((m=c==null?void 0:c.authorization)==null?void 0:m.mode)==="otp"){this.activeRef=c.reference;const y=await z((p=this.paymentResponse)==null?void 0:p.providerMessage,H());this.otpMessage=y,this.currentStep=6;return}else this.currentStep=3}).catch(async c=>{if(_.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Null"}),c.code==="payment_max_retry_attempts")this.isMaxRetriesReached=!0,this.verifyPaymentProcess(),this.currentStep=5,this.warningScreen.setPaymentError(P["maximum-retries"],P["maximum-retries-desc"],q["merchant-back"]);else{const l=await z(c.message,H());this.errorText=l,c.message?(this.currentStep=5,this.warningScreen.setPaymentError(this.errorText)):(this.currentStep=5,this.warningScreen.setPaymentError(P["payment-failed"]))}this.warningScreen.hideReportIssue()}).finally(()=>{i&&s&&(i.classList.add("hidden"),s.classList.remove("hidden"))})}showLoader(){this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader()}submitOtp(e,n){e.preventDefault();const i=this.container.querySelector(".spinner"),s=this.container.querySelector("#mobile-money-button-text"),o={authorization:{otp:n},reference:this.activeRef};_.track("input_MobileMoneyOTP",{payment_method:"Mobile Money",authentication_type:"0TP"}),i&&s&&(i.classList.remove("hidden"),s.classList.add("hidden")),On(this.token,o,this.rdtCode,this.url).then(({data:c})=>{c.status==="failed"?(this.activeRef=c.reference,this.currentStep=3):["success","successful","failed"].includes(c.status)?["success","successful"].includes(c.status)&&(this.activeRef=c.reference,this.currentStep=3):(this.activeRef=c.reference,this.currentStep=3)}).catch(async c=>{_.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Failed",authentication_type:"OTP"});const l=this.container.querySelector("#otp-error");if(c.code==="invalid_otp"){if(l){const m=await z(c.message,H());l.innerHTML=m}_.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Failed",authentication_type:"OTP"})}else this.currentStep=3}).finally(()=>{i&&s&&(i.classList.add("hidden"),s.classList.remove("hidden"))})}async verifyPaymentProcess(){try{const e=await Xe(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers}catch{this.currentStep=5}}goBackToMerchant(){Pe(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}renderMobileMoneyContent(e){if(e&&(this.merchantDetails=e),this.currentStep===3&&this.disablePaymentMethods("mobile_money"),this.currentStep!==1){const n=document.getElementById("go-back");n&&(n.classList.remove("flex","items-center","gap-2","mb-2"),n.innerHTML="")}switch(this.currentStep===6?this.hidePaymentMethods():this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.currentStep){case 1:this.mobileMoneyForm=new Fc({container:this.contents,merchantKey:this.token,url:this.url,onAction:n=>i=>this.createMobileMoney.bind(this)(n,i),ref:this.activeRef,switchScreen:n=>{this.currentStep=n},rdtCode:this.rdtCode,currency:this.currency,localCurrency:this.localCurrency,amount:this.amount,totalAmount:this.totalAmount,restartTransactionProcess:this.restartTransactionProcess.bind(this),merchantDetails:this.merchantDetails,countryCode:this.countryCode||""}),this.mobileMoneyForm.renderContent();break;case 2:this.mainLoader=new ke(this.contents),this.mainLoader.mountLoader("25dvh"),this.mainLoader.updateMessage(Me["please-wait"]);break;case 3:this.mobileMoneyConfirmation=new Uc({container:this.contents,onAction:(n,i)=>{i&&n===5?(this.currentStep=5,this.warningScreen.setPaymentError(i),this.warningScreen.hideReportIssue()):this.currentStep=n},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(n,i)=>{this.paymentResponse=n,this.paymentResponseHeaders=i}}),this.mobileMoneyConfirmation.renderComponent();break;case 4:this.successScreen=new Vt({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:e==null?void 0:e.rate.rate}),this.successScreen.renderComponent();break;case 5:this.warningScreen=new et({container:this.contents,onReportIssue:()=>this.currentStep=9,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this)}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 6:this.mobileMoneyValidationForm=new Gc({container:this.contents,onClose:this.onClose,onAction:n=>i=>this.submitOtp.bind(this)(n,i),otpMessage:this.otpMessage||Me["enter-phone-otp"]}),this.mobileMoneyValidationForm.renderComponent();break;case 7:this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 8:this.mobileMoneyConfirmationEnd=new zc({container:this.contents,onAction:n=>{this.currentStep=n},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders,paymentMethod:"Mobile Money"}),this.mobileMoneyConfirmationEnd.renderComponent();break;case 9:this.transactionIssuesScreen=new sn({container:this.contents,onAction:()=>{var n;this.currentStep=5,this.warningScreen.setPaymentError(((n=this.paymentResponse)==null?void 0:n.providerMessage)||"Payment failed")},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"mobile_money",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break}this.attachInputListeners()}}const Zc=`<div id="eft-authenticate-container" data-section="eft">
2330
+ </div>`;class zc{constructor(e){d(this,"container");d(this,"onAction");d(this,"callBackUrl");d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"paymentMethod");this.container=e.container,this.onAction=e.onAction,this.callBackUrl=e.callBackUrl,this.paymentResponse=e.paymentResponse,this.paymentResponseHeaders=e.paymentResponseHeaders,this.paymentMethod=e.paymentMethod}attachListeners(){const e=this.container.querySelector(".details-form-button"),n=this.container.querySelector("#mobile-money-button-text"),i=this.container.querySelector("#long-processing-text"),s=this.container.querySelector("#confirmed-text");i&&(i.innerHTML=P["long-processing"]),s&&(s.innerHTML=P["once-confirmed"]),n&&(n.innerHTML=q["merchant-back"]),e&&e.addEventListener("click",()=>{var o;_.track("redirect_to_merchant",{payment_method:this.paymentMethod,status:(o=this.paymentResponse)==null?void 0:o.status}),Ie(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)})}renderComponent(){var e;this.container.innerHTML=this.render(),_.track("payment_timeout",{payment_method:this.paymentMethod,status:(e=this.paymentResponse)==null?void 0:e.status}),this.attachListeners()}render(){return jc}}class qc{constructor({container:e,merchantKey:n,localCurrency:i,metadata:s,callBackUrl:o,rdtCode:a,reference:c,onSuccess:l,url:m,customer:p,amount:y,totalAmount:b,token:g,currency:w,disablePaymentMethods:f,hidePaymentMethods:k,showPaymentMethods:x,onClose:A,restartTransactionProcess:M,retryingPayment:E,countryCode:D,planId:F}){d(this,"contents");d(this,"mobileMoneyForm");d(this,"mobileMoneyValidationForm");d(this,"onSuccess");d(this,"mobileMoneyConfirmation");d(this,"mobileMoneyConfirmationEnd");d(this,"transactionIssuesScreen");d(this,"container");d(this,"pageLoader");d(this,"mainLoader");d(this,"_currentStep");d(this,"successScreen");d(this,"customer");d(this,"activeRef");d(this,"warningScreen");d(this,"amount");d(this,"totalAmount");d(this,"url");d(this,"reference");d(this,"metadata");d(this,"currency");d(this,"localCurrency");d(this,"token");d(this,"callBackUrl");d(this,"rdtCode");d(this,"planId","");d(this,"merchantDetails");d(this,"onClose");d(this,"hidePaymentMethods");d(this,"showPaymentMethods");d(this,"disablePaymentMethods");d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"restartTransactionProcess");d(this,"retryingPayment");d(this,"isMaxRetriesReached");d(this,"isMobile",!1);d(this,"countryCode");d(this,"errorText");d(this,"otpMessage");this.container=e,this.onSuccess=l||(()=>null),this.token=g,this.currency=w,this.amount=y,this.totalAmount=b,this.contents=this.container.querySelector("#payment-content-view"),this._currentStep=1,this.activeRef="",this.token=n,this.customer=p,this.metadata=s,this.localCurrency=i,this.callBackUrl=o,this.localCurrency=i,this.rdtCode=a,this.url=m,this.reference=c,this.planId=F,this.merchantDetails={},this.disablePaymentMethods=f,this.hidePaymentMethods=k,this.showPaymentMethods=x,this.onClose=A,this.paymentResponse={},this.paymentResponseHeaders={},this.restartTransactionProcess=M,this.retryingPayment=E,this.isMaxRetriesReached=!1,this.countryCode=D,this.errorText="",this.otpMessage="",_.track("mobile_money_opens",{payment_method:"Mobile Money"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderMobileMoneyContent()}attachInputListeners(){}async createMobileMoney(e,n){e.stopPropagation(),e.preventDefault();const i=this.container.querySelector(".spinner"),s=this.container.querySelector("#mobile-money-button-text");i&&s&&(i.classList.remove("hidden"),s.classList.add("hidden"));const o=fn();(()=>{var c,l,m,p;if(this.retryingPayment){const y={channel:"mobile_money",reference:this.reference,mobileMoney:{code:n.code,phoneNumber:n.phoneNumber,...n.otp&&{otp:n.otp}}};return $t(this.token,y,this.rdtCode,this.url)}else{const y={amount:this.amount,channel:"mobile_money",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:{...this.metadata,...((c=this.merchantDetails)==null?void 0:c.subscription_id)&&{subscription_id:(l=this.merchantDetails)==null?void 0:l.subscription_id}},mobileMoney:{code:n.code,phoneNumber:n.phoneNumber,...n.otp&&{otp:n.otp}},...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((m=this.merchantDetails)==null?void 0:m.taxQuoteId)&&{taxQuoteId:(p=this.merchantDetails)==null?void 0:p.taxQuoteId},...this.countryCode&&{countryCode:this.countryCode},...this.planId&&{planId:this.planId},deviceInformation:o};return Na(this.token,y,this.rdtCode,this.url)}})().then(async({data:c,headers:l})=>{var m,p;if(this.paymentResponse=c,this.paymentResponseHeaders=l,c.providerMessage){const y=await z(c.providerMessage,H());this.errorText=y}if(c.status==="failed"){if(c.providerMessage){const y=await z(c.providerMessage,H());this.currentStep=5,this.warningScreen.setPaymentError(y),this.warningScreen.hideReportIssue()}else this.currentStep=5,this.warningScreen.setPaymentError(P["payment-failed"]),this.warningScreen.hideReportIssue();_.track("start_payment_failed",{payment_method:"Mobile Money",verification_status:"Failed",payment_error:c.providerMessage||"Payment failed"});return}else if(c.status==="success"||c.status==="successful"){this.currentStep=4,_.track("start_payment_success",{payment_method:"Mobile Money",verification_status:"Success"}),Ie(c,l,c==null?void 0:c.callBackUrl);return}else if(((m=c==null?void 0:c.authorization)==null?void 0:m.mode)==="otp"){this.activeRef=c.reference;const y=await z((p=this.paymentResponse)==null?void 0:p.providerMessage,H());this.otpMessage=y,this.currentStep=6;return}else this.currentStep=3}).catch(async c=>{if(_.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Null"}),c.code==="payment_max_retry_attempts")this.isMaxRetriesReached=!0,this.verifyPaymentProcess(),this.currentStep=5,this.warningScreen.setPaymentError(P["maximum-retries"],P["maximum-retries-desc"],q["merchant-back"]);else{const l=await z(c.message,H());this.errorText=l,c.message?(this.currentStep=5,this.warningScreen.setPaymentError(this.errorText)):(this.currentStep=5,this.warningScreen.setPaymentError(P["payment-failed"]))}this.warningScreen.hideReportIssue()}).finally(()=>{i&&s&&(i.classList.add("hidden"),s.classList.remove("hidden"))})}showLoader(){this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader()}submitOtp(e,n){e.preventDefault();const i=this.container.querySelector(".spinner"),s=this.container.querySelector("#mobile-money-button-text"),o={authorization:{otp:n},reference:this.activeRef};_.track("input_MobileMoneyOTP",{payment_method:"Mobile Money",authentication_type:"0TP"}),i&&s&&(i.classList.remove("hidden"),s.classList.add("hidden")),On(this.token,o,this.rdtCode,this.url).then(({data:c})=>{c.status==="failed"?(this.activeRef=c.reference,this.currentStep=3):["success","successful","failed"].includes(c.status)?["success","successful"].includes(c.status)&&(this.activeRef=c.reference,this.currentStep=3):(this.activeRef=c.reference,this.currentStep=3)}).catch(async c=>{_.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Failed",authentication_type:"OTP"});const l=this.container.querySelector("#otp-error");if(c.code==="invalid_otp"){if(l){const m=await z(c.message,H());l.innerHTML=m}_.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Failed",authentication_type:"OTP"})}else this.currentStep=3}).finally(()=>{i&&s&&(i.classList.add("hidden"),s.classList.remove("hidden"))})}async verifyPaymentProcess(){try{const e=await Xe(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers}catch{this.currentStep=5}}goBackToMerchant(){Ie(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}renderMobileMoneyContent(e){if(e&&(this.merchantDetails=e),this.currentStep===3&&this.disablePaymentMethods("mobile_money"),this.currentStep!==1){const n=document.getElementById("go-back");n&&(n.classList.remove("flex","items-center","gap-2","mb-2"),n.innerHTML="")}switch(this.currentStep===6?this.hidePaymentMethods():this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.currentStep){case 1:this.mobileMoneyForm=new Fc({container:this.contents,merchantKey:this.token,url:this.url,onAction:n=>i=>this.createMobileMoney.bind(this)(n,i),ref:this.activeRef,switchScreen:n=>{this.currentStep=n},rdtCode:this.rdtCode,currency:this.currency,localCurrency:this.localCurrency,amount:this.amount,totalAmount:this.totalAmount,restartTransactionProcess:this.restartTransactionProcess.bind(this),merchantDetails:this.merchantDetails,countryCode:this.countryCode||""}),this.mobileMoneyForm.renderContent();break;case 2:this.mainLoader=new ke(this.contents),this.mainLoader.mountLoader("25dvh"),this.mainLoader.updateMessage(Me["please-wait"]);break;case 3:this.mobileMoneyConfirmation=new Uc({container:this.contents,onAction:(n,i)=>{i&&n===5?(this.currentStep=5,this.warningScreen.setPaymentError(i),this.warningScreen.hideReportIssue()):this.currentStep=n},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(n,i)=>{this.paymentResponse=n,this.paymentResponseHeaders=i}}),this.mobileMoneyConfirmation.renderComponent();break;case 4:this.successScreen=new Vt({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:e==null?void 0:e.rate.rate}),this.successScreen.renderComponent();break;case 5:this.warningScreen=new et({container:this.contents,onReportIssue:()=>this.currentStep=9,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this)}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 6:this.mobileMoneyValidationForm=new Gc({container:this.contents,onClose:this.onClose,onAction:n=>i=>this.submitOtp.bind(this)(n,i),otpMessage:this.otpMessage||Me["enter-phone-otp"]}),this.mobileMoneyValidationForm.renderComponent();break;case 7:this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 8:this.mobileMoneyConfirmationEnd=new zc({container:this.contents,onAction:n=>{this.currentStep=n},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders,paymentMethod:"Mobile Money"}),this.mobileMoneyConfirmationEnd.renderComponent();break;case 9:this.transactionIssuesScreen=new sn({container:this.contents,onAction:()=>{var n;this.currentStep=5,this.warningScreen.setPaymentError(((n=this.paymentResponse)==null?void 0:n.providerMessage)||"Payment failed")},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"mobile_money",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break}this.attachInputListeners()}}const Zc=`<div id="eft-authenticate-container" data-section="eft">
2329
2331
  <div class="pt-3">
2330
2332
  <div class="container-center">
2331
2333
  <svg width="98" height="32" viewBox="0 0 98 32" fill="none" xmlns="http://www.w3.org/2000/svg"
@@ -2358,7 +2360,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
2358
2360
  </div>
2359
2361
  </div>
2360
2362
 
2361
- </div>`;class va{constructor(e){d(this,"container");d(this,"payment");d(this,"warningError");d(this,"pageLoader");d(this,"onAction");d(this,"restartTransactionProcess");this.container=e.container,this.onAction=e.onAction,this.restartTransactionProcess=e.restartTransactionProcess,this.warningError=new et({container:this.container,onAction:this.restartTransactionProcess.bind(this)})}attachListener(){const e=this.container.querySelector("#authenticate-btn"),n=this.container.querySelector("#authenticate-request-text"),i=this.container.querySelector("#authenticate-button-text");n&&(n.innerHTML=Mt["authenticate-request"]),i&&(i.innerHTML=Mt.authenticate),e&&e.addEventListener("click",()=>{this.onAction(),_.track("start_payment",{payment_method:"EFT"})})}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return Zc}}class Wc{constructor({amount:e,totalAmount:n,container:i,customer:s,token:o,currency:a,rdtCode:c,url:l,reference:m,callBackUrl:p,metadata:y,localCurrency:b,hidePaymentMethods:g,showPaymentMethods:w,restartTransactionProcess:f,retryingPayment:k}){d(this,"contents");d(this,"eftAuthenticate");d(this,"successScreen");d(this,"pageLoader");d(this,"warningScreen");d(this,"transactionIssuesScreen");d(this,"container");d(this,"customer");d(this,"token");d(this,"amount");d(this,"totalAmount");d(this,"currency");d(this,"_currentStep");d(this,"rdtCode");d(this,"url");d(this,"reference");d(this,"callBackUrl");d(this,"metadata");d(this,"localCurrency");d(this,"hidePaymentMethods");d(this,"showPaymentMethods");d(this,"merchantPlanDetail",{});d(this,"restartTransactionProcess");d(this,"retryingPayment");d(this,"isMaxRetriesReached");d(this,"isMobile",!1);d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"errorText");this.currency=a,this.container=i,this.token=o,this.customer=s,this.amount=e,this.totalAmount=n,this.rdtCode=c,this.url=l,this.reference=m,this.callBackUrl=p,this.metadata=y,this.localCurrency=b,this._currentStep=1,this.contents=this.container.querySelector("#payment-content-view"),this.hidePaymentMethods=g,this.showPaymentMethods=w,this.restartTransactionProcess=f,this.retryingPayment=k,this.isMaxRetriesReached=!1,this.paymentResponse={},this.paymentResponseHeaders={},this.errorText="",this.renderEftContent(),_.track("eft_opens",{payment_method:"EFT"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderEftContent()}showLoader(){this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage(P["verify-payment"])}goBackToMerchant(){Pe(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}async createEftPayment(){const e=this.container.querySelector(".spinner"),n=this.container.querySelector("#authenticate-button-text");e&&n&&(e.classList.remove("hidden"),n.classList.add("hidden"));const i=fn();(()=>{var o,a;if(this.retryingPayment){const c={channel:"eft",reference:this.reference};return $t(this.token,c,this.rdtCode,this.url)}else{const c={amount:this.amount,channel:"eft",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((o=this.merchantPlanDetail)==null?void 0:o.taxQuoteId)&&{taxQuoteId:(a=this.merchantPlanDetail)==null?void 0:a.taxQuoteId},deviceInformation:i};return Hi(this.token,c,this.rdtCode,this.url)}})().then(async({data:o,headers:a})=>{var c,l,m;if(this.paymentResponse=o,this.paymentResponseHeaders=a,o.providerMessage){const p=await z(o.providerMessage,H());this.errorText=p}if(o.status==="failed"){this.currentStep=4,o.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(P["payment-failed"]),_.track("start_payment",{payment_method:"EFT",verification_status:"Failed"});return}else if(((c=o==null?void 0:o.authorization)==null?void 0:c.mode)==="redirect"){(l=o==null?void 0:o.authorization)!=null&&l.redirectUrl&&this.redirectToOzow((m=o==null?void 0:o.authorization)==null?void 0:m.redirectUrl);return}else this.currentStep=4,o!=null&&o.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(Mt["unable-redirect-url"])}).catch(async o=>{if(o.code==="payment_max_retry_attempts")this.isMaxRetriesReached=!0,this.verifyPaymentProcess(),this.currentStep=4,this.warningScreen.setPaymentError(P["maximum-retries"],P["maximum-retries-desc"],q["merchant-back"]);else if(o.message){const a=await z(o.message,H());this.errorText=a,this.currentStep=4,this.warningScreen.setPaymentError(this.errorText)}else this.currentStep=4,this.warningScreen.setPaymentError(q["payment-failed"])}).finally(()=>{e&&n&&(e.classList.add("hidden"),n.classList.remove("hidden"))})}redirectToOzow(e){const n=window.open(e,"_blank");if(n){_.track("auth_redirect",{payment_method:"EFT",authentication_type:"Redirect",verification_status:"In Progress"}),this.currentStep=3,this.showLoader();const i=setInterval(()=>{n.closed&&(clearInterval(i),this.verifyPaymentProcess())},2e3)}}async verifyPaymentProcess(){try{const e=await Xe(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers;const n=this.paymentResponse.status;if(n==="successful")this.currentStep=2,_.track("verify_payment",{payment_method:"EFT",verification_status:"Success"}),Pe(this.paymentResponse,this.paymentResponseHeaders,"success");else if(n==="failed"){if(this.paymentResponse.providerMessage){const i=await z(this.paymentResponse.providerMessage,H());this.errorText=i}this.currentStep=4,_.track("verify_payment",{payment_method:"EFT",verification_status:"Failed"}),this.paymentResponse.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(q["payment-failed"])}else n==="cancelled"&&(this.isMaxRetriesReached=!0,this.currentStep=4,this.warningScreen.setPaymentError(Mt["payment-cancelled"],Mt["cancel-payment-desc"],q["merchant-back"]))}catch{this.currentStep=4,this.warningScreen.setPaymentError(q["payment-failed"])}}renderEftContent(e){var i;e&&(this.merchantPlanDetail=e);const n=document.getElementById("go-back");if(this.currentStep!==1?(this.hidePaymentMethods(),n==null||n.classList.add("hidden")):this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.contents)switch(this.currentStep){case 1:this.eftAuthenticate=new va({container:this.contents,onAction:this.createEftPayment.bind(this),restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.eftAuthenticate.renderComponent();break;case 2:this.successScreen=new Vt({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(i=this.merchantPlanDetail)==null?void 0:i.rate.rate}),this.successScreen.renderComponent();break;case 3:this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage(P["verify-payment"]);break;case 4:this.warningScreen=new et({container:this.contents,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this),onReportIssue:()=>this.currentStep=5}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 5:this.transactionIssuesScreen=new sn({container:this.contents,onAction:async()=>{var s,o;if((s=this.paymentResponse)!=null&&s.providerMessage){const a=await z((o=this.paymentResponse)==null?void 0:o.providerMessage,H());this.errorText=a}this.currentStep=4,this.warningScreen.setPaymentError(this.errorText||P["payment-failed"])},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"eft",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break;default:this.eftAuthenticate=new va({container:this.contents,onAction:this.createEftPayment.bind(this),restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.eftAuthenticate.renderComponent();break}}}const Qc=`<form id="stablecoins-form" data-section="stablecoin">
2363
+ </div>`;class va{constructor(e){d(this,"container");d(this,"payment");d(this,"warningError");d(this,"pageLoader");d(this,"onAction");d(this,"restartTransactionProcess");this.container=e.container,this.onAction=e.onAction,this.restartTransactionProcess=e.restartTransactionProcess,this.warningError=new et({container:this.container,onAction:this.restartTransactionProcess.bind(this)})}attachListener(){const e=this.container.querySelector("#authenticate-btn"),n=this.container.querySelector("#authenticate-request-text"),i=this.container.querySelector("#authenticate-button-text");n&&(n.innerHTML=Mt["authenticate-request"]),i&&(i.innerHTML=Mt.authenticate),e&&e.addEventListener("click",()=>{this.onAction(),_.track("start_payment",{payment_method:"EFT"})})}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return Zc}}class Wc{constructor({amount:e,totalAmount:n,container:i,customer:s,token:o,currency:a,rdtCode:c,url:l,reference:m,callBackUrl:p,metadata:y,localCurrency:b,hidePaymentMethods:g,showPaymentMethods:w,restartTransactionProcess:f,retryingPayment:k}){d(this,"contents");d(this,"eftAuthenticate");d(this,"successScreen");d(this,"pageLoader");d(this,"warningScreen");d(this,"transactionIssuesScreen");d(this,"container");d(this,"customer");d(this,"token");d(this,"amount");d(this,"totalAmount");d(this,"currency");d(this,"_currentStep");d(this,"rdtCode");d(this,"url");d(this,"reference");d(this,"callBackUrl");d(this,"metadata");d(this,"localCurrency");d(this,"hidePaymentMethods");d(this,"showPaymentMethods");d(this,"merchantPlanDetail",{});d(this,"restartTransactionProcess");d(this,"retryingPayment");d(this,"isMaxRetriesReached");d(this,"isMobile",!1);d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"errorText");this.currency=a,this.container=i,this.token=o,this.customer=s,this.amount=e,this.totalAmount=n,this.rdtCode=c,this.url=l,this.reference=m,this.callBackUrl=p,this.metadata=y,this.localCurrency=b,this._currentStep=1,this.contents=this.container.querySelector("#payment-content-view"),this.hidePaymentMethods=g,this.showPaymentMethods=w,this.restartTransactionProcess=f,this.retryingPayment=k,this.isMaxRetriesReached=!1,this.paymentResponse={},this.paymentResponseHeaders={},this.errorText="",this.renderEftContent(),_.track("eft_opens",{payment_method:"EFT"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderEftContent()}showLoader(){this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage(P["verify-payment"])}goBackToMerchant(){Ie(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}async createEftPayment(){const e=this.container.querySelector(".spinner"),n=this.container.querySelector("#authenticate-button-text");e&&n&&(e.classList.remove("hidden"),n.classList.add("hidden"));const i=fn();(()=>{var o,a;if(this.retryingPayment){const c={channel:"eft",reference:this.reference};return $t(this.token,c,this.rdtCode,this.url)}else{const c={amount:this.amount,channel:"eft",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((o=this.merchantPlanDetail)==null?void 0:o.taxQuoteId)&&{taxQuoteId:(a=this.merchantPlanDetail)==null?void 0:a.taxQuoteId},deviceInformation:i};return Hi(this.token,c,this.rdtCode,this.url)}})().then(async({data:o,headers:a})=>{var c,l,m;if(this.paymentResponse=o,this.paymentResponseHeaders=a,o.providerMessage){const p=await z(o.providerMessage,H());this.errorText=p}if(o.status==="failed"){this.currentStep=4,o.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(P["payment-failed"]),_.track("start_payment",{payment_method:"EFT",verification_status:"Failed"});return}else if(((c=o==null?void 0:o.authorization)==null?void 0:c.mode)==="redirect"){(l=o==null?void 0:o.authorization)!=null&&l.redirectUrl&&this.redirectToOzow((m=o==null?void 0:o.authorization)==null?void 0:m.redirectUrl);return}else this.currentStep=4,o!=null&&o.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(Mt["unable-redirect-url"])}).catch(async o=>{if(o.code==="payment_max_retry_attempts")this.isMaxRetriesReached=!0,this.verifyPaymentProcess(),this.currentStep=4,this.warningScreen.setPaymentError(P["maximum-retries"],P["maximum-retries-desc"],q["merchant-back"]);else if(o.message){const a=await z(o.message,H());this.errorText=a,this.currentStep=4,this.warningScreen.setPaymentError(this.errorText)}else this.currentStep=4,this.warningScreen.setPaymentError(q["payment-failed"])}).finally(()=>{e&&n&&(e.classList.add("hidden"),n.classList.remove("hidden"))})}redirectToOzow(e){const n=window.open(e,"_blank");if(n){_.track("auth_redirect",{payment_method:"EFT",authentication_type:"Redirect",verification_status:"In Progress"}),this.currentStep=3,this.showLoader();const i=setInterval(()=>{n.closed&&(clearInterval(i),this.verifyPaymentProcess())},2e3)}}async verifyPaymentProcess(){try{const e=await Xe(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers;const n=this.paymentResponse.status;if(n==="successful")this.currentStep=2,_.track("verify_payment",{payment_method:"EFT",verification_status:"Success"}),Ie(this.paymentResponse,this.paymentResponseHeaders,"success");else if(n==="failed"){if(this.paymentResponse.providerMessage){const i=await z(this.paymentResponse.providerMessage,H());this.errorText=i}this.currentStep=4,_.track("verify_payment",{payment_method:"EFT",verification_status:"Failed"}),this.paymentResponse.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(q["payment-failed"])}else n==="cancelled"&&(this.isMaxRetriesReached=!0,this.currentStep=4,this.warningScreen.setPaymentError(Mt["payment-cancelled"],Mt["cancel-payment-desc"],q["merchant-back"]))}catch{this.currentStep=4,this.warningScreen.setPaymentError(q["payment-failed"])}}renderEftContent(e){var i;e&&(this.merchantPlanDetail=e);const n=document.getElementById("go-back");if(this.currentStep!==1?(this.hidePaymentMethods(),n==null||n.classList.add("hidden")):this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.contents)switch(this.currentStep){case 1:this.eftAuthenticate=new va({container:this.contents,onAction:this.createEftPayment.bind(this),restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.eftAuthenticate.renderComponent();break;case 2:this.successScreen=new Vt({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(i=this.merchantPlanDetail)==null?void 0:i.rate.rate}),this.successScreen.renderComponent();break;case 3:this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage(P["verify-payment"]);break;case 4:this.warningScreen=new et({container:this.contents,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this),onReportIssue:()=>this.currentStep=5}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 5:this.transactionIssuesScreen=new sn({container:this.contents,onAction:async()=>{var s,o;if((s=this.paymentResponse)!=null&&s.providerMessage){const a=await z((o=this.paymentResponse)==null?void 0:o.providerMessage,H());this.errorText=a}this.currentStep=4,this.warningScreen.setPaymentError(this.errorText||P["payment-failed"])},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"eft",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break;default:this.eftAuthenticate=new va({container:this.contents,onAction:this.createEftPayment.bind(this),restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.eftAuthenticate.renderComponent();break}}}const Qc=`<form id="stablecoins-form" data-section="stablecoin">
2362
2364
  <div class="mt-2 flex flex-col gap-4">
2363
2365
  <div class="relative bank-select-relative">
2364
2366
  <div class="relative w-full">
@@ -2438,7 +2440,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
2438
2440
  </button>
2439
2441
  </div>
2440
2442
  </div>
2441
- `;const A=l.querySelector("#confirm-payment-btn"),M=l.querySelector("#wallet-address");M&&(M.textContent=Fe["copy-text"]),A&&(A.textContent=Fe["payment-confirmation"]),A==null||A.addEventListener("click",async()=>{await this.onVerify()}),M==null||M.addEventListener("click",()=>{this.copyToClipboard(k,M)})}else l.innerHTML=""};i.addEventListener("change",p),s.addEventListener("change",p)}async createStablecoinPayment(e){const n=this.container.querySelector(".spinner"),i=this.container.querySelector("#confirm-payment-btn"),s=i?i.querySelector(".text"):null;n&&s&&(n.classList.remove("hidden"),s.classList.add("hidden"));const o=fn();return(()=>{var c,l;if(this.retryingPayment){const m={channel:"stablecoin",reference:this.reference,stablecoin:{asset:e.asset,chain:e.chain}};return $t(this.token,m,this.rdtCode,this.url)}else{const m={amount:this.amount,channel:"stablecoin",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,isCheckout:!0,...this.localCurrency&&{localCurrency:this.localCurrency},deviceInformation:o,...((c=this.merchantPlanDetail)==null?void 0:c.taxQuoteId)&&{taxQuoteId:(l=this.merchantPlanDetail)==null?void 0:l.taxQuoteId},stablecoin:{asset:e.asset,chain:e.chain}};return Oa(this.token,m,this.rdtCode,this.url)}})().then(async({data:c,headers:l})=>{var m;if(this.paymentResponse=c,c.status==="failed"){if((m=this.onStepChange)==null||m.call(this,4),c.providerMessage){const p=await z(c.providerMessage,wn.language);this.errorText=p,this.warningScreen.setPaymentError(this.errorText)}else this.warningScreen.setPaymentError(P["payment-failed"]);_.track("start_payment",{payment_method:"Stablecoins",verification_status:"Failed"});return}else if(c.status==="success")this.currentStep=2,_.track("start_payment_success",{payment_method:"Mobile Money",verification_status:"Success"}),Pe(c,l,c==null?void 0:c.callBackUrl);else return}).catch(async c=>{var l,m;if(_.track("verify_payment",{payment_method:"Stablecoins",verification_status:"Null"}),c.code==="payment_max_retry_attempts")this.isMaxRetriesReached=!0,(l=this.onStepChange)==null||l.call(this,4),this.warningScreen.setPaymentError(P["maximum-retries"],P["maximum-retries-desc"],q["merchant-back"]);else if((m=this.onStepChange)==null||m.call(this,4),c.message){const p=await z(c.message,wn==null?void 0:wn.language);this.errorText=p,this.warningScreen.setPaymentError(this.errorText)}else this.warningScreen.setPaymentError(P["payment-failed"]);this.warningScreen.hideReportIssue()}).finally(()=>{n&&s&&(n.classList.add("hidden"),s.classList.remove("hidden"))})}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return Qc}}const Yc=`<div id="stablecoinConfirmationProgress" data-section="stablecoin">
2443
+ `;const A=l.querySelector("#confirm-payment-btn"),M=l.querySelector("#wallet-address");M&&(M.textContent=Fe["copy-text"]),A&&(A.textContent=Fe["payment-confirmation"]),A==null||A.addEventListener("click",async()=>{await this.onVerify()}),M==null||M.addEventListener("click",()=>{this.copyToClipboard(k,M)})}else l.innerHTML=""};i.addEventListener("change",p),s.addEventListener("change",p)}async createStablecoinPayment(e){const n=this.container.querySelector(".spinner"),i=this.container.querySelector("#confirm-payment-btn"),s=i?i.querySelector(".text"):null;n&&s&&(n.classList.remove("hidden"),s.classList.add("hidden"));const o=fn();return(()=>{var c,l;if(this.retryingPayment){const m={channel:"stablecoin",reference:this.reference,stablecoin:{asset:e.asset,chain:e.chain}};return $t(this.token,m,this.rdtCode,this.url)}else{const m={amount:this.amount,channel:"stablecoin",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,isCheckout:!0,...this.localCurrency&&{localCurrency:this.localCurrency},deviceInformation:o,...((c=this.merchantPlanDetail)==null?void 0:c.taxQuoteId)&&{taxQuoteId:(l=this.merchantPlanDetail)==null?void 0:l.taxQuoteId},stablecoin:{asset:e.asset,chain:e.chain}};return Oa(this.token,m,this.rdtCode,this.url)}})().then(async({data:c,headers:l})=>{var m;if(this.paymentResponse=c,c.status==="failed"){if((m=this.onStepChange)==null||m.call(this,4),c.providerMessage){const p=await z(c.providerMessage,wn.language);this.errorText=p,this.warningScreen.setPaymentError(this.errorText)}else this.warningScreen.setPaymentError(P["payment-failed"]);_.track("start_payment",{payment_method:"Stablecoins",verification_status:"Failed"});return}else if(c.status==="success")this.currentStep=2,_.track("start_payment_success",{payment_method:"Mobile Money",verification_status:"Success"}),Ie(c,l,c==null?void 0:c.callBackUrl);else return}).catch(async c=>{var l,m;if(_.track("verify_payment",{payment_method:"Stablecoins",verification_status:"Null"}),c.code==="payment_max_retry_attempts")this.isMaxRetriesReached=!0,(l=this.onStepChange)==null||l.call(this,4),this.warningScreen.setPaymentError(P["maximum-retries"],P["maximum-retries-desc"],q["merchant-back"]);else if((m=this.onStepChange)==null||m.call(this,4),c.message){const p=await z(c.message,wn==null?void 0:wn.language);this.errorText=p,this.warningScreen.setPaymentError(this.errorText)}else this.warningScreen.setPaymentError(P["payment-failed"]);this.warningScreen.hideReportIssue()}).finally(()=>{n&&s&&(n.classList.add("hidden"),s.classList.remove("hidden"))})}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return Qc}}const Yc=`<div id="stablecoinConfirmationProgress" data-section="stablecoin">
2442
2444
  <div>
2443
2445
  <div>
2444
2446
  <div class=" grid grid-rows-[auto_1fr] gap-4 mx-5">
@@ -2505,7 +2507,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
2505
2507
  </div>
2506
2508
  </div>
2507
2509
  </div>
2508
- </div>`;class ed{constructor(e){d(this,"container");d(this,"onAction");d(this,"callBackUrl");d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"paymentMethod");this.container=e.container,this.onAction=e.onAction,this.callBackUrl=e.callBackUrl,this.paymentResponse=e.paymentResponse,this.paymentResponseHeaders=e.paymentResponseHeaders,this.paymentMethod=e.paymentMethod}attachListeners(){const e=this.container.querySelector(".details-form-button");e&&e.addEventListener("click",()=>{var n;_.track("redirect_to_merchant",{payment_method:this.paymentMethod,status:(n=this.paymentResponse)==null?void 0:n.status}),Pe(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)})}renderComponent(){var e;this.container.innerHTML=this.render(),_.track("payment_timeout",{payment_method:this.paymentMethod,status:(e=this.paymentResponse)==null?void 0:e.status}),this.attachListeners()}render(){return $c}}class td{constructor({container:e,restartTransactionProcess:n,amount:i,currency:s,customer:o,callBackUrl:a,metadata:c,reference:l,rdtCode:m,url:p,token:y,retryingPayment:b,totalAmount:g,localCurrency:w,onSuccess:f}){d(this,"contents");d(this,"container");d(this,"stableCoinsForm");d(this,"successScreen");d(this,"stablecoinConfirmationEnd");d(this,"pageLoader");d(this,"onSuccess");d(this,"restartTransactionProcess");d(this,"stablecoinsConfirmationProgress");d(this,"_currentStep");d(this,"customer");d(this,"totalAmount");d(this,"amount");d(this,"currency");d(this,"rdtCode");d(this,"url");d(this,"reference");d(this,"callBackUrl");d(this,"metadata");d(this,"retryingPayment");d(this,"warningScreen");d(this,"transactionIssuesScreen");d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"isMaxRetriesReached");d(this,"token");d(this,"localCurrency");d(this,"errorText");this.token=y,this.amount=i,this.totalAmount=g,this.currency=s,this.customer=o,this.rdtCode=m,this.url=p,this.reference=l,this.callBackUrl=a,this.metadata=c,this.retryingPayment=b,this.container=e,this.restartTransactionProcess=n,this.isMaxRetriesReached=!1,this.localCurrency=w,this.paymentResponseHeaders={},this.paymentResponse={},this.contents=this.container.querySelector("#payment-content-view"),this._currentStep=1,this.onSuccess=f||(()=>null),this.errorText=""}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderStablecoinsContent()}showLoader(){this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage(P["verify-payment"])}setPaymentError(e){const n=this.container.querySelector("#payment-warning-text");n&&(n.textContent=e)}goBackToMerchant(){Pe(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}async verifyPaymentProcess(){try{const e=await Xe(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers;const n=this.paymentResponse.status;n==="successful"?(this.currentStep=2,_.track("verify_payment",{payment_method:"Stablecoins",verification_status:"Success"}),Pe(this.paymentResponse,this.paymentResponseHeaders,"success")):n==="failed"?(this.currentStep=4,_.track("verify_payment",{payment_method:"Stablecoins",verification_status:"Failed"}),this.paymentResponse.providerMessage?this.warningScreen.setPaymentError(this.paymentResponse.providerMessage):this.warningScreen.setPaymentError("Payment failed")):n==="cancelled"&&(this.isMaxRetriesReached=!0,this.currentStep=4,this.warningScreen.setPaymentError("Payment Cancelled","You have cancelled the payment. Go back to merchant website to start the payment process again.","Go back to Merchant"))}catch{this.currentStep=4,this.warningScreen.setPaymentError("Payment failed")}}renderStablecoinsContent(e){var n;if(this.contents)switch(this.currentStep){case 1:this.stableCoinsForm=new ba({container:this.contents,onAction:()=>{},paymentResponse:this.paymentResponse,restartTransactionProcess:this.restartTransactionProcess.bind(this),merchantKey:this.token,rdtCode:this.rdtCode,url:this.url,amount:this.amount,currency:this.currency,onVerify:async()=>{this.currentStep=6,await this.verifyPaymentProcess()},callBackUrl:this.callBackUrl,customer:this.customer,metadata:this.metadata,reference:this.reference,retryingPayment:this.retryingPayment,token:this.token,totalAmount:this.totalAmount,localCurrency:this.localCurrency,onStepChange:i=>{this.currentStep=i}}),this.stableCoinsForm.renderComponent();break;case 2:this.successScreen=new Vt({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency}),this.successScreen.renderComponent();break;case 3:this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage(P["verify-payment"]);break;case 4:this.warningScreen=new et({container:this.contents,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this),onReportIssue:()=>this._currentStep=7}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.setPaymentError(((n=this.paymentResponse)==null?void 0:n.providerMessage)||P["payment-failed"],this.errorText,this.isMaxRetriesReached?P["merchant-back"]:P["try-again"]),this.warningScreen.attachListener();break;case 5:this.transactionIssuesScreen=new sn({container:this.contents,onAction:()=>{var i;this.currentStep=4,this.warningScreen.setPaymentError(((i=this.paymentResponse)==null?void 0:i.providerMessage)||P["payment-failed"])},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"stablecoin",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break;case 6:this.stablecoinsConfirmationProgress=new Xc({container:this.contents,callBackUrl:this.callBackUrl,setPaymentResponses:(i,s)=>{this.paymentResponse=i,this.paymentResponseHeaders=s},token:this.token,onAction:i=>{this.currentStep=i},ref:this.reference,onSuccess:()=>{this.currentStep=2,setTimeout(()=>{Pe(this.paymentResponse,this.paymentResponseHeaders,"success")},2500)}}),this.stablecoinsConfirmationProgress.renderComponent();break;case 7:this.stablecoinConfirmationEnd=new ed({container:this.contents,onAction:i=>{this.currentStep=i},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders,paymentMethod:"Stablecoins"}),this.stablecoinConfirmationEnd.renderComponent();break;default:this.stableCoinsForm=new ba({container:this.contents,onAction:()=>{},restartTransactionProcess:this.restartTransactionProcess.bind(this),merchantKey:this.token,rdtCode:this.rdtCode,url:this.url,amount:this.amount,currency:this.currency,onVerify:this.verifyPaymentProcess.bind(this),paymentResponse:this.paymentResponse,callBackUrl:this.callBackUrl,customer:this.customer,metadata:this.metadata,reference:this.reference,retryingPayment:this.retryingPayment,token:this.token,totalAmount:this.totalAmount,localCurrency:this.localCurrency}),this.stableCoinsForm.renderComponent();break}}}const nd=`<div id="eft-authenticate-container" data-section="opay">
2510
+ </div>`;class ed{constructor(e){d(this,"container");d(this,"onAction");d(this,"callBackUrl");d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"paymentMethod");this.container=e.container,this.onAction=e.onAction,this.callBackUrl=e.callBackUrl,this.paymentResponse=e.paymentResponse,this.paymentResponseHeaders=e.paymentResponseHeaders,this.paymentMethod=e.paymentMethod}attachListeners(){const e=this.container.querySelector(".details-form-button");e&&e.addEventListener("click",()=>{var n;_.track("redirect_to_merchant",{payment_method:this.paymentMethod,status:(n=this.paymentResponse)==null?void 0:n.status}),Ie(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)})}renderComponent(){var e;this.container.innerHTML=this.render(),_.track("payment_timeout",{payment_method:this.paymentMethod,status:(e=this.paymentResponse)==null?void 0:e.status}),this.attachListeners()}render(){return $c}}class td{constructor({container:e,restartTransactionProcess:n,amount:i,currency:s,customer:o,callBackUrl:a,metadata:c,reference:l,rdtCode:m,url:p,token:y,retryingPayment:b,totalAmount:g,localCurrency:w,onSuccess:f}){d(this,"contents");d(this,"container");d(this,"stableCoinsForm");d(this,"successScreen");d(this,"stablecoinConfirmationEnd");d(this,"pageLoader");d(this,"onSuccess");d(this,"restartTransactionProcess");d(this,"stablecoinsConfirmationProgress");d(this,"_currentStep");d(this,"customer");d(this,"totalAmount");d(this,"amount");d(this,"currency");d(this,"rdtCode");d(this,"url");d(this,"reference");d(this,"callBackUrl");d(this,"metadata");d(this,"retryingPayment");d(this,"warningScreen");d(this,"transactionIssuesScreen");d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"isMaxRetriesReached");d(this,"token");d(this,"localCurrency");d(this,"errorText");this.token=y,this.amount=i,this.totalAmount=g,this.currency=s,this.customer=o,this.rdtCode=m,this.url=p,this.reference=l,this.callBackUrl=a,this.metadata=c,this.retryingPayment=b,this.container=e,this.restartTransactionProcess=n,this.isMaxRetriesReached=!1,this.localCurrency=w,this.paymentResponseHeaders={},this.paymentResponse={},this.contents=this.container.querySelector("#payment-content-view"),this._currentStep=1,this.onSuccess=f||(()=>null),this.errorText=""}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderStablecoinsContent()}showLoader(){this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage(P["verify-payment"])}setPaymentError(e){const n=this.container.querySelector("#payment-warning-text");n&&(n.textContent=e)}goBackToMerchant(){Ie(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}async verifyPaymentProcess(){try{const e=await Xe(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers;const n=this.paymentResponse.status;n==="successful"?(this.currentStep=2,_.track("verify_payment",{payment_method:"Stablecoins",verification_status:"Success"}),Ie(this.paymentResponse,this.paymentResponseHeaders,"success")):n==="failed"?(this.currentStep=4,_.track("verify_payment",{payment_method:"Stablecoins",verification_status:"Failed"}),this.paymentResponse.providerMessage?this.warningScreen.setPaymentError(this.paymentResponse.providerMessage):this.warningScreen.setPaymentError("Payment failed")):n==="cancelled"&&(this.isMaxRetriesReached=!0,this.currentStep=4,this.warningScreen.setPaymentError("Payment Cancelled","You have cancelled the payment. Go back to merchant website to start the payment process again.","Go back to Merchant"))}catch{this.currentStep=4,this.warningScreen.setPaymentError("Payment failed")}}renderStablecoinsContent(e){var n;if(this.contents)switch(this.currentStep){case 1:this.stableCoinsForm=new ba({container:this.contents,onAction:()=>{},paymentResponse:this.paymentResponse,restartTransactionProcess:this.restartTransactionProcess.bind(this),merchantKey:this.token,rdtCode:this.rdtCode,url:this.url,amount:this.amount,currency:this.currency,onVerify:async()=>{this.currentStep=6,await this.verifyPaymentProcess()},callBackUrl:this.callBackUrl,customer:this.customer,metadata:this.metadata,reference:this.reference,retryingPayment:this.retryingPayment,token:this.token,totalAmount:this.totalAmount,localCurrency:this.localCurrency,onStepChange:i=>{this.currentStep=i}}),this.stableCoinsForm.renderComponent();break;case 2:this.successScreen=new Vt({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency}),this.successScreen.renderComponent();break;case 3:this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage(P["verify-payment"]);break;case 4:this.warningScreen=new et({container:this.contents,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this),onReportIssue:()=>this._currentStep=7}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.setPaymentError(((n=this.paymentResponse)==null?void 0:n.providerMessage)||P["payment-failed"],this.errorText,this.isMaxRetriesReached?P["merchant-back"]:P["try-again"]),this.warningScreen.attachListener();break;case 5:this.transactionIssuesScreen=new sn({container:this.contents,onAction:()=>{var i;this.currentStep=4,this.warningScreen.setPaymentError(((i=this.paymentResponse)==null?void 0:i.providerMessage)||P["payment-failed"])},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"stablecoin",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break;case 6:this.stablecoinsConfirmationProgress=new Xc({container:this.contents,callBackUrl:this.callBackUrl,setPaymentResponses:(i,s)=>{this.paymentResponse=i,this.paymentResponseHeaders=s},token:this.token,onAction:i=>{this.currentStep=i},ref:this.reference,onSuccess:()=>{this.currentStep=2,setTimeout(()=>{Ie(this.paymentResponse,this.paymentResponseHeaders,"success")},2500)}}),this.stablecoinsConfirmationProgress.renderComponent();break;case 7:this.stablecoinConfirmationEnd=new ed({container:this.contents,onAction:i=>{this.currentStep=i},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders,paymentMethod:"Stablecoins"}),this.stablecoinConfirmationEnd.renderComponent();break;default:this.stableCoinsForm=new ba({container:this.contents,onAction:()=>{},restartTransactionProcess:this.restartTransactionProcess.bind(this),merchantKey:this.token,rdtCode:this.rdtCode,url:this.url,amount:this.amount,currency:this.currency,onVerify:this.verifyPaymentProcess.bind(this),paymentResponse:this.paymentResponse,callBackUrl:this.callBackUrl,customer:this.customer,metadata:this.metadata,reference:this.reference,retryingPayment:this.retryingPayment,token:this.token,totalAmount:this.totalAmount,localCurrency:this.localCurrency}),this.stableCoinsForm.renderComponent();break}}}const nd=`<div id="eft-authenticate-container" data-section="opay">
2509
2511
  <div class="pt-3">
2510
2512
  <div class="md:w-4/6 mx-auto mt-4">
2511
2513
  <p class="text-lg font-medium text-center" id="authenticate-request-text" data-translate="authenticate-request">
@@ -2524,7 +2526,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
2524
2526
  </div>
2525
2527
  </div>
2526
2528
 
2527
- </div>`;class fa{constructor(e){d(this,"container");d(this,"payment");d(this,"warningError");d(this,"pageLoader");d(this,"onAction");d(this,"restartTransactionProcess");this.container=e.container,this.onAction=e.onAction,this.restartTransactionProcess=e.restartTransactionProcess,this.warningError=new et({container:this.container,onAction:this.restartTransactionProcess.bind(this)})}attachListener(){const e=this.container.querySelector("#authenticate-btn"),n=this.container.querySelector("#authenticate-request-text"),i=this.container.querySelector("#authenticate-button-text");n&&(n.innerHTML=Lt["authenticate-request"]),i&&(i.innerHTML=Lt.authenticate),e&&e.addEventListener("click",()=>{this.onAction(),_.track("start_payment",{payment_method:"OPAY"})})}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return nd}}class id{constructor({amount:e,totalAmount:n,container:i,customer:s,token:o,currency:a,rdtCode:c,url:l,reference:m,callBackUrl:p,metadata:y,localCurrency:b,hidePaymentMethods:g,showPaymentMethods:w,restartTransactionProcess:f,retryingPayment:k}){d(this,"contents");d(this,"OpayAuthenticate");d(this,"successScreen");d(this,"pageLoader");d(this,"warningScreen");d(this,"transactionIssuesScreen");d(this,"container");d(this,"customer");d(this,"token");d(this,"amount");d(this,"totalAmount");d(this,"currency");d(this,"_currentStep");d(this,"rdtCode");d(this,"url");d(this,"reference");d(this,"callBackUrl");d(this,"metadata");d(this,"localCurrency");d(this,"hidePaymentMethods");d(this,"showPaymentMethods");d(this,"merchantPlanDetail",{});d(this,"restartTransactionProcess");d(this,"retryingPayment");d(this,"isMaxRetriesReached");d(this,"isMobile",!1);d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"countdownInterval");d(this,"popupInterval");d(this,"errorText");this.currency=a,this.container=i,this.token=o,this.customer=s,this.amount=e,this.totalAmount=n,this.rdtCode=c,this.url=l,this.reference=m,this.callBackUrl=p,this.metadata=y,this.localCurrency=b,this._currentStep=1,this.countdownInterval,this.contents=this.container.querySelector("#payment-content-view"),this.hidePaymentMethods=g,this.showPaymentMethods=w,this.restartTransactionProcess=f,this.retryingPayment=k,this.isMaxRetriesReached=!1,this.paymentResponse={},this.paymentResponseHeaders={},this.errorText="",this.renderOpayContent(),_.track("pay_with_opay_opens",{payment_method:"OPAY"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderOpayContent()}showLoader(){this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage(P["verify-payment"])}goBackToMerchant(){Pe(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}async createOpayPayment(){const e=this.container.querySelector(".spinner"),n=this.container.querySelector("#authenticate-button-text");e&&n&&(e.classList.remove("hidden"),n.classList.add("hidden"));const i=fn();(()=>{var o,a;if(this.retryingPayment){const c={channel:"pay_with_opay",reference:this.reference};return $t(this.token,c,this.rdtCode,this.url)}else{const c={amount:this.amount,channel:"pay_with_opay",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((o=this.merchantPlanDetail)==null?void 0:o.taxQuoteId)&&{taxQuoteId:(a=this.merchantPlanDetail)==null?void 0:a.taxQuoteId},deviceInformation:i};return Hi(this.token,c,this.rdtCode,this.url)}})().then(async({data:o,headers:a})=>{var c,l,m;if(this.paymentResponse=o,this.paymentResponseHeaders=a,o.providerMessage){const p=await z(o.providerMessage,H());this.errorText=p}if(o.status==="failed"){this.currentStep=4,o.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(P["payment-failed"]),_.track("start_payment",{payment_method:"OPAY",verification_status:"Failed"});return}else if(((c=o==null?void 0:o.authorization)==null?void 0:c.mode)==="redirect"){(l=o==null?void 0:o.authorization)!=null&&l.redirectUrl&&this.redirectToOpay((m=o==null?void 0:o.authorization)==null?void 0:m.redirectUrl);return}else this.currentStep=4,o!=null&&o.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(Lt["unable-redirect-url"])}).catch(async o=>{if(o.code==="payment_max_retry_attempts")this.isMaxRetriesReached=!0,this.verifyPaymentProcess(),this.currentStep=4,this.warningScreen.setPaymentError(P["maximum-retries"],P["maximum-retries-desc"],q["merchant-back"]);else if(o.message){const a=await z(o.message,H());this.errorText=a,this.currentStep=4,this.warningScreen.setPaymentError(this.errorText)}else this.currentStep=4,this.warningScreen.setPaymentError(q["payment-failed"])}).finally(()=>{e&&n&&(e.classList.add("hidden"),n.classList.remove("hidden"))})}startCountdown(e,n,i){let s=e;n(s);const o=setInterval(()=>{s--,n(s),s<=0&&(clearInterval(o),i())},1e3);return o}redirectToOpay(e){const n=window.open(e,"_blank");n&&(this.currentStep=3,this.showLoader(),this.countdownInterval=this.startCountdown(1800,i=>{},()=>{this.verifyPaymentProcess()}),this.popupInterval=setInterval(()=>{n.closed&&(clearInterval(this.countdownInterval),clearInterval(this.popupInterval),this.verifyPaymentProcess())},2e3))}async verifyPaymentProcess(){try{const e=await Xe(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers;const n=this.paymentResponse.status;if(n==="successful")this.currentStep=2,_.track("verify_payment",{payment_method:"OPAY",verification_status:"Success"}),Pe(this.paymentResponse,this.paymentResponseHeaders,"success");else if(n==="failed"){if(this.paymentResponse.providerMessage){const i=await z(this.paymentResponse.providerMessage,H());this.errorText=i}this.currentStep=4,_.track("verify_payment",{payment_method:"OPAY",verification_status:"Failed"}),this.paymentResponse.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(q["payment-failed"])}else n==="cancelled"&&(this.isMaxRetriesReached=!0,this.currentStep=4,this.warningScreen.setPaymentError(Lt["payment-cancelled"],Lt["cancel-payment-desc"],q["merchant-back"]))}catch{this.currentStep=4,this.warningScreen.setPaymentError(q["payment-failed"])}}renderOpayContent(e){var i;e&&(this.merchantPlanDetail=e);const n=document.getElementById("go-back");if(this.currentStep!==1?(this.hidePaymentMethods(),n==null||n.classList.add("hidden")):this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.contents)switch(this.currentStep){case 1:this.OpayAuthenticate=new fa({container:this.contents,onAction:this.createOpayPayment.bind(this),restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.OpayAuthenticate.renderComponent();break;case 2:this.successScreen=new Vt({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(i=this.merchantPlanDetail)==null?void 0:i.rate.rate}),this.successScreen.renderComponent();break;case 3:this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage(P["verify-payment"]);break;case 4:this.warningScreen=new et({container:this.contents,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this),onReportIssue:()=>this.currentStep=5}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 5:this.transactionIssuesScreen=new sn({container:this.contents,onAction:async()=>{var s,o;if((s=this.paymentResponse)!=null&&s.providerMessage){const a=await z((o=this.paymentResponse)==null?void 0:o.providerMessage,H());this.errorText=a}this.currentStep=4,this.warningScreen.setPaymentError(this.errorText||P["payment-failed"])},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"pay_with_opay",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break;default:this.OpayAuthenticate=new fa({container:this.contents,onAction:this.createOpayPayment.bind(this),restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.OpayAuthenticate.renderComponent();break}}}class sd{constructor({container:e,customerDetails:n,encryption:i,merchantKey:s,modalContainer:o,amount:a,planId:c,rdtCode:l,url:m,reference:p,callBackUrl:y,metadata:b,localCurrency:g,closePayment:w,countryCode:f,mode:k}){d(this,"validChannels",[]);d(this,"disabledChannels",[]);d(this,"selectedChannel");d(this,"modalContainer");d(this,"currentPaymentMethod");d(this,"mainLayout");d(this,"mainHeader");d(this,"mainFooter");d(this,"testCard");d(this,"merchantPlanDetail",{});d(this,"mainScreen");d(this,"currency");d(this,"card");d(this,"transfer");d(this,"ussd");d(this,"mobileMoney");d(this,"eft");d(this,"opay");d(this,"stablecoins");d(this,"encryption");d(this,"merchantKey");d(this,"planId");d(this,"customerDetails");d(this,"amount",0);d(this,"rdtCode");d(this,"url");d(this,"reference");d(this,"isMobile",!1);d(this,"callBackUrl");d(this,"metadata");d(this,"localCurrency");d(this,"closePayment");d(this,"retryingPayment");d(this,"totalAmount");d(this,"countryCode");d(this,"mainLoader");d(this,"mode");d(this,"selectedMethods");this.validChannels=[],this.disabledChannels=[],this.selectedChannel="",this.modalContainer=o,this.encryption=i,this.planId=c||"",this.merchantKey=s,this.amount=a||0,this.rdtCode=l||"",this.url=m||"",this.reference=p,this.mainLayout=e,this.callBackUrl=y,this.metadata=b||{},this.localCurrency=g||"",this.isMobile=window.matchMedia("(max-width: 767px)").matches,this.currentPaymentMethod="",this.currency="",this.closePayment=w,this.retryingPayment=!1,this.totalAmount=0,this.countryCode=f||"",this.customerDetails=n,this.mode=k,this.selectedMethods=[]}mountScreen(e,n,i,s){var l,m;i&&(this.validChannels=i),s&&(this.disabledChannels=s),this.mainLayout.innerHTML=this.render(),this.merchantPlanDetail=e,this.currency=n;const o=(m=(l=this.merchantPlanDetail.plan)==null?void 0:l.pricingOptions)==null?void 0:m.find(p=>p.currency===this.currency);this.amount=(o==null?void 0:o.amount)||this.amount,this.totalAmount=this.merchantPlanDetail.totalAmount||this.amount,this.mainHeader=new Nc({container:document.getElementById("main-header"),email:this.customerDetails.email,amount:this.amount,metadata:this.metadata,currency:this.currency,localCurrency:this.localCurrency,merchantDetail:e,onAction:this.switchTab.bind(this),isMobile:this.isMobile,onClose:p=>{this.closeBTN.bind(this)(p)},currentPaymentMethod:this.currentPaymentMethod,countryCode:this.countryCode}),this.mainHeader.renderComponent(),this.testCard=new aa({container:document.getElementById("test-container"),closeCallback:()=>{const p=document.getElementById("test-container");p&&(p.innerHTML="",p.classList.add("hidden"))}});const a=!1,c=Ms(this.merchantKey);this.mainFooter=new ra({container:document.getElementById("main-footer"),testCardContainer:document.getElementById("test-container"),keyEnvironment:c||(this.mode?this.mode:null),isVisible:a}),document.addEventListener("DOMContentLoaded",()=>{const p=document.getElementById("main-footer"),y=document.getElementById("test-container");new ra({container:p,testCardContainer:y,keyEnvironment:c||(this.mode?this.mode:null),isVisible:a}).renderComponent()}),this.mainFooter.renderComponent(),this.setupPaymentMethodButtons(),this.selectedChannel&&(this.currentPaymentMethod=this.selectedChannel),this.updatePaymentMethodView(this.merchantKey,this.customerDetails,this.amount,this.totalAmount,this.currency),this.renderPaymentMethodContent(),this.setCurrentPaymentMethod(this.currentPaymentMethod)}setupPaymentMethodButtons(){const e=document.querySelectorAll(".tab-button");e.forEach(i=>{i.removeAttribute("disabled"),i.classList.remove("hidden","disabled","limit-exceeded");const s=i.querySelector(".disabled-indicator");s&&i.removeChild(s)});const n=[...this.validChannels,...this.disabledChannels];e.forEach(i=>{const s=i.getAttribute("data-name");s&&!n.includes(s)&&i.classList.add("hidden")}),this.disabledChannels.forEach(i=>{const s=Array.from(e).find(o=>o.getAttribute("data-name")===i);if(s){s.setAttribute("disabled","true"),s.classList.add("disabled","limit-exceeded"),s.setAttribute("title","Transaction amount exceeds limit for this payment method");const o=document.createElement("span");o.classList.add("disabled-indicator"),o.style.fontSize="10px",o.style.color="#FF5733",o.style.display="block",s.appendChild(o)}})}attachListeners(){const e=document.getElementById("go-back"),n=document.getElementById("select-payment-method-text");this.isMobile&&(this.currentPaymentMethod?(e&&(e.classList.add("flex","items-center","gap-2","mb-2"),e.innerHTML=` <svg width="9" height="18" viewBox="0 0 9 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2529
+ </div>`;class fa{constructor(e){d(this,"container");d(this,"payment");d(this,"warningError");d(this,"pageLoader");d(this,"onAction");d(this,"restartTransactionProcess");this.container=e.container,this.onAction=e.onAction,this.restartTransactionProcess=e.restartTransactionProcess,this.warningError=new et({container:this.container,onAction:this.restartTransactionProcess.bind(this)})}attachListener(){const e=this.container.querySelector("#authenticate-btn"),n=this.container.querySelector("#authenticate-request-text"),i=this.container.querySelector("#authenticate-button-text");n&&(n.innerHTML=Lt["authenticate-request"]),i&&(i.innerHTML=Lt.authenticate),e&&e.addEventListener("click",()=>{this.onAction(),_.track("start_payment",{payment_method:"OPAY"})})}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return nd}}class id{constructor({amount:e,totalAmount:n,container:i,customer:s,token:o,currency:a,rdtCode:c,url:l,reference:m,callBackUrl:p,metadata:y,localCurrency:b,hidePaymentMethods:g,showPaymentMethods:w,restartTransactionProcess:f,retryingPayment:k}){d(this,"contents");d(this,"OpayAuthenticate");d(this,"successScreen");d(this,"pageLoader");d(this,"warningScreen");d(this,"transactionIssuesScreen");d(this,"container");d(this,"customer");d(this,"token");d(this,"amount");d(this,"totalAmount");d(this,"currency");d(this,"_currentStep");d(this,"rdtCode");d(this,"url");d(this,"reference");d(this,"callBackUrl");d(this,"metadata");d(this,"localCurrency");d(this,"hidePaymentMethods");d(this,"showPaymentMethods");d(this,"merchantPlanDetail",{});d(this,"restartTransactionProcess");d(this,"retryingPayment");d(this,"isMaxRetriesReached");d(this,"isMobile",!1);d(this,"paymentResponse");d(this,"paymentResponseHeaders");d(this,"countdownInterval");d(this,"popupInterval");d(this,"errorText");this.currency=a,this.container=i,this.token=o,this.customer=s,this.amount=e,this.totalAmount=n,this.rdtCode=c,this.url=l,this.reference=m,this.callBackUrl=p,this.metadata=y,this.localCurrency=b,this._currentStep=1,this.countdownInterval,this.contents=this.container.querySelector("#payment-content-view"),this.hidePaymentMethods=g,this.showPaymentMethods=w,this.restartTransactionProcess=f,this.retryingPayment=k,this.isMaxRetriesReached=!1,this.paymentResponse={},this.paymentResponseHeaders={},this.errorText="",this.renderOpayContent(),_.track("pay_with_opay_opens",{payment_method:"OPAY"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderOpayContent()}showLoader(){this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage(P["verify-payment"])}goBackToMerchant(){Ie(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}async createOpayPayment(){const e=this.container.querySelector(".spinner"),n=this.container.querySelector("#authenticate-button-text");e&&n&&(e.classList.remove("hidden"),n.classList.add("hidden"));const i=fn();(()=>{var o,a;if(this.retryingPayment){const c={channel:"pay_with_opay",reference:this.reference};return $t(this.token,c,this.rdtCode,this.url)}else{const c={amount:this.amount,channel:"pay_with_opay",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((o=this.merchantPlanDetail)==null?void 0:o.taxQuoteId)&&{taxQuoteId:(a=this.merchantPlanDetail)==null?void 0:a.taxQuoteId},deviceInformation:i};return Hi(this.token,c,this.rdtCode,this.url)}})().then(async({data:o,headers:a})=>{var c,l,m;if(this.paymentResponse=o,this.paymentResponseHeaders=a,o.providerMessage){const p=await z(o.providerMessage,H());this.errorText=p}if(o.status==="failed"){this.currentStep=4,o.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(P["payment-failed"]),_.track("start_payment",{payment_method:"OPAY",verification_status:"Failed"});return}else if(((c=o==null?void 0:o.authorization)==null?void 0:c.mode)==="redirect"){(l=o==null?void 0:o.authorization)!=null&&l.redirectUrl&&this.redirectToOpay((m=o==null?void 0:o.authorization)==null?void 0:m.redirectUrl);return}else this.currentStep=4,o!=null&&o.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(Lt["unable-redirect-url"])}).catch(async o=>{if(o.code==="payment_max_retry_attempts")this.isMaxRetriesReached=!0,this.verifyPaymentProcess(),this.currentStep=4,this.warningScreen.setPaymentError(P["maximum-retries"],P["maximum-retries-desc"],q["merchant-back"]);else if(o.message){const a=await z(o.message,H());this.errorText=a,this.currentStep=4,this.warningScreen.setPaymentError(this.errorText)}else this.currentStep=4,this.warningScreen.setPaymentError(q["payment-failed"])}).finally(()=>{e&&n&&(e.classList.add("hidden"),n.classList.remove("hidden"))})}startCountdown(e,n,i){let s=e;n(s);const o=setInterval(()=>{s--,n(s),s<=0&&(clearInterval(o),i())},1e3);return o}redirectToOpay(e){const n=window.open(e,"_blank");n&&(this.currentStep=3,this.showLoader(),this.countdownInterval=this.startCountdown(1800,i=>{},()=>{this.verifyPaymentProcess()}),this.popupInterval=setInterval(()=>{n.closed&&(clearInterval(this.countdownInterval),clearInterval(this.popupInterval),this.verifyPaymentProcess())},2e3))}async verifyPaymentProcess(){try{const e=await Xe(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers;const n=this.paymentResponse.status;if(n==="successful")this.currentStep=2,_.track("verify_payment",{payment_method:"OPAY",verification_status:"Success"}),Ie(this.paymentResponse,this.paymentResponseHeaders,"success");else if(n==="failed"){if(this.paymentResponse.providerMessage){const i=await z(this.paymentResponse.providerMessage,H());this.errorText=i}this.currentStep=4,_.track("verify_payment",{payment_method:"OPAY",verification_status:"Failed"}),this.paymentResponse.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(q["payment-failed"])}else n==="cancelled"&&(this.isMaxRetriesReached=!0,this.currentStep=4,this.warningScreen.setPaymentError(Lt["payment-cancelled"],Lt["cancel-payment-desc"],q["merchant-back"]))}catch{this.currentStep=4,this.warningScreen.setPaymentError(q["payment-failed"])}}renderOpayContent(e){var i;e&&(this.merchantPlanDetail=e);const n=document.getElementById("go-back");if(this.currentStep!==1?(this.hidePaymentMethods(),n==null||n.classList.add("hidden")):this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.contents)switch(this.currentStep){case 1:this.OpayAuthenticate=new fa({container:this.contents,onAction:this.createOpayPayment.bind(this),restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.OpayAuthenticate.renderComponent();break;case 2:this.successScreen=new Vt({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(i=this.merchantPlanDetail)==null?void 0:i.rate.rate}),this.successScreen.renderComponent();break;case 3:this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage(P["verify-payment"]);break;case 4:this.warningScreen=new et({container:this.contents,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this),onReportIssue:()=>this.currentStep=5}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 5:this.transactionIssuesScreen=new sn({container:this.contents,onAction:async()=>{var s,o;if((s=this.paymentResponse)!=null&&s.providerMessage){const a=await z((o=this.paymentResponse)==null?void 0:o.providerMessage,H());this.errorText=a}this.currentStep=4,this.warningScreen.setPaymentError(this.errorText||P["payment-failed"])},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"pay_with_opay",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break;default:this.OpayAuthenticate=new fa({container:this.contents,onAction:this.createOpayPayment.bind(this),restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.OpayAuthenticate.renderComponent();break}}}class sd{constructor({container:e,customerDetails:n,encryption:i,merchantKey:s,modalContainer:o,amount:a,planId:c,rdtCode:l,url:m,reference:p,callBackUrl:y,metadata:b,localCurrency:g,closePayment:w,countryCode:f,mode:k}){d(this,"validChannels",[]);d(this,"disabledChannels",[]);d(this,"selectedChannel");d(this,"modalContainer");d(this,"currentPaymentMethod");d(this,"mainLayout");d(this,"mainHeader");d(this,"mainFooter");d(this,"testCard");d(this,"merchantPlanDetail",{});d(this,"mainScreen");d(this,"currency");d(this,"card");d(this,"transfer");d(this,"ussd");d(this,"mobileMoney");d(this,"eft");d(this,"opay");d(this,"stablecoins");d(this,"encryption");d(this,"merchantKey");d(this,"planId");d(this,"customerDetails");d(this,"amount",0);d(this,"rdtCode");d(this,"url");d(this,"reference");d(this,"isMobile",!1);d(this,"callBackUrl");d(this,"metadata");d(this,"localCurrency");d(this,"closePayment");d(this,"retryingPayment");d(this,"totalAmount");d(this,"countryCode");d(this,"mainLoader");d(this,"mode");d(this,"selectedMethods");this.validChannels=[],this.disabledChannels=[],this.selectedChannel="",this.modalContainer=o,this.encryption=i,this.planId=c||"",this.merchantKey=s,this.amount=a||0,this.rdtCode=l||"",this.url=m||"",this.reference=p,this.mainLayout=e,this.callBackUrl=y,this.metadata=b||{},this.localCurrency=g||"",this.isMobile=window.matchMedia("(max-width: 767px)").matches,this.currentPaymentMethod="",this.currency="",this.closePayment=w,this.retryingPayment=!1,this.totalAmount=0,this.countryCode=f||"",this.customerDetails=n,this.mode=k,this.selectedMethods=[]}mountScreen(e,n,i,s){var l,m;i&&(this.validChannels=i),s&&(this.disabledChannels=s),this.mainLayout.innerHTML=this.render(),this.merchantPlanDetail=e,this.currency=n;const o=(m=(l=this.merchantPlanDetail.plan)==null?void 0:l.pricingOptions)==null?void 0:m.find(p=>p.currency===this.currency);this.amount=(o==null?void 0:o.amount)||this.amount,this.totalAmount=this.merchantPlanDetail.totalAmount||this.amount,this.mainHeader=new Nc({container:document.getElementById("main-header"),email:this.customerDetails.email,amount:this.amount,metadata:this.metadata,currency:this.currency,localCurrency:this.localCurrency,merchantDetail:e,onAction:this.switchTab.bind(this),isMobile:this.isMobile,onClose:p=>{this.closeBTN.bind(this)(p)},currentPaymentMethod:this.currentPaymentMethod,countryCode:this.countryCode}),this.mainHeader.renderComponent(),this.testCard=new aa({container:document.getElementById("test-container"),closeCallback:()=>{const p=document.getElementById("test-container");p&&(p.innerHTML="",p.classList.add("hidden"))}});const a=!1,c=Ms(this.merchantKey);this.mainFooter=new ra({container:document.getElementById("main-footer"),testCardContainer:document.getElementById("test-container"),keyEnvironment:c||(this.mode?this.mode:null),isVisible:a}),document.addEventListener("DOMContentLoaded",()=>{const p=document.getElementById("main-footer"),y=document.getElementById("test-container");new ra({container:p,testCardContainer:y,keyEnvironment:c||(this.mode?this.mode:null),isVisible:a}).renderComponent()}),this.mainFooter.renderComponent(),this.setupPaymentMethodButtons(),this.selectedChannel&&(this.currentPaymentMethod=this.selectedChannel),this.updatePaymentMethodView(this.merchantKey,this.customerDetails,this.amount,this.totalAmount,this.currency),this.renderPaymentMethodContent(),this.setCurrentPaymentMethod(this.currentPaymentMethod)}setupPaymentMethodButtons(){const e=document.querySelectorAll(".tab-button");e.forEach(i=>{i.removeAttribute("disabled"),i.classList.remove("hidden","disabled","limit-exceeded");const s=i.querySelector(".disabled-indicator");s&&i.removeChild(s)});const n=[...this.validChannels,...this.disabledChannels];e.forEach(i=>{const s=i.getAttribute("data-name");s&&!n.includes(s)&&i.classList.add("hidden")}),this.disabledChannels.forEach(i=>{const s=Array.from(e).find(o=>o.getAttribute("data-name")===i);if(s){s.setAttribute("disabled","true"),s.classList.add("disabled","limit-exceeded"),s.setAttribute("title","Transaction amount exceeds limit for this payment method");const o=document.createElement("span");o.classList.add("disabled-indicator"),o.style.fontSize="10px",o.style.color="#FF5733",o.style.display="block",s.appendChild(o)}})}attachListeners(){const e=document.getElementById("go-back"),n=document.getElementById("select-payment-method-text");this.isMobile&&(this.currentPaymentMethod?(e&&(e.classList.add("flex","items-center","gap-2","mb-2"),e.innerHTML=` <svg width="9" height="18" viewBox="0 0 9 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2528
2530
  <path d="M7.99984 16.9201L1.47984 10.4001C0.709844 9.63008 0.709844 8.37008 1.47984 7.60008L7.99984 1.08008" stroke="#0D0716" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
2529
2531
  </svg>
2530
2532
  <span class="text-tone-100 font-semibold">