@spot-flow/checkout-inline-js 0.2.4-dev.2 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/checkout-inline.es.js +101 -95
- package/dist/checkout-inline.js +13 -13
- package/dist/modules/MobileMoney.d.ts +3 -1
- package/package.json +1 -1
package/dist/checkout-inline.js
CHANGED
|
@@ -642,7 +642,7 @@
|
|
|
642
642
|
}
|
|
643
643
|
|
|
644
644
|
|
|
645
|
-
`,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 Hs=new ir({defaultStyle:"skeleton",fadeOpacity:.5}),Ae=(()=>{let n=navigator==null?void 0:navigator.language.split("-")[0].toLowerCase(),e=new Map,t=[],i=0,s=[],o=!1;const a=f=>{n!==f&&(n=f,o=!1,l())},l=()=>{t.forEach(f=>f(n))},c=()=>{s.forEach(f=>f(i>0))},p=f=>(t.push(f),()=>{t=t.filter(k=>k!==f)}),m=async(f,k=n,x="static")=>{if(o)return Array.isArray(f)?f:[f];if(k==="en"&&x==="static")return Array.isArray(f)?f:[f];i+=1,c();const M=Array.isArray(f)?`[${f.join("|")}]:${k}`:`${f}:${k}`;if(e.has(M))return i-=1,c(),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,c()}};return{setLanguage:a,getLanguage:()=>n,translate:m,translateRecord:async(f,k=n)=>{if(k==="en"||o)return f;const x=Object.keys(f),A=Object.values(f);return(await m(A,k)).reduce((D,
|
|
645
|
+
`,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 Hs=new ir({defaultStyle:"skeleton",fadeOpacity:.5}),Ae=(()=>{let n=navigator==null?void 0:navigator.language.split("-")[0].toLowerCase(),e=new Map,t=[],i=0,s=[],o=!1;const a=f=>{n!==f&&(n=f,o=!1,l())},l=()=>{t.forEach(f=>f(n))},c=()=>{s.forEach(f=>f(i>0))},p=f=>(t.push(f),()=>{t=t.filter(k=>k!==f)}),m=async(f,k=n,x="static")=>{if(o)return Array.isArray(f)?f:[f];if(k==="en"&&x==="static")return Array.isArray(f)?f:[f];i+=1,c();const M=Array.isArray(f)?`[${f.join("|")}]:${k}`:`${f}:${k}`;if(e.has(M))return i-=1,c(),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,c()}};return{setLanguage:a,getLanguage:()=>n,translate:m,translateRecord:async(f,k=n)=>{if(k==="en"||o)return f;const x=Object.keys(f),A=Object.values(f);return(await m(A,k)).reduce((D,F,Z)=>(D[x[Z]]=F,D),{})},subscribe:p,subscribeToLoading:f=>(s.push(f),()=>{s=s.filter(k=>k!==f)}),getIsLoading:()=>i>0,getTranslationError:()=>o}})(),pn=navigator==null?void 0:navigator.language.split("-")[0].toLowerCase();let Ns=pn;const it=n=>{Ns=n},R=()=>Ns,sr=(n,e)=>{const t=Ni(n,e),i=t==null?void 0:t.language,s=Ae.getTranslationError();i&&i!==pn?it(s?"en":pn):i&&i===pn?it(i):!pn&&!i&&it("en")},z=async(n,e)=>{const t=await Ae.translate(n,e,"dynamic");return typeof t=="string"?t:t[0]};let rn=Hi;const Os=async n=>(rn=await Ae.translateRecord(Hi,n),rn);let q=Ls;const Us=async n=>{q=await Ae.translateRecord(Ls,n)};let P=Ts;const Vs=async n=>{P=await Ae.translateRecord(Ts,n)};let pe=_s;const Fs=async n=>{pe=await Ae.translateRecord(_s,n)};let $e=Es;const Ks=async n=>{$e=await Ae.translateRecord(Es,n)};let Ve=Ps;const Gs=async n=>{Ve=await Ae.translateRecord(Ps,n)};let Me=Is;const js=async n=>{Me=await Ae.translateRecord(Is,n)};let Ln=Ds;const zs=async n=>{Ln=await Ae.translateRecord(Ds,n)};let Fe=Rs;const qs=async n=>{Fe=await Ae.translateRecord(Rs,n)};let Tn=Bs;const Ws=async n=>{Tn=await Ae.translateRecord(Bs,n)};function Zs(n){if(n in q)return q[n];if(n in P)return P[n];if(n in rn)return rn[n];if(n in pe)return pe[n];if(n in $e)return $e[n];if(n in Ve)return Ve[n];if(n in Me)return Me[n];if(n in Ln)return Ln[n];if(n in Tn)return Tn[n];if(n in Fe)return Fe[n]}function Oi(){document.querySelectorAll("[data-translate]").forEach(n=>{const e=n.getAttribute("data-translate");if(!e)return;const t=Zs(e);t&&(n.textContent=t)}),document.querySelectorAll("[data-translate-placeholder]").forEach(n=>{const e=n.getAttribute("data-translate-placeholder");if(!e)return;const t=Zs(e);t&&(n.placeholder=t)})}Ae.subscribe(async n=>{Hs.startSmartLoading({});try{await Promise.all([Us(n),Vs(n),Os(n),(()=>{const e=or();if(e){if(e==="card")return Fs(n);e==="transfer"?Gs(n):e==="mobile_money"?js(n):e==="eft"?zs(n):e==="opay"?Ws(n):e==="test_cards"?Ks(n):e==="stablecoin"&&qs(n)}return Promise.resolve()})()]),Oi()}catch(e){console.error("Translation error:",e),Oi()}finally{Hs.stopGlobalLoading()}Oi()});function or(){const n=Array.from(document.querySelectorAll("[data-section]")).map(e=>e.dataset.section);for(const e of n)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 t=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"),l=document.querySelector("#checkoutcard"),c=this.container.querySelector("#enter-details-text"),p=this.container.querySelector("#certified-text"),m=this.container.querySelector("#card-confirmation-text-one"),g=this.container.querySelector("#card-confirmation-text-two");c&&(c.innerHTML=pe["enter-card-details"]),p&&(p.innerHTML=pe.certified),m&&(m.innerHTML=pe["card-confirmation-one"]),g&&(g.innerHTML=pe["card-confirmation-two"]),t&&(t.setAttribute("placeholder",pe["card-number"]),t.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))),l&&l.addEventListener("submit",b=>{var y,w,f;b.preventDefault(),this.onAction(b)({pan:Ja(this.cardDetailsValues.number),cvv:this.cardDetailsValues.cvv,expiryMonth:(y=this.cardDetailsValues)==null?void 0:y.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 t=e.split("").map(s=>parseInt(s,10));for(let s=t.length-2;s>=0;s-=2){let o=t[s]*2;o>9&&(o-=9),t[s]=o}return t.reduce((s,o)=>s+o,0)%10===0}handleInputChange(e,t){var l,c,p;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 m=a.replace(/\s+/g,""),g=this.validateCreditCard(m);this.filterCreditCardType(o);const b=(l=this.creditCardTypes[0])==null?void 0:l.name;b&&Mn.map(y=>{if(y.name===this.currency)if(y.cardTypes.includes(b)){const w=nr[b];if(w.length>1){const f=w.some(k=>m.length===k);this.checkInputValidity(g,i,f,"card-number-invalid")}else m.length===w[0]&&this.checkInputValidity(g,i,m.length>=14&&m.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 m=new Date;a=$a(o);const g=a.split("/"),b=(c=g[0])==null?void 0:c.trim(),y=(p=g[1])==null?void 0:p.trim(),w=new Date().getFullYear()%100,f=m.getMonth()+1;let k=!0;(parseInt(y)===w&&parseInt(b)<f||parseInt(y)<w)&&(k=!1),(y==null?void 0:y.length)===2&&this.checkInputValidity(k,i,g.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())t&&t.removeAttribute("disabled");else if(t){if(t.disabled)return;t.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(t=>{const i=document.createElement("div");i.classList.add("card-type"),i.innerHTML=t.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">
|
|
646
646
|
<path
|
|
647
647
|
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"
|
|
648
648
|
fill="#B6B4B9" />
|
|
@@ -1062,9 +1062,9 @@
|
|
|
1062
1062
|
</div>
|
|
1063
1063
|
</form>
|
|
1064
1064
|
</div>
|
|
1065
|
-
</div>`;class gr{constructor(e){d(this,"container");d(this,"formValues");d(this,"documents");d(this,"paymentResponse");d(this,"uploadEvidenceFile");d(this,"uploadRes");d(this,"onAction");this.container=e.container,this.formValues={reason:""},this.documents=[],this.uploadEvidenceFile=e.uploadEvidenceFile,this.onAction=e.onAction,this.paymentResponse=e.paymentResponse,this.uploadRes={message:"",status:"",url:""}}attachListener(){var k,x;const e=this.container.querySelector("#trans-reference"),t=this.container.querySelector("#full-name"),i=this.container.querySelector("#email"),s=this.container.querySelector("#reason"),o=this.container.querySelector("#debited-select-field"),a=this.container.querySelector("#debited-select-label"),l=this.container.querySelector("#type-select-field"),c=this.container.querySelector("#type-select-label"),p=this.container.querySelector("#filee"),m=this.container.querySelector("#file-label"),g=this.container.querySelector("#file-text"),b=this.container.querySelector("#file-icon"),y=this.container.querySelector("#file-button"),w=this.container.querySelector("#form-button"),f=document.querySelector("#transaction-issues-form");e&&(e.value=((k=this.paymentResponse)==null?void 0:k.reference)||""),t&&t.addEventListener("input",A=>{this.handleInputChange(A,w)}),i&&(i.value=((x=this.paymentResponse.customer)==null?void 0:x.email)||""),s&&s.addEventListener("input",A=>{this.handleInputChange(A,w)}),o&&(o.value||a&&(a.classList.add("top-1/2"),a.classList.remove("inset-y-4")),o==null||o.addEventListener("change",A=>{this.handleInputChange(A,w),o.value?a&&(a.classList.add("inset-y-4"),a.classList.remove("top-1/2")):a&&(a.classList.add("top-1/2"),a.classList.remove("inset-y-4"))})),l&&(l.value||c&&(c.classList.add("top-1/2"),c.classList.remove("inset-y-4")),l==null||l.addEventListener("change",A=>{this.handleInputChange(A,w),l.value?c&&(c.classList.add("inset-y-4"),c.classList.remove("top-1/2")):c&&(c.classList.add("top-1/2"),c.classList.remove("inset-y-4"))})),p&&p.addEventListener("change",A=>{var D;A.preventDefault();const M=p.files,E=/(\.jpg|\.jpeg|\.png|\.pdf)$/i;if(M&&M.length)if(E.exec(M[0].name)){const
|
|
1065
|
+
</div>`;class gr{constructor(e){d(this,"container");d(this,"formValues");d(this,"documents");d(this,"paymentResponse");d(this,"uploadEvidenceFile");d(this,"uploadRes");d(this,"onAction");this.container=e.container,this.formValues={reason:""},this.documents=[],this.uploadEvidenceFile=e.uploadEvidenceFile,this.onAction=e.onAction,this.paymentResponse=e.paymentResponse,this.uploadRes={message:"",status:"",url:""}}attachListener(){var k,x;const e=this.container.querySelector("#trans-reference"),t=this.container.querySelector("#full-name"),i=this.container.querySelector("#email"),s=this.container.querySelector("#reason"),o=this.container.querySelector("#debited-select-field"),a=this.container.querySelector("#debited-select-label"),l=this.container.querySelector("#type-select-field"),c=this.container.querySelector("#type-select-label"),p=this.container.querySelector("#filee"),m=this.container.querySelector("#file-label"),g=this.container.querySelector("#file-text"),b=this.container.querySelector("#file-icon"),y=this.container.querySelector("#file-button"),w=this.container.querySelector("#form-button"),f=document.querySelector("#transaction-issues-form");e&&(e.value=((k=this.paymentResponse)==null?void 0:k.reference)||""),t&&t.addEventListener("input",A=>{this.handleInputChange(A,w)}),i&&(i.value=((x=this.paymentResponse.customer)==null?void 0:x.email)||""),s&&s.addEventListener("input",A=>{this.handleInputChange(A,w)}),o&&(o.value||a&&(a.classList.add("top-1/2"),a.classList.remove("inset-y-4")),o==null||o.addEventListener("change",A=>{this.handleInputChange(A,w),o.value?a&&(a.classList.add("inset-y-4"),a.classList.remove("top-1/2")):a&&(a.classList.add("top-1/2"),a.classList.remove("inset-y-4"))})),l&&(l.value||c&&(c.classList.add("top-1/2"),c.classList.remove("inset-y-4")),l==null||l.addEventListener("change",A=>{this.handleInputChange(A,w),l.value?c&&(c.classList.add("inset-y-4"),c.classList.remove("top-1/2")):c&&(c.classList.add("top-1/2"),c.classList.remove("inset-y-4"))})),p&&p.addEventListener("change",A=>{var D;A.preventDefault();const M=p.files,E=/(\.jpg|\.jpeg|\.png|\.pdf)$/i;if(M&&M.length)if(E.exec(M[0].name)){const F=M[0];y&&(y.innerHTML=`<span class="bg-primary text-white text-sm font-semibold py-2 px-3 rounded-md" id="upload-btn-text">
|
|
1066
1066
|
Uploading...
|
|
1067
|
-
</span>`),setTimeout(async()=>{var Z;this.uploadRes=await this.uploadEvidenceFile(
|
|
1067
|
+
</span>`),setTimeout(async()=>{var Z;this.uploadRes=await this.uploadEvidenceFile(F),(Z=this.uploadRes)!=null&&Z.url&&this.documents.push(this.uploadRes.url),M[0].name&&(m&&(m.textContent=this.uploadRes.message),g&&(g.textContent=`${M[0].name} | ${Math.floor(M[0].size/1024)} KB . ${new Date().toLocaleString("en-us",{day:"numeric",year:"numeric",month:"short"})}`),b&&(this.uploadRes.status==="error"?b.innerHTML=`<svg width="30" height="30" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1068
1068
|
<rect x="10" y="11.6667" width="20" height="18.3333" fill="white"/>
|
|
1069
1069
|
<path d="M19.9955 36.6666C15.5754 36.6706 11.3352 34.9161 8.20965 31.7898C5.08414 28.6635 3.33001 24.4222 3.33399 20.0009V19.6676C3.47026 12.9884 7.57901 7.0353 13.7747 4.54029C19.9704 2.04528 27.0568 3.49007 31.7819 8.21164C36.5512 12.9782 37.9786 20.1498 35.398 26.38C32.8174 32.6101 26.7375 36.6706 19.9955 36.6666ZM19.9955 22.3508L24.3109 26.6672L26.6601 24.3174L22.3448 20.0009L26.6601 15.6845L24.3109 13.3347L19.9955 17.6511L15.6802 13.3347L13.3309 15.6845L17.6463 20.0009L13.3309 24.3174L15.6802 26.6672L19.9955 22.3525V22.3508Z" fill="#D62020"/>
|
|
1070
1070
|
</svg>
|
|
@@ -1128,9 +1128,9 @@
|
|
|
1128
1128
|
|
|
1129
1129
|
</div>
|
|
1130
1130
|
</div>
|
|
1131
|
-
</div>`}renderTransactionIssuesComponent(){const e=document.querySelector("#main-header"),t=document.querySelector("#main-content"),i=document.querySelector("#main-footer");switch(e&&(e.style.display="none"),t&&t.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(n){n[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment"})(ve||(ve={}));function yr(n){return n.nodeType===n.ELEMENT_NODE}function kt(n){const e=n==null?void 0:n.host;return(e==null?void 0:e.shadowRoot)===n}function St(n){return Object.prototype.toString.call(n)==="[object ShadowRoot]"}function Cr(n){return n.includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n}function wr(n){const{cssText:e}=n;if(e.split('"').length<3)return e;const t=["@import",`url(${JSON.stringify(n.href)})`];return n.layerName===""?t.push("layer"):n.layerName&&t.push(`layer(${n.layerName})`),n.supportsText&&t.push(`supports(${n.supportsText})`),n.media.length&&t.push(n.media.mediaText),t.join(" ")+";"}function Ft(n){try{const e=n.rules||n.cssRules;return e?Cr(Array.from(e,Ys).join("")):null}catch{return null}}function Ys(n){let e;if(Sr(n))try{e=Ft(n.styleSheet)||wr(n)}catch{}else if(xr(n)&&n.selectorText.includes(":"))return kr(n.cssText);return e||n.cssText}function kr(n){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return n.replace(e,"$1\\$2")}function Sr(n){return"styleSheet"in n}function xr(n){return"selectorText"in n}class Xs{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const i=(t=this.getMeta(e))===null||t===void 0?void 0:t.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 t=this.getId(e);this.idNodeMap.delete(t),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,t){const i=t.id;this.idNodeMap.set(i,e),this.nodeMetaMap.set(e,t)}replace(e,t){const i=this.getNode(e);if(i){const s=this.nodeMetaMap.get(i);s&&this.nodeMetaMap.set(t,s)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Ar(){return new Xs}function Ui({element:n,maskInputOptions:e,tagName:t,type:i,value:s,maskInputFn:o}){let a=s||"";const l=i&&Kn(i);return(e[t.toLowerCase()]||l&&e[l])&&(o?a=o(a,n):a="*".repeat(a.length)),a}function Kn(n){return n.toLowerCase()}const $s="__rrweb_original__";function Mr(n){const e=n.getContext("2d");if(!e)return!0;const t=50;for(let i=0;i<n.width;i+=t)for(let s=0;s<n.height;s+=t){const o=e.getImageData,a=$s in o?o[$s]:o;if(new Uint32Array(a.call(e,i,s,Math.min(t,n.width-i),Math.min(t,n.height-s)).data.buffer).some(c=>c!==0))return!1}return!0}function Vi(n){const e=n.type;return n.hasAttribute("data-rr-is-password")?"password":e?Kn(e):null}function eo(n,e){var t;let i;try{i=new URL(n,e??window.location.href)}catch{return null}const s=/\.([0-9a-z]+)(?:$)/i,o=i.pathname.match(s);return(t=o==null?void 0:o[1])!==null&&t!==void 0?t:null}let Lr=1;const Tr=new RegExp("[^a-z0-9-_:]"),xt=-2;function no(){return Lr++}function _r(n){if(n instanceof HTMLFormElement)return"form";const e=Kn(n.tagName);return Tr.test(e)?"div":e}function Er(n){let e="";return n.indexOf("//")>-1?e=n.split("/").slice(0,3).join("/"):e=n.split("/")[0],e=e.split("?")[0],e}let ot,to;const Pr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ir=/^(?:[a-z+]+:)?\/\//i,Dr=/^www\..*/i,Br=/^(data:)([^,]*),(.*)/i;function Kt(n,e){return(n||"").replace(Pr,(t,i,s,o,a,l)=>{const c=s||a||l,p=i||o||"";if(!c)return t;if(Ir.test(c)||Dr.test(c))return`url(${p}${c}${p})`;if(Br.test(c))return`url(${p}${c}${p})`;if(c[0]==="/")return`url(${p}${Er(e)+c}${p})`;const m=e.split("/"),g=c.split("/");m.pop();for(const b of g)b!=="."&&(b===".."?m.pop():m.push(b));return`url(${p}${m.join("/")}${p})`})}const Rr=/^[^ \t\n\r\u000c]+/,Hr=/^[, \t\n\r\u000c]+/;function Nr(n,e){if(e.trim()==="")return e;let t=0;function i(o){let a;const l=o.exec(e.substring(t));return l?(a=l[0],t+=a.length,a):""}const s=[];for(;i(Hr),!(t>=e.length);){let o=i(Rr);if(o.slice(-1)===",")o=at(n,o.substring(0,o.length-1)),s.push(o);else{let a="";o=at(n,o);let l=!1;for(;;){const c=e.charAt(t);if(c===""){s.push((o+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){t+=1,s.push((o+a).trim());break}else c==="("&&(l=!0);a+=c,t+=1}}}return s.join(", ")}function at(n,e){if(!e||e.trim()==="")return e;const t=n.createElement("a");return t.href=e,t.href}function Or(n){return!!(n.tagName==="svg"||n.ownerSVGElement)}function Fi(){const n=document.createElement("a");return n.href="",n.href}function io(n,e,t,i){return i&&(t==="src"||t==="href"&&!(e==="use"&&i[0]==="#")||t==="xlink:href"&&i[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?at(n,i):t==="srcset"?Nr(n,i):t==="style"?Kt(i,Fi()):e==="object"&&t==="data"?at(n,i):i)}function so(n,e,t){return(n==="video"||n==="audio")&&e==="autoplay"}function Ur(n,e,t){try{if(typeof e=="string"){if(n.classList.contains(e))return!0}else for(let i=n.classList.length;i--;){const s=n.classList[i];if(e.test(s))return!0}if(t)return n.matches(t)}catch{}return!1}function Gt(n,e,t){if(!n)return!1;if(n.nodeType!==n.ELEMENT_NODE)return t?Gt(n.parentNode,e,t):!1;for(let i=n.classList.length;i--;){const s=n.classList[i];if(e.test(s))return!0}return t?Gt(n.parentNode,e,t):!1}function oo(n,e,t,i){try{const s=n.nodeType===n.ELEMENT_NODE?n:n.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(Gt(s,e,i))return!0;if(t){if(i){if(s.closest(t))return!0}else if(s.matches(t))return!0}}catch{}return!1}function Vr(n,e,t){const i=n.contentWindow;if(!i)return;let s=!1,o;try{o=i.document.readyState}catch{return}if(o!=="complete"){const l=setTimeout(()=>{s||(e(),s=!0)},t);n.addEventListener("load",()=>{clearTimeout(l),s=!0,e()});return}const a="about:blank";if(i.location.href!==a||n.src===a||n.src==="")return setTimeout(e,0),n.addEventListener("load",e);n.addEventListener("load",e)}function Fr(n,e,t){let i=!1,s;try{s=n.sheet}catch{return}if(s)return;const o=setTimeout(()=>{i||(e(),i=!0)},t);n.addEventListener("load",()=>{clearTimeout(o),i=!0,e()})}function Kr(n,e){const{doc:t,mirror:i,blockClass:s,blockSelector:o,needsMask:a,inlineStylesheet:l,maskInputOptions:c={},maskTextFn:p,maskInputFn:m,dataURLOptions:g={},inlineImages:b,recordCanvas:y,keepIframeSrcFn:w,newlyAddedElement:f=!1}=e,k=Gr(t,i);switch(n.nodeType){case n.DOCUMENT_NODE:return n.compatMode!=="CSS1Compat"?{type:ve.Document,childNodes:[],compatMode:n.compatMode}:{type:ve.Document,childNodes:[]};case n.DOCUMENT_TYPE_NODE:return{type:ve.DocumentType,name:n.name,publicId:n.publicId,systemId:n.systemId,rootId:k};case n.ELEMENT_NODE:return zr(n,{doc:t,blockClass:s,blockSelector:o,inlineStylesheet:l,maskInputOptions:c,maskInputFn:m,dataURLOptions:g,inlineImages:b,recordCanvas:y,keepIframeSrcFn:w,newlyAddedElement:f,rootId:k});case n.TEXT_NODE:return jr(n,{needsMask:a,maskTextFn:p,rootId:k});case n.CDATA_SECTION_NODE:return{type:ve.CDATA,textContent:"",rootId:k};case n.COMMENT_NODE:return{type:ve.Comment,textContent:n.textContent||"",rootId:k};default:return!1}}function Gr(n,e){if(!e.hasNode(n))return;const t=e.getId(n);return t===1?void 0:t}function jr(n,e){var t;const{needsMask:i,maskTextFn:s,rootId:o}=e,a=n.parentNode&&n.parentNode.tagName;let l=n.textContent;const c=a==="STYLE"?!0:void 0,p=a==="SCRIPT"?!0:void 0;if(c&&l){try{n.nextSibling||n.previousSibling||!((t=n.parentNode.sheet)===null||t===void 0)&&t.cssRules&&(l=Ft(n.parentNode.sheet))}catch(m){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${m}`,n)}l=Kt(l,Fi())}return p&&(l="SCRIPT_PLACEHOLDER"),!c&&!p&&l&&i&&(l=s?s(l,n.parentElement):l.replace(/[\S]/g,"*")),{type:ve.Text,textContent:l||"",isStyle:c,rootId:o}}function zr(n,e){const{doc:t,blockClass:i,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:c={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:g,newlyAddedElement:b=!1,rootId:y}=e,w=Ur(n,i,s),f=_r(n);let k={};const x=n.attributes.length;for(let M=0;M<x;M++){const E=n.attributes[M];so(f,E.name,E.value)||(k[E.name]=io(t,f,Kn(E.name),E.value))}if(f==="link"&&o){const M=Array.from(t.styleSheets).find(D=>D.href===n.href);let E=null;M&&(E=Ft(M)),E&&(delete k.rel,delete k.href,k._cssText=Kt(E,M.href))}if(f==="style"&&n.sheet&&!(n.innerText||n.textContent||"").trim().length){const M=Ft(n.sheet);M&&(k._cssText=Kt(M,Fi()))}if(f==="input"||f==="textarea"||f==="select"){const M=n.value,E=n.checked;k.type!=="radio"&&k.type!=="checkbox"&&k.type!=="submit"&&k.type!=="button"&&M?k.value=Ui({element:n,type:Vi(n),tagName:f,value:M,maskInputOptions:a,maskInputFn:l}):E&&(k.checked=E)}if(f==="option"&&(n.selected&&!a.select?k.selected=!0:delete k.selected),f==="canvas"&&m){if(n.__context==="2d")Mr(n)||(k.rr_dataURL=n.toDataURL(c.type,c.quality));else if(!("__context"in n)){const M=n.toDataURL(c.type,c.quality),E=document.createElement("canvas");E.width=n.width,E.height=n.height;const D=E.toDataURL(c.type,c.quality);M!==D&&(k.rr_dataURL=M)}}if(f==="img"&&p){ot||(ot=t.createElement("canvas"),to=ot.getContext("2d"));const M=n,E=M.crossOrigin;M.crossOrigin="anonymous";const D=()=>{M.removeEventListener("load",D);try{ot.width=M.naturalWidth,ot.height=M.naturalHeight,to.drawImage(M,0,0),k.rr_dataURL=ot.toDataURL(c.type,c.quality)}catch(G){console.warn(`Cannot inline img src=${M.currentSrc}! Error: ${G}`)}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=n.paused?"paused":"played",M.rr_mediaCurrentTime=n.currentTime,M.rr_mediaPlaybackRate=n.playbackRate,M.rr_mediaMuted=n.muted,M.rr_mediaLoop=n.loop,M.rr_mediaVolume=n.volume}if(b||(n.scrollLeft&&(k.rr_scrollLeft=n.scrollLeft),n.scrollTop&&(k.rr_scrollTop=n.scrollTop)),w){const{width:M,height:E}=n.getBoundingClientRect();k={class:k.class,rr_width:`${M}px`,rr_height:`${E}px`}}f==="iframe"&&!g(k.src)&&(n.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(n)||void 0,needBlock:w,rootId:y,isCustom:A}}function ae(n){return n==null?"":n.toLowerCase()}function qr(n,e){if(e.comment&&n.type===ve.Comment)return!0;if(n.type===ve.Element){if(e.script&&(n.tagName==="script"||n.tagName==="link"&&(n.attributes.rel==="preload"||n.attributes.rel==="modulepreload")&&n.attributes.as==="script"||n.tagName==="link"&&n.attributes.rel==="prefetch"&&typeof n.attributes.href=="string"&&eo(n.attributes.href)==="js"))return!0;if(e.headFavicon&&(n.tagName==="link"&&n.attributes.rel==="shortcut icon"||n.tagName==="meta"&&(ae(n.attributes.name).match(/^msapplication-tile(image|color)$/)||ae(n.attributes.name)==="application-name"||ae(n.attributes.rel)==="icon"||ae(n.attributes.rel)==="apple-touch-icon"||ae(n.attributes.rel)==="shortcut icon")))return!0;if(n.tagName==="meta"){if(e.headMetaDescKeywords&&ae(n.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ae(n.attributes.property).match(/^(og|twitter|fb):/)||ae(n.attributes.name).match(/^(og|twitter):/)||ae(n.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(ae(n.attributes.name)==="robots"||ae(n.attributes.name)==="googlebot"||ae(n.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&n.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(ae(n.attributes.name)==="author"||ae(n.attributes.name)==="generator"||ae(n.attributes.name)==="framework"||ae(n.attributes.name)==="publisher"||ae(n.attributes.name)==="progid"||ae(n.attributes.property).match(/^article:/)||ae(n.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(ae(n.attributes.name)==="google-site-verification"||ae(n.attributes.name)==="yandex-verification"||ae(n.attributes.name)==="csrf-token"||ae(n.attributes.name)==="p:domain_verify"||ae(n.attributes.name)==="verify-v1"||ae(n.attributes.name)==="verification"||ae(n.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function rt(n,e){const{doc:t,mirror:i,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:l,skipChild:c=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskTextFn:g,maskInputFn:b,slimDOMOptions:y,dataURLOptions:w={},inlineImages:f=!1,recordCanvas:k=!1,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M=5e3,onStylesheetLoad:E,stylesheetLoadTimeout:D=5e3,keepIframeSrcFn:G=()=>!1,newlyAddedElement:Z=!1}=e;let{needsMask:K}=e,{preserveWhiteSpace:Q=!0}=e;!K&&n.childNodes&&(K=oo(n,a,l,K===void 0));const de=Kr(n,{doc:t,mirror:i,blockClass:s,blockSelector:o,needsMask:K,inlineStylesheet:p,maskInputOptions:m,maskTextFn:g,maskInputFn:b,dataURLOptions:w,inlineImages:f,recordCanvas:k,keepIframeSrcFn:G,newlyAddedElement:Z});if(!de)return console.warn(n,"not serialized"),null;let _e;i.hasNode(n)?_e=i.getId(n):qr(de,y)||!Q&&de.type===ve.Text&&!de.isStyle&&!de.textContent.replace(/^\s+|\s+$/gm,"").length?_e=xt:_e=no();const j=Object.assign(de,{id:_e});if(i.add(n,j),_e===xt)return null;x&&x(n);let Oe=!c;if(j.type===ve.Element){Oe=Oe&&!j.needBlock,delete j.needBlock;const ge=n.shadowRoot;ge&&St(ge)&&(j.isShadowHost=!0)}if((j.type===ve.Document||j.type===ve.Element)&&Oe){y.headWhitespace&&j.type===ve.Element&&j.tagName==="head"&&(Q=!1);const ge={doc:t,mirror:i,blockClass:s,blockSelector:o,needsMask:K,maskTextClass:a,maskTextSelector:l,skipChild:c,inlineStylesheet:p,maskInputOptions:m,maskTextFn:g,maskInputFn:b,slimDOMOptions:y,dataURLOptions:w,inlineImages:f,recordCanvas:k,preserveWhiteSpace:Q,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:G};if(!(j.type===ve.Element&&j.tagName==="textarea"&&j.attributes.value!==void 0))for(const Ge of Array.from(n.childNodes)){const Se=rt(Ge,ge);Se&&j.childNodes.push(Se)}if(yr(n)&&n.shadowRoot)for(const Ge of Array.from(n.shadowRoot.childNodes)){const Se=rt(Ge,ge);Se&&(St(n.shadowRoot)&&(Se.isShadow=!0),j.childNodes.push(Se))}}return n.parentNode&&kt(n.parentNode)&&St(n.parentNode)&&(j.isShadow=!0),j.type===ve.Element&&j.tagName==="iframe"&&Vr(n,()=>{const ge=n.contentDocument;if(ge&&A){const Ge=rt(ge,{doc:ge,mirror:i,blockClass:s,blockSelector:o,needsMask:K,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskTextFn:g,maskInputFn:b,slimDOMOptions:y,dataURLOptions:w,inlineImages:f,recordCanvas:k,preserveWhiteSpace:Q,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:G});Ge&&A(n,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(n,()=>{if(E){const ge=rt(n,{doc:t,mirror:i,blockClass:s,blockSelector:o,needsMask:K,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskTextFn:g,maskInputFn:b,slimDOMOptions:y,dataURLOptions:w,inlineImages:f,recordCanvas:k,preserveWhiteSpace:Q,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:G});ge&&E(n,ge)}},D),j}function Wr(n,e){const{mirror:t=new Xs,blockClass:i="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:l=!0,inlineImages:c=!1,recordCanvas:p=!1,maskAllInputs:m=!1,maskTextFn:g,maskInputFn:b,slimDOM:y=!1,dataURLOptions:w,preserveWhiteSpace:f,onSerialize:k,onIframeLoad:x,iframeLoadTimeout:A,onStylesheetLoad:M,stylesheetLoadTimeout:E,keepIframeSrcFn:D=()=>!1}=e||{};return rt(n,{doc:n,mirror:t,blockClass:i,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:m===!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}:m===!1?{password:!0}:m,maskTextFn:g,maskInputFn:b,slimDOMOptions:y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:y==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:y===!1?{}:y,dataURLOptions:w,inlineImages:c,recordCanvas:p,preserveWhiteSpace:f,onSerialize:k,onIframeLoad:x,iframeLoadTimeout:A,onStylesheetLoad:M,stylesheetLoadTimeout:E,keepIframeSrcFn:D,newlyAddedElement:!1})}function He(n,e,t=document){const i={capture:!0,passive:!0};return t.addEventListener(n,e,i),()=>t.removeEventListener(n,e,i)}const lt=`Please stop import mirror directly. Instead of that,\r
|
|
1131
|
+
</div>`}renderTransactionIssuesComponent(){const e=document.querySelector("#main-header"),t=document.querySelector("#main-content"),i=document.querySelector("#main-footer");switch(e&&(e.style.display="none"),t&&t.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(n){n[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment"})(ve||(ve={}));function yr(n){return n.nodeType===n.ELEMENT_NODE}function kt(n){const e=n==null?void 0:n.host;return(e==null?void 0:e.shadowRoot)===n}function St(n){return Object.prototype.toString.call(n)==="[object ShadowRoot]"}function Cr(n){return n.includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n}function wr(n){const{cssText:e}=n;if(e.split('"').length<3)return e;const t=["@import",`url(${JSON.stringify(n.href)})`];return n.layerName===""?t.push("layer"):n.layerName&&t.push(`layer(${n.layerName})`),n.supportsText&&t.push(`supports(${n.supportsText})`),n.media.length&&t.push(n.media.mediaText),t.join(" ")+";"}function Ft(n){try{const e=n.rules||n.cssRules;return e?Cr(Array.from(e,Ys).join("")):null}catch{return null}}function Ys(n){let e;if(Sr(n))try{e=Ft(n.styleSheet)||wr(n)}catch{}else if(xr(n)&&n.selectorText.includes(":"))return kr(n.cssText);return e||n.cssText}function kr(n){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return n.replace(e,"$1\\$2")}function Sr(n){return"styleSheet"in n}function xr(n){return"selectorText"in n}class Xs{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const i=(t=this.getMeta(e))===null||t===void 0?void 0:t.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 t=this.getId(e);this.idNodeMap.delete(t),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,t){const i=t.id;this.idNodeMap.set(i,e),this.nodeMetaMap.set(e,t)}replace(e,t){const i=this.getNode(e);if(i){const s=this.nodeMetaMap.get(i);s&&this.nodeMetaMap.set(t,s)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Ar(){return new Xs}function Ui({element:n,maskInputOptions:e,tagName:t,type:i,value:s,maskInputFn:o}){let a=s||"";const l=i&&Kn(i);return(e[t.toLowerCase()]||l&&e[l])&&(o?a=o(a,n):a="*".repeat(a.length)),a}function Kn(n){return n.toLowerCase()}const $s="__rrweb_original__";function Mr(n){const e=n.getContext("2d");if(!e)return!0;const t=50;for(let i=0;i<n.width;i+=t)for(let s=0;s<n.height;s+=t){const o=e.getImageData,a=$s in o?o[$s]:o;if(new Uint32Array(a.call(e,i,s,Math.min(t,n.width-i),Math.min(t,n.height-s)).data.buffer).some(c=>c!==0))return!1}return!0}function Vi(n){const e=n.type;return n.hasAttribute("data-rr-is-password")?"password":e?Kn(e):null}function eo(n,e){var t;let i;try{i=new URL(n,e??window.location.href)}catch{return null}const s=/\.([0-9a-z]+)(?:$)/i,o=i.pathname.match(s);return(t=o==null?void 0:o[1])!==null&&t!==void 0?t:null}let Lr=1;const Tr=new RegExp("[^a-z0-9-_:]"),xt=-2;function no(){return Lr++}function _r(n){if(n instanceof HTMLFormElement)return"form";const e=Kn(n.tagName);return Tr.test(e)?"div":e}function Er(n){let e="";return n.indexOf("//")>-1?e=n.split("/").slice(0,3).join("/"):e=n.split("/")[0],e=e.split("?")[0],e}let ot,to;const Pr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ir=/^(?:[a-z+]+:)?\/\//i,Dr=/^www\..*/i,Br=/^(data:)([^,]*),(.*)/i;function Kt(n,e){return(n||"").replace(Pr,(t,i,s,o,a,l)=>{const c=s||a||l,p=i||o||"";if(!c)return t;if(Ir.test(c)||Dr.test(c))return`url(${p}${c}${p})`;if(Br.test(c))return`url(${p}${c}${p})`;if(c[0]==="/")return`url(${p}${Er(e)+c}${p})`;const m=e.split("/"),g=c.split("/");m.pop();for(const b of g)b!=="."&&(b===".."?m.pop():m.push(b));return`url(${p}${m.join("/")}${p})`})}const Rr=/^[^ \t\n\r\u000c]+/,Hr=/^[, \t\n\r\u000c]+/;function Nr(n,e){if(e.trim()==="")return e;let t=0;function i(o){let a;const l=o.exec(e.substring(t));return l?(a=l[0],t+=a.length,a):""}const s=[];for(;i(Hr),!(t>=e.length);){let o=i(Rr);if(o.slice(-1)===",")o=at(n,o.substring(0,o.length-1)),s.push(o);else{let a="";o=at(n,o);let l=!1;for(;;){const c=e.charAt(t);if(c===""){s.push((o+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){t+=1,s.push((o+a).trim());break}else c==="("&&(l=!0);a+=c,t+=1}}}return s.join(", ")}function at(n,e){if(!e||e.trim()==="")return e;const t=n.createElement("a");return t.href=e,t.href}function Or(n){return!!(n.tagName==="svg"||n.ownerSVGElement)}function Fi(){const n=document.createElement("a");return n.href="",n.href}function io(n,e,t,i){return i&&(t==="src"||t==="href"&&!(e==="use"&&i[0]==="#")||t==="xlink:href"&&i[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?at(n,i):t==="srcset"?Nr(n,i):t==="style"?Kt(i,Fi()):e==="object"&&t==="data"?at(n,i):i)}function so(n,e,t){return(n==="video"||n==="audio")&&e==="autoplay"}function Ur(n,e,t){try{if(typeof e=="string"){if(n.classList.contains(e))return!0}else for(let i=n.classList.length;i--;){const s=n.classList[i];if(e.test(s))return!0}if(t)return n.matches(t)}catch{}return!1}function Gt(n,e,t){if(!n)return!1;if(n.nodeType!==n.ELEMENT_NODE)return t?Gt(n.parentNode,e,t):!1;for(let i=n.classList.length;i--;){const s=n.classList[i];if(e.test(s))return!0}return t?Gt(n.parentNode,e,t):!1}function oo(n,e,t,i){try{const s=n.nodeType===n.ELEMENT_NODE?n:n.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(Gt(s,e,i))return!0;if(t){if(i){if(s.closest(t))return!0}else if(s.matches(t))return!0}}catch{}return!1}function Vr(n,e,t){const i=n.contentWindow;if(!i)return;let s=!1,o;try{o=i.document.readyState}catch{return}if(o!=="complete"){const l=setTimeout(()=>{s||(e(),s=!0)},t);n.addEventListener("load",()=>{clearTimeout(l),s=!0,e()});return}const a="about:blank";if(i.location.href!==a||n.src===a||n.src==="")return setTimeout(e,0),n.addEventListener("load",e);n.addEventListener("load",e)}function Fr(n,e,t){let i=!1,s;try{s=n.sheet}catch{return}if(s)return;const o=setTimeout(()=>{i||(e(),i=!0)},t);n.addEventListener("load",()=>{clearTimeout(o),i=!0,e()})}function Kr(n,e){const{doc:t,mirror:i,blockClass:s,blockSelector:o,needsMask:a,inlineStylesheet:l,maskInputOptions:c={},maskTextFn:p,maskInputFn:m,dataURLOptions:g={},inlineImages:b,recordCanvas:y,keepIframeSrcFn:w,newlyAddedElement:f=!1}=e,k=Gr(t,i);switch(n.nodeType){case n.DOCUMENT_NODE:return n.compatMode!=="CSS1Compat"?{type:ve.Document,childNodes:[],compatMode:n.compatMode}:{type:ve.Document,childNodes:[]};case n.DOCUMENT_TYPE_NODE:return{type:ve.DocumentType,name:n.name,publicId:n.publicId,systemId:n.systemId,rootId:k};case n.ELEMENT_NODE:return zr(n,{doc:t,blockClass:s,blockSelector:o,inlineStylesheet:l,maskInputOptions:c,maskInputFn:m,dataURLOptions:g,inlineImages:b,recordCanvas:y,keepIframeSrcFn:w,newlyAddedElement:f,rootId:k});case n.TEXT_NODE:return jr(n,{needsMask:a,maskTextFn:p,rootId:k});case n.CDATA_SECTION_NODE:return{type:ve.CDATA,textContent:"",rootId:k};case n.COMMENT_NODE:return{type:ve.Comment,textContent:n.textContent||"",rootId:k};default:return!1}}function Gr(n,e){if(!e.hasNode(n))return;const t=e.getId(n);return t===1?void 0:t}function jr(n,e){var t;const{needsMask:i,maskTextFn:s,rootId:o}=e,a=n.parentNode&&n.parentNode.tagName;let l=n.textContent;const c=a==="STYLE"?!0:void 0,p=a==="SCRIPT"?!0:void 0;if(c&&l){try{n.nextSibling||n.previousSibling||!((t=n.parentNode.sheet)===null||t===void 0)&&t.cssRules&&(l=Ft(n.parentNode.sheet))}catch(m){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${m}`,n)}l=Kt(l,Fi())}return p&&(l="SCRIPT_PLACEHOLDER"),!c&&!p&&l&&i&&(l=s?s(l,n.parentElement):l.replace(/[\S]/g,"*")),{type:ve.Text,textContent:l||"",isStyle:c,rootId:o}}function zr(n,e){const{doc:t,blockClass:i,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:c={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:g,newlyAddedElement:b=!1,rootId:y}=e,w=Ur(n,i,s),f=_r(n);let k={};const x=n.attributes.length;for(let M=0;M<x;M++){const E=n.attributes[M];so(f,E.name,E.value)||(k[E.name]=io(t,f,Kn(E.name),E.value))}if(f==="link"&&o){const M=Array.from(t.styleSheets).find(D=>D.href===n.href);let E=null;M&&(E=Ft(M)),E&&(delete k.rel,delete k.href,k._cssText=Kt(E,M.href))}if(f==="style"&&n.sheet&&!(n.innerText||n.textContent||"").trim().length){const M=Ft(n.sheet);M&&(k._cssText=Kt(M,Fi()))}if(f==="input"||f==="textarea"||f==="select"){const M=n.value,E=n.checked;k.type!=="radio"&&k.type!=="checkbox"&&k.type!=="submit"&&k.type!=="button"&&M?k.value=Ui({element:n,type:Vi(n),tagName:f,value:M,maskInputOptions:a,maskInputFn:l}):E&&(k.checked=E)}if(f==="option"&&(n.selected&&!a.select?k.selected=!0:delete k.selected),f==="canvas"&&m){if(n.__context==="2d")Mr(n)||(k.rr_dataURL=n.toDataURL(c.type,c.quality));else if(!("__context"in n)){const M=n.toDataURL(c.type,c.quality),E=document.createElement("canvas");E.width=n.width,E.height=n.height;const D=E.toDataURL(c.type,c.quality);M!==D&&(k.rr_dataURL=M)}}if(f==="img"&&p){ot||(ot=t.createElement("canvas"),to=ot.getContext("2d"));const M=n,E=M.crossOrigin;M.crossOrigin="anonymous";const D=()=>{M.removeEventListener("load",D);try{ot.width=M.naturalWidth,ot.height=M.naturalHeight,to.drawImage(M,0,0),k.rr_dataURL=ot.toDataURL(c.type,c.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=n.paused?"paused":"played",M.rr_mediaCurrentTime=n.currentTime,M.rr_mediaPlaybackRate=n.playbackRate,M.rr_mediaMuted=n.muted,M.rr_mediaLoop=n.loop,M.rr_mediaVolume=n.volume}if(b||(n.scrollLeft&&(k.rr_scrollLeft=n.scrollLeft),n.scrollTop&&(k.rr_scrollTop=n.scrollTop)),w){const{width:M,height:E}=n.getBoundingClientRect();k={class:k.class,rr_width:`${M}px`,rr_height:`${E}px`}}f==="iframe"&&!g(k.src)&&(n.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(n)||void 0,needBlock:w,rootId:y,isCustom:A}}function ae(n){return n==null?"":n.toLowerCase()}function qr(n,e){if(e.comment&&n.type===ve.Comment)return!0;if(n.type===ve.Element){if(e.script&&(n.tagName==="script"||n.tagName==="link"&&(n.attributes.rel==="preload"||n.attributes.rel==="modulepreload")&&n.attributes.as==="script"||n.tagName==="link"&&n.attributes.rel==="prefetch"&&typeof n.attributes.href=="string"&&eo(n.attributes.href)==="js"))return!0;if(e.headFavicon&&(n.tagName==="link"&&n.attributes.rel==="shortcut icon"||n.tagName==="meta"&&(ae(n.attributes.name).match(/^msapplication-tile(image|color)$/)||ae(n.attributes.name)==="application-name"||ae(n.attributes.rel)==="icon"||ae(n.attributes.rel)==="apple-touch-icon"||ae(n.attributes.rel)==="shortcut icon")))return!0;if(n.tagName==="meta"){if(e.headMetaDescKeywords&&ae(n.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ae(n.attributes.property).match(/^(og|twitter|fb):/)||ae(n.attributes.name).match(/^(og|twitter):/)||ae(n.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(ae(n.attributes.name)==="robots"||ae(n.attributes.name)==="googlebot"||ae(n.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&n.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(ae(n.attributes.name)==="author"||ae(n.attributes.name)==="generator"||ae(n.attributes.name)==="framework"||ae(n.attributes.name)==="publisher"||ae(n.attributes.name)==="progid"||ae(n.attributes.property).match(/^article:/)||ae(n.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(ae(n.attributes.name)==="google-site-verification"||ae(n.attributes.name)==="yandex-verification"||ae(n.attributes.name)==="csrf-token"||ae(n.attributes.name)==="p:domain_verify"||ae(n.attributes.name)==="verify-v1"||ae(n.attributes.name)==="verification"||ae(n.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function rt(n,e){const{doc:t,mirror:i,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:l,skipChild:c=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskTextFn:g,maskInputFn:b,slimDOMOptions:y,dataURLOptions:w={},inlineImages:f=!1,recordCanvas:k=!1,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M=5e3,onStylesheetLoad:E,stylesheetLoadTimeout:D=5e3,keepIframeSrcFn:F=()=>!1,newlyAddedElement:Z=!1}=e;let{needsMask:G}=e,{preserveWhiteSpace:Q=!0}=e;!G&&n.childNodes&&(G=oo(n,a,l,G===void 0));const de=Kr(n,{doc:t,mirror:i,blockClass:s,blockSelector:o,needsMask:G,inlineStylesheet:p,maskInputOptions:m,maskTextFn:g,maskInputFn:b,dataURLOptions:w,inlineImages:f,recordCanvas:k,keepIframeSrcFn:F,newlyAddedElement:Z});if(!de)return console.warn(n,"not serialized"),null;let _e;i.hasNode(n)?_e=i.getId(n):qr(de,y)||!Q&&de.type===ve.Text&&!de.isStyle&&!de.textContent.replace(/^\s+|\s+$/gm,"").length?_e=xt:_e=no();const j=Object.assign(de,{id:_e});if(i.add(n,j),_e===xt)return null;x&&x(n);let Oe=!c;if(j.type===ve.Element){Oe=Oe&&!j.needBlock,delete j.needBlock;const ge=n.shadowRoot;ge&&St(ge)&&(j.isShadowHost=!0)}if((j.type===ve.Document||j.type===ve.Element)&&Oe){y.headWhitespace&&j.type===ve.Element&&j.tagName==="head"&&(Q=!1);const ge={doc:t,mirror:i,blockClass:s,blockSelector:o,needsMask:G,maskTextClass:a,maskTextSelector:l,skipChild:c,inlineStylesheet:p,maskInputOptions:m,maskTextFn:g,maskInputFn:b,slimDOMOptions:y,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(n.childNodes)){const Se=rt(Ge,ge);Se&&j.childNodes.push(Se)}if(yr(n)&&n.shadowRoot)for(const Ge of Array.from(n.shadowRoot.childNodes)){const Se=rt(Ge,ge);Se&&(St(n.shadowRoot)&&(Se.isShadow=!0),j.childNodes.push(Se))}}return n.parentNode&&kt(n.parentNode)&&St(n.parentNode)&&(j.isShadow=!0),j.type===ve.Element&&j.tagName==="iframe"&&Vr(n,()=>{const ge=n.contentDocument;if(ge&&A){const Ge=rt(ge,{doc:ge,mirror:i,blockClass:s,blockSelector:o,needsMask:G,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskTextFn:g,maskInputFn:b,slimDOMOptions:y,dataURLOptions:w,inlineImages:f,recordCanvas:k,preserveWhiteSpace:Q,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:F});Ge&&A(n,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(n,()=>{if(E){const ge=rt(n,{doc:t,mirror:i,blockClass:s,blockSelector:o,needsMask:G,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskTextFn:g,maskInputFn:b,slimDOMOptions:y,dataURLOptions:w,inlineImages:f,recordCanvas:k,preserveWhiteSpace:Q,onSerialize:x,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:F});ge&&E(n,ge)}},D),j}function Wr(n,e){const{mirror:t=new Xs,blockClass:i="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:l=!0,inlineImages:c=!1,recordCanvas:p=!1,maskAllInputs:m=!1,maskTextFn:g,maskInputFn:b,slimDOM:y=!1,dataURLOptions:w,preserveWhiteSpace:f,onSerialize:k,onIframeLoad:x,iframeLoadTimeout:A,onStylesheetLoad:M,stylesheetLoadTimeout:E,keepIframeSrcFn:D=()=>!1}=e||{};return rt(n,{doc:n,mirror:t,blockClass:i,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:m===!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}:m===!1?{password:!0}:m,maskTextFn:g,maskInputFn:b,slimDOMOptions:y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:y==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:y===!1?{}:y,dataURLOptions:w,inlineImages:c,recordCanvas:p,preserveWhiteSpace:f,onSerialize:k,onIframeLoad:x,iframeLoadTimeout:A,onStylesheetLoad:M,stylesheetLoadTimeout:E,keepIframeSrcFn:D,newlyAddedElement:!1})}function He(n,e,t=document){const i={capture:!0,passive:!0};return t.addEventListener(n,e,i),()=>t.removeEventListener(n,e,i)}const lt=`Please stop import mirror directly. Instead of that,\r
|
|
1132
1132
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
1133
|
-
or you can use record.mirror to access the mirror instance during recording.`;let ao={map:{},getId(){return console.error(lt),-1},getNode(){return console.error(lt),null},removeNodeFromMap(){console.error(lt)},has(){return console.error(lt),!1},reset(){console.error(lt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ao=new Proxy(ao,{get(n,e,t){return e==="map"&&console.error(lt),Reflect.get(n,e,t)}}));function At(n,e,t={}){let i=null,s=0;return function(...o){const a=Date.now();!s&&t.leading===!1&&(s=a);const l=e-(a-s),c=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),s=a,n.apply(c,o)):!i&&t.trailing!==!1&&(i=setTimeout(()=>{s=t.leading===!1?0:Date.now(),i=null,n.apply(c,o)},l))}}function jt(n,e,t,i,s=window){const o=s.Object.getOwnPropertyDescriptor(n,e);return s.Object.defineProperty(n,e,i?t:{set(a){setTimeout(()=>{t.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>jt(n,e,o||{},!0)}function ct(n,e,t){try{if(!(e in n))return()=>{};const i=n[e],s=t(i);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i}})),n[e]=s,()=>{n[e]=i}}catch{return()=>{}}}let zt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(zt=()=>new Date().getTime());function ro(n){var e,t,i,s,o,a;const l=n.document;return{left:l.scrollingElement?l.scrollingElement.scrollLeft:n.pageXOffset!==void 0?n.pageXOffset:(l==null?void 0:l.documentElement.scrollLeft)||((t=(e=l==null?void 0:l.body)===null||e===void 0?void 0:e.parentElement)===null||t===void 0?void 0:t.scrollLeft)||((i=l==null?void 0:l.body)===null||i===void 0?void 0:i.scrollLeft)||0,top:l.scrollingElement?l.scrollingElement.scrollTop:n.pageYOffset!==void 0?n.pageYOffset:(l==null?void 0:l.documentElement.scrollTop)||((o=(s=l==null?void 0:l.body)===null||s===void 0?void 0:s.parentElement)===null||o===void 0?void 0:o.scrollTop)||((a=l==null?void 0:l.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(n){return n?n.nodeType===n.ELEMENT_NODE?n:n.parentElement:null}function Ne(n,e,t,i){if(!n)return!1;const s=uo(n);if(!s)return!1;try{if(typeof e=="string"){if(s.classList.contains(e)||i&&s.closest("."+e)!==null)return!0}else if(Gt(s,e,i))return!0}catch{}return!!(t&&(s.matches(t)||i&&s.closest(t)!==null))}function Zr(n,e){return e.getId(n)!==-1}function Ki(n,e){return e.getId(n)===xt}function ho(n,e){if(kt(n))return!1;const t=e.getId(n);return e.has(t)?n.parentNode&&n.parentNode.nodeType===n.DOCUMENT_NODE?!1:n.parentNode?ho(n.parentNode,e):!0:!0}function Gi(n){return!!n.changedTouches}function Qr(n=window){"NodeList"in n&&!n.NodeList.prototype.forEach&&(n.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in n&&!n.DOMTokenList.prototype.forEach&&(n.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}function mo(n,e){return!!(n.nodeName==="IFRAME"&&e.getMeta(n))}function po(n,e){return!!(n.nodeName==="LINK"&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute&&n.getAttribute("rel")==="stylesheet"&&e.getMeta(n))}function ji(n){return!!(n!=null&&n.shadowRoot)}class Jr{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return(t=this.styleIDMap.get(e))!==null&&t!==void 0?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let i;return t===void 0?i=this.id++:i=t,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(n){var e,t;let i=null;return((t=(e=n.getRootNode)===null||e===void 0?void 0:e.call(n))===null||t===void 0?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&n.getRootNode().host&&(i=n.getRootNode().host),i}function Yr(n){let e=n,t;for(;t=vo(e);)e=t;return e}function Xr(n){const e=n.ownerDocument;if(!e)return!1;const t=Yr(n);return e.contains(t)}function bo(n){const e=n.ownerDocument;return e?e.contains(n)||Xr(n):!1}var X=(n=>(n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n))(X||{}),J=(n=>(n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n))(J||{}),Ke=(n=>(n[n.MouseUp=0]="MouseUp",n[n.MouseDown=1]="MouseDown",n[n.Click=2]="Click",n[n.ContextMenu=3]="ContextMenu",n[n.DblClick=4]="DblClick",n[n.Focus=5]="Focus",n[n.Blur=6]="Blur",n[n.TouchStart=7]="TouchStart",n[n.TouchMove_Departed=8]="TouchMove_Departed",n[n.TouchEnd=9]="TouchEnd",n[n.TouchCancel=10]="TouchCancel",n))(Ke||{}),vn=(n=>(n[n.Mouse=0]="Mouse",n[n.Pen=1]="Pen",n[n.Touch=2]="Touch",n))(vn||{}),dt=(n=>(n[n["2D"]=0]="2D",n[n.WebGL=1]="WebGL",n[n.WebGL2=2]="WebGL2",n))(dt||{});function fo(n){return"__ln"in n}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 t=this.head;for(let i=0;i<e;i++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&fo(e.previousSibling)){const i=e.previousSibling.__ln.next;t.next=i,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,i&&(i.previous=t)}else if(e.nextSibling&&fo(e.nextSibling)&&e.nextSibling.__ln.previous){const i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const go=(n,e)=>`${n}@${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=[],t=new Set,i=new $r,s=c=>{let p=c,m=xt;for(;m===xt;)p=p&&p.nextSibling,m=p&&this.mirror.getId(p);return m},o=c=>{if(!c.parentNode||!bo(c)||c.parentNode.tagName==="TEXTAREA")return;const p=kt(c.parentNode)?this.mirror.getId(vo(c)):this.mirror.getId(c.parentNode),m=s(c);if(p===-1||m===-1)return i.addNode(c);const g=rt(c,{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(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(b,y)=>{this.iframeManager.attachIframe(b,y),this.shadowDomManager.observeAttachShadow(b)},onStylesheetLoad:(b,y)=>{this.stylesheetManager.attachLinkElement(b,y)}});g&&(e.push({parentId:p,nextId:m,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)yo(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||o(c);for(const c of this.addedSet)!wo(this.droppedSet,c)&&!yo(this.removes,c,this.mirror)||wo(this.movedSet,c)?o(c):this.droppedSet.add(c);let a=null;for(;i.length;){let c=null;if(a){const p=this.mirror.getId(a.value.parentNode),m=s(a.value);p!==-1&&m!==-1&&(c=a)}if(!c){let p=i.tail;for(;p;){const m=p;if(p=p.previous,m){const g=this.mirror.getId(m.value.parentNode);if(s(m.value)===-1)continue;if(g!==-1){c=m;break}else{const y=m.value;if(y.parentNode&&y.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const w=y.parentNode.host;if(this.mirror.getId(w)!==-1){c=m;break}}}}}}if(!c){for(;i.head;)i.removeNode(i.head.value);break}a=c.previous,i.removeNode(c.value),o(c.value)}const l={texts:this.texts.map(c=>{const p=c.node;return p.parentNode&&p.parentNode.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(p.parentNode),{id:this.mirror.getId(p),value:c.value}}).filter(c=>!t.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:p}=c;if(typeof p.style=="string"){const m=JSON.stringify(c.styleDiff),g=JSON.stringify(c._unchangedStyles);m.length<p.style.length&&(m+g).split("var(").length===p.style.split("var(").length&&(p.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:p}}).filter(c=>!t.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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(l))},this.genTextAreaValueMutation=e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.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 t=e.target.textContent;!Ne(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:oo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,uo(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let i=e.attributeName,s=e.target.getAttribute(i);if(i==="value"){const a=Vi(t);s=Ui({element:t,maskInputOptions:this.maskInputOptions,tagName:t.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(t.tagName==="IFRAME"&&i==="src"&&!this.keepIframeSrcFn(s))if(!t.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"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!so(t.tagName,i)&&(o.attributes[i]=io(this.doc,Kn(t.tagName),Kn(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 l of Array.from(t.style)){const c=t.style.getPropertyValue(l),p=t.style.getPropertyPriority(l);c!==a.style.getPropertyValue(l)||p!==a.style.getPropertyPriority(l)?p===""?o.styleDiff[l]=c:o.styleDiff[l]=[c,p]:o._unchangedStyles[l]=[c,p]}for(const l of Array.from(a.style))t.style.getPropertyValue(l)===""&&(o.styleDiff[l]=!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(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const i=this.mirror.getId(t),s=kt(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Ne(e.target,this.blockClass,this.blockSelector,!1)||Ki(t,this.mirror)||!Zr(t,this.mirror)||(this.addedSet.has(t)?(zi(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&i===-1||ho(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[go(i,s)]?zi(this.movedSet,t):this.removes.push({parentId:s,id:i,isShadow:kt(e.target)&&St(e.target)?!0:void 0})),this.mapRemoves.push(t))});break}}},this.genAdds=(e,t)=>{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;t&&this.mirror.hasNode(t)&&(i=this.mirror.getId(t)),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(t=>{this[t]=e[t]})}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(n,e){n.delete(e),e.childNodes.forEach(t=>zi(n,t))}function yo(n,e,t){return n.length===0?!1:Co(n,e,t)}function Co(n,e,t){const{parentNode:i}=e;if(!i)return!1;const s=t.getId(i);return n.some(o=>o.id===s)?!0:Co(n,i,t)}function wo(n,e){return n.size===0?!1:ko(n,e)}function ko(n,e){const{parentNode:t}=e;return t?n.has(t)?!0:ko(n,t):!1}let Mt;function nl(n){Mt=n}function tl(){Mt=void 0}const Y=n=>Mt?(...t)=>{try{return n(...t)}catch(i){if(Mt&&Mt(i)===!0)return;throw i}}:n,Gn=[];function Lt(n){try{if("composedPath"in n){const e=n.composedPath();if(e.length)return e[0]}else if("path"in n&&n.path.length)return n.path[0]}catch{}return n&&n.target}function So(n,e){var t,i;const s=new el;Gn.push(s),s.init(n);let o=window.MutationObserver||window.__rrMutationObserver;const a=(i=(t=window==null?void 0:window.Zone)===null||t===void 0?void 0:t.__symbol__)===null||i===void 0?void 0:i.call(t,"MutationObserver");a&&window[a]&&(o=window[a]);const l=new o(Y(s.processMutations.bind(s)));return l.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function il({mousemoveCb:n,sampling:e,doc:t,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=[],l;const c=At(Y(g=>{const b=Date.now()-l;n(a.map(y=>(y.timeOffset-=b,y)),g),a=[],l=null}),o),p=Y(At(Y(g=>{const b=Lt(g),{clientX:y,clientY:w}=Gi(g)?g.changedTouches[0]:g;l||(l=zt()),a.push({x:y,y:w,id:i.getId(b),timeOffset:zt()-l}),c(typeof DragEvent<"u"&&g instanceof DragEvent?J.Drag:g instanceof MouseEvent?J.MouseMove:J.TouchMove)}),s,{trailing:!1})),m=[He("mousemove",p,t),He("touchmove",p,t),He("drag",p,t)];return Y(()=>{m.forEach(g=>g())})}function sl({mouseInteractionCb:n,doc:e,mirror:t,blockClass:i,blockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[];let c=null;const p=m=>g=>{const b=Lt(g);if(Ne(b,i,s,!0))return;let y=null,w=m;if("pointerType"in g){switch(g.pointerType){case"mouse":y=vn.Mouse;break;case"touch":y=vn.Touch;break;case"pen":y=vn.Pen;break}y===vn.Touch?Ke[m]===Ke.MouseDown?w="TouchStart":Ke[m]===Ke.MouseUp&&(w="TouchEnd"):vn.Pen}else Gi(g)&&(y=vn.Touch);y!==null?(c=y,(w.startsWith("Touch")&&y===vn.Touch||w.startsWith("Mouse")&&y===vn.Mouse)&&(y=null)):Ke[m]===Ke.Click&&(y=c,c=null);const f=Gi(g)?g.changedTouches[0]:g;if(!f)return;const k=t.getId(b),{clientX:x,clientY:A}=f;Y(n)(Object.assign({type:Ke[w],id:k,x,y:A},y!==null&&{pointerType:y}))};return Object.keys(Ke).filter(m=>Number.isNaN(Number(m))&&!m.endsWith("_Departed")&&a[m]!==!1).forEach(m=>{let g=Kn(m);const b=p(m);if(window.PointerEvent)switch(Ke[m]){case Ke.MouseDown:case Ke.MouseUp:g=g.replace("mouse","pointer");break;case Ke.TouchStart:case Ke.TouchEnd:return}l.push(He(g,b,e))}),Y(()=>{l.forEach(m=>m())})}function xo({scrollCb:n,doc:e,mirror:t,blockClass:i,blockSelector:s,sampling:o}){const a=Y(At(Y(l=>{const c=Lt(l);if(!c||Ne(c,i,s,!0))return;const p=t.getId(c);if(c===e&&e.defaultView){const m=ro(e.defaultView);n({id:p,x:m.left,y:m.top})}else n({id:p,x:c.scrollLeft,y:c.scrollTop})}),o.scroll||100));return He("scroll",a,e)}function ol({viewportResizeCb:n},{win:e}){let t=-1,i=-1;const s=Y(At(Y(()=>{const o=lo(),a=co();(t!==o||i!==a)&&(n({width:Number(a),height:Number(o)}),t=o,i=a)}),200));return He("resize",s,e)}const al=["INPUT","TEXTAREA","SELECT"],Ao=new WeakMap;function rl({inputCb:n,doc:e,mirror:t,blockClass:i,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:p,userTriggeredOnInput:m}){function g(A){let M=Lt(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 G=M.value,Z=!1;const K=Vi(M)||"";K==="radio"||K==="checkbox"?Z=M.checked:(l[D.toLowerCase()]||l[K])&&(G=Ui({element:M,maskInputOptions:l,tagName:D,type:K,value:G,maskInputFn:c})),b(M,m?{text:G,isChecked:Z,userTriggered:E}:{text:G,isChecked:Z});const Q=M.name;K==="radio"&&Q&&Z&&e.querySelectorAll(`input[type="radio"][name="${Q}"]`).forEach(de=>{if(de!==M){const _e=de.value;b(de,m?{text:_e,isChecked:!Z,userTriggered:!1}:{text:_e,isChecked:!Z})}})}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=t.getId(A);Y(n)(Object.assign(Object.assign({},M),{id:D}))}}const w=(p.input==="last"?["change"]:["input","change"]).map(A=>He(A,Y(g),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=>jt(A[0],A[1],{set(){Y(g)({target:this,isTrusted:!1})}},!1,f))),Y(()=>{w.forEach(A=>A())})}function qt(n){const e=[];function t(i,s){if(Wt("CSSGroupingRule")&&i.parentRule instanceof CSSGroupingRule||Wt("CSSMediaRule")&&i.parentRule instanceof CSSMediaRule||Wt("CSSSupportsRule")&&i.parentRule instanceof CSSSupportsRule||Wt("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 t(n,e)}function _n(n,e,t){let i,s;return n?(n.ownerNode?i=e.getId(n.ownerNode):s=t.getId(n),{styleId:s,id:i}):{}}function ll({styleSheetRuleCb:n,mirror:e,stylesheetManager:t},{win:i}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Y((m,g,b)=>{const[y,w]=b,{id:f,styleId:k}=_n(g,e,t.styleMirror);return(f&&f!==-1||k&&k!==-1)&&n({id:f,styleId:k,adds:[{rule:y,index:w}]}),m.apply(g,b)})});const o=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Y((m,g,b)=>{const[y]=b,{id:w,styleId:f}=_n(g,e,t.styleMirror);return(w&&w!==-1||f&&f!==-1)&&n({id:w,styleId:f,removes:[{index:y}]}),m.apply(g,b)})});let a;i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Y((m,g,b)=>{const[y]=b,{id:w,styleId:f}=_n(g,e,t.styleMirror);return(w&&w!==-1||f&&f!==-1)&&n({id:w,styleId:f,replace:y}),m.apply(g,b)})}));let l;i.CSSStyleSheet.prototype.replaceSync&&(l=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Y((m,g,b)=>{const[y]=b,{id:w,styleId:f}=_n(g,e,t.styleMirror);return(w&&w!==-1||f&&f!==-1)&&n({id:w,styleId:f,replaceSync:y}),m.apply(g,b)})}));const c={};Zt("CSSGroupingRule")?c.CSSGroupingRule=i.CSSGroupingRule:(Zt("CSSMediaRule")&&(c.CSSMediaRule=i.CSSMediaRule),Zt("CSSConditionRule")&&(c.CSSConditionRule=i.CSSConditionRule),Zt("CSSSupportsRule")&&(c.CSSSupportsRule=i.CSSSupportsRule));const p={};return Object.entries(c).forEach(([m,g])=>{p[m]={insertRule:g.prototype.insertRule,deleteRule:g.prototype.deleteRule},g.prototype.insertRule=new Proxy(p[m].insertRule,{apply:Y((b,y,w)=>{const[f,k]=w,{id:x,styleId:A}=_n(y.parentStyleSheet,e,t.styleMirror);return(x&&x!==-1||A&&A!==-1)&&n({id:x,styleId:A,adds:[{rule:f,index:[...qt(y),k||0]}]}),b.apply(y,w)})}),g.prototype.deleteRule=new Proxy(p[m].deleteRule,{apply:Y((b,y,w)=>{const[f]=w,{id:k,styleId:x}=_n(y.parentStyleSheet,e,t.styleMirror);return(k&&k!==-1||x&&x!==-1)&&n({id:k,styleId:x,removes:[{index:[...qt(y),f]}]}),b.apply(y,w)})})}),Y(()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=o,a&&(i.CSSStyleSheet.prototype.replace=a),l&&(i.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach(([m,g])=>{g.prototype.insertRule=p[m].insertRule,g.prototype.deleteRule=p[m].deleteRule})})}function Mo({mirror:n,stylesheetManager:e},t){var i,s,o;let a=null;t.nodeName==="#document"?a=n.getId(t):a=n.getId(t.host);const l=t.nodeName==="#document"?(i=t.defaultView)===null||i===void 0?void 0:i.Document:(o=(s=t.ownerDocument)===null||s===void 0?void 0:s.defaultView)===null||o===void 0?void 0:o.ShadowRoot,c=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!l||!c?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var p;return(p=c.get)===null||p===void 0?void 0:p.call(this)},set(p){var m;const g=(m=c.set)===null||m===void 0?void 0:m.call(this,p);if(a!==null&&a!==-1)try{e.adoptStyleSheets(p,a)}catch{}return g}}),Y(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))}function cl({styleDeclarationCb:n,mirror:e,ignoreCSSAttributes:t,stylesheetManager:i},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Y((l,c,p)=>{var m;const[g,b,y]=p;if(t.has(g))return o.apply(c,[g,b,y]);const{id:w,styleId:f}=_n((m=c.parentRule)===null||m===void 0?void 0:m.parentStyleSheet,e,i.styleMirror);return(w&&w!==-1||f&&f!==-1)&&n({id:w,styleId:f,set:{property:g,value:b,priority:y},index:qt(c.parentRule)}),l.apply(c,p)})});const a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Y((l,c,p)=>{var m;const[g]=p;if(t.has(g))return a.apply(c,[g]);const{id:b,styleId:y}=_n((m=c.parentRule)===null||m===void 0?void 0:m.parentStyleSheet,e,i.styleMirror);return(b&&b!==-1||y&&y!==-1)&&n({id:b,styleId:y,remove:{property:g},index:qt(c.parentRule)}),l.apply(c,p)})}),Y(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a})}function dl({mediaInteractionCb:n,blockClass:e,blockSelector:t,mirror:i,sampling:s,doc:o}){const a=Y(c=>At(Y(p=>{const m=Lt(p);if(!m||Ne(m,e,t,!0))return;const{currentTime:g,volume:b,muted:y,playbackRate:w,loop:f}=m;n({type:c,id:i.getId(m),currentTime:g,volume:b,muted:y,playbackRate:w,loop:f})}),s.media||500)),l=[He("play",a(0),o),He("pause",a(1),o),He("seeked",a(2),o),He("volumechange",a(3),o),He("ratechange",a(4),o)];return Y(()=>{l.forEach(c=>c())})}function ul({fontCb:n,doc:e}){const t=e.defaultView;if(!t)return()=>{};const i=[],s=new WeakMap,o=t.FontFace;t.FontFace=function(c,p,m){const g=new o(c,p,m);return s.set(g,{family:c,buffer:typeof p!="string",descriptors:m,fontSource:typeof p=="string"?p:JSON.stringify(Array.from(new Uint8Array(p)))}),g};const a=ct(e.fonts,"add",function(l){return function(c){return setTimeout(Y(()=>{const p=s.get(c);p&&(n(p),s.delete(c))}),0),l.apply(this,[c])}});return i.push(()=>{t.FontFace=o}),i.push(a),Y(()=>{i.forEach(l=>l())})}function hl(n){const{doc:e,mirror:t,blockClass:i,blockSelector:s,selectionCb:o}=n;let a=!0;const l=Y(()=>{const c=e.getSelection();if(!c||a&&(c!=null&&c.isCollapsed))return;a=c.isCollapsed||!1;const p=[],m=c.rangeCount||0;for(let g=0;g<m;g++){const b=c.getRangeAt(g),{startContainer:y,startOffset:w,endContainer:f,endOffset:k}=b;Ne(y,i,s,!0)||Ne(f,i,s,!0)||p.push({start:t.getId(y),startOffset:w,end:t.getId(f),endOffset:k})}o({ranges:p})});return l(),He("selectionchange",l)}function ml({doc:n,customElementCb:e}){const t=n.defaultView;return!t||!t.customElements?()=>{}:ct(t.customElements,"define",function(s){return function(o,a,l){try{e({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return s.apply(this,[o,a,l])}})}function pl(n,e){const{mutationCb:t,mousemoveCb:i,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:p,styleDeclarationCb:m,canvasMutationCb:g,fontCb:b,selectionCb:y,customElementCb:w}=n;n.mutationCb=(...f)=>{e.mutation&&e.mutation(...f),t(...f)},n.mousemoveCb=(...f)=>{e.mousemove&&e.mousemove(...f),i(...f)},n.mouseInteractionCb=(...f)=>{e.mouseInteraction&&e.mouseInteraction(...f),s(...f)},n.scrollCb=(...f)=>{e.scroll&&e.scroll(...f),o(...f)},n.viewportResizeCb=(...f)=>{e.viewportResize&&e.viewportResize(...f),a(...f)},n.inputCb=(...f)=>{e.input&&e.input(...f),l(...f)},n.mediaInteractionCb=(...f)=>{e.mediaInteaction&&e.mediaInteaction(...f),c(...f)},n.styleSheetRuleCb=(...f)=>{e.styleSheetRule&&e.styleSheetRule(...f),p(...f)},n.styleDeclarationCb=(...f)=>{e.styleDeclaration&&e.styleDeclaration(...f),m(...f)},n.canvasMutationCb=(...f)=>{e.canvasMutation&&e.canvasMutation(...f),g(...f)},n.fontCb=(...f)=>{e.font&&e.font(...f),b(...f)},n.selectionCb=(...f)=>{e.selection&&e.selection(...f),y(...f)},n.customElementCb=(...f)=>{e.customElement&&e.customElement(...f),w(...f)}}function vl(n,e={}){const t=n.doc.defaultView;if(!t)return()=>{};pl(n,e);let i;n.recordDOM&&(i=So(n,n.doc));const s=il(n),o=sl(n),a=xo(n),l=ol(n,{win:t}),c=rl(n),p=dl(n);let m=()=>{},g=()=>{},b=()=>{},y=()=>{};n.recordDOM&&(m=ll(n,{win:t}),g=Mo(n,n.doc),b=cl(n,{win:t}),n.collectFonts&&(y=ul(n)));const w=hl(n),f=ml(n),k=[];for(const x of n.plugins)k.push(x.observer(x.callback,t,x.options));return Y(()=>{Gn.forEach(x=>x.reset()),i==null||i.disconnect(),s(),o(),a(),l(),c(),p(),m(),g(),b(),y(),w(),f(),k.forEach(x=>x())})}function Wt(n){return typeof window[n]<"u"}function Zt(n){return!!(typeof window[n]<"u"&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}class Lo{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,i,s){const o=i||this.getIdToRemoteIdMap(e),a=s||this.getRemoteIdToIdMap(e);let l=o.get(t);return l||(l=this.generateIdFn(),o.set(t,l),a.set(l,t)),l}getIds(e,t){const i=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,i,s))}getRemoteId(e,t,i){const s=i||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const o=s.get(t);return o||-1}getRemoteIds(e,t){const i=this.getRemoteIdToIdMap(e);return t.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 t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class bl{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Lo(no),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,t){var i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],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 t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const o=this.transformCrossOriginEvent(s,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var i;switch(t.type){case X.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const s=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,s),this.patchRootIdOnNode(t.data.node,s),{timestamp:t.timestamp,type:X.IncrementalSnapshot,data:{source:J.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case X.Meta:case X.Load:case X.DomContentLoaded:return!1;case X.Plugin:return t;case X.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case X.IncrementalSnapshot:switch(t.data.source){case J.Mutation:return t.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)}),t.data.removes.forEach(s=>{this.replaceIds(s,e,["parentId","id"])}),t.data.attributes.forEach(s=>{this.replaceIds(s,e,["id"])}),t.data.texts.forEach(s=>{this.replaceIds(s,e,["id"])}),t;case J.Drag:case J.TouchMove:case J.MouseMove:return t.data.positions.forEach(s=>{this.replaceIds(s,e,["id"])}),t;case J.ViewportResize:return!1;case J.MediaInteraction:case J.MouseInteraction:case J.Scroll:case J.CanvasMutation:case J.Input:return this.replaceIds(t.data,e,["id"]),t;case J.StyleSheetRule:case J.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case J.Font:return t;case J.Selection:return t.data.ranges.forEach(s=>{this.replaceIds(s,e,["start","end"])}),t;case J.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(i=t.data.styles)===null||i===void 0||i.forEach(s=>{this.replaceStyleIds(s,e,["styleId"])}),t}}return!1}replace(e,t,i,s){for(const o of s)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(i,t[o]):t[o]=e.getId(i,t[o]));return t}replaceIds(e,t,i){return this.replace(this.crossOriginIframeMirror,e,t,i)}replaceStyleIds(e,t,i){return this.replace(this.crossOriginIframeStyleMirror,e,t,i)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(i=>{this.replaceIdOnNode(i,t)})}patchRootIdOnNode(e,t){e.type!==ve.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(i=>{this.patchRootIdOnNode(i,t)})}}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,t){if(!St(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const i=So(Object.assign(Object.assign({},this.bypassOptions),{doc:t,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,t){const i=this;this.restoreHandlers.push(ct(e.prototype,"attachShadow",function(s){return function(o){const a=s.call(this,o);return this.shadowRoot&&bo(this)&&i.addShadowRoot(this.shadowRoot,t),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
|
|
1133
|
+
or you can use record.mirror to access the mirror instance during recording.`;let ao={map:{},getId(){return console.error(lt),-1},getNode(){return console.error(lt),null},removeNodeFromMap(){console.error(lt)},has(){return console.error(lt),!1},reset(){console.error(lt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ao=new Proxy(ao,{get(n,e,t){return e==="map"&&console.error(lt),Reflect.get(n,e,t)}}));function At(n,e,t={}){let i=null,s=0;return function(...o){const a=Date.now();!s&&t.leading===!1&&(s=a);const l=e-(a-s),c=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),s=a,n.apply(c,o)):!i&&t.trailing!==!1&&(i=setTimeout(()=>{s=t.leading===!1?0:Date.now(),i=null,n.apply(c,o)},l))}}function jt(n,e,t,i,s=window){const o=s.Object.getOwnPropertyDescriptor(n,e);return s.Object.defineProperty(n,e,i?t:{set(a){setTimeout(()=>{t.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>jt(n,e,o||{},!0)}function ct(n,e,t){try{if(!(e in n))return()=>{};const i=n[e],s=t(i);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i}})),n[e]=s,()=>{n[e]=i}}catch{return()=>{}}}let zt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(zt=()=>new Date().getTime());function ro(n){var e,t,i,s,o,a;const l=n.document;return{left:l.scrollingElement?l.scrollingElement.scrollLeft:n.pageXOffset!==void 0?n.pageXOffset:(l==null?void 0:l.documentElement.scrollLeft)||((t=(e=l==null?void 0:l.body)===null||e===void 0?void 0:e.parentElement)===null||t===void 0?void 0:t.scrollLeft)||((i=l==null?void 0:l.body)===null||i===void 0?void 0:i.scrollLeft)||0,top:l.scrollingElement?l.scrollingElement.scrollTop:n.pageYOffset!==void 0?n.pageYOffset:(l==null?void 0:l.documentElement.scrollTop)||((o=(s=l==null?void 0:l.body)===null||s===void 0?void 0:s.parentElement)===null||o===void 0?void 0:o.scrollTop)||((a=l==null?void 0:l.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(n){return n?n.nodeType===n.ELEMENT_NODE?n:n.parentElement:null}function Ne(n,e,t,i){if(!n)return!1;const s=uo(n);if(!s)return!1;try{if(typeof e=="string"){if(s.classList.contains(e)||i&&s.closest("."+e)!==null)return!0}else if(Gt(s,e,i))return!0}catch{}return!!(t&&(s.matches(t)||i&&s.closest(t)!==null))}function Zr(n,e){return e.getId(n)!==-1}function Ki(n,e){return e.getId(n)===xt}function ho(n,e){if(kt(n))return!1;const t=e.getId(n);return e.has(t)?n.parentNode&&n.parentNode.nodeType===n.DOCUMENT_NODE?!1:n.parentNode?ho(n.parentNode,e):!0:!0}function Gi(n){return!!n.changedTouches}function Qr(n=window){"NodeList"in n&&!n.NodeList.prototype.forEach&&(n.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in n&&!n.DOMTokenList.prototype.forEach&&(n.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}function mo(n,e){return!!(n.nodeName==="IFRAME"&&e.getMeta(n))}function po(n,e){return!!(n.nodeName==="LINK"&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute&&n.getAttribute("rel")==="stylesheet"&&e.getMeta(n))}function ji(n){return!!(n!=null&&n.shadowRoot)}class Jr{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return(t=this.styleIDMap.get(e))!==null&&t!==void 0?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let i;return t===void 0?i=this.id++:i=t,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(n){var e,t;let i=null;return((t=(e=n.getRootNode)===null||e===void 0?void 0:e.call(n))===null||t===void 0?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&n.getRootNode().host&&(i=n.getRootNode().host),i}function Yr(n){let e=n,t;for(;t=vo(e);)e=t;return e}function Xr(n){const e=n.ownerDocument;if(!e)return!1;const t=Yr(n);return e.contains(t)}function bo(n){const e=n.ownerDocument;return e?e.contains(n)||Xr(n):!1}var X=(n=>(n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n))(X||{}),J=(n=>(n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n))(J||{}),Ke=(n=>(n[n.MouseUp=0]="MouseUp",n[n.MouseDown=1]="MouseDown",n[n.Click=2]="Click",n[n.ContextMenu=3]="ContextMenu",n[n.DblClick=4]="DblClick",n[n.Focus=5]="Focus",n[n.Blur=6]="Blur",n[n.TouchStart=7]="TouchStart",n[n.TouchMove_Departed=8]="TouchMove_Departed",n[n.TouchEnd=9]="TouchEnd",n[n.TouchCancel=10]="TouchCancel",n))(Ke||{}),vn=(n=>(n[n.Mouse=0]="Mouse",n[n.Pen=1]="Pen",n[n.Touch=2]="Touch",n))(vn||{}),dt=(n=>(n[n["2D"]=0]="2D",n[n.WebGL=1]="WebGL",n[n.WebGL2=2]="WebGL2",n))(dt||{});function fo(n){return"__ln"in n}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 t=this.head;for(let i=0;i<e;i++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&fo(e.previousSibling)){const i=e.previousSibling.__ln.next;t.next=i,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,i&&(i.previous=t)}else if(e.nextSibling&&fo(e.nextSibling)&&e.nextSibling.__ln.previous){const i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const go=(n,e)=>`${n}@${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=[],t=new Set,i=new $r,s=c=>{let p=c,m=xt;for(;m===xt;)p=p&&p.nextSibling,m=p&&this.mirror.getId(p);return m},o=c=>{if(!c.parentNode||!bo(c)||c.parentNode.tagName==="TEXTAREA")return;const p=kt(c.parentNode)?this.mirror.getId(vo(c)):this.mirror.getId(c.parentNode),m=s(c);if(p===-1||m===-1)return i.addNode(c);const g=rt(c,{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(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(b,y)=>{this.iframeManager.attachIframe(b,y),this.shadowDomManager.observeAttachShadow(b)},onStylesheetLoad:(b,y)=>{this.stylesheetManager.attachLinkElement(b,y)}});g&&(e.push({parentId:p,nextId:m,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)yo(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||o(c);for(const c of this.addedSet)!wo(this.droppedSet,c)&&!yo(this.removes,c,this.mirror)||wo(this.movedSet,c)?o(c):this.droppedSet.add(c);let a=null;for(;i.length;){let c=null;if(a){const p=this.mirror.getId(a.value.parentNode),m=s(a.value);p!==-1&&m!==-1&&(c=a)}if(!c){let p=i.tail;for(;p;){const m=p;if(p=p.previous,m){const g=this.mirror.getId(m.value.parentNode);if(s(m.value)===-1)continue;if(g!==-1){c=m;break}else{const y=m.value;if(y.parentNode&&y.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const w=y.parentNode.host;if(this.mirror.getId(w)!==-1){c=m;break}}}}}}if(!c){for(;i.head;)i.removeNode(i.head.value);break}a=c.previous,i.removeNode(c.value),o(c.value)}const l={texts:this.texts.map(c=>{const p=c.node;return p.parentNode&&p.parentNode.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(p.parentNode),{id:this.mirror.getId(p),value:c.value}}).filter(c=>!t.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:p}=c;if(typeof p.style=="string"){const m=JSON.stringify(c.styleDiff),g=JSON.stringify(c._unchangedStyles);m.length<p.style.length&&(m+g).split("var(").length===p.style.split("var(").length&&(p.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:p}}).filter(c=>!t.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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(l))},this.genTextAreaValueMutation=e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.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 t=e.target.textContent;!Ne(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:oo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,uo(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let i=e.attributeName,s=e.target.getAttribute(i);if(i==="value"){const a=Vi(t);s=Ui({element:t,maskInputOptions:this.maskInputOptions,tagName:t.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(t.tagName==="IFRAME"&&i==="src"&&!this.keepIframeSrcFn(s))if(!t.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"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!so(t.tagName,i)&&(o.attributes[i]=io(this.doc,Kn(t.tagName),Kn(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 l of Array.from(t.style)){const c=t.style.getPropertyValue(l),p=t.style.getPropertyPriority(l);c!==a.style.getPropertyValue(l)||p!==a.style.getPropertyPriority(l)?p===""?o.styleDiff[l]=c:o.styleDiff[l]=[c,p]:o._unchangedStyles[l]=[c,p]}for(const l of Array.from(a.style))t.style.getPropertyValue(l)===""&&(o.styleDiff[l]=!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(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const i=this.mirror.getId(t),s=kt(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Ne(e.target,this.blockClass,this.blockSelector,!1)||Ki(t,this.mirror)||!Zr(t,this.mirror)||(this.addedSet.has(t)?(zi(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&i===-1||ho(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[go(i,s)]?zi(this.movedSet,t):this.removes.push({parentId:s,id:i,isShadow:kt(e.target)&&St(e.target)?!0:void 0})),this.mapRemoves.push(t))});break}}},this.genAdds=(e,t)=>{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;t&&this.mirror.hasNode(t)&&(i=this.mirror.getId(t)),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(t=>{this[t]=e[t]})}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(n,e){n.delete(e),e.childNodes.forEach(t=>zi(n,t))}function yo(n,e,t){return n.length===0?!1:Co(n,e,t)}function Co(n,e,t){const{parentNode:i}=e;if(!i)return!1;const s=t.getId(i);return n.some(o=>o.id===s)?!0:Co(n,i,t)}function wo(n,e){return n.size===0?!1:ko(n,e)}function ko(n,e){const{parentNode:t}=e;return t?n.has(t)?!0:ko(n,t):!1}let Mt;function nl(n){Mt=n}function tl(){Mt=void 0}const Y=n=>Mt?(...t)=>{try{return n(...t)}catch(i){if(Mt&&Mt(i)===!0)return;throw i}}:n,Gn=[];function Lt(n){try{if("composedPath"in n){const e=n.composedPath();if(e.length)return e[0]}else if("path"in n&&n.path.length)return n.path[0]}catch{}return n&&n.target}function So(n,e){var t,i;const s=new el;Gn.push(s),s.init(n);let o=window.MutationObserver||window.__rrMutationObserver;const a=(i=(t=window==null?void 0:window.Zone)===null||t===void 0?void 0:t.__symbol__)===null||i===void 0?void 0:i.call(t,"MutationObserver");a&&window[a]&&(o=window[a]);const l=new o(Y(s.processMutations.bind(s)));return l.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function il({mousemoveCb:n,sampling:e,doc:t,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=[],l;const c=At(Y(g=>{const b=Date.now()-l;n(a.map(y=>(y.timeOffset-=b,y)),g),a=[],l=null}),o),p=Y(At(Y(g=>{const b=Lt(g),{clientX:y,clientY:w}=Gi(g)?g.changedTouches[0]:g;l||(l=zt()),a.push({x:y,y:w,id:i.getId(b),timeOffset:zt()-l}),c(typeof DragEvent<"u"&&g instanceof DragEvent?J.Drag:g instanceof MouseEvent?J.MouseMove:J.TouchMove)}),s,{trailing:!1})),m=[He("mousemove",p,t),He("touchmove",p,t),He("drag",p,t)];return Y(()=>{m.forEach(g=>g())})}function sl({mouseInteractionCb:n,doc:e,mirror:t,blockClass:i,blockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[];let c=null;const p=m=>g=>{const b=Lt(g);if(Ne(b,i,s,!0))return;let y=null,w=m;if("pointerType"in g){switch(g.pointerType){case"mouse":y=vn.Mouse;break;case"touch":y=vn.Touch;break;case"pen":y=vn.Pen;break}y===vn.Touch?Ke[m]===Ke.MouseDown?w="TouchStart":Ke[m]===Ke.MouseUp&&(w="TouchEnd"):vn.Pen}else Gi(g)&&(y=vn.Touch);y!==null?(c=y,(w.startsWith("Touch")&&y===vn.Touch||w.startsWith("Mouse")&&y===vn.Mouse)&&(y=null)):Ke[m]===Ke.Click&&(y=c,c=null);const f=Gi(g)?g.changedTouches[0]:g;if(!f)return;const k=t.getId(b),{clientX:x,clientY:A}=f;Y(n)(Object.assign({type:Ke[w],id:k,x,y:A},y!==null&&{pointerType:y}))};return Object.keys(Ke).filter(m=>Number.isNaN(Number(m))&&!m.endsWith("_Departed")&&a[m]!==!1).forEach(m=>{let g=Kn(m);const b=p(m);if(window.PointerEvent)switch(Ke[m]){case Ke.MouseDown:case Ke.MouseUp:g=g.replace("mouse","pointer");break;case Ke.TouchStart:case Ke.TouchEnd:return}l.push(He(g,b,e))}),Y(()=>{l.forEach(m=>m())})}function xo({scrollCb:n,doc:e,mirror:t,blockClass:i,blockSelector:s,sampling:o}){const a=Y(At(Y(l=>{const c=Lt(l);if(!c||Ne(c,i,s,!0))return;const p=t.getId(c);if(c===e&&e.defaultView){const m=ro(e.defaultView);n({id:p,x:m.left,y:m.top})}else n({id:p,x:c.scrollLeft,y:c.scrollTop})}),o.scroll||100));return He("scroll",a,e)}function ol({viewportResizeCb:n},{win:e}){let t=-1,i=-1;const s=Y(At(Y(()=>{const o=lo(),a=co();(t!==o||i!==a)&&(n({width:Number(a),height:Number(o)}),t=o,i=a)}),200));return He("resize",s,e)}const al=["INPUT","TEXTAREA","SELECT"],Ao=new WeakMap;function rl({inputCb:n,doc:e,mirror:t,blockClass:i,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:p,userTriggeredOnInput:m}){function g(A){let M=Lt(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,Z=!1;const G=Vi(M)||"";G==="radio"||G==="checkbox"?Z=M.checked:(l[D.toLowerCase()]||l[G])&&(F=Ui({element:M,maskInputOptions:l,tagName:D,type:G,value:F,maskInputFn:c})),b(M,m?{text:F,isChecked:Z,userTriggered:E}:{text:F,isChecked:Z});const Q=M.name;G==="radio"&&Q&&Z&&e.querySelectorAll(`input[type="radio"][name="${Q}"]`).forEach(de=>{if(de!==M){const _e=de.value;b(de,m?{text:_e,isChecked:!Z,userTriggered:!1}:{text:_e,isChecked:!Z})}})}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=t.getId(A);Y(n)(Object.assign(Object.assign({},M),{id:D}))}}const w=(p.input==="last"?["change"]:["input","change"]).map(A=>He(A,Y(g),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=>jt(A[0],A[1],{set(){Y(g)({target:this,isTrusted:!1})}},!1,f))),Y(()=>{w.forEach(A=>A())})}function qt(n){const e=[];function t(i,s){if(Wt("CSSGroupingRule")&&i.parentRule instanceof CSSGroupingRule||Wt("CSSMediaRule")&&i.parentRule instanceof CSSMediaRule||Wt("CSSSupportsRule")&&i.parentRule instanceof CSSSupportsRule||Wt("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 t(n,e)}function _n(n,e,t){let i,s;return n?(n.ownerNode?i=e.getId(n.ownerNode):s=t.getId(n),{styleId:s,id:i}):{}}function ll({styleSheetRuleCb:n,mirror:e,stylesheetManager:t},{win:i}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Y((m,g,b)=>{const[y,w]=b,{id:f,styleId:k}=_n(g,e,t.styleMirror);return(f&&f!==-1||k&&k!==-1)&&n({id:f,styleId:k,adds:[{rule:y,index:w}]}),m.apply(g,b)})});const o=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Y((m,g,b)=>{const[y]=b,{id:w,styleId:f}=_n(g,e,t.styleMirror);return(w&&w!==-1||f&&f!==-1)&&n({id:w,styleId:f,removes:[{index:y}]}),m.apply(g,b)})});let a;i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Y((m,g,b)=>{const[y]=b,{id:w,styleId:f}=_n(g,e,t.styleMirror);return(w&&w!==-1||f&&f!==-1)&&n({id:w,styleId:f,replace:y}),m.apply(g,b)})}));let l;i.CSSStyleSheet.prototype.replaceSync&&(l=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Y((m,g,b)=>{const[y]=b,{id:w,styleId:f}=_n(g,e,t.styleMirror);return(w&&w!==-1||f&&f!==-1)&&n({id:w,styleId:f,replaceSync:y}),m.apply(g,b)})}));const c={};Zt("CSSGroupingRule")?c.CSSGroupingRule=i.CSSGroupingRule:(Zt("CSSMediaRule")&&(c.CSSMediaRule=i.CSSMediaRule),Zt("CSSConditionRule")&&(c.CSSConditionRule=i.CSSConditionRule),Zt("CSSSupportsRule")&&(c.CSSSupportsRule=i.CSSSupportsRule));const p={};return Object.entries(c).forEach(([m,g])=>{p[m]={insertRule:g.prototype.insertRule,deleteRule:g.prototype.deleteRule},g.prototype.insertRule=new Proxy(p[m].insertRule,{apply:Y((b,y,w)=>{const[f,k]=w,{id:x,styleId:A}=_n(y.parentStyleSheet,e,t.styleMirror);return(x&&x!==-1||A&&A!==-1)&&n({id:x,styleId:A,adds:[{rule:f,index:[...qt(y),k||0]}]}),b.apply(y,w)})}),g.prototype.deleteRule=new Proxy(p[m].deleteRule,{apply:Y((b,y,w)=>{const[f]=w,{id:k,styleId:x}=_n(y.parentStyleSheet,e,t.styleMirror);return(k&&k!==-1||x&&x!==-1)&&n({id:k,styleId:x,removes:[{index:[...qt(y),f]}]}),b.apply(y,w)})})}),Y(()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=o,a&&(i.CSSStyleSheet.prototype.replace=a),l&&(i.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach(([m,g])=>{g.prototype.insertRule=p[m].insertRule,g.prototype.deleteRule=p[m].deleteRule})})}function Mo({mirror:n,stylesheetManager:e},t){var i,s,o;let a=null;t.nodeName==="#document"?a=n.getId(t):a=n.getId(t.host);const l=t.nodeName==="#document"?(i=t.defaultView)===null||i===void 0?void 0:i.Document:(o=(s=t.ownerDocument)===null||s===void 0?void 0:s.defaultView)===null||o===void 0?void 0:o.ShadowRoot,c=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!l||!c?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var p;return(p=c.get)===null||p===void 0?void 0:p.call(this)},set(p){var m;const g=(m=c.set)===null||m===void 0?void 0:m.call(this,p);if(a!==null&&a!==-1)try{e.adoptStyleSheets(p,a)}catch{}return g}}),Y(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))}function cl({styleDeclarationCb:n,mirror:e,ignoreCSSAttributes:t,stylesheetManager:i},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Y((l,c,p)=>{var m;const[g,b,y]=p;if(t.has(g))return o.apply(c,[g,b,y]);const{id:w,styleId:f}=_n((m=c.parentRule)===null||m===void 0?void 0:m.parentStyleSheet,e,i.styleMirror);return(w&&w!==-1||f&&f!==-1)&&n({id:w,styleId:f,set:{property:g,value:b,priority:y},index:qt(c.parentRule)}),l.apply(c,p)})});const a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Y((l,c,p)=>{var m;const[g]=p;if(t.has(g))return a.apply(c,[g]);const{id:b,styleId:y}=_n((m=c.parentRule)===null||m===void 0?void 0:m.parentStyleSheet,e,i.styleMirror);return(b&&b!==-1||y&&y!==-1)&&n({id:b,styleId:y,remove:{property:g},index:qt(c.parentRule)}),l.apply(c,p)})}),Y(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a})}function dl({mediaInteractionCb:n,blockClass:e,blockSelector:t,mirror:i,sampling:s,doc:o}){const a=Y(c=>At(Y(p=>{const m=Lt(p);if(!m||Ne(m,e,t,!0))return;const{currentTime:g,volume:b,muted:y,playbackRate:w,loop:f}=m;n({type:c,id:i.getId(m),currentTime:g,volume:b,muted:y,playbackRate:w,loop:f})}),s.media||500)),l=[He("play",a(0),o),He("pause",a(1),o),He("seeked",a(2),o),He("volumechange",a(3),o),He("ratechange",a(4),o)];return Y(()=>{l.forEach(c=>c())})}function ul({fontCb:n,doc:e}){const t=e.defaultView;if(!t)return()=>{};const i=[],s=new WeakMap,o=t.FontFace;t.FontFace=function(c,p,m){const g=new o(c,p,m);return s.set(g,{family:c,buffer:typeof p!="string",descriptors:m,fontSource:typeof p=="string"?p:JSON.stringify(Array.from(new Uint8Array(p)))}),g};const a=ct(e.fonts,"add",function(l){return function(c){return setTimeout(Y(()=>{const p=s.get(c);p&&(n(p),s.delete(c))}),0),l.apply(this,[c])}});return i.push(()=>{t.FontFace=o}),i.push(a),Y(()=>{i.forEach(l=>l())})}function hl(n){const{doc:e,mirror:t,blockClass:i,blockSelector:s,selectionCb:o}=n;let a=!0;const l=Y(()=>{const c=e.getSelection();if(!c||a&&(c!=null&&c.isCollapsed))return;a=c.isCollapsed||!1;const p=[],m=c.rangeCount||0;for(let g=0;g<m;g++){const b=c.getRangeAt(g),{startContainer:y,startOffset:w,endContainer:f,endOffset:k}=b;Ne(y,i,s,!0)||Ne(f,i,s,!0)||p.push({start:t.getId(y),startOffset:w,end:t.getId(f),endOffset:k})}o({ranges:p})});return l(),He("selectionchange",l)}function ml({doc:n,customElementCb:e}){const t=n.defaultView;return!t||!t.customElements?()=>{}:ct(t.customElements,"define",function(s){return function(o,a,l){try{e({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return s.apply(this,[o,a,l])}})}function pl(n,e){const{mutationCb:t,mousemoveCb:i,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:p,styleDeclarationCb:m,canvasMutationCb:g,fontCb:b,selectionCb:y,customElementCb:w}=n;n.mutationCb=(...f)=>{e.mutation&&e.mutation(...f),t(...f)},n.mousemoveCb=(...f)=>{e.mousemove&&e.mousemove(...f),i(...f)},n.mouseInteractionCb=(...f)=>{e.mouseInteraction&&e.mouseInteraction(...f),s(...f)},n.scrollCb=(...f)=>{e.scroll&&e.scroll(...f),o(...f)},n.viewportResizeCb=(...f)=>{e.viewportResize&&e.viewportResize(...f),a(...f)},n.inputCb=(...f)=>{e.input&&e.input(...f),l(...f)},n.mediaInteractionCb=(...f)=>{e.mediaInteaction&&e.mediaInteaction(...f),c(...f)},n.styleSheetRuleCb=(...f)=>{e.styleSheetRule&&e.styleSheetRule(...f),p(...f)},n.styleDeclarationCb=(...f)=>{e.styleDeclaration&&e.styleDeclaration(...f),m(...f)},n.canvasMutationCb=(...f)=>{e.canvasMutation&&e.canvasMutation(...f),g(...f)},n.fontCb=(...f)=>{e.font&&e.font(...f),b(...f)},n.selectionCb=(...f)=>{e.selection&&e.selection(...f),y(...f)},n.customElementCb=(...f)=>{e.customElement&&e.customElement(...f),w(...f)}}function vl(n,e={}){const t=n.doc.defaultView;if(!t)return()=>{};pl(n,e);let i;n.recordDOM&&(i=So(n,n.doc));const s=il(n),o=sl(n),a=xo(n),l=ol(n,{win:t}),c=rl(n),p=dl(n);let m=()=>{},g=()=>{},b=()=>{},y=()=>{};n.recordDOM&&(m=ll(n,{win:t}),g=Mo(n,n.doc),b=cl(n,{win:t}),n.collectFonts&&(y=ul(n)));const w=hl(n),f=ml(n),k=[];for(const x of n.plugins)k.push(x.observer(x.callback,t,x.options));return Y(()=>{Gn.forEach(x=>x.reset()),i==null||i.disconnect(),s(),o(),a(),l(),c(),p(),m(),g(),b(),y(),w(),f(),k.forEach(x=>x())})}function Wt(n){return typeof window[n]<"u"}function Zt(n){return!!(typeof window[n]<"u"&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}class Lo{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,i,s){const o=i||this.getIdToRemoteIdMap(e),a=s||this.getRemoteIdToIdMap(e);let l=o.get(t);return l||(l=this.generateIdFn(),o.set(t,l),a.set(l,t)),l}getIds(e,t){const i=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,i,s))}getRemoteId(e,t,i){const s=i||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const o=s.get(t);return o||-1}getRemoteIds(e,t){const i=this.getRemoteIdToIdMap(e);return t.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 t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class bl{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Lo(no),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,t){var i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],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 t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const o=this.transformCrossOriginEvent(s,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var i;switch(t.type){case X.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const s=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,s),this.patchRootIdOnNode(t.data.node,s),{timestamp:t.timestamp,type:X.IncrementalSnapshot,data:{source:J.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case X.Meta:case X.Load:case X.DomContentLoaded:return!1;case X.Plugin:return t;case X.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case X.IncrementalSnapshot:switch(t.data.source){case J.Mutation:return t.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)}),t.data.removes.forEach(s=>{this.replaceIds(s,e,["parentId","id"])}),t.data.attributes.forEach(s=>{this.replaceIds(s,e,["id"])}),t.data.texts.forEach(s=>{this.replaceIds(s,e,["id"])}),t;case J.Drag:case J.TouchMove:case J.MouseMove:return t.data.positions.forEach(s=>{this.replaceIds(s,e,["id"])}),t;case J.ViewportResize:return!1;case J.MediaInteraction:case J.MouseInteraction:case J.Scroll:case J.CanvasMutation:case J.Input:return this.replaceIds(t.data,e,["id"]),t;case J.StyleSheetRule:case J.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case J.Font:return t;case J.Selection:return t.data.ranges.forEach(s=>{this.replaceIds(s,e,["start","end"])}),t;case J.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(i=t.data.styles)===null||i===void 0||i.forEach(s=>{this.replaceStyleIds(s,e,["styleId"])}),t}}return!1}replace(e,t,i,s){for(const o of s)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(i,t[o]):t[o]=e.getId(i,t[o]));return t}replaceIds(e,t,i){return this.replace(this.crossOriginIframeMirror,e,t,i)}replaceStyleIds(e,t,i){return this.replace(this.crossOriginIframeStyleMirror,e,t,i)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(i=>{this.replaceIdOnNode(i,t)})}patchRootIdOnNode(e,t){e.type!==ve.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(i=>{this.patchRootIdOnNode(i,t)})}}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,t){if(!St(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const i=So(Object.assign(Object.assign({},this.bypassOptions),{doc:t,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,t){const i=this;this.restoreHandlers.push(ct(e.prototype,"attachShadow",function(s){return function(o){const a=s.call(this,o);return this.shadowRoot&&bo(this)&&i.addShadowRoot(this.shadowRoot,t),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
|
|
1134
1134
|
Copyright (c) Microsoft Corporation.
|
|
1135
1135
|
|
|
1136
1136
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1158,13 +1158,13 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
1158
1158
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1159
1159
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1160
1160
|
PERFORMANCE OF THIS SOFTWARE.
|
|
1161
|
-
***************************************************************************** */function n(p,m,g,b){function y(w){return w instanceof g?w:new g(function(f){f(w)})}return new(g||(g=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):y(M.value).then(k,x)}A((b=b.apply(p,[])).next())})}for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=typeof Uint8Array>"u"?[]:new Uint8Array(256),i=0;i<e.length;i++)t[e.charCodeAt(i)]=i;var s=function(p){var m=new Uint8Array(p),g,b=m.length,y="";for(g=0;g<b;g+=3)y+=e[m[g]>>2],y+=e[(m[g]&3)<<4|m[g+1]>>4],y+=e[(m[g+1]&15)<<2|m[g+2]>>6],y+=e[m[g+2]&63];return b%3===2?y=y.substring(0,y.length-1)+"=":b%3===1&&(y=y.substring(0,y.length-2)+"=="),y};const o=new Map,a=new Map;function l(p,m,g){return n(this,void 0,void 0,function*(){const b=`${p}-${m}`;if("OffscreenCanvas"in globalThis){if(a.has(b))return a.get(b);const y=new OffscreenCanvas(p,m);y.getContext("2d");const f=yield(yield y.convertToBlob(g)).arrayBuffer(),k=s(f);return a.set(b,k),k}else return""})}const c=self;c.onmessage=function(p){return n(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:m,bitmap:g,width:b,height:y,dataURLOptions:w}=p.data,f=l(b,y,w),k=new OffscreenCanvas(b,y);k.getContext("2d").drawImage(g,0,0),g.close();const A=yield k.convertToBlob(w),M=A.type,E=yield A.arrayBuffer(),D=s(E);if(!o.has(m)&&(yield f)===D)return o.set(m,D),c.postMessage({id:m});if(o.get(m)===D)return c.postMessage({id:m});c.postMessage({id:m,type:M,base64:D,width:b,height:y}),o.set(m,D)}else return c.postMessage({id:p.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=(c,p)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(p)};const{sampling:t="all",win:i,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&t==="all"&&this.initCanvasMutationObserver(i,s,o),a&&typeof t=="number"&&this.initCanvasFPSObserver(t,i,s,o,{dataURLOptions:l})}initCanvasFPSObserver(e,t,i,s,o){const a=Io(t,i,s,!0),l=new Map,c=new _l;c.onmessage=w=>{const{id:f}=w.data;if(l.set(f,!1),!("base64"in w.data))return;const{base64:k,type:x,width:A,height:M}=w.data;this.mutationCb({id:f,type:dt["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 p=1e3/e;let m=0,g;const b=()=>{const w=[];return t.document.querySelectorAll("canvas").forEach(f=>{Ne(f,i,s,!0)||w.push(f)}),w},y=w=>{if(m&&w-m<p){g=requestAnimationFrame(y);return}m=w,b().forEach(f=>yl(this,void 0,void 0,function*(){var k;const x=this.mirror.getId(f);if(l.get(x)||f.width===0||f.height===0)return;if(l.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);c.postMessage({id:x,bitmap:A,width:f.width,height:f.height,dataURLOptions:o.dataURLOptions},[A])})),g=requestAnimationFrame(y)};g=requestAnimationFrame(y),this.resetObservers=()=>{a(),cancelAnimationFrame(g)}}initCanvasMutationObserver(e,t,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=Io(e,t,i,!1),o=Sl(this.processMutation.bind(this),e,t,i),a=Al(this.processMutation.bind(this),e,t,i,this.mirror);this.resetObservers=()=>{s(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const i=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,i)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const i=this.pendingCanvasMutations.get(e);if(!i||t===-1)return;const s=i.map(a=>gl(a,["type"])),{type:o}=i[0];this.mutationCb({id:t,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,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const i={id:t,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,(l,c)=>({rule:Ys(l),index:c}))})),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,t){const i=this.nodeMap.get(e);return i&&Array.from(i).some(s=>s!==t)}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function be(n){return Object.assign(Object.assign({},n),{timestamp:zt()})}let he,Yt,qi,Xt=!1;const nn=Ar();function Tt(n={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:i,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:c="rr-mask",maskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:g,maskInputOptions:b,slimDOMOptions:y,maskInputFn:w,maskTextFn:f,hooks:k,packFn:x,sampling:A={},dataURLOptions:M={},mousemoveWait:E,recordDOM:D=!0,recordCanvas:G=!1,recordCrossOriginIframes:Z=!1,recordAfter:K=n.recordAfter==="DOMContentLoaded"?n.recordAfter:"load",userTriggeredOnInput:Q=!1,collectFonts:de=!1,inlineImages:_e=!1,plugins:j,keepIframeSrcFn:Oe=()=>!1,ignoreCSSAttributes:ge=new Set([]),errorHandler:Ge}=n;nl(Ge);const Se=Z?window.parent===window:!0;let Cn=!1;if(!Se)try{window.parent.document&&(Cn=!1)}catch{Cn=!0}if(Se&&!e)throw new Error("emit function is required");E!==void 0&&A.mousemove===void 0&&(A.mousemove=E),nn.reset();const un=g===!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},wn=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};Qr();let Wn,On=0;const je=H=>{for(const ye of j||[])ye.eventProcessor&&(H=ye.eventProcessor(H));return x&&!Cn&&(H=x(H)),H};he=(H,ye)=>{var te;if(!((te=Gn[0])===null||te===void 0)&&te.isFrozen()&&H.type!==X.FullSnapshot&&!(H.type===X.IncrementalSnapshot&&H.data.source===J.Mutation)&&Gn.forEach(Ce=>Ce.unfreeze()),Se)e==null||e(je(H),ye);else if(Cn){const Ce={type:"rrweb",event:je(H),origin:window.location.origin,isCheckout:ye};window.parent.postMessage(Ce,"*")}if(H.type===X.FullSnapshot)Wn=H,On=0;else if(H.type===X.IncrementalSnapshot){if(H.data.source===J.Mutation&&H.data.isAttachIframe)return;On++;const Ce=i&&On>=i,qe=t&&H.timestamp-Wn.timestamp>t;(Ce||qe)&&Yt(!0)}};const kn=H=>{he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Mutation},H)}))},Zn=H=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Scroll},H)})),me=H=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.CanvasMutation},H)})),xe=H=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.AdoptedStyleSheet},H)})),Qe=new Pl({mutationCb:kn,adoptedStyleSheetCb:xe}),ze=new bl({mirror:nn,mutationCb:kn,stylesheetManager:Qe,recordCrossOriginIframes:Z,wrappedEmit:he});for(const H of j||[])H.getMirror&&H.getMirror({nodeMirror:nn,crossOriginIframeMirror:ze.crossOriginIframeMirror,crossOriginIframeStyleMirror:ze.crossOriginIframeStyleMirror});const De=new Il;qi=new El({recordCanvas:G,mutationCb:me,win:window,blockClass:s,blockSelector:o,mirror:nn,sampling:A.canvas,dataURLOptions:M});const hn=new fl({mutationCb:kn,scrollCb:Zn,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:p,inlineStylesheet:m,maskInputOptions:un,dataURLOptions:M,maskTextFn:f,maskInputFn:w,recordCanvas:G,inlineImages:_e,sampling:A,slimDOMOptions:wn,iframeManager:ze,stylesheetManager:Qe,canvasManager:qi,keepIframeSrcFn:Oe,processedNodeManager:De},mirror:nn});Yt=(H=!1)=>{if(!D)return;he(be({type:X.Meta,data:{href:window.location.href,width:co(),height:lo()}}),H),Qe.reset(),hn.init(),Gn.forEach(te=>te.lock());const ye=Wr(document,{mirror:nn,blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:p,inlineStylesheet:m,maskAllInputs:un,maskTextFn:f,slimDOM:wn,dataURLOptions:M,recordCanvas:G,inlineImages:_e,onSerialize:te=>{mo(te,nn)&&ze.addIframe(te),po(te,nn)&&Qe.trackLinkElement(te),ji(te)&&hn.addShadowRoot(te.shadowRoot,document)},onIframeLoad:(te,Ce)=>{ze.attachIframe(te,Ce),hn.observeAttachShadow(te)},onStylesheetLoad:(te,Ce)=>{Qe.attachLinkElement(te,Ce)},keepIframeSrcFn:Oe});if(!ye)return console.warn("Failed to snapshot the document");he(be({type:X.FullSnapshot,data:{node:ye,initialOffset:ro(window)}}),H),Gn.forEach(te=>te.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Qe.adoptStyleSheets(document.adoptedStyleSheets,nn.getId(document))};try{const H=[],ye=Ce=>{var qe;return Y(vl)({mutationCb:kn,mousemoveCb:(ne,Un)=>he(be({type:X.IncrementalSnapshot,data:{source:Un,positions:ne}})),mouseInteractionCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.MouseInteraction},ne)})),scrollCb:Zn,viewportResizeCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.ViewportResize},ne)})),inputCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Input},ne)})),mediaInteractionCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.MediaInteraction},ne)})),styleSheetRuleCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.StyleSheetRule},ne)})),styleDeclarationCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.StyleDeclaration},ne)})),canvasMutationCb:me,fontCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Font},ne)})),selectionCb:ne=>{he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Selection},ne)}))},customElementCb:ne=>{he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.CustomElement},ne)}))},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:c,maskTextSelector:p,maskInputOptions:un,inlineStylesheet:m,sampling:A,recordDOM:D,recordCanvas:G,inlineImages:_e,userTriggeredOnInput:Q,collectFonts:de,doc:Ce,maskInputFn:w,maskTextFn:f,keepIframeSrcFn:Oe,blockSelector:o,slimDOMOptions:wn,dataURLOptions:M,mirror:nn,iframeManager:ze,stylesheetManager:Qe,shadowDomManager:hn,processedNodeManager:De,canvasManager:qi,ignoreCSSAttributes:ge,plugins:((qe=j==null?void 0:j.filter(ne=>ne.observer))===null||qe===void 0?void 0:qe.map(ne=>({observer:ne.observer,options:ne.options,callback:Un=>he(be({type:X.Plugin,data:{plugin:ne.name,payload:Un}}))})))||[]},k)};ze.addLoadListener(Ce=>{try{H.push(ye(Ce.contentDocument))}catch(qe){console.warn(qe)}});const te=()=>{Yt(),H.push(ye(document)),Xt=!0};return document.readyState==="interactive"||document.readyState==="complete"?te():(H.push(He("DOMContentLoaded",()=>{he(be({type:X.DomContentLoaded,data:{}})),K==="DOMContentLoaded"&&te()})),H.push(He("load",()=>{he(be({type:X.Load,data:{}})),K==="load"&&te()},window))),()=>{H.forEach(Ce=>Ce()),De.destroy(),Xt=!1,tl()}}catch(H){console.warn(H)}}Tt.addCustomEvent=(n,e)=>{if(!Xt)throw new Error("please add custom event after start recording");he(be({type:X.Custom,data:{tag:n,payload:e}}))},Tt.freezePage=()=>{Gn.forEach(n=>n.freeze())},Tt.takeFullSnapshot=n=>{if(!Xt)throw new Error("please take full snapshot after start recording");Yt(n)},Tt.mirror=nn;var Bo=(n=>(n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n))(Bo||{}),ln=(n=>(n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n))(ln||{}),bn={DEBUG:!1,LIB_VERSION:"2.55.1"},O;if(typeof window>"u"){var Ro={hostname:""};O={navigator:{userAgent:"",onLine:!0},document:{location:Ro,referrer:""},screen:{width:0,height:0},location:Ro}}else O=window;var _t=24*60*60*1e3,Wi=8*1e3,$t=Array.prototype,Dl=Function.prototype,Ho=Object.prototype,En=$t.slice,Et=Ho.toString,ei=Ho.hasOwnProperty,fe=O.console,Pn=O.navigator,oe=O.document,ni=O.opera,ti=O.screen,cn=Pn.userAgent,Zi=Dl.bind,No=$t.forEach,Oo=$t.indexOf,Uo=$t.map,Bl=Array.isArray,Qi={},v={trim:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},ee={log:function(){if(bn.DEBUG&&!v.isUndefined(fe)&&fe)try{fe.log.apply(fe,arguments)}catch{v.each(arguments,function(e){fe.log(e)})}},warn:function(){if(bn.DEBUG&&!v.isUndefined(fe)&&fe){var n=["Mixpanel warning:"].concat(v.toArray(arguments));try{fe.warn.apply(fe,n)}catch{v.each(n,function(t){fe.warn(t)})}}},error:function(){if(bn.DEBUG&&!v.isUndefined(fe)&&fe){var n=["Mixpanel error:"].concat(v.toArray(arguments));try{fe.error.apply(fe,n)}catch{v.each(n,function(t){fe.error(t)})}}},critical:function(){if(!v.isUndefined(fe)&&fe){var n=["Mixpanel error:"].concat(v.toArray(arguments));try{fe.error.apply(fe,n)}catch{v.each(n,function(t){fe.error(t)})}}}},Ji=function(n,e){return function(){return arguments[0]="["+e+"] "+arguments[0],n.apply(ee,arguments)}},ii=function(n){return{log:Ji(ee.log,n),error:Ji(ee.error,n),critical:Ji(ee.critical,n)}};v.bind=function(n,e){var t,i;if(Zi&&n.bind===Zi)return Zi.apply(n,En.call(arguments,1));if(!v.isFunction(n))throw new TypeError;return t=En.call(arguments,2),i=function(){if(!(this instanceof i))return n.apply(e,t.concat(En.call(arguments)));var s={};s.prototype=n.prototype;var o=new s;s.prototype=null;var a=n.apply(o,t.concat(En.call(arguments)));return Object(a)===a?a:o},i},v.each=function(n,e,t){if(n!=null){if(No&&n.forEach===No)n.forEach(e,t);else if(n.length===+n.length){for(var i=0,s=n.length;i<s;i++)if(i in n&&e.call(t,n[i],i,n)===Qi)return}else for(var o in n)if(ei.call(n,o)&&e.call(t,n[o],o,n)===Qi)return}},v.extend=function(n){return v.each(En.call(arguments,1),function(e){for(var t in e)e[t]!==void 0&&(n[t]=e[t])}),n},v.isArray=Bl||function(n){return Et.call(n)==="[object Array]"},v.isFunction=function(n){try{return/^\s*\bfunction\b/.test(n)}catch{return!1}},v.isArguments=function(n){return!!(n&&ei.call(n,"callee"))},v.toArray=function(n){return n?n.toArray?n.toArray():v.isArray(n)||v.isArguments(n)?En.call(n):v.values(n):[]},v.map=function(n,e,t){if(Uo&&n.map===Uo)return n.map(e,t);var i=[];return v.each(n,function(s){i.push(e.call(t,s))}),i},v.keys=function(n){var e=[];return n===null||v.each(n,function(t,i){e[e.length]=i}),e},v.values=function(n){var e=[];return n===null||v.each(n,function(t){e[e.length]=t}),e},v.include=function(n,e){var t=!1;return n===null?t:Oo&&n.indexOf===Oo?n.indexOf(e)!=-1:(v.each(n,function(i){if(t||(t=i===e))return Qi}),t)},v.includes=function(n,e){return n.indexOf(e)!==-1},v.inherit=function(n,e){return n.prototype=new e,n.prototype.constructor=n,n.superclass=e.prototype,n},v.isObject=function(n){return n===Object(n)&&!v.isArray(n)},v.isEmptyObject=function(n){if(v.isObject(n)){for(var e in n)if(ei.call(n,e))return!1;return!0}return!1},v.isUndefined=function(n){return n===void 0},v.isString=function(n){return Et.call(n)=="[object String]"},v.isDate=function(n){return Et.call(n)=="[object Date]"},v.isNumber=function(n){return Et.call(n)=="[object Number]"},v.isElement=function(n){return!!(n&&n.nodeType===1)},v.encodeDates=function(n){return v.each(n,function(e,t){v.isDate(e)?n[t]=v.formatDate(e):v.isObject(e)&&(n[t]=v.encodeDates(e))}),n},v.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},v.formatDate=function(n){function e(t){return t<10?"0"+t:t}return n.getUTCFullYear()+"-"+e(n.getUTCMonth()+1)+"-"+e(n.getUTCDate())+"T"+e(n.getUTCHours())+":"+e(n.getUTCMinutes())+":"+e(n.getUTCSeconds())},v.strip_empty_properties=function(n){var e={};return v.each(n,function(t,i){v.isString(t)&&t.length>0&&(e[i]=t)}),e},v.truncate=function(n,e){var t;return typeof n=="string"?t=n.slice(0,e):v.isArray(n)?(t=[],v.each(n,function(i){t.push(v.truncate(i,e))})):v.isObject(n)?(t={},v.each(n,function(i,s){t[s]=v.truncate(i,e)})):t=n,t},v.JSONEncode=function(){return function(n){var e=n,t=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(l){var c=a[l];return typeof c=="string"?c:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+s+'"'},i=function(s,o){var a="",l=" ",c=0,p="",m="",g=0,b=a,y=[],w=o[s];switch(w&&typeof w=="object"&&typeof w.toJSON=="function"&&(w=w.toJSON(s)),typeof w){case"string":return t(w);case"number":return isFinite(w)?String(w):"null";case"boolean":case"null":return String(w);case"object":if(!w)return"null";if(a+=l,y=[],Et.apply(w)==="[object Array]"){for(g=w.length,c=0;c<g;c+=1)y[c]=i(c,w)||"null";return m=y.length===0?"[]":a?`[
|
|
1161
|
+
***************************************************************************** */function n(p,m,g,b){function y(w){return w instanceof g?w:new g(function(f){f(w)})}return new(g||(g=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):y(M.value).then(k,x)}A((b=b.apply(p,[])).next())})}for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=typeof Uint8Array>"u"?[]:new Uint8Array(256),i=0;i<e.length;i++)t[e.charCodeAt(i)]=i;var s=function(p){var m=new Uint8Array(p),g,b=m.length,y="";for(g=0;g<b;g+=3)y+=e[m[g]>>2],y+=e[(m[g]&3)<<4|m[g+1]>>4],y+=e[(m[g+1]&15)<<2|m[g+2]>>6],y+=e[m[g+2]&63];return b%3===2?y=y.substring(0,y.length-1)+"=":b%3===1&&(y=y.substring(0,y.length-2)+"=="),y};const o=new Map,a=new Map;function l(p,m,g){return n(this,void 0,void 0,function*(){const b=`${p}-${m}`;if("OffscreenCanvas"in globalThis){if(a.has(b))return a.get(b);const y=new OffscreenCanvas(p,m);y.getContext("2d");const f=yield(yield y.convertToBlob(g)).arrayBuffer(),k=s(f);return a.set(b,k),k}else return""})}const c=self;c.onmessage=function(p){return n(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:m,bitmap:g,width:b,height:y,dataURLOptions:w}=p.data,f=l(b,y,w),k=new OffscreenCanvas(b,y);k.getContext("2d").drawImage(g,0,0),g.close();const A=yield k.convertToBlob(w),M=A.type,E=yield A.arrayBuffer(),D=s(E);if(!o.has(m)&&(yield f)===D)return o.set(m,D),c.postMessage({id:m});if(o.get(m)===D)return c.postMessage({id:m});c.postMessage({id:m,type:M,base64:D,width:b,height:y}),o.set(m,D)}else return c.postMessage({id:p.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=(c,p)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(p)};const{sampling:t="all",win:i,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&t==="all"&&this.initCanvasMutationObserver(i,s,o),a&&typeof t=="number"&&this.initCanvasFPSObserver(t,i,s,o,{dataURLOptions:l})}initCanvasFPSObserver(e,t,i,s,o){const a=Io(t,i,s,!0),l=new Map,c=new _l;c.onmessage=w=>{const{id:f}=w.data;if(l.set(f,!1),!("base64"in w.data))return;const{base64:k,type:x,width:A,height:M}=w.data;this.mutationCb({id:f,type:dt["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 p=1e3/e;let m=0,g;const b=()=>{const w=[];return t.document.querySelectorAll("canvas").forEach(f=>{Ne(f,i,s,!0)||w.push(f)}),w},y=w=>{if(m&&w-m<p){g=requestAnimationFrame(y);return}m=w,b().forEach(f=>yl(this,void 0,void 0,function*(){var k;const x=this.mirror.getId(f);if(l.get(x)||f.width===0||f.height===0)return;if(l.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);c.postMessage({id:x,bitmap:A,width:f.width,height:f.height,dataURLOptions:o.dataURLOptions},[A])})),g=requestAnimationFrame(y)};g=requestAnimationFrame(y),this.resetObservers=()=>{a(),cancelAnimationFrame(g)}}initCanvasMutationObserver(e,t,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=Io(e,t,i,!1),o=Sl(this.processMutation.bind(this),e,t,i),a=Al(this.processMutation.bind(this),e,t,i,this.mirror);this.resetObservers=()=>{s(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const i=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,i)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const i=this.pendingCanvasMutations.get(e);if(!i||t===-1)return;const s=i.map(a=>gl(a,["type"])),{type:o}=i[0];this.mutationCb({id:t,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,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const i={id:t,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,(l,c)=>({rule:Ys(l),index:c}))})),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,t){const i=this.nodeMap.get(e);return i&&Array.from(i).some(s=>s!==t)}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function be(n){return Object.assign(Object.assign({},n),{timestamp:zt()})}let he,Yt,qi,Xt=!1;const nn=Ar();function Tt(n={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:i,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:c="rr-mask",maskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:g,maskInputOptions:b,slimDOMOptions:y,maskInputFn:w,maskTextFn:f,hooks:k,packFn:x,sampling:A={},dataURLOptions:M={},mousemoveWait:E,recordDOM:D=!0,recordCanvas:F=!1,recordCrossOriginIframes:Z=!1,recordAfter:G=n.recordAfter==="DOMContentLoaded"?n.recordAfter:"load",userTriggeredOnInput:Q=!1,collectFonts:de=!1,inlineImages:_e=!1,plugins:j,keepIframeSrcFn:Oe=()=>!1,ignoreCSSAttributes:ge=new Set([]),errorHandler:Ge}=n;nl(Ge);const Se=Z?window.parent===window:!0;let Cn=!1;if(!Se)try{window.parent.document&&(Cn=!1)}catch{Cn=!0}if(Se&&!e)throw new Error("emit function is required");E!==void 0&&A.mousemove===void 0&&(A.mousemove=E),nn.reset();const un=g===!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},wn=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};Qr();let Wn,On=0;const je=H=>{for(const ye of j||[])ye.eventProcessor&&(H=ye.eventProcessor(H));return x&&!Cn&&(H=x(H)),H};he=(H,ye)=>{var te;if(!((te=Gn[0])===null||te===void 0)&&te.isFrozen()&&H.type!==X.FullSnapshot&&!(H.type===X.IncrementalSnapshot&&H.data.source===J.Mutation)&&Gn.forEach(Ce=>Ce.unfreeze()),Se)e==null||e(je(H),ye);else if(Cn){const Ce={type:"rrweb",event:je(H),origin:window.location.origin,isCheckout:ye};window.parent.postMessage(Ce,"*")}if(H.type===X.FullSnapshot)Wn=H,On=0;else if(H.type===X.IncrementalSnapshot){if(H.data.source===J.Mutation&&H.data.isAttachIframe)return;On++;const Ce=i&&On>=i,qe=t&&H.timestamp-Wn.timestamp>t;(Ce||qe)&&Yt(!0)}};const kn=H=>{he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Mutation},H)}))},Zn=H=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Scroll},H)})),me=H=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.CanvasMutation},H)})),xe=H=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.AdoptedStyleSheet},H)})),Qe=new Pl({mutationCb:kn,adoptedStyleSheetCb:xe}),ze=new bl({mirror:nn,mutationCb:kn,stylesheetManager:Qe,recordCrossOriginIframes:Z,wrappedEmit:he});for(const H of j||[])H.getMirror&&H.getMirror({nodeMirror:nn,crossOriginIframeMirror:ze.crossOriginIframeMirror,crossOriginIframeStyleMirror:ze.crossOriginIframeStyleMirror});const De=new Il;qi=new El({recordCanvas:F,mutationCb:me,win:window,blockClass:s,blockSelector:o,mirror:nn,sampling:A.canvas,dataURLOptions:M});const hn=new fl({mutationCb:kn,scrollCb:Zn,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:p,inlineStylesheet:m,maskInputOptions:un,dataURLOptions:M,maskTextFn:f,maskInputFn:w,recordCanvas:F,inlineImages:_e,sampling:A,slimDOMOptions:wn,iframeManager:ze,stylesheetManager:Qe,canvasManager:qi,keepIframeSrcFn:Oe,processedNodeManager:De},mirror:nn});Yt=(H=!1)=>{if(!D)return;he(be({type:X.Meta,data:{href:window.location.href,width:co(),height:lo()}}),H),Qe.reset(),hn.init(),Gn.forEach(te=>te.lock());const ye=Wr(document,{mirror:nn,blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:p,inlineStylesheet:m,maskAllInputs:un,maskTextFn:f,slimDOM:wn,dataURLOptions:M,recordCanvas:F,inlineImages:_e,onSerialize:te=>{mo(te,nn)&&ze.addIframe(te),po(te,nn)&&Qe.trackLinkElement(te),ji(te)&&hn.addShadowRoot(te.shadowRoot,document)},onIframeLoad:(te,Ce)=>{ze.attachIframe(te,Ce),hn.observeAttachShadow(te)},onStylesheetLoad:(te,Ce)=>{Qe.attachLinkElement(te,Ce)},keepIframeSrcFn:Oe});if(!ye)return console.warn("Failed to snapshot the document");he(be({type:X.FullSnapshot,data:{node:ye,initialOffset:ro(window)}}),H),Gn.forEach(te=>te.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Qe.adoptStyleSheets(document.adoptedStyleSheets,nn.getId(document))};try{const H=[],ye=Ce=>{var qe;return Y(vl)({mutationCb:kn,mousemoveCb:(ne,Un)=>he(be({type:X.IncrementalSnapshot,data:{source:Un,positions:ne}})),mouseInteractionCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.MouseInteraction},ne)})),scrollCb:Zn,viewportResizeCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.ViewportResize},ne)})),inputCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Input},ne)})),mediaInteractionCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.MediaInteraction},ne)})),styleSheetRuleCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.StyleSheetRule},ne)})),styleDeclarationCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.StyleDeclaration},ne)})),canvasMutationCb:me,fontCb:ne=>he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Font},ne)})),selectionCb:ne=>{he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.Selection},ne)}))},customElementCb:ne=>{he(be({type:X.IncrementalSnapshot,data:Object.assign({source:J.CustomElement},ne)}))},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:c,maskTextSelector:p,maskInputOptions:un,inlineStylesheet:m,sampling:A,recordDOM:D,recordCanvas:F,inlineImages:_e,userTriggeredOnInput:Q,collectFonts:de,doc:Ce,maskInputFn:w,maskTextFn:f,keepIframeSrcFn:Oe,blockSelector:o,slimDOMOptions:wn,dataURLOptions:M,mirror:nn,iframeManager:ze,stylesheetManager:Qe,shadowDomManager:hn,processedNodeManager:De,canvasManager:qi,ignoreCSSAttributes:ge,plugins:((qe=j==null?void 0:j.filter(ne=>ne.observer))===null||qe===void 0?void 0:qe.map(ne=>({observer:ne.observer,options:ne.options,callback:Un=>he(be({type:X.Plugin,data:{plugin:ne.name,payload:Un}}))})))||[]},k)};ze.addLoadListener(Ce=>{try{H.push(ye(Ce.contentDocument))}catch(qe){console.warn(qe)}});const te=()=>{Yt(),H.push(ye(document)),Xt=!0};return document.readyState==="interactive"||document.readyState==="complete"?te():(H.push(He("DOMContentLoaded",()=>{he(be({type:X.DomContentLoaded,data:{}})),G==="DOMContentLoaded"&&te()})),H.push(He("load",()=>{he(be({type:X.Load,data:{}})),G==="load"&&te()},window))),()=>{H.forEach(Ce=>Ce()),De.destroy(),Xt=!1,tl()}}catch(H){console.warn(H)}}Tt.addCustomEvent=(n,e)=>{if(!Xt)throw new Error("please add custom event after start recording");he(be({type:X.Custom,data:{tag:n,payload:e}}))},Tt.freezePage=()=>{Gn.forEach(n=>n.freeze())},Tt.takeFullSnapshot=n=>{if(!Xt)throw new Error("please take full snapshot after start recording");Yt(n)},Tt.mirror=nn;var Bo=(n=>(n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n))(Bo||{}),ln=(n=>(n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n))(ln||{}),bn={DEBUG:!1,LIB_VERSION:"2.55.1"},O;if(typeof window>"u"){var Ro={hostname:""};O={navigator:{userAgent:"",onLine:!0},document:{location:Ro,referrer:""},screen:{width:0,height:0},location:Ro}}else O=window;var _t=24*60*60*1e3,Wi=8*1e3,$t=Array.prototype,Dl=Function.prototype,Ho=Object.prototype,En=$t.slice,Et=Ho.toString,ei=Ho.hasOwnProperty,fe=O.console,Pn=O.navigator,oe=O.document,ni=O.opera,ti=O.screen,cn=Pn.userAgent,Zi=Dl.bind,No=$t.forEach,Oo=$t.indexOf,Uo=$t.map,Bl=Array.isArray,Qi={},v={trim:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},ee={log:function(){if(bn.DEBUG&&!v.isUndefined(fe)&&fe)try{fe.log.apply(fe,arguments)}catch{v.each(arguments,function(e){fe.log(e)})}},warn:function(){if(bn.DEBUG&&!v.isUndefined(fe)&&fe){var n=["Mixpanel warning:"].concat(v.toArray(arguments));try{fe.warn.apply(fe,n)}catch{v.each(n,function(t){fe.warn(t)})}}},error:function(){if(bn.DEBUG&&!v.isUndefined(fe)&&fe){var n=["Mixpanel error:"].concat(v.toArray(arguments));try{fe.error.apply(fe,n)}catch{v.each(n,function(t){fe.error(t)})}}},critical:function(){if(!v.isUndefined(fe)&&fe){var n=["Mixpanel error:"].concat(v.toArray(arguments));try{fe.error.apply(fe,n)}catch{v.each(n,function(t){fe.error(t)})}}}},Ji=function(n,e){return function(){return arguments[0]="["+e+"] "+arguments[0],n.apply(ee,arguments)}},ii=function(n){return{log:Ji(ee.log,n),error:Ji(ee.error,n),critical:Ji(ee.critical,n)}};v.bind=function(n,e){var t,i;if(Zi&&n.bind===Zi)return Zi.apply(n,En.call(arguments,1));if(!v.isFunction(n))throw new TypeError;return t=En.call(arguments,2),i=function(){if(!(this instanceof i))return n.apply(e,t.concat(En.call(arguments)));var s={};s.prototype=n.prototype;var o=new s;s.prototype=null;var a=n.apply(o,t.concat(En.call(arguments)));return Object(a)===a?a:o},i},v.each=function(n,e,t){if(n!=null){if(No&&n.forEach===No)n.forEach(e,t);else if(n.length===+n.length){for(var i=0,s=n.length;i<s;i++)if(i in n&&e.call(t,n[i],i,n)===Qi)return}else for(var o in n)if(ei.call(n,o)&&e.call(t,n[o],o,n)===Qi)return}},v.extend=function(n){return v.each(En.call(arguments,1),function(e){for(var t in e)e[t]!==void 0&&(n[t]=e[t])}),n},v.isArray=Bl||function(n){return Et.call(n)==="[object Array]"},v.isFunction=function(n){try{return/^\s*\bfunction\b/.test(n)}catch{return!1}},v.isArguments=function(n){return!!(n&&ei.call(n,"callee"))},v.toArray=function(n){return n?n.toArray?n.toArray():v.isArray(n)||v.isArguments(n)?En.call(n):v.values(n):[]},v.map=function(n,e,t){if(Uo&&n.map===Uo)return n.map(e,t);var i=[];return v.each(n,function(s){i.push(e.call(t,s))}),i},v.keys=function(n){var e=[];return n===null||v.each(n,function(t,i){e[e.length]=i}),e},v.values=function(n){var e=[];return n===null||v.each(n,function(t){e[e.length]=t}),e},v.include=function(n,e){var t=!1;return n===null?t:Oo&&n.indexOf===Oo?n.indexOf(e)!=-1:(v.each(n,function(i){if(t||(t=i===e))return Qi}),t)},v.includes=function(n,e){return n.indexOf(e)!==-1},v.inherit=function(n,e){return n.prototype=new e,n.prototype.constructor=n,n.superclass=e.prototype,n},v.isObject=function(n){return n===Object(n)&&!v.isArray(n)},v.isEmptyObject=function(n){if(v.isObject(n)){for(var e in n)if(ei.call(n,e))return!1;return!0}return!1},v.isUndefined=function(n){return n===void 0},v.isString=function(n){return Et.call(n)=="[object String]"},v.isDate=function(n){return Et.call(n)=="[object Date]"},v.isNumber=function(n){return Et.call(n)=="[object Number]"},v.isElement=function(n){return!!(n&&n.nodeType===1)},v.encodeDates=function(n){return v.each(n,function(e,t){v.isDate(e)?n[t]=v.formatDate(e):v.isObject(e)&&(n[t]=v.encodeDates(e))}),n},v.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},v.formatDate=function(n){function e(t){return t<10?"0"+t:t}return n.getUTCFullYear()+"-"+e(n.getUTCMonth()+1)+"-"+e(n.getUTCDate())+"T"+e(n.getUTCHours())+":"+e(n.getUTCMinutes())+":"+e(n.getUTCSeconds())},v.strip_empty_properties=function(n){var e={};return v.each(n,function(t,i){v.isString(t)&&t.length>0&&(e[i]=t)}),e},v.truncate=function(n,e){var t;return typeof n=="string"?t=n.slice(0,e):v.isArray(n)?(t=[],v.each(n,function(i){t.push(v.truncate(i,e))})):v.isObject(n)?(t={},v.each(n,function(i,s){t[s]=v.truncate(i,e)})):t=n,t},v.JSONEncode=function(){return function(n){var e=n,t=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(l){var c=a[l];return typeof c=="string"?c:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+s+'"'},i=function(s,o){var a="",l=" ",c=0,p="",m="",g=0,b=a,y=[],w=o[s];switch(w&&typeof w=="object"&&typeof w.toJSON=="function"&&(w=w.toJSON(s)),typeof w){case"string":return t(w);case"number":return isFinite(w)?String(w):"null";case"boolean":case"null":return String(w);case"object":if(!w)return"null";if(a+=l,y=[],Et.apply(w)==="[object Array]"){for(g=w.length,c=0;c<g;c+=1)y[c]=i(c,w)||"null";return m=y.length===0?"[]":a?`[
|
|
1162
1162
|
`+a+y.join(`,
|
|
1163
1163
|
`+a)+`
|
|
1164
1164
|
`+b+"]":"["+y.join(",")+"]",a=b,m}for(p in w)ei.call(w,p)&&(m=i(p,w),m&&y.push(t(p)+(a?": ":":")+m));return m=y.length===0?"{}":a?"{"+y.join(",")+b+"}":"{"+y.join(",")+"}",a=b,m}};return i("",{"":e})}}(),v.JSONDecode=function(){var n,e,t={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
1165
1165
|
`,r:"\r",t:" "},i,s=function(y){var w=new SyntaxError(y);throw w.at=n,w.text=i,w},o=function(y){return y&&y!==e&&s("Expected '"+y+"' instead of '"+e+"'"),e=i.charAt(n),n+=1,e},a=function(){var y,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(y=+w,!isFinite(y))s("Bad number");else return y},l=function(){var y,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&&(y=parseInt(o(),16),!!isFinite(y));w+=1)k=k*16+y;f+=String.fromCharCode(k)}else if(typeof t[e]=="string")f+=t[e];else break;else f+=e}s("Bad string")},c=function(){for(;e&&e<=" ";)o()},p=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+'"')},m,g=function(){var y=[];if(e==="["){if(o("["),c(),e==="]")return o("]"),y;for(;e;){if(y.push(m()),c(),e==="]")return o("]"),y;o(","),c()}}s("Bad array")},b=function(){var y,w={};if(e==="{"){if(o("{"),c(),e==="}")return o("}"),w;for(;e;){if(y=l(),c(),o(":"),Object.hasOwnProperty.call(w,y)&&s('Duplicate key "'+y+'"'),w[y]=m(),c(),e==="}")return o("}"),w;o(","),c()}}s("Bad object")};return m=function(){switch(c(),e){case"{":return b();case"[":return g();case'"':return l();case"-":return a();default:return e>="0"&&e<="9"?a():p()}},function(y){var w;return i=y,n=0,e=" ",w=m(),c(),e&&s("Syntax error"),w}}(),v.base64Encode=function(n){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",t,i,s,o,a,l,c,p,m=0,g=0,b="",y=[];if(!n)return n;n=v.utf8Encode(n);do t=n.charCodeAt(m++),i=n.charCodeAt(m++),s=n.charCodeAt(m++),p=t<<16|i<<8|s,o=p>>18&63,a=p>>12&63,l=p>>6&63,c=p&63,y[g++]=e.charAt(o)+e.charAt(a)+e.charAt(l)+e.charAt(c);while(m<n.length);switch(b=y.join(""),n.length%3){case 1:b=b.slice(0,-2)+"==";break;case 2:b=b.slice(0,-1)+"=";break}return b},v.utf8Encode=function(n){n=(n+"").replace(/\r\n/g,`
|
|
1166
1166
|
`).replace(/\r/g,`
|
|
1167
|
-
`);var e="",t,i,s=0,o;for(t=i=0,s=n.length,o=0;o<s;o++){var a=n.charCodeAt(o),l=null;a<128?i++:a>127&&a<2048?l=String.fromCharCode(a>>6|192,a&63|128):l=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),l!==null&&(i>t&&(e+=n.substring(t,i)),e+=l,t=i=o+1)}return i>t&&(e+=n.substring(t,n.length)),e},v.UUID=function(){var n=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(".","")},t=function(){var i=cn,s,o,a=[],l=0;function c(p,m){var g,b=0;for(g=0;g<m.length;g++)b|=a[g]<<g*8;return p^b}for(s=0;s<i.length;s++)o=i.charCodeAt(s),a.unshift(o&255),a.length>=4&&(l=c(l,a),a=[]);return a.length>0&&(l=c(l,a)),l.toString(16)};return function(){var i=(ti.height*ti.width).toString(16);return n()+"-"+e()+"-"+t()+"-"+i+"-"+n()}}();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(n){var e;for(n=n.toLowerCase(),e=0;e<Vo.length;e++)if(n.indexOf(Vo[e])!==-1)return!0;return!1},v.HTTPBuildQuery=function(n,e){var t,i,s=[];return v.isUndefined(e)&&(e="&"),v.each(n,function(o,a){t=encodeURIComponent(o.toString()),i=encodeURIComponent(a),s[s.length]=i+"="+t}),s.join(e)},v.getQueryParam=function(n,e){e=e.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var t="[\\?&]"+e+"=([^&#]*)",i=new RegExp(t),s=i.exec(n);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(n){for(var e=n+"=",t=oe.cookie.split(";"),i=0;i<t.length;i++){for(var s=t[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(n){var e;try{e=v.JSONDecode(v.cookie.get(n))||{}}catch{}return e},set_seconds:function(n,e,t,i,s,o,a){var l="",c="",p="";if(a)l="; domain="+a;else if(i){var m=Fo(oe.location.hostname);l=m?"; domain=."+m:""}if(t){var g=new Date;g.setTime(g.getTime()+t*1e3),c="; expires="+g.toGMTString()}o&&(s=!0,p="; SameSite=None"),s&&(p+="; secure"),oe.cookie=n+"="+encodeURIComponent(e)+c+"; path=/"+l+p},set:function(n,e,t,i,s,o,a){var l="",c="",p="";if(a)l="; domain="+a;else if(i){var m=Fo(oe.location.hostname);l=m?"; domain=."+m:""}if(t){var g=new Date;g.setTime(g.getTime()+t*24*60*60*1e3),c="; expires="+g.toGMTString()}o&&(s=!0,p="; SameSite=None"),s&&(p+="; secure");var b=n+"="+encodeURIComponent(e)+c+"; path=/"+l+p;return oe.cookie=b,b},remove:function(n,e,t){v.cookie.set(n,"",-1,e,!1,!1,t)}};var Yi=null,si=function(n,e){if(Yi!==null&&!e)return Yi;var t=!0;try{n=n||window.localStorage;var i="__mplss_"+Xi(8),s="xyz";n.setItem(i,s),n.getItem(i)!==s&&(t=!1),n.removeItem(i)}catch{t=!1}return Yi=t,t};v.localStorage={is_supported:function(n){var e=si(null,n);return e||ee.error("localStorage unsupported; falling back to cookie store"),e},error:function(n){ee.error("localStorage error: "+n)},get:function(n){try{return window.localStorage.getItem(n)}catch(e){v.localStorage.error(e)}return null},parse:function(n){try{return v.JSONDecode(v.localStorage.get(n))||{}}catch{}return null},set:function(n,e){try{window.localStorage.setItem(n,e)}catch(t){v.localStorage.error(t)}},remove:function(n){try{window.localStorage.removeItem(n)}catch(e){v.localStorage.error(e)}}},v.register_event=function(){var n=function(i,s,o,a,l){if(!i){ee.error("No valid element provided to register_event");return}if(i.addEventListener&&!a)i.addEventListener(s,o,!!l);else{var c="on"+s,p=i[c];i[c]=e(i,o,p)}};function e(i,s,o){var a=function(l){if(l=l||t(window.event),!!l){var c=!0,p,m;return v.isFunction(o)&&(p=o(l)),m=s.call(i,l),(p===!1||m===!1)&&(c=!1),c}};return a}function t(i){return i&&(i.preventDefault=t.preventDefault,i.stopPropagation=t.stopPropagation),i}return t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0},n}();var Rl=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');v.dom_query=function(){function n(s){return s.all?s.all:s.getElementsByTagName("*")}var e=/[\t\r\n]/g;function t(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,l,c,p,m,g,b,y,w,f,k=[oe];for(g=0;g<o.length;g++){if(a=o[g].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){l=a.split("#"),c=l[0];var x=l[1],A=oe.getElementById(x);if(!A||c&&A.nodeName.toLowerCase()!=c)return[];k=[A];continue}if(a.indexOf(".")>-1){l=a.split("."),c=l[0];var M=l[1];for(c||(c="*"),p=[],m=0,b=0;b<k.length;b++)for(c=="*"?w=n(k[b]):w=k[b].getElementsByTagName(c),y=0;y<w.length;y++)p[m++]=w[y];for(k=[],f=0,b=0;b<p.length;b++)p[b].className&&v.isString(p[b].className)&&t(p[b],M)&&(k[f++]=p[b]);continue}var E=a.match(Rl);if(E){c=E[1];var D=E[2],G=E[3],Z=E[4];for(c||(c="*"),p=[],m=0,b=0;b<k.length;b++)for(c=="*"?w=n(k[b]):w=k[b].getElementsByTagName(c),y=0;y<w.length;y++)p[m++]=w[y];k=[],f=0;var K;switch(G){case"=":K=function(Q){return Q.getAttribute(D)==Z};break;case"~":K=function(Q){return Q.getAttribute(D).match(new RegExp("\\b"+Z+"\\b"))};break;case"|":K=function(Q){return Q.getAttribute(D).match(new RegExp("^"+Z+"-?"))};break;case"^":K=function(Q){return Q.getAttribute(D).indexOf(Z)===0};break;case"$":K=function(Q){return Q.getAttribute(D).lastIndexOf(Z)==Q.getAttribute(D).length-Z.length};break;case"*":K=function(Q){return Q.getAttribute(D).indexOf(Z)>-1};break;default:K=function(Q){return Q.getAttribute(D)}}for(k=[],f=0,b=0;b<p.length;b++)K(p[b])&&(k[f++]=p[b]);continue}for(c=a,p=[],m=0,b=0;b<k.length;b++)for(w=k[b].getElementsByTagName(c),y=0;y<w.length;y++)p[m++]=w[y];k=p}return k}return function(s){return v.isElement(s)?[s]:v.isObject(s)&&!v.isUndefined(s.length)?s:i.call(this,s)}}();var Hl=["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(n){var e="",t={};return v.each(Hl,function(i){e=v.getQueryParam(oe.URL,i),e.length?t[i]=e:n!==void 0&&(t[i]=n)}),t},clickParams:function(){var n="",e={};return v.each(Nl,function(t){n=v.getQueryParam(oe.URL,t),n.length&&(e[t]=n)}),e},marketingParams:function(){return v.extend(v.info.campaignParams(),v.info.clickParams())},searchEngine:function(n){return n.search("https?://(.*)google.([^/?]*)")===0?"google":n.search("https?://(.*)bing.com")===0?"bing":n.search("https?://(.*)yahoo.com")===0?"yahoo":n.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(n){var e=v.info.searchEngine(n),t=e!="yahoo"?"q":"p",i={};if(e!==null){i.$search_engine=e;var s=v.getQueryParam(n,t);s.length&&(i.mp_keyword=s)}return i},browser:function(n,e,t){return e=e||"",t||v.includes(n," OPR/")?v.includes(n,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":v.includes(n,"IEMobile")||v.includes(n,"WPDesktop")?"Internet Explorer Mobile":v.includes(n,"SamsungBrowser/")?"Samsung Internet":v.includes(n,"Edge")||v.includes(n,"Edg/")?"Microsoft Edge":v.includes(n,"FBIOS")?"Facebook Mobile":v.includes(n,"Chrome")?"Chrome":v.includes(n,"CriOS")?"Chrome iOS":v.includes(n,"UCWEB")||v.includes(n,"UCBrowser")?"UC Browser":v.includes(n,"FxiOS")?"Firefox iOS":v.includes(e,"Apple")?v.includes(n,"Mobile")?"Mobile Safari":"Safari":v.includes(n,"Android")?"Android Mobile":v.includes(n,"Konqueror")?"Konqueror":v.includes(n,"Firefox")?"Firefox":v.includes(n,"MSIE")||v.includes(n,"Trident/")?"Internet Explorer":v.includes(n,"Gecko")?"Mozilla":""},browserVersion:function(n,e,t){var i=v.info.browser(n,e,t),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=n.match(o);return a?parseFloat(a[a.length-2]):null},os:function(){var n=cn;return/Windows/i.test(n)?/Phone/.test(n)||/WPDesktop/.test(n)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(n)?"iOS":/Android/.test(n)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Mac/i.test(n)?"Mac OS X":/Linux/.test(n)?"Linux":/CrOS/.test(n)?"Chrome OS":""},device:function(n){return/Windows Phone/i.test(n)||/WPDesktop/.test(n)?"Windows Phone":/iPad/.test(n)?"iPad":/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Android/.test(n)?"Android":""},referringDomain:function(n){var e=n.split("/");return e.length>=3?e[2]:""},currentUrl:function(){return O.location.href},properties:function(n){return typeof n!="object"&&(n={}),v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(cn,Pn.vendor,ni),$referrer:oe.referrer,$referring_domain:v.info.referringDomain(oe.referrer),$device:v.info.device(cn)}),{$current_url:v.info.currentUrl(),$browser_version:v.info.browserVersion(cn,Pn.vendor,ni),$screen_height:ti.height,$screen_width:ti.width,mp_lib:"web",$lib_version:bn.LIB_VERSION,$insert_id:Xi(),time:v.timestamp()/1e3},v.strip_empty_properties(n))},people_properties:function(){return v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(cn,Pn.vendor,ni)}),{$browser_version:v.info.browserVersion(cn,Pn.vendor,ni)})},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(n){var e=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return n?e.substring(0,n):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(n){var e=Ul,t=n.split("."),i=t[t.length-1];(i.length>4||i==="com"||i==="org")&&(e=Ol);var s=n.match(e);return s?s[0]:""},Vl=function(){var n=O.navigator.onLine;return v.isUndefined(n)||n},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(n,e){jo(!0,n,e)}function Gl(n,e){jo(!1,n,e)}function jl(n,e){return Go(n,e)==="1"}function Ko(n,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 t=Go(n,e)==="0";return t&&ee.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),t}function In(n){return ns(n,function(e){return this.get_config(e)})}function Dn(n){return ns(n,function(e){return this._get_config(e)})}function ht(n){return ns(n,function(e){return this._get_config(e)})}function zl(n,e){e=e||{},$i(e).remove(es(n,e),!!e.crossSubdomainCookie,e.cookieDomain)}function $i(n){return n=n||{},n.persistenceType==="localStorage"?v.localStorage:v.cookie}function es(n,e){return e=e||{},(e.persistencePrefix||Fl)+n}function Go(n,e){return $i(e).get(es(n,e))}function ql(n){if(n&&n.ignoreDnt)return!1;var e=n&&n.window||O,t=e.navigator||{},i=!1;return v.each([t.doNotTrack,t.msDoNotTrack,e.doNotTrack],function(s){v.includes([!0,1,"1","yes"],s)&&(i=!0)}),i}function jo(n,e,t){if(!v.isString(e)||!e.length){ee.error("gdpr."+(n?"optIn":"optOut")+" called with an invalid token");return}t=t||{},$i(t).set(es(e,t),n?1:0,v.isNumber(t.cookieExpiration)?t.cookieExpiration:null,!!t.crossSubdomainCookie,!!t.secureCookie,!!t.crossSiteCookie,t.cookieDomain),t.track&&n&&t.track(t.trackEventName||"$opt_in",t.trackProperties,{send_immediately:!0})}function ns(n,e){return function(){var t=!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"),l=e.call(this,"window");i&&(t=Ko(i,{ignoreDnt:s,persistenceType:o,persistencePrefix:a,window:l}))}catch(p){ee.error("Unexpected error when checking tracking opt-out status: "+p)}if(!t)return n.apply(this,arguments);var c=arguments[arguments.length-1];typeof c=="function"&&c(0)}}var Wl=ii("lock"),zo=function(n,e){e=e||{},this.storageKey=n,this.storage=e.storage||window.localStorage,this.pollIntervalMS=e.pollIntervalMS||100,this.timeoutMS=e.timeoutMS||2e3};zo.prototype.withLock=function(n,e,t){!t&&typeof e!="function"&&(t=e,e=null);var i=t||new Date().getTime()+"|"+Math.random(),s=new Date().getTime(),o=this.storageKey,a=this.pollIntervalMS,l=this.timeoutMS,c=this.storage,p=o+":X",m=o+":Y",g=o+":Z",b=function(A){e&&e(A)},y=function(A){if(new Date().getTime()-s>l){Wl.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+i+"]"),c.removeItem(g),c.removeItem(m),k();return}setTimeout(function(){try{A()}catch(M){b(M)}},a*(Math.random()+.1))},w=function(A,M){A()?M():y(function(){w(A,M)})},f=function(){var A=c.getItem(m);if(A&&A!==i)return!1;if(c.setItem(m,i),c.getItem(m)===i)return!0;if(!si(c,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},k=function(){c.setItem(p,i),w(f,function(){if(c.getItem(p)===i){x();return}y(function(){if(c.getItem(m)!==i){k();return}w(function(){return!c.getItem(g)},x)})})},x=function(){c.setItem(g,"1");try{n()}finally{c.removeItem(g),c.getItem(m)===i&&c.removeItem(m),c.getItem(p)===i&&c.removeItem(p)}};try{if(si(c,!0))k();else throw new Error("localStorage support check failed")}catch(A){b(A)}};var qo=ii("batch"),Bn=function(n,e){e=e||{},this.storageKey=n,this.storage=e.storage||window.localStorage,this.reportError=e.errorReporter||v.bind(qo.error,qo),this.lock=new zo(n,{storage:this.storage}),this.usePersistence=e.usePersistence,this.pid=e.pid||null,this.memQueue=[]};Bn.prototype.enqueue=function(n,e,t){var i={id:Xi(),flushAfter:new Date().getTime()+e*2,payload:n};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",n),o=!1}t&&t(o)},this),v.bind(function(o){this.reportError("Error acquiring storage lock",o),t&&t(!1)},this),this.pid):(this.memQueue.push(i),t&&t(!0))},Bn.prototype.fillBatch=function(n){var e=this.memQueue.slice(0,n);if(this.usePersistence&&e.length<n){var t=this.readFromStorage();if(t.length){var i={};v.each(e,function(a){i[a.id]=!0});for(var s=0;s<t.length;s++){var o=t[s];if(new Date().getTime()>o.flushAfter&&!i[o.id]&&(o.orphaned=!0,e.push(o),e.length>=n))break}}}return e};var Wo=function(n,e){var t=[];return v.each(n,function(i){i.id&&!e[i.id]&&t.push(i)}),t};Bn.prototype.removeItemsByID=function(n,e){var t={};if(v.each(n,function(s){t[s]=!0}),this.memQueue=Wo(this.memQueue,t),!this.usePersistence)e&&e(!0);else{var i=v.bind(function(){var s;try{var o=this.readFromStorage();if(o=Wo(o,t),s=this.saveToStorage(o),s){o=this.readFromStorage();for(var a=0;a<o.length;a++){var l=o[a];if(l.id&&t[l.id])return this.reportError("Item not removed from storage"),!1}}}catch{this.reportError("Error removing items",n),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(l){this.reportError("Error clearing queue",l)}e&&e(a)},this),this.pid)}};var Zo=function(n,e){var t=[];return v.each(n,function(i){var s=i.id;if(s in e){var o=e[s];o!==null&&(i.payload=o,t.push(i))}else t.push(i)}),t};Bn.prototype.updatePayloads=function(n,e){this.memQueue=Zo(this.memQueue,n),this.usePersistence?this.lock.withLock(v.bind(function(){var i;try{var s=this.readFromStorage();s=Zo(s,n),i=this.saveToStorage(s)}catch{this.reportError("Error updating items",n),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)},Bn.prototype.readFromStorage=function(){var n;try{n=this.storage.getItem(this.storageKey),n&&(n=ai(n),v.isArray(n)||(this.reportError("Invalid storage entry:",n),n=null))}catch(e){this.reportError("Error retrieving queue",e),n=null}return n||[]},Bn.prototype.saveToStorage=function(n){try{return this.storage.setItem(this.storageKey,oi(n)),!0}catch(e){return this.reportError("Error saving queue",e),!1}},Bn.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var Zl=10*60*1e3,Pt=ii("batch"),tn=function(n,e){this.errorReporter=e.errorReporter,this.queue=new Bn(n,{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};tn.prototype.enqueue=function(n,e){this.queue.enqueue(n,this.flushInterval,e)},tn.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},tn.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},tn.prototype.clear=function(){this.queue.clear()},tn.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},tn.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},tn.prototype.scheduleFlush=function(n){this.flushInterval=n,this.stopped||(this.timeoutID=setTimeout(v.bind(function(){this.stopped||this.flush()},this),this.flushInterval))},tn.prototype.flush=function(n){try{if(this.requestInProgress){Pt.log("Flush: Request already in progress");return}n=n||{};var e=this.libConfig.batch_request_timeout_ms,t=new Date().getTime(),i=this.batchSize,s=this.queue.fillBatch(i),o=s.length===i,a=[],l={};if(v.each(s,function(m){var g=m.payload;if(this.beforeSendHook&&!m.orphaned&&(g=this.beforeSendHook(g)),g){g.event&&g.properties&&(g.properties=v.extend({},g.properties,{mp_sent_by_lib_version:bn.LIB_VERSION}));var b=!0,y=m.id;y?(this.itemIdsSentSuccessfully[y]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:m,batchSize:s.length,timesSent:this.itemIdsSentSuccessfully[y]}),b=!1):this.reportError("[dupe] found item with no ID",{item:m}),b&&a.push(g)}l[m.id]=g},this),a.length<1){this.resetFlush();return}this.requestInProgress=!0;var c=v.bind(function(m){this.requestInProgress=!1;try{var g=!1;if(n.unloading)this.queue.updatePayloads(l);else if(v.isObject(m)&&m.error==="timeout"&&new Date().getTime()-t>=e)this.reportError("Network timeout; retrying"),this.flush();else if(v.isObject(m)&&(m.httpStatusCode>=500||m.httpStatusCode===429||m.httpStatusCode<=0&&!Vl()||m.error==="timeout")){var b=this.flushInterval*2;m.retryAfter&&(b=parseInt(m.retryAfter,10)*1e3||b),b=Math.min(Zl,b),this.reportError("Error; retry in "+b+" ms"),this.scheduleFlush(b)}else if(v.isObject(m)&&m.httpStatusCode===413)if(s.length>1){var y=Math.max(1,Math.floor(i/2));this.batchSize=Math.min(this.batchSize,y,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(),g=!0;else g=!0;g&&(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),p={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:e};n.unloading&&(p.transport="sendBeacon"),Pt.log("MIXPANEL REQUEST:",a),this.sendRequest(a,p,c)}catch(m){this.reportError("Error flushing request queue",m),this.resetFlush()}},tn.prototype.reportError=function(n,e){if(Pt.error.apply(Pt.error,arguments),this.errorReporter)try{e instanceof Error||(e=new Error(n)),this.errorReporter(n,e)}catch(t){Pt.error(t)}};var jn=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([ln.MouseMove,ln.MouseInteraction,ln.Scroll,ln.ViewportResize,ln.Input,ln.TouchMove,ln.MediaInteraction,ln.Drag,ln.Selection]);function Yl(n){return n.type===Bo.IncrementalSnapshot&&Jl.has(n.data.source)}var sn=function(n){this._mixpanel=n,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=_t,this.recordMinMs=0,this._initBatcher()};sn.prototype._initBatcher=function(){this.batcher=new tn("__mprec",{libConfig:Ql,sendRequestFunc:v.bind(this.flushEventsWithOptOut,this),errorReporter:v.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},sn.prototype.get_config=function(n){return this._mixpanel.get_config(n)},sn.prototype.startRecording=function(n){if(this._stopRecording!==null){jn.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>_t&&(this.recordMaxMs=_t,jn.critical("record_max_ms cannot be greater than "+_t+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>Wi&&(this.recordMinMs=Wi,jn.critical("record_min_ms cannot be greater than "+Wi+"ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=new Date().getTime(),this.replayId=v.UUID(),n||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var e=v.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(v.bind(function(){jn.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),this.get_config("record_idle_timeout_ms"))},this),t=this.get_config("record_block_selector");(t===""||t===null)&&(t=void 0),this._stopRecording=Tt({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:t,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)},sn.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},sn.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)},sn.prototype.flushEventsWithOptOut=function(n,e,t){this._flushEvents(n,e,t,v.bind(this._onOptOut,this))},sn.prototype._onOptOut=function(n){n===0&&(this.recEvents=[],this.stopRecording())},sn.prototype._sendRequest=function(n,e,t,i){var s=v.bind(function(o,a){o.status===200&&this.replayId===n&&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:t}).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})})},sn.prototype._flushEvents=In(function(n,e,t){const i=n.length;if(i>0){var s=this.replayId,o=n[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=n[i-1].timestamp-this.replayStartTime,l={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},c=v.JSONEncode(n),p=this._mixpanel.get_property("$device_id");p&&(l.$device_id=p);var m=this._mixpanel.get_property("$user_id");if(m&&(l.$user_id=m),Qo){var g=new Blob([c],{type:"application/json"}).stream(),b=g.pipeThrough(new Qo("gzip"));new Response(b).blob().then(v.bind(function(y){l.format="gzip",this._sendRequest(s,l,y,t)},this))}else l.format="body",this._sendRequest(s,l,c,t)}}),sn.prototype.reportError=function(n,e){jn.error.apply(jn.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.get_config("error_reporter")(n,e)}catch(t){jn.error(t)}},O.__mp_recorder=sn;var fn=function(){};fn.prototype.create_properties=function(){},fn.prototype.event_handler=function(){},fn.prototype.after_track_handler=function(){},fn.prototype.init=function(n){return this.mp=n,this},fn.prototype.track=function(n,e,t,i){var s=this,o=v.dom_query(n);if(o.length===0){ee.error("The DOM query ("+n+") returned 0 elements");return}return v.each(o,function(a){v.register_event(a,this.override_event,function(l){var c={},p=s.create_properties(t,this),m=s.mp.get_config("track_links_timeout");s.event_handler(l,this,c),window.setTimeout(s.track_callback(i,p,c,!0),m),s.mp.track(e,p,s.track_callback(i,p,c))})},this),!0},fn.prototype.track_callback=function(n,e,t,i){i=i||!1;var s=this;return function(){t.callback_fired||(t.callback_fired=!0,!(n&&n(i,e)===!1)&&s.after_track_handler(e,t,i))}},fn.prototype.create_properties=function(n,e){var t;return typeof n=="function"?t=n(e):t=v.extend({},n),t};var mt=function(){this.override_event="click"};v.inherit(mt,fn),mt.prototype.create_properties=function(n,e){var t=mt.superclass.create_properties.apply(this,arguments);return e.href&&(t.url=e.href),t},mt.prototype.event_handler=function(n,e,t){t.new_tab=n.which===2||n.metaKey||n.ctrlKey||e.target==="_blank",t.href=e.href,t.new_tab||n.preventDefault()},mt.prototype.after_track_handler=function(n,e){e.new_tab||setTimeout(function(){window.location=e.href},0)};var ri=function(){this.override_event="submit"};v.inherit(ri,fn),ri.prototype.event_handler=function(n,e,t){t.element=e,n.preventDefault()},ri.prototype.after_track_handler=function(n,e){setTimeout(function(){e.element.submit()},0)};var Rn="$set",pt="$set_once",on="$unset",zn="$add",dn="$append",qn="$union",gn="$remove",Xl="$delete",Jo={set_action:function(n,e){var t={},i={};return v.isObject(n)?v.each(n,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[n]=e,t[Rn]=i,t},unset_action:function(n){var e={},t=[];return v.isArray(n)||(n=[n]),v.each(n,function(i){this._is_reserved_property(i)||t.push(i)},this),e[on]=t,e},set_once_action:function(n,e){var t={},i={};return v.isObject(n)?v.each(n,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[n]=e,t[pt]=i,t},union_action:function(n,e){var t={},i={};return v.isObject(n)?v.each(n,function(s,o){this._is_reserved_property(o)||(i[o]=v.isArray(s)?s:[s])},this):i[n]=v.isArray(e)?e:[e],t[qn]=i,t},append_action:function(n,e){var t={},i={};return v.isObject(n)?v.each(n,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[n]=e,t[dn]=i,t},remove_action:function(n,e){var t={},i={};return v.isObject(n)?v.each(n,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[n]=e,t[gn]=i,t},delete_action:function(){var n={};return n[Xl]="",n}},le=function(){};v.extend(le.prototype,Jo),le.prototype._init=function(n,e,t){this._mixpanel=n,this._group_key=e,this._group_id=t},le.prototype.set=ht(function(n,e,t){var i=this.set_action(n,e);return v.isObject(n)&&(t=e),this._send_request(i,t)}),le.prototype.set_once=ht(function(n,e,t){var i=this.set_once_action(n,e);return v.isObject(n)&&(t=e),this._send_request(i,t)}),le.prototype.unset=ht(function(n,e){var t=this.unset_action(n);return this._send_request(t,e)}),le.prototype.union=ht(function(n,e,t){v.isObject(n)&&(t=e);var i=this.union_action(n,e);return this._send_request(i,t)}),le.prototype.delete=ht(function(n){var e=this.delete_action();return this._send_request(e,n)}),le.prototype.remove=ht(function(n,e,t){var i=this.remove_action(n,e);return this._send_request(i,t)}),le.prototype._send_request=function(n,e){n.$group_key=this._group_key,n.$group_id=this._group_id,n.$token=this._get_config("token");var t=v.encodeDates(n);return this._mixpanel._track_or_batch({type:"groups",data:t,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(n){return n==="$group_key"||n==="$group_id"},le.prototype._get_config=function(n){return this._mixpanel.get_config(n)},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(n){this._mixpanel=n},U.prototype.set=Dn(function(n,e,t){var i=this.set_action(n,e);return v.isObject(n)&&(t=e),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),i[Rn]=v.extend({},v.info.people_properties(),i[Rn]),this._send_request(i,t)}),U.prototype.set_once=Dn(function(n,e,t){var i=this.set_once_action(n,e);return v.isObject(n)&&(t=e),this._send_request(i,t)}),U.prototype.unset=Dn(function(n,e){var t=this.unset_action(n);return this._send_request(t,e)}),U.prototype.increment=Dn(function(n,e,t){var i={},s={};return v.isObject(n)?(v.each(n,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),t=e):(v.isUndefined(e)&&(e=1),s[n]=e),i[zn]=s,this._send_request(i,t)}),U.prototype.append=Dn(function(n,e,t){v.isObject(n)&&(t=e);var i=this.append_action(n,e);return this._send_request(i,t)}),U.prototype.remove=Dn(function(n,e,t){v.isObject(n)&&(t=e);var i=this.remove_action(n,e);return this._send_request(i,t)}),U.prototype.union=Dn(function(n,e,t){v.isObject(n)&&(t=e);var i=this.union_action(n,e);return this._send_request(i,t)}),U.prototype.track_charge=Dn(function(n,e,t){if(!v.isNumber(n)&&(n=parseFloat(n),isNaN(n))){ee.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",v.extend({$amount:n},e),t)}),U.prototype.clear_charges=function(n){return this.set("$transactions",[],n)},U.prototype.delete_user=function(){if(!this._identify_called()){ee.error("mixpanel.people.delete_user() requires you to call identify() first");return}var n={$delete:this._mixpanel.get_distinct_id()};return this._send_request(n)},U.prototype.toString=function(){return this._mixpanel.toString()+".people"},U.prototype._send_request=function(n,e){n.$token=this._get_config("token"),n.$distinct_id=this._mixpanel.get_distinct_id();var t=this._mixpanel.get_property("$device_id"),i=this._mixpanel.get_property("$user_id"),s=this._mixpanel.get_property("$had_persisted_distinct_id");t&&(n.$device_id=t),i&&(n.$user_id=i),s&&(n.$had_persisted_distinct_id=s);var o=v.encodeDates(n);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(n),v.isUndefined(e)||(this._get_config("verbose")?e({status:-1,error:null}):e(-1)),v.truncate(o,255))},U.prototype._get_config=function(n){return this._mixpanel.get_config(n)},U.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},U.prototype._enqueue=function(n){Rn in n?this._mixpanel.persistence._add_to_people_queue(Rn,n):pt in n?this._mixpanel.persistence._add_to_people_queue(pt,n):on in n?this._mixpanel.persistence._add_to_people_queue(on,n):zn in n?this._mixpanel.persistence._add_to_people_queue(zn,n):dn in n?this._mixpanel.persistence._add_to_people_queue(dn,n):gn in n?this._mixpanel.persistence._add_to_people_queue(gn,n):qn in n?this._mixpanel.persistence._add_to_people_queue(qn,n):ee.error("Invalid call to _enqueue():",n)},U.prototype._flush_one_queue=function(n,e,t,i){var s=this,o=v.extend({},this._mixpanel.persistence.load_queue(n)),a=o;!v.isUndefined(o)&&v.isObject(o)&&!v.isEmptyObject(o)&&(s._mixpanel.persistence._pop_from_people_queue(n,o),s._mixpanel.persistence.save(),i&&(a=i(o)),e.call(s,a,function(l,c){l===0&&s._mixpanel.persistence._add_to_people_queue(n,o),v.isUndefined(t)||t(l,c)}))},U.prototype._flush=function(n,e,t,i,s,o,a){var l=this;this._flush_one_queue(Rn,this.set,n),this._flush_one_queue(pt,this.set_once,i),this._flush_one_queue(on,this.unset,o,function(k){return v.keys(k)}),this._flush_one_queue(zn,this.increment,e),this._flush_one_queue(qn,this.union,s);var c=this._mixpanel.persistence.load_queue(dn);if(!v.isUndefined(c)&&v.isArray(c)&&c.length)for(var p,m=function(k,x){k===0&&l._mixpanel.persistence._add_to_people_queue(dn,p),v.isUndefined(t)||t(k,x)},g=c.length-1;g>=0;g--)c=this._mixpanel.persistence.load_queue(dn),p=c.pop(),l._mixpanel.persistence.save(),v.isEmptyObject(p)||l.append(p,m);var b=this._mixpanel.persistence.load_queue(gn);if(!v.isUndefined(b)&&v.isArray(b)&&b.length)for(var y,w=function(k,x){k===0&&l._mixpanel.persistence._add_to_people_queue(gn,y),v.isUndefined(a)||a(k,x)},f=b.length-1;f>=0;f--)b=this._mixpanel.persistence.load_queue(gn),y=b.pop(),l._mixpanel.persistence.save(),v.isEmptyObject(y)||l.remove(y,w)},U.prototype._is_reserved_property=function(n){return n==="$distinct_id"||n==="$token"||n==="$device_id"||n==="$user_id"||n==="$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 ts="__mps",is="__mpso",ss="__mpus",os="__mpa",as="__mpap",rs="__mpr",ls="__mpu",Yo="$people_distinct_id",li="__alias",It="__timers",$l=[ts,is,ss,os,as,rs,ls,Yo,li,It],W=function(n){this.props={},this.campaign_params_saved=!1,n.persistence_name?this.name="mp_"+n.persistence_name:this.name="mp_"+n.token+"_mixpanel";var e=n.persistence;e!=="cookie"&&e!=="localStorage"&&(ee.critical("Unknown persistence type "+e+"; falling back to cookie"),e=n.persistence="cookie"),e==="localStorage"&&v.localStorage.is_supported()?this.storage=v.localStorage:this.storage=v.cookie,this.load(),this.update_config(n),this.upgrade(),this.save()};W.prototype.properties=function(){var n={};return this.load(),v.each(this.props,function(e,t){v.include($l,t)||(n[t]=e)}),n},W.prototype.load=function(){if(!this.disabled){var n=this.storage.parse(this.name);n&&(this.props=v.extend({},n))}},W.prototype.upgrade=function(){var n,e;this.storage===v.localStorage?(n=v.cookie.parse(this.name),v.cookie.remove(this.name),v.cookie.remove(this.name,!0),n&&this.register_once(n)):this.storage===v.cookie&&(e=v.localStorage.parse(this.name),v.localStorage.remove(this.name),e&&this.register_once(e))},W.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)},W.prototype.load_prop=function(n){return this.load(),this.props[n]},W.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},W.prototype.clear=function(){this.remove(),this.props={}},W.prototype.register_once=function(n,e,t){return v.isObject(n)?(typeof e>"u"&&(e="None"),this.expire_days=typeof t>"u"?this.default_expiry:t,this.load(),v.each(n,function(i,s){(!this.props.hasOwnProperty(s)||this.props[s]===e)&&(this.props[s]=i)},this),this.save(),!0):!1},W.prototype.register=function(n,e){return v.isObject(n)?(this.expire_days=typeof e>"u"?this.default_expiry:e,this.load(),v.extend(this.props,n),this.save(),!0):!1},W.prototype.unregister=function(n){this.load(),n in this.props&&(delete this.props[n],this.save())},W.prototype.update_search_keyword=function(n){this.register(v.info.searchInfo(n))},W.prototype.update_referrer_info=function(n){this.register_once({$initial_referrer:n||"$direct",$initial_referring_domain:v.info.referringDomain(n)||"$direct"},"")},W.prototype.get_referrer_info=function(){return v.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},W.prototype.update_config=function(n){this.default_expiry=this.expire_days=n.cookie_expiration,this.set_disabled(n.disable_persistence),this.set_cookie_domain(n.cookie_domain),this.set_cross_site(n.cross_site_cookie),this.set_cross_subdomain(n.cross_subdomain_cookie),this.set_secure(n.secure_cookie)},W.prototype.set_disabled=function(n){this.disabled=n,this.disabled?this.remove():this.save()},W.prototype.set_cookie_domain=function(n){n!==this.cookie_domain&&(this.remove(),this.cookie_domain=n,this.save())},W.prototype.set_cross_site=function(n){n!==this.cross_site&&(this.cross_site=n,this.remove(),this.save())},W.prototype.set_cross_subdomain=function(n){n!==this.cross_subdomain&&(this.cross_subdomain=n,this.remove(),this.save())},W.prototype.get_cross_subdomain=function(){return this.cross_subdomain},W.prototype.set_secure=function(n){n!==this.secure&&(this.secure=!!n,this.remove(),this.save())},W.prototype._add_to_people_queue=function(n,e){var t=this._get_queue_key(n),i=e[n],s=this._get_or_create_queue(Rn),o=this._get_or_create_queue(pt),a=this._get_or_create_queue(on),l=this._get_or_create_queue(zn),c=this._get_or_create_queue(qn),p=this._get_or_create_queue(gn,[]),m=this._get_or_create_queue(dn,[]);t===ts?(v.extend(s,i),this._pop_from_people_queue(zn,i),this._pop_from_people_queue(qn,i),this._pop_from_people_queue(on,i)):t===is?(v.each(i,function(g,b){b in o||(o[b]=g)}),this._pop_from_people_queue(on,i)):t===ss?v.each(i,function(g){v.each([s,o,l,c],function(b){g in b&&delete b[g]}),v.each(m,function(b){g in b&&delete b[g]}),a[g]=!0}):t===os?(v.each(i,function(g,b){b in s?s[b]+=g:(b in l||(l[b]=0),l[b]+=g)},this),this._pop_from_people_queue(on,i)):t===ls?(v.each(i,function(g,b){v.isArray(g)&&(b in c||(c[b]=[]),c[b]=c[b].concat(g))}),this._pop_from_people_queue(on,i)):t===rs?(p.push(i),this._pop_from_people_queue(dn,i)):t===as&&(m.push(i),this._pop_from_people_queue(on,i)),ee.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),ee.log(e),this.save()},W.prototype._pop_from_people_queue=function(n,e){var t=this.props[this._get_queue_key(n)];v.isUndefined(t)||v.each(e,function(i,s){n===dn||n===gn?v.each(t,function(o){o[s]===i&&delete o[s]}):delete t[s]},this)},W.prototype.load_queue=function(n){return this.load_prop(this._get_queue_key(n))},W.prototype._get_queue_key=function(n){if(n===Rn)return ts;if(n===pt)return is;if(n===on)return ss;if(n===zn)return os;if(n===dn)return as;if(n===gn)return rs;if(n===qn)return ls;ee.error("Invalid queue:",n)},W.prototype._get_or_create_queue=function(n,e){var t=this._get_queue_key(n);return e=v.isUndefined(e)?{}:e,this.props[t]||(this.props[t]=e)},W.prototype.set_event_timer=function(n,e){var t=this.load_prop(It)||{};t[n]=e,this.props[It]=t,this.save()},W.prototype.remove_event_timer=function(n){var e=this.load_prop(It)||{},t=e[n];return v.isUndefined(t)||(delete this.props[It][n],this.save()),t};var cs,Xo=function(n,e){throw new Error(n+" not available in this build.")},Ie,$o=0,ec=1,nc=function(n){return n},Dt=function(){},Ze="mixpanel",ea="base64",tc="json",ds="$device:",vt=O.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,na=!vt&&cn.indexOf("MSIE")===-1&&cn.indexOf("Mozilla")===-1,ci=null;Pn.sendBeacon&&(ci=function(){return Pn.sendBeacon.apply(Pn,arguments)});var ta={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},ia={api_host:"https://api-js.mixpanel.com",api_routes:ta,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:Dt,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Dt,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:_t,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(n,e,t){var i,s=t===Ze?Ie:Ie[t];if(s&&cs===$o)i=s;else{if(s&&!v.isArray(s)){ee.error("You have already initialized "+t);return}i=new L}if(i._cached_groups={},i._init(n,e,t),i.people=new U,i.people._init(i),!i.get_config("skip_first_touch_marketing")){var o=v.info.campaignParams(null),a={},l=!1;v.each(o,function(c,p){a["initial_"+p]=c,c&&(l=!0)}),l&&i.people.set_once(a)}return bn.DEBUG=bn.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(n,e,t){if(v.isUndefined(t)){this.report_error("You must name your new library: init(token, config, name)");return}if(t===Ze){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var i=us(n,e,t);return Ie[t]=i,i._loaded(),i},L.prototype._init=function(n,e,t){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=tc)}if(this.set_config(v.extend({},ia,i,e,{name:t,token:n,callback_fn:(t===Ze?t:Ze+"."+t)+"._jsc"})),this._jsc=Dt,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)||!vt)this._batch_requests=!1,ee.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),v.each(this.get_batcher_configs(),function(c){ee.log("Clearing batch queue "+c.queue_key),v.localStorage.remove(c.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(c){c.persisted&&o()}),O.addEventListener("visibilitychange",function(){oe.visibilityState==="hidden"&&o()})}}this.persistence=this.cookie=new W(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 l=this.get_config("track_pageview");l&&this._init_url_change_tracking(l),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=In(function(){if(!O.MutationObserver){ee.critical("Browser does not support MutationObserver; skipping session recording");return}var n=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"),n):n()}),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 n={};if(this._recorder){var e=this._recorder.replayId;e&&(n.$mp_replay_id=e)}return n},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 n=v.info.campaignParams(null);v.each(n,(function(e,t){this.unregister(t)}).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(n){this._track_dom.apply(this,n)},this),this.has_opted_out_tracking()||v.each(this.__request_queue,function(n){this._send_request.apply(this,n)},this),delete this.__dom_loaded_queue,delete this.__request_queue},L.prototype._track_dom=function(n,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([n,e]),!1;var t=new n().init(this);return t.track.apply(t,e)},L.prototype._init_url_change_tracking=function(n){var e="",t=this.track_pageview();if(t&&(e=v.info.currentUrl()),v.include(["full-url","url-with-path-and-query-string","url-with-path"],n)){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,l){i.call(O.history,o,a,l),O.dispatchEvent(new Event("mp_locationchange"))});var s=O.history.replaceState;typeof s=="function"&&(O.history.replaceState=function(o,a,l){s.call(O.history,o,a,l),O.dispatchEvent(new Event("mp_locationchange"))}),O.addEventListener("mp_locationchange",(function(){var o=v.info.currentUrl(),a=!1;if(n==="full-url"?a=o!==e:n==="url-with-path-and-query-string"?a=o.split("#")[0]!==e.split("#")[0]:n==="url-with-path"&&(a=o.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0]),a){var l=this.track_pageview();l&&(e=o)}}).bind(this))}},L.prototype._prepare_callback=function(n,e){if(v.isUndefined(n))return null;if(vt){var t=function(a){n(a,e)};return t}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],n(a,e)},o}},L.prototype._send_request=function(n,e,t,i){var s=!0;if(na)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(t)||typeof t=="string")&&(i=t,t=null),t=v.extend(o,t||{}),vt||(t.method="GET");var l=t.method==="POST",c=ci&&l&&t.transport.toLowerCase()==="sendbeacon",p=t.verbose;e.verbose&&(p=!0),this.get_config("test")&&(e.test=1),p&&(e.verbose=1),this.get_config("img")&&(e.img=1),vt||(i?e.callback=i:(p||this.get_config("test"))&&(e.callback="(function(){})")),e.ip=this.get_config("ip")?1:0,e._=new Date().getTime().toString(),l&&(a="data="+encodeURIComponent(e.data),delete e.data),n+="?"+v.HTTPBuildQuery(e);var m=this;if("img"in e){var g=oe.createElement("img");g.src=n,oe.body.appendChild(g)}else if(c){try{s=ci(n,a)}catch(x){m.report_error(x),s=!1}try{i&&i(s?1:0)}catch(x){m.report_error(x)}}else if(vt)try{var b=new XMLHttpRequest;b.open(t.method,n,!0);var y=this.get_config("xhr_headers");if(l&&(y["Content-Type"]="application/x-www-form-urlencoded"),v.each(y,function(x,A){b.setRequestHeader(A,x)}),t.timeout_ms&&typeof b.timeout<"u"){b.timeout=t.timeout_ms;var w=new Date().getTime()}b.withCredentials=!0,b.onreadystatechange=function(){if(b.readyState===4)if(b.status===200){if(i)if(p){var x;try{x=v.JSONDecode(b.responseText)}catch(E){if(m.report_error(E),t.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,m.report_error(A),i)if(p){var M=b.responseHeaders||{};i({status:0,httpStatusCode:b.status,error:A,retryAfter:M["Retry-After"]})}else i(0)}},b.send(a)}catch(x){m.report_error(x),s=!1}else{var f=oe.createElement("script");f.type="text/javascript",f.async=!0,f.defer=!0,f.src=n;var k=oe.getElementsByTagName("script")[0];k.parentNode.insertBefore(f,k)}return s},L.prototype._execute_array=function(n){var e,t=[],i=[],s=[];v.each(n,function(a){a&&(e=a[0],v.isArray(e)?s.push(a):typeof a=="function"?a.call(this):v.isArray(a)&&e==="alias"?t.push(a):v.isArray(a)&&e.indexOf("track")!==-1&&typeof this[e]=="function"?s.push(a):i.push(a))},this);var o=function(a,l){v.each(a,function(c){if(v.isArray(c[0])){var p=l;v.each(c,function(m){p=p[m[0]].apply(p,m.slice(1))})}else this[c[0]].apply(this,c.slice(1))},l)};o(t,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 n="__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:n+"_ev"},people:{type:"people",endpoint:"/"+e.engage,queue_key:n+"_pp"},groups:{type:"groups",endpoint:"/"+e.groups,queue_key:n+"_gr"}},this._batcher_configs},L.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var n=v.bind(function(t){return new tn(t.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")+t.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_"+t.type,i)},this),stopAllBatchingFunc:v.bind(this.stop_batch_senders,this),usePersistence:!0})},this),e=this.get_batcher_configs();this.request_batchers={events:n(e.events),people:n(e.people),groups:n(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(n){n.start()}))},L.prototype.stop_batch_senders=function(){this._batch_requests=!1,v.each(this.request_batchers,function(n){n.stop(),n.clear()})},L.prototype.push=function(n){this._execute_array([n])},L.prototype.disable=function(n){typeof n>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(n)},L.prototype._encode_data_for_request=function(n){var e=v.JSONEncode(n);return this.get_config("api_payload_format")===ea&&(e=v.base64Encode(e)),{data:e}},L.prototype._track_or_batch=function(n,e){var t=v.truncate(n.data,255),i=n.endpoint,s=n.batcher,o=n.should_send_immediately,a=n.send_request_options||{};e=e||Dt;var l=!0,c=v.bind(function(){return a.skip_hooks||(t=this._run_hook("before_send_"+n.type,t)),t?(ee.log("MIXPANEL REQUEST:"),ee.log(t),this._send_request(i,this._encode_data_for_request(t),a,this._prepare_callback(e,t))):null},this);return this._batch_requests&&!o?s.enqueue(t,function(p){p?e(1,t):c()}):l=c(),l&&t},L.prototype.track=In(function(n,e,t,i){!i&&typeof t=="function"&&(i=t,t=null),t=t||{};var s=t.transport;s&&(t.transport=s);var o=t.send_immediately;if(typeof i!="function"&&(i=Dt),v.isUndefined(n)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(n)){i(0);return}e=v.extend({},e),e.token=this.get_config("token");var a=this.persistence.remove_event_timer(n);if(!v.isUndefined(a)){var l=new Date().getTime()-a;e.$duration=parseFloat((l/1e3).toFixed(3))}this._set_default_superprops();var c=this.get_config("track_marketing")?v.info.marketingParams():{};e=v.extend({},v.info.properties({mp_loader:this.get_config("mp_loader")}),c,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),e);var p=this.get_config("property_blacklist");v.isArray(p)?v.each(p,function(b){delete e[b]}):this.report_error("Invalid value for property_blacklist config: "+p);var m={event:n,properties:e},g=this._track_or_batch({type:"events",data:m,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:t},i);return g}),L.prototype.set_group=In(function(n,e,t){v.isArray(e)||(e=[e]);var i={};return i[n]=e,this.register(i),this.people.set(n,e,t)}),L.prototype.add_group=In(function(n,e,t){var i=this.get_property(n),s={};return i===void 0?(s[n]=[e],this.register(s)):i.indexOf(e)===-1&&(i.push(e),s[n]=i,this.register(s)),this.people.union(n,e,t)}),L.prototype.remove_group=In(function(n,e,t){var i=this.get_property(n);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(n)}return this.people.remove(n,e,t)}),L.prototype.track_with_groups=In(function(n,e,t,i){var s=v.extend({},e||{});return v.each(t,function(o,a){o!=null&&(s[a]=o)}),this.track(n,s,i)}),L.prototype._create_map_key=function(n,e){return n+"_"+JSON.stringify(e)},L.prototype._remove_group_from_cache=function(n,e){delete this._cached_groups[this._create_map_key(n,e)]},L.prototype.get_group=function(n,e){var t=this._create_map_key(n,e),i=this._cached_groups[t];return(i===void 0||i._group_key!==n||i._group_id!==e)&&(i=new le,i._init(this,n,e),this._cached_groups[t]=i),i},L.prototype.track_pageview=In(function(n,e){typeof n!="object"&&(n={}),e=e||{};var t=e.event_name||"$mp_web_page_view",i=v.extend(v.info.mpPageViewProperties(),v.info.campaignParams(),v.info.clickParams()),s=v.extend({},i,n);return this.track(t,s)}),L.prototype.track_links=function(){return this._track_dom.call(this,mt,arguments)},L.prototype.track_forms=function(){return this._track_dom.call(this,ri,arguments)},L.prototype.time_event=function(n){if(v.isUndefined(n)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(n)||this.persistence.set_event_timer(n,new Date().getTime())};var ic={persistent:!0},hs=function(n){var e;return v.isObject(n)?e=n:v.isUndefined(n)?e={}:e={days:n},v.extend({},ic,e)};L.prototype.register=function(n,e){var t=hs(e);t.persistent?this.persistence.register(n,t.days):v.extend(this.unpersisted_superprops,n)},L.prototype.register_once=function(n,e,t){var i=hs(t);i.persistent?this.persistence.register_once(n,e,i.days):(typeof e>"u"&&(e="None"),v.each(n,function(s,o){(!this.unpersisted_superprops.hasOwnProperty(o)||this.unpersisted_superprops[o]===e)&&(this.unpersisted_superprops[o]=s)},this))},L.prototype.unregister=function(n,e){e=hs(e),e.persistent?this.persistence.unregister(n):delete this.unpersisted_superprops[n]},L.prototype._register_single=function(n,e){var t={};t[n]=e,this.register(t)},L.prototype.identify=function(n,e,t,i,s,o,a,l){var c=this.get_distinct_id();if(n&&c!==n){if(typeof n=="string"&&n.indexOf(ds)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:n})}if(!this.get_property("$device_id")){var p=c;this.register_once({$had_persisted_distinct_id:!0,$device_id:p},"")}n!==c&&n!==this.get_property(li)&&(this.unregister(li),this.register({distinct_id:n})),this._flags.identify_called=!0,this.people._flush(e,t,i,s,o,a,l),n!==c&&this.track("$identify",{distinct_id:n,$anon_distinct_id:c},{skip_hooks:!0})},L.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var n=v.UUID();this.register_once({distinct_id:ds+n,$device_id:n},"")},L.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},L.prototype.alias=function(n,e){if(n===this.get_property(Yo))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var t=this;return v.isUndefined(e)&&(e=this.get_distinct_id()),n!==e?(this._register_single(li,n),this.track("$create_alias",{alias:n,distinct_id:e},{skip_hooks:!0},function(){t.identify(n)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(n),-1)},L.prototype.name_tag=function(n){this._register_single("mp_name_tag",n)},L.prototype.set_config=function(n){if(v.isObject(n)){v.extend(this.config,n);var e=n.batch_size;e&&v.each(this.request_batchers,function(t){t.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),bn.DEBUG=bn.DEBUG||this.get_config("debug")}},L.prototype.get_config=function(n){return this.config[n]},L.prototype._run_hook=function(n){var e=(this.config.hooks[n]||nc).apply(this,En.call(arguments,1));return typeof e>"u"&&(this.report_error(n+" hook did not return a value"),e=null),e},L.prototype.get_property=function(n){return this.persistence.load_prop([n])},L.prototype.toString=function(){var n=this.get_config("name");return n!==Ze&&(n=Ze+"."+n),n},L.prototype._event_is_disabled=function(n){return v.isBlockedUA(cn)||this._flags.disable_all_events||v.include(this.__disabled_events,n)},L.prototype._gdpr_init=function(){var n=this.get_config("opt_out_tracking_persistence_type")==="localStorage";n&&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(n){var e;if(n&&n.clear_persistence)e=!0;else if(n&&n.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(n,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"),n(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(n){n=v.extend({enable_persistence:!0},n),this._gdpr_call_func(Kl,n),this._gdpr_update_persistence(n)},L.prototype.opt_out_tracking=function(n){n=v.extend({clear_persistence:!0,delete_user:!0},n),n.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(Gl,n),this._gdpr_update_persistence(n)},L.prototype.has_opted_in_tracking=function(n){return this._gdpr_call_func(jl,n)},L.prototype.has_opted_out_tracking=function(n){return this._gdpr_call_func(Ko,n)},L.prototype.clear_opt_in_out_tracking=function(n){n=v.extend({enable_persistence:!0},n),this._gdpr_call_func(zl,n),this._gdpr_update_persistence(n)},L.prototype.report_error=function(n,e){ee.error.apply(ee.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.get_config("error_reporter")(n,e)}catch(t){ee.error(t)}},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=ta,W.prototype.properties=W.prototype.properties,W.prototype.update_search_keyword=W.prototype.update_search_keyword,W.prototype.update_referrer_info=W.prototype.update_referrer_info,W.prototype.get_cross_subdomain=W.prototype.get_cross_subdomain,W.prototype.clear=W.prototype.clear;var bt={},sc=function(){v.each(bt,function(n,e){e!==Ze&&(Ie[e]=n)}),Ie._=v},oc=function(){Ie.init=function(n,e,t){if(t)return Ie[t]||(Ie[t]=bt[t]=us(n,e,t),Ie[t]._loaded()),Ie[t];var i=Ie;bt[Ze]?i=bt[Ze]:n&&(i=us(n,e,Ze),i._loaded(),bt[Ze]=i),Ie=i,cs===ec&&(O[Ze]=Ie),sc()}},ac=function(){function n(){n.done||(n.done=!0,sa=!0,na=!1,v.each(bt,function(i){i._dom_loaded()}))}function e(){try{oe.documentElement.doScroll("left")}catch{setTimeout(e,1);return}n()}if(oe.addEventListener)oe.readyState==="complete"?n():oe.addEventListener("DOMContentLoaded",n,!1);else if(oe.attachEvent){oe.attachEvent("onreadystatechange",n);var t=!1;try{t=O.frameElement===null}catch{}oe.documentElement.doScroll&&t&&e()}v.register_event(O,"load",n,!0)};function rc(n){return Xo=n,cs=$o,Ie=new L,oc(),Ie.init(),ac(),Ie}function lc(n,e){e()}var _=rc(lc);const cc=`<div id="checkoutConfirmationEnd" data-section="transfer">
|
|
1167
|
+
`);var e="",t,i,s=0,o;for(t=i=0,s=n.length,o=0;o<s;o++){var a=n.charCodeAt(o),l=null;a<128?i++:a>127&&a<2048?l=String.fromCharCode(a>>6|192,a&63|128):l=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),l!==null&&(i>t&&(e+=n.substring(t,i)),e+=l,t=i=o+1)}return i>t&&(e+=n.substring(t,n.length)),e},v.UUID=function(){var n=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(".","")},t=function(){var i=cn,s,o,a=[],l=0;function c(p,m){var g,b=0;for(g=0;g<m.length;g++)b|=a[g]<<g*8;return p^b}for(s=0;s<i.length;s++)o=i.charCodeAt(s),a.unshift(o&255),a.length>=4&&(l=c(l,a),a=[]);return a.length>0&&(l=c(l,a)),l.toString(16)};return function(){var i=(ti.height*ti.width).toString(16);return n()+"-"+e()+"-"+t()+"-"+i+"-"+n()}}();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(n){var e;for(n=n.toLowerCase(),e=0;e<Vo.length;e++)if(n.indexOf(Vo[e])!==-1)return!0;return!1},v.HTTPBuildQuery=function(n,e){var t,i,s=[];return v.isUndefined(e)&&(e="&"),v.each(n,function(o,a){t=encodeURIComponent(o.toString()),i=encodeURIComponent(a),s[s.length]=i+"="+t}),s.join(e)},v.getQueryParam=function(n,e){e=e.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var t="[\\?&]"+e+"=([^&#]*)",i=new RegExp(t),s=i.exec(n);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(n){for(var e=n+"=",t=oe.cookie.split(";"),i=0;i<t.length;i++){for(var s=t[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(n){var e;try{e=v.JSONDecode(v.cookie.get(n))||{}}catch{}return e},set_seconds:function(n,e,t,i,s,o,a){var l="",c="",p="";if(a)l="; domain="+a;else if(i){var m=Fo(oe.location.hostname);l=m?"; domain=."+m:""}if(t){var g=new Date;g.setTime(g.getTime()+t*1e3),c="; expires="+g.toGMTString()}o&&(s=!0,p="; SameSite=None"),s&&(p+="; secure"),oe.cookie=n+"="+encodeURIComponent(e)+c+"; path=/"+l+p},set:function(n,e,t,i,s,o,a){var l="",c="",p="";if(a)l="; domain="+a;else if(i){var m=Fo(oe.location.hostname);l=m?"; domain=."+m:""}if(t){var g=new Date;g.setTime(g.getTime()+t*24*60*60*1e3),c="; expires="+g.toGMTString()}o&&(s=!0,p="; SameSite=None"),s&&(p+="; secure");var b=n+"="+encodeURIComponent(e)+c+"; path=/"+l+p;return oe.cookie=b,b},remove:function(n,e,t){v.cookie.set(n,"",-1,e,!1,!1,t)}};var Yi=null,si=function(n,e){if(Yi!==null&&!e)return Yi;var t=!0;try{n=n||window.localStorage;var i="__mplss_"+Xi(8),s="xyz";n.setItem(i,s),n.getItem(i)!==s&&(t=!1),n.removeItem(i)}catch{t=!1}return Yi=t,t};v.localStorage={is_supported:function(n){var e=si(null,n);return e||ee.error("localStorage unsupported; falling back to cookie store"),e},error:function(n){ee.error("localStorage error: "+n)},get:function(n){try{return window.localStorage.getItem(n)}catch(e){v.localStorage.error(e)}return null},parse:function(n){try{return v.JSONDecode(v.localStorage.get(n))||{}}catch{}return null},set:function(n,e){try{window.localStorage.setItem(n,e)}catch(t){v.localStorage.error(t)}},remove:function(n){try{window.localStorage.removeItem(n)}catch(e){v.localStorage.error(e)}}},v.register_event=function(){var n=function(i,s,o,a,l){if(!i){ee.error("No valid element provided to register_event");return}if(i.addEventListener&&!a)i.addEventListener(s,o,!!l);else{var c="on"+s,p=i[c];i[c]=e(i,o,p)}};function e(i,s,o){var a=function(l){if(l=l||t(window.event),!!l){var c=!0,p,m;return v.isFunction(o)&&(p=o(l)),m=s.call(i,l),(p===!1||m===!1)&&(c=!1),c}};return a}function t(i){return i&&(i.preventDefault=t.preventDefault,i.stopPropagation=t.stopPropagation),i}return t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0},n}();var Rl=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');v.dom_query=function(){function n(s){return s.all?s.all:s.getElementsByTagName("*")}var e=/[\t\r\n]/g;function t(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,l,c,p,m,g,b,y,w,f,k=[oe];for(g=0;g<o.length;g++){if(a=o[g].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){l=a.split("#"),c=l[0];var x=l[1],A=oe.getElementById(x);if(!A||c&&A.nodeName.toLowerCase()!=c)return[];k=[A];continue}if(a.indexOf(".")>-1){l=a.split("."),c=l[0];var M=l[1];for(c||(c="*"),p=[],m=0,b=0;b<k.length;b++)for(c=="*"?w=n(k[b]):w=k[b].getElementsByTagName(c),y=0;y<w.length;y++)p[m++]=w[y];for(k=[],f=0,b=0;b<p.length;b++)p[b].className&&v.isString(p[b].className)&&t(p[b],M)&&(k[f++]=p[b]);continue}var E=a.match(Rl);if(E){c=E[1];var D=E[2],F=E[3],Z=E[4];for(c||(c="*"),p=[],m=0,b=0;b<k.length;b++)for(c=="*"?w=n(k[b]):w=k[b].getElementsByTagName(c),y=0;y<w.length;y++)p[m++]=w[y];k=[],f=0;var G;switch(F){case"=":G=function(Q){return Q.getAttribute(D)==Z};break;case"~":G=function(Q){return Q.getAttribute(D).match(new RegExp("\\b"+Z+"\\b"))};break;case"|":G=function(Q){return Q.getAttribute(D).match(new RegExp("^"+Z+"-?"))};break;case"^":G=function(Q){return Q.getAttribute(D).indexOf(Z)===0};break;case"$":G=function(Q){return Q.getAttribute(D).lastIndexOf(Z)==Q.getAttribute(D).length-Z.length};break;case"*":G=function(Q){return Q.getAttribute(D).indexOf(Z)>-1};break;default:G=function(Q){return Q.getAttribute(D)}}for(k=[],f=0,b=0;b<p.length;b++)G(p[b])&&(k[f++]=p[b]);continue}for(c=a,p=[],m=0,b=0;b<k.length;b++)for(w=k[b].getElementsByTagName(c),y=0;y<w.length;y++)p[m++]=w[y];k=p}return k}return function(s){return v.isElement(s)?[s]:v.isObject(s)&&!v.isUndefined(s.length)?s:i.call(this,s)}}();var Hl=["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(n){var e="",t={};return v.each(Hl,function(i){e=v.getQueryParam(oe.URL,i),e.length?t[i]=e:n!==void 0&&(t[i]=n)}),t},clickParams:function(){var n="",e={};return v.each(Nl,function(t){n=v.getQueryParam(oe.URL,t),n.length&&(e[t]=n)}),e},marketingParams:function(){return v.extend(v.info.campaignParams(),v.info.clickParams())},searchEngine:function(n){return n.search("https?://(.*)google.([^/?]*)")===0?"google":n.search("https?://(.*)bing.com")===0?"bing":n.search("https?://(.*)yahoo.com")===0?"yahoo":n.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(n){var e=v.info.searchEngine(n),t=e!="yahoo"?"q":"p",i={};if(e!==null){i.$search_engine=e;var s=v.getQueryParam(n,t);s.length&&(i.mp_keyword=s)}return i},browser:function(n,e,t){return e=e||"",t||v.includes(n," OPR/")?v.includes(n,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":v.includes(n,"IEMobile")||v.includes(n,"WPDesktop")?"Internet Explorer Mobile":v.includes(n,"SamsungBrowser/")?"Samsung Internet":v.includes(n,"Edge")||v.includes(n,"Edg/")?"Microsoft Edge":v.includes(n,"FBIOS")?"Facebook Mobile":v.includes(n,"Chrome")?"Chrome":v.includes(n,"CriOS")?"Chrome iOS":v.includes(n,"UCWEB")||v.includes(n,"UCBrowser")?"UC Browser":v.includes(n,"FxiOS")?"Firefox iOS":v.includes(e,"Apple")?v.includes(n,"Mobile")?"Mobile Safari":"Safari":v.includes(n,"Android")?"Android Mobile":v.includes(n,"Konqueror")?"Konqueror":v.includes(n,"Firefox")?"Firefox":v.includes(n,"MSIE")||v.includes(n,"Trident/")?"Internet Explorer":v.includes(n,"Gecko")?"Mozilla":""},browserVersion:function(n,e,t){var i=v.info.browser(n,e,t),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=n.match(o);return a?parseFloat(a[a.length-2]):null},os:function(){var n=cn;return/Windows/i.test(n)?/Phone/.test(n)||/WPDesktop/.test(n)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(n)?"iOS":/Android/.test(n)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Mac/i.test(n)?"Mac OS X":/Linux/.test(n)?"Linux":/CrOS/.test(n)?"Chrome OS":""},device:function(n){return/Windows Phone/i.test(n)||/WPDesktop/.test(n)?"Windows Phone":/iPad/.test(n)?"iPad":/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Android/.test(n)?"Android":""},referringDomain:function(n){var e=n.split("/");return e.length>=3?e[2]:""},currentUrl:function(){return O.location.href},properties:function(n){return typeof n!="object"&&(n={}),v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(cn,Pn.vendor,ni),$referrer:oe.referrer,$referring_domain:v.info.referringDomain(oe.referrer),$device:v.info.device(cn)}),{$current_url:v.info.currentUrl(),$browser_version:v.info.browserVersion(cn,Pn.vendor,ni),$screen_height:ti.height,$screen_width:ti.width,mp_lib:"web",$lib_version:bn.LIB_VERSION,$insert_id:Xi(),time:v.timestamp()/1e3},v.strip_empty_properties(n))},people_properties:function(){return v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(cn,Pn.vendor,ni)}),{$browser_version:v.info.browserVersion(cn,Pn.vendor,ni)})},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(n){var e=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return n?e.substring(0,n):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(n){var e=Ul,t=n.split("."),i=t[t.length-1];(i.length>4||i==="com"||i==="org")&&(e=Ol);var s=n.match(e);return s?s[0]:""},Vl=function(){var n=O.navigator.onLine;return v.isUndefined(n)||n},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(n,e){jo(!0,n,e)}function Gl(n,e){jo(!1,n,e)}function jl(n,e){return Go(n,e)==="1"}function Ko(n,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 t=Go(n,e)==="0";return t&&ee.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),t}function In(n){return ns(n,function(e){return this.get_config(e)})}function Dn(n){return ns(n,function(e){return this._get_config(e)})}function ht(n){return ns(n,function(e){return this._get_config(e)})}function zl(n,e){e=e||{},$i(e).remove(es(n,e),!!e.crossSubdomainCookie,e.cookieDomain)}function $i(n){return n=n||{},n.persistenceType==="localStorage"?v.localStorage:v.cookie}function es(n,e){return e=e||{},(e.persistencePrefix||Fl)+n}function Go(n,e){return $i(e).get(es(n,e))}function ql(n){if(n&&n.ignoreDnt)return!1;var e=n&&n.window||O,t=e.navigator||{},i=!1;return v.each([t.doNotTrack,t.msDoNotTrack,e.doNotTrack],function(s){v.includes([!0,1,"1","yes"],s)&&(i=!0)}),i}function jo(n,e,t){if(!v.isString(e)||!e.length){ee.error("gdpr."+(n?"optIn":"optOut")+" called with an invalid token");return}t=t||{},$i(t).set(es(e,t),n?1:0,v.isNumber(t.cookieExpiration)?t.cookieExpiration:null,!!t.crossSubdomainCookie,!!t.secureCookie,!!t.crossSiteCookie,t.cookieDomain),t.track&&n&&t.track(t.trackEventName||"$opt_in",t.trackProperties,{send_immediately:!0})}function ns(n,e){return function(){var t=!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"),l=e.call(this,"window");i&&(t=Ko(i,{ignoreDnt:s,persistenceType:o,persistencePrefix:a,window:l}))}catch(p){ee.error("Unexpected error when checking tracking opt-out status: "+p)}if(!t)return n.apply(this,arguments);var c=arguments[arguments.length-1];typeof c=="function"&&c(0)}}var Wl=ii("lock"),zo=function(n,e){e=e||{},this.storageKey=n,this.storage=e.storage||window.localStorage,this.pollIntervalMS=e.pollIntervalMS||100,this.timeoutMS=e.timeoutMS||2e3};zo.prototype.withLock=function(n,e,t){!t&&typeof e!="function"&&(t=e,e=null);var i=t||new Date().getTime()+"|"+Math.random(),s=new Date().getTime(),o=this.storageKey,a=this.pollIntervalMS,l=this.timeoutMS,c=this.storage,p=o+":X",m=o+":Y",g=o+":Z",b=function(A){e&&e(A)},y=function(A){if(new Date().getTime()-s>l){Wl.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+i+"]"),c.removeItem(g),c.removeItem(m),k();return}setTimeout(function(){try{A()}catch(M){b(M)}},a*(Math.random()+.1))},w=function(A,M){A()?M():y(function(){w(A,M)})},f=function(){var A=c.getItem(m);if(A&&A!==i)return!1;if(c.setItem(m,i),c.getItem(m)===i)return!0;if(!si(c,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},k=function(){c.setItem(p,i),w(f,function(){if(c.getItem(p)===i){x();return}y(function(){if(c.getItem(m)!==i){k();return}w(function(){return!c.getItem(g)},x)})})},x=function(){c.setItem(g,"1");try{n()}finally{c.removeItem(g),c.getItem(m)===i&&c.removeItem(m),c.getItem(p)===i&&c.removeItem(p)}};try{if(si(c,!0))k();else throw new Error("localStorage support check failed")}catch(A){b(A)}};var qo=ii("batch"),Bn=function(n,e){e=e||{},this.storageKey=n,this.storage=e.storage||window.localStorage,this.reportError=e.errorReporter||v.bind(qo.error,qo),this.lock=new zo(n,{storage:this.storage}),this.usePersistence=e.usePersistence,this.pid=e.pid||null,this.memQueue=[]};Bn.prototype.enqueue=function(n,e,t){var i={id:Xi(),flushAfter:new Date().getTime()+e*2,payload:n};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",n),o=!1}t&&t(o)},this),v.bind(function(o){this.reportError("Error acquiring storage lock",o),t&&t(!1)},this),this.pid):(this.memQueue.push(i),t&&t(!0))},Bn.prototype.fillBatch=function(n){var e=this.memQueue.slice(0,n);if(this.usePersistence&&e.length<n){var t=this.readFromStorage();if(t.length){var i={};v.each(e,function(a){i[a.id]=!0});for(var s=0;s<t.length;s++){var o=t[s];if(new Date().getTime()>o.flushAfter&&!i[o.id]&&(o.orphaned=!0,e.push(o),e.length>=n))break}}}return e};var Wo=function(n,e){var t=[];return v.each(n,function(i){i.id&&!e[i.id]&&t.push(i)}),t};Bn.prototype.removeItemsByID=function(n,e){var t={};if(v.each(n,function(s){t[s]=!0}),this.memQueue=Wo(this.memQueue,t),!this.usePersistence)e&&e(!0);else{var i=v.bind(function(){var s;try{var o=this.readFromStorage();if(o=Wo(o,t),s=this.saveToStorage(o),s){o=this.readFromStorage();for(var a=0;a<o.length;a++){var l=o[a];if(l.id&&t[l.id])return this.reportError("Item not removed from storage"),!1}}}catch{this.reportError("Error removing items",n),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(l){this.reportError("Error clearing queue",l)}e&&e(a)},this),this.pid)}};var Zo=function(n,e){var t=[];return v.each(n,function(i){var s=i.id;if(s in e){var o=e[s];o!==null&&(i.payload=o,t.push(i))}else t.push(i)}),t};Bn.prototype.updatePayloads=function(n,e){this.memQueue=Zo(this.memQueue,n),this.usePersistence?this.lock.withLock(v.bind(function(){var i;try{var s=this.readFromStorage();s=Zo(s,n),i=this.saveToStorage(s)}catch{this.reportError("Error updating items",n),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)},Bn.prototype.readFromStorage=function(){var n;try{n=this.storage.getItem(this.storageKey),n&&(n=ai(n),v.isArray(n)||(this.reportError("Invalid storage entry:",n),n=null))}catch(e){this.reportError("Error retrieving queue",e),n=null}return n||[]},Bn.prototype.saveToStorage=function(n){try{return this.storage.setItem(this.storageKey,oi(n)),!0}catch(e){return this.reportError("Error saving queue",e),!1}},Bn.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var Zl=10*60*1e3,Pt=ii("batch"),tn=function(n,e){this.errorReporter=e.errorReporter,this.queue=new Bn(n,{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};tn.prototype.enqueue=function(n,e){this.queue.enqueue(n,this.flushInterval,e)},tn.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},tn.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},tn.prototype.clear=function(){this.queue.clear()},tn.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},tn.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},tn.prototype.scheduleFlush=function(n){this.flushInterval=n,this.stopped||(this.timeoutID=setTimeout(v.bind(function(){this.stopped||this.flush()},this),this.flushInterval))},tn.prototype.flush=function(n){try{if(this.requestInProgress){Pt.log("Flush: Request already in progress");return}n=n||{};var e=this.libConfig.batch_request_timeout_ms,t=new Date().getTime(),i=this.batchSize,s=this.queue.fillBatch(i),o=s.length===i,a=[],l={};if(v.each(s,function(m){var g=m.payload;if(this.beforeSendHook&&!m.orphaned&&(g=this.beforeSendHook(g)),g){g.event&&g.properties&&(g.properties=v.extend({},g.properties,{mp_sent_by_lib_version:bn.LIB_VERSION}));var b=!0,y=m.id;y?(this.itemIdsSentSuccessfully[y]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:m,batchSize:s.length,timesSent:this.itemIdsSentSuccessfully[y]}),b=!1):this.reportError("[dupe] found item with no ID",{item:m}),b&&a.push(g)}l[m.id]=g},this),a.length<1){this.resetFlush();return}this.requestInProgress=!0;var c=v.bind(function(m){this.requestInProgress=!1;try{var g=!1;if(n.unloading)this.queue.updatePayloads(l);else if(v.isObject(m)&&m.error==="timeout"&&new Date().getTime()-t>=e)this.reportError("Network timeout; retrying"),this.flush();else if(v.isObject(m)&&(m.httpStatusCode>=500||m.httpStatusCode===429||m.httpStatusCode<=0&&!Vl()||m.error==="timeout")){var b=this.flushInterval*2;m.retryAfter&&(b=parseInt(m.retryAfter,10)*1e3||b),b=Math.min(Zl,b),this.reportError("Error; retry in "+b+" ms"),this.scheduleFlush(b)}else if(v.isObject(m)&&m.httpStatusCode===413)if(s.length>1){var y=Math.max(1,Math.floor(i/2));this.batchSize=Math.min(this.batchSize,y,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(),g=!0;else g=!0;g&&(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),p={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:e};n.unloading&&(p.transport="sendBeacon"),Pt.log("MIXPANEL REQUEST:",a),this.sendRequest(a,p,c)}catch(m){this.reportError("Error flushing request queue",m),this.resetFlush()}},tn.prototype.reportError=function(n,e){if(Pt.error.apply(Pt.error,arguments),this.errorReporter)try{e instanceof Error||(e=new Error(n)),this.errorReporter(n,e)}catch(t){Pt.error(t)}};var jn=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([ln.MouseMove,ln.MouseInteraction,ln.Scroll,ln.ViewportResize,ln.Input,ln.TouchMove,ln.MediaInteraction,ln.Drag,ln.Selection]);function Yl(n){return n.type===Bo.IncrementalSnapshot&&Jl.has(n.data.source)}var sn=function(n){this._mixpanel=n,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=_t,this.recordMinMs=0,this._initBatcher()};sn.prototype._initBatcher=function(){this.batcher=new tn("__mprec",{libConfig:Ql,sendRequestFunc:v.bind(this.flushEventsWithOptOut,this),errorReporter:v.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},sn.prototype.get_config=function(n){return this._mixpanel.get_config(n)},sn.prototype.startRecording=function(n){if(this._stopRecording!==null){jn.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>_t&&(this.recordMaxMs=_t,jn.critical("record_max_ms cannot be greater than "+_t+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>Wi&&(this.recordMinMs=Wi,jn.critical("record_min_ms cannot be greater than "+Wi+"ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=new Date().getTime(),this.replayId=v.UUID(),n||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var e=v.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(v.bind(function(){jn.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),this.get_config("record_idle_timeout_ms"))},this),t=this.get_config("record_block_selector");(t===""||t===null)&&(t=void 0),this._stopRecording=Tt({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:t,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)},sn.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},sn.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)},sn.prototype.flushEventsWithOptOut=function(n,e,t){this._flushEvents(n,e,t,v.bind(this._onOptOut,this))},sn.prototype._onOptOut=function(n){n===0&&(this.recEvents=[],this.stopRecording())},sn.prototype._sendRequest=function(n,e,t,i){var s=v.bind(function(o,a){o.status===200&&this.replayId===n&&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:t}).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})})},sn.prototype._flushEvents=In(function(n,e,t){const i=n.length;if(i>0){var s=this.replayId,o=n[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=n[i-1].timestamp-this.replayStartTime,l={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},c=v.JSONEncode(n),p=this._mixpanel.get_property("$device_id");p&&(l.$device_id=p);var m=this._mixpanel.get_property("$user_id");if(m&&(l.$user_id=m),Qo){var g=new Blob([c],{type:"application/json"}).stream(),b=g.pipeThrough(new Qo("gzip"));new Response(b).blob().then(v.bind(function(y){l.format="gzip",this._sendRequest(s,l,y,t)},this))}else l.format="body",this._sendRequest(s,l,c,t)}}),sn.prototype.reportError=function(n,e){jn.error.apply(jn.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.get_config("error_reporter")(n,e)}catch(t){jn.error(t)}},O.__mp_recorder=sn;var fn=function(){};fn.prototype.create_properties=function(){},fn.prototype.event_handler=function(){},fn.prototype.after_track_handler=function(){},fn.prototype.init=function(n){return this.mp=n,this},fn.prototype.track=function(n,e,t,i){var s=this,o=v.dom_query(n);if(o.length===0){ee.error("The DOM query ("+n+") returned 0 elements");return}return v.each(o,function(a){v.register_event(a,this.override_event,function(l){var c={},p=s.create_properties(t,this),m=s.mp.get_config("track_links_timeout");s.event_handler(l,this,c),window.setTimeout(s.track_callback(i,p,c,!0),m),s.mp.track(e,p,s.track_callback(i,p,c))})},this),!0},fn.prototype.track_callback=function(n,e,t,i){i=i||!1;var s=this;return function(){t.callback_fired||(t.callback_fired=!0,!(n&&n(i,e)===!1)&&s.after_track_handler(e,t,i))}},fn.prototype.create_properties=function(n,e){var t;return typeof n=="function"?t=n(e):t=v.extend({},n),t};var mt=function(){this.override_event="click"};v.inherit(mt,fn),mt.prototype.create_properties=function(n,e){var t=mt.superclass.create_properties.apply(this,arguments);return e.href&&(t.url=e.href),t},mt.prototype.event_handler=function(n,e,t){t.new_tab=n.which===2||n.metaKey||n.ctrlKey||e.target==="_blank",t.href=e.href,t.new_tab||n.preventDefault()},mt.prototype.after_track_handler=function(n,e){e.new_tab||setTimeout(function(){window.location=e.href},0)};var ri=function(){this.override_event="submit"};v.inherit(ri,fn),ri.prototype.event_handler=function(n,e,t){t.element=e,n.preventDefault()},ri.prototype.after_track_handler=function(n,e){setTimeout(function(){e.element.submit()},0)};var Rn="$set",pt="$set_once",on="$unset",zn="$add",dn="$append",qn="$union",gn="$remove",Xl="$delete",Jo={set_action:function(n,e){var t={},i={};return v.isObject(n)?v.each(n,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[n]=e,t[Rn]=i,t},unset_action:function(n){var e={},t=[];return v.isArray(n)||(n=[n]),v.each(n,function(i){this._is_reserved_property(i)||t.push(i)},this),e[on]=t,e},set_once_action:function(n,e){var t={},i={};return v.isObject(n)?v.each(n,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[n]=e,t[pt]=i,t},union_action:function(n,e){var t={},i={};return v.isObject(n)?v.each(n,function(s,o){this._is_reserved_property(o)||(i[o]=v.isArray(s)?s:[s])},this):i[n]=v.isArray(e)?e:[e],t[qn]=i,t},append_action:function(n,e){var t={},i={};return v.isObject(n)?v.each(n,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[n]=e,t[dn]=i,t},remove_action:function(n,e){var t={},i={};return v.isObject(n)?v.each(n,function(s,o){this._is_reserved_property(o)||(i[o]=s)},this):i[n]=e,t[gn]=i,t},delete_action:function(){var n={};return n[Xl]="",n}},le=function(){};v.extend(le.prototype,Jo),le.prototype._init=function(n,e,t){this._mixpanel=n,this._group_key=e,this._group_id=t},le.prototype.set=ht(function(n,e,t){var i=this.set_action(n,e);return v.isObject(n)&&(t=e),this._send_request(i,t)}),le.prototype.set_once=ht(function(n,e,t){var i=this.set_once_action(n,e);return v.isObject(n)&&(t=e),this._send_request(i,t)}),le.prototype.unset=ht(function(n,e){var t=this.unset_action(n);return this._send_request(t,e)}),le.prototype.union=ht(function(n,e,t){v.isObject(n)&&(t=e);var i=this.union_action(n,e);return this._send_request(i,t)}),le.prototype.delete=ht(function(n){var e=this.delete_action();return this._send_request(e,n)}),le.prototype.remove=ht(function(n,e,t){var i=this.remove_action(n,e);return this._send_request(i,t)}),le.prototype._send_request=function(n,e){n.$group_key=this._group_key,n.$group_id=this._group_id,n.$token=this._get_config("token");var t=v.encodeDates(n);return this._mixpanel._track_or_batch({type:"groups",data:t,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(n){return n==="$group_key"||n==="$group_id"},le.prototype._get_config=function(n){return this._mixpanel.get_config(n)},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(n){this._mixpanel=n},U.prototype.set=Dn(function(n,e,t){var i=this.set_action(n,e);return v.isObject(n)&&(t=e),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),i[Rn]=v.extend({},v.info.people_properties(),i[Rn]),this._send_request(i,t)}),U.prototype.set_once=Dn(function(n,e,t){var i=this.set_once_action(n,e);return v.isObject(n)&&(t=e),this._send_request(i,t)}),U.prototype.unset=Dn(function(n,e){var t=this.unset_action(n);return this._send_request(t,e)}),U.prototype.increment=Dn(function(n,e,t){var i={},s={};return v.isObject(n)?(v.each(n,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),t=e):(v.isUndefined(e)&&(e=1),s[n]=e),i[zn]=s,this._send_request(i,t)}),U.prototype.append=Dn(function(n,e,t){v.isObject(n)&&(t=e);var i=this.append_action(n,e);return this._send_request(i,t)}),U.prototype.remove=Dn(function(n,e,t){v.isObject(n)&&(t=e);var i=this.remove_action(n,e);return this._send_request(i,t)}),U.prototype.union=Dn(function(n,e,t){v.isObject(n)&&(t=e);var i=this.union_action(n,e);return this._send_request(i,t)}),U.prototype.track_charge=Dn(function(n,e,t){if(!v.isNumber(n)&&(n=parseFloat(n),isNaN(n))){ee.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",v.extend({$amount:n},e),t)}),U.prototype.clear_charges=function(n){return this.set("$transactions",[],n)},U.prototype.delete_user=function(){if(!this._identify_called()){ee.error("mixpanel.people.delete_user() requires you to call identify() first");return}var n={$delete:this._mixpanel.get_distinct_id()};return this._send_request(n)},U.prototype.toString=function(){return this._mixpanel.toString()+".people"},U.prototype._send_request=function(n,e){n.$token=this._get_config("token"),n.$distinct_id=this._mixpanel.get_distinct_id();var t=this._mixpanel.get_property("$device_id"),i=this._mixpanel.get_property("$user_id"),s=this._mixpanel.get_property("$had_persisted_distinct_id");t&&(n.$device_id=t),i&&(n.$user_id=i),s&&(n.$had_persisted_distinct_id=s);var o=v.encodeDates(n);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(n),v.isUndefined(e)||(this._get_config("verbose")?e({status:-1,error:null}):e(-1)),v.truncate(o,255))},U.prototype._get_config=function(n){return this._mixpanel.get_config(n)},U.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},U.prototype._enqueue=function(n){Rn in n?this._mixpanel.persistence._add_to_people_queue(Rn,n):pt in n?this._mixpanel.persistence._add_to_people_queue(pt,n):on in n?this._mixpanel.persistence._add_to_people_queue(on,n):zn in n?this._mixpanel.persistence._add_to_people_queue(zn,n):dn in n?this._mixpanel.persistence._add_to_people_queue(dn,n):gn in n?this._mixpanel.persistence._add_to_people_queue(gn,n):qn in n?this._mixpanel.persistence._add_to_people_queue(qn,n):ee.error("Invalid call to _enqueue():",n)},U.prototype._flush_one_queue=function(n,e,t,i){var s=this,o=v.extend({},this._mixpanel.persistence.load_queue(n)),a=o;!v.isUndefined(o)&&v.isObject(o)&&!v.isEmptyObject(o)&&(s._mixpanel.persistence._pop_from_people_queue(n,o),s._mixpanel.persistence.save(),i&&(a=i(o)),e.call(s,a,function(l,c){l===0&&s._mixpanel.persistence._add_to_people_queue(n,o),v.isUndefined(t)||t(l,c)}))},U.prototype._flush=function(n,e,t,i,s,o,a){var l=this;this._flush_one_queue(Rn,this.set,n),this._flush_one_queue(pt,this.set_once,i),this._flush_one_queue(on,this.unset,o,function(k){return v.keys(k)}),this._flush_one_queue(zn,this.increment,e),this._flush_one_queue(qn,this.union,s);var c=this._mixpanel.persistence.load_queue(dn);if(!v.isUndefined(c)&&v.isArray(c)&&c.length)for(var p,m=function(k,x){k===0&&l._mixpanel.persistence._add_to_people_queue(dn,p),v.isUndefined(t)||t(k,x)},g=c.length-1;g>=0;g--)c=this._mixpanel.persistence.load_queue(dn),p=c.pop(),l._mixpanel.persistence.save(),v.isEmptyObject(p)||l.append(p,m);var b=this._mixpanel.persistence.load_queue(gn);if(!v.isUndefined(b)&&v.isArray(b)&&b.length)for(var y,w=function(k,x){k===0&&l._mixpanel.persistence._add_to_people_queue(gn,y),v.isUndefined(a)||a(k,x)},f=b.length-1;f>=0;f--)b=this._mixpanel.persistence.load_queue(gn),y=b.pop(),l._mixpanel.persistence.save(),v.isEmptyObject(y)||l.remove(y,w)},U.prototype._is_reserved_property=function(n){return n==="$distinct_id"||n==="$token"||n==="$device_id"||n==="$user_id"||n==="$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 ts="__mps",is="__mpso",ss="__mpus",os="__mpa",as="__mpap",rs="__mpr",ls="__mpu",Yo="$people_distinct_id",li="__alias",It="__timers",$l=[ts,is,ss,os,as,rs,ls,Yo,li,It],W=function(n){this.props={},this.campaign_params_saved=!1,n.persistence_name?this.name="mp_"+n.persistence_name:this.name="mp_"+n.token+"_mixpanel";var e=n.persistence;e!=="cookie"&&e!=="localStorage"&&(ee.critical("Unknown persistence type "+e+"; falling back to cookie"),e=n.persistence="cookie"),e==="localStorage"&&v.localStorage.is_supported()?this.storage=v.localStorage:this.storage=v.cookie,this.load(),this.update_config(n),this.upgrade(),this.save()};W.prototype.properties=function(){var n={};return this.load(),v.each(this.props,function(e,t){v.include($l,t)||(n[t]=e)}),n},W.prototype.load=function(){if(!this.disabled){var n=this.storage.parse(this.name);n&&(this.props=v.extend({},n))}},W.prototype.upgrade=function(){var n,e;this.storage===v.localStorage?(n=v.cookie.parse(this.name),v.cookie.remove(this.name),v.cookie.remove(this.name,!0),n&&this.register_once(n)):this.storage===v.cookie&&(e=v.localStorage.parse(this.name),v.localStorage.remove(this.name),e&&this.register_once(e))},W.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)},W.prototype.load_prop=function(n){return this.load(),this.props[n]},W.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},W.prototype.clear=function(){this.remove(),this.props={}},W.prototype.register_once=function(n,e,t){return v.isObject(n)?(typeof e>"u"&&(e="None"),this.expire_days=typeof t>"u"?this.default_expiry:t,this.load(),v.each(n,function(i,s){(!this.props.hasOwnProperty(s)||this.props[s]===e)&&(this.props[s]=i)},this),this.save(),!0):!1},W.prototype.register=function(n,e){return v.isObject(n)?(this.expire_days=typeof e>"u"?this.default_expiry:e,this.load(),v.extend(this.props,n),this.save(),!0):!1},W.prototype.unregister=function(n){this.load(),n in this.props&&(delete this.props[n],this.save())},W.prototype.update_search_keyword=function(n){this.register(v.info.searchInfo(n))},W.prototype.update_referrer_info=function(n){this.register_once({$initial_referrer:n||"$direct",$initial_referring_domain:v.info.referringDomain(n)||"$direct"},"")},W.prototype.get_referrer_info=function(){return v.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},W.prototype.update_config=function(n){this.default_expiry=this.expire_days=n.cookie_expiration,this.set_disabled(n.disable_persistence),this.set_cookie_domain(n.cookie_domain),this.set_cross_site(n.cross_site_cookie),this.set_cross_subdomain(n.cross_subdomain_cookie),this.set_secure(n.secure_cookie)},W.prototype.set_disabled=function(n){this.disabled=n,this.disabled?this.remove():this.save()},W.prototype.set_cookie_domain=function(n){n!==this.cookie_domain&&(this.remove(),this.cookie_domain=n,this.save())},W.prototype.set_cross_site=function(n){n!==this.cross_site&&(this.cross_site=n,this.remove(),this.save())},W.prototype.set_cross_subdomain=function(n){n!==this.cross_subdomain&&(this.cross_subdomain=n,this.remove(),this.save())},W.prototype.get_cross_subdomain=function(){return this.cross_subdomain},W.prototype.set_secure=function(n){n!==this.secure&&(this.secure=!!n,this.remove(),this.save())},W.prototype._add_to_people_queue=function(n,e){var t=this._get_queue_key(n),i=e[n],s=this._get_or_create_queue(Rn),o=this._get_or_create_queue(pt),a=this._get_or_create_queue(on),l=this._get_or_create_queue(zn),c=this._get_or_create_queue(qn),p=this._get_or_create_queue(gn,[]),m=this._get_or_create_queue(dn,[]);t===ts?(v.extend(s,i),this._pop_from_people_queue(zn,i),this._pop_from_people_queue(qn,i),this._pop_from_people_queue(on,i)):t===is?(v.each(i,function(g,b){b in o||(o[b]=g)}),this._pop_from_people_queue(on,i)):t===ss?v.each(i,function(g){v.each([s,o,l,c],function(b){g in b&&delete b[g]}),v.each(m,function(b){g in b&&delete b[g]}),a[g]=!0}):t===os?(v.each(i,function(g,b){b in s?s[b]+=g:(b in l||(l[b]=0),l[b]+=g)},this),this._pop_from_people_queue(on,i)):t===ls?(v.each(i,function(g,b){v.isArray(g)&&(b in c||(c[b]=[]),c[b]=c[b].concat(g))}),this._pop_from_people_queue(on,i)):t===rs?(p.push(i),this._pop_from_people_queue(dn,i)):t===as&&(m.push(i),this._pop_from_people_queue(on,i)),ee.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),ee.log(e),this.save()},W.prototype._pop_from_people_queue=function(n,e){var t=this.props[this._get_queue_key(n)];v.isUndefined(t)||v.each(e,function(i,s){n===dn||n===gn?v.each(t,function(o){o[s]===i&&delete o[s]}):delete t[s]},this)},W.prototype.load_queue=function(n){return this.load_prop(this._get_queue_key(n))},W.prototype._get_queue_key=function(n){if(n===Rn)return ts;if(n===pt)return is;if(n===on)return ss;if(n===zn)return os;if(n===dn)return as;if(n===gn)return rs;if(n===qn)return ls;ee.error("Invalid queue:",n)},W.prototype._get_or_create_queue=function(n,e){var t=this._get_queue_key(n);return e=v.isUndefined(e)?{}:e,this.props[t]||(this.props[t]=e)},W.prototype.set_event_timer=function(n,e){var t=this.load_prop(It)||{};t[n]=e,this.props[It]=t,this.save()},W.prototype.remove_event_timer=function(n){var e=this.load_prop(It)||{},t=e[n];return v.isUndefined(t)||(delete this.props[It][n],this.save()),t};var cs,Xo=function(n,e){throw new Error(n+" not available in this build.")},Ie,$o=0,ec=1,nc=function(n){return n},Dt=function(){},Ze="mixpanel",ea="base64",tc="json",ds="$device:",vt=O.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,na=!vt&&cn.indexOf("MSIE")===-1&&cn.indexOf("Mozilla")===-1,ci=null;Pn.sendBeacon&&(ci=function(){return Pn.sendBeacon.apply(Pn,arguments)});var ta={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},ia={api_host:"https://api-js.mixpanel.com",api_routes:ta,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:Dt,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Dt,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:_t,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(n,e,t){var i,s=t===Ze?Ie:Ie[t];if(s&&cs===$o)i=s;else{if(s&&!v.isArray(s)){ee.error("You have already initialized "+t);return}i=new L}if(i._cached_groups={},i._init(n,e,t),i.people=new U,i.people._init(i),!i.get_config("skip_first_touch_marketing")){var o=v.info.campaignParams(null),a={},l=!1;v.each(o,function(c,p){a["initial_"+p]=c,c&&(l=!0)}),l&&i.people.set_once(a)}return bn.DEBUG=bn.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(n,e,t){if(v.isUndefined(t)){this.report_error("You must name your new library: init(token, config, name)");return}if(t===Ze){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var i=us(n,e,t);return Ie[t]=i,i._loaded(),i},L.prototype._init=function(n,e,t){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=tc)}if(this.set_config(v.extend({},ia,i,e,{name:t,token:n,callback_fn:(t===Ze?t:Ze+"."+t)+"._jsc"})),this._jsc=Dt,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)||!vt)this._batch_requests=!1,ee.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),v.each(this.get_batcher_configs(),function(c){ee.log("Clearing batch queue "+c.queue_key),v.localStorage.remove(c.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(c){c.persisted&&o()}),O.addEventListener("visibilitychange",function(){oe.visibilityState==="hidden"&&o()})}}this.persistence=this.cookie=new W(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 l=this.get_config("track_pageview");l&&this._init_url_change_tracking(l),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=In(function(){if(!O.MutationObserver){ee.critical("Browser does not support MutationObserver; skipping session recording");return}var n=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"),n):n()}),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 n={};if(this._recorder){var e=this._recorder.replayId;e&&(n.$mp_replay_id=e)}return n},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 n=v.info.campaignParams(null);v.each(n,(function(e,t){this.unregister(t)}).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(n){this._track_dom.apply(this,n)},this),this.has_opted_out_tracking()||v.each(this.__request_queue,function(n){this._send_request.apply(this,n)},this),delete this.__dom_loaded_queue,delete this.__request_queue},L.prototype._track_dom=function(n,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([n,e]),!1;var t=new n().init(this);return t.track.apply(t,e)},L.prototype._init_url_change_tracking=function(n){var e="",t=this.track_pageview();if(t&&(e=v.info.currentUrl()),v.include(["full-url","url-with-path-and-query-string","url-with-path"],n)){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,l){i.call(O.history,o,a,l),O.dispatchEvent(new Event("mp_locationchange"))});var s=O.history.replaceState;typeof s=="function"&&(O.history.replaceState=function(o,a,l){s.call(O.history,o,a,l),O.dispatchEvent(new Event("mp_locationchange"))}),O.addEventListener("mp_locationchange",(function(){var o=v.info.currentUrl(),a=!1;if(n==="full-url"?a=o!==e:n==="url-with-path-and-query-string"?a=o.split("#")[0]!==e.split("#")[0]:n==="url-with-path"&&(a=o.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0]),a){var l=this.track_pageview();l&&(e=o)}}).bind(this))}},L.prototype._prepare_callback=function(n,e){if(v.isUndefined(n))return null;if(vt){var t=function(a){n(a,e)};return t}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],n(a,e)},o}},L.prototype._send_request=function(n,e,t,i){var s=!0;if(na)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(t)||typeof t=="string")&&(i=t,t=null),t=v.extend(o,t||{}),vt||(t.method="GET");var l=t.method==="POST",c=ci&&l&&t.transport.toLowerCase()==="sendbeacon",p=t.verbose;e.verbose&&(p=!0),this.get_config("test")&&(e.test=1),p&&(e.verbose=1),this.get_config("img")&&(e.img=1),vt||(i?e.callback=i:(p||this.get_config("test"))&&(e.callback="(function(){})")),e.ip=this.get_config("ip")?1:0,e._=new Date().getTime().toString(),l&&(a="data="+encodeURIComponent(e.data),delete e.data),n+="?"+v.HTTPBuildQuery(e);var m=this;if("img"in e){var g=oe.createElement("img");g.src=n,oe.body.appendChild(g)}else if(c){try{s=ci(n,a)}catch(x){m.report_error(x),s=!1}try{i&&i(s?1:0)}catch(x){m.report_error(x)}}else if(vt)try{var b=new XMLHttpRequest;b.open(t.method,n,!0);var y=this.get_config("xhr_headers");if(l&&(y["Content-Type"]="application/x-www-form-urlencoded"),v.each(y,function(x,A){b.setRequestHeader(A,x)}),t.timeout_ms&&typeof b.timeout<"u"){b.timeout=t.timeout_ms;var w=new Date().getTime()}b.withCredentials=!0,b.onreadystatechange=function(){if(b.readyState===4)if(b.status===200){if(i)if(p){var x;try{x=v.JSONDecode(b.responseText)}catch(E){if(m.report_error(E),t.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,m.report_error(A),i)if(p){var M=b.responseHeaders||{};i({status:0,httpStatusCode:b.status,error:A,retryAfter:M["Retry-After"]})}else i(0)}},b.send(a)}catch(x){m.report_error(x),s=!1}else{var f=oe.createElement("script");f.type="text/javascript",f.async=!0,f.defer=!0,f.src=n;var k=oe.getElementsByTagName("script")[0];k.parentNode.insertBefore(f,k)}return s},L.prototype._execute_array=function(n){var e,t=[],i=[],s=[];v.each(n,function(a){a&&(e=a[0],v.isArray(e)?s.push(a):typeof a=="function"?a.call(this):v.isArray(a)&&e==="alias"?t.push(a):v.isArray(a)&&e.indexOf("track")!==-1&&typeof this[e]=="function"?s.push(a):i.push(a))},this);var o=function(a,l){v.each(a,function(c){if(v.isArray(c[0])){var p=l;v.each(c,function(m){p=p[m[0]].apply(p,m.slice(1))})}else this[c[0]].apply(this,c.slice(1))},l)};o(t,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 n="__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:n+"_ev"},people:{type:"people",endpoint:"/"+e.engage,queue_key:n+"_pp"},groups:{type:"groups",endpoint:"/"+e.groups,queue_key:n+"_gr"}},this._batcher_configs},L.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var n=v.bind(function(t){return new tn(t.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")+t.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_"+t.type,i)},this),stopAllBatchingFunc:v.bind(this.stop_batch_senders,this),usePersistence:!0})},this),e=this.get_batcher_configs();this.request_batchers={events:n(e.events),people:n(e.people),groups:n(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(n){n.start()}))},L.prototype.stop_batch_senders=function(){this._batch_requests=!1,v.each(this.request_batchers,function(n){n.stop(),n.clear()})},L.prototype.push=function(n){this._execute_array([n])},L.prototype.disable=function(n){typeof n>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(n)},L.prototype._encode_data_for_request=function(n){var e=v.JSONEncode(n);return this.get_config("api_payload_format")===ea&&(e=v.base64Encode(e)),{data:e}},L.prototype._track_or_batch=function(n,e){var t=v.truncate(n.data,255),i=n.endpoint,s=n.batcher,o=n.should_send_immediately,a=n.send_request_options||{};e=e||Dt;var l=!0,c=v.bind(function(){return a.skip_hooks||(t=this._run_hook("before_send_"+n.type,t)),t?(ee.log("MIXPANEL REQUEST:"),ee.log(t),this._send_request(i,this._encode_data_for_request(t),a,this._prepare_callback(e,t))):null},this);return this._batch_requests&&!o?s.enqueue(t,function(p){p?e(1,t):c()}):l=c(),l&&t},L.prototype.track=In(function(n,e,t,i){!i&&typeof t=="function"&&(i=t,t=null),t=t||{};var s=t.transport;s&&(t.transport=s);var o=t.send_immediately;if(typeof i!="function"&&(i=Dt),v.isUndefined(n)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(n)){i(0);return}e=v.extend({},e),e.token=this.get_config("token");var a=this.persistence.remove_event_timer(n);if(!v.isUndefined(a)){var l=new Date().getTime()-a;e.$duration=parseFloat((l/1e3).toFixed(3))}this._set_default_superprops();var c=this.get_config("track_marketing")?v.info.marketingParams():{};e=v.extend({},v.info.properties({mp_loader:this.get_config("mp_loader")}),c,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),e);var p=this.get_config("property_blacklist");v.isArray(p)?v.each(p,function(b){delete e[b]}):this.report_error("Invalid value for property_blacklist config: "+p);var m={event:n,properties:e},g=this._track_or_batch({type:"events",data:m,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:t},i);return g}),L.prototype.set_group=In(function(n,e,t){v.isArray(e)||(e=[e]);var i={};return i[n]=e,this.register(i),this.people.set(n,e,t)}),L.prototype.add_group=In(function(n,e,t){var i=this.get_property(n),s={};return i===void 0?(s[n]=[e],this.register(s)):i.indexOf(e)===-1&&(i.push(e),s[n]=i,this.register(s)),this.people.union(n,e,t)}),L.prototype.remove_group=In(function(n,e,t){var i=this.get_property(n);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(n)}return this.people.remove(n,e,t)}),L.prototype.track_with_groups=In(function(n,e,t,i){var s=v.extend({},e||{});return v.each(t,function(o,a){o!=null&&(s[a]=o)}),this.track(n,s,i)}),L.prototype._create_map_key=function(n,e){return n+"_"+JSON.stringify(e)},L.prototype._remove_group_from_cache=function(n,e){delete this._cached_groups[this._create_map_key(n,e)]},L.prototype.get_group=function(n,e){var t=this._create_map_key(n,e),i=this._cached_groups[t];return(i===void 0||i._group_key!==n||i._group_id!==e)&&(i=new le,i._init(this,n,e),this._cached_groups[t]=i),i},L.prototype.track_pageview=In(function(n,e){typeof n!="object"&&(n={}),e=e||{};var t=e.event_name||"$mp_web_page_view",i=v.extend(v.info.mpPageViewProperties(),v.info.campaignParams(),v.info.clickParams()),s=v.extend({},i,n);return this.track(t,s)}),L.prototype.track_links=function(){return this._track_dom.call(this,mt,arguments)},L.prototype.track_forms=function(){return this._track_dom.call(this,ri,arguments)},L.prototype.time_event=function(n){if(v.isUndefined(n)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(n)||this.persistence.set_event_timer(n,new Date().getTime())};var ic={persistent:!0},hs=function(n){var e;return v.isObject(n)?e=n:v.isUndefined(n)?e={}:e={days:n},v.extend({},ic,e)};L.prototype.register=function(n,e){var t=hs(e);t.persistent?this.persistence.register(n,t.days):v.extend(this.unpersisted_superprops,n)},L.prototype.register_once=function(n,e,t){var i=hs(t);i.persistent?this.persistence.register_once(n,e,i.days):(typeof e>"u"&&(e="None"),v.each(n,function(s,o){(!this.unpersisted_superprops.hasOwnProperty(o)||this.unpersisted_superprops[o]===e)&&(this.unpersisted_superprops[o]=s)},this))},L.prototype.unregister=function(n,e){e=hs(e),e.persistent?this.persistence.unregister(n):delete this.unpersisted_superprops[n]},L.prototype._register_single=function(n,e){var t={};t[n]=e,this.register(t)},L.prototype.identify=function(n,e,t,i,s,o,a,l){var c=this.get_distinct_id();if(n&&c!==n){if(typeof n=="string"&&n.indexOf(ds)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:n})}if(!this.get_property("$device_id")){var p=c;this.register_once({$had_persisted_distinct_id:!0,$device_id:p},"")}n!==c&&n!==this.get_property(li)&&(this.unregister(li),this.register({distinct_id:n})),this._flags.identify_called=!0,this.people._flush(e,t,i,s,o,a,l),n!==c&&this.track("$identify",{distinct_id:n,$anon_distinct_id:c},{skip_hooks:!0})},L.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var n=v.UUID();this.register_once({distinct_id:ds+n,$device_id:n},"")},L.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},L.prototype.alias=function(n,e){if(n===this.get_property(Yo))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var t=this;return v.isUndefined(e)&&(e=this.get_distinct_id()),n!==e?(this._register_single(li,n),this.track("$create_alias",{alias:n,distinct_id:e},{skip_hooks:!0},function(){t.identify(n)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(n),-1)},L.prototype.name_tag=function(n){this._register_single("mp_name_tag",n)},L.prototype.set_config=function(n){if(v.isObject(n)){v.extend(this.config,n);var e=n.batch_size;e&&v.each(this.request_batchers,function(t){t.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),bn.DEBUG=bn.DEBUG||this.get_config("debug")}},L.prototype.get_config=function(n){return this.config[n]},L.prototype._run_hook=function(n){var e=(this.config.hooks[n]||nc).apply(this,En.call(arguments,1));return typeof e>"u"&&(this.report_error(n+" hook did not return a value"),e=null),e},L.prototype.get_property=function(n){return this.persistence.load_prop([n])},L.prototype.toString=function(){var n=this.get_config("name");return n!==Ze&&(n=Ze+"."+n),n},L.prototype._event_is_disabled=function(n){return v.isBlockedUA(cn)||this._flags.disable_all_events||v.include(this.__disabled_events,n)},L.prototype._gdpr_init=function(){var n=this.get_config("opt_out_tracking_persistence_type")==="localStorage";n&&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(n){var e;if(n&&n.clear_persistence)e=!0;else if(n&&n.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(n,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"),n(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(n){n=v.extend({enable_persistence:!0},n),this._gdpr_call_func(Kl,n),this._gdpr_update_persistence(n)},L.prototype.opt_out_tracking=function(n){n=v.extend({clear_persistence:!0,delete_user:!0},n),n.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(Gl,n),this._gdpr_update_persistence(n)},L.prototype.has_opted_in_tracking=function(n){return this._gdpr_call_func(jl,n)},L.prototype.has_opted_out_tracking=function(n){return this._gdpr_call_func(Ko,n)},L.prototype.clear_opt_in_out_tracking=function(n){n=v.extend({enable_persistence:!0},n),this._gdpr_call_func(zl,n),this._gdpr_update_persistence(n)},L.prototype.report_error=function(n,e){ee.error.apply(ee.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.get_config("error_reporter")(n,e)}catch(t){ee.error(t)}},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=ta,W.prototype.properties=W.prototype.properties,W.prototype.update_search_keyword=W.prototype.update_search_keyword,W.prototype.update_referrer_info=W.prototype.update_referrer_info,W.prototype.get_cross_subdomain=W.prototype.get_cross_subdomain,W.prototype.clear=W.prototype.clear;var bt={},sc=function(){v.each(bt,function(n,e){e!==Ze&&(Ie[e]=n)}),Ie._=v},oc=function(){Ie.init=function(n,e,t){if(t)return Ie[t]||(Ie[t]=bt[t]=us(n,e,t),Ie[t]._loaded()),Ie[t];var i=Ie;bt[Ze]?i=bt[Ze]:n&&(i=us(n,e,Ze),i._loaded(),bt[Ze]=i),Ie=i,cs===ec&&(O[Ze]=Ie),sc()}},ac=function(){function n(){n.done||(n.done=!0,sa=!0,na=!1,v.each(bt,function(i){i._dom_loaded()}))}function e(){try{oe.documentElement.doScroll("left")}catch{setTimeout(e,1);return}n()}if(oe.addEventListener)oe.readyState==="complete"?n():oe.addEventListener("DOMContentLoaded",n,!1);else if(oe.attachEvent){oe.attachEvent("onreadystatechange",n);var t=!1;try{t=O.frameElement===null}catch{}oe.documentElement.doScroll&&t&&e()}v.register_event(O,"load",n,!0)};function rc(n){return Xo=n,cs=$o,Ie=new L,oc(),Ie.init(),ac(),Ie}function lc(n,e){e()}var _=rc(lc);const cc=`<div id="checkoutConfirmationEnd" data-section="transfer">
|
|
1168
1168
|
<div class="w-full">
|
|
1169
1169
|
<div id="otp-content" class=" grid gap-4">
|
|
1170
1170
|
<h5 class="text-black" id="otp-message">
|
|
@@ -1565,7 +1565,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
1565
1565
|
<path
|
|
1566
1566
|
d="M4.66667 3.99992V1.99992C4.66667 1.82311 4.7369 1.65354 4.86193 1.52851C4.98695 1.40349 5.15652 1.33325 5.33333 1.33325H13.3333C13.5101 1.33325 13.6797 1.40349 13.8047 1.52851C13.9298 1.65354 14 1.82311 14 1.99992V11.3333C14 11.5101 13.9298 11.6796 13.8047 11.8047C13.6797 11.9297 13.5101 11.9999 13.3333 11.9999H11.3333V13.9999C11.3333 14.3679 11.0333 14.6666 10.662 14.6666H2.67133C2.58342 14.6671 2.49626 14.6503 2.41488 14.617C2.3335 14.5837 2.25949 14.5347 2.19711 14.4728C2.13472 14.4108 2.0852 14.3372 2.05137 14.256C2.01754 14.1749 2.00009 14.0878 2 13.9999L2.002 4.66659C2.002 4.29859 2.302 3.99992 2.67333 3.99992H4.66667ZM3.33533 5.33325L3.33333 13.3333H10V5.33325H3.33533ZM6 3.99992H11.3333V10.6666H12.6667V2.66659H6V3.99992Z"
|
|
1567
1567
|
fill="#0D0716" />
|
|
1568
|
-
</svg>`},1e3))})})}renderComponent(e){R()!=="en"&&e===1?(this.mainLoader=new ke(this.container),this.mainLoader.mountLoader("15dvh"),this.renderTranslatedText().then(()=>{this.mainLoader.unmountLoader(),this.container.innerHTML=this.render(),this.attachListener()})):(this.container.innerHTML=this.render(),this.attachListener())}async renderTranslatedText(){await Ks(R())}}function pc(n){n.classList.remove("hidden"),requestAnimationFrame(()=>{n.classList.remove("opacity-0","scale-95")})}function di(n){n.classList.add("opacity-0","scale-95"),n.addEventListener("transitionend",()=>n.classList.add("hidden"),{once:!0})}class ra{constructor({container:e,testCardContainer:t,keyEnvironment:i}){d(this,"container");d(this,"testCardContainer");d(this,"testCardInstance",null);d(this,"keyEnvironment",null);d(this,"isVisible",!1);d(this,"mainLoader");d(this,"testCardClicks");this.container=e,this.testCardContainer=t,this.keyEnvironment=i,this.isVisible=!1,this.testCardClicks=0}attachListener(){const e=this.container.querySelector("#test-cards-link"),t=this.container.querySelector("#terms-text"),i=this.container.querySelector("#privacy-text"),s=this.container.querySelector("#contact-text"),o=this.container.querySelector("#powered-by-text");if(t&&(t.innerHTML=q.terms),i&&(i.innerHTML=q.privacy),s&&(s.innerHTML=q.contact),o&&(o.innerHTML=q.powered),!!e){if(e.innerHTML=q["test-card"],this.keyEnvironment!=="test"){e.classList.add("hidden");return}e.addEventListener("click",async()=>{this.testCardClicks=this.testCardClicks+1,this.testCardInstance||(this.testCardInstance=new aa({container:this.testCardContainer,closeCallback:()=>{this.testCardContainer.innerHTML="",di(this.testCardContainer),e.classList.remove("text-tone-100","font-bold"),this.isVisible=!1}})),this.testCardInstance.renderComponent(this.testCardClicks),pc(this.testCardContainer),e.classList.add("text-tone-100","font-bold"),this.isVisible=!0})}}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return hc}}function ft(){return{httpBrowserLanguage:navigator.language||"en-US",httpBrowserJavaEnabled:!1,httpBrowserJavaScriptEnabled:!0,httpBrowserColorDepth:window.screen.colorDepth.toString(),httpBrowserScreenHeight:window.screen.height.toString(),httpBrowserScreenWidth:window.screen.width.toString(),httpBrowserTimeDifference:(-new Date().getTimezoneOffset()).toString(),userAgentBrowserValue:navigator.userAgent,deviceChannel:"Browser"}}function Hn(n,e){return e&&e!==n?e:n}class vc{constructor({amount:e,totalAmount:t,container:i,customer:s,encryption:o,planId:a,token:l,currency:c,rdtCode:p,url:m,reference:g,onSuccess:b,callBackUrl:y,metadata:w,localCurrency:f,hidePaymentMethods:k,showPaymentMethods:x,onClose:A,restartTransactionProcess:M,retryingPayment:E,keys:D,testcardIsVisible:
|
|
1568
|
+
</svg>`},1e3))})})}renderComponent(e){R()!=="en"&&e===1?(this.mainLoader=new ke(this.container),this.mainLoader.mountLoader("15dvh"),this.renderTranslatedText().then(()=>{this.mainLoader.unmountLoader(),this.container.innerHTML=this.render(),this.attachListener()})):(this.container.innerHTML=this.render(),this.attachListener())}async renderTranslatedText(){await Ks(R())}}function pc(n){n.classList.remove("hidden"),requestAnimationFrame(()=>{n.classList.remove("opacity-0","scale-95")})}function di(n){n.classList.add("opacity-0","scale-95"),n.addEventListener("transitionend",()=>n.classList.add("hidden"),{once:!0})}class ra{constructor({container:e,testCardContainer:t,keyEnvironment:i}){d(this,"container");d(this,"testCardContainer");d(this,"testCardInstance",null);d(this,"keyEnvironment",null);d(this,"isVisible",!1);d(this,"mainLoader");d(this,"testCardClicks");this.container=e,this.testCardContainer=t,this.keyEnvironment=i,this.isVisible=!1,this.testCardClicks=0}attachListener(){const e=this.container.querySelector("#test-cards-link"),t=this.container.querySelector("#terms-text"),i=this.container.querySelector("#privacy-text"),s=this.container.querySelector("#contact-text"),o=this.container.querySelector("#powered-by-text");if(t&&(t.innerHTML=q.terms),i&&(i.innerHTML=q.privacy),s&&(s.innerHTML=q.contact),o&&(o.innerHTML=q.powered),!!e){if(e.innerHTML=q["test-card"],this.keyEnvironment!=="test"){e.classList.add("hidden");return}e.addEventListener("click",async()=>{this.testCardClicks=this.testCardClicks+1,this.testCardInstance||(this.testCardInstance=new aa({container:this.testCardContainer,closeCallback:()=>{this.testCardContainer.innerHTML="",di(this.testCardContainer),e.classList.remove("text-tone-100","font-bold"),this.isVisible=!1}})),this.testCardInstance.renderComponent(this.testCardClicks),pc(this.testCardContainer),e.classList.add("text-tone-100","font-bold"),this.isVisible=!0})}}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return hc}}function ft(){return{httpBrowserLanguage:navigator.language||"en-US",httpBrowserJavaEnabled:!1,httpBrowserJavaScriptEnabled:!0,httpBrowserColorDepth:window.screen.colorDepth.toString(),httpBrowserScreenHeight:window.screen.height.toString(),httpBrowserScreenWidth:window.screen.width.toString(),httpBrowserTimeDifference:(-new Date().getTimezoneOffset()).toString(),userAgentBrowserValue:navigator.userAgent,deviceChannel:"Browser"}}function Hn(n,e){return e&&e!==n?e:n}class vc{constructor({amount:e,totalAmount:t,container:i,customer:s,encryption:o,planId:a,token:l,currency:c,rdtCode:p,url:m,reference:g,onSuccess:b,callBackUrl:y,metadata:w,localCurrency:f,hidePaymentMethods:k,showPaymentMethods:x,onClose:A,restartTransactionProcess:M,retryingPayment:E,keys:D,testcardIsVisible:F}){d(this,"contents");d(this,"cardDetailForm");d(this,"cardOtpValidationForm");d(this,"merchantPlanDetail",{});d(this,"cardPinForm");d(this,"avsForm");d(this,"isw3dsForm");d(this,"successScreen");d(this,"pageLoader");d(this,"warningScreen");d(this,"transactionIssuesScreen");d(this,"container");d(this,"onSuccess");d(this,"planId","");d(this,"customer");d(this,"token");d(this,"amount");d(this,"totalAmount");d(this,"encryption");d(this,"currency");d(this,"_currentStep");d(this,"activeRef");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,"onClose");d(this,"cardResponse");d(this,"cardResponseHeader");d(this,"confirmationEnd");d(this,"confirmationProgress");d(this,"restartTransactionProcess");d(this,"retryingPayment");d(this,"isMaxRetriesReached");d(this,"isCancelledPlan");d(this,"isMobile",!1);d(this,"keys");d(this,"testcardIsVisible",!1);d(this,"errorText");d(this,"otpMessage");d(this,"rawAvsData");d(this,"translatedAvsData");this.currency=c,this.onSuccess=b||(()=>null),this.keys=D,this.testcardIsVisible=F,this.container=i,this.encryption=o,this.token=l,this.customer=s,this.planId=a,this.amount=e,this.totalAmount=t,this.rdtCode=p,this.url=m,this.reference=g,this.callBackUrl=y,this.metadata=w,this.localCurrency=f,this._currentStep=1,this.activeRef="",this.contents=this.container.querySelector("#payment-content-view"),this.cardResponse={},this.cardResponseHeader={},this.hidePaymentMethods=k,this.showPaymentMethods=x,this.onClose=A,this.restartTransactionProcess=M,this.retryingPayment=E,this.isMaxRetriesReached=!1,this.isCancelledPlan=!1,this.errorText="",this.otpMessage="",this.renderCardContent(),this.rawAvsData={"billing-address":"Billing address",address:"Address",city:"City",state:"State",country:"Country","zip-code":"Zip code",submit:"Submit"},this.translatedAvsData=this.rawAvsData,_.track("card_opens",{payment_method:"Card"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderCardContent()}fetchCurrentRegionDetails(){const e=this.localCurrency?this.localCurrency!==this.currency?this.localCurrency:this.currency:this.currency;return Ni(e)}cancellledPlanAction(){if(this.rdtCode)window.history.back();else{const e=document.getElementById("checkout-modal");e&&e.remove()}}async renderTranslatedText(e){if(Array.isArray(e))this.translatedAvsData=await Ae.translateRecord(this.rawAvsData,R());else if(e){const t=await z(e,R());this.otpMessage=t}else this.otpMessage=""}showLoader(){this.pageLoader=new ke(this.contents),this.pageLoader.mountLoader()}async submitCardDetails(e,t){e.preventDefault(),_.track("input_cardDetails",{payment_method:"Card",authentication_type:"None"});const i=this.container.querySelector(".spinner"),s=this.container.querySelector("#details-form-button-text"),o=await ar(JSON.stringify(t),this.encryption);i&&s&&(i.classList.remove("hidden"),s.classList.add("hidden"));const a=ft();(()=>{var c,p,m,g,b;if(this.retryingPayment){const y={channel:"card",reference:this.reference,encryptedCard:o};return et(this.token,y,this.rdtCode,this.url)}else{const y={amount:((g=(m=(p=(c=this.merchantPlanDetail)==null?void 0:c.plan)==null?void 0:p.trial)==null?void 0:m.pricingList[0])==null?void 0:g.amount)??this.amount,channel:"card",applyDiscount:!0,currency:this.currency,planId:this.planId,customer:this.customer,reference:this.reference,encryptedCard:o,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((b=this.merchantPlanDetail)==null?void 0:b.taxQuoteId)&&{taxQuoteId:this.merchantPlanDetail.taxQuoteId},deviceInformation:a};return Ha(this.token,y,this.rdtCode,this.url)}})().then(async({data:c,headers:p})=>{var m,g,b,y,w,f,k,x;if(c.providerMessage){const A=await z(c.providerMessage,R());this.errorText=A}if(c.status==="failed")this.currentStep=4,this.reference=c.reference,_.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"None"}),this.cardResponse=c,this.cardResponseHeader=p,c.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(P["payment-failed"]),this.warningScreen.hideReportIssue();else if(["success","successful"].includes(c.status))this.currentStep=5,this.cardResponse=c,this.cardResponseHeader=p,_.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN"}),this.redirectTo(c,p,"success");else if(!["success","successful"].includes(c.status)&&c.status!=="failed")if(this.cardResponse=c,this.cardResponseHeader=p,c!=null&&c.authorization){if(this.activeRef=c.reference,((m=c==null?void 0:c.authorization)==null?void 0:m.mode)==="pin"){this.currentStep=2;return}if(((g=c==null?void 0:c.authorization)==null?void 0:g.mode)==="3DS"){(b=c==null?void 0:c.authorization)!=null&&b.redirectUrl&&this.redirectTo3DS((y=c==null?void 0:c.authorization)==null?void 0:y.redirectUrl),(w=c==null?void 0:c.authorization)!=null&&w.embeddedHtml&&this.redirectToPreciumDoc((f=c==null?void 0:c.authorization)==null?void 0:f.embeddedHtml);return}if(((k=c==null?void 0:c.authorization)==null?void 0:k.mode)==="otp"){this.cardResponse=c,this.currentStep=3;return}if(((x=c==null?void 0:c.authorization)==null?void 0:x.mode)==="avs"){if(R()!=="en"){this.showLoader();const A=Object.values(this.rawAvsData);this.renderTranslatedText(A).then(()=>{this.pageLoader.unmountLoader(),this.currentStep=7})}else this.currentStep=7;return}}else this.currentStep=4,c.providerMessage?this.warningScreen.setPaymentError(this.errorText):this.warningScreen.setPaymentError(P["error-with-payment"]),this.warningScreen.hideReportIssue()}).catch(async c=>{if(_.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"None"}),c.code==="payment_max_retry_attempts")this.isMaxRetriesReached=!0,this.verifyPaymentProcess(),this.currentStep=4,_.track("max_retries_reached",{payment_method:"Card"}),this.warningScreen.setPaymentError(P["maximum-retries"],P["maximum-retries-desc"],q["merchant-back"]);else{if(c.message){const p=await z(c.message,R());this.errorText=p,c.code==="7137"?(this.isCancelledPlan=!0,this.currentStep=4,_.track("cancelled_plan",{payment_method:"Card"}),this.warningScreen.setPaymentError(this.errorText,"",q["merchant-back"])):(this.currentStep=4,this.warningScreen.setPaymentError(this.errorText))}else this.currentStep=4,this.warningScreen.setPaymentError(P["payment-failed"]);this.warningScreen.hideReportIssue()}}).finally(()=>{i&&s&&(i.classList.add("hidden"),s.classList.remove("hidden"))})}handlePinRequest(e){if(e.length===4){const t={authorization:{pin:e},reference:this.activeRef};_.track("input_cardPin",{payment_method:"Card",authentication_type:"PIN"}),setTimeout(()=>{const i=this.container.querySelector("#pin-loader"),s=this.container.querySelector("#cancel-payment");i&&(i.innerHTML=`<svg class="animate-spin" width="40" height="40" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1569
1569
|
<path
|
|
1570
1570
|
d="M62 32C62 38.6156 59.8132 45.0457 55.78 50.2897C51.7468 55.5336 46.0932 59.2974 39.6992 60.9952C33.3052 62.693 26.5293 62.2297 20.4258 59.6774C14.3224 57.1251 9.2338 52.6268 5.95186 46.8827C2.66993 41.1385 1.37873 34.4707 2.2792 27.9166C3.17967 21.3626 6.22129 15.29 10.9308 10.6438C15.6402 5.9976 21.7534 3.0384 28.3191 2.22668C34.8847 1.41496 41.5345 2.79623 47.2337 6.15557"
|
|
1571
1571
|
stroke="black" stroke-width="4" stroke-linejoin="round" />
|
|
@@ -1664,8 +1664,8 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
1664
1664
|
*
|
|
1665
1665
|
* Copyright 2020, Pusher
|
|
1666
1666
|
* Released under the MIT licence.
|
|
1667
|
-
*/(function(n,e){(function(i,s){n.exports=s()})(window,function(){return function(t){var i={};function s(o){if(i[o])return i[o].exports;var a=i[o]={i:o,l:!1,exports:{}};return t[o].call(a.exports,a,a.exports,s),a.l=!0,a.exports}return s.m=t,s.c=i,s.d=function(o,a,l){s.o(o,a)||Object.defineProperty(o,a,{enumerable:!0,get:l})},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 l=Object.create(null);if(s.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:o}),a&2&&typeof o!="string")for(var c in o)s.d(l,c,(function(p){return o[p]}).bind(null,c));return l},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(t,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,l=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,G=0,Z=0,K=0,Q=0,de=0;D<A-4;D+=4)Z=this._decodeChar(k.charCodeAt(D+0)),K=this._decodeChar(k.charCodeAt(D+1)),Q=this._decodeChar(k.charCodeAt(D+2)),de=this._decodeChar(k.charCodeAt(D+3)),M[E++]=Z<<2|K>>>4,M[E++]=K<<4|Q>>>2,M[E++]=Q<<6|de,G|=Z&a,G|=K&a,G|=Q&a,G|=de&a;if(D<A-1&&(Z=this._decodeChar(k.charCodeAt(D)),K=this._decodeChar(k.charCodeAt(D+1)),M[E++]=Z<<2|K>>>4,G|=Z&a,G|=K&a),D<A-2&&(Q=this._decodeChar(k.charCodeAt(D+2)),M[E++]=K<<4|Q>>>2,G|=Q&a),D<A-3&&(de=this._decodeChar(k.charCodeAt(D+3)),M[E++]=Q<<6|de,G|=de&a),G!==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=l;var c=new l;function p(f){return c.encode(f)}i.encode=p;function m(f){return c.decode(f)}i.decode=m;var g=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}(l);i.URLSafeCoder=g;var b=new g;function y(f){return b.encode(f)}i.encodeURLSafe=y;function w(f){return b.decode(f)}i.decodeURLSafe=w,i.encodedLength=function(f){return c.encodedLength(f)},i.maxDecodedLength=function(f){return c.maxDecodedLength(f)},i.decodedLength=function(f){return c.decodedLength(f)}},function(t,i,s){Object.defineProperty(i,"__esModule",{value:!0});var o="utf8: invalid string",a="utf8: invalid source encoding";function l(m){for(var g=new Uint8Array(c(m)),b=0,y=0;y<m.length;y++){var w=m.charCodeAt(y);w<128?g[b++]=w:w<2048?(g[b++]=192|w>>6,g[b++]=128|w&63):w<55296?(g[b++]=224|w>>12,g[b++]=128|w>>6&63,g[b++]=128|w&63):(y++,w=(w&1023)<<10,w|=m.charCodeAt(y)&1023,w+=65536,g[b++]=240|w>>18,g[b++]=128|w>>12&63,g[b++]=128|w>>6&63,g[b++]=128|w&63)}return g}i.encode=l;function c(m){for(var g=0,b=0;b<m.length;b++){var y=m.charCodeAt(b);if(y<128)g+=1;else if(y<2048)g+=2;else if(y<55296)g+=3;else if(y<=57343){if(b>=m.length-1)throw new Error(o);b++,g+=4}else throw new Error(o)}return g}i.encodedLength=c;function p(m){for(var g=[],b=0;b<m.length;b++){var y=m[b];if(y&128){var w=void 0;if(y<224){if(b>=m.length)throw new Error(a);var f=m[++b];if((f&192)!==128)throw new Error(a);y=(y&31)<<6|f&63,w=128}else if(y<240){if(b>=m.length-1)throw new Error(a);var f=m[++b],k=m[++b];if((f&192)!==128||(k&192)!==128)throw new Error(a);y=(y&15)<<12|(f&63)<<6|k&63,w=2048}else if(y<248){if(b>=m.length-2)throw new Error(a);var f=m[++b],k=m[++b],x=m[++b];if((f&192)!==128||(k&192)!==128||(x&192)!==128)throw new Error(a);y=(y&15)<<18|(f&63)<<12|(k&63)<<6|x&63,w=65536}else throw new Error(a);if(y<w||y>=55296&&y<=57343)throw new Error(a);if(y>=65536){if(y>1114111)throw new Error(a);y-=65536,g.push(String.fromCharCode(55296|y>>10)),y=56320|y&1023}}g.push(String.fromCharCode(y))}return g.join("")}i.decode=p},function(t,i,s){t.exports=s(3).default},function(t,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"),l={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:""},c=l;class p{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=F.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()},ie=0;ie<V.length;ie++)V[ie](B,$)}});T.send(I)}}getRoot(r){var u,C=F.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 m=new o("_pusher_dependencies","Pusher.DependenciesReceivers"),g=new p({cdn_http:c.cdn_http,cdn_https:c.cdn_https,version:c.VERSION,suffix:c.dependency_suffix,receivers:m});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 G extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class Z extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class K 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=F.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 K(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 K(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 Cn(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("")},Cn=window.btoa||function(h){return h.replace(/[\s\S]{1,3}/g,Se)};class un{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 wn=un;function Wn(h){window.clearTimeout(h)}function On(h){window.clearInterval(h)}class je extends wn{constructor(r,u){super(setTimeout,Wn,r,function(C){return u(),null})}}class kn extends wn{constructor(r,u){super(setInterval,On,r,function(C){return u(),C})}}var Zn={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=Zn;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(Qn(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 hn(h){var r=[];return De(h,function(u,C){r.push(C)}),r}function H(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 te(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 ne(h,r){var u={};return De(h,function(C,S){(r&&r(C,S,h,u)||C)&&(u[S]=C)}),u}function Un(h){var r=[];return De(h,function(u,C){r.push([C,u])}),r}function Bt(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=Qn(r)),encodeURIComponent(_e(r.toString()))})}function pi(h){var r=ne(h,function(C){return C!==void 0}),u=te(Un(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 Qn(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(ie){S(null,ie)};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=F.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=F.createJSONPRequest(T,u),B=F.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 gt(h,r,u){var C=h+(r.useTLS?"s":""),S=r.useTLS?r.hostTLS:r.hostNonTLS;return C+"://"+S+u}function yt(h,r){var u="/app/"+h,C="?protocol="+c.PROTOCOL+"&client=js&version="+c.VERSION+(r?"&"+r:"");return u+C}var xi={getInitial:function(h,r){var u=(r.httpPath||"")+yt(h,"flash=false");return gt("ws",r,u)}},Ai={getInitial:function(h,r){var u=(r.httpPath||"/pusher")+yt(h);return gt("http",r,u)}},Mi={getInitial:function(h,r){return gt("http",r,r.httpPath||"/pusher")},getPath:function(h,r){return yt(h)}};class Li{constructor(){this._callbacks={}}get(r){return this._callbacks[Ct(r)]}add(r,u,C){var S=Ct(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?[Ct(r)]:hn(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 Ct(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=F.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 Sn{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 Sn({urls:xi,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!F.getWebSocketAPI()},isSupported:function(){return!!F.getWebSocketAPI()},getSocket:function(h){return F.createWebSocket(h)}}),Rt={urls:Ai,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},an=xe({getSocket:function(h){return F.HTTPFactory.createStreamingSocket(h)}},Rt),Vn=xe({getSocket:function(h){return F.HTTPFactory.createPollingSocket(h)}},Rt),xn={isSupported:function(){return F.isXHRSupported()}},ga=new Sn(xe({},an,xn)),ya=new Sn(xe({},Vn,xn)),Ye={ws:_i,xhr_streaming:ga,xhr_polling:ya},mn=Ye,Ei=new Sn({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:g.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=F.isXDRSupported(h.useTLS);return r}},ld=new Sn(xe({},an,Pi)),cd=new Sn(xe({},Vn,Pi));mn.xdr_streaming=ld,mn.xdr_polling=cd,mn.sockjs=Ei;var dd=mn;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 ie=me.now()-I;ie<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(ie/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 Jn=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(Jn.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=Jn.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=Jn.getCloseAction(r),C=Jn.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=Jn.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=Jn.getCloseAction(r)||"backoff",C=Jn.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(F.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 K?{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(ie){try{$(C.next(ie))}catch(we){I(we)}}function V(ie){try{$(C.throw(ie))}catch(we){I(we)}}function $(ie){ie.done?T(ie.value):S(ie.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=F.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 H(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 An.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 An.createPrivateChannel(h,r);if(h.indexOf("presence-")===0)return An.createPresenceChannel(h,r);if(h.indexOf("#")===0)throw new x('Cannot create a channel with name "'+h+'".');return An.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)}},An=Ad;class wa{constructor(r){this.options=r||{},this.livesLeft=this.options.lives||1/0}getAssistant(r){return An.createAssistantToTheTransportManager(this,r,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Yn{constructor(r,u){this.strategies=r,this.loop=!!u.loop,this.failFast=!!u.failFast,this.timeout=u.timeout,this.timeoutLimit=u.timeoutLimit}isSupported(){return Bt(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 Bt(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=te(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 Yn([B],{timeout:S.latency*2+1e3,failFast:!0}))):T++)}var V=me.now(),$=I.pop().connect(r,function ie(we,Bi){we?(ka(C),I.length>0?(V=me.now(),$=I.pop().connect(r,ie)):u(we)):(Pd(C,Bi.transport.name,me.now()-V,T),u(null,Bi))});return{abort:function(){$.abort()},forceMinPriority:function(ie){r=ie,$&&$.forceMinPriority(ie)}}}}function ys(h){return"pusherTransport"+(h?"TLS":"NonTLS")}function Ed(h){var r=F.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=F.getLocalStorage();if(S)try{S[ys(h)]=Qn({timestamp:me.now(),transport:r,latency:u,cacheSkipCount:C})}catch{}}function ka(h){var r=F.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 Ht{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 Nt(h){return function(){return h.isSupported()}}var Dd=function(h,r,u){var C={};function S(Da,Iu,Du,Bu,Ru){var Ba=u(h,Da,Iu,Du,Bu,Ru);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}),ie=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,ie),Tu=S("xdr_streaming","xdr_streaming",1,B,ie),Ta=S("xhr_polling","xhr_polling",1,B),_u=S("xdr_polling","xdr_polling",1,B),_a=new Yn([we],V),Eu=new Yn([Bi],V),Pu=new Yn([Lu],V),Ea=new Yn([new Ht(Nt(La),La,Tu)],V),Pa=new Yn([new Ht(Nt(Ta),Ta,_u)],V),Ia=new Yn([new Ht(Nt(Ea),new gs([Ea,new Ii(Pa,{delay:4e3})]),Pa)],V),Ss=new Ht(Nt(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 Ht(Nt(we),xs,Ss)),C,{ttl:18e5,timeline:r.timeline,useTLS:r.useTLS})},Bd=Dd,Rd=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"),g.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()},Hd={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=Hd;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()},F.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&&(F.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(`
|
|
1668
|
-
`);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 Xn=Cs,Vd=1;class Fd{constructor(r,u){this.hooks=r,this.session=xa(1e3)+"/"+zd(8),this.location=Kd(u),this.readyState=Xn.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===Xn.OPEN)try{return F.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=Xn.CLOSED,this.onclose&&this.onclose({code:r,reason:u,wasClean:C})}onChunk(r){if(r.status===200){this.readyState===Xn.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===Xn.CONNECTING?(r&&r.hostname&&(this.location.base=jd(this.location.base,r.hostname)),this.readyState=Xn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(r){this.readyState===Xn.OPEN&&this.onmessage&&this.onmessage({data:r})}onActivity(){this.onactivity&&this.onactivity()}onError(r){this.onerror&&this.onerror(r)}openStream(){this.stream=F.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 F.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,Wd={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)}},Zd=Wd,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=F.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(Zd,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,nu={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:a,DependenciesReceivers:m,getDefaultStrategy:Bd,Transports:dd,transportConnectionInitializer:Rd,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():g.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)}},F=nu,ws;(function(h){h[h.ERROR=3]="ERROR",h[h.INFO=6]="INFO",h[h.DEBUG=7]="DEBUG"})(ws||(ws={}));var Di=ws;class tu{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 Z,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=An.createHandshake(S,function(we){C=!0,ie(),u(null,we)})},V=function(we){ie(),u(we)},$=function(){ie();var we;we=Qn(S),u(new E(we))},ie=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||(ie(),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}=F;var ou=function(h,r,u,C,S,T){var I=su[u];if(!I)throw new G(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 Z)});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 F.getAuthorizers()[h.transport]>"u")throw`'${h.transport}' is not a recognized auth transport`;return(r,u)=>{const C=lu(r,h);F.getAuthorizers()[h.transport](F,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 F.getAuthorizers()[h.transport]>"u")throw`'${h.transport}' is not a recognized auth transport`;return(r,u)=>{const C=du(r,h);F.getAuthorizers()[h.transport](F,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||c.activityTimeout,cluster:h.cluster,httpPath:h.httpPath||c.httpPath,httpPort:h.httpPort||c.httpPort,httpsPort:h.httpsPort||c.httpsPort,pongTimeout:h.pongTimeout||c.pongTimeout,statsHost:h.statsHost||c.stats_host,unavailableTimeout:h.unavailableTimeout||c.unavailableTimeout,wsPath:h.wsPath||c.wsPath,wsPort:h.wsPort||c.wsPort,wssPort:h.wssPort||c.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`:c.httpHost}function vu(h){return h.wsHost?h.wsHost:bu(h.cluster)}function bu(h){return`ws-${h}.pusher.com`}function fu(h){return F.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({},c.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({},c.channelAuthorization),h.channelAuthorization):(u={transport:h.authTransport||c.authTransport,endpoint:h.authEndpoint||c.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 hn(ne({ws:F.Transports.ws},function(r){return r.isSupported({})}))}constructor(r,u){Mu(r),ru(u),this.key=r,this.config=mu(u,this),this.channels=An.createChannels(),this.global_emitter=new Je,this.sessionID=F.randomInt(1e9),this.timeline=new tu(this.key,this.sessionID,{cluster:this.config.cluster,features:Ee.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Di.INFO,version:c.VERSION}),this.config.enableStats&&(this.timelineSender=An.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+F.TimelineTransport.name}));var C=S=>F.getDefaultStrategy(this.config,S,ou);this.connection=An.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 kn(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=F,Ee.ScriptReceivers=F.ScriptReceivers,Ee.DependenciesReceivers=F.DependenciesReceivers,Ee.auth_callbacks=F.auth_callbacks;var ks=i.default=Ee;function Mu(h){if(h==null)throw"You must pass your app key when you instantiate Pusher."}F.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"),t=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"),l=this.container.querySelector("#amount-tooltip"),c=this.container.querySelector("#transfer-button"),p=this.container.querySelector("#transfer-header-text"),m=this.container.querySelector("#bank-name-text"),g=this.container.querySelector("#beneficiary-text"),b=this.container.querySelector("#amount-text"),y=this.container.querySelectorAll(".copy-text"),w=this.container.querySelector("#account-number-text"),f=this.container.querySelector("#expiration-text");p&&(p.innerHTML=Ve["transfer-header"]),b&&(b.innerHTML=q.amount),y.forEach(k=>{k.innerHTML=P.copy}),w&&(w.innerHTML=Ve["account-number"]),m&&(m.innerHTML=Ve["bank-name"]),g&&(g.innerHTML=Ve.beneficiary),f&&(f.innerHTML=Ve["expiration-text"]),i&&e&&i.addEventListener("click",()=>{s&&(t&&_.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Started",account_number:e.innerHTML,bank_name:t.innerHTML}),this.copyToClipboard(e.innerHTML,s))}),a&&o&&a.addEventListener("click",()=>{l&&(_.track("copy_transferAmount",{payment_method:"Transfer",amount:o.innerHTML.split(" ")[1].replace(/,/g,"")}),this.copyToClipboard(o.innerHTML.split(" ")[1].replace(/,/g,""),l))}),c&&(c.innerHTML=Ve["made-transfer"],c.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 t=this.container.querySelector("#time-left");t&&(t.innerHTML=tt(this.timeLeft))}else this.stopTimer(),e==="check"&&this.onAction(2)},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}copyToClipboard(e,t){navigator.clipboard.writeText(e).then(()=>{t.innerHTML=P.copied}).catch(()=>{t.innerHTML=P["copy-fail"]})}renderComponent(e){var g,b,y,w,f,k;e&&(this.payment=e),this.container.innerHTML=this.render();const t=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"),l=((g=this.payment)==null?void 0:g.currency)||"USD",c=l==="USD"?(b=this.payment)==null?void 0:b.localCurrency:l;if(t&&(t.innerHTML=`${c} ${Te(this.payment.totalTaxAmount?this.payment.totalLocalAmount:l==="USD"?(y=this.payment)==null?void 0:y.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=tt(this.initialTime)),this.startTimer("poll"),e.status==="inProgress"){const x="45654f3ce4c9512ea9a4",A="us2";var p=new yc(x,{cluster:A}),m=p.subscribe(e.reference);m.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">
|
|
1667
|
+
*/(function(n,e){(function(i,s){n.exports=s()})(window,function(){return function(t){var i={};function s(o){if(i[o])return i[o].exports;var a=i[o]={i:o,l:!1,exports:{}};return t[o].call(a.exports,a,a.exports,s),a.l=!0,a.exports}return s.m=t,s.c=i,s.d=function(o,a,l){s.o(o,a)||Object.defineProperty(o,a,{enumerable:!0,get:l})},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 l=Object.create(null);if(s.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:o}),a&2&&typeof o!="string")for(var c in o)s.d(l,c,(function(p){return o[p]}).bind(null,c));return l},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(t,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,l=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,Z=0,G=0,Q=0,de=0;D<A-4;D+=4)Z=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++]=Z<<2|G>>>4,M[E++]=G<<4|Q>>>2,M[E++]=Q<<6|de,F|=Z&a,F|=G&a,F|=Q&a,F|=de&a;if(D<A-1&&(Z=this._decodeChar(k.charCodeAt(D)),G=this._decodeChar(k.charCodeAt(D+1)),M[E++]=Z<<2|G>>>4,F|=Z&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=l;var c=new l;function p(f){return c.encode(f)}i.encode=p;function m(f){return c.decode(f)}i.decode=m;var g=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}(l);i.URLSafeCoder=g;var b=new g;function y(f){return b.encode(f)}i.encodeURLSafe=y;function w(f){return b.decode(f)}i.decodeURLSafe=w,i.encodedLength=function(f){return c.encodedLength(f)},i.maxDecodedLength=function(f){return c.maxDecodedLength(f)},i.decodedLength=function(f){return c.decodedLength(f)}},function(t,i,s){Object.defineProperty(i,"__esModule",{value:!0});var o="utf8: invalid string",a="utf8: invalid source encoding";function l(m){for(var g=new Uint8Array(c(m)),b=0,y=0;y<m.length;y++){var w=m.charCodeAt(y);w<128?g[b++]=w:w<2048?(g[b++]=192|w>>6,g[b++]=128|w&63):w<55296?(g[b++]=224|w>>12,g[b++]=128|w>>6&63,g[b++]=128|w&63):(y++,w=(w&1023)<<10,w|=m.charCodeAt(y)&1023,w+=65536,g[b++]=240|w>>18,g[b++]=128|w>>12&63,g[b++]=128|w>>6&63,g[b++]=128|w&63)}return g}i.encode=l;function c(m){for(var g=0,b=0;b<m.length;b++){var y=m.charCodeAt(b);if(y<128)g+=1;else if(y<2048)g+=2;else if(y<55296)g+=3;else if(y<=57343){if(b>=m.length-1)throw new Error(o);b++,g+=4}else throw new Error(o)}return g}i.encodedLength=c;function p(m){for(var g=[],b=0;b<m.length;b++){var y=m[b];if(y&128){var w=void 0;if(y<224){if(b>=m.length)throw new Error(a);var f=m[++b];if((f&192)!==128)throw new Error(a);y=(y&31)<<6|f&63,w=128}else if(y<240){if(b>=m.length-1)throw new Error(a);var f=m[++b],k=m[++b];if((f&192)!==128||(k&192)!==128)throw new Error(a);y=(y&15)<<12|(f&63)<<6|k&63,w=2048}else if(y<248){if(b>=m.length-2)throw new Error(a);var f=m[++b],k=m[++b],x=m[++b];if((f&192)!==128||(k&192)!==128||(x&192)!==128)throw new Error(a);y=(y&15)<<18|(f&63)<<12|(k&63)<<6|x&63,w=65536}else throw new Error(a);if(y<w||y>=55296&&y<=57343)throw new Error(a);if(y>=65536){if(y>1114111)throw new Error(a);y-=65536,g.push(String.fromCharCode(55296|y>>10)),y=56320|y&1023}}g.push(String.fromCharCode(y))}return g.join("")}i.decode=p},function(t,i,s){t.exports=s(3).default},function(t,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"),l={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:""},c=l;class p{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()},ie=0;ie<V.length;ie++)V[ie](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 m=new o("_pusher_dependencies","Pusher.DependenciesReceivers"),g=new p({cdn_http:c.cdn_http,cdn_https:c.cdn_https,version:c.VERSION,suffix:c.dependency_suffix,receivers:m});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 Z 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 Cn(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("")},Cn=window.btoa||function(h){return h.replace(/[\s\S]{1,3}/g,Se)};class un{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 wn=un;function Wn(h){window.clearTimeout(h)}function On(h){window.clearInterval(h)}class je extends wn{constructor(r,u){super(setTimeout,Wn,r,function(C){return u(),null})}}class kn extends wn{constructor(r,u){super(setInterval,On,r,function(C){return u(),C})}}var Zn={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=Zn;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(Qn(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 hn(h){var r=[];return De(h,function(u,C){r.push(C)}),r}function H(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 te(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 ne(h,r){var u={};return De(h,function(C,S){(r&&r(C,S,h,u)||C)&&(u[S]=C)}),u}function Un(h){var r=[];return De(h,function(u,C){r.push([C,u])}),r}function Bt(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=Qn(r)),encodeURIComponent(_e(r.toString()))})}function pi(h){var r=ne(h,function(C){return C!==void 0}),u=te(Un(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 Qn(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(ie){S(null,ie)};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 gt(h,r,u){var C=h+(r.useTLS?"s":""),S=r.useTLS?r.hostTLS:r.hostNonTLS;return C+"://"+S+u}function yt(h,r){var u="/app/"+h,C="?protocol="+c.PROTOCOL+"&client=js&version="+c.VERSION+(r?"&"+r:"");return u+C}var xi={getInitial:function(h,r){var u=(r.httpPath||"")+yt(h,"flash=false");return gt("ws",r,u)}},Ai={getInitial:function(h,r){var u=(r.httpPath||"/pusher")+yt(h);return gt("http",r,u)}},Mi={getInitial:function(h,r){return gt("http",r,r.httpPath||"/pusher")},getPath:function(h,r){return yt(h)}};class Li{constructor(){this._callbacks={}}get(r){return this._callbacks[Ct(r)]}add(r,u,C){var S=Ct(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?[Ct(r)]:hn(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 Ct(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 Sn{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 Sn({urls:xi,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!K.getWebSocketAPI()},isSupported:function(){return!!K.getWebSocketAPI()},getSocket:function(h){return K.createWebSocket(h)}}),Rt={urls:Ai,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},an=xe({getSocket:function(h){return K.HTTPFactory.createStreamingSocket(h)}},Rt),Vn=xe({getSocket:function(h){return K.HTTPFactory.createPollingSocket(h)}},Rt),xn={isSupported:function(){return K.isXHRSupported()}},ga=new Sn(xe({},an,xn)),ya=new Sn(xe({},Vn,xn)),Ye={ws:_i,xhr_streaming:ga,xhr_polling:ya},mn=Ye,Ei=new Sn({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:g.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 Sn(xe({},an,Pi)),cd=new Sn(xe({},Vn,Pi));mn.xdr_streaming=ld,mn.xdr_polling=cd,mn.sockjs=Ei;var dd=mn;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 ie=me.now()-I;ie<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(ie/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 Jn=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(Jn.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=Jn.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=Jn.getCloseAction(r),C=Jn.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=Jn.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=Jn.getCloseAction(r)||"backoff",C=Jn.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(ie){try{$(C.next(ie))}catch(we){I(we)}}function V(ie){try{$(C.throw(ie))}catch(we){I(we)}}function $(ie){ie.done?T(ie.value):S(ie.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 H(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 An.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 An.createPrivateChannel(h,r);if(h.indexOf("presence-")===0)return An.createPresenceChannel(h,r);if(h.indexOf("#")===0)throw new x('Cannot create a channel with name "'+h+'".');return An.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)}},An=Ad;class wa{constructor(r){this.options=r||{},this.livesLeft=this.options.lives||1/0}getAssistant(r){return An.createAssistantToTheTransportManager(this,r,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Yn{constructor(r,u){this.strategies=r,this.loop=!!u.loop,this.failFast=!!u.failFast,this.timeout=u.timeout,this.timeoutLimit=u.timeoutLimit}isSupported(){return Bt(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 Bt(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=te(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 Yn([B],{timeout:S.latency*2+1e3,failFast:!0}))):T++)}var V=me.now(),$=I.pop().connect(r,function ie(we,Bi){we?(ka(C),I.length>0?(V=me.now(),$=I.pop().connect(r,ie)):u(we)):(Pd(C,Bi.transport.name,me.now()-V,T),u(null,Bi))});return{abort:function(){$.abort()},forceMinPriority:function(ie){r=ie,$&&$.forceMinPriority(ie)}}}}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)]=Qn({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 Ht{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 Nt(h){return function(){return h.isSupported()}}var Dd=function(h,r,u){var C={};function S(Da,Iu,Du,Bu,Ru){var Ba=u(h,Da,Iu,Du,Bu,Ru);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}),ie=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,ie),Tu=S("xdr_streaming","xdr_streaming",1,B,ie),Ta=S("xhr_polling","xhr_polling",1,B),_u=S("xdr_polling","xdr_polling",1,B),_a=new Yn([we],V),Eu=new Yn([Bi],V),Pu=new Yn([Lu],V),Ea=new Yn([new Ht(Nt(La),La,Tu)],V),Pa=new Yn([new Ht(Nt(Ta),Ta,_u)],V),Ia=new Yn([new Ht(Nt(Ea),new gs([Ea,new Ii(Pa,{delay:4e3})]),Pa)],V),Ss=new Ht(Nt(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 Ht(Nt(we),xs,Ss)),C,{ttl:18e5,timeline:r.timeline,useTLS:r.useTLS})},Bd=Dd,Rd=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"),g.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()},Hd={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=Hd;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(`
|
|
1668
|
+
`);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 Xn=Cs,Vd=1;class Fd{constructor(r,u){this.hooks=r,this.session=xa(1e3)+"/"+zd(8),this.location=Kd(u),this.readyState=Xn.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===Xn.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=Xn.CLOSED,this.onclose&&this.onclose({code:r,reason:u,wasClean:C})}onChunk(r){if(r.status===200){this.readyState===Xn.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===Xn.CONNECTING?(r&&r.hostname&&(this.location.base=jd(this.location.base,r.hostname)),this.readyState=Xn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(r){this.readyState===Xn.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,Wd={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)}},Zd=Wd,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(Zd,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,nu={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:a,DependenciesReceivers:m,getDefaultStrategy:Bd,Transports:dd,transportConnectionInitializer:Rd,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():g.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=nu,ws;(function(h){h[h.ERROR=3]="ERROR",h[h.INFO=6]="INFO",h[h.DEBUG=7]="DEBUG"})(ws||(ws={}));var Di=ws;class tu{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 Z,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=An.createHandshake(S,function(we){C=!0,ie(),u(null,we)})},V=function(we){ie(),u(we)},$=function(){ie();var we;we=Qn(S),u(new E(we))},ie=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||(ie(),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 Z)});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||c.activityTimeout,cluster:h.cluster,httpPath:h.httpPath||c.httpPath,httpPort:h.httpPort||c.httpPort,httpsPort:h.httpsPort||c.httpsPort,pongTimeout:h.pongTimeout||c.pongTimeout,statsHost:h.statsHost||c.stats_host,unavailableTimeout:h.unavailableTimeout||c.unavailableTimeout,wsPath:h.wsPath||c.wsPath,wsPort:h.wsPort||c.wsPort,wssPort:h.wssPort||c.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`:c.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({},c.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({},c.channelAuthorization),h.channelAuthorization):(u={transport:h.authTransport||c.authTransport,endpoint:h.authEndpoint||c.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 hn(ne({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=An.createChannels(),this.global_emitter=new Je,this.sessionID=K.randomInt(1e9),this.timeline=new tu(this.key,this.sessionID,{cluster:this.config.cluster,features:Ee.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Di.INFO,version:c.VERSION}),this.config.enableStats&&(this.timelineSender=An.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+K.TimelineTransport.name}));var C=S=>K.getDefaultStrategy(this.config,S,ou);this.connection=An.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 kn(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"),t=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"),l=this.container.querySelector("#amount-tooltip"),c=this.container.querySelector("#transfer-button"),p=this.container.querySelector("#transfer-header-text"),m=this.container.querySelector("#bank-name-text"),g=this.container.querySelector("#beneficiary-text"),b=this.container.querySelector("#amount-text"),y=this.container.querySelectorAll(".copy-text"),w=this.container.querySelector("#account-number-text"),f=this.container.querySelector("#expiration-text");p&&(p.innerHTML=Ve["transfer-header"]),b&&(b.innerHTML=q.amount),y.forEach(k=>{k.innerHTML=P.copy}),w&&(w.innerHTML=Ve["account-number"]),m&&(m.innerHTML=Ve["bank-name"]),g&&(g.innerHTML=Ve.beneficiary),f&&(f.innerHTML=Ve["expiration-text"]),i&&e&&i.addEventListener("click",()=>{s&&(t&&_.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Started",account_number:e.innerHTML,bank_name:t.innerHTML}),this.copyToClipboard(e.innerHTML,s))}),a&&o&&a.addEventListener("click",()=>{l&&(_.track("copy_transferAmount",{payment_method:"Transfer",amount:o.innerHTML.split(" ")[1].replace(/,/g,"")}),this.copyToClipboard(o.innerHTML.split(" ")[1].replace(/,/g,""),l))}),c&&(c.innerHTML=Ve["made-transfer"],c.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 t=this.container.querySelector("#time-left");t&&(t.innerHTML=tt(this.timeLeft))}else this.stopTimer(),e==="check"&&this.onAction(2)},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}copyToClipboard(e,t){navigator.clipboard.writeText(e).then(()=>{t.innerHTML=P.copied}).catch(()=>{t.innerHTML=P["copy-fail"]})}renderComponent(e){var g,b,y,w,f,k;e&&(this.payment=e),this.container.innerHTML=this.render();const t=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"),l=((g=this.payment)==null?void 0:g.currency)||"USD",c=l==="USD"?(b=this.payment)==null?void 0:b.localCurrency:l;if(t&&(t.innerHTML=`${c} ${Te(this.payment.totalTaxAmount?this.payment.totalLocalAmount:l==="USD"?(y=this.payment)==null?void 0:y.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=tt(this.initialTime)),this.startTimer("poll"),e.status==="inProgress"){const x="45654f3ce4c9512ea9a4",A="us2";var p=new yc(x,{cluster:A}),m=p.subscribe(e.reference);m.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">
|
|
1669
1669
|
<div>
|
|
1670
1670
|
<div>
|
|
1671
1671
|
<div class=" grid grid-rows-[auto_1fr] gap-4 mx-5">
|
|
@@ -1991,7 +1991,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
1991
1991
|
<!-- Tab options -->
|
|
1992
1992
|
</div>
|
|
1993
1993
|
</div>
|
|
1994
|
-
</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||"",l=o.querySelector(".tab-button-icon"),c=o.querySelector(".tab-button-label");l&&(l.innerHTML=se[a].icon),c&&(c.textContent=se[a].label),o.addEventListener("click",p=>{p.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 wn,Wn,On,je,kn,Zn,me,xe,Qe,ze,De,hn,H,ye,te,Ce,qe,ne,Un,Bt,hi,mi,pi,vi,Qn,bi,re,fi,gi,yi,Ci,wi,ki,Si,gt,yt,xi,Ai,Mi,Li,Ct,Je,Ti,Sn,_i,Rt;this.container.innerHTML=this.render(),this.mainLoader=new ke(this.container),this.amount=this.amount;const e=this.container.querySelector("#merchant-logo-container"),t=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"),l=this.container.querySelector("#plan-name"),c=this.container.querySelector("#plan-name-mob"),p=this.container.querySelector("#payment-fees"),m=this.container.querySelector("#currency-cursor"),g=this.container.querySelector("#currency-cursor-mob"),b=this.container.querySelector("#payment-rate-display"),y=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"),
|
|
1994
|
+
</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||"",l=o.querySelector(".tab-button-icon"),c=o.querySelector(".tab-button-label");l&&(l.innerHTML=se[a].icon),c&&(c.textContent=se[a].label),o.addEventListener("click",p=>{p.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 wn,Wn,On,je,kn,Zn,me,xe,Qe,ze,De,hn,H,ye,te,Ce,qe,ne,Un,Bt,hi,mi,pi,vi,Qn,bi,re,fi,gi,yi,Ci,wi,ki,Si,gt,yt,xi,Ai,Mi,Li,Ct,Je,Ti,Sn,_i,Rt;this.container.innerHTML=this.render(),this.mainLoader=new ke(this.container),this.amount=this.amount;const e=this.container.querySelector("#merchant-logo-container"),t=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"),l=this.container.querySelector("#plan-name"),c=this.container.querySelector("#plan-name-mob"),p=this.container.querySelector("#payment-fees"),m=this.container.querySelector("#currency-cursor"),g=this.container.querySelector("#currency-cursor-mob"),b=this.container.querySelector("#payment-rate-display"),y=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"),Z=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 an=this.currency==="USD"?this.localCurrency:this.currency,Vn=(wn=Ni(an,this.countryCode))==null?void 0:wn.language,xn=new Set;xn.add("en"),Vn&&Vn!=="en"&&xn.add(Vn),Ae.getTranslationError()||pn&&!xn.has(pn)&&xn.add(pn),xn.size===1?Se.classList.add("hidden"):Se.classList.remove("hidden"),xn.forEach(Ye=>{const mn=new Option(Ye,Ye);mn.value=Ye,mn.text=Dc[Ye]||Ye,Ye===R()&&(mn.selected=!0),Se.appendChild(mn)}),Ae.subscribeToLoading(Ye=>{Se.disabled=Ye}),Se.addEventListener("change",async Ye=>{const Ei=Ye.target.value;it(Ei);try{await Ae.setLanguage(Ei)}catch(Pi){console.error("Failed to change language:",Pi)}finally{}})}if(Z&&(Z.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"]),(Wn=this.merchantDetail)!=null&&Wn.merchantLogo?t&&t.setAttribute("src",(On=this.merchantDetail)==null?void 0:On.merchantLogo):e&&(t==null||t.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),l){if((kn=(je=this.merchantDetail)==null?void 0:je.plan)!=null&&kn.title){const an=((me=(Zn=this.merchantDetail)==null?void 0:Zn.plan)==null?void 0:me.title)||"";l.textContent=ui(an)}(xe=this.metadata)!=null&&xe.productName&&(l.textContent=ui(this.metadata.productName))}if(c){if((ze=(Qe=this.merchantDetail)==null?void 0:Qe.plan)!=null&&ze.title){const an=((hn=(De=this.merchantDetail)==null?void 0:De.plan)==null?void 0:hn.title)||"";c.textContent=ui(an)}(H=this.metadata)!=null&&H.productName&&(c.textContent=ui(this.metadata.productName))}if(m&&(this.currency==="USD"?b&&(b.innerHTML=`1 ${((te=(ye=this.merchantDetail)==null?void 0:ye.rate)==null?void 0:te.to)||"-"} = ${((qe=(Ce=this.merchantDetail)==null?void 0:Ce.rate)==null?void 0:qe.from)||"-"} ${Te(((ne=this.merchantDetail.rate)==null?void 0:ne.rate)||1,2)} `):m.innerHTML=""),g&&(this.currency==="USD"?y&&(y.innerHTML=`1 ${((Bt=(Un=this.merchantDetail)==null?void 0:Un.rate)==null?void 0:Bt.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)} `):g.innerHTML=""),(Qn=(vi=this.merchantDetail)==null?void 0:vi.plan)!=null&&Qn.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>`),l&&c&&(l.remove(),c==null||c.remove()),this.localCurrency?w==null||w.remove():p&&p.remove()),f){const an=(yi=(gi=this.merchantDetail)==null?void 0:gi.plan)==null?void 0:yi.trial,Vn=(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;an&&a?(a.textContent=`${this.currency} ${Te(Vn,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*(((yt=(gt=this.merchantDetail)==null?void 0:gt.rate)==null?void 0:yt.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 Cn=this.localCurrency!==this.currency?this.amount*(((Li=(Mi=this.merchantDetail)==null?void 0:Mi.rate)==null?void 0:Li.rate)||1):this.amount;M&&(Ct=this.merchantDetail)!=null&&Ct.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)-Cn,2)}`),E&&(Sn=this.merchantDetail)!=null&&Sn.taxQuoteId&&(_i=this.merchantDetail)!=null&&_i.totalAmount&&(E.classList.remove("hidden"),E.children[1].innerHTML=`${this.localCurrency!==this.currency?this.localCurrency:this.currency} ${Te(((Rt=this.merchantDetail)==null?void 0:Rt.totalAmount)-Cn,2)}`);const un=Ic[this.localCurrency];D&&this.localCurrency&&(D.innerHTML=un?`${un} (${this.localCurrency})`:this.localCurrency),F&&this.localCurrency&&(F.innerHTML=un?`${un} (${this.localCurrency})`:this.localCurrency),this.renderPaymentOptions(this.container),this.attachListeners()}renderPaymentOptions(e){const t=e.querySelector(".payment-options"),i=Hn(this.currency,this.localCurrency);if(t){const s=this.merchantDetail.plan?[se.mobile_money]:this.merchantDetail.paymentMethods.filter(o=>o!=="ussd").filter(o=>!(i!=="USD"&&o==="stablecoin")).map(o=>se[o]);if(this.isMobile){let o='<div class="">';s.forEach(a=>{o+=`
|
|
1995
1995
|
<div key=${a.key}>
|
|
1996
1996
|
<button class="tab-button gap-2 mb-4 group" data-name="${a.key}">
|
|
1997
1997
|
<div class="lg:block">${a.icon}</div>
|
|
@@ -2217,7 +2217,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
2217
2217
|
</div>
|
|
2218
2218
|
</div>
|
|
2219
2219
|
</div>
|
|
2220
|
-
</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"),t=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"]),t&&(t.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:t,localCurrency:i,metadata:s,callBackUrl:o,rdtCode:a,reference:l,onSuccess:c,url:p,customer:m,amount:g,totalAmount:b,token:y,currency:w,disablePaymentMethods:f,hidePaymentMethods:k,showPaymentMethods:x,onClose:A,restartTransactionProcess:M,retryingPayment:E,countryCode:D}){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,"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=c||(()=>null),this.token=y,this.currency=w,this.amount=g,this.totalAmount=b,this.contents=this.container.querySelector("#payment-content-view"),this._currentStep=1,this.activeRef="",this.token=t,this.customer=m,this.metadata=s,this.localCurrency=i,this.callBackUrl=o,this.localCurrency=i,this.rdtCode=a,this.url=p,this.reference=l,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,t){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=ft();(()=>{var l,c,p,m;if(this.retryingPayment){const g={channel:"mobile_money",reference:this.reference,mobileMoney:{code:t.code,phoneNumber:t.phoneNumber,...t.otp&&{otp:t.otp}}};return et(this.token,g,this.rdtCode,this.url)}else{const g={amount:this.amount,channel:"mobile_money",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:{...this.metadata,...((l=this.merchantDetails)==null?void 0:l.subscription_id)&&{subscription_id:(c=this.merchantDetails)==null?void 0:c.subscription_id}},mobileMoney:{code:t.code,phoneNumber:t.phoneNumber,...t.otp&&{otp:t.otp}},...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((p=this.merchantDetails)==null?void 0:p.taxQuoteId)&&{taxQuoteId:(m=this.merchantDetails)==null?void 0:m.taxQuoteId},...this.countryCode&&{countryCode:this.countryCode},deviceInformation:o};return Na(this.token,g,this.rdtCode,this.url)}})().then(async({data:l,headers:c})=>{var p,m;if(this.paymentResponse=l,this.paymentResponseHeaders=c,l.providerMessage){const g=await z(l.providerMessage,R());this.errorText=g}if(l.status==="failed"){if(l.providerMessage){const g=await z(l.providerMessage,R());this.currentStep=5,this.warningScreen.setPaymentError(g),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:l.providerMessage||"Payment failed"});return}else if(l.status==="success"||l.status==="successful"){this.currentStep=4,_.track("start_payment_success",{payment_method:"Mobile Money",verification_status:"Success"}),Pe(l,c,l==null?void 0:l.callBackUrl);return}else if(((p=l==null?void 0:l.authorization)==null?void 0:p.mode)==="otp"){this.activeRef=l.reference;const g=await z((m=this.paymentResponse)==null?void 0:m.providerMessage,R());this.otpMessage=g,this.currentStep=6;return}else this.currentStep=3}).catch(async l=>{if(_.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Null"}),l.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 c=await z(l.message,R());this.errorText=c,l.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,t){e.preventDefault();const i=this.container.querySelector(".spinner"),s=this.container.querySelector("#mobile-money-button-text"),o={authorization:{otp:t},reference:this.activeRef};_.track("input_MobileMoneyOTP",{payment_method:"Mobile Money",authentication_type:"0TP"}),i&&s&&(i.classList.remove("hidden"),s.classList.add("hidden")),Ot(this.token,o,this.rdtCode,this.url).then(({data:l})=>{l.status==="failed"?(this.activeRef=l.reference,this.currentStep=3):["success","successful","failed"].includes(l.status)?["success","successful"].includes(l.status)&&(this.activeRef=l.reference,this.currentStep=3):(this.activeRef=l.reference,this.currentStep=3)}).catch(async l=>{_.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Failed",authentication_type:"OTP"});const c=this.container.querySelector("#otp-error");if(l.code==="invalid_otp"){if(c){const p=await z(l.message,R());c.innerHTML=p}_.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 t=document.getElementById("go-back");t&&(t.classList.remove("flex","items-center","gap-2","mb-2"),t.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:t=>i=>this.createMobileMoney.bind(this)(t,i),ref:this.activeRef,switchScreen:t=>{this.currentStep=t},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:t=>{this.currentStep=t},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(t,i)=>{this.paymentResponse=t,this.paymentResponseHeaders=i}}),this.mobileMoneyConfirmation.renderComponent();break;case 4:this.successScreen=new Fn({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 en({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:t=>i=>this.submitOtp.bind(this)(t,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:t=>{this.currentStep=t},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 st({container:this.contents,onAction:()=>{var t;this.currentStep=5,this.warningScreen.setPaymentError(((t=this.paymentResponse)==null?void 0:t.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 Wc=`<div id="eft-authenticate-container" data-section="eft">
|
|
2220
|
+
</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"),t=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"]),t&&(t.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:t,localCurrency:i,metadata:s,callBackUrl:o,rdtCode:a,reference:l,onSuccess:c,url:p,customer:m,amount:g,totalAmount:b,token:y,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=c||(()=>null),this.token=y,this.currency=w,this.amount=g,this.totalAmount=b,this.contents=this.container.querySelector("#payment-content-view"),this._currentStep=1,this.activeRef="",this.token=t,this.customer=m,this.metadata=s,this.localCurrency=i,this.callBackUrl=o,this.localCurrency=i,this.rdtCode=a,this.url=p,this.reference=l,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,t){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=ft();(()=>{var l,c,p,m;if(this.retryingPayment){const g={channel:"mobile_money",reference:this.reference,mobileMoney:{code:t.code,phoneNumber:t.phoneNumber,...t.otp&&{otp:t.otp}}};return et(this.token,g,this.rdtCode,this.url)}else{const g={amount:this.amount,channel:"mobile_money",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:{...this.metadata,...((l=this.merchantDetails)==null?void 0:l.subscription_id)&&{subscription_id:(c=this.merchantDetails)==null?void 0:c.subscription_id}},mobileMoney:{code:t.code,phoneNumber:t.phoneNumber,...t.otp&&{otp:t.otp}},...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((p=this.merchantDetails)==null?void 0:p.taxQuoteId)&&{taxQuoteId:(m=this.merchantDetails)==null?void 0:m.taxQuoteId},...this.countryCode&&{countryCode:this.countryCode},...this.planId&&{planId:this.planId},deviceInformation:o};return Na(this.token,g,this.rdtCode,this.url)}})().then(async({data:l,headers:c})=>{var p,m;if(this.paymentResponse=l,this.paymentResponseHeaders=c,l.providerMessage){const g=await z(l.providerMessage,R());this.errorText=g}if(l.status==="failed"){if(l.providerMessage){const g=await z(l.providerMessage,R());this.currentStep=5,this.warningScreen.setPaymentError(g),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:l.providerMessage||"Payment failed"});return}else if(l.status==="success"||l.status==="successful"){this.currentStep=4,_.track("start_payment_success",{payment_method:"Mobile Money",verification_status:"Success"}),Pe(l,c,l==null?void 0:l.callBackUrl);return}else if(((p=l==null?void 0:l.authorization)==null?void 0:p.mode)==="otp"){this.activeRef=l.reference;const g=await z((m=this.paymentResponse)==null?void 0:m.providerMessage,R());this.otpMessage=g,this.currentStep=6;return}else this.currentStep=3}).catch(async l=>{if(_.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Null"}),l.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 c=await z(l.message,R());this.errorText=c,l.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,t){e.preventDefault();const i=this.container.querySelector(".spinner"),s=this.container.querySelector("#mobile-money-button-text"),o={authorization:{otp:t},reference:this.activeRef};_.track("input_MobileMoneyOTP",{payment_method:"Mobile Money",authentication_type:"0TP"}),i&&s&&(i.classList.remove("hidden"),s.classList.add("hidden")),Ot(this.token,o,this.rdtCode,this.url).then(({data:l})=>{l.status==="failed"?(this.activeRef=l.reference,this.currentStep=3):["success","successful","failed"].includes(l.status)?["success","successful"].includes(l.status)&&(this.activeRef=l.reference,this.currentStep=3):(this.activeRef=l.reference,this.currentStep=3)}).catch(async l=>{_.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Failed",authentication_type:"OTP"});const c=this.container.querySelector("#otp-error");if(l.code==="invalid_otp"){if(c){const p=await z(l.message,R());c.innerHTML=p}_.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 t=document.getElementById("go-back");t&&(t.classList.remove("flex","items-center","gap-2","mb-2"),t.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:t=>i=>this.createMobileMoney.bind(this)(t,i),ref:this.activeRef,switchScreen:t=>{this.currentStep=t},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:t=>{this.currentStep=t},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(t,i)=>{this.paymentResponse=t,this.paymentResponseHeaders=i}}),this.mobileMoneyConfirmation.renderComponent();break;case 4:this.successScreen=new Fn({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 en({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:t=>i=>this.submitOtp.bind(this)(t,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:t=>{this.currentStep=t},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 st({container:this.contents,onAction:()=>{var t;this.currentStep=5,this.warningScreen.setPaymentError(((t=this.paymentResponse)==null?void 0:t.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 Wc=`<div id="eft-authenticate-container" data-section="eft">
|
|
2221
2221
|
<div class="pt-3">
|
|
2222
2222
|
<div class="container-center">
|
|
2223
2223
|
<svg width="98" height="32" viewBox="0 0 98 32" fill="none" xmlns="http://www.w3.org/2000/svg"
|
|
@@ -2421,7 +2421,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
|
|
|
2421
2421
|
</svg>
|
|
2422
2422
|
<span class="text-tone-100 font-semibold">
|
|
2423
2423
|
Go back
|
|
2424
|
-
</span>`),t&&(t.innerHTML="Selected")):(e&&(e.classList.remove("flex","items-center","gap-2","mb-2"),e.innerHTML=""),t&&(t.innerHTML="Select your preferred")))}closeBTN(e){(()=>{this.cleanup(),e?(_.track("checkout_closes"),this.closeModal()):this.closePayment()})()}updatePaymentMethodView(e,t,i,s,o){switch(this.currentPaymentMethod){case"card":return this.card=new vc({container:this.modalContainer,amount:i,totalAmount:s,currency:o,token:e,customer:t||this.customerDetails,planId:this.planId,rdtCode:this.rdtCode,url:this.url,reference:this.reference,encryption:this.encryption,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,switchTab:()=>this.switchTab("card"),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment,keys:Ms(this.merchantKey),testcardIsVisible:this.mainFooter.isVisible});case"bank_transfer":return this.transfer=new xc({amount:i,totalAmount:s,currency:o,closeModal:this.closeModal.bind(this),token:e,container:this.modalContainer,customer:t||this.customerDetails,rdtCode:this.rdtCode,url:this.url,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,disablePaymentMethods:a=>{this.disablePaymentMethods.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),hidePaymentMethods:this.hidePaymentMethods.bind(this),retryingPayment:this.retryingPayment});case"ussd":return this.ussd=new ma({container:this.modalContainer,amount:i,totalAmount:s,currency:o,secret:this.merchantKey,rdtCode:this.rdtCode,url:this.url,customer:t||this.customerDetails,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,closeModal:()=>this.closeModal(),switchTab:a=>this.switchTab.bind(a),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),disablePaymentMethods:a=>{this.disablePaymentMethods.bind(this)(a)}});case"mobile_money":return this.mobileMoney=new qc({container:this.modalContainer,customer:t||this.customerDetails,currency:o,rdtCode:this.rdtCode,url:this.url,token:e,amount:this.amount,totalAmount:this.totalAmount,metadata:this.metadata,localCurrency:this.localCurrency,callBackUrl:this.callBackUrl,merchantKey:this.merchantKey,reference:this.reference,closeModal:()=>this.closeModal(),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),disablePaymentMethods:a=>{this.disablePaymentMethods.bind(this)(a)},onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment,countryCode:this.countryCode||""});case"eft":return this.eft=new Zc({container:this.modalContainer,amount:i,totalAmount:s,currency:o,customer:t||this.customerDetails,token:e,rdtCode:this.rdtCode,url:this.url,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,switchTab:()=>this.switchTab("eft"),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment});case"pay_with_opay":return this.opay=new id({container:this.modalContainer,amount:i,totalAmount:s,currency:o,customer:t||this.customerDetails,token:e,rdtCode:this.rdtCode,url:this.url,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,switchTab:()=>this.switchTab("pay_with_opay"),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment});case"stablecoin":return this.stablecoins=new nd({container:this.modalContainer,restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),closeModal:()=>this.closeModal(),token:e,amount:i,totalAmount:s,currency:o,callBackUrl:this.callBackUrl,metadata:this.metadata,customer:t||this.customerDetails,reference:this.reference,retryingPayment:this.retryingPayment,localCurrency:this.localCurrency,url:this.url});default:return null}}renderPaymentMethodContent(){return(()=>{switch(this.currentPaymentMethod){case"card":return this.card.renderCardContent(this.merchantPlanDetail);case"bank_transfer":return this.transfer.renderTransferContent(this.merchantPlanDetail);case"ussd":return this.ussd.renderUssdContent(this.merchantPlanDetail);case"mobile_money":return this.mobileMoney.renderMobileMoneyContent(this.merchantPlanDetail);case"eft":return this.eft.renderEftContent(this.merchantPlanDetail);case"pay_with_opay":return this.opay.renderOpayContent(this.merchantPlanDetail);case"stablecoin":return this.stablecoins.renderStablecoinsContent(this.merchantPlanDetail);default:return this.defaultToEmptyContainer()}})()}setCurrentPaymentMethod(e){this.currentPaymentMethod=e;const t=document.querySelectorAll(".tab-button");t.forEach(s=>s.classList.remove("active"));const i=Array.from(t).find(s=>s.getAttribute("data-name")===e);i&&i.classList.add("active")}setToDefaultEmptyContainer(){this.currentPaymentMethod="",this.retryingPayment=!0,this.updatePaymentMethodView(this.merchantKey,this.customerDetails,this.amount,this.totalAmount,this.currency),this.cleanup(),this.switchTab(""),this.showPaymentMethods(),this.setupPaymentMethodButtons(),this.renderPaymentMethodContent(),_.track("retry_payment")}defaultToEmptyContainer(){const e=document.querySelector("#payment-content-view");e.innerHTML=""}switchTab(e){if(this.currentPaymentMethod===e&&e!=="")return;this.selectedMethods.push(e),this.currentPaymentMethod==="bank_transfer"&&this.currentPaymentMethod!==e&&this.setToDefaultEmptyContainer(),this.setCurrentPaymentMethod(e);const t=this.modalContainer.querySelector("#payment-content-view");R()!=="en"&&!tr(this.selectedMethods,e)?(this.mainLoader=new ke(t),this.mainLoader.mountLoader("25dvh"),this.renderTranslatedText(e).then(()=>{this.mainLoader.unmountLoader(),this.renderingPaymentMethodDetails(e)})):this.renderingPaymentMethodDetails(e)}renderingPaymentMethodDetails(e){this.updatePaymentMethodView(this.merchantKey,this.customerDetails,this.amount,this.totalAmount,this.currency),this.cleanup(),this.showPaymentMethods(),this.renderPaymentMethodContent(),this.attachListeners(),this.isMobile&&(document.querySelectorAll(".tab-button").forEach(i=>{const s=i.getAttribute("data-name");this.disabledChannels.includes(s)||i.removeAttribute("disabled")}),e?document.querySelectorAll(".tab-button").forEach(s=>{s.getAttribute("data-name")!==e&&s.classList.add("hidden")}):document.querySelectorAll(".tab-button").forEach(s=>{const o=s.getAttribute("data-name");[...this.validChannels,...this.disabledChannels].includes(o)&&s.classList.remove("hidden")}))}async renderTranslatedText(e){switch(e){case"card":await Fs(R());break;case"bank_transfer":await Gs(R());break;case"mobile_money":await js(R());break;case"eft":await zs(R());break;case"pay_with_opay":await Ws(R());break;case"stablecoin":await qs(R());break}}disablePaymentMethods(e){this.currentPaymentMethod=e;const t=document.querySelectorAll(".tab-button");t.forEach(s=>s.setAttribute("disabled","true"));const i=Array.from(t).find(s=>s.getAttribute("data-name")===e);i&&i.removeAttribute("disabled")}enablePaymentMethods(){const e=document.querySelectorAll(".tab-button");e.forEach(i=>{const s=i.getAttribute("data-name");s&&!this.disabledChannels.includes(s)&&i.removeAttribute("disabled")});const t=Array.from(e).find(i=>i.getAttribute("data-name")===this.currentPaymentMethod);t&&!this.disabledChannels.includes(this.currentPaymentMethod)&&t.removeAttribute("disabled")}hidePaymentMethods(){const e=document.querySelector("#payment-methods-container");e&&e.classList.add("hidden")}showPaymentMethods(){const e=document.querySelector("#payment-methods-container");e&&e.classList.remove("hidden")}cleanup(){this.transfer&&this.transfer.destroyTimer()}closeModal(e){this.modalContainer&&this.modalContainer.parentNode&&document.body.removeChild(this.modalContainer),e&&e()}setupParent(e){e&&e()}render(){return Ra}}class ps{constructor(e){d(this,"container");this.container=e}renderContent(e,t){var o;this.container.innerHTML=this.render();const i=document.getElementById("error-action-container"),s=document.getElementById("error-message-div");s&&(s.textContent=e),t&&i&&(i.classList.remove("hidden"),(o=i.querySelector("#go-back"))==null||o.addEventListener("click",()=>{window.location.href=t}))}render(){return`
|
|
2424
|
+
</span>`),t&&(t.innerHTML="Selected")):(e&&(e.classList.remove("flex","items-center","gap-2","mb-2"),e.innerHTML=""),t&&(t.innerHTML="Select your preferred")))}closeBTN(e){(()=>{this.cleanup(),e?(_.track("checkout_closes"),this.closeModal()):this.closePayment()})()}updatePaymentMethodView(e,t,i,s,o){switch(this.currentPaymentMethod){case"card":return this.card=new vc({container:this.modalContainer,amount:i,totalAmount:s,currency:o,token:e,customer:t||this.customerDetails,planId:this.planId,rdtCode:this.rdtCode,url:this.url,reference:this.reference,encryption:this.encryption,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,switchTab:()=>this.switchTab("card"),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment,keys:Ms(this.merchantKey),testcardIsVisible:this.mainFooter.isVisible});case"bank_transfer":return this.transfer=new xc({amount:i,totalAmount:s,currency:o,closeModal:this.closeModal.bind(this),token:e,container:this.modalContainer,customer:t||this.customerDetails,rdtCode:this.rdtCode,url:this.url,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,disablePaymentMethods:a=>{this.disablePaymentMethods.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),hidePaymentMethods:this.hidePaymentMethods.bind(this),retryingPayment:this.retryingPayment});case"ussd":return this.ussd=new ma({container:this.modalContainer,amount:i,totalAmount:s,currency:o,secret:this.merchantKey,rdtCode:this.rdtCode,url:this.url,customer:t||this.customerDetails,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,closeModal:()=>this.closeModal(),switchTab:a=>this.switchTab.bind(a),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),disablePaymentMethods:a=>{this.disablePaymentMethods.bind(this)(a)}});case"mobile_money":return this.mobileMoney=new qc({container:this.modalContainer,customer:t||this.customerDetails,currency:o,rdtCode:this.rdtCode,url:this.url,token:e,amount:this.amount,planId:this.planId,totalAmount:this.totalAmount,metadata:this.metadata,localCurrency:this.localCurrency,callBackUrl:this.callBackUrl,merchantKey:this.merchantKey,reference:this.reference,closeModal:()=>this.closeModal(),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),disablePaymentMethods:a=>{this.disablePaymentMethods.bind(this)(a)},onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment,countryCode:this.countryCode||""});case"eft":return this.eft=new Zc({container:this.modalContainer,amount:i,totalAmount:s,currency:o,customer:t||this.customerDetails,token:e,rdtCode:this.rdtCode,url:this.url,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,switchTab:()=>this.switchTab("eft"),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment});case"pay_with_opay":return this.opay=new id({container:this.modalContainer,amount:i,totalAmount:s,currency:o,customer:t||this.customerDetails,token:e,rdtCode:this.rdtCode,url:this.url,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,switchTab:()=>this.switchTab("pay_with_opay"),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment});case"stablecoin":return this.stablecoins=new nd({container:this.modalContainer,restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),closeModal:()=>this.closeModal(),token:e,amount:i,totalAmount:s,currency:o,callBackUrl:this.callBackUrl,metadata:this.metadata,customer:t||this.customerDetails,reference:this.reference,retryingPayment:this.retryingPayment,localCurrency:this.localCurrency,url:this.url});default:return null}}renderPaymentMethodContent(){return(()=>{switch(this.currentPaymentMethod){case"card":return this.card.renderCardContent(this.merchantPlanDetail);case"bank_transfer":return this.transfer.renderTransferContent(this.merchantPlanDetail);case"ussd":return this.ussd.renderUssdContent(this.merchantPlanDetail);case"mobile_money":return this.mobileMoney.renderMobileMoneyContent(this.merchantPlanDetail);case"eft":return this.eft.renderEftContent(this.merchantPlanDetail);case"pay_with_opay":return this.opay.renderOpayContent(this.merchantPlanDetail);case"stablecoin":return this.stablecoins.renderStablecoinsContent(this.merchantPlanDetail);default:return this.defaultToEmptyContainer()}})()}setCurrentPaymentMethod(e){this.currentPaymentMethod=e;const t=document.querySelectorAll(".tab-button");t.forEach(s=>s.classList.remove("active"));const i=Array.from(t).find(s=>s.getAttribute("data-name")===e);i&&i.classList.add("active")}setToDefaultEmptyContainer(){this.currentPaymentMethod="",this.retryingPayment=!0,this.updatePaymentMethodView(this.merchantKey,this.customerDetails,this.amount,this.totalAmount,this.currency),this.cleanup(),this.switchTab(""),this.showPaymentMethods(),this.setupPaymentMethodButtons(),this.renderPaymentMethodContent(),_.track("retry_payment")}defaultToEmptyContainer(){const e=document.querySelector("#payment-content-view");e.innerHTML=""}switchTab(e){if(this.currentPaymentMethod===e&&e!=="")return;this.selectedMethods.push(e),this.currentPaymentMethod==="bank_transfer"&&this.currentPaymentMethod!==e&&this.setToDefaultEmptyContainer(),this.setCurrentPaymentMethod(e);const t=this.modalContainer.querySelector("#payment-content-view");R()!=="en"&&!tr(this.selectedMethods,e)?(this.mainLoader=new ke(t),this.mainLoader.mountLoader("25dvh"),this.renderTranslatedText(e).then(()=>{this.mainLoader.unmountLoader(),this.renderingPaymentMethodDetails(e)})):this.renderingPaymentMethodDetails(e)}renderingPaymentMethodDetails(e){this.updatePaymentMethodView(this.merchantKey,this.customerDetails,this.amount,this.totalAmount,this.currency),this.cleanup(),this.showPaymentMethods(),this.renderPaymentMethodContent(),this.attachListeners(),this.isMobile&&(document.querySelectorAll(".tab-button").forEach(i=>{const s=i.getAttribute("data-name");this.disabledChannels.includes(s)||i.removeAttribute("disabled")}),e?document.querySelectorAll(".tab-button").forEach(s=>{s.getAttribute("data-name")!==e&&s.classList.add("hidden")}):document.querySelectorAll(".tab-button").forEach(s=>{const o=s.getAttribute("data-name");[...this.validChannels,...this.disabledChannels].includes(o)&&s.classList.remove("hidden")}))}async renderTranslatedText(e){switch(e){case"card":await Fs(R());break;case"bank_transfer":await Gs(R());break;case"mobile_money":await js(R());break;case"eft":await zs(R());break;case"pay_with_opay":await Ws(R());break;case"stablecoin":await qs(R());break}}disablePaymentMethods(e){this.currentPaymentMethod=e;const t=document.querySelectorAll(".tab-button");t.forEach(s=>s.setAttribute("disabled","true"));const i=Array.from(t).find(s=>s.getAttribute("data-name")===e);i&&i.removeAttribute("disabled")}enablePaymentMethods(){const e=document.querySelectorAll(".tab-button");e.forEach(i=>{const s=i.getAttribute("data-name");s&&!this.disabledChannels.includes(s)&&i.removeAttribute("disabled")});const t=Array.from(e).find(i=>i.getAttribute("data-name")===this.currentPaymentMethod);t&&!this.disabledChannels.includes(this.currentPaymentMethod)&&t.removeAttribute("disabled")}hidePaymentMethods(){const e=document.querySelector("#payment-methods-container");e&&e.classList.add("hidden")}showPaymentMethods(){const e=document.querySelector("#payment-methods-container");e&&e.classList.remove("hidden")}cleanup(){this.transfer&&this.transfer.destroyTimer()}closeModal(e){this.modalContainer&&this.modalContainer.parentNode&&document.body.removeChild(this.modalContainer),e&&e()}setupParent(e){e&&e()}render(){return Ra}}class ps{constructor(e){d(this,"container");this.container=e}renderContent(e,t){var o;this.container.innerHTML=this.render();const i=document.getElementById("error-action-container"),s=document.getElementById("error-message-div");s&&(s.textContent=e),t&&i&&(i.classList.remove("hidden"),(o=i.querySelector("#go-back"))==null||o.addEventListener("click",()=>{window.location.href=t}))}render(){return`
|
|
2425
2425
|
<div class="box-container">
|
|
2426
2426
|
|
|
2427
2427
|
<div class="container-center h-[40vh] hidden mx-auto" id="shared-error-container">
|