@astropay/payments-lib 2.0.8 → 2.0.9
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/astropay-payments-lib.es.js +1 -1
- package/dist/astropay-payments-lib.umd.js +21 -13
- package/dist/{main-QOFSdpoZ.js → main-OhXOviRS.js} +165 -132
- package/dist/{profiler-Cq4Jvt9c.js → profiler-D3cW_-YH.js} +1 -1
- package/dist/{startRecording-CKBjDVQr.js → startRecording-D2fB2eZp.js} +1 -1
- package/dist/types/index.d.ts +57 -122
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(ii,Jr){typeof exports=="object"&&typeof module<"u"?Jr(exports):typeof define=="function"&&define.amd?define(["exports"],Jr):(ii=typeof globalThis<"u"?globalThis:ii||self,Jr(ii.AstroPay={}))})(this,(function(exports){"use strict";var Ma=Object.defineProperty;var Ua=(ii,Jr,xi)=>Jr in ii?Ma(ii,Jr,{enumerable:!0,configurable:!0,writable:!0,value:xi}):ii[Jr]=xi;var xe=(ii,Jr,xi)=>Ua(ii,typeof Jr!="symbol"?Jr+"":Jr,xi);const FONT_SIZES={xxsm:10,xsm:12,sm:14,base:16,md:20,lg:26,xl:32,xxl:40},FONT_SIZE_MAP={sm:{xSmall:FONT_SIZES.xxsm,small:FONT_SIZES.xsm,medium:FONT_SIZES.sm,base:FONT_SIZES.base,large:FONT_SIZES.md,xLarge:FONT_SIZES.lg},md:{xSmall:FONT_SIZES.xsm,small:FONT_SIZES.sm,medium:FONT_SIZES.base,base:FONT_SIZES.md,large:FONT_SIZES.lg,xLarge:FONT_SIZES.xl},lg:{xSmall:FONT_SIZES.sm,small:FONT_SIZES.base,medium:FONT_SIZES.md,base:FONT_SIZES.lg,large:FONT_SIZES.xl,xLarge:FONT_SIZES.xxl}},DEFAULT_COLORS={transparent:"transparent",surface_dark:"#041311",surface_light:"#FFFFFF",neutral_lightest:"#FFFFFF",neutral_light:"#F3F6F6",neutral_lighter:"#ECF1F0",neutral_base:"#B4C5C3",neutral_darker:"#7C9995",neutral_dark:"#536663",neutral_darkest:"#151E1D",primary_lightest:"#DBFFFB",primary_light:"#AAF6EC",primary_base:"#00DBBF",primary_darker:"#0FC3AC",primary_dark:"#059986",primary_darkest:"#07544A",warning_lightest:"#FFF7DB",warning_light:"#FFEBA8",warning_darker:"#DBA800",warning_darkest:"#755A00",error_lightest:"#FFDCD6",error_light:"#FFB0A3",error_lighter:"#FF8470",error_base:"#FF2C0A",error_dark:"#A31600",error_darkest:"#700F00",success_lightest:"#F0FAEB",success_light:"#D3EFC2",success_base:"#7CD049",success_darker:"#62B52F",success_dark:"#4D8E25",success_darkest:"#37651A"},DEFAULT_FONTS={poppins:"Poppins"},loadFonts=async()=>{try{const ee=document.createElement("link");ee.href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap",ee.rel="stylesheet",document.head.appendChild(ee),await document.fonts.ready}catch(ee){console.error("Font loading failed:",ee)}},DARK_THEME={backgroundColor:DEFAULT_COLORS.surface_dark,fontFamily:DEFAULT_FONTS.poppins,textColor:DEFAULT_COLORS.neutral_light,fontScale:FONT_SIZE_MAP.md,primaryColor:DEFAULT_COLORS.primary_base,secondaryColor:DEFAULT_COLORS.primary_darkest,textPrimaryColor:DEFAULT_COLORS.neutral_lightest,textSecondaryColor:DEFAULT_COLORS.neutral_base,width:"100%",paddingWrapper:"12px",borderRadiusWrapper:"4px",messages:{success:{textColor:DEFAULT_COLORS.success_base},error:{textColor:DEFAULT_COLORS.error_lighter}},input:{normal:{textColor:DEFAULT_COLORS.neutral_lightest,backgroundColor:DEFAULT_COLORS.neutral_darkest,hintTextColor:DEFAULT_COLORS.neutral_darker,placeholderTextColor:DEFAULT_COLORS.neutral_dark,borderColor:DEFAULT_COLORS.transparent,borderRadius:8,borderWidth:3},focus:{textColor:DEFAULT_COLORS.neutral_lightest,backgroundColor:DEFAULT_COLORS.neutral_darkest,hintTextColor:DEFAULT_COLORS.neutral_darker,placeholderTextColor:DEFAULT_COLORS.neutral_darker,borderColor:DEFAULT_COLORS.primary_base,borderRadius:8,borderWidth:3},disabled:{textColor:DEFAULT_COLORS.neutral_darker,backgroundColor:DEFAULT_COLORS.neutral_dark,hintTextColor:DEFAULT_COLORS.neutral_darker,placeholderTextColor:DEFAULT_COLORS.neutral_base,borderColor:DEFAULT_COLORS.neutral_dark,borderRadius:8,borderWidth:3},error:{textColor:DEFAULT_COLORS.neutral_lightest,backgroundColor:DEFAULT_COLORS.neutral_darkest,hintTextColor:DEFAULT_COLORS.error_base,placeholderTextColor:DEFAULT_COLORS.neutral_darker,borderColor:DEFAULT_COLORS.error_base,borderRadius:8,borderWidth:3}},button:{small:{borderRadius:4},medium:{borderRadius:8},large:{borderRadius:8},primary:{textColor:DEFAULT_COLORS.neutral_lightest,backgroundColor:DEFAULT_COLORS.primary_base,borderColor:DEFAULT_COLORS.transparent,borderWidth:0},secondary:{textColor:DEFAULT_COLORS.primary_lightest,backgroundColor:DEFAULT_COLORS.primary_darkest,borderColor:DEFAULT_COLORS.transparent,borderWidth:0},text:{textColor:DEFAULT_COLORS.primary_base,backgroundColor:"unset",borderColor:DEFAULT_COLORS.primary_base,borderWidth:1},disabled:{textColor:DEFAULT_COLORS.neutral_dark,backgroundColor:DEFAULT_COLORS.neutral_base,borderColor:DEFAULT_COLORS.transparent,borderWidth:0}},divider:{color:DEFAULT_COLORS.neutral_darker,variant:"dashed",size:1},card:{padding:12,backgroundColor:DEFAULT_COLORS.neutral_darkest,borderWidth:0,borderStyle:"none",borderColor:DEFAULT_COLORS.transparent,borderRadius:16},qrCode:{padding:16,backgroundColor:DEFAULT_COLORS.neutral_darkest,borderWidth:1,borderStyle:"solid",borderColor:DEFAULT_COLORS.primary_base,borderRadius:16},badge:{default:{padding:"2px 6px",textColor:DEFAULT_COLORS.neutral_light,backgroundColor:DEFAULT_COLORS.neutral_dark,borderWidth:0,borderStyle:"none",borderColor:"unset",borderRadius:4},highlight:{padding:"2px 6px",textColor:DEFAULT_COLORS.primary_light,backgroundColor:DEFAULT_COLORS.primary_darkest,borderWidth:0,borderStyle:"none",borderColor:"unset",borderRadius:4},error:{padding:"2px 6px",textColor:DEFAULT_COLORS.error_light,backgroundColor:DEFAULT_COLORS.error_darkest,borderWidth:0,borderStyle:"none",borderColor:"unset",borderRadius:4},success:{padding:"2px 6px",textColor:DEFAULT_COLORS.success_light,backgroundColor:DEFAULT_COLORS.success_darkest,borderWidth:0,borderStyle:"none",borderColor:"unset",borderRadius:4},warning:{padding:"2px 6px",textColor:DEFAULT_COLORS.warning_light,backgroundColor:DEFAULT_COLORS.warning_darkest,borderWidth:0,borderStyle:"none",borderColor:"unset",borderRadius:4}},timer:{padding:"4px 8px",textColor:DEFAULT_COLORS.error_lightest,backgroundColor:DEFAULT_COLORS.warning_darkest,borderWidth:0,borderStyle:"none",borderColor:"unset",borderRadius:12},apFontFamily:DEFAULT_FONTS.poppins,apPrimaryColor:DEFAULT_COLORS.primary_base,apButtonPrimaryBgColor:DEFAULT_COLORS.primary_base,apButtonPrimaryTxtColor:DEFAULT_COLORS.neutral_darkest,apButtonSecondaryBgColor:DEFAULT_COLORS.primary_darkest,apButtonSecondaryTxtColor:DEFAULT_COLORS.primary_base,apButtonTextTxtColor:DEFAULT_COLORS.primary_base,apButtonDisableBgColor:DEFAULT_COLORS.neutral_base,apButtonDisableTextColor:DEFAULT_COLORS.neutral_dark},LIGHT_THEME={backgroundColor:DEFAULT_COLORS.surface_light,fontFamily:DEFAULT_FONTS.poppins,textColor:DEFAULT_COLORS.neutral_darkest,fontScale:FONT_SIZE_MAP.md,primaryColor:DEFAULT_COLORS.primary_base,secondaryColor:DEFAULT_COLORS.primary_lightest,textPrimaryColor:DEFAULT_COLORS.neutral_darkest,textSecondaryColor:DEFAULT_COLORS.neutral_dark,width:"100%",paddingWrapper:"12px",borderRadiusWrapper:"4px",messages:{success:{textColor:DEFAULT_COLORS.success_darker},error:{textColor:DEFAULT_COLORS.error_dark}},input:{normal:{textColor:DEFAULT_COLORS.neutral_darkest,backgroundColor:DEFAULT_COLORS.neutral_lighter,hintTextColor:DEFAULT_COLORS.neutral_dark,placeholderTextColor:DEFAULT_COLORS.neutral_dark,borderColor:DEFAULT_COLORS.transparent,borderRadius:8,borderWidth:3},focus:{textColor:DEFAULT_COLORS.neutral_darkest,backgroundColor:DEFAULT_COLORS.neutral_lighter,hintTextColor:DEFAULT_COLORS.neutral_dark,placeholderTextColor:DEFAULT_COLORS.neutral_dark,borderColor:DEFAULT_COLORS.primary_base,borderRadius:8,borderWidth:3},disabled:{textColor:DEFAULT_COLORS.neutral_dark,backgroundColor:DEFAULT_COLORS.neutral_base,hintTextColor:DEFAULT_COLORS.neutral_dark,placeholderTextColor:DEFAULT_COLORS.neutral_darker,borderColor:DEFAULT_COLORS.neutral_base,borderRadius:8,borderWidth:3},error:{textColor:DEFAULT_COLORS.neutral_darkest,backgroundColor:DEFAULT_COLORS.neutral_lighter,hintTextColor:DEFAULT_COLORS.error_dark,placeholderTextColor:DEFAULT_COLORS.neutral_dark,borderColor:DEFAULT_COLORS.error_dark,borderRadius:8,borderWidth:3}},button:{small:{borderRadius:4},medium:{borderRadius:8},large:{borderRadius:8},primary:{textColor:DEFAULT_COLORS.neutral_darkest,backgroundColor:DEFAULT_COLORS.primary_base,borderColor:DEFAULT_COLORS.transparent,borderWidth:0},secondary:{textColor:DEFAULT_COLORS.primary_darker,backgroundColor:DEFAULT_COLORS.primary_lightest,borderColor:DEFAULT_COLORS.transparent,borderWidth:0},text:{textColor:DEFAULT_COLORS.primary_base,backgroundColor:"unset",borderColor:DEFAULT_COLORS.primary_base,borderWidth:1},disabled:{textColor:DEFAULT_COLORS.neutral_dark,backgroundColor:DEFAULT_COLORS.neutral_base,borderColor:DEFAULT_COLORS.transparent,borderWidth:0}},divider:{color:DEFAULT_COLORS.neutral_base,variant:"dashed",size:1},card:{padding:12,backgroundColor:DEFAULT_COLORS.neutral_light,borderWidth:0,borderStyle:"none",borderColor:DEFAULT_COLORS.transparent,borderRadius:16},qrCode:{padding:16,backgroundColor:DEFAULT_COLORS.neutral_lightest,borderWidth:1,borderStyle:"solid",borderColor:DEFAULT_COLORS.primary_base,borderRadius:16},badge:{default:{padding:"2px 6px",textColor:DEFAULT_COLORS.neutral_dark,backgroundColor:DEFAULT_COLORS.neutral_light,borderWidth:0,borderStyle:"none",borderColor:"unset",borderRadius:4},highlight:{padding:"2px 6px",textColor:DEFAULT_COLORS.primary_dark,backgroundColor:DEFAULT_COLORS.primary_lightest,borderWidth:0,borderStyle:"none",borderColor:"unset",borderRadius:4},error:{padding:"2px 6px",textColor:DEFAULT_COLORS.error_dark,backgroundColor:DEFAULT_COLORS.error_lightest,borderWidth:0,borderStyle:"none",borderColor:"unset",borderRadius:4},success:{padding:"2px 6px",textColor:DEFAULT_COLORS.success_dark,backgroundColor:DEFAULT_COLORS.success_lightest,borderWidth:0,borderStyle:"none",borderColor:"unset",borderRadius:4},warning:{padding:"2px 6px",textColor:DEFAULT_COLORS.warning_darker,backgroundColor:DEFAULT_COLORS.warning_lightest,borderWidth:0,borderStyle:"none",borderColor:"unset",borderRadius:4}},timer:{padding:"4px 8px",textColor:DEFAULT_COLORS.error_dark,backgroundColor:DEFAULT_COLORS.warning_light,borderWidth:0,borderStyle:"none",borderColor:"unset",borderRadius:12},apFontFamily:DEFAULT_FONTS.poppins,apPrimaryColor:DEFAULT_COLORS.primary_base,apButtonPrimaryBgColor:DEFAULT_COLORS.primary_base,apButtonPrimaryTxtColor:DEFAULT_COLORS.neutral_darkest,apButtonSecondaryBgColor:DEFAULT_COLORS.primary_lightest,apButtonSecondaryTxtColor:DEFAULT_COLORS.primary_dark,apButtonTextTxtColor:DEFAULT_COLORS.primary_dark,apButtonDisableBgColor:DEFAULT_COLORS.neutral_base,apButtonDisableTextColor:DEFAULT_COLORS.neutral_dark},CONFIG_ENVIRONMENT_VALUES=["production","sandbox"],CONFIG_THEME_VALUES=["light","dark"],CONFIG_LANGUAGE_VALUES=["en","pt","es"],CONFIG_CURRENCY_MODE_VALUES=["iso","symbol"],CONFIG_FONT_SCALE_VALUES=["sm","md","lg"],copyToClipboard=async ee=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(ee).catch(re=>{console.error("Error to copy:",re)}):new Promise((re,te)=>{const ne=document.createElement("textarea");ne.value=ee,ne.style.position="fixed",document.body.appendChild(ne),ne.focus(),ne.select();try{document.execCommand("copy")?re():te(new Error("Failed to copy text using execCommand"))}catch(ie){te(ie)}finally{document.body.removeChild(ne)}}),shareInfo=async(ee,re,te)=>{if(navigator.share)try{const ne={title:ee,text:re,...te&&{url:te}};await navigator.share(ne)}catch(ne){console.error("Failed to share information:",ne)}else{console.warn("Web Share API not supported");const ne=`${ee}
|
|
2
2
|
${re}${te?`
|
|
3
|
-
${te}`:""}`;await copyToClipboard(ne)}};function validateValue(ee,re,te){return re.includes(ee)?ee:te}const toCamelCase$1=ee=>ee.toLowerCase().replace(/(?:^|[^a-zA-Z0-9]+)([a-zA-Z0-9])/g,(re,te,ne)=>ne===0?te.toLowerCase():te.toUpperCase()),toSnakeCase=ee=>ee.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[^a-zA-Z0-9]+/g,"_").toLowerCase(),encodeData=ee=>{const re=JSON.stringify(ee);return btoa(re)},applyMask=(ee,re)=>{if(!re)return ee;const te=re.split(""),ne=ee.replace(/[^A-Za-z0-9]/g,"");let ie="",oe=0,se=!1;for(const ae of te){if(se){ie+=ae,se=!1;continue}if(ae==="\\"){se=!0;continue}if(oe>=ne.length)break;switch(ae){case"#":if(/\d/.test(ne[oe]))ie+=ne[oe++];else{oe++;continue}break;case"A":if(/[A-Za-z]/.test(ne[oe]))ie+=ne[oe++];else{oe++;continue}break;case"*":if(/[A-Za-z0-9]/.test(ne[oe]))ie+=ne[oe++];else{oe++;continue}break;default:ie+=ae,ne[oe]===ae&&oe++;break}}return ie},removeMask=(ee,re)=>{if(!re)return ee;const te=re.split(""),ne=ee.split("");let ie="",oe=!1,se=0;for(const ae of te){if(oe){oe=!1,ne[se]===ae&&se++;continue}if(ae==="\\"){oe=!0;continue}if(se>=ne.length)break;switch(ae){case"#":/\d/.test(ne[se])&&(ie+=ne[se]),se++;break;case"A":/[A-Za-z]/.test(ne[se])&&(ie+=ne[se]),se++;break;case"*":/[A-Za-z0-9]/.test(ne[se])&&(ie+=ne[se]),se++;break;default:ne[se]===ae&&se++;break}}return ie},uuid=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,ee=>{const re=Math.random()*16|0;return(ee==="x"?re:re&3||8).toString(16)}),formatPhoneNumber=ee=>ee?ee.startsWith("+")?ee:`+${ee}`:"",isArray$3=Array.isArray,isObject$1=ee=>ee!==null&&typeof ee=="object"&&!isArray$3(ee),snakeCaseToCamelCaseObject=ee=>Object.entries(ee).reduce((re,[te,ne])=>({...re,[toCamelCase$1(te)]:isObject$1(ne)?snakeCaseToCamelCaseObject(ne):isArray$3(ne)?ne.map(ie=>isObject$1(ie)?snakeCaseToCamelCaseObject(ie):ie):ne}),{}),snakeCaseToCamelCaseArray=ee=>{if(isArray$3(ee))return ee.map(re=>isObject$1(re)?snakeCaseToCamelCaseObject(re):re);throw new Error("Input is not an array")},camelCaseToSnakeCaseObject=ee=>Object.entries(ee).reduce((re,[te,ne])=>({...re,[toSnakeCase(te)]:isObject$1(ne)?camelCaseToSnakeCaseObject(ne):isArray$3(ne)?ne.map(ie=>isObject$1(ie)?camelCaseToSnakeCaseObject(ie):ie):ne}),{}),camelCaseToSnakeCaseArray=ee=>{if(isArray$3(ee))return ee.map(re=>isObject$1(re)?camelCaseToSnakeCaseObject(re):re);throw new Error("Input is not an array")},convertData=(ee,re)=>isArray$3(ee)?re==="snake_case-to-camelCase"?snakeCaseToCamelCaseArray(ee):camelCaseToSnakeCaseArray(ee):isObject$1(ee)?re==="snake_case-to-camelCase"?snakeCaseToCamelCaseObject(ee):camelCaseToSnakeCaseObject(ee):ee,deepMerge=(ee,re)=>{if(!re)return ee;const te={...ee};for(const ne in re)if(Object.prototype.hasOwnProperty.call(re,ne)){const ie=re[ne],oe=ee[ne];isObject$1(ie)&&isObject$1(oe)?te[ne]=deepMerge(oe,ie):ie!==void 0&&(te[ne]=ie)}return te},defaultThemes={light:LIGHT_THEME,dark:DARK_THEME},ii=class ii{static init(re){const te=validateValue(re==null?void 0:re.theme,CONFIG_THEME_VALUES,"light");ii.currentTheme=te;const ne=ii.processStyles(re==null?void 0:re.styles);ii.styles=deepMerge(defaultThemes[te],ne)}static getStyles(){return ii.styles}static getTheme(){return ii.currentTheme}static getFontScale(){return this.getStyles().fontScale}static processStyles(re){if(!re)return;const te={...re};return typeof re.fontScale=="string"&&CONFIG_FONT_SCALE_VALUES.includes(re.fontScale)&&(te.fontScale=FONT_SIZE_MAP[re.fontScale]),te}};xe(ii,"currentTheme","light"),xe(ii,"styles",LIGHT_THEME);let ThemeManager=ii;class Component{constructor({tag:re,elementId:te,styles:ne}){xe(this,"element");if(this.element=document.createElement(re),te&&this.element.setAttribute("id",te),ne){const ie=ThemeManager.getStyles(),oe=ne(ie);this.element.className=oe}}addStyleClass(re){this.element.classList.add(re)}render(re){re instanceof Component?re.element.appendChild(this.element):re.appendChild(this.element)}destroy(){this.element.parentElement&&this.element.parentElement.removeChild(this.element)}}function sheetForTag(ee){if(ee.sheet)return ee.sheet;for(var re=0;re<document.styleSheets.length;re++)if(document.styleSheets[re].ownerNode===ee)return document.styleSheets[re]}function createStyleElement(ee){var re=document.createElement("style");return re.setAttribute("data-emotion",ee.key),ee.nonce!==void 0&&re.setAttribute("nonce",ee.nonce),re.appendChild(document.createTextNode("")),re.setAttribute("data-s",""),re}var StyleSheet=(function(){function ee(te){var ne=this;this._insertTag=function(ie){var oe;ne.tags.length===0?ne.insertionPoint?oe=ne.insertionPoint.nextSibling:ne.prepend?oe=ne.container.firstChild:oe=ne.before:oe=ne.tags[ne.tags.length-1].nextSibling,ne.container.insertBefore(ie,oe),ne.tags.push(ie)},this.isSpeedy=te.speedy===void 0?!0:te.speedy,this.tags=[],this.ctr=0,this.nonce=te.nonce,this.key=te.key,this.container=te.container,this.prepend=te.prepend,this.insertionPoint=te.insertionPoint,this.before=null}var re=ee.prototype;return re.hydrate=function(ne){ne.forEach(this._insertTag)},re.insert=function(ne){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(createStyleElement(this));var ie=this.tags[this.tags.length-1];if(this.isSpeedy){var oe=sheetForTag(ie);try{oe.insertRule(ne,oe.cssRules.length)}catch{}}else ie.appendChild(document.createTextNode(ne));this.ctr++},re.flush=function(){this.tags.forEach(function(ne){var ie;return(ie=ne.parentNode)==null?void 0:ie.removeChild(ne)}),this.tags=[],this.ctr=0},ee})(),MS="-ms-",MOZ="-moz-",WEBKIT="-webkit-",COMMENT="comm",RULESET="rule",DECLARATION="decl",IMPORT="@import",KEYFRAMES="@keyframes",LAYER="@layer",abs=Math.abs,from$1=String.fromCharCode,assign=Object.assign;function hash(ee,re){return charat(ee,0)^45?(((re<<2^charat(ee,0))<<2^charat(ee,1))<<2^charat(ee,2))<<2^charat(ee,3):0}function trim$1(ee){return ee.trim()}function match(ee,re){return(ee=re.exec(ee))?ee[0]:ee}function replace(ee,re,te){return ee.replace(re,te)}function indexof(ee,re){return ee.indexOf(re)}function charat(ee,re){return ee.charCodeAt(re)|0}function substr(ee,re,te){return ee.slice(re,te)}function strlen(ee){return ee.length}function sizeof(ee){return ee.length}function append(ee,re){return re.push(ee),ee}function combine$1(ee,re){return ee.map(re).join("")}var line=1,column=1,length=0,position=0,character=0,characters="";function node(ee,re,te,ne,ie,oe,se){return{value:ee,root:re,parent:te,type:ne,props:ie,children:oe,line,column,length:se,return:""}}function copy$1(ee,re){return assign(node("",null,null,"",null,null,0),ee,{length:-ee.length},re)}function char(){return character}function prev(){return character=position>0?charat(characters,--position):0,column--,character===10&&(column=1,line--),character}function next$1(){return character=position<length?charat(characters,position++):0,column++,character===10&&(column=1,line++),character}function peek(){return charat(characters,position)}function caret(){return position}function slice(ee,re){return substr(characters,ee,re)}function token(ee){switch(ee){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function alloc(ee){return line=column=1,length=strlen(characters=ee),position=0,[]}function dealloc(ee){return characters="",ee}function delimit(ee){return trim$1(slice(position-1,delimiter(ee===91?ee+2:ee===40?ee+1:ee)))}function whitespace(ee){for(;(character=peek())&&character<33;)next$1();return token(ee)>2||token(character)>3?"":" "}function escaping(ee,re){for(;--re&&next$1()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice(ee,caret()+(re<6&&peek()==32&&next$1()==32))}function delimiter(ee){for(;next$1();)switch(character){case ee:return position;case 34:case 39:ee!==34&&ee!==39&&delimiter(character);break;case 40:ee===41&&delimiter(ee);break;case 92:next$1();break}return position}function commenter(ee,re){for(;next$1()&&ee+character!==57;)if(ee+character===84&&peek()===47)break;return"/*"+slice(re,position-1)+"*"+from$1(ee===47?ee:next$1())}function identifier(ee){for(;!token(peek());)next$1();return slice(ee,position)}function compile(ee){return dealloc(parse("",null,null,null,[""],ee=alloc(ee),0,[0],ee))}function parse(ee,re,te,ne,ie,oe,se,ae,ue){for(var ce=0,le=0,de=se,fe=0,he=0,pe=0,ge=1,me=1,ye=1,ve=0,be="",_e=ie,Ie=oe,Te=ne,Se=be;me;)switch(pe=ve,ve=next$1()){case 40:if(pe!=108&&charat(Se,de-1)==58){indexof(Se+=replace(delimit(ve),"&","&\f"),"&\f")!=-1&&(ye=-1);break}case 34:case 39:case 91:Se+=delimit(ve);break;case 9:case 10:case 13:case 32:Se+=whitespace(pe);break;case 92:Se+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:append(comment(commenter(next$1(),caret()),re,te),ue);break;default:Se+="/"}break;case 123*ge:ae[ce++]=strlen(Se)*ye;case 125*ge:case 59:case 0:switch(ve){case 0:case 125:me=0;case 59+le:ye==-1&&(Se=replace(Se,/\f/g,"")),he>0&&strlen(Se)-de&&append(he>32?declaration(Se+";",ne,te,de-1):declaration(replace(Se," ","")+";",ne,te,de-2),ue);break;case 59:Se+=";";default:if(append(Te=ruleset(Se,re,te,ce,le,ie,ae,be,_e=[],Ie=[],de),oe),ve===123)if(le===0)parse(Se,re,Te,Te,_e,oe,de,ae,Ie);else switch(fe===99&&charat(Se,3)===110?100:fe){case 100:case 108:case 109:case 115:parse(ee,Te,Te,ne&&append(ruleset(ee,Te,Te,0,0,ie,ae,be,ie,_e=[],de),Ie),ie,Ie,de,ae,ne?_e:Ie);break;default:parse(Se,Te,Te,Te,[""],Ie,0,ae,Ie)}}ce=le=he=0,ge=ye=1,be=Se="",de=se;break;case 58:de=1+strlen(Se),he=pe;default:if(ge<1){if(ve==123)--ge;else if(ve==125&&ge++==0&&prev()==125)continue}switch(Se+=from$1(ve),ve*ge){case 38:ye=le>0?1:(Se+="\f",-1);break;case 44:ae[ce++]=(strlen(Se)-1)*ye,ye=1;break;case 64:peek()===45&&(Se+=delimit(next$1())),fe=peek(),le=de=strlen(be=Se+=identifier(caret())),ve++;break;case 45:pe===45&&strlen(Se)==2&&(ge=0)}}return oe}function ruleset(ee,re,te,ne,ie,oe,se,ae,ue,ce,le){for(var de=ie-1,fe=ie===0?oe:[""],he=sizeof(fe),pe=0,ge=0,me=0;pe<ne;++pe)for(var ye=0,ve=substr(ee,de+1,de=abs(ge=se[pe])),be=ee;ye<he;++ye)(be=trim$1(ge>0?fe[ye]+" "+ve:replace(ve,/&\f/g,fe[ye])))&&(ue[me++]=be);return node(ee,re,te,ie===0?RULESET:ae,ue,ce,le)}function comment(ee,re,te){return node(ee,re,te,COMMENT,from$1(char()),substr(ee,2,-2),0)}function declaration(ee,re,te,ne){return node(ee,re,te,DECLARATION,substr(ee,0,ne),substr(ee,ne+1,-1),ne)}function serialize(ee,re){for(var te="",ne=sizeof(ee),ie=0;ie<ne;ie++)te+=re(ee[ie],ie,ee,re)||"";return te}function stringify(ee,re,te,ne){switch(ee.type){case LAYER:if(ee.children.length)break;case IMPORT:case DECLARATION:return ee.return=ee.return||ee.value;case COMMENT:return"";case KEYFRAMES:return ee.return=ee.value+"{"+serialize(ee.children,ne)+"}";case RULESET:ee.value=ee.props.join(",")}return strlen(te=serialize(ee.children,ne))?ee.return=ee.value+"{"+te+"}":""}function middleware(ee){var re=sizeof(ee);return function(te,ne,ie,oe){for(var se="",ae=0;ae<re;ae++)se+=ee[ae](te,ne,ie,oe)||"";return se}}function rulesheet(ee){return function(re){re.root||(re=re.return)&&ee(re)}}function memoize(ee){var re=Object.create(null);return function(te){return re[te]===void 0&&(re[te]=ee(te)),re[te]}}var identifierWithPointTracking=function(re,te,ne){for(var ie=0,oe=0;ie=oe,oe=peek(),ie===38&&oe===12&&(te[ne]=1),!token(oe);)next$1();return slice(re,position)},toRules=function(re,te){var ne=-1,ie=44;do switch(token(ie)){case 0:ie===38&&peek()===12&&(te[ne]=1),re[ne]+=identifierWithPointTracking(position-1,te,ne);break;case 2:re[ne]+=delimit(ie);break;case 4:if(ie===44){re[++ne]=peek()===58?"&\f":"",te[ne]=re[ne].length;break}default:re[ne]+=from$1(ie)}while(ie=next$1());return re},getRules=function(re,te){return dealloc(toRules(alloc(re),te))},fixedElements=new WeakMap,compat=function(re){if(!(re.type!=="rule"||!re.parent||re.length<1)){for(var te=re.value,ne=re.parent,ie=re.column===ne.column&&re.line===ne.line;ne.type!=="rule";)if(ne=ne.parent,!ne)return;if(!(re.props.length===1&&te.charCodeAt(0)!==58&&!fixedElements.get(ne))&&!ie){fixedElements.set(re,!0);for(var oe=[],se=getRules(te,oe),ae=ne.props,ue=0,ce=0;ue<se.length;ue++)for(var le=0;le<ae.length;le++,ce++)re.props[ce]=oe[ue]?se[ue].replace(/&\f/g,ae[le]):ae[le]+" "+se[ue]}}},removeLabel=function(re){if(re.type==="decl"){var te=re.value;te.charCodeAt(0)===108&&te.charCodeAt(2)===98&&(re.return="",re.value="")}};function prefix(ee,re){switch(hash(ee,re)){case 5103:return WEBKIT+"print-"+ee+ee;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return WEBKIT+ee+ee;case 5349:case 4246:case 4810:case 6968:case 2756:return WEBKIT+ee+MOZ+ee+MS+ee+ee;case 6828:case 4268:return WEBKIT+ee+MS+ee+ee;case 6165:return WEBKIT+ee+MS+"flex-"+ee+ee;case 5187:return WEBKIT+ee+replace(ee,/(\w+).+(:[^]+)/,WEBKIT+"box-$1$2"+MS+"flex-$1$2")+ee;case 5443:return WEBKIT+ee+MS+"flex-item-"+replace(ee,/flex-|-self/,"")+ee;case 4675:return WEBKIT+ee+MS+"flex-line-pack"+replace(ee,/align-content|flex-|-self/,"")+ee;case 5548:return WEBKIT+ee+MS+replace(ee,"shrink","negative")+ee;case 5292:return WEBKIT+ee+MS+replace(ee,"basis","preferred-size")+ee;case 6060:return WEBKIT+"box-"+replace(ee,"-grow","")+WEBKIT+ee+MS+replace(ee,"grow","positive")+ee;case 4554:return WEBKIT+replace(ee,/([^-])(transform)/g,"$1"+WEBKIT+"$2")+ee;case 6187:return replace(replace(replace(ee,/(zoom-|grab)/,WEBKIT+"$1"),/(image-set)/,WEBKIT+"$1"),ee,"")+ee;case 5495:case 3959:return replace(ee,/(image-set\([^]*)/,WEBKIT+"$1$`$1");case 4968:return replace(replace(ee,/(.+:)(flex-)?(.*)/,WEBKIT+"box-pack:$3"+MS+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+WEBKIT+ee+ee;case 4095:case 3583:case 4068:case 2532:return replace(ee,/(.+)-inline(.+)/,WEBKIT+"$1$2")+ee;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(strlen(ee)-1-re>6)switch(charat(ee,re+1)){case 109:if(charat(ee,re+4)!==45)break;case 102:return replace(ee,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(charat(ee,re+3)==108?"$3":"$2-$3"))+ee;case 115:return~indexof(ee,"stretch")?prefix(replace(ee,"stretch","fill-available"),re)+ee:ee}break;case 4949:if(charat(ee,re+1)!==115)break;case 6444:switch(charat(ee,strlen(ee)-3-(~indexof(ee,"!important")&&10))){case 107:return replace(ee,":",":"+WEBKIT)+ee;case 101:return replace(ee,/(.+:)([^;!]+)(;|!.+)?/,"$1"+WEBKIT+(charat(ee,14)===45?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+ee}break;case 5936:switch(charat(ee,re+11)){case 114:return WEBKIT+ee+MS+replace(ee,/[svh]\w+-[tblr]{2}/,"tb")+ee;case 108:return WEBKIT+ee+MS+replace(ee,/[svh]\w+-[tblr]{2}/,"tb-rl")+ee;case 45:return WEBKIT+ee+MS+replace(ee,/[svh]\w+-[tblr]{2}/,"lr")+ee}return WEBKIT+ee+MS+ee+ee}return ee}var prefixer=function(re,te,ne,ie){if(re.length>-1&&!re.return)switch(re.type){case DECLARATION:re.return=prefix(re.value,re.length);break;case KEYFRAMES:return serialize([copy$1(re,{value:replace(re.value,"@","@"+WEBKIT)})],ie);case RULESET:if(re.length)return combine$1(re.props,function(oe){switch(match(oe,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize([copy$1(re,{props:[replace(oe,/:(read-\w+)/,":"+MOZ+"$1")]})],ie);case"::placeholder":return serialize([copy$1(re,{props:[replace(oe,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy$1(re,{props:[replace(oe,/:(plac\w+)/,":"+MOZ+"$1")]}),copy$1(re,{props:[replace(oe,/:(plac\w+)/,MS+"input-$1")]})],ie)}return""})}},defaultStylisPlugins=[prefixer],createCache=function(re){var te=re.key;if(te==="css"){var ne=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(ne,function(ge){var me=ge.getAttribute("data-emotion");me.indexOf(" ")!==-1&&(document.head.appendChild(ge),ge.setAttribute("data-s",""))})}var ie=re.stylisPlugins||defaultStylisPlugins,oe={},se,ae=[];se=re.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+te+' "]'),function(ge){for(var me=ge.getAttribute("data-emotion").split(" "),ye=1;ye<me.length;ye++)oe[me[ye]]=!0;ae.push(ge)});var ue,ce=[compat,removeLabel];{var le,de=[stringify,rulesheet(function(ge){le.insert(ge)})],fe=middleware(ce.concat(ie,de)),he=function(me){return serialize(compile(me),fe)};ue=function(me,ye,ve,be){le=ve,he(me?me+"{"+ye.styles+"}":ye.styles),be&&(pe.inserted[ye.name]=!0)}}var pe={key:te,sheet:new StyleSheet({key:te,container:se,nonce:re.nonce,speedy:re.speedy,prepend:re.prepend,insertionPoint:re.insertionPoint}),nonce:re.nonce,inserted:oe,registered:{},insert:ue};return pe.sheet.hydrate(ae),pe};function murmur2(ee){for(var re=0,te,ne=0,ie=ee.length;ie>=4;++ne,ie-=4)te=ee.charCodeAt(ne)&255|(ee.charCodeAt(++ne)&255)<<8|(ee.charCodeAt(++ne)&255)<<16|(ee.charCodeAt(++ne)&255)<<24,te=(te&65535)*1540483477+((te>>>16)*59797<<16),te^=te>>>24,re=(te&65535)*1540483477+((te>>>16)*59797<<16)^(re&65535)*1540483477+((re>>>16)*59797<<16);switch(ie){case 3:re^=(ee.charCodeAt(ne+2)&255)<<16;case 2:re^=(ee.charCodeAt(ne+1)&255)<<8;case 1:re^=ee.charCodeAt(ne)&255,re=(re&65535)*1540483477+((re>>>16)*59797<<16)}return re^=re>>>13,re=(re&65535)*1540483477+((re>>>16)*59797<<16),((re^re>>>15)>>>0).toString(36)}var unitlessKeys={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},hyphenateRegex=/[A-Z]|^ms/g,animationRegex=/_EMO_([^_]+?)_([^]*?)_EMO_/g,isCustomProperty=function(re){return re.charCodeAt(1)===45},isProcessableValue=function(re){return re!=null&&typeof re!="boolean"},processStyleName=memoize(function(ee){return isCustomProperty(ee)?ee:ee.replace(hyphenateRegex,"-$&").toLowerCase()}),processStyleValue=function(re,te){switch(re){case"animation":case"animationName":if(typeof te=="string")return te.replace(animationRegex,function(ne,ie,oe){return cursor={name:ie,styles:oe,next:cursor},ie})}return unitlessKeys[re]!==1&&!isCustomProperty(re)&&typeof te=="number"&&te!==0?te+"px":te};function handleInterpolation(ee,re,te){if(te==null)return"";var ne=te;if(ne.__emotion_styles!==void 0)return ne;switch(typeof te){case"boolean":return"";case"object":{var ie=te;if(ie.anim===1)return cursor={name:ie.name,styles:ie.styles,next:cursor},ie.name;var oe=te;if(oe.styles!==void 0){var se=oe.next;if(se!==void 0)for(;se!==void 0;)cursor={name:se.name,styles:se.styles,next:cursor},se=se.next;var ae=oe.styles+";";return ae}return createStringFromObject(ee,re,te)}}var ue=te;if(re==null)return ue;var ce=re[ue];return ce!==void 0?ce:ue}function createStringFromObject(ee,re,te){var ne="";if(Array.isArray(te))for(var ie=0;ie<te.length;ie++)ne+=handleInterpolation(ee,re,te[ie])+";";else for(var oe in te){var se=te[oe];if(typeof se!="object"){var ae=se;re!=null&&re[ae]!==void 0?ne+=oe+"{"+re[ae]+"}":isProcessableValue(ae)&&(ne+=processStyleName(oe)+":"+processStyleValue(oe,ae)+";")}else if(Array.isArray(se)&&typeof se[0]=="string"&&(re==null||re[se[0]]===void 0))for(var ue=0;ue<se.length;ue++)isProcessableValue(se[ue])&&(ne+=processStyleName(oe)+":"+processStyleValue(oe,se[ue])+";");else{var ce=handleInterpolation(ee,re,se);switch(oe){case"animation":case"animationName":{ne+=processStyleName(oe)+":"+ce+";";break}default:ne+=oe+"{"+ce+"}"}}}return ne}var labelPattern=/label:\s*([^\s;{]+)\s*(;|$)/g,cursor;function serializeStyles(ee,re,te){if(ee.length===1&&typeof ee[0]=="object"&&ee[0]!==null&&ee[0].styles!==void 0)return ee[0];var ne=!0,ie="";cursor=void 0;var oe=ee[0];if(oe==null||oe.raw===void 0)ne=!1,ie+=handleInterpolation(te,re,oe);else{var se=oe;ie+=se[0]}for(var ae=1;ae<ee.length;ae++)if(ie+=handleInterpolation(te,re,ee[ae]),ne){var ue=oe;ie+=ue[ae]}labelPattern.lastIndex=0;for(var ce="",le;(le=labelPattern.exec(ie))!==null;)ce+="-"+le[1];var de=murmur2(ie)+ce;return{name:de,styles:ie,next:cursor}}function getRegisteredStyles(ee,re,te){var ne="";return te.split(" ").forEach(function(ie){ee[ie]!==void 0?re.push(ee[ie]+";"):ie&&(ne+=ie+" ")}),ne}var registerStyles=function(re,te,ne){var ie=re.key+"-"+te.name;re.registered[ie]===void 0&&(re.registered[ie]=te.styles)},insertStyles=function(re,te,ne){registerStyles(re,te);var ie=re.key+"-"+te.name;if(re.inserted[te.name]===void 0){var oe=te;do re.insert(te===oe?"."+ie:"",oe,re.sheet,!0),oe=oe.next;while(oe!==void 0)}};function insertWithoutScoping(ee,re){if(ee.inserted[re.name]===void 0)return ee.insert("",re,ee.sheet,!0)}function merge$2(ee,re,te){var ne=[],ie=getRegisteredStyles(ee,ne,te);return ne.length<2?te:ie+re(ne)}var createEmotion=function(re){var te=createCache(re);te.sheet.speedy=function(ae){this.isSpeedy=ae},te.compat=!0;var ne=function(){for(var ue=arguments.length,ce=new Array(ue),le=0;le<ue;le++)ce[le]=arguments[le];var de=serializeStyles(ce,te.registered,void 0);return insertStyles(te,de),te.key+"-"+de.name},ie=function(){for(var ue=arguments.length,ce=new Array(ue),le=0;le<ue;le++)ce[le]=arguments[le];var de=serializeStyles(ce,te.registered),fe="animation-"+de.name;return insertWithoutScoping(te,{name:de.name,styles:"@keyframes "+fe+"{"+de.styles+"}"}),fe},oe=function(){for(var ue=arguments.length,ce=new Array(ue),le=0;le<ue;le++)ce[le]=arguments[le];var de=serializeStyles(ce,te.registered);insertWithoutScoping(te,de)},se=function(){for(var ue=arguments.length,ce=new Array(ue),le=0;le<ue;le++)ce[le]=arguments[le];return merge$2(te.registered,ne,classnames(ce))};return{css:ne,cx:se,injectGlobal:oe,keyframes:ie,hydrate:function(ue){ue.forEach(function(ce){te.inserted[ce]=!0})},flush:function(){te.registered={},te.inserted={},te.sheet.flush()},sheet:te.sheet,cache:te,getRegisteredStyles:getRegisteredStyles.bind(null,te.registered),merge:merge$2.bind(null,te.registered,ne)}},classnames=function ee(re){for(var te="",ne=0;ne<re.length;ne++){var ie=re[ne];if(ie!=null){var oe=void 0;switch(typeof ie){case"boolean":break;case"object":{if(Array.isArray(ie))oe=ee(ie);else{oe="";for(var se in ie)ie[se]&&se&&(oe&&(oe+=" "),oe+=se)}break}default:oe=ie}oe&&(te&&(te+=" "),te+=oe)}}return te},_createEmotion=createEmotion({key:"css"}),cx=_createEmotion.cx,keyframes=_createEmotion.keyframes,css=_createEmotion.css;const getSizeInPx=ee=>typeof ee=="number"?ee:ThemeManager.getFontScale()[ee],getLineHeight=(ee,re)=>{if(re)return re;const te=typeof ee=="number"?ee:getSizeInPx(ee);return Math.round(te*1.5)},getTypographyStyles=(ee,re)=>{const te=getSizeInPx(re.size||12),ne=getLineHeight(te,re.lineHeight);return css`
|
|
3
|
+
${te}`:""}`;await copyToClipboard(ne)}};function validateValue(ee,re,te){return re.includes(ee)?ee:te}const NON_BREAKING_SPACE=" ",toCamelCase$1=ee=>ee.toLowerCase().replace(/(?:^|[^a-zA-Z0-9]+)([a-zA-Z0-9])/g,(re,te,ne)=>ne===0?te.toLowerCase():te.toUpperCase()),toSnakeCase=ee=>ee.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[^a-zA-Z0-9]+/g,"_").toLowerCase(),encodeData=ee=>{const re=JSON.stringify(ee);return btoa(re)},applyMask=(ee,re)=>{if(!re)return ee;const te=re.split(""),ne=ee.replace(/[^A-Za-z0-9]/g,"");let ie="",oe=0,se=!1;for(const ae of te){if(se){ie+=ae,se=!1;continue}if(ae==="\\"){se=!0;continue}if(oe>=ne.length)break;switch(ae){case"#":if(/\d/.test(ne[oe]))ie+=ne[oe++];else{oe++;continue}break;case"A":if(/[A-Za-z]/.test(ne[oe]))ie+=ne[oe++];else{oe++;continue}break;case"*":if(/[A-Za-z0-9]/.test(ne[oe]))ie+=ne[oe++];else{oe++;continue}break;default:ie+=ae,ne[oe]===ae&&oe++;break}}return ie},removeMask=(ee,re)=>{if(!re)return ee;const te=re.split(""),ne=ee.split("");let ie="",oe=!1,se=0;for(const ae of te){if(oe){oe=!1,ne[se]===ae&&se++;continue}if(ae==="\\"){oe=!0;continue}if(se>=ne.length)break;switch(ae){case"#":/\d/.test(ne[se])&&(ie+=ne[se]),se++;break;case"A":/[A-Za-z]/.test(ne[se])&&(ie+=ne[se]),se++;break;case"*":/[A-Za-z0-9]/.test(ne[se])&&(ie+=ne[se]),se++;break;default:ne[se]===ae&&se++;break}}return ie},uuid=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,ee=>{const re=Math.random()*16|0;return(ee==="x"?re:re&3||8).toString(16)}),formatPhoneNumber=ee=>ee?ee.startsWith("+")?ee:`+${ee}`:"",isArray$3=Array.isArray,isObject$1=ee=>ee!==null&&typeof ee=="object"&&!isArray$3(ee),snakeCaseToCamelCaseObject=ee=>Object.entries(ee).reduce((re,[te,ne])=>({...re,[toCamelCase$1(te)]:isObject$1(ne)?snakeCaseToCamelCaseObject(ne):isArray$3(ne)?ne.map(ie=>isObject$1(ie)?snakeCaseToCamelCaseObject(ie):ie):ne}),{}),snakeCaseToCamelCaseArray=ee=>{if(isArray$3(ee))return ee.map(re=>isObject$1(re)?snakeCaseToCamelCaseObject(re):re);throw new Error("Input is not an array")},camelCaseToSnakeCaseObject=ee=>Object.entries(ee).reduce((re,[te,ne])=>({...re,[toSnakeCase(te)]:isObject$1(ne)?camelCaseToSnakeCaseObject(ne):isArray$3(ne)?ne.map(ie=>isObject$1(ie)?camelCaseToSnakeCaseObject(ie):ie):ne}),{}),camelCaseToSnakeCaseArray=ee=>{if(isArray$3(ee))return ee.map(re=>isObject$1(re)?camelCaseToSnakeCaseObject(re):re);throw new Error("Input is not an array")},convertData=(ee,re)=>isArray$3(ee)?re==="snake_case-to-camelCase"?snakeCaseToCamelCaseArray(ee):camelCaseToSnakeCaseArray(ee):isObject$1(ee)?re==="snake_case-to-camelCase"?snakeCaseToCamelCaseObject(ee):camelCaseToSnakeCaseObject(ee):ee,deepMerge=(ee,re)=>{if(!re)return ee;const te={...ee};for(const ne in re)if(Object.prototype.hasOwnProperty.call(re,ne)){const ie=re[ne],oe=ee[ne];isObject$1(ie)&&isObject$1(oe)?te[ne]=deepMerge(oe,ie):ie!==void 0&&(te[ne]=ie)}return te},defaultThemes={light:LIGHT_THEME,dark:DARK_THEME},ii=class ii{static init(re){const te=validateValue(re==null?void 0:re.theme,CONFIG_THEME_VALUES,"light");ii.currentTheme=te;const ne=ii.processStyles(re==null?void 0:re.styles);ii.styles=deepMerge(defaultThemes[te],ne)}static getStyles(){return ii.styles}static getTheme(){return ii.currentTheme}static getFontScale(){return this.getStyles().fontScale}static processStyles(re){if(!re)return;const te={...re};return typeof re.fontScale=="string"&&CONFIG_FONT_SCALE_VALUES.includes(re.fontScale)&&(te.fontScale=FONT_SIZE_MAP[re.fontScale]),te}};xe(ii,"currentTheme","light"),xe(ii,"styles",LIGHT_THEME);let ThemeManager=ii;class Component{constructor({tag:re,elementId:te,styles:ne}){xe(this,"element");if(this.element=document.createElement(re),te&&this.element.setAttribute("id",te),ne){const ie=ThemeManager.getStyles(),oe=ne(ie);this.element.className=oe}}addStyleClass(re){this.element.classList.add(re)}render(re){re instanceof Component?re.element.appendChild(this.element):re.appendChild(this.element)}destroy(){this.element.parentElement&&this.element.parentElement.removeChild(this.element)}}function sheetForTag(ee){if(ee.sheet)return ee.sheet;for(var re=0;re<document.styleSheets.length;re++)if(document.styleSheets[re].ownerNode===ee)return document.styleSheets[re]}function createStyleElement(ee){var re=document.createElement("style");return re.setAttribute("data-emotion",ee.key),ee.nonce!==void 0&&re.setAttribute("nonce",ee.nonce),re.appendChild(document.createTextNode("")),re.setAttribute("data-s",""),re}var StyleSheet=(function(){function ee(te){var ne=this;this._insertTag=function(ie){var oe;ne.tags.length===0?ne.insertionPoint?oe=ne.insertionPoint.nextSibling:ne.prepend?oe=ne.container.firstChild:oe=ne.before:oe=ne.tags[ne.tags.length-1].nextSibling,ne.container.insertBefore(ie,oe),ne.tags.push(ie)},this.isSpeedy=te.speedy===void 0?!0:te.speedy,this.tags=[],this.ctr=0,this.nonce=te.nonce,this.key=te.key,this.container=te.container,this.prepend=te.prepend,this.insertionPoint=te.insertionPoint,this.before=null}var re=ee.prototype;return re.hydrate=function(ne){ne.forEach(this._insertTag)},re.insert=function(ne){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(createStyleElement(this));var ie=this.tags[this.tags.length-1];if(this.isSpeedy){var oe=sheetForTag(ie);try{oe.insertRule(ne,oe.cssRules.length)}catch{}}else ie.appendChild(document.createTextNode(ne));this.ctr++},re.flush=function(){this.tags.forEach(function(ne){var ie;return(ie=ne.parentNode)==null?void 0:ie.removeChild(ne)}),this.tags=[],this.ctr=0},ee})(),MS="-ms-",MOZ="-moz-",WEBKIT="-webkit-",COMMENT="comm",RULESET="rule",DECLARATION="decl",IMPORT="@import",KEYFRAMES="@keyframes",LAYER="@layer",abs=Math.abs,from$1=String.fromCharCode,assign=Object.assign;function hash(ee,re){return charat(ee,0)^45?(((re<<2^charat(ee,0))<<2^charat(ee,1))<<2^charat(ee,2))<<2^charat(ee,3):0}function trim$1(ee){return ee.trim()}function match(ee,re){return(ee=re.exec(ee))?ee[0]:ee}function replace(ee,re,te){return ee.replace(re,te)}function indexof(ee,re){return ee.indexOf(re)}function charat(ee,re){return ee.charCodeAt(re)|0}function substr(ee,re,te){return ee.slice(re,te)}function strlen(ee){return ee.length}function sizeof(ee){return ee.length}function append(ee,re){return re.push(ee),ee}function combine$1(ee,re){return ee.map(re).join("")}var line=1,column=1,length=0,position=0,character=0,characters="";function node(ee,re,te,ne,ie,oe,se){return{value:ee,root:re,parent:te,type:ne,props:ie,children:oe,line,column,length:se,return:""}}function copy$1(ee,re){return assign(node("",null,null,"",null,null,0),ee,{length:-ee.length},re)}function char(){return character}function prev(){return character=position>0?charat(characters,--position):0,column--,character===10&&(column=1,line--),character}function next$1(){return character=position<length?charat(characters,position++):0,column++,character===10&&(column=1,line++),character}function peek(){return charat(characters,position)}function caret(){return position}function slice(ee,re){return substr(characters,ee,re)}function token(ee){switch(ee){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function alloc(ee){return line=column=1,length=strlen(characters=ee),position=0,[]}function dealloc(ee){return characters="",ee}function delimit(ee){return trim$1(slice(position-1,delimiter(ee===91?ee+2:ee===40?ee+1:ee)))}function whitespace(ee){for(;(character=peek())&&character<33;)next$1();return token(ee)>2||token(character)>3?"":" "}function escaping(ee,re){for(;--re&&next$1()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice(ee,caret()+(re<6&&peek()==32&&next$1()==32))}function delimiter(ee){for(;next$1();)switch(character){case ee:return position;case 34:case 39:ee!==34&&ee!==39&&delimiter(character);break;case 40:ee===41&&delimiter(ee);break;case 92:next$1();break}return position}function commenter(ee,re){for(;next$1()&&ee+character!==57;)if(ee+character===84&&peek()===47)break;return"/*"+slice(re,position-1)+"*"+from$1(ee===47?ee:next$1())}function identifier(ee){for(;!token(peek());)next$1();return slice(ee,position)}function compile(ee){return dealloc(parse("",null,null,null,[""],ee=alloc(ee),0,[0],ee))}function parse(ee,re,te,ne,ie,oe,se,ae,ue){for(var ce=0,le=0,de=se,fe=0,he=0,pe=0,ge=1,me=1,ye=1,ve=0,be="",_e=ie,Ie=oe,Te=ne,Se=be;me;)switch(pe=ve,ve=next$1()){case 40:if(pe!=108&&charat(Se,de-1)==58){indexof(Se+=replace(delimit(ve),"&","&\f"),"&\f")!=-1&&(ye=-1);break}case 34:case 39:case 91:Se+=delimit(ve);break;case 9:case 10:case 13:case 32:Se+=whitespace(pe);break;case 92:Se+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:append(comment(commenter(next$1(),caret()),re,te),ue);break;default:Se+="/"}break;case 123*ge:ae[ce++]=strlen(Se)*ye;case 125*ge:case 59:case 0:switch(ve){case 0:case 125:me=0;case 59+le:ye==-1&&(Se=replace(Se,/\f/g,"")),he>0&&strlen(Se)-de&&append(he>32?declaration(Se+";",ne,te,de-1):declaration(replace(Se," ","")+";",ne,te,de-2),ue);break;case 59:Se+=";";default:if(append(Te=ruleset(Se,re,te,ce,le,ie,ae,be,_e=[],Ie=[],de),oe),ve===123)if(le===0)parse(Se,re,Te,Te,_e,oe,de,ae,Ie);else switch(fe===99&&charat(Se,3)===110?100:fe){case 100:case 108:case 109:case 115:parse(ee,Te,Te,ne&&append(ruleset(ee,Te,Te,0,0,ie,ae,be,ie,_e=[],de),Ie),ie,Ie,de,ae,ne?_e:Ie);break;default:parse(Se,Te,Te,Te,[""],Ie,0,ae,Ie)}}ce=le=he=0,ge=ye=1,be=Se="",de=se;break;case 58:de=1+strlen(Se),he=pe;default:if(ge<1){if(ve==123)--ge;else if(ve==125&&ge++==0&&prev()==125)continue}switch(Se+=from$1(ve),ve*ge){case 38:ye=le>0?1:(Se+="\f",-1);break;case 44:ae[ce++]=(strlen(Se)-1)*ye,ye=1;break;case 64:peek()===45&&(Se+=delimit(next$1())),fe=peek(),le=de=strlen(be=Se+=identifier(caret())),ve++;break;case 45:pe===45&&strlen(Se)==2&&(ge=0)}}return oe}function ruleset(ee,re,te,ne,ie,oe,se,ae,ue,ce,le){for(var de=ie-1,fe=ie===0?oe:[""],he=sizeof(fe),pe=0,ge=0,me=0;pe<ne;++pe)for(var ye=0,ve=substr(ee,de+1,de=abs(ge=se[pe])),be=ee;ye<he;++ye)(be=trim$1(ge>0?fe[ye]+" "+ve:replace(ve,/&\f/g,fe[ye])))&&(ue[me++]=be);return node(ee,re,te,ie===0?RULESET:ae,ue,ce,le)}function comment(ee,re,te){return node(ee,re,te,COMMENT,from$1(char()),substr(ee,2,-2),0)}function declaration(ee,re,te,ne){return node(ee,re,te,DECLARATION,substr(ee,0,ne),substr(ee,ne+1,-1),ne)}function serialize(ee,re){for(var te="",ne=sizeof(ee),ie=0;ie<ne;ie++)te+=re(ee[ie],ie,ee,re)||"";return te}function stringify(ee,re,te,ne){switch(ee.type){case LAYER:if(ee.children.length)break;case IMPORT:case DECLARATION:return ee.return=ee.return||ee.value;case COMMENT:return"";case KEYFRAMES:return ee.return=ee.value+"{"+serialize(ee.children,ne)+"}";case RULESET:ee.value=ee.props.join(",")}return strlen(te=serialize(ee.children,ne))?ee.return=ee.value+"{"+te+"}":""}function middleware(ee){var re=sizeof(ee);return function(te,ne,ie,oe){for(var se="",ae=0;ae<re;ae++)se+=ee[ae](te,ne,ie,oe)||"";return se}}function rulesheet(ee){return function(re){re.root||(re=re.return)&&ee(re)}}function memoize(ee){var re=Object.create(null);return function(te){return re[te]===void 0&&(re[te]=ee(te)),re[te]}}var identifierWithPointTracking=function(re,te,ne){for(var ie=0,oe=0;ie=oe,oe=peek(),ie===38&&oe===12&&(te[ne]=1),!token(oe);)next$1();return slice(re,position)},toRules=function(re,te){var ne=-1,ie=44;do switch(token(ie)){case 0:ie===38&&peek()===12&&(te[ne]=1),re[ne]+=identifierWithPointTracking(position-1,te,ne);break;case 2:re[ne]+=delimit(ie);break;case 4:if(ie===44){re[++ne]=peek()===58?"&\f":"",te[ne]=re[ne].length;break}default:re[ne]+=from$1(ie)}while(ie=next$1());return re},getRules=function(re,te){return dealloc(toRules(alloc(re),te))},fixedElements=new WeakMap,compat=function(re){if(!(re.type!=="rule"||!re.parent||re.length<1)){for(var te=re.value,ne=re.parent,ie=re.column===ne.column&&re.line===ne.line;ne.type!=="rule";)if(ne=ne.parent,!ne)return;if(!(re.props.length===1&&te.charCodeAt(0)!==58&&!fixedElements.get(ne))&&!ie){fixedElements.set(re,!0);for(var oe=[],se=getRules(te,oe),ae=ne.props,ue=0,ce=0;ue<se.length;ue++)for(var le=0;le<ae.length;le++,ce++)re.props[ce]=oe[ue]?se[ue].replace(/&\f/g,ae[le]):ae[le]+" "+se[ue]}}},removeLabel=function(re){if(re.type==="decl"){var te=re.value;te.charCodeAt(0)===108&&te.charCodeAt(2)===98&&(re.return="",re.value="")}};function prefix(ee,re){switch(hash(ee,re)){case 5103:return WEBKIT+"print-"+ee+ee;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return WEBKIT+ee+ee;case 5349:case 4246:case 4810:case 6968:case 2756:return WEBKIT+ee+MOZ+ee+MS+ee+ee;case 6828:case 4268:return WEBKIT+ee+MS+ee+ee;case 6165:return WEBKIT+ee+MS+"flex-"+ee+ee;case 5187:return WEBKIT+ee+replace(ee,/(\w+).+(:[^]+)/,WEBKIT+"box-$1$2"+MS+"flex-$1$2")+ee;case 5443:return WEBKIT+ee+MS+"flex-item-"+replace(ee,/flex-|-self/,"")+ee;case 4675:return WEBKIT+ee+MS+"flex-line-pack"+replace(ee,/align-content|flex-|-self/,"")+ee;case 5548:return WEBKIT+ee+MS+replace(ee,"shrink","negative")+ee;case 5292:return WEBKIT+ee+MS+replace(ee,"basis","preferred-size")+ee;case 6060:return WEBKIT+"box-"+replace(ee,"-grow","")+WEBKIT+ee+MS+replace(ee,"grow","positive")+ee;case 4554:return WEBKIT+replace(ee,/([^-])(transform)/g,"$1"+WEBKIT+"$2")+ee;case 6187:return replace(replace(replace(ee,/(zoom-|grab)/,WEBKIT+"$1"),/(image-set)/,WEBKIT+"$1"),ee,"")+ee;case 5495:case 3959:return replace(ee,/(image-set\([^]*)/,WEBKIT+"$1$`$1");case 4968:return replace(replace(ee,/(.+:)(flex-)?(.*)/,WEBKIT+"box-pack:$3"+MS+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+WEBKIT+ee+ee;case 4095:case 3583:case 4068:case 2532:return replace(ee,/(.+)-inline(.+)/,WEBKIT+"$1$2")+ee;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(strlen(ee)-1-re>6)switch(charat(ee,re+1)){case 109:if(charat(ee,re+4)!==45)break;case 102:return replace(ee,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(charat(ee,re+3)==108?"$3":"$2-$3"))+ee;case 115:return~indexof(ee,"stretch")?prefix(replace(ee,"stretch","fill-available"),re)+ee:ee}break;case 4949:if(charat(ee,re+1)!==115)break;case 6444:switch(charat(ee,strlen(ee)-3-(~indexof(ee,"!important")&&10))){case 107:return replace(ee,":",":"+WEBKIT)+ee;case 101:return replace(ee,/(.+:)([^;!]+)(;|!.+)?/,"$1"+WEBKIT+(charat(ee,14)===45?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+ee}break;case 5936:switch(charat(ee,re+11)){case 114:return WEBKIT+ee+MS+replace(ee,/[svh]\w+-[tblr]{2}/,"tb")+ee;case 108:return WEBKIT+ee+MS+replace(ee,/[svh]\w+-[tblr]{2}/,"tb-rl")+ee;case 45:return WEBKIT+ee+MS+replace(ee,/[svh]\w+-[tblr]{2}/,"lr")+ee}return WEBKIT+ee+MS+ee+ee}return ee}var prefixer=function(re,te,ne,ie){if(re.length>-1&&!re.return)switch(re.type){case DECLARATION:re.return=prefix(re.value,re.length);break;case KEYFRAMES:return serialize([copy$1(re,{value:replace(re.value,"@","@"+WEBKIT)})],ie);case RULESET:if(re.length)return combine$1(re.props,function(oe){switch(match(oe,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize([copy$1(re,{props:[replace(oe,/:(read-\w+)/,":"+MOZ+"$1")]})],ie);case"::placeholder":return serialize([copy$1(re,{props:[replace(oe,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy$1(re,{props:[replace(oe,/:(plac\w+)/,":"+MOZ+"$1")]}),copy$1(re,{props:[replace(oe,/:(plac\w+)/,MS+"input-$1")]})],ie)}return""})}},defaultStylisPlugins=[prefixer],createCache=function(re){var te=re.key;if(te==="css"){var ne=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(ne,function(ge){var me=ge.getAttribute("data-emotion");me.indexOf(" ")!==-1&&(document.head.appendChild(ge),ge.setAttribute("data-s",""))})}var ie=re.stylisPlugins||defaultStylisPlugins,oe={},se,ae=[];se=re.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+te+' "]'),function(ge){for(var me=ge.getAttribute("data-emotion").split(" "),ye=1;ye<me.length;ye++)oe[me[ye]]=!0;ae.push(ge)});var ue,ce=[compat,removeLabel];{var le,de=[stringify,rulesheet(function(ge){le.insert(ge)})],fe=middleware(ce.concat(ie,de)),he=function(me){return serialize(compile(me),fe)};ue=function(me,ye,ve,be){le=ve,he(me?me+"{"+ye.styles+"}":ye.styles),be&&(pe.inserted[ye.name]=!0)}}var pe={key:te,sheet:new StyleSheet({key:te,container:se,nonce:re.nonce,speedy:re.speedy,prepend:re.prepend,insertionPoint:re.insertionPoint}),nonce:re.nonce,inserted:oe,registered:{},insert:ue};return pe.sheet.hydrate(ae),pe};function murmur2(ee){for(var re=0,te,ne=0,ie=ee.length;ie>=4;++ne,ie-=4)te=ee.charCodeAt(ne)&255|(ee.charCodeAt(++ne)&255)<<8|(ee.charCodeAt(++ne)&255)<<16|(ee.charCodeAt(++ne)&255)<<24,te=(te&65535)*1540483477+((te>>>16)*59797<<16),te^=te>>>24,re=(te&65535)*1540483477+((te>>>16)*59797<<16)^(re&65535)*1540483477+((re>>>16)*59797<<16);switch(ie){case 3:re^=(ee.charCodeAt(ne+2)&255)<<16;case 2:re^=(ee.charCodeAt(ne+1)&255)<<8;case 1:re^=ee.charCodeAt(ne)&255,re=(re&65535)*1540483477+((re>>>16)*59797<<16)}return re^=re>>>13,re=(re&65535)*1540483477+((re>>>16)*59797<<16),((re^re>>>15)>>>0).toString(36)}var unitlessKeys={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},hyphenateRegex=/[A-Z]|^ms/g,animationRegex=/_EMO_([^_]+?)_([^]*?)_EMO_/g,isCustomProperty=function(re){return re.charCodeAt(1)===45},isProcessableValue=function(re){return re!=null&&typeof re!="boolean"},processStyleName=memoize(function(ee){return isCustomProperty(ee)?ee:ee.replace(hyphenateRegex,"-$&").toLowerCase()}),processStyleValue=function(re,te){switch(re){case"animation":case"animationName":if(typeof te=="string")return te.replace(animationRegex,function(ne,ie,oe){return cursor={name:ie,styles:oe,next:cursor},ie})}return unitlessKeys[re]!==1&&!isCustomProperty(re)&&typeof te=="number"&&te!==0?te+"px":te};function handleInterpolation(ee,re,te){if(te==null)return"";var ne=te;if(ne.__emotion_styles!==void 0)return ne;switch(typeof te){case"boolean":return"";case"object":{var ie=te;if(ie.anim===1)return cursor={name:ie.name,styles:ie.styles,next:cursor},ie.name;var oe=te;if(oe.styles!==void 0){var se=oe.next;if(se!==void 0)for(;se!==void 0;)cursor={name:se.name,styles:se.styles,next:cursor},se=se.next;var ae=oe.styles+";";return ae}return createStringFromObject(ee,re,te)}}var ue=te;if(re==null)return ue;var ce=re[ue];return ce!==void 0?ce:ue}function createStringFromObject(ee,re,te){var ne="";if(Array.isArray(te))for(var ie=0;ie<te.length;ie++)ne+=handleInterpolation(ee,re,te[ie])+";";else for(var oe in te){var se=te[oe];if(typeof se!="object"){var ae=se;re!=null&&re[ae]!==void 0?ne+=oe+"{"+re[ae]+"}":isProcessableValue(ae)&&(ne+=processStyleName(oe)+":"+processStyleValue(oe,ae)+";")}else if(Array.isArray(se)&&typeof se[0]=="string"&&(re==null||re[se[0]]===void 0))for(var ue=0;ue<se.length;ue++)isProcessableValue(se[ue])&&(ne+=processStyleName(oe)+":"+processStyleValue(oe,se[ue])+";");else{var ce=handleInterpolation(ee,re,se);switch(oe){case"animation":case"animationName":{ne+=processStyleName(oe)+":"+ce+";";break}default:ne+=oe+"{"+ce+"}"}}}return ne}var labelPattern=/label:\s*([^\s;{]+)\s*(;|$)/g,cursor;function serializeStyles(ee,re,te){if(ee.length===1&&typeof ee[0]=="object"&&ee[0]!==null&&ee[0].styles!==void 0)return ee[0];var ne=!0,ie="";cursor=void 0;var oe=ee[0];if(oe==null||oe.raw===void 0)ne=!1,ie+=handleInterpolation(te,re,oe);else{var se=oe;ie+=se[0]}for(var ae=1;ae<ee.length;ae++)if(ie+=handleInterpolation(te,re,ee[ae]),ne){var ue=oe;ie+=ue[ae]}labelPattern.lastIndex=0;for(var ce="",le;(le=labelPattern.exec(ie))!==null;)ce+="-"+le[1];var de=murmur2(ie)+ce;return{name:de,styles:ie,next:cursor}}function getRegisteredStyles(ee,re,te){var ne="";return te.split(" ").forEach(function(ie){ee[ie]!==void 0?re.push(ee[ie]+";"):ie&&(ne+=ie+" ")}),ne}var registerStyles=function(re,te,ne){var ie=re.key+"-"+te.name;re.registered[ie]===void 0&&(re.registered[ie]=te.styles)},insertStyles=function(re,te,ne){registerStyles(re,te);var ie=re.key+"-"+te.name;if(re.inserted[te.name]===void 0){var oe=te;do re.insert(te===oe?"."+ie:"",oe,re.sheet,!0),oe=oe.next;while(oe!==void 0)}};function insertWithoutScoping(ee,re){if(ee.inserted[re.name]===void 0)return ee.insert("",re,ee.sheet,!0)}function merge$2(ee,re,te){var ne=[],ie=getRegisteredStyles(ee,ne,te);return ne.length<2?te:ie+re(ne)}var createEmotion=function(re){var te=createCache(re);te.sheet.speedy=function(ae){this.isSpeedy=ae},te.compat=!0;var ne=function(){for(var ue=arguments.length,ce=new Array(ue),le=0;le<ue;le++)ce[le]=arguments[le];var de=serializeStyles(ce,te.registered,void 0);return insertStyles(te,de),te.key+"-"+de.name},ie=function(){for(var ue=arguments.length,ce=new Array(ue),le=0;le<ue;le++)ce[le]=arguments[le];var de=serializeStyles(ce,te.registered),fe="animation-"+de.name;return insertWithoutScoping(te,{name:de.name,styles:"@keyframes "+fe+"{"+de.styles+"}"}),fe},oe=function(){for(var ue=arguments.length,ce=new Array(ue),le=0;le<ue;le++)ce[le]=arguments[le];var de=serializeStyles(ce,te.registered);insertWithoutScoping(te,de)},se=function(){for(var ue=arguments.length,ce=new Array(ue),le=0;le<ue;le++)ce[le]=arguments[le];return merge$2(te.registered,ne,classnames(ce))};return{css:ne,cx:se,injectGlobal:oe,keyframes:ie,hydrate:function(ue){ue.forEach(function(ce){te.inserted[ce]=!0})},flush:function(){te.registered={},te.inserted={},te.sheet.flush()},sheet:te.sheet,cache:te,getRegisteredStyles:getRegisteredStyles.bind(null,te.registered),merge:merge$2.bind(null,te.registered,ne)}},classnames=function ee(re){for(var te="",ne=0;ne<re.length;ne++){var ie=re[ne];if(ie!=null){var oe=void 0;switch(typeof ie){case"boolean":break;case"object":{if(Array.isArray(ie))oe=ee(ie);else{oe="";for(var se in ie)ie[se]&&se&&(oe&&(oe+=" "),oe+=se)}break}default:oe=ie}oe&&(te&&(te+=" "),te+=oe)}}return te},_createEmotion=createEmotion({key:"css"}),cx=_createEmotion.cx,keyframes=_createEmotion.keyframes,css=_createEmotion.css;const getSizeInPx=ee=>typeof ee=="number"?ee:ThemeManager.getFontScale()[ee],getLineHeight=(ee,re)=>{if(re)return re;const te=typeof ee=="number"?ee:getSizeInPx(ee);return Math.round(te*1.5)},getTypographyStyles=(ee,re)=>{const te=getSizeInPx(re.size||12),ne=getLineHeight(te,re.lineHeight);return css`
|
|
4
4
|
font-family: ${ee.fontFamily};
|
|
5
5
|
color: ${(re==null?void 0:re.color)||ee.textColor};
|
|
6
6
|
|
|
@@ -222,13 +222,13 @@ ${te}`:""}`;await copyToClipboard(ne)}};function validateValue(ee,re,te){return
|
|
|
222
222
|
align-items: center;
|
|
223
223
|
justify-content: center;
|
|
224
224
|
gap: 8px;
|
|
225
|
-
`;class LoadingSuccess extends Component{constructor({text:re,delay:te,onSuccess:ne}){super({tag:"div",styles:()=>getLoadingSuccessStyles()});const ie=new Loading({size:12,color:ThemeManager.getStyles().textPrimaryColor}).element,oe=new Typography({text:re??AstroPayI18n.translate("almost_done"),size:"xSmall"}).element;this.element.append(ie,oe),setTimeout(()=>{ne(),this.element.remove()},te??5e3)}}const RUNTIME_CONFIG={test:{NAME:"@astropay/payments-lib",VERSION:"2.0.8",MODE:"test",API_BASE_URL:"https://partners-api-tst.astropay.com/api",RESOURCES_BUCKET:"https://rs-tst.astropay.com",CHECKOUT_URL:"https://checkout-tst.astropay.com",SINGULAR_LINK_URL:"https://astropay-tst.sng.link/Eftaj/ovlnu?_smtype=3",SINGULAR_LINK_PREFIX:"apcmobiletst://"},sandbox:{NAME:"@astropay/payments-lib",VERSION:"2.0.8",MODE:"staging",API_BASE_URL:"https://partners-api-sandbox.astropay.com/api",RESOURCES_BUCKET:"https://rs-tst.astropay.com",CHECKOUT_URL:"https://checkout-sandbox.astropay.com",SINGULAR_LINK_URL:"https://astropay-stg.sng.link/Ezzoz/nfnj?_smtype=3",SINGULAR_LINK_PREFIX:"apcmobilestaging://"},production:{NAME:"@astropay/payments-lib",VERSION:"2.0.8",MODE:"production",API_BASE_URL:"https://partners-api.astropay.com/api",RESOURCES_BUCKET:"https://rs.astropay.com",CHECKOUT_URL:"https://checkout.astropay.com",SINGULAR_LINK_URL:"https://astropay.sng.link/E2h2a/jqze?_smtype=3",SINGULAR_LINK_PREFIX:"apcmobile://"}};var EStorageKey=(ee=>(ee.SESSION_ID="session_id",ee))(EStorageKey||{});const Jr=class Jr{static init(re){const te=validateValue(re==null?void 0:re.environment,[...CONFIG_ENVIRONMENT_VALUES,"test"],"production"),ne=validateValue(re==null?void 0:re.currencyMode,CONFIG_CURRENCY_MODE_VALUES,"iso");Jr.environment=te,Jr.currencyMode=ne}static getRuntimeConfig(){const re=Jr.environment||"production";return RUNTIME_CONFIG[re]}static getEnvironment(){return Jr.environment}static getCurrencyMode(){return Jr.currencyMode}};xe(Jr,"environment"),xe(Jr,"currencyMode");let AstroPayConfig=Jr;const ConsoleApiName={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},globalConsole=console,originalConsoleMethods={};Object.keys(ConsoleApiName).forEach(ee=>{originalConsoleMethods[ee]=globalConsole[ee]});const PREFIX$1="Datadog Browser SDK:",display={debug:originalConsoleMethods.debug.bind(globalConsole,PREFIX$1),log:originalConsoleMethods.log.bind(globalConsole,PREFIX$1),info:originalConsoleMethods.info.bind(globalConsole,PREFIX$1),warn:originalConsoleMethods.warn.bind(globalConsole,PREFIX$1),error:originalConsoleMethods.error.bind(globalConsole,PREFIX$1)},DOCS_ORIGIN="https://docs.datadoghq.com",DOCS_TROUBLESHOOTING=`${DOCS_ORIGIN}/real_user_monitoring/browser/troubleshooting`,MORE_DETAILS="More details:";function catchUserErrors(ee,re){return(...te)=>{try{return ee(...te)}catch(ne){display.error(re,ne)}}}function performDraw(ee){return ee!==0&&Math.random()*100<=ee}function round(ee,re){return+ee.toFixed(re)}function isPercentage(ee){return isNumber$1(ee)&&ee>=0&&ee<=100}function isNumber$1(ee){return typeof ee=="number"}const ONE_SECOND=1e3,ONE_MINUTE=60*ONE_SECOND,ONE_HOUR=60*ONE_MINUTE,ONE_DAY=24*ONE_HOUR,ONE_YEAR=365*ONE_DAY;function relativeToClocks(ee){return{relative:ee,timeStamp:getCorrectedTimeStamp(ee)}}function timeStampToClocks(ee){return{relative:getRelativeTime(ee),timeStamp:ee}}function getCorrectedTimeStamp(ee){const re=dateNow()-performance.now();return re>getNavigationStart()?Math.round(addDuration(re,ee)):getTimeStamp(ee)}function currentDrift(){return Math.round(dateNow()-addDuration(getNavigationStart(),performance.now()))}function toServerDuration(ee){return isNumber$1(ee)?round(ee*1e6,0):ee}function dateNow(){return new Date().getTime()}function timeStampNow(){return dateNow()}function relativeNow(){return performance.now()}function clocksNow(){return{relative:relativeNow(),timeStamp:timeStampNow()}}function clocksOrigin(){return{relative:0,timeStamp:getNavigationStart()}}function elapsed(ee,re){return re-ee}function addDuration(ee,re){return ee+re}function getRelativeTime(ee){return ee-getNavigationStart()}function getTimeStamp(ee){return Math.round(addDuration(getNavigationStart(),ee))}function looksLikeRelativeTime(ee){return ee<ONE_YEAR}let navigationStart;function getNavigationStart(){return navigationStart===void 0&&(navigationStart=performance.timing.navigationStart),navigationStart}const ONE_KIBI_BYTE=1024,ONE_MEBI_BYTE=1024*ONE_KIBI_BYTE,HAS_MULTI_BYTES_CHARACTERS=/[^\u0000-\u007F]/;function computeBytesCount(ee){return HAS_MULTI_BYTES_CHARACTERS.test(ee)?window.TextEncoder!==void 0?new TextEncoder().encode(ee).length:new Blob([ee]).size:ee.length}function concatBuffers(ee){const re=ee.reduce((ie,oe)=>ie+oe.length,0),te=new Uint8Array(re);let ne=0;for(const ie of ee)te.set(ie,ne),ne+=ie.length;return te}function shallowClone(ee){return{...ee}}function objectHasValue(ee,re){return Object.keys(ee).some(te=>ee[te]===re)}function isEmptyObject$1(ee){return Object.keys(ee).length===0}function mapValues(ee,re){const te={};for(const ne of Object.keys(ee))te[ne]=re(ee[ne]);return te}function getGlobalObject(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let ee=_dd_temp_;return delete Object.prototype._dd_temp_,typeof ee!="object"&&(typeof self=="object"?ee=self:typeof window=="object"?ee=window:ee={}),ee}function getZoneJsOriginalValue(ee,re){const te=getGlobalObject();let ne;return te.Zone&&typeof te.Zone.__symbol__=="function"&&(ne=ee[te.Zone.__symbol__(re)]),ne||(ne=ee[re]),ne}let onMonitorErrorCollected,debugMode=!1;function startMonitorErrorCollection(ee){onMonitorErrorCollected=ee}function setDebugMode(ee){debugMode=ee}function monitor(ee){return function(){return callMonitored(ee,this,arguments)}}function callMonitored(ee,re,te){try{return ee.apply(re,te)}catch(ne){monitorError(ne)}}function monitorError(ee){if(displayIfDebugEnabled(ee),onMonitorErrorCollected)try{onMonitorErrorCollected(ee)}catch(re){displayIfDebugEnabled(re)}}function displayIfDebugEnabled(...ee){debugMode&&display.error("[MONITOR]",...ee)}function setTimeout$1(ee,re){return getZoneJsOriginalValue(getGlobalObject(),"setTimeout")(monitor(ee),re)}function clearTimeout$1(ee){getZoneJsOriginalValue(getGlobalObject(),"clearTimeout")(ee)}function setInterval$1(ee,re){return getZoneJsOriginalValue(getGlobalObject(),"setInterval")(monitor(ee),re)}function clearInterval$1(ee){getZoneJsOriginalValue(getGlobalObject(),"clearInterval")(ee)}let Observable$1=class{constructor(re){this.onFirstSubscribe=re,this.observers=[]}subscribe(re){return this.observers.push(re),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter(te=>re!==te),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(re){this.observers.forEach(te=>te(re))}};function mergeObservables(...ee){return new Observable$1(re=>{const te=ee.map(ne=>ne.subscribe(ie=>re.notify(ie)));return()=>te.forEach(ne=>ne.unsubscribe())})}function throttle$2(ee,re,te){const ne=te&&te.leading!==void 0?te.leading:!0,ie=te&&te.trailing!==void 0?te.trailing:!0;let oe=!1,se,ae;return{throttled:(...ue)=>{if(oe){se=ue;return}ne?ee(...ue):se=ue,oe=!0,ae=setTimeout$1(()=>{ie&&se&&ee(...se),oe=!1,se=void 0},re)},cancel:()=>{clearTimeout$1(ae),oe=!1,se=void 0}}}function noop$2(){}function generateUUID(ee){return ee?(parseInt(ee,10)^Math.random()*16>>parseInt(ee,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,generateUUID)}const COMMA_SEPARATED_KEY_VALUE=/([\w-]+)\s*=\s*([^;]+)/g;function findCommaSeparatedValue(ee,re){for(COMMA_SEPARATED_KEY_VALUE.lastIndex=0;;){const te=COMMA_SEPARATED_KEY_VALUE.exec(ee);if(te){if(te[1]===re)return te[2]}else break}}function findCommaSeparatedValues(ee){const re=new Map;for(COMMA_SEPARATED_KEY_VALUE.lastIndex=0;;){const te=COMMA_SEPARATED_KEY_VALUE.exec(ee);if(te)re.set(te[1],te[2]);else break}return re}function safeTruncate(ee,re,te=""){const ne=ee.charCodeAt(re-1),oe=ne>=55296&&ne<=56319?re+1:re;return ee.length<=oe?ee:`${ee.slice(0,oe)}${te}`}function isChromium(){return detectBrowserCached()===0}function isSafari(){return detectBrowserCached()===1}let browserCache;function detectBrowserCached(){return browserCache??(browserCache=detectBrowser())}function detectBrowser(ee=window){var re;const te=ee.navigator.userAgent;return ee.chrome||/HeadlessChrome/.test(te)?0:((re=ee.navigator.vendor)===null||re===void 0?void 0:re.indexOf("Apple"))===0||/safari/i.test(te)&&!/chrome|android/i.test(te)?1:2}function setCookie(ee,re,te=0,ne){const ie=new Date;ie.setTime(ie.getTime()+te);const oe=`expires=${ie.toUTCString()}`,se=ne&&ne.crossSite?"none":"strict",ae=ne&&ne.domain?`;domain=${ne.domain}`:"",ue=ne&&ne.secure?";secure":"",ce=ne&&ne.partitioned?";partitioned":"";document.cookie=`${ee}=${re};${oe};path=/;samesite=${se}${ae}${ue}${ce}`}function getCookie(ee){return findCommaSeparatedValue(document.cookie,ee)}let initCookieParsed;function getInitCookie(ee){return initCookieParsed||(initCookieParsed=findCommaSeparatedValues(document.cookie)),initCookieParsed.get(ee)}function deleteCookie(ee,re){setCookie(ee,"",0,re)}function areCookiesAuthorized(ee){if(document.cookie===void 0||document.cookie===null)return!1;try{const re=`dd_cookie_test_${generateUUID()}`,te="test";setCookie(re,te,ONE_MINUTE,ee);const ne=getCookie(re)===te;return deleteCookie(re,ee),ne}catch(re){return display.error(re),!1}}let getCurrentSiteCache;function getCurrentSite(){if(getCurrentSiteCache===void 0){const ee=`dd_site_test_${generateUUID()}`,re="test",te=window.location.hostname.split(".");let ne=te.pop();for(;te.length&&!getCookie(ee);)ne=`${te.pop()}.${ne}`,setCookie(ee,re,ONE_SECOND,{domain:ne});deleteCookie(ee,{domain:ne}),getCurrentSiteCache=ne}return getCurrentSiteCache}const SESSION_STORE_KEY="_dd_s";function findLast(ee,re){for(let te=ee.length-1;te>=0;te-=1){const ne=ee[te];if(re(ne,te,ee))return ne}}function objectValues(ee){return Object.values(ee)}function objectEntries(ee){return Object.entries(ee)}const SESSION_TIME_OUT_DELAY=4*ONE_HOUR,SESSION_EXPIRATION_DELAY=15*ONE_MINUTE,SESSION_COOKIE_EXPIRATION_DELAY=ONE_YEAR,SessionPersistence={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},SESSION_ENTRY_REGEXP=/^([a-zA-Z]+)=([a-z0-9-]+)$/,SESSION_ENTRY_SEPARATOR="&";function isValidSessionString(ee){return!!ee&&(ee.indexOf(SESSION_ENTRY_SEPARATOR)!==-1||SESSION_ENTRY_REGEXP.test(ee))}const EXPIRED="1";function getExpiredSessionState(ee,re){const te={isExpired:EXPIRED};return re.trackAnonymousUser&&(ee!=null&&ee.anonymousId?te.anonymousId=ee==null?void 0:ee.anonymousId:te.anonymousId=generateUUID()),te}function isSessionInNotStartedState(ee){return isEmptyObject$1(ee)}function isSessionStarted(ee){return!isSessionInNotStartedState(ee)}function isSessionInExpiredState(ee){return ee.isExpired!==void 0||!isActiveSession(ee)}function isActiveSession(ee){return(ee.created===void 0||dateNow()-Number(ee.created)<SESSION_TIME_OUT_DELAY)&&(ee.expire===void 0||dateNow()<Number(ee.expire))}function expandSessionState(ee){ee.expire=String(dateNow()+SESSION_EXPIRATION_DELAY)}function toSessionString(ee){return objectEntries(ee).map(([re,te])=>re==="anonymousId"?`aid=${te}`:`${re}=${te}`).join(SESSION_ENTRY_SEPARATOR)}function toSessionState(ee){const re={};return isValidSessionString(ee)&&ee.split(SESSION_ENTRY_SEPARATOR).forEach(te=>{const ne=SESSION_ENTRY_REGEXP.exec(te);if(ne!==null){const[,ie,oe]=ne;ie==="aid"?re.anonymousId=oe:re[ie]=oe}}),re}const OLD_SESSION_COOKIE_NAME="_dd",OLD_RUM_COOKIE_NAME="_dd_r",OLD_LOGS_COOKIE_NAME="_dd_l",RUM_SESSION_KEY$1="rum",LOGS_SESSION_KEY="logs";function tryOldCookiesMigration(ee){if(!getInitCookie(SESSION_STORE_KEY)){const te=getInitCookie(OLD_SESSION_COOKIE_NAME),ne=getInitCookie(OLD_RUM_COOKIE_NAME),ie=getInitCookie(OLD_LOGS_COOKIE_NAME),oe={};te&&(oe.id=te),ie&&/^[01]$/.test(ie)&&(oe[LOGS_SESSION_KEY]=ie),ne&&/^[012]$/.test(ne)&&(oe[RUM_SESSION_KEY$1]=ne),isSessionStarted(oe)&&(expandSessionState(oe),ee.persistSession(oe))}}function selectCookieStrategy(ee){const re=buildCookieOptions(ee);return areCookiesAuthorized(re)?{type:SessionPersistence.COOKIE,cookieOptions:re}:void 0}function initCookieStrategy(ee,re){const te={isLockEnabled:isChromium(),persistSession:persistSessionCookie(re),retrieveSession:retrieveSessionCookie,expireSession:ne=>expireSessionCookie(re,ne,ee)};return tryOldCookiesMigration(te),te}function persistSessionCookie(ee){return re=>{setCookie(SESSION_STORE_KEY,toSessionString(re),SESSION_EXPIRATION_DELAY,ee)}}function expireSessionCookie(ee,re,te){const ne=getExpiredSessionState(re,te);setCookie(SESSION_STORE_KEY,toSessionString(ne),te.trackAnonymousUser?SESSION_COOKIE_EXPIRATION_DELAY:SESSION_TIME_OUT_DELAY,ee)}function retrieveSessionCookie(){const ee=getCookie(SESSION_STORE_KEY);return toSessionState(ee)}function buildCookieOptions(ee){const re={};return re.secure=!!ee.useSecureSessionCookie||!!ee.usePartitionedCrossSiteSessionCookie,re.crossSite=!!ee.usePartitionedCrossSiteSessionCookie,re.partitioned=!!ee.usePartitionedCrossSiteSessionCookie,ee.trackSessionAcrossSubdomains&&(re.domain=getCurrentSite()),re}const LOCAL_STORAGE_TEST_KEY="_dd_test_";function selectLocalStorageStrategy(){try{const ee=generateUUID(),re=`${LOCAL_STORAGE_TEST_KEY}${ee}`;localStorage.setItem(re,ee);const te=localStorage.getItem(re);return localStorage.removeItem(re),ee===te?{type:SessionPersistence.LOCAL_STORAGE}:void 0}catch{return}}function initLocalStorageStrategy(ee){return{isLockEnabled:!1,persistSession:persistInLocalStorage,retrieveSession:retrieveSessionFromLocalStorage,expireSession:re=>expireSessionFromLocalStorage(re,ee)}}function persistInLocalStorage(ee){localStorage.setItem(SESSION_STORE_KEY,toSessionString(ee))}function retrieveSessionFromLocalStorage(){const ee=localStorage.getItem(SESSION_STORE_KEY);return toSessionState(ee)}function expireSessionFromLocalStorage(ee,re){persistInLocalStorage(getExpiredSessionState(ee,re))}const LOCK_RETRY_DELAY=10,LOCK_MAX_TRIES=100,bufferedOperations=[];let ongoingOperations;function processSessionStoreOperations(ee,re,te=0){var ne;const{isLockEnabled:ie,persistSession:oe,expireSession:se}=re,ae=fe=>oe({...fe,lock:ce}),ue=()=>{const fe=re.retrieveSession(),he=fe.lock;return fe.lock&&delete fe.lock,{session:fe,lock:he}};if(ongoingOperations||(ongoingOperations=ee),ee!==ongoingOperations){bufferedOperations.push(ee);return}if(ie&&te>=LOCK_MAX_TRIES){next(re);return}let ce,le=ue();if(ie){if(le.lock){retryLater(ee,re,te);return}if(ce=generateUUID(),ae(le.session),le=ue(),le.lock!==ce){retryLater(ee,re,te);return}}let de=ee.process(le.session);if(ie&&(le=ue(),le.lock!==ce)){retryLater(ee,re,te);return}if(de&&(isSessionInExpiredState(de)?se(de):(expandSessionState(de),ie?ae(de):oe(de))),ie&&!(de&&isSessionInExpiredState(de))){if(le=ue(),le.lock!==ce){retryLater(ee,re,te);return}oe(le.session),de=le.session}(ne=ee.after)===null||ne===void 0||ne.call(ee,de||le.session),next(re)}function retryLater(ee,re,te){setTimeout$1(()=>{processSessionStoreOperations(ee,re,te+1)},LOCK_RETRY_DELAY)}function next(ee){ongoingOperations=void 0;const re=bufferedOperations.shift();re&&processSessionStoreOperations(re,ee)}const STORAGE_POLL_DELAY=ONE_SECOND;function selectSessionStoreStrategyType(ee){switch(ee.sessionPersistence){case SessionPersistence.COOKIE:return selectCookieStrategy(ee);case SessionPersistence.LOCAL_STORAGE:return selectLocalStorageStrategy();case void 0:{let re=selectCookieStrategy(ee);return!re&&ee.allowFallbackToLocalStorage&&(re=selectLocalStorageStrategy()),re}default:display.error(`Invalid session persistence '${String(ee.sessionPersistence)}'`)}}function startSessionStore(ee,re,te,ne){const ie=new Observable$1,oe=new Observable$1,se=new Observable$1,ae=ee.type===SessionPersistence.COOKIE?initCookieStrategy(re,ee.cookieOptions):initLocalStorageStrategy(re),{expireSession:ue}=ae,ce=setInterval$1(pe,STORAGE_POLL_DELAY);let le;me();const{throttled:de,cancel:fe}=throttle$2(()=>{processSessionStoreOperations({process:Se=>{if(isSessionInNotStartedState(Se))return;const Oe=ge(Se);return ye(Oe),Oe},after:Se=>{isSessionStarted(Se)&&!ve()&&Ie(Se),le=Se}},ae)},STORAGE_POLL_DELAY);function he(){processSessionStoreOperations({process:Se=>ve()?ge(Se):void 0},ae)}function pe(){processSessionStoreOperations({process:Se=>isSessionInExpiredState(Se)?getExpiredSessionState(Se,re):void 0,after:ge},ae)}function ge(Se){return isSessionInExpiredState(Se)&&(Se=getExpiredSessionState(Se,re)),ve()&&(be(Se)?_e():(se.notify({previousState:le,newState:Se}),le=Se)),Se}function me(){processSessionStoreOperations({process:Se=>{if(isSessionInNotStartedState(Se))return getExpiredSessionState(Se,re)},after:Se=>{le=Se}},ae)}function ye(Se){if(isSessionInNotStartedState(Se))return!1;const{trackingType:Oe,isTracked:Ce}=ne(Se[te]);Se[te]=Oe,delete Se.isExpired,Ce&&!Se.id&&(Se.id=generateUUID(),Se.created=String(dateNow()))}function ve(){return le[te]!==void 0}function be(Se){return le.id!==Se.id||le[te]!==Se[te]}function _e(){le=getExpiredSessionState(le,re),oe.notify()}function Ie(Se){le=Se,ie.notify()}function Te(Se){processSessionStoreOperations({process:Oe=>({...Oe,...Se}),after:ge},ae)}return{expandOrRenewSession:de,expandSession:he,getSession:()=>le,renewObservable:ie,expireObservable:oe,sessionStateUpdateObservable:se,restartSession:me,expire:()=>{fe(),ue(le),ge(getExpiredSessionState(le,re))},stop:()=>{clearInterval$1(ce)},updateSessionState:Te}}const TrackingConsent={GRANTED:"granted",NOT_GRANTED:"not-granted"};function createTrackingConsentState(ee){const re=new Observable$1;return{tryToInit(te){ee||(ee=te)},update(te){ee=te,re.notify()},isGranted(){return ee===TrackingConsent.GRANTED},observable:re}}function jsonStringify(ee,re,te){if(typeof ee!="object"||ee===null)return JSON.stringify(ee);const ne=detachToJsonMethod(Object.prototype),ie=detachToJsonMethod(Array.prototype),oe=detachToJsonMethod(Object.getPrototypeOf(ee)),se=detachToJsonMethod(ee);try{return JSON.stringify(ee,re,te)}catch{return"<error: unable to serialize object>"}finally{ne(),ie(),oe(),se()}}function detachToJsonMethod(ee){const re=ee,te=re.toJSON;return te?(delete re.toJSON,()=>{re.toJSON=te}):noop$2}function normalizeUrl(ee){return buildUrl(ee,location.href).href}function isValidUrl(ee){try{return!!buildUrl(ee)}catch{return!1}}function getPathName(ee){const re=buildUrl(ee).pathname;return re[0]==="/"?re:`/${re}`}function buildUrl(ee,re){const te=getSupportedUrl();if(te)try{return re!==void 0?new te(ee,re):new te(ee)}catch(oe){throw new Error(`Failed to construct URL: ${String(oe)} ${jsonStringify({url:ee,base:re})}`)}if(re===void 0&&!/:/.test(ee))throw new Error(`Invalid URL: '${ee}'`);let ne=document;const ie=ne.createElement("a");if(re!==void 0){ne=document.implementation.createHTMLDocument("");const oe=ne.createElement("base");oe.href=re,ne.head.appendChild(oe),ne.body.appendChild(ie)}return ie.href=ee,ie}const originalURL=URL;let isURLSupported;function getSupportedUrl(){if(isURLSupported===void 0)try{isURLSupported=new originalURL("http://test/path").href==="http://test/path"}catch{isURLSupported=!1}return isURLSupported?originalURL:void 0}const INTAKE_SITE_STAGING="datad0g.com",INTAKE_SITE_FED_STAGING="dd0g-gov.com",INTAKE_SITE_US1="datadoghq.com",INTAKE_SITE_EU1="datadoghq.eu",INTAKE_SITE_US1_FED="ddog-gov.com",PCI_INTAKE_HOST_US1="pci.browser-intake-datadoghq.com",INTAKE_URL_PARAMETERS=["ddsource","ddtags"];function createEndpointBuilder(ee,re,te){const ne=createEndpointUrlWithParametersBuilder(ee,re);return{build(ie,oe){const se=buildEndpointParameters(ee,re,te,ie,oe);return ne(se)},tags:te,urlPrefix:ne(""),trackType:re}}function createEndpointUrlWithParametersBuilder(ee,re){const te=`/api/v2/${re}`,ne=ee.proxy;if(typeof ne=="string"){const oe=normalizeUrl(ne);return se=>`${oe}?ddforward=${encodeURIComponent(`${te}?${se}`)}`}if(typeof ne=="function")return oe=>ne({path:te,parameters:oe});const ie=buildEndpointHost(re,ee);return oe=>`https://${ie}${te}?${oe}`}function buildEndpointHost(ee,re){const{site:te=INTAKE_SITE_US1,internalAnalyticsSubdomain:ne}=re;if(ee==="logs"&&re.usePciIntake&&te===INTAKE_SITE_US1)return PCI_INTAKE_HOST_US1;if(ne&&te===INTAKE_SITE_US1)return`${ne}.${INTAKE_SITE_US1}`;if(te===INTAKE_SITE_FED_STAGING)return`http-intake.logs.${te}`;const ie=te.split("."),oe=ie.pop();return`browser-intake-${ie.join("-")}.${oe}`}function buildEndpointParameters({clientToken:ee,internalAnalyticsSubdomain:re},te,ne,ie,{retry:oe,encoding:se}){const ae=["sdk_version:6.6.3",`api:${ie}`].concat(ne);oe&&ae.push(`retry_count:${oe.count}`,`retry_after:${oe.lastFailureStatus}`);const ue=["ddsource=browser",`ddtags=${encodeURIComponent(ae.join(","))}`,`dd-api-key=${ee}`,`dd-evp-origin-version=${encodeURIComponent("6.6.3")}`,"dd-evp-origin=browser",`dd-request-id=${generateUUID()}`];return se&&ue.push(`dd-evp-encoding=${se}`),te==="rum"&&ue.push(`batch_time=${timeStampNow()}`),re&&ue.reverse(),ue.join("&")}const TAG_SIZE_LIMIT=200;function buildTags(ee){const{env:re,service:te,version:ne,datacenter:ie}=ee,oe=[];return re&&oe.push(buildTag("env",re)),te&&oe.push(buildTag("service",te)),ne&&oe.push(buildTag("version",ne)),ie&&oe.push(buildTag("datacenter",ie)),oe}function buildTag(ee,re){const te=TAG_SIZE_LIMIT-ee.length-1;(re.length>te||hasForbiddenCharacters(re))&&display.warn(`${ee} value doesn't meet tag requirements and will be sanitized. ${MORE_DETAILS} ${DOCS_ORIGIN}/getting_started/tagging/#defining-tags`);const ne=re.replace(/,/g,"_");return`${ee}:${ne}`}function hasForbiddenCharacters(ee){return supportUnicodePropertyEscapes()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(ee):!1}function supportUnicodePropertyEscapes(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function computeTransportConfiguration(ee){const re=ee.site||INTAKE_SITE_US1,te=buildTags(ee),ne=computeEndpointBuilders(ee,te);return{replica:computeReplicaConfiguration(ee,te),site:re,...ne}}function computeEndpointBuilders(ee,re){return{logsEndpointBuilder:createEndpointBuilder(ee,"logs",re),rumEndpointBuilder:createEndpointBuilder(ee,"rum",re),profilingEndpointBuilder:createEndpointBuilder(ee,"profile",re),sessionReplayEndpointBuilder:createEndpointBuilder(ee,"replay",re)}}function computeReplicaConfiguration(ee,re){if(!ee.replica)return;const te={...ee,site:INTAKE_SITE_US1,clientToken:ee.replica.clientToken},ne={logsEndpointBuilder:createEndpointBuilder(te,"logs",re),rumEndpointBuilder:createEndpointBuilder(te,"rum",re)};return{applicationId:ee.replica.applicationId,...ne}}function isIntakeUrl(ee){return INTAKE_URL_PARAMETERS.every(re=>ee.includes(re))}const DefaultPrivacyLevel={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},TraceContextInjection={ALL:"all",SAMPLED:"sampled"};function isString$1(ee,re){return ee!=null&&typeof ee!="string"?(display.error(`${re} must be defined as a string`),!1):!0}function isDatadogSite(ee){return ee&&typeof ee=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(ee)?(display.error(`Site should be a valid Datadog site. ${MORE_DETAILS} ${DOCS_ORIGIN}/getting_started/site/.`),!1):!0}function isSampleRate(ee,re){return ee!==void 0&&!isPercentage(ee)?(display.error(`${re} Sample Rate should be a number between 0 and 100`),!1):!0}function validateAndBuildConfiguration(ee){var re,te,ne,ie,oe,se;if(!ee||!ee.clientToken){display.error("Client Token is not configured, we will not send any data.");return}if(!(!isDatadogSite(ee.site)||!isSampleRate(ee.sessionSampleRate,"Session")||!isSampleRate(ee.telemetrySampleRate,"Telemetry")||!isSampleRate(ee.telemetryConfigurationSampleRate,"Telemetry Configuration")||!isSampleRate(ee.telemetryUsageSampleRate,"Telemetry Usage")||!isString$1(ee.version,"Version")||!isString$1(ee.env,"Env")||!isString$1(ee.service,"Service"))){if(ee.trackingConsent!==void 0&&!objectHasValue(TrackingConsent,ee.trackingConsent)){display.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:ee.beforeSend&&catchUserErrors(ee.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:selectSessionStoreStrategyType(ee),sessionSampleRate:(re=ee.sessionSampleRate)!==null&&re!==void 0?re:100,telemetrySampleRate:(te=ee.telemetrySampleRate)!==null&&te!==void 0?te:20,telemetryConfigurationSampleRate:(ne=ee.telemetryConfigurationSampleRate)!==null&&ne!==void 0?ne:5,telemetryUsageSampleRate:(ie=ee.telemetryUsageSampleRate)!==null&&ie!==void 0?ie:5,service:ee.service||void 0,silentMultipleInit:!!ee.silentMultipleInit,allowUntrustedEvents:!!ee.allowUntrustedEvents,trackingConsent:(oe=ee.trackingConsent)!==null&&oe!==void 0?oe:TrackingConsent.GRANTED,trackAnonymousUser:(se=ee.trackAnonymousUser)!==null&&se!==void 0?se:!0,storeContextsAcrossPages:!!ee.storeContextsAcrossPages,batchBytesLimit:16*ONE_KIBI_BYTE,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*ONE_SECOND,batchMessagesLimit:50,messageBytesLimit:256*ONE_KIBI_BYTE,...computeTransportConfiguration(ee)}}}function serializeConfiguration(ee){return{session_sample_rate:ee.sessionSampleRate,telemetry_sample_rate:ee.telemetrySampleRate,telemetry_configuration_sample_rate:ee.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:ee.telemetryUsageSampleRate,use_before_send:!!ee.beforeSend,use_partitioned_cross_site_session_cookie:ee.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:ee.useSecureSessionCookie,use_proxy:!!ee.proxy,silent_multiple_init:ee.silentMultipleInit,track_session_across_subdomains:ee.trackSessionAcrossSubdomains,track_anonymous_user:ee.trackAnonymousUser,session_persistence:ee.sessionPersistence,allow_fallback_to_local_storage:!!ee.allowFallbackToLocalStorage,store_contexts_across_pages:!!ee.storeContextsAcrossPages,allow_untrusted_events:!!ee.allowUntrustedEvents,tracking_consent:ee.trackingConsent}}var ExperimentalFeature;(function(ee){ee.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",ee.MISSING_URL_CONTEXT_TELEMETRY="missing_url_context_telemetry",ee.USER_ACCOUNT_TRACE_HEADER="user_account_trace_header",ee.PROFILING="profiling"})(ExperimentalFeature||(ExperimentalFeature={}));const enabledExperimentalFeatures=new Set;function initFeatureFlags(ee){Array.isArray(ee)&&addExperimentalFeatures(ee.filter(re=>objectHasValue(ExperimentalFeature,re)))}function addExperimentalFeatures(ee){ee.forEach(re=>{enabledExperimentalFeatures.add(re)})}function isExperimentalFeatureEnabled(ee){return enabledExperimentalFeatures.has(ee)}function getExperimentalFeatures(){return enabledExperimentalFeatures}const UNKNOWN_FUNCTION="?";function computeStackTrace(ee){const re=[];let te=tryToGetString(ee,"stack");const ne=String(ee);return te&&te.startsWith(ne)&&(te=te.slice(ne.length)),te&&te.split(`
|
|
225
|
+
`;class LoadingSuccess extends Component{constructor({text:re,delay:te,onSuccess:ne}){super({tag:"div",styles:()=>getLoadingSuccessStyles()});const ie=new Loading({size:12,color:ThemeManager.getStyles().textPrimaryColor}).element,oe=new Typography({text:re??AstroPayI18n.translate("almost_done"),size:"xSmall"}).element;this.element.append(ie,oe),setTimeout(()=>{ne(),this.element.remove()},te??5e3)}}const RUNTIME_CONFIG={test:{NAME:"@astropay/payments-lib",VERSION:"2.0.9",MODE:"test",API_BASE_URL:"https://partners-api-tst.astropay.com/api",RESOURCES_BUCKET:"https://rs-tst.astropay.com",CHECKOUT_URL:"https://checkout-tst.astropay.com",SINGULAR_LINK_URL:"https://astropay-tst.sng.link/Eftaj/ovlnu?_smtype=3",SINGULAR_LINK_PREFIX:"apcmobiletst://"},sandbox:{NAME:"@astropay/payments-lib",VERSION:"2.0.9",MODE:"staging",API_BASE_URL:"https://partners-api-sandbox.astropay.com/api",RESOURCES_BUCKET:"https://rs-tst.astropay.com",CHECKOUT_URL:"https://checkout-sandbox.astropay.com",SINGULAR_LINK_URL:"https://astropay-stg.sng.link/Ezzoz/nfnj?_smtype=3",SINGULAR_LINK_PREFIX:"apcmobilestaging://"},production:{NAME:"@astropay/payments-lib",VERSION:"2.0.9",MODE:"production",API_BASE_URL:"https://partners-api.astropay.com/api",RESOURCES_BUCKET:"https://rs.astropay.com",CHECKOUT_URL:"https://checkout.astropay.com",SINGULAR_LINK_URL:"https://astropay.sng.link/E2h2a/jqze?_smtype=3",SINGULAR_LINK_PREFIX:"apcmobile://"}};var EStorageKey=(ee=>(ee.SESSION_ID="session_id",ee))(EStorageKey||{});const Jr=class Jr{static init(re){const te=validateValue(re==null?void 0:re.environment,[...CONFIG_ENVIRONMENT_VALUES,"test"],"production"),ne=validateValue(re==null?void 0:re.currencyMode,CONFIG_CURRENCY_MODE_VALUES,"iso");Jr.environment=te,Jr.currencyMode=ne}static getRuntimeConfig(){const re=Jr.environment||"production";return RUNTIME_CONFIG[re]}static getEnvironment(){return Jr.environment}static getCurrencyMode(){return Jr.currencyMode}};xe(Jr,"environment"),xe(Jr,"currencyMode");let AstroPayConfig=Jr;const ConsoleApiName={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},globalConsole=console,originalConsoleMethods={};Object.keys(ConsoleApiName).forEach(ee=>{originalConsoleMethods[ee]=globalConsole[ee]});const PREFIX$1="Datadog Browser SDK:",display={debug:originalConsoleMethods.debug.bind(globalConsole,PREFIX$1),log:originalConsoleMethods.log.bind(globalConsole,PREFIX$1),info:originalConsoleMethods.info.bind(globalConsole,PREFIX$1),warn:originalConsoleMethods.warn.bind(globalConsole,PREFIX$1),error:originalConsoleMethods.error.bind(globalConsole,PREFIX$1)},DOCS_ORIGIN="https://docs.datadoghq.com",DOCS_TROUBLESHOOTING=`${DOCS_ORIGIN}/real_user_monitoring/browser/troubleshooting`,MORE_DETAILS="More details:";function catchUserErrors(ee,re){return(...te)=>{try{return ee(...te)}catch(ne){display.error(re,ne)}}}function performDraw(ee){return ee!==0&&Math.random()*100<=ee}function round(ee,re){return+ee.toFixed(re)}function isPercentage(ee){return isNumber$1(ee)&&ee>=0&&ee<=100}function isNumber$1(ee){return typeof ee=="number"}const ONE_SECOND=1e3,ONE_MINUTE=60*ONE_SECOND,ONE_HOUR=60*ONE_MINUTE,ONE_DAY=24*ONE_HOUR,ONE_YEAR=365*ONE_DAY;function relativeToClocks(ee){return{relative:ee,timeStamp:getCorrectedTimeStamp(ee)}}function timeStampToClocks(ee){return{relative:getRelativeTime(ee),timeStamp:ee}}function getCorrectedTimeStamp(ee){const re=dateNow()-performance.now();return re>getNavigationStart()?Math.round(addDuration(re,ee)):getTimeStamp(ee)}function currentDrift(){return Math.round(dateNow()-addDuration(getNavigationStart(),performance.now()))}function toServerDuration(ee){return isNumber$1(ee)?round(ee*1e6,0):ee}function dateNow(){return new Date().getTime()}function timeStampNow(){return dateNow()}function relativeNow(){return performance.now()}function clocksNow(){return{relative:relativeNow(),timeStamp:timeStampNow()}}function clocksOrigin(){return{relative:0,timeStamp:getNavigationStart()}}function elapsed(ee,re){return re-ee}function addDuration(ee,re){return ee+re}function getRelativeTime(ee){return ee-getNavigationStart()}function getTimeStamp(ee){return Math.round(addDuration(getNavigationStart(),ee))}function looksLikeRelativeTime(ee){return ee<ONE_YEAR}let navigationStart;function getNavigationStart(){return navigationStart===void 0&&(navigationStart=performance.timing.navigationStart),navigationStart}const ONE_KIBI_BYTE=1024,ONE_MEBI_BYTE=1024*ONE_KIBI_BYTE,HAS_MULTI_BYTES_CHARACTERS=/[^\u0000-\u007F]/;function computeBytesCount(ee){return HAS_MULTI_BYTES_CHARACTERS.test(ee)?window.TextEncoder!==void 0?new TextEncoder().encode(ee).length:new Blob([ee]).size:ee.length}function concatBuffers(ee){const re=ee.reduce((ie,oe)=>ie+oe.length,0),te=new Uint8Array(re);let ne=0;for(const ie of ee)te.set(ie,ne),ne+=ie.length;return te}function shallowClone(ee){return{...ee}}function objectHasValue(ee,re){return Object.keys(ee).some(te=>ee[te]===re)}function isEmptyObject$1(ee){return Object.keys(ee).length===0}function mapValues(ee,re){const te={};for(const ne of Object.keys(ee))te[ne]=re(ee[ne]);return te}function getGlobalObject(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let ee=_dd_temp_;return delete Object.prototype._dd_temp_,typeof ee!="object"&&(typeof self=="object"?ee=self:typeof window=="object"?ee=window:ee={}),ee}function getZoneJsOriginalValue(ee,re){const te=getGlobalObject();let ne;return te.Zone&&typeof te.Zone.__symbol__=="function"&&(ne=ee[te.Zone.__symbol__(re)]),ne||(ne=ee[re]),ne}let onMonitorErrorCollected,debugMode=!1;function startMonitorErrorCollection(ee){onMonitorErrorCollected=ee}function setDebugMode(ee){debugMode=ee}function monitor(ee){return function(){return callMonitored(ee,this,arguments)}}function callMonitored(ee,re,te){try{return ee.apply(re,te)}catch(ne){monitorError(ne)}}function monitorError(ee){if(displayIfDebugEnabled(ee),onMonitorErrorCollected)try{onMonitorErrorCollected(ee)}catch(re){displayIfDebugEnabled(re)}}function displayIfDebugEnabled(...ee){debugMode&&display.error("[MONITOR]",...ee)}function setTimeout$1(ee,re){return getZoneJsOriginalValue(getGlobalObject(),"setTimeout")(monitor(ee),re)}function clearTimeout$1(ee){getZoneJsOriginalValue(getGlobalObject(),"clearTimeout")(ee)}function setInterval$1(ee,re){return getZoneJsOriginalValue(getGlobalObject(),"setInterval")(monitor(ee),re)}function clearInterval$1(ee){getZoneJsOriginalValue(getGlobalObject(),"clearInterval")(ee)}let Observable$1=class{constructor(re){this.onFirstSubscribe=re,this.observers=[]}subscribe(re){return this.observers.push(re),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter(te=>re!==te),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(re){this.observers.forEach(te=>te(re))}};function mergeObservables(...ee){return new Observable$1(re=>{const te=ee.map(ne=>ne.subscribe(ie=>re.notify(ie)));return()=>te.forEach(ne=>ne.unsubscribe())})}function throttle$2(ee,re,te){const ne=te&&te.leading!==void 0?te.leading:!0,ie=te&&te.trailing!==void 0?te.trailing:!0;let oe=!1,se,ae;return{throttled:(...ue)=>{if(oe){se=ue;return}ne?ee(...ue):se=ue,oe=!0,ae=setTimeout$1(()=>{ie&&se&&ee(...se),oe=!1,se=void 0},re)},cancel:()=>{clearTimeout$1(ae),oe=!1,se=void 0}}}function noop$2(){}function generateUUID(ee){return ee?(parseInt(ee,10)^Math.random()*16>>parseInt(ee,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,generateUUID)}const COMMA_SEPARATED_KEY_VALUE=/([\w-]+)\s*=\s*([^;]+)/g;function findCommaSeparatedValue(ee,re){for(COMMA_SEPARATED_KEY_VALUE.lastIndex=0;;){const te=COMMA_SEPARATED_KEY_VALUE.exec(ee);if(te){if(te[1]===re)return te[2]}else break}}function findCommaSeparatedValues(ee){const re=new Map;for(COMMA_SEPARATED_KEY_VALUE.lastIndex=0;;){const te=COMMA_SEPARATED_KEY_VALUE.exec(ee);if(te)re.set(te[1],te[2]);else break}return re}function safeTruncate(ee,re,te=""){const ne=ee.charCodeAt(re-1),oe=ne>=55296&&ne<=56319?re+1:re;return ee.length<=oe?ee:`${ee.slice(0,oe)}${te}`}function isChromium(){return detectBrowserCached()===0}function isSafari(){return detectBrowserCached()===1}let browserCache;function detectBrowserCached(){return browserCache??(browserCache=detectBrowser())}function detectBrowser(ee=window){var re;const te=ee.navigator.userAgent;return ee.chrome||/HeadlessChrome/.test(te)?0:((re=ee.navigator.vendor)===null||re===void 0?void 0:re.indexOf("Apple"))===0||/safari/i.test(te)&&!/chrome|android/i.test(te)?1:2}function setCookie(ee,re,te=0,ne){const ie=new Date;ie.setTime(ie.getTime()+te);const oe=`expires=${ie.toUTCString()}`,se=ne&&ne.crossSite?"none":"strict",ae=ne&&ne.domain?`;domain=${ne.domain}`:"",ue=ne&&ne.secure?";secure":"",ce=ne&&ne.partitioned?";partitioned":"";document.cookie=`${ee}=${re};${oe};path=/;samesite=${se}${ae}${ue}${ce}`}function getCookie(ee){return findCommaSeparatedValue(document.cookie,ee)}let initCookieParsed;function getInitCookie(ee){return initCookieParsed||(initCookieParsed=findCommaSeparatedValues(document.cookie)),initCookieParsed.get(ee)}function deleteCookie(ee,re){setCookie(ee,"",0,re)}function areCookiesAuthorized(ee){if(document.cookie===void 0||document.cookie===null)return!1;try{const re=`dd_cookie_test_${generateUUID()}`,te="test";setCookie(re,te,ONE_MINUTE,ee);const ne=getCookie(re)===te;return deleteCookie(re,ee),ne}catch(re){return display.error(re),!1}}let getCurrentSiteCache;function getCurrentSite(){if(getCurrentSiteCache===void 0){const ee=`dd_site_test_${generateUUID()}`,re="test",te=window.location.hostname.split(".");let ne=te.pop();for(;te.length&&!getCookie(ee);)ne=`${te.pop()}.${ne}`,setCookie(ee,re,ONE_SECOND,{domain:ne});deleteCookie(ee,{domain:ne}),getCurrentSiteCache=ne}return getCurrentSiteCache}const SESSION_STORE_KEY="_dd_s";function findLast(ee,re){for(let te=ee.length-1;te>=0;te-=1){const ne=ee[te];if(re(ne,te,ee))return ne}}function objectValues(ee){return Object.values(ee)}function objectEntries(ee){return Object.entries(ee)}const SESSION_TIME_OUT_DELAY=4*ONE_HOUR,SESSION_EXPIRATION_DELAY=15*ONE_MINUTE,SESSION_COOKIE_EXPIRATION_DELAY=ONE_YEAR,SessionPersistence={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},SESSION_ENTRY_REGEXP=/^([a-zA-Z]+)=([a-z0-9-]+)$/,SESSION_ENTRY_SEPARATOR="&";function isValidSessionString(ee){return!!ee&&(ee.indexOf(SESSION_ENTRY_SEPARATOR)!==-1||SESSION_ENTRY_REGEXP.test(ee))}const EXPIRED="1";function getExpiredSessionState(ee,re){const te={isExpired:EXPIRED};return re.trackAnonymousUser&&(ee!=null&&ee.anonymousId?te.anonymousId=ee==null?void 0:ee.anonymousId:te.anonymousId=generateUUID()),te}function isSessionInNotStartedState(ee){return isEmptyObject$1(ee)}function isSessionStarted(ee){return!isSessionInNotStartedState(ee)}function isSessionInExpiredState(ee){return ee.isExpired!==void 0||!isActiveSession(ee)}function isActiveSession(ee){return(ee.created===void 0||dateNow()-Number(ee.created)<SESSION_TIME_OUT_DELAY)&&(ee.expire===void 0||dateNow()<Number(ee.expire))}function expandSessionState(ee){ee.expire=String(dateNow()+SESSION_EXPIRATION_DELAY)}function toSessionString(ee){return objectEntries(ee).map(([re,te])=>re==="anonymousId"?`aid=${te}`:`${re}=${te}`).join(SESSION_ENTRY_SEPARATOR)}function toSessionState(ee){const re={};return isValidSessionString(ee)&&ee.split(SESSION_ENTRY_SEPARATOR).forEach(te=>{const ne=SESSION_ENTRY_REGEXP.exec(te);if(ne!==null){const[,ie,oe]=ne;ie==="aid"?re.anonymousId=oe:re[ie]=oe}}),re}const OLD_SESSION_COOKIE_NAME="_dd",OLD_RUM_COOKIE_NAME="_dd_r",OLD_LOGS_COOKIE_NAME="_dd_l",RUM_SESSION_KEY$1="rum",LOGS_SESSION_KEY="logs";function tryOldCookiesMigration(ee){if(!getInitCookie(SESSION_STORE_KEY)){const te=getInitCookie(OLD_SESSION_COOKIE_NAME),ne=getInitCookie(OLD_RUM_COOKIE_NAME),ie=getInitCookie(OLD_LOGS_COOKIE_NAME),oe={};te&&(oe.id=te),ie&&/^[01]$/.test(ie)&&(oe[LOGS_SESSION_KEY]=ie),ne&&/^[012]$/.test(ne)&&(oe[RUM_SESSION_KEY$1]=ne),isSessionStarted(oe)&&(expandSessionState(oe),ee.persistSession(oe))}}function selectCookieStrategy(ee){const re=buildCookieOptions(ee);return areCookiesAuthorized(re)?{type:SessionPersistence.COOKIE,cookieOptions:re}:void 0}function initCookieStrategy(ee,re){const te={isLockEnabled:isChromium(),persistSession:persistSessionCookie(re),retrieveSession:retrieveSessionCookie,expireSession:ne=>expireSessionCookie(re,ne,ee)};return tryOldCookiesMigration(te),te}function persistSessionCookie(ee){return re=>{setCookie(SESSION_STORE_KEY,toSessionString(re),SESSION_EXPIRATION_DELAY,ee)}}function expireSessionCookie(ee,re,te){const ne=getExpiredSessionState(re,te);setCookie(SESSION_STORE_KEY,toSessionString(ne),te.trackAnonymousUser?SESSION_COOKIE_EXPIRATION_DELAY:SESSION_TIME_OUT_DELAY,ee)}function retrieveSessionCookie(){const ee=getCookie(SESSION_STORE_KEY);return toSessionState(ee)}function buildCookieOptions(ee){const re={};return re.secure=!!ee.useSecureSessionCookie||!!ee.usePartitionedCrossSiteSessionCookie,re.crossSite=!!ee.usePartitionedCrossSiteSessionCookie,re.partitioned=!!ee.usePartitionedCrossSiteSessionCookie,ee.trackSessionAcrossSubdomains&&(re.domain=getCurrentSite()),re}const LOCAL_STORAGE_TEST_KEY="_dd_test_";function selectLocalStorageStrategy(){try{const ee=generateUUID(),re=`${LOCAL_STORAGE_TEST_KEY}${ee}`;localStorage.setItem(re,ee);const te=localStorage.getItem(re);return localStorage.removeItem(re),ee===te?{type:SessionPersistence.LOCAL_STORAGE}:void 0}catch{return}}function initLocalStorageStrategy(ee){return{isLockEnabled:!1,persistSession:persistInLocalStorage,retrieveSession:retrieveSessionFromLocalStorage,expireSession:re=>expireSessionFromLocalStorage(re,ee)}}function persistInLocalStorage(ee){localStorage.setItem(SESSION_STORE_KEY,toSessionString(ee))}function retrieveSessionFromLocalStorage(){const ee=localStorage.getItem(SESSION_STORE_KEY);return toSessionState(ee)}function expireSessionFromLocalStorage(ee,re){persistInLocalStorage(getExpiredSessionState(ee,re))}const LOCK_RETRY_DELAY=10,LOCK_MAX_TRIES=100,bufferedOperations=[];let ongoingOperations;function processSessionStoreOperations(ee,re,te=0){var ne;const{isLockEnabled:ie,persistSession:oe,expireSession:se}=re,ae=fe=>oe({...fe,lock:ce}),ue=()=>{const fe=re.retrieveSession(),he=fe.lock;return fe.lock&&delete fe.lock,{session:fe,lock:he}};if(ongoingOperations||(ongoingOperations=ee),ee!==ongoingOperations){bufferedOperations.push(ee);return}if(ie&&te>=LOCK_MAX_TRIES){next(re);return}let ce,le=ue();if(ie){if(le.lock){retryLater(ee,re,te);return}if(ce=generateUUID(),ae(le.session),le=ue(),le.lock!==ce){retryLater(ee,re,te);return}}let de=ee.process(le.session);if(ie&&(le=ue(),le.lock!==ce)){retryLater(ee,re,te);return}if(de&&(isSessionInExpiredState(de)?se(de):(expandSessionState(de),ie?ae(de):oe(de))),ie&&!(de&&isSessionInExpiredState(de))){if(le=ue(),le.lock!==ce){retryLater(ee,re,te);return}oe(le.session),de=le.session}(ne=ee.after)===null||ne===void 0||ne.call(ee,de||le.session),next(re)}function retryLater(ee,re,te){setTimeout$1(()=>{processSessionStoreOperations(ee,re,te+1)},LOCK_RETRY_DELAY)}function next(ee){ongoingOperations=void 0;const re=bufferedOperations.shift();re&&processSessionStoreOperations(re,ee)}const STORAGE_POLL_DELAY=ONE_SECOND;function selectSessionStoreStrategyType(ee){switch(ee.sessionPersistence){case SessionPersistence.COOKIE:return selectCookieStrategy(ee);case SessionPersistence.LOCAL_STORAGE:return selectLocalStorageStrategy();case void 0:{let re=selectCookieStrategy(ee);return!re&&ee.allowFallbackToLocalStorage&&(re=selectLocalStorageStrategy()),re}default:display.error(`Invalid session persistence '${String(ee.sessionPersistence)}'`)}}function startSessionStore(ee,re,te,ne){const ie=new Observable$1,oe=new Observable$1,se=new Observable$1,ae=ee.type===SessionPersistence.COOKIE?initCookieStrategy(re,ee.cookieOptions):initLocalStorageStrategy(re),{expireSession:ue}=ae,ce=setInterval$1(pe,STORAGE_POLL_DELAY);let le;me();const{throttled:de,cancel:fe}=throttle$2(()=>{processSessionStoreOperations({process:Se=>{if(isSessionInNotStartedState(Se))return;const Oe=ge(Se);return ye(Oe),Oe},after:Se=>{isSessionStarted(Se)&&!ve()&&Ie(Se),le=Se}},ae)},STORAGE_POLL_DELAY);function he(){processSessionStoreOperations({process:Se=>ve()?ge(Se):void 0},ae)}function pe(){processSessionStoreOperations({process:Se=>isSessionInExpiredState(Se)?getExpiredSessionState(Se,re):void 0,after:ge},ae)}function ge(Se){return isSessionInExpiredState(Se)&&(Se=getExpiredSessionState(Se,re)),ve()&&(be(Se)?_e():(se.notify({previousState:le,newState:Se}),le=Se)),Se}function me(){processSessionStoreOperations({process:Se=>{if(isSessionInNotStartedState(Se))return getExpiredSessionState(Se,re)},after:Se=>{le=Se}},ae)}function ye(Se){if(isSessionInNotStartedState(Se))return!1;const{trackingType:Oe,isTracked:Ce}=ne(Se[te]);Se[te]=Oe,delete Se.isExpired,Ce&&!Se.id&&(Se.id=generateUUID(),Se.created=String(dateNow()))}function ve(){return le[te]!==void 0}function be(Se){return le.id!==Se.id||le[te]!==Se[te]}function _e(){le=getExpiredSessionState(le,re),oe.notify()}function Ie(Se){le=Se,ie.notify()}function Te(Se){processSessionStoreOperations({process:Oe=>({...Oe,...Se}),after:ge},ae)}return{expandOrRenewSession:de,expandSession:he,getSession:()=>le,renewObservable:ie,expireObservable:oe,sessionStateUpdateObservable:se,restartSession:me,expire:()=>{fe(),ue(le),ge(getExpiredSessionState(le,re))},stop:()=>{clearInterval$1(ce)},updateSessionState:Te}}const TrackingConsent={GRANTED:"granted",NOT_GRANTED:"not-granted"};function createTrackingConsentState(ee){const re=new Observable$1;return{tryToInit(te){ee||(ee=te)},update(te){ee=te,re.notify()},isGranted(){return ee===TrackingConsent.GRANTED},observable:re}}function jsonStringify(ee,re,te){if(typeof ee!="object"||ee===null)return JSON.stringify(ee);const ne=detachToJsonMethod(Object.prototype),ie=detachToJsonMethod(Array.prototype),oe=detachToJsonMethod(Object.getPrototypeOf(ee)),se=detachToJsonMethod(ee);try{return JSON.stringify(ee,re,te)}catch{return"<error: unable to serialize object>"}finally{ne(),ie(),oe(),se()}}function detachToJsonMethod(ee){const re=ee,te=re.toJSON;return te?(delete re.toJSON,()=>{re.toJSON=te}):noop$2}function normalizeUrl(ee){return buildUrl(ee,location.href).href}function isValidUrl(ee){try{return!!buildUrl(ee)}catch{return!1}}function getPathName(ee){const re=buildUrl(ee).pathname;return re[0]==="/"?re:`/${re}`}function buildUrl(ee,re){const te=getSupportedUrl();if(te)try{return re!==void 0?new te(ee,re):new te(ee)}catch(oe){throw new Error(`Failed to construct URL: ${String(oe)} ${jsonStringify({url:ee,base:re})}`)}if(re===void 0&&!/:/.test(ee))throw new Error(`Invalid URL: '${ee}'`);let ne=document;const ie=ne.createElement("a");if(re!==void 0){ne=document.implementation.createHTMLDocument("");const oe=ne.createElement("base");oe.href=re,ne.head.appendChild(oe),ne.body.appendChild(ie)}return ie.href=ee,ie}const originalURL=URL;let isURLSupported;function getSupportedUrl(){if(isURLSupported===void 0)try{isURLSupported=new originalURL("http://test/path").href==="http://test/path"}catch{isURLSupported=!1}return isURLSupported?originalURL:void 0}const INTAKE_SITE_STAGING="datad0g.com",INTAKE_SITE_FED_STAGING="dd0g-gov.com",INTAKE_SITE_US1="datadoghq.com",INTAKE_SITE_EU1="datadoghq.eu",INTAKE_SITE_US1_FED="ddog-gov.com",PCI_INTAKE_HOST_US1="pci.browser-intake-datadoghq.com",INTAKE_URL_PARAMETERS=["ddsource","ddtags"];function createEndpointBuilder(ee,re,te){const ne=createEndpointUrlWithParametersBuilder(ee,re);return{build(ie,oe){const se=buildEndpointParameters(ee,re,te,ie,oe);return ne(se)},tags:te,urlPrefix:ne(""),trackType:re}}function createEndpointUrlWithParametersBuilder(ee,re){const te=`/api/v2/${re}`,ne=ee.proxy;if(typeof ne=="string"){const oe=normalizeUrl(ne);return se=>`${oe}?ddforward=${encodeURIComponent(`${te}?${se}`)}`}if(typeof ne=="function")return oe=>ne({path:te,parameters:oe});const ie=buildEndpointHost(re,ee);return oe=>`https://${ie}${te}?${oe}`}function buildEndpointHost(ee,re){const{site:te=INTAKE_SITE_US1,internalAnalyticsSubdomain:ne}=re;if(ee==="logs"&&re.usePciIntake&&te===INTAKE_SITE_US1)return PCI_INTAKE_HOST_US1;if(ne&&te===INTAKE_SITE_US1)return`${ne}.${INTAKE_SITE_US1}`;if(te===INTAKE_SITE_FED_STAGING)return`http-intake.logs.${te}`;const ie=te.split("."),oe=ie.pop();return`browser-intake-${ie.join("-")}.${oe}`}function buildEndpointParameters({clientToken:ee,internalAnalyticsSubdomain:re},te,ne,ie,{retry:oe,encoding:se}){const ae=["sdk_version:6.6.3",`api:${ie}`].concat(ne);oe&&ae.push(`retry_count:${oe.count}`,`retry_after:${oe.lastFailureStatus}`);const ue=["ddsource=browser",`ddtags=${encodeURIComponent(ae.join(","))}`,`dd-api-key=${ee}`,`dd-evp-origin-version=${encodeURIComponent("6.6.3")}`,"dd-evp-origin=browser",`dd-request-id=${generateUUID()}`];return se&&ue.push(`dd-evp-encoding=${se}`),te==="rum"&&ue.push(`batch_time=${timeStampNow()}`),re&&ue.reverse(),ue.join("&")}const TAG_SIZE_LIMIT=200;function buildTags(ee){const{env:re,service:te,version:ne,datacenter:ie}=ee,oe=[];return re&&oe.push(buildTag("env",re)),te&&oe.push(buildTag("service",te)),ne&&oe.push(buildTag("version",ne)),ie&&oe.push(buildTag("datacenter",ie)),oe}function buildTag(ee,re){const te=TAG_SIZE_LIMIT-ee.length-1;(re.length>te||hasForbiddenCharacters(re))&&display.warn(`${ee} value doesn't meet tag requirements and will be sanitized. ${MORE_DETAILS} ${DOCS_ORIGIN}/getting_started/tagging/#defining-tags`);const ne=re.replace(/,/g,"_");return`${ee}:${ne}`}function hasForbiddenCharacters(ee){return supportUnicodePropertyEscapes()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(ee):!1}function supportUnicodePropertyEscapes(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function computeTransportConfiguration(ee){const re=ee.site||INTAKE_SITE_US1,te=buildTags(ee),ne=computeEndpointBuilders(ee,te);return{replica:computeReplicaConfiguration(ee,te),site:re,...ne}}function computeEndpointBuilders(ee,re){return{logsEndpointBuilder:createEndpointBuilder(ee,"logs",re),rumEndpointBuilder:createEndpointBuilder(ee,"rum",re),profilingEndpointBuilder:createEndpointBuilder(ee,"profile",re),sessionReplayEndpointBuilder:createEndpointBuilder(ee,"replay",re)}}function computeReplicaConfiguration(ee,re){if(!ee.replica)return;const te={...ee,site:INTAKE_SITE_US1,clientToken:ee.replica.clientToken},ne={logsEndpointBuilder:createEndpointBuilder(te,"logs",re),rumEndpointBuilder:createEndpointBuilder(te,"rum",re)};return{applicationId:ee.replica.applicationId,...ne}}function isIntakeUrl(ee){return INTAKE_URL_PARAMETERS.every(re=>ee.includes(re))}const DefaultPrivacyLevel={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},TraceContextInjection={ALL:"all",SAMPLED:"sampled"};function isString$1(ee,re){return ee!=null&&typeof ee!="string"?(display.error(`${re} must be defined as a string`),!1):!0}function isDatadogSite(ee){return ee&&typeof ee=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(ee)?(display.error(`Site should be a valid Datadog site. ${MORE_DETAILS} ${DOCS_ORIGIN}/getting_started/site/.`),!1):!0}function isSampleRate(ee,re){return ee!==void 0&&!isPercentage(ee)?(display.error(`${re} Sample Rate should be a number between 0 and 100`),!1):!0}function validateAndBuildConfiguration(ee){var re,te,ne,ie,oe,se;if(!ee||!ee.clientToken){display.error("Client Token is not configured, we will not send any data.");return}if(!(!isDatadogSite(ee.site)||!isSampleRate(ee.sessionSampleRate,"Session")||!isSampleRate(ee.telemetrySampleRate,"Telemetry")||!isSampleRate(ee.telemetryConfigurationSampleRate,"Telemetry Configuration")||!isSampleRate(ee.telemetryUsageSampleRate,"Telemetry Usage")||!isString$1(ee.version,"Version")||!isString$1(ee.env,"Env")||!isString$1(ee.service,"Service"))){if(ee.trackingConsent!==void 0&&!objectHasValue(TrackingConsent,ee.trackingConsent)){display.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:ee.beforeSend&&catchUserErrors(ee.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:selectSessionStoreStrategyType(ee),sessionSampleRate:(re=ee.sessionSampleRate)!==null&&re!==void 0?re:100,telemetrySampleRate:(te=ee.telemetrySampleRate)!==null&&te!==void 0?te:20,telemetryConfigurationSampleRate:(ne=ee.telemetryConfigurationSampleRate)!==null&&ne!==void 0?ne:5,telemetryUsageSampleRate:(ie=ee.telemetryUsageSampleRate)!==null&&ie!==void 0?ie:5,service:ee.service||void 0,silentMultipleInit:!!ee.silentMultipleInit,allowUntrustedEvents:!!ee.allowUntrustedEvents,trackingConsent:(oe=ee.trackingConsent)!==null&&oe!==void 0?oe:TrackingConsent.GRANTED,trackAnonymousUser:(se=ee.trackAnonymousUser)!==null&&se!==void 0?se:!0,storeContextsAcrossPages:!!ee.storeContextsAcrossPages,batchBytesLimit:16*ONE_KIBI_BYTE,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*ONE_SECOND,batchMessagesLimit:50,messageBytesLimit:256*ONE_KIBI_BYTE,...computeTransportConfiguration(ee)}}}function serializeConfiguration(ee){return{session_sample_rate:ee.sessionSampleRate,telemetry_sample_rate:ee.telemetrySampleRate,telemetry_configuration_sample_rate:ee.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:ee.telemetryUsageSampleRate,use_before_send:!!ee.beforeSend,use_partitioned_cross_site_session_cookie:ee.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:ee.useSecureSessionCookie,use_proxy:!!ee.proxy,silent_multiple_init:ee.silentMultipleInit,track_session_across_subdomains:ee.trackSessionAcrossSubdomains,track_anonymous_user:ee.trackAnonymousUser,session_persistence:ee.sessionPersistence,allow_fallback_to_local_storage:!!ee.allowFallbackToLocalStorage,store_contexts_across_pages:!!ee.storeContextsAcrossPages,allow_untrusted_events:!!ee.allowUntrustedEvents,tracking_consent:ee.trackingConsent}}var ExperimentalFeature;(function(ee){ee.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",ee.MISSING_URL_CONTEXT_TELEMETRY="missing_url_context_telemetry",ee.USER_ACCOUNT_TRACE_HEADER="user_account_trace_header",ee.PROFILING="profiling"})(ExperimentalFeature||(ExperimentalFeature={}));const enabledExperimentalFeatures=new Set;function initFeatureFlags(ee){Array.isArray(ee)&&addExperimentalFeatures(ee.filter(re=>objectHasValue(ExperimentalFeature,re)))}function addExperimentalFeatures(ee){ee.forEach(re=>{enabledExperimentalFeatures.add(re)})}function isExperimentalFeatureEnabled(ee){return enabledExperimentalFeatures.has(ee)}function getExperimentalFeatures(){return enabledExperimentalFeatures}const UNKNOWN_FUNCTION="?";function computeStackTrace(ee){const re=[];let te=tryToGetString(ee,"stack");const ne=String(ee);return te&&te.startsWith(ne)&&(te=te.slice(ne.length)),te&&te.split(`
|
|
226
226
|
`).forEach(ie=>{const oe=parseChromeLine(ie)||parseChromeAnonymousLine(ie)||parseWinLine(ie)||parseGeckoLine(ie);oe&&(!oe.func&&oe.line&&(oe.func=UNKNOWN_FUNCTION),re.push(oe))}),{message:tryToGetString(ee,"message"),name:tryToGetString(ee,"name"),stack:re}}const fileUrl="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",filePosition="(?::(\\d+))",CHROME_LINE_RE=new RegExp(`^\\s*at (.*?) ?\\(${fileUrl}${filePosition}?${filePosition}?\\)?\\s*$`,"i"),CHROME_EVAL_RE=new RegExp(`\\((\\S*)${filePosition}${filePosition}\\)`);function parseChromeLine(ee){const re=CHROME_LINE_RE.exec(ee);if(!re)return;const te=re[2]&&re[2].indexOf("native")===0,ne=re[2]&&re[2].indexOf("eval")===0,ie=CHROME_EVAL_RE.exec(re[2]);return ne&&ie&&(re[2]=ie[1],re[3]=ie[2],re[4]=ie[3]),{args:te?[re[2]]:[],column:re[4]?+re[4]:void 0,func:re[1]||UNKNOWN_FUNCTION,line:re[3]?+re[3]:void 0,url:te?void 0:re[2]}}const CHROME_ANONYMOUS_FUNCTION_RE=new RegExp(`^\\s*at ?${fileUrl}${filePosition}?${filePosition}??\\s*$`,"i");function parseChromeAnonymousLine(ee){const re=CHROME_ANONYMOUS_FUNCTION_RE.exec(ee);if(re)return{args:[],column:re[3]?+re[3]:void 0,func:UNKNOWN_FUNCTION,line:re[2]?+re[2]:void 0,url:re[1]}}const WINJS_LINE_RE=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function parseWinLine(ee){const re=WINJS_LINE_RE.exec(ee);if(re)return{args:[],column:re[4]?+re[4]:void 0,func:re[1]||UNKNOWN_FUNCTION,line:+re[3],url:re[2]}}const GECKO_LINE_RE=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,GECKO_EVAL_RE=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function parseGeckoLine(ee){const re=GECKO_LINE_RE.exec(ee);if(!re)return;const te=re[3]&&re[3].indexOf(" > eval")>-1,ne=GECKO_EVAL_RE.exec(re[3]);return te&&ne&&(re[3]=ne[1],re[4]=ne[2],re[5]=void 0),{args:re[2]?re[2].split(","):[],column:re[5]?+re[5]:void 0,func:re[1]||UNKNOWN_FUNCTION,line:re[4]?+re[4]:void 0,url:re[3]}}function tryToGetString(ee,re){if(typeof ee!="object"||!ee||!(re in ee))return;const te=ee[re];return typeof te=="string"?te:void 0}function computeStackTraceFromOnErrorMessage(ee,re,te,ne){const ie=[{url:re,column:ne,line:te}],{name:oe,message:se}=tryToParseMessage(ee);return{name:oe,message:se,stack:ie}}const ERROR_TYPES_RE=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function tryToParseMessage(ee){let re,te;return{}.toString.call(ee)==="[object String]"&&([,re,te]=ERROR_TYPES_RE.exec(ee)),{name:re,message:te}}function createHandlingStack(ee){const te=new Error(ee);te.name="HandlingStack";let ne;return callMonitored(()=>{const ie=computeStackTrace(te);ie.stack=ie.stack.slice(2),ne=toStackTraceString(ie)}),ne}function toStackTraceString(ee){let re=formatErrorMessage(ee);return ee.stack.forEach(te=>{const ne=te.func==="?"?"<anonymous>":te.func,ie=te.args&&te.args.length>0?`(${te.args.join(", ")})`:"",oe=te.line?`:${te.line}`:"",se=te.line&&te.column?`:${te.column}`:"";re+=`
|
|
227
227
|
at ${ne}${ie} @ ${te.url}${oe}${se}`}),re}function formatErrorMessage(ee){return`${ee.name||"Error"}: ${ee.message}`}function instrumentMethod(ee,re,te,{computeHandlingStack:ne}={}){let ie=ee[re];if(typeof ie!="function")if(re in ee&&re.startsWith("on"))ie=noop$2;else return{stop:noop$2};let oe=!1;const se=function(){if(oe)return ie.apply(this,arguments);const ae=Array.from(arguments);let ue;callMonitored(te,null,[{target:this,parameters:ae,onPostCall:le=>{ue=le},handlingStack:ne?createHandlingStack("instrumented method"):void 0}]);const ce=ie.apply(this,ae);return ue&&callMonitored(ue,null,[ce]),ce};return ee[re]=se,{stop:()=>{oe=!0,ee[re]===se&&(ee[re]=ie)}}}function instrumentSetter(ee,re,te){const ne=Object.getOwnPropertyDescriptor(ee,re);if(!ne||!ne.set||!ne.configurable)return{stop:noop$2};const ie=noop$2;let oe=(ae,ue)=>{setTimeout$1(()=>{oe!==ie&&te(ae,ue)},0)};const se=function(ae){ne.set.call(this,ae),oe(this,ae)};return Object.defineProperty(ee,re,{set:se}),{stop:()=>{var ae;((ae=Object.getOwnPropertyDescriptor(ee,re))===null||ae===void 0?void 0:ae.set)===se&&Object.defineProperty(ee,re,ne),oe=ie}}}const SANITIZE_DEFAULT_MAX_CHARACTER_COUNT=220*ONE_KIBI_BYTE,JSON_PATH_ROOT_ELEMENT="$",KEY_DECORATION_LENGTH=3;function sanitize(ee,re=SANITIZE_DEFAULT_MAX_CHARACTER_COUNT){const te=detachToJsonMethod(Object.prototype),ne=detachToJsonMethod(Array.prototype),ie=[],oe=new WeakMap,se=sanitizeProcessor(ee,JSON_PATH_ROOT_ELEMENT,void 0,ie,oe),ae=JSON.stringify(se);let ue=ae?ae.length:0;if(ue>re){warnOverCharacterLimit(re,"discarded",ee);return}for(;ie.length>0&&ue<re;){const ce=ie.shift();let le=0;if(Array.isArray(ce.source))for(let de=0;de<ce.source.length;de++){const fe=sanitizeProcessor(ce.source[de],ce.path,de,ie,oe);if(fe!==void 0?ue+=JSON.stringify(fe).length:ue+=4,ue+=le,le=1,ue>re){warnOverCharacterLimit(re,"truncated",ee);break}ce.target[de]=fe}else for(const de in ce.source)if(Object.prototype.hasOwnProperty.call(ce.source,de)){const fe=sanitizeProcessor(ce.source[de],ce.path,de,ie,oe);if(fe!==void 0&&(ue+=JSON.stringify(fe).length+le+de.length+KEY_DECORATION_LENGTH,le=1),ue>re){warnOverCharacterLimit(re,"truncated",ee);break}ce.target[de]=fe}}return te(),ne(),se}function sanitizeProcessor(ee,re,te,ne,ie){const oe=tryToApplyToJSON(ee);if(!oe||typeof oe!="object")return sanitizePrimitivesAndFunctions(oe);const se=sanitizeObjects(oe);if(se!=="[Object]"&&se!=="[Array]"&&se!=="[Error]")return se;const ae=ee;if(ie.has(ae))return`[Reference seen at ${ie.get(ae)}]`;const ue=te!==void 0?`${re}.${te}`:re,ce=Array.isArray(oe)?[]:{};return ie.set(ae,ue),ne.push({source:oe,target:ce,path:ue}),ce}function sanitizePrimitivesAndFunctions(ee){return typeof ee=="bigint"?`[BigInt] ${ee.toString()}`:typeof ee=="function"?`[Function] ${ee.name||"unknown"}`:typeof ee=="symbol"?`[Symbol] ${ee.description||ee.toString()}`:ee}function sanitizeObjects(ee){try{if(ee instanceof Event)return sanitizeEvent(ee);if(ee instanceof RegExp)return`[RegExp] ${ee.toString()}`;const te=Object.prototype.toString.call(ee).match(/\[object (.*)\]/);if(te&&te[1])return`[${te[1]}]`}catch{}return"[Unserializable]"}function sanitizeEvent(ee){return{type:ee.type,isTrusted:ee.isTrusted,currentTarget:ee.currentTarget?sanitizeObjects(ee.currentTarget):null,target:ee.target?sanitizeObjects(ee.target):null}}function tryToApplyToJSON(ee){const re=ee;if(re&&typeof re.toJSON=="function")try{return re.toJSON()}catch{}return ee}function warnOverCharacterLimit(ee,re,te){display.warn(`The data provided has been ${re} as it is over the limit of ${ee} characters:`,te)}const NO_ERROR_STACK_PRESENT_MESSAGE="No stack, consider using an instance of Error";function computeRawError({stackTrace:ee,originalError:re,handlingStack:te,componentStack:ne,startClocks:ie,nonErrorPrefix:oe,source:se,handling:ae}){const ue=isError(re),ce=computeMessage(ee,ue,oe,re),le=hasUsableStack(ue,ee)?toStackTraceString(ee):NO_ERROR_STACK_PRESENT_MESSAGE,de=ue?flattenErrorCauses(re,se):void 0,fe=ee?ee.name:void 0,he=tryToGetFingerprint(re),pe=tryToGetErrorContext(re);return{startClocks:ie,source:se,handling:ae,handlingStack:te,componentStack:ne,originalError:re,type:fe,message:ce,stack:le,causes:de,fingerprint:he,context:pe}}function computeMessage(ee,re,te,ne){return ee!=null&&ee.message&&(ee!=null&&ee.name)?ee.message:re?"Empty message":`${te} ${jsonStringify(sanitize(ne))}`}function hasUsableStack(ee,re){return re===void 0?!1:ee?!0:re.stack.length>0&&(re.stack.length>1||re.stack[0].url!==void 0)}function tryToGetFingerprint(ee){return isError(ee)&&"dd_fingerprint"in ee?String(ee.dd_fingerprint):void 0}function tryToGetErrorContext(ee){if(ee!==null&&typeof ee=="object"&&"dd_context"in ee)return ee.dd_context}function isError(ee){return ee instanceof Error||Object.prototype.toString.call(ee)==="[object Error]"}function flattenErrorCauses(ee,re){let te=ee;const ne=[];for(;isError(te==null?void 0:te.cause)&&ne.length<10;){const ie=computeStackTrace(te.cause);ne.push({message:te.cause.message,source:re,type:ie==null?void 0:ie.name,stack:ie&&toStackTraceString(ie)}),te=te.cause}return ne.length?ne:void 0}const ErrorSource={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function trackRuntimeError(ee){const re=(ie,oe)=>{const se=computeRawError({stackTrace:ie,originalError:oe,startClocks:clocksNow(),nonErrorPrefix:"Uncaught",source:ErrorSource.SOURCE,handling:"unhandled"});ee.notify(se)},{stop:te}=instrumentOnError(re),{stop:ne}=instrumentUnhandledRejection(re);return{stop:()=>{te(),ne()}}}function instrumentOnError(ee){return instrumentMethod(window,"onerror",({parameters:[re,te,ne,ie,oe]})=>{let se;isError(oe)?se=computeStackTrace(oe):se=computeStackTraceFromOnErrorMessage(re,te,ne,ie),ee(se,oe??re)})}function instrumentUnhandledRejection(ee){return instrumentMethod(window,"onunhandledrejection",({parameters:[re]})=>{const te=re.reason||"Empty reason",ne=computeStackTrace(te);ee(ne,te)})}function makePublicApi(ee){const re={version:"6.6.3",onReady(te){te()},...ee};return Object.defineProperty(re,"_setDebug",{get(){return setDebugMode},enumerable:!1}),re}function defineGlobal(ee,re,te){const ne=ee[re];ne&&!ne.q&&ne.version&&display.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),ee[re]=te,ne&&ne.q&&ne.q.forEach(ie=>catchUserErrors(ie,"onReady callback threw an error:")())}function displayAlreadyInitializedError(ee,re){re.silentMultipleInit||display.error(`${ee} is already initialized.`)}function addEventListener$1(ee,re,te,ne,ie){return addEventListeners(ee,re,[te],ne,ie)}function addEventListeners(ee,re,te,ne,{once:ie,capture:oe,passive:se}={}){const ae=monitor(fe=>{!fe.isTrusted&&!fe.__ddIsTrusted&&!ee.allowUntrustedEvents||(ie&&de(),ne(fe))}),ue=se?{capture:oe,passive:se}:oe,ce=window.EventTarget&&re instanceof EventTarget?window.EventTarget.prototype:re,le=getZoneJsOriginalValue(ce,"addEventListener");te.forEach(fe=>le.call(re,fe,ae,ue));function de(){const fe=getZoneJsOriginalValue(ce,"removeEventListener");te.forEach(he=>fe.call(re,he,ae,ue))}return{stop:de}}const RawReportType={intervention:"intervention",cspViolation:"csp_violation"};function initReportObservable(ee,re){const te=[];re.includes(RawReportType.cspViolation)&&te.push(createCspViolationReportObservable(ee));const ne=re.filter(ie=>ie!==RawReportType.cspViolation);return ne.length&&te.push(createReportObservable(ne)),mergeObservables(...te)}function createReportObservable(ee){return new Observable$1(re=>{if(!window.ReportingObserver)return;const te=monitor((ie,oe)=>ie.forEach(se=>re.notify(buildRawReportErrorFromReport(se)))),ne=new window.ReportingObserver(te,{types:ee,buffered:!0});return ne.observe(),()=>{ne.disconnect()}})}function createCspViolationReportObservable(ee){return new Observable$1(re=>{const{stop:te}=addEventListener$1(ee,document,"securitypolicyviolation",ne=>{re.notify(buildRawReportErrorFromCspViolation(ne))});return te})}function buildRawReportErrorFromReport(ee){const{type:re,body:te}=ee;return buildRawReportError({type:te.id,message:`${re}: ${te.message}`,originalError:ee,stack:buildStack(te.id,te.message,te.sourceFile,te.lineNumber,te.columnNumber)})}function buildRawReportErrorFromCspViolation(ee){const re=`'${ee.blockedURI}' blocked by '${ee.effectiveDirective}' directive`;return buildRawReportError({type:ee.effectiveDirective,message:`${RawReportType.cspViolation}: ${re}`,originalError:ee,csp:{disposition:ee.disposition},stack:buildStack(ee.effectiveDirective,ee.originalPolicy?`${re} of the policy "${safeTruncate(ee.originalPolicy,100,"...")}"`:"no policy",ee.sourceFile,ee.lineNumber,ee.columnNumber)})}function buildRawReportError(ee){return{startClocks:clocksNow(),source:ErrorSource.REPORT,handling:"unhandled",...ee}}function buildStack(ee,re,te,ne,ie){return te?toStackTraceString({name:ee,message:re,stack:[{func:"?",url:te,line:ne??void 0,column:ie??void 0}]}):void 0}function sendToExtension(ee,re){const te=window.__ddBrowserSdkExtensionCallback;te&&te({type:ee,payload:re})}function getType(ee){return ee===null?"null":Array.isArray(ee)?"array":typeof ee}function mergeInto(ee,re,te=createCircularReferenceChecker()){if(re===void 0)return ee;if(typeof re!="object"||re===null)return re;if(re instanceof Date)return new Date(re.getTime());if(re instanceof RegExp){const ie=re.flags||[re.global?"g":"",re.ignoreCase?"i":"",re.multiline?"m":"",re.sticky?"y":"",re.unicode?"u":""].join("");return new RegExp(re.source,ie)}if(te.hasAlreadyBeenSeen(re))return;if(Array.isArray(re)){const ie=Array.isArray(ee)?ee:[];for(let oe=0;oe<re.length;++oe)ie[oe]=mergeInto(ie[oe],re[oe],te);return ie}const ne=getType(ee)==="object"?ee:{};for(const ie in re)Object.prototype.hasOwnProperty.call(re,ie)&&(ne[ie]=mergeInto(ne[ie],re[ie],te));return ne}function deepClone(ee){return mergeInto(void 0,ee)}function combine(...ee){let re;for(const te of ee)te!=null&&(re=mergeInto(re,te));return re}function createCircularReferenceChecker(){if(typeof WeakSet<"u"){const re=new WeakSet;return{hasAlreadyBeenSeen(te){const ne=re.has(te);return ne||re.add(te),ne}}}const ee=[];return{hasAlreadyBeenSeen(re){const te=ee.indexOf(re)>=0;return te||ee.push(re),te}}}function getConnectivity(){var ee;const re=window.navigator;return{status:re.onLine?"connected":"not_connected",interfaces:re.connection&&re.connection.type?[re.connection.type]:void 0,effective_type:(ee=re.connection)===null||ee===void 0?void 0:ee.effectiveType}}function removeItem(ee,re){const te=ee.indexOf(re);te>=0&&ee.splice(te,1)}const BUFFER_LIMIT=500;function createBoundedBuffer(){const ee=[];return{add:ie=>{ee.push(ie)>BUFFER_LIMIT&&ee.splice(0,1)},remove:ie=>{removeItem(ee,ie)},drain:ie=>{ee.forEach(oe=>oe(ie)),ee.length=0}}}const TelemetryType={log:"log",configuration:"configuration",usage:"usage"},ALLOWED_FRAME_URLS=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],TELEMETRY_EXCLUDED_SITES=[INTAKE_SITE_US1_FED];let preStartTelemetryBuffer=createBoundedBuffer(),onRawTelemetryEventCollected=ee=>{preStartTelemetryBuffer.add(()=>onRawTelemetryEventCollected(ee))};function startTelemetry(ee,re){let te;const ne=new Observable$1,ie=new Set,oe=!TELEMETRY_EXCLUDED_SITES.includes(re.site)&&performDraw(re.telemetrySampleRate),se={[TelemetryType.log]:oe,[TelemetryType.configuration]:oe&&performDraw(re.telemetryConfigurationSampleRate),[TelemetryType.usage]:oe&&performDraw(re.telemetryUsageSampleRate)},ae=getRuntimeEnvInfo();onRawTelemetryEventCollected=ce=>{const le=jsonStringify(ce);if(se[ce.type]&&ie.size<re.maxTelemetryEventsPerPage&&!ie.has(le)){const de=ue(ee,ce,ae);ne.notify(de),sendToExtension("telemetry",de),ie.add(le)}},startMonitorErrorCollection(addTelemetryError);function ue(ce,le,de){return combine({type:"telemetry",date:timeStampNow(),service:ce,version:"6.6.3",source:"browser",_dd:{format_version:2},telemetry:combine(le,{runtime_env:de,connectivity:getConnectivity(),sdk_setup:"npm"}),experimental_features:Array.from(getExperimentalFeatures())},te!==void 0?te():{})}return{setContextProvider:ce=>{te=ce},observable:ne,enabled:oe}}function getRuntimeEnvInfo(){return{is_local_file:window.location.protocol==="file:",is_worker:"WorkerGlobalScope"in self}}function drainPreStartTelemetry(){preStartTelemetryBuffer.drain()}function isTelemetryReplicationAllowed(ee){return ee.site===INTAKE_SITE_STAGING}function addTelemetryDebug(ee,re){displayIfDebugEnabled(ConsoleApiName.debug,ee,re),onRawTelemetryEventCollected({type:TelemetryType.log,message:ee,status:"debug",...re})}function addTelemetryError(ee,re){onRawTelemetryEventCollected({type:TelemetryType.log,status:"error",...formatError(ee),...re})}function addTelemetryConfiguration(ee){onRawTelemetryEventCollected({type:TelemetryType.configuration,configuration:ee})}function addTelemetryUsage(ee){onRawTelemetryEventCollected({type:TelemetryType.usage,usage:ee})}function formatError(ee){if(isError(ee)){const re=computeStackTrace(ee);return{error:{kind:re.name,stack:toStackTraceString(scrubCustomerFrames(re))},message:re.message}}return{error:{stack:NO_ERROR_STACK_PRESENT_MESSAGE},message:`Uncaught ${jsonStringify(ee)}`}}function scrubCustomerFrames(ee){return ee.stack=ee.stack.filter(re=>!re.url||ALLOWED_FRAME_URLS.some(te=>re.url.startsWith(te))),ee}const END_OF_TIMES=1/0,CLEAR_OLD_VALUES_INTERVAL=ONE_MINUTE;let cleanupHistoriesInterval=null;const cleanupTasks=new Set;function cleanupHistories(){cleanupTasks.forEach(ee=>ee())}function createValueHistory({expireDelay:ee,maxEntries:re}){let te=[];const ne=[];cleanupHistoriesInterval||(cleanupHistoriesInterval=setInterval$1(()=>cleanupHistories(),CLEAR_OLD_VALUES_INTERVAL));const ie=()=>{const he=relativeNow()-ee;for(;te.length>0&&te[te.length-1].endTime<he;){const pe=te.pop();pe&&ne.push(pe.startTime)}};cleanupTasks.add(ie);function oe(he,pe){const ge={value:he,startTime:pe,endTime:END_OF_TIMES,remove:()=>{removeItem(te,ge)},close:me=>{ge.endTime=me}};return re&&te.length>=re&&te.pop(),te.unshift(ge),ge}function se(he=END_OF_TIMES,pe={returnInactive:!1}){for(const ge of te)if(ge.startTime<=he){if(pe.returnInactive||he<=ge.endTime)return ge.value;break}}function ae(he){const pe=te[0];pe&&pe.endTime===END_OF_TIMES&&pe.close(he)}function ue(he=END_OF_TIMES,pe=0){const ge=addDuration(he,pe);return te.filter(me=>me.startTime<=ge&&he<=me.endTime).map(me=>me.value)}function ce(){return te.map(({startTime:he,endTime:pe,value:ge})=>({startTime:he,endTime:pe===END_OF_TIMES?"Infinity":pe,value:ge}))}function le(){return ne}function de(){te=[]}function fe(){cleanupTasks.delete(ie),cleanupTasks.size===0&&cleanupHistoriesInterval&&(clearInterval$1(cleanupHistoriesInterval),cleanupHistoriesInterval=null)}return{add:oe,find:se,closeActive:ae,findAll:ue,reset:de,stop:fe,getAllEntries:ce,getDeletedEntries:le}}const VISIBILITY_CHECK_DELAY=ONE_MINUTE,SESSION_CONTEXT_TIMEOUT_DELAY=SESSION_TIME_OUT_DELAY;function startSessionManager(ee,re,te,ne){const ie=new Observable$1,oe=new Observable$1,se=startSessionStore(ee.sessionStoreStrategyType,ee,re,te),ae=createValueHistory({expireDelay:SESSION_CONTEXT_TIMEOUT_DELAY});se.renewObservable.subscribe(()=>{ae.add(ue(),relativeNow()),ie.notify()}),se.expireObservable.subscribe(()=>{oe.notify(),ae.closeActive(relativeNow())}),se.expandOrRenewSession(),ae.add(ue(),clocksOrigin().relative),ne.observable.subscribe(()=>{ne.isGranted()?se.expandOrRenewSession():se.expire()}),trackActivity(ee,()=>{ne.isGranted()&&se.expandOrRenewSession()}),trackVisibility(ee,()=>se.expandSession()),trackResume(ee,()=>se.restartSession());function ue(){return{id:se.getSession().id,trackingType:se.getSession()[re],isReplayForced:!!se.getSession().forcedReplay,anonymousId:se.getSession().anonymousId}}return{findSession:(ce,le)=>ae.find(ce,le),renewObservable:ie,expireObservable:oe,sessionStateUpdateObservable:se.sessionStateUpdateObservable,expire:se.expire,updateSessionState:se.updateSessionState}}function trackActivity(ee,re){const{stop:te}=addEventListeners(ee,window,["click","touchstart","keydown","scroll"],re,{capture:!0,passive:!0})}function trackVisibility(ee,re){const te=()=>{document.visibilityState==="visible"&&re()},{stop:ne}=addEventListener$1(ee,document,"visibilitychange",te);setInterval$1(te,VISIBILITY_CHECK_DELAY)}function trackResume(ee,re){const{stop:te}=addEventListener$1(ee,window,"resume",re,{capture:!0})}function isServerError(ee){return ee>=500}function tryToClone(ee){try{return ee.clone()}catch{return}}const MAX_ONGOING_BYTES_COUNT=80*ONE_KIBI_BYTE,MAX_ONGOING_REQUESTS=32,MAX_QUEUE_BYTES_COUNT=3*ONE_MEBI_BYTE,MAX_BACKOFF_TIME=ONE_MINUTE,INITIAL_BACKOFF_TIME=ONE_SECOND;function sendWithRetryStrategy(ee,re,te,ne,ie){re.transportStatus===0&&re.queuedPayloads.size()===0&&re.bandwidthMonitor.canHandle(ee)?send(ee,re,te,{onSuccess:()=>retryQueuedPayloads(0,re,te,ne,ie),onFailure:()=>{re.queuedPayloads.enqueue(ee),scheduleRetry(re,te,ne,ie)}}):re.queuedPayloads.enqueue(ee)}function scheduleRetry(ee,re,te,ne){ee.transportStatus===2&&setTimeout$1(()=>{const ie=ee.queuedPayloads.first();send(ie,ee,re,{onSuccess:()=>{ee.queuedPayloads.dequeue(),ee.currentBackoffTime=INITIAL_BACKOFF_TIME,retryQueuedPayloads(1,ee,re,te,ne)},onFailure:()=>{ee.currentBackoffTime=Math.min(MAX_BACKOFF_TIME,ee.currentBackoffTime*2),scheduleRetry(ee,re,te,ne)}})},ee.currentBackoffTime)}function send(ee,re,te,{onSuccess:ne,onFailure:ie}){re.bandwidthMonitor.add(ee),te(ee,oe=>{re.bandwidthMonitor.remove(ee),shouldRetryRequest(oe)?(re.transportStatus=re.bandwidthMonitor.ongoingRequestCount>0?1:2,ee.retry={count:ee.retry?ee.retry.count+1:1,lastFailureStatus:oe.status},ie()):(re.transportStatus=0,ne())})}function retryQueuedPayloads(ee,re,te,ne,ie){ee===0&&re.queuedPayloads.isFull()&&!re.queueFullReported&&(ie({message:`Reached max ${ne} events size queued for upload: ${MAX_QUEUE_BYTES_COUNT/ONE_MEBI_BYTE}MiB`,source:ErrorSource.AGENT,startClocks:clocksNow()}),re.queueFullReported=!0);const oe=re.queuedPayloads;for(re.queuedPayloads=newPayloadQueue();oe.size()>0;)sendWithRetryStrategy(oe.dequeue(),re,te,ne,ie)}function shouldRetryRequest(ee){return ee.type!=="opaque"&&(ee.status===0&&!navigator.onLine||ee.status===408||ee.status===429||isServerError(ee.status))}function newRetryState(){return{transportStatus:0,currentBackoffTime:INITIAL_BACKOFF_TIME,bandwidthMonitor:newBandwidthMonitor(),queuedPayloads:newPayloadQueue(),queueFullReported:!1}}function newPayloadQueue(){const ee=[];return{bytesCount:0,enqueue(re){this.isFull()||(ee.push(re),this.bytesCount+=re.bytesCount)},first(){return ee[0]},dequeue(){const re=ee.shift();return re&&(this.bytesCount-=re.bytesCount),re},size(){return ee.length},isFull(){return this.bytesCount>=MAX_QUEUE_BYTES_COUNT}}}function newBandwidthMonitor(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(ee){return this.ongoingRequestCount===0||this.ongoingByteCount+ee.bytesCount<=MAX_ONGOING_BYTES_COUNT&&this.ongoingRequestCount<MAX_ONGOING_REQUESTS},add(ee){this.ongoingRequestCount+=1,this.ongoingByteCount+=ee.bytesCount},remove(ee){this.ongoingRequestCount-=1,this.ongoingByteCount-=ee.bytesCount}}}function createHttpRequest(ee,re,te){const ne=newRetryState(),ie=(oe,se)=>fetchKeepAliveStrategy(ee,re,oe,se);return{send:oe=>{sendWithRetryStrategy(oe,ne,ie,ee.trackType,te)},sendOnExit:oe=>{sendBeaconStrategy(ee,re,oe)}}}function sendBeaconStrategy(ee,re,te){if(!!navigator.sendBeacon&&te.bytesCount<re)try{const ie=ee.build("beacon",te);if(navigator.sendBeacon(ie,te.data))return}catch(ie){reportBeaconError(ie)}fetchStrategy(ee,te)}let hasReportedBeaconError=!1;function reportBeaconError(ee){hasReportedBeaconError||(hasReportedBeaconError=!0,monitorError(ee))}function fetchKeepAliveStrategy(ee,re,te,ne){if(isKeepAliveSupported()&&te.bytesCount<re){const oe=ee.build("fetch-keepalive",te);fetch(oe,{method:"POST",body:te.data,keepalive:!0,mode:"cors"}).then(monitor(se=>ne==null?void 0:ne({status:se.status,type:se.type}))).catch(monitor(()=>fetchStrategy(ee,te,ne)))}else fetchStrategy(ee,te,ne)}function fetchStrategy(ee,re,te){const ne=ee.build("fetch",re);fetch(ne,{method:"POST",body:re.data,mode:"cors"}).then(monitor(ie=>te==null?void 0:te({status:ie.status,type:ie.type}))).catch(monitor(()=>te==null?void 0:te({status:0})))}function isKeepAliveSupported(){try{return window.Request&&"keepalive"in new Request("http://a")}catch{return!1}}function getEventBridge(){const ee=getEventBridgeGlobal();if(ee)return{getCapabilities(){var re;return JSON.parse(((re=ee.getCapabilities)===null||re===void 0?void 0:re.call(ee))||"[]")},getPrivacyLevel(){var re;return(re=ee.getPrivacyLevel)===null||re===void 0?void 0:re.call(ee)},getAllowedWebViewHosts(){return JSON.parse(ee.getAllowedWebViewHosts())},send(re,te,ne){const ie=ne?{id:ne}:void 0;ee.send(JSON.stringify({eventType:re,event:te,view:ie}))}}}function bridgeSupports(ee){const re=getEventBridge();return!!re&&re.getCapabilities().includes(ee)}function canUseEventBridge(ee){var re;ee===void 0&&(ee=(re=getGlobalObject().location)===null||re===void 0?void 0:re.hostname);const te=getEventBridge();return!!te&&te.getAllowedWebViewHosts().some(ne=>ee===ne||ee.endsWith(`.${ne}`))}function getEventBridgeGlobal(){return getGlobalObject().DatadogEventBridge}const PageExitReason={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function createPageMayExitObservable(ee){return new Observable$1(re=>{const{stop:te}=addEventListeners(ee,window,["visibilitychange","freeze"],ie=>{ie.type==="visibilitychange"&&document.visibilityState==="hidden"?re.notify({reason:PageExitReason.HIDDEN}):ie.type==="freeze"&&re.notify({reason:PageExitReason.FROZEN})},{capture:!0}),ne=addEventListener$1(ee,window,"beforeunload",()=>{re.notify({reason:PageExitReason.UNLOADING})}).stop;return()=>{te(),ne()}})}function isPageExitReason(ee){return objectValues(PageExitReason).includes(ee)}function createBatch({encoder:ee,request:re,flushController:te,messageBytesLimit:ne}){let ie={};const oe=te.flushObservable.subscribe(de=>le(de));function se(de,fe,he){te.notifyBeforeAddMessage(fe),he!==void 0?(ie[he]=de,te.notifyAfterAddMessage()):ee.write(ee.isEmpty?de:`
|
|
228
228
|
${de}`,pe=>{te.notifyAfterAddMessage(pe-fe)})}function ae(de){return de!==void 0&&ie[de]!==void 0}function ue(de){const fe=ie[de];delete ie[de];const he=ee.estimateEncodedBytesCount(fe);te.notifyAfterRemoveMessage(he)}function ce(de,fe){const he=jsonStringify(de),pe=ee.estimateEncodedBytesCount(he);if(pe>=ne){display.warn(`Discarded a message whose size was bigger than the maximum allowed size ${ne}KB. ${MORE_DETAILS} ${DOCS_TROUBLESHOOTING}/#technical-limitations`);return}ae(fe)&&ue(fe),se(he,pe,fe)}function le(de){const fe=objectValues(ie).join(`
|
|
229
229
|
`);ie={};const he=isPageExitReason(de.reason),pe=he?re.sendOnExit:re.send;if(he&&ee.isAsync){const ge=ee.finishSync();ge.outputBytesCount&&pe(formatPayloadFromEncoder(ge));const me=[ge.pendingData,fe].filter(Boolean).join(`
|
|
230
230
|
`);me&&pe({data:me,bytesCount:computeBytesCount(me)})}else fe&&ee.write(ee.isEmpty?fe:`
|
|
231
|
-
${fe}`),ee.finish(ge=>{pe(formatPayloadFromEncoder(ge))})}return{flushController:te,add:ce,upsert:ce,stop:oe.unsubscribe}}function formatPayloadFromEncoder(ee){let re;return typeof ee.output=="string"?re=ee.output:re=new Blob([ee.output],{type:"text/plain"}),{data:re,bytesCount:ee.outputBytesCount,encoding:ee.encoding}}function createFlushController({messagesLimit:ee,bytesLimit:re,durationLimit:te,pageMayExitObservable:ne,sessionExpireObservable:ie}){const oe=ne.subscribe(pe=>le(pe.reason)),se=ie.subscribe(()=>le("session_expire")),ae=new Observable$1(()=>()=>{oe.unsubscribe(),se.unsubscribe()});let ue=0,ce=0;function le(pe){if(ce===0)return;const ge=ce,me=ue;ce=0,ue=0,he(),ae.notify({reason:pe,messagesCount:ge,bytesCount:me})}let de;function fe(){de===void 0&&(de=setTimeout$1(()=>{le("duration_limit")},te))}function he(){clearTimeout$1(de),de=void 0}return{flushObservable:ae,get messagesCount(){return ce},notifyBeforeAddMessage(pe){ue+pe>=re&&le("bytes_limit"),ce+=1,ue+=pe,fe()},notifyAfterAddMessage(pe=0){ue+=pe,ce>=ee?le("messages_limit"):ue>=re&&le("bytes_limit")},notifyAfterRemoveMessage(pe){ue-=pe,ce-=1,ce===0&&he()}}}function startBatchWithReplica(ee,re,te,ne,ie,oe,se=createBatch){const ae=ce(ee,re),ue=te&&ce(ee,te);function ce(le,{endpoint:de,encoder:fe}){return se({encoder:fe,request:createHttpRequest(de,le.batchBytesLimit,ne),flushController:createFlushController({messagesLimit:le.batchMessagesLimit,bytesLimit:le.batchBytesLimit,durationLimit:le.flushTimeout,pageMayExitObservable:ie,sessionExpireObservable:oe}),messageBytesLimit:le.messageBytesLimit})}return{flushObservable:ae.flushController.flushObservable,add(le,de=!0){ae.add(le),ue&&de&&ue.add(te.transformMessage?te.transformMessage(le):le)},upsert:(le,de)=>{ae.upsert(le,de),ue&&ue.upsert(te.transformMessage?te.transformMessage(le):le,de)},stop:()=>{ae.stop(),ue&&ue.stop()}}}function createIdentityEncoder(){let ee="",re=0;return{isAsync:!1,get isEmpty(){return!ee},write(te,ne){const ie=computeBytesCount(te);re+=ie,ee+=te,ne&&ne(ie)},finish(te){te(this.finishSync())},finishSync(){const te={output:ee,outputBytesCount:re,rawBytesCount:re,pendingData:""};return ee="",re=0,te},estimateEncodedBytesCount(te){return te.length}}}class AbstractLifeCycle{constructor(){this.callbacks={}}notify(re,te){const ne=this.callbacks[re];ne&&ne.forEach(ie=>ie(te))}subscribe(re,te){return this.callbacks[re]||(this.callbacks[re]=[]),this.callbacks[re].push(te),{unsubscribe:()=>{this.callbacks[re]=this.callbacks[re].filter(ne=>te!==ne)}}}}function createEventRateLimiter(ee,re,te){let ne=0,ie=!1;return{isLimitReached(){if(ne===0&&setTimeout$1(()=>{ne=0},ONE_MINUTE),ne+=1,ne<=re||ie)return ie=!1,!1;if(ne===re+1){ie=!0;try{te({message:`Reached max number of ${ee}s by minute: ${re}`,source:ErrorSource.AGENT,startClocks:clocksNow()})}finally{ie=!1}}return!0}}}function runOnReadyState(ee,re,te){return document.readyState===re||document.readyState==="complete"?(te(),{stop:noop$2}):addEventListener$1(ee,window,re==="complete"?"load":"DOMContentLoaded",te,{once:!0})}function asyncRunOnReadyState(ee,re){return new Promise(te=>{runOnReadyState(ee,re,te)})}let xhrObservable;const xhrContexts=new WeakMap;function initXhrObservable(ee){return xhrObservable||(xhrObservable=createXhrObservable(ee)),xhrObservable}function createXhrObservable(ee){return new Observable$1(re=>{const{stop:te}=instrumentMethod(XMLHttpRequest.prototype,"open",openXhr),{stop:ne}=instrumentMethod(XMLHttpRequest.prototype,"send",oe=>{sendXhr(oe,ee,re)},{computeHandlingStack:!0}),{stop:ie}=instrumentMethod(XMLHttpRequest.prototype,"abort",abortXhr);return()=>{te(),ne(),ie()}})}function openXhr({target:ee,parameters:[re,te]}){xhrContexts.set(ee,{state:"open",method:String(re).toUpperCase(),url:normalizeUrl(String(te))})}function sendXhr({target:ee,handlingStack:re},te,ne){const ie=xhrContexts.get(ee);if(!ie)return;const oe=ie;oe.state="start",oe.startClocks=clocksNow(),oe.isAborted=!1,oe.xhr=ee,oe.handlingStack=re;let se=!1;const{stop:ae}=instrumentMethod(ee,"onreadystatechange",()=>{ee.readyState===XMLHttpRequest.DONE&&ue()}),ue=()=>{if(ce(),ae(),se)return;se=!0;const le=ie;le.state="complete",le.duration=elapsed(oe.startClocks.timeStamp,timeStampNow()),le.status=ee.status,ne.notify(shallowClone(le))},{stop:ce}=addEventListener$1(te,ee,"loadend",ue);ne.notify(oe)}function abortXhr({target:ee}){const re=xhrContexts.get(ee);re&&(re.isAborted=!0)}let fetchObservable;function initFetchObservable(){return fetchObservable||(fetchObservable=createFetchObservable()),fetchObservable}function createFetchObservable(){return new Observable$1(ee=>{if(!window.fetch)return;const{stop:re}=instrumentMethod(window,"fetch",te=>beforeSend(te,ee),{computeHandlingStack:!0});return re})}function beforeSend({parameters:ee,onPostCall:re,handlingStack:te},ne){const[ie,oe]=ee;let se=oe&&oe.method;se===void 0&&ie instanceof Request&&(se=ie.method);const ae=se!==void 0?String(se).toUpperCase():"GET",ue=ie instanceof Request?ie.url:normalizeUrl(String(ie)),ce=clocksNow(),le={state:"start",init:oe,input:ie,method:ae,startClocks:ce,url:ue,handlingStack:te};ne.notify(le),ee[0]=le.input,ee[1]=le.init,re(de=>afterSend(ne,de,le))}function afterSend(ee,re,te){const ne=te;function ie(oe){ne.state="resolve",Object.assign(ne,oe),ee.notify(ne)}re.then(monitor(oe=>{ie({response:oe,responseType:oe.type,status:oe.status,isAborted:!1})}),monitor(oe=>{var se,ae;ie({status:0,isAborted:((ae=(se=ne.init)===null||se===void 0?void 0:se.signal)===null||ae===void 0?void 0:ae.aborted)||oe instanceof DOMException&&oe.code===DOMException.ABORT_ERR,error:oe})}))}function requestIdleCallback(ee,re){if(window.requestIdleCallback&&window.cancelIdleCallback){const te=window.requestIdleCallback(monitor(ee),re);return()=>window.cancelIdleCallback(te)}return requestIdleCallbackShim(ee)}const MAX_TASK_TIME=50;function requestIdleCallbackShim(ee){const re=dateNow(),te=setTimeout$1(()=>{ee({didTimeout:!1,timeRemaining:()=>Math.max(0,MAX_TASK_TIME-(dateNow()-re))})},0);return()=>clearTimeout$1(te)}const IDLE_CALLBACK_TIMEOUT=ONE_SECOND,MAX_EXECUTION_TIME_ON_TIMEOUT=30;function createTaskQueue(){const ee=[];function re(ne){let ie;if(ne.didTimeout){const oe=performance.now();ie=()=>MAX_EXECUTION_TIME_ON_TIMEOUT-(performance.now()-oe)}else ie=ne.timeRemaining.bind(ne);for(;ie()>0&&ee.length;)ee.shift()();ee.length&&te()}function te(){requestIdleCallback(re,{timeout:IDLE_CALLBACK_TIMEOUT})}return{push(ne){ee.push(ne)===1&&te()}}}let consoleObservablesByApi={};function initConsoleObservable(ee){const re=ee.map(te=>(consoleObservablesByApi[te]||(consoleObservablesByApi[te]=createConsoleObservable(te)),consoleObservablesByApi[te]));return mergeObservables(...re)}function createConsoleObservable(ee){return new Observable$1(re=>{const te=globalConsole[ee];return globalConsole[ee]=(...ne)=>{te.apply(console,ne);const ie=createHandlingStack("console error");callMonitored(()=>{re.notify(buildConsoleLog(ne,ee,ie))})},()=>{globalConsole[ee]=te}})}function buildConsoleLog(ee,re,te){const ne=ee.map(oe=>formatConsoleParameters(oe)).join(" ");let ie;if(re===ConsoleApiName.error){const oe=ee.find(isError);ie={stack:oe?toStackTraceString(computeStackTrace(oe)):void 0,fingerprint:tryToGetFingerprint(oe),causes:oe?flattenErrorCauses(oe,"console"):void 0,startClocks:clocksNow(),message:ne,source:ErrorSource.CONSOLE,handling:"handled",handlingStack:te,context:tryToGetErrorContext(oe),originalError:oe}}return{api:re,message:ne,error:ie,handlingStack:te}}function formatConsoleParameters(ee){return typeof ee=="string"?sanitize(ee):isError(ee)?formatErrorMessage(computeStackTrace(ee)):jsonStringify(sanitize(ee),void 0,2)}function checkContext(ee){const re=getType(ee)==="object";return re||display.error("Unsupported context:",ee),re}function ensureProperties(ee,re,te){const ne={...ee};for(const[ie,{required:oe,type:se}]of Object.entries(re))se==="string"&&ie in ne&&(ne[ie]=String(ne[ie])),oe&&!(ie in ee)&&display.warn(`The property ${ie} of ${te} is required; context will not be sent to the intake.`);return ne}function createContextManager(ee="",{propertiesConfig:re={}}={}){let te={};const ne=new Observable$1,ie={getContext:()=>deepClone(te),setContext:oe=>{checkContext(oe)?te=sanitize(ensureProperties(oe,re,ee)):ie.clearContext(),ne.notify()},setContextProperty:(oe,se)=>{te=sanitize(ensureProperties({...te,[oe]:se},re,ee)),ne.notify()},removeContextProperty:oe=>{delete te[oe],ensureProperties(te,re,ee),ne.notify()},clearContext:()=>{te={},ne.notify()},changeObservable:ne};return ie}const CONTEXT_STORE_KEY_PREFIX="_dd_c",storageListeners=[];function storeContextManager(ee,re,te,ne){const ie=buildStorageKey(te,ne);storageListeners.push(addEventListener$1(ee,window,"storage",({key:ce})=>{ie===ce&&se()})),re.changeObservable.subscribe(ae);const oe=combine(ue(),re.getContext());isEmptyObject$1(oe)||re.setContext(oe);function se(){re.setContext(ue())}function ae(){localStorage.setItem(ie,JSON.stringify(re.getContext()))}function ue(){const ce=localStorage.getItem(ie);return ce?JSON.parse(ce):{}}}function buildStorageKey(ee,re){return`${CONTEXT_STORE_KEY_PREFIX}_${ee}_${re}`}const CustomerContextKey={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},ContextManagerMethod={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};function readBytesFromStream(ee,re,te){const ne=ee.getReader();let ie=0;oe();function oe(){ne.read().then(monitor(ae=>{if(ae.done){se();return}ie+=ae.value.length,ie>te.bytesLimit?se():oe()}),monitor(ae=>re(ae)))}function se(){ne.cancel().catch(noop$2),re(void 0,void 0,void 0)}}const SYNTHETICS_TEST_ID_COOKIE_NAME="datadog-synthetics-public-id",SYNTHETICS_RESULT_ID_COOKIE_NAME="datadog-synthetics-result-id",SYNTHETICS_INJECTS_RUM_COOKIE_NAME="datadog-synthetics-injects-rum";function willSyntheticsInjectRum(){return!!(window._DATADOG_SYNTHETICS_INJECTS_RUM||getInitCookie(SYNTHETICS_INJECTS_RUM_COOKIE_NAME))}function getSyntheticsTestId(){const ee=window._DATADOG_SYNTHETICS_PUBLIC_ID||getInitCookie(SYNTHETICS_TEST_ID_COOKIE_NAME);return typeof ee=="string"?ee:void 0}function getSyntheticsResultId(){const ee=window._DATADOG_SYNTHETICS_RESULT_ID||getInitCookie(SYNTHETICS_RESULT_ID_COOKIE_NAME);return typeof ee=="string"?ee:void 0}function isMatchOption(ee){const re=getType(ee);return re==="string"||re==="function"||ee instanceof RegExp}function matchList(ee,re,te=!1){return ee.some(ne=>{try{if(typeof ne=="function")return ne(re);if(ne instanceof RegExp)return ne.test(re);if(typeof ne=="string")return te?re.startsWith(ne):ne===re}catch(ie){display.error(ie)}return!1})}function createCustomVitalsState(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function startVitalCollection(ee,re,te){function ne(oe){return!re.wasInPageStateDuringPeriod("frozen",oe.startClocks.relative,oe.duration)}function ie(oe){ne(oe)&&ee.notify(12,processVital(oe))}return{addDurationVital:ie,startDurationVital:(oe,se={})=>startDurationVital(te,oe,se),stopDurationVital:(oe,se={})=>{stopDurationVital(ie,te,oe,se)}}}function startDurationVital({vitalsByName:ee,vitalsByReference:re},te,ne={}){const ie={name:te,startClocks:clocksNow(),context:ne.context,description:ne.description},oe={__dd_vital_reference:!0};return ee.set(te,ie),re.set(oe,ie),oe}function stopDurationVital(ee,{vitalsByName:re,vitalsByReference:te},ne,ie={}){const oe=typeof ne=="string"?re.get(ne):te.get(ne);oe&&(ee(buildDurationVital(oe,oe.startClocks,ie,clocksNow())),typeof ne=="string"?re.delete(ne):te.delete(ne))}function buildDurationVital(ee,re,te,ne){var ie;return{name:ee.name,type:"duration",startClocks:re,duration:elapsed(re.timeStamp,ne.timeStamp),context:combine(ee.context,te.context),description:(ie=te.description)!==null&&ie!==void 0?ie:ee.description}}function processVital(ee,re){const te={date:ee.startClocks.timeStamp,vital:{id:generateUUID(),type:ee.type,name:ee.name,duration:toServerDuration(ee.duration),description:ee.description},type:"vital"};return te._dd={vital:{computed_value:!0}},{rawRumEvent:te,startTime:ee.startClocks.relative,duration:ee.duration,customerContext:ee.context,domainContext:{}}}function callPluginsMethod(ee,re,te){if(ee)for(const ne of ee){const ie=ne[re];ie&&ie(te)}}function createTraceIdentifier(){return createIdentifier(64)}function createSpanIdentifier(){return createIdentifier(63)}function createIdentifier(ee){const re=crypto.getRandomValues(new Uint32Array(2));return ee===63&&(re[re.length-1]>>>=1),{toString(te=10){let ne=re[1],ie=re[0],oe="";do{const se=ne%te*4294967296+ie;ne=Math.floor(ne/te),ie=Math.floor(se/te),oe=(se%te).toString(te)+oe}while(ne||ie);return oe}}}function toPaddedHexadecimalString(ee){return ee.toString(16).padStart(16,"0")}let sampleDecisionCache;function isTraceSampled(ee,re){if(re===100)return!0;if(re===0)return!1;if(sampleDecisionCache&&ee===sampleDecisionCache.sessionId)return sampleDecisionCache.decision;let te;return window.BigInt?te=sampleUsingKnuthFactor(BigInt(`0x${ee.split("-")[4]}`),re):te=performDraw(re),sampleDecisionCache={sessionId:ee,decision:te},te}function sampleUsingKnuthFactor(ee,re){const te=BigInt("1111111111111111111"),ne=BigInt("0x10000000000000000"),ie=ee*te%ne;return Number(ie)<=re/100*Number(ne)}function isTracingOption(ee){const re=ee;return getType(re)==="object"&&isMatchOption(re.match)&&Array.isArray(re.propagatorTypes)}function clearTracingIfNeeded(ee){ee.status===0&&!ee.isAborted&&(ee.traceId=void 0,ee.spanId=void 0,ee.traceSampled=void 0)}function startTracer(ee,re,te){return{clearTracingIfNeeded,traceFetch:ne=>injectHeadersIfTracingAllowed(ee,ne,re,te,ie=>{var oe;if(ne.input instanceof Request&&!(!((oe=ne.init)===null||oe===void 0)&&oe.headers))ne.input=new Request(ne.input),Object.keys(ie).forEach(se=>{ne.input.headers.append(se,ie[se])});else{ne.init=shallowClone(ne.init);const se=[];ne.init.headers instanceof Headers?ne.init.headers.forEach((ae,ue)=>{se.push([ue,ae])}):Array.isArray(ne.init.headers)?ne.init.headers.forEach(ae=>{se.push(ae)}):ne.init.headers&&Object.keys(ne.init.headers).forEach(ae=>{se.push([ae,ne.init.headers[ae]])}),ne.init.headers=se.concat(objectEntries(ie))}}),traceXhr:(ne,ie)=>injectHeadersIfTracingAllowed(ee,ne,re,te,oe=>{Object.keys(oe).forEach(se=>{ie.setRequestHeader(se,oe[se])})})}}function injectHeadersIfTracingAllowed(ee,re,te,ne,ie){const oe=te.findTrackedSession();if(!oe)return;const se=ee.allowedTracingUrls.find(ce=>matchList([ce.match],re.url,!0));if(!se)return;const ae=isTraceSampled(oe.id,ee.traceSampleRate);(ae||ee.traceContextInjection===TraceContextInjection.ALL)&&(re.traceSampled=ae,re.traceId=createTraceIdentifier(),re.spanId=createSpanIdentifier(),ie(makeTracingHeaders(re.traceId,re.spanId,re.traceSampled,se.propagatorTypes,ne,ee)))}function makeTracingHeaders(ee,re,te,ne,ie,oe){const se={};if(ne.forEach(ae=>{switch(ae){case"datadog":{Object.assign(se,{"x-datadog-origin":"rum","x-datadog-parent-id":re.toString(),"x-datadog-sampling-priority":te?"1":"0","x-datadog-trace-id":ee.toString()});break}case"tracecontext":{Object.assign(se,{traceparent:`00-0000000000000000${toPaddedHexadecimalString(ee)}-${toPaddedHexadecimalString(re)}-0${te?"1":"0"}`,tracestate:`dd=s:${te?"1":"0"};o:rum`});break}case"b3":{Object.assign(se,{b3:`${toPaddedHexadecimalString(ee)}-${toPaddedHexadecimalString(re)}-${te?"1":"0"}`});break}case"b3multi":{Object.assign(se,{"X-B3-TraceId":toPaddedHexadecimalString(ee),"X-B3-SpanId":toPaddedHexadecimalString(re),"X-B3-Sampled":te?"1":"0"});break}}}),isExperimentalFeatureEnabled(ExperimentalFeature.USER_ACCOUNT_TRACE_HEADER)&&oe.propagateTraceBaggage){const ae=ie().user.id,ue=ie().account.id,ce=[];typeof ae=="string"&&ce.push(`usr.id=${encodeURIComponent(ae)}`),typeof ue=="string"&&ce.push(`account.id=${encodeURIComponent(ue)}`),ce.length>0&&(se.baggage=ce.join(","))}return se}const DEFAULT_PROPAGATOR_TYPES=["tracecontext","datadog"];function validateAndBuildRumConfiguration(ee){var re,te,ne,ie,oe,se,ae;if(ee.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(ee.trackFeatureFlagsForEvents)&&display.warn("trackFeatureFlagsForEvents should be an array"),!ee.applicationId){display.error("Application ID is not configured, no RUM data will be collected.");return}if(!isSampleRate(ee.sessionReplaySampleRate,"Session Replay")||!isSampleRate(ee.traceSampleRate,"Trace"))return;if(ee.excludedActivityUrls!==void 0&&!Array.isArray(ee.excludedActivityUrls)){display.error("Excluded Activity Urls should be an array");return}const ue=validateAndBuildTracingOptions(ee);if(!ue)return;const ce=validateAndBuildConfiguration(ee);if(!ce)return;const le=isExperimentalFeatureEnabled(ExperimentalFeature.PROFILING),de=(re=ee.sessionReplaySampleRate)!==null&&re!==void 0?re:0;return{applicationId:ee.applicationId,version:ee.version||void 0,actionNameAttribute:ee.actionNameAttribute,sessionReplaySampleRate:de,startSessionReplayRecordingManually:ee.startSessionReplayRecordingManually!==void 0?!!ee.startSessionReplayRecordingManually:de===0,traceSampleRate:(te=ee.traceSampleRate)!==null&&te!==void 0?te:100,rulePsr:isNumber$1(ee.traceSampleRate)?ee.traceSampleRate/100:void 0,allowedTracingUrls:ue,excludedActivityUrls:(ne=ee.excludedActivityUrls)!==null&&ne!==void 0?ne:[],workerUrl:ee.workerUrl,compressIntakeRequests:!!ee.compressIntakeRequests,trackUserInteractions:!!(!((ie=ee.trackUserInteractions)!==null&&ie!==void 0)||ie),trackViewsManually:!!ee.trackViewsManually,trackResources:!!(!((oe=ee.trackResources)!==null&&oe!==void 0)||oe),trackLongTasks:!!(!((se=ee.trackLongTasks)!==null&&se!==void 0)||se),subdomain:ee.subdomain,defaultPrivacyLevel:objectHasValue(DefaultPrivacyLevel,ee.defaultPrivacyLevel)?ee.defaultPrivacyLevel:DefaultPrivacyLevel.MASK,enablePrivacyForActionName:!!ee.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,traceContextInjection:objectHasValue(TraceContextInjection,ee.traceContextInjection)?ee.traceContextInjection:TraceContextInjection.SAMPLED,plugins:ee.plugins||[],trackFeatureFlagsForEvents:ee.trackFeatureFlagsForEvents||[],profilingSampleRate:le&&(ae=ee.profilingSampleRate)!==null&&ae!==void 0?ae:0,propagateTraceBaggage:!!ee.propagateTraceBaggage,...ce}}function validateAndBuildTracingOptions(ee){if(ee.allowedTracingUrls===void 0)return[];if(!Array.isArray(ee.allowedTracingUrls)){display.error("Allowed Tracing URLs should be an array");return}if(ee.allowedTracingUrls.length!==0&&ee.service===void 0){display.error("Service needs to be configured when tracing is enabled");return}const re=[];return ee.allowedTracingUrls.forEach(te=>{isMatchOption(te)?re.push({match:te,propagatorTypes:DEFAULT_PROPAGATOR_TYPES}):isTracingOption(te)?re.push(te):display.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",te)}),re}function getSelectedTracingPropagators(ee){const re=new Set;return Array.isArray(ee.allowedTracingUrls)&&ee.allowedTracingUrls.length>0&&ee.allowedTracingUrls.forEach(te=>{isMatchOption(te)?DEFAULT_PROPAGATOR_TYPES.forEach(ne=>re.add(ne)):getType(te)==="object"&&Array.isArray(te.propagatorTypes)&&te.propagatorTypes.forEach(ne=>re.add(ne))}),Array.from(re)}function serializeRumConfiguration(ee){var re;const te=serializeConfiguration(ee);return{session_replay_sample_rate:ee.sessionReplaySampleRate,start_session_replay_recording_manually:ee.startSessionReplayRecordingManually,trace_sample_rate:ee.traceSampleRate,trace_context_injection:ee.traceContextInjection,action_name_attribute:ee.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(ee.allowedTracingUrls)&&ee.allowedTracingUrls.length>0,selected_tracing_propagators:getSelectedTracingPropagators(ee),default_privacy_level:ee.defaultPrivacyLevel,enable_privacy_for_action_name:ee.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(ee.excludedActivityUrls)&&ee.excludedActivityUrls.length>0,use_worker_url:!!ee.workerUrl,compress_intake_requests:ee.compressIntakeRequests,track_views_manually:ee.trackViewsManually,track_user_interactions:ee.trackUserInteractions,track_resources:ee.trackResources,track_long_task:ee.trackLongTasks,plugins:(re=ee.plugins)===null||re===void 0?void 0:re.map(ne=>{var ie;return{name:ne.name,...(ie=ne.getConfigurationTelemetry)===null||ie===void 0?void 0:ie.call(ne)}}),track_feature_flags_for_events:ee.trackFeatureFlagsForEvents,...te}}const REMOTE_CONFIGURATION_VERSION="v1";function fetchAndApplyRemoteConfiguration(ee,re){fetchRemoteConfiguration(ee,te=>{re(applyRemoteConfiguration(ee,te))})}function applyRemoteConfiguration(ee,re){return{...ee,...re}}function fetchRemoteConfiguration(ee,re){const te=new XMLHttpRequest;addEventListener$1(ee,te,"load",function(){if(te.status===200){const ne=JSON.parse(te.responseText);re(ne.rum)}else displayRemoteConfigurationFetchingError()}),addEventListener$1(ee,te,"error",function(){displayRemoteConfigurationFetchingError()}),te.open("GET",buildEndpoint(ee)),te.send()}function buildEndpoint(ee){return`https://sdk-configuration.${buildEndpointHost("rum",ee)}/${REMOTE_CONFIGURATION_VERSION}/${encodeURIComponent(ee.remoteConfigurationId)}.json`}function displayRemoteConfigurationFetchingError(){display.error("Error fetching the remote configuration.")}function startGlobalContext(ee){const re=buildGlobalContextManager();return ee.storeContextsAcrossPages&&storeContextManager(ee,re,"rum",2),re}function buildGlobalContextManager(){return createContextManager("global context")}function startUserContext(ee){const re=buildUserContextManager();return ee.storeContextsAcrossPages&&storeContextManager(ee,re,"rum",1),re}function buildUserContextManager(){return createContextManager("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}function startAccountContext(ee){const re=buildAccountContextManager();return ee.storeContextsAcrossPages&&storeContextManager(ee,re,"rum",4),re}function buildAccountContextManager(){return createContextManager("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function createPreStartStrategy$1({ignoreInitIfSyntheticsWillInjectRum:ee,startDeflateWorker:re},te,ne,ie){const oe=createBoundedBuffer(),se=buildGlobalContextManager();bufferContextCalls(se,CustomerContextKey.globalContext,oe);const ae=buildUserContextManager();bufferContextCalls(ae,CustomerContextKey.userContext,oe);const ue=buildAccountContextManager();bufferContextCalls(ue,CustomerContextKey.accountContext,oe);let ce,le,de,fe;const he=te.observable.subscribe(ge),pe={};function ge(){if(!de||!fe||!te.isGranted())return;he.unsubscribe();let be;if(fe.trackViewsManually){if(!ce)return;oe.remove(ce.callback),be=ce.options}const _e=ie(fe,le,be);oe.drain(_e)}function me(be){const _e=canUseEventBridge();if(_e&&(be=overrideInitConfigurationForBridge(be)),de=be,addTelemetryConfiguration(serializeRumConfiguration(be)),fe){displayAlreadyInitializedError("DD_RUM",be);return}const Ie=validateAndBuildRumConfiguration(be);if(Ie){if(!_e&&!Ie.sessionStoreStrategyType){display.warn("No storage available for session. We will not send any data.");return}Ie.compressIntakeRequests&&!_e&&re&&(le=re(Ie,"Datadog RUM",noop$2),!le)||(fe=Ie,initFetchObservable().subscribe(noop$2),te.tryToInit(Ie.trackingConsent),ge())}}const ye=be=>{oe.add(_e=>_e.addDurationVital(be))};return{init(be,_e){if(!be){display.error("Missing configuration");return}initFeatureFlags(be.enableExperimentalFeatures),de=be,!(ee&&willSyntheticsInjectRum())&&(callPluginsMethod(be.plugins,"onInit",{initConfiguration:be,publicApi:_e}),be.remoteConfigurationId?fetchAndApplyRemoteConfiguration(be,me):me(be))},get initConfiguration(){return de},getInternalContext:noop$2,stopSession:noop$2,addTiming(be,_e=timeStampNow()){oe.add(Ie=>Ie.addTiming(be,_e))},startView(be,_e=clocksNow()){const Ie=Te=>{Te.startView(be,_e)};oe.add(Ie),ce||(ce={options:be,callback:Ie},ge())},setViewName(be){oe.add(_e=>_e.setViewName(be))},setViewContext(be){oe.add(_e=>_e.setViewContext(be))},setViewContextProperty(be,_e){oe.add(Ie=>Ie.setViewContextProperty(be,_e))},getViewContext:()=>pe,globalContext:se,userContext:ae,accountContext:ue,addAction(be){oe.add(_e=>_e.addAction(be))},addError(be){oe.add(_e=>_e.addError(be))},addFeatureFlagEvaluation(be,_e){oe.add(Ie=>Ie.addFeatureFlagEvaluation(be,_e))},startDurationVital(be,_e){return startDurationVital(ne,be,_e)},stopDurationVital(be,_e){stopDurationVital(ye,ne,be,_e)},addDurationVital:ye}}function overrideInitConfigurationForBridge(ee){var re,te;return{...ee,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(re=ee.defaultPrivacyLevel)!==null&&re!==void 0?re:(te=getEventBridge())===null||te===void 0?void 0:te.getPrivacyLevel()}}function bufferContextCalls(ee,re,te){ee.changeObservable.subscribe(()=>{const ne=ee.getContext();te.add(ie=>ie[re].setContext(ne))})}function makeRumPublicApi(ee,re,te,ne={}){const ie=createTrackingConsentState(),oe=createCustomVitalsState();let se=createPreStartStrategy$1(ne,ie,oe,(le,de,fe)=>{const he=ee(le,re,te,fe,de&&ne.createDeflateEncoder?pe=>ne.createDeflateEncoder(le,de,pe):createIdentityEncoder,ie,oe);return re.onRumStart(he.lifeCycle,le,he.session,he.viewHistory,de),te.onRumStart(he.lifeCycle,le,he.session,he.viewHistory),se=createPostStartStrategy$1(se,he),callPluginsMethod(le.plugins,"onRumStart",{strategy:se}),he});const ae=monitor(le=>{const de=typeof le=="object"?le:{name:le};se.startView(de),addTelemetryUsage({feature:"start-view"})});function ue(le,de,fe){return monitor((...he)=>(addTelemetryUsage({feature:fe}),se[le][de](...he)))}const ce=makePublicApi({init:monitor(le=>{se.init(le,ce)}),setTrackingConsent:monitor(le=>{ie.update(le),addTelemetryUsage({feature:"set-tracking-consent",tracking_consent:le})}),setViewName:monitor(le=>{se.setViewName(le),addTelemetryUsage({feature:"set-view-name"})}),setViewContext:monitor(le=>{se.setViewContext(le),addTelemetryUsage({feature:"set-view-context"})}),setViewContextProperty:monitor((le,de)=>{se.setViewContextProperty(le,de),addTelemetryUsage({feature:"set-view-context-property"})}),getViewContext:monitor(()=>(addTelemetryUsage({feature:"set-view-context-property"}),se.getViewContext())),getInternalContext:monitor(le=>se.getInternalContext(le)),getInitConfiguration:monitor(()=>deepClone(se.initConfiguration)),addAction:(le,de)=>{const fe=createHandlingStack("action");callMonitored(()=>{se.addAction({name:sanitize(le),context:sanitize(de),startClocks:clocksNow(),type:"custom",handlingStack:fe}),addTelemetryUsage({feature:"add-action"})})},addError:(le,de)=>{const fe=createHandlingStack("error");callMonitored(()=>{se.addError({error:le,handlingStack:fe,context:sanitize(de),startClocks:clocksNow()}),addTelemetryUsage({feature:"add-error"})})},addTiming:monitor((le,de)=>{se.addTiming(sanitize(le),de)}),setGlobalContext:ue(CustomerContextKey.globalContext,ContextManagerMethod.setContext,"set-global-context"),getGlobalContext:ue(CustomerContextKey.globalContext,ContextManagerMethod.getContext,"get-global-context"),setGlobalContextProperty:ue(CustomerContextKey.globalContext,ContextManagerMethod.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:ue(CustomerContextKey.globalContext,ContextManagerMethod.removeContextProperty,"remove-global-context-property"),clearGlobalContext:ue(CustomerContextKey.globalContext,ContextManagerMethod.clearContext,"clear-global-context"),setUser:ue(CustomerContextKey.userContext,ContextManagerMethod.setContext,"set-user"),getUser:ue(CustomerContextKey.userContext,ContextManagerMethod.getContext,"get-user"),setUserProperty:ue(CustomerContextKey.userContext,ContextManagerMethod.setContextProperty,"set-user-property"),removeUserProperty:ue(CustomerContextKey.userContext,ContextManagerMethod.removeContextProperty,"remove-user-property"),clearUser:ue(CustomerContextKey.userContext,ContextManagerMethod.clearContext,"clear-user"),setAccount:ue(CustomerContextKey.accountContext,ContextManagerMethod.setContext,"set-account"),getAccount:ue(CustomerContextKey.accountContext,ContextManagerMethod.getContext,"get-account"),setAccountProperty:ue(CustomerContextKey.accountContext,ContextManagerMethod.setContextProperty,"set-account-property"),removeAccountProperty:ue(CustomerContextKey.accountContext,ContextManagerMethod.removeContextProperty,"remove-account-property"),clearAccount:ue(CustomerContextKey.accountContext,ContextManagerMethod.clearContext,"clear-account"),startView:ae,stopSession:monitor(()=>{se.stopSession(),addTelemetryUsage({feature:"stop-session"})}),addFeatureFlagEvaluation:monitor((le,de)=>{se.addFeatureFlagEvaluation(sanitize(le),sanitize(de)),addTelemetryUsage({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:monitor(()=>re.getSessionReplayLink()),startSessionReplayRecording:monitor(le=>{re.start(le),addTelemetryUsage({feature:"start-session-replay-recording",force:le&&le.force})}),stopSessionReplayRecording:monitor(()=>re.stop()),addDurationVital:monitor((le,de)=>{addTelemetryUsage({feature:"add-duration-vital"}),se.addDurationVital({name:sanitize(le),type:"duration",startClocks:timeStampToClocks(de.startTime),duration:de.duration,context:sanitize(de&&de.context),description:sanitize(de&&de.description)})}),startDurationVital:monitor((le,de)=>(addTelemetryUsage({feature:"start-duration-vital"}),se.startDurationVital(sanitize(le),{context:sanitize(de&&de.context),description:sanitize(de&&de.description)}))),stopDurationVital:monitor((le,de)=>{addTelemetryUsage({feature:"stop-duration-vital"}),se.stopDurationVital(typeof le=="string"?sanitize(le):le,{context:sanitize(de&&de.context),description:sanitize(de&&de.description)})})});return ce}function createPostStartStrategy$1(ee,re){return{init:te=>{displayAlreadyInitializedError("DD_RUM",te)},initConfiguration:ee.initConfiguration,...re}}function createDOMMutationObservable(){const ee=getMutationObserverConstructor();return new Observable$1(re=>{if(!ee)return;const te=new ee(monitor(()=>re.notify()));return te.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>te.disconnect()})}function getMutationObserverConstructor(){let ee;const re=window;if(re.Zone&&(ee=getZoneJsOriginalValue(re,"MutationObserver"),re.MutationObserver&&ee===re.MutationObserver)){const te=new re.MutationObserver(noop$2),ne=getZoneJsOriginalValue(te,"originalInstance");ee=ne&&ne.constructor}return ee||(ee=re.MutationObserver),ee}function createWindowOpenObservable(){const ee=new Observable$1,{stop:re}=instrumentMethod(window,"open",()=>ee.notify());return{observable:ee,stop:re}}function startInternalContext(ee,re,te,ne,ie){return{get:oe=>{const se=te.findView(oe),ae=ie.findUrl(oe),ue=re.findTrackedSession(oe);if(ue&&se&&ae){const ce=ne.findActionId(oe);return{application_id:ee,session_id:ue.id,user_action:ce?{id:ce}:void 0,view:{id:se.id,name:se.name,referrer:ae.referrer,url:ae.url}}}}}}const LifeCycle=AbstractLifeCycle,VIEW_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startViewHistory(ee){const re=createValueHistory({expireDelay:VIEW_CONTEXT_TIME_OUT_DELAY});ee.subscribe(1,ne=>{re.add(te(ne),ne.startClocks.relative)}),ee.subscribe(6,({endClocks:ne})=>{re.closeActive(ne.relative)}),ee.subscribe(3,ne=>{const ie=re.find(ne.startClocks.relative);ie&&ne.name&&(ie.name=ne.name),ie&&ne.context&&(ie.context=ne.context)}),ee.subscribe(10,()=>{re.reset()});function te(ne){return{service:ne.service,version:ne.version,context:ne.context,id:ne.id,name:ne.name,startClocks:ne.startClocks}}return{findView:ne=>re.find(ne),getAllEntries:()=>re.getAllEntries(),getDeletedEntries:()=>re.getDeletedEntries(),stop:()=>{re.stop()}}}const FAKE_INITIAL_DOCUMENT="initial_document",RESOURCE_TYPES=[["document",ee=>FAKE_INITIAL_DOCUMENT===ee],["xhr",ee=>ee==="xmlhttprequest"],["fetch",ee=>ee==="fetch"],["beacon",ee=>ee==="beacon"],["css",(ee,re)=>/\.css$/i.test(re)],["js",(ee,re)=>/\.js$/i.test(re)],["image",(ee,re)=>["image","img","icon"].includes(ee)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(re)!==null],["font",(ee,re)=>/\.(woff|eot|woff2|ttf)$/i.exec(re)!==null],["media",(ee,re)=>["audio","video"].includes(ee)||/\.(mp3|mp4)$/i.exec(re)!==null]];function computeResourceEntryType(ee){const re=ee.name;if(!isValidUrl(re))return addTelemetryDebug(`Failed to construct URL for "${ee.name}"`),"other";const te=getPathName(re);for(const[ne,ie]of RESOURCE_TYPES)if(ie(ee.initiatorType,te))return ne;return"other"}function areInOrder(...ee){for(let re=1;re<ee.length;re+=1)if(ee[re-1]>ee[re])return!1;return!0}function isResourceEntryRequestType(ee){return ee.initiatorType==="xmlhttprequest"||ee.initiatorType==="fetch"}function computeResourceEntryDuration(ee){const{duration:re,startTime:te,responseEnd:ne}=ee;return re===0&&te<ne?elapsed(te,ne):re}function computeResourceEntryDetails(ee){if(!hasValidResourceEntryTimings(ee))return;const{startTime:re,fetchStart:te,workerStart:ne,redirectStart:ie,redirectEnd:oe,domainLookupStart:se,domainLookupEnd:ae,connectStart:ue,secureConnectionStart:ce,connectEnd:le,requestStart:de,responseStart:fe,responseEnd:he}=ee,pe={download:formatTiming(re,fe,he),first_byte:formatTiming(re,de,fe)};return 0<ne&&ne<te&&(pe.worker=formatTiming(re,ne,te)),te<le&&(pe.connect=formatTiming(re,ue,le),ue<=ce&&ce<=le&&(pe.ssl=formatTiming(re,ce,le))),te<ae&&(pe.dns=formatTiming(re,se,ae)),re<oe&&(pe.redirect=formatTiming(re,ie,oe)),pe}function hasValidResourceEntryDuration(ee){return ee.duration>=0}function hasValidResourceEntryTimings(ee){const re=areInOrder(ee.startTime,ee.fetchStart,ee.domainLookupStart,ee.domainLookupEnd,ee.connectStart,ee.connectEnd,ee.requestStart,ee.responseStart,ee.responseEnd),te=hasRedirection(ee)?areInOrder(ee.startTime,ee.redirectStart,ee.redirectEnd,ee.fetchStart):!0;return re&&te}function hasRedirection(ee){return ee.redirectEnd>ee.startTime}function formatTiming(ee,re,te){if(ee<=re&&re<=te)return{duration:toServerDuration(elapsed(re,te)),start:toServerDuration(elapsed(ee,re))}}function computeResourceEntryProtocol(ee){return ee.nextHopProtocol===""?void 0:ee.nextHopProtocol}function computeResourceEntryDeliveryType(ee){return ee.deliveryType===""?"other":ee.deliveryType}function computeResourceEntrySize(ee){if(ee.startTime<ee.responseStart){const{encodedBodySize:re,decodedBodySize:te,transferSize:ne}=ee;return{size:te,encoded_body_size:re,decoded_body_size:te,transfer_size:ne}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function isAllowedRequestUrl(ee){return ee&&!isIntakeUrl(ee)}const DATA_URL_REGEX=/data:(.+)?(;base64)?,/g,MAX_ATTRIBUTE_VALUE_CHAR_LENGTH=24e3;function isLongDataUrl(ee){return ee.length<=MAX_ATTRIBUTE_VALUE_CHAR_LENGTH?!1:ee.substring(0,5)==="data:"?(ee=ee.substring(0,MAX_ATTRIBUTE_VALUE_CHAR_LENGTH),!0):!1}function sanitizeDataUrl(ee){return`${ee.match(DATA_URL_REGEX)[0]}[...]`}let nextRequestIndex=1;function startRequestCollection(ee,re,te,ne){const ie=startTracer(re,te,ne);trackXhr(ee,re,ie),trackFetch(ee,ie)}function trackXhr(ee,re,te){const ne=initXhrObservable(re).subscribe(ie=>{const oe=ie;if(isAllowedRequestUrl(oe.url))switch(oe.state){case"start":te.traceXhr(oe,oe.xhr),oe.requestIndex=getNextRequestIndex(),ee.notify(7,{requestIndex:oe.requestIndex,url:oe.url});break;case"complete":te.clearTracingIfNeeded(oe),ee.notify(8,{duration:oe.duration,method:oe.method,requestIndex:oe.requestIndex,spanId:oe.spanId,startClocks:oe.startClocks,status:oe.status,traceId:oe.traceId,traceSampled:oe.traceSampled,type:"xhr",url:oe.url,xhr:oe.xhr,isAborted:oe.isAborted,handlingStack:oe.handlingStack});break}});return{stop:()=>ne.unsubscribe()}}function trackFetch(ee,re){const te=initFetchObservable().subscribe(ne=>{const ie=ne;if(isAllowedRequestUrl(ie.url))switch(ie.state){case"start":re.traceFetch(ie),ie.requestIndex=getNextRequestIndex(),ee.notify(7,{requestIndex:ie.requestIndex,url:ie.url});break;case"resolve":waitForResponseToComplete(ie,oe=>{re.clearTracingIfNeeded(ie),ee.notify(8,{duration:oe,method:ie.method,requestIndex:ie.requestIndex,responseType:ie.responseType,spanId:ie.spanId,startClocks:ie.startClocks,status:ie.status,traceId:ie.traceId,traceSampled:ie.traceSampled,type:"fetch",url:ie.url,response:ie.response,init:ie.init,input:ie.input,isAborted:ie.isAborted,handlingStack:ie.handlingStack})});break}});return{stop:()=>te.unsubscribe()}}function getNextRequestIndex(){const ee=nextRequestIndex;return nextRequestIndex+=1,ee}function waitForResponseToComplete(ee,re){const te=ee.response&&tryToClone(ee.response);!te||!te.body?re(elapsed(ee.startClocks.timeStamp,timeStampNow())):readBytesFromStream(te.body,()=>{re(elapsed(ee.startClocks.timeStamp,timeStampNow()))},{bytesLimit:Number.POSITIVE_INFINITY})}function discardNegativeDuration(ee){return isNumber$1(ee)&&ee<0?void 0:ee}function trackEventCounts({lifeCycle:ee,isChildEvent:re,onChange:te=noop$2}){const ne={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},ie=ee.subscribe(13,oe=>{var se;if(!(oe.type==="view"||oe.type==="vital"||!re(oe)))switch(oe.type){case"error":ne.errorCount+=1,te();break;case"action":ne.actionCount+=1,oe.action.frustration&&(ne.frustrationCount+=oe.action.frustration.type.length),te();break;case"long_task":ne.longTaskCount+=1,te();break;case"resource":!((se=oe._dd)===null||se===void 0)&&se.discarded||(ne.resourceCount+=1,te());break}});return{stop:()=>{ie.unsubscribe()},eventCounts:ne}}function retrieveFirstInputTiming(ee,re){const te=dateNow();let ne=!1;const{stop:ie}=addEventListeners(ee,window,["click","mousedown","keydown","touchstart","pointerdown"],ae=>{if(!ae.cancelable)return;const ue={entryType:"first-input",processingStart:relativeNow(),processingEnd:relativeNow(),startTime:ae.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};ae.type==="pointerdown"?oe(ee,ue):se(ue)},{passive:!0,capture:!0});return{stop:ie};function oe(ae,ue){addEventListeners(ae,window,["pointerup","pointercancel"],ce=>{ce.type==="pointerup"&&se(ue)},{once:!0})}function se(ae){if(!ne){ne=!0,ie();const ue=ae.processingStart-ae.startTime;ue>=0&&ue<dateNow()-te&&re(ae)}}}var RumPerformanceEntryType;(function(ee){ee.EVENT="event",ee.FIRST_INPUT="first-input",ee.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",ee.LAYOUT_SHIFT="layout-shift",ee.LONG_TASK="longtask",ee.LONG_ANIMATION_FRAME="long-animation-frame",ee.NAVIGATION="navigation",ee.PAINT="paint",ee.RESOURCE="resource",ee.VISIBILITY_STATE="visibility-state"})(RumPerformanceEntryType||(RumPerformanceEntryType={}));function createPerformanceObservable(ee,re){return new Observable$1(te=>{if(!window.PerformanceObserver)return;const ne=ue=>{const ce=filterRumPerformanceEntries(ue);ce.length>0&&te.notify(ce)};let ie,oe=!0;const se=new PerformanceObserver(monitor(ue=>{oe?ie=setTimeout$1(()=>ne(ue.getEntries())):ne(ue.getEntries())}));try{se.observe(re)}catch{if([RumPerformanceEntryType.RESOURCE,RumPerformanceEntryType.NAVIGATION,RumPerformanceEntryType.LONG_TASK,RumPerformanceEntryType.PAINT].includes(re.type)){re.buffered&&(ie=setTimeout$1(()=>ne(performance.getEntriesByType(re.type))));try{se.observe({entryTypes:[re.type]})}catch{return}}}oe=!1,manageResourceTimingBufferFull(ee);let ae;return!supportPerformanceTimingEvent(RumPerformanceEntryType.FIRST_INPUT)&&re.type===RumPerformanceEntryType.FIRST_INPUT&&({stop:ae}=retrieveFirstInputTiming(ee,ue=>{ne([ue])})),()=>{se.disconnect(),ae&&ae(),clearTimeout$1(ie)}})}let resourceTimingBufferFullListener;function manageResourceTimingBufferFull(ee){return!resourceTimingBufferFullListener&&supportPerformanceObject()&&"addEventListener"in performance&&(resourceTimingBufferFullListener=addEventListener$1(ee,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{resourceTimingBufferFullListener==null||resourceTimingBufferFullListener.stop()}}function supportPerformanceObject(){return window.performance!==void 0&&"getEntries"in performance}function supportPerformanceTimingEvent(ee){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(ee)}function filterRumPerformanceEntries(ee){return ee.filter(re=>!isForbiddenResource(re))}function isForbiddenResource(ee){return ee.entryType===RumPerformanceEntryType.RESOURCE&&(!isAllowedRequestUrl(ee.name)||!hasValidResourceEntryDuration(ee))}const PAGE_ACTIVITY_VALIDATION_DELAY=100,PAGE_ACTIVITY_END_DELAY=100;function waitPageActivityEnd(ee,re,te,ne,ie,oe){const se=createPageActivityObservable(ee,re,te,ne);return doWaitPageActivityEnd(se,ie,oe)}function doWaitPageActivityEnd(ee,re,te){let ne,ie=!1;const oe=setTimeout$1(monitor(()=>ce({hadActivity:!1})),PAGE_ACTIVITY_VALIDATION_DELAY),se=te!==void 0?setTimeout$1(monitor(()=>ce({hadActivity:!0,end:timeStampNow()})),te):void 0,ae=ee.subscribe(({isBusy:le})=>{clearTimeout$1(oe),clearTimeout$1(ne);const de=timeStampNow();le||(ne=setTimeout$1(monitor(()=>ce({hadActivity:!0,end:de})),PAGE_ACTIVITY_END_DELAY))}),ue=()=>{ie=!0,clearTimeout$1(oe),clearTimeout$1(ne),clearTimeout$1(se),ae.unsubscribe()};function ce(le){ie||(ue(),re(le))}return{stop:ue}}function createPageActivityObservable(ee,re,te,ne){return new Observable$1(ie=>{const oe=[];let se,ae=0;return oe.push(re.subscribe(ue),te.subscribe(ue),createPerformanceObservable(ne,{type:RumPerformanceEntryType.RESOURCE}).subscribe(ce=>{ce.some(le=>!isExcludedUrl(ne,le.name))&&ue()}),ee.subscribe(7,ce=>{isExcludedUrl(ne,ce.url)||(se===void 0&&(se=ce.requestIndex),ae+=1,ue())}),ee.subscribe(8,ce=>{isExcludedUrl(ne,ce.url)||se===void 0||ce.requestIndex<se||(ae-=1,ue())})),()=>{oe.forEach(ce=>ce.unsubscribe())};function ue(){ie.notify({isBusy:ae>0})}})}function isExcludedUrl(ee,re){return matchList(ee.excludedActivityUrls,re)}function isTextNode(ee){return ee.nodeType===Node.TEXT_NODE}function isCommentNode(ee){return ee.nodeType===Node.COMMENT_NODE}function isElementNode(ee){return ee.nodeType===Node.ELEMENT_NODE}function isNodeShadowHost(ee){return isElementNode(ee)&&!!ee.shadowRoot}function isNodeShadowRoot(ee){const re=ee;return!!re.host&&re.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&isElementNode(re.host)}function hasChildNodes(ee){return ee.childNodes.length>0||isNodeShadowHost(ee)}function forEachChildNodes(ee,re){let te=ee.firstChild;for(;te;)re(te),te=te.nextSibling;isNodeShadowHost(ee)&&re(ee.shadowRoot)}function getParentNode(ee){return isNodeShadowRoot(ee)?ee.host:ee.parentNode}const NodePrivacyLevel={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:DefaultPrivacyLevel.ALLOW,MASK:DefaultPrivacyLevel.MASK,MASK_USER_INPUT:DefaultPrivacyLevel.MASK_USER_INPUT},PRIVACY_ATTR_NAME="data-dd-privacy",PRIVACY_ATTR_VALUE_HIDDEN="hidden",PRIVACY_CLASS_PREFIX="dd-privacy-",CENSORED_STRING_MARK="***",CENSORED_IMG_MARK="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",FORM_PRIVATE_TAG_NAMES={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},TEXT_MASKING_CHAR="x";function getNodePrivacyLevel(ee,re,te){if(te&&te.has(ee))return te.get(ee);const ne=getParentNode(ee),ie=ne?getNodePrivacyLevel(ne,re,te):re,oe=getNodeSelfPrivacyLevel(ee),se=reducePrivacyLevel(oe,ie);return te&&te.set(ee,se),se}function reducePrivacyLevel(ee,re){switch(re){case NodePrivacyLevel.HIDDEN:case NodePrivacyLevel.IGNORE:return re}switch(ee){case NodePrivacyLevel.ALLOW:case NodePrivacyLevel.MASK:case NodePrivacyLevel.MASK_USER_INPUT:case NodePrivacyLevel.HIDDEN:case NodePrivacyLevel.IGNORE:return ee;default:return re}}function getNodeSelfPrivacyLevel(ee){if(isElementNode(ee)){if(ee.tagName==="BASE")return NodePrivacyLevel.ALLOW;if(ee.tagName==="INPUT"){const re=ee;if(re.type==="password"||re.type==="email"||re.type==="tel"||re.type==="hidden")return NodePrivacyLevel.MASK;const te=re.getAttribute("autocomplete");if(te&&(te.startsWith("cc-")||te.endsWith("-password")))return NodePrivacyLevel.MASK}if(ee.matches(getPrivacySelector(NodePrivacyLevel.HIDDEN)))return NodePrivacyLevel.HIDDEN;if(ee.matches(getPrivacySelector(NodePrivacyLevel.MASK)))return NodePrivacyLevel.MASK;if(ee.matches(getPrivacySelector(NodePrivacyLevel.MASK_USER_INPUT)))return NodePrivacyLevel.MASK_USER_INPUT;if(ee.matches(getPrivacySelector(NodePrivacyLevel.ALLOW)))return NodePrivacyLevel.ALLOW;if(shouldIgnoreElement(ee))return NodePrivacyLevel.IGNORE}}function shouldMaskNode(ee,re){switch(re){case NodePrivacyLevel.MASK:case NodePrivacyLevel.HIDDEN:case NodePrivacyLevel.IGNORE:return!0;case NodePrivacyLevel.MASK_USER_INPUT:return isTextNode(ee)?isFormElement(ee.parentNode):isFormElement(ee);default:return!1}}function isFormElement(ee){if(!ee||ee.nodeType!==ee.ELEMENT_NODE)return!1;const re=ee;if(re.tagName==="INPUT")switch(re.type){case"button":case"color":case"reset":case"submit":return!1}return!!FORM_PRIVATE_TAG_NAMES[re.tagName]}const censorText=ee=>ee.replace(/\S/g,TEXT_MASKING_CHAR);function getTextContent(ee,re,te){var ne;const ie=(ne=ee.parentElement)===null||ne===void 0?void 0:ne.tagName;let oe=ee.textContent||"";if(re&&!oe.trim())return;const se=te;if(ie==="SCRIPT")oe=CENSORED_STRING_MARK;else if(se===NodePrivacyLevel.HIDDEN)oe=CENSORED_STRING_MARK;else if(shouldMaskNode(ee,se))if(ie==="DATALIST"||ie==="SELECT"||ie==="OPTGROUP"){if(!oe.trim())return}else ie==="OPTION"?oe=CENSORED_STRING_MARK:oe=censorText(oe);return oe}function shouldIgnoreElement(ee){if(ee.nodeName==="SCRIPT")return!0;if(ee.nodeName==="LINK"){const te=re("rel");return/preload|prefetch/i.test(te)&&re("as")==="script"||te==="shortcut icon"||te==="icon"}if(ee.nodeName==="META"){const te=re("name"),ne=re("rel"),ie=re("property");return/^msapplication-tile(image|color)$/.test(te)||te==="application-name"||ne==="icon"||ne==="apple-touch-icon"||ne==="shortcut icon"||te==="keywords"||te==="description"||/^(og|twitter|fb):/.test(ie)||/^(og|twitter):/.test(te)||te==="pinterest"||te==="robots"||te==="googlebot"||te==="bingbot"||ee.hasAttribute("http-equiv")||te==="author"||te==="generator"||te==="framework"||te==="publisher"||te==="progid"||/^article:/.test(ie)||/^product:/.test(ie)||te==="google-site-verification"||te==="yandex-verification"||te==="csrf-token"||te==="p:domain_verify"||te==="verify-v1"||te==="verification"||te==="shopify-checkout-api-token"}function re(te){return(ee.getAttribute(te)||"").toLowerCase()}return!1}function getPrivacySelector(ee){return`[${PRIVACY_ATTR_NAME}="${ee}"], .${PRIVACY_CLASS_PREFIX}${ee}`}const DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE="data-dd-action-name",ACTION_NAME_PLACEHOLDER="Masked Element";function getActionNameFromElement(ee,{enablePrivacyForActionName:re,actionNameAttribute:te},ne){const ie=getActionNameFromElementProgrammatically(ee,DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE)||te&&getActionNameFromElementProgrammatically(ee,te);return ie?{name:ie,nameSource:"custom_attribute"}:ne===NodePrivacyLevel.MASK?{name:ACTION_NAME_PLACEHOLDER,nameSource:"mask_placeholder"}:getActionNameFromElementForStrategies(ee,te,priorityStrategies,re)||getActionNameFromElementForStrategies(ee,te,fallbackStrategies,re)||{name:"",nameSource:"blank"}}function getActionNameFromElementProgrammatically(ee,re){const te=ee.closest(`[${re}]`);if(!te)return;const ne=te.getAttribute(re);return truncate(normalizeWhitespace(ne.trim()))}const priorityStrategies=[(ee,re)=>{if("labels"in ee&&ee.labels&&ee.labels.length>0)return getActionNameFromTextualContent(ee.labels[0],re)},ee=>{if(ee.nodeName==="INPUT"){const re=ee,te=re.getAttribute("type");if(te==="button"||te==="submit"||te==="reset")return{name:re.value,nameSource:"text_content"}}},(ee,re,te)=>{if(ee.nodeName==="BUTTON"||ee.nodeName==="LABEL"||ee.getAttribute("role")==="button")return getActionNameFromTextualContent(ee,re,te)},ee=>getActionNameFromStandardAttribute(ee,"aria-label"),(ee,re,te)=>{const ne=ee.getAttribute("aria-labelledby");if(ne)return{name:ne.split(/\s+/).map(ie=>getElementById(ee,ie)).filter(ie=>!!ie).map(ie=>getTextualContent(ie,re,te)).join(" "),nameSource:"text_content"}},ee=>getActionNameFromStandardAttribute(ee,"alt"),ee=>getActionNameFromStandardAttribute(ee,"name"),ee=>getActionNameFromStandardAttribute(ee,"title"),ee=>getActionNameFromStandardAttribute(ee,"placeholder"),(ee,re)=>{if("options"in ee&&ee.options.length>0)return getActionNameFromTextualContent(ee.options[0],re)}],fallbackStrategies=[(ee,re,te)=>getActionNameFromTextualContent(ee,re,te)],MAX_PARENTS_TO_CONSIDER=10;function getActionNameFromElementForStrategies(ee,re,te,ne){let ie=ee,oe=0;for(;oe<=MAX_PARENTS_TO_CONSIDER&&ie&&ie.nodeName!=="BODY"&&ie.nodeName!=="HTML"&&ie.nodeName!=="HEAD";){for(const se of te){const ae=se(ie,re,ne);if(ae){const{name:ue,nameSource:ce}=ae,le=ue&&ue.trim();if(le)return{name:truncate(normalizeWhitespace(le)),nameSource:ce}}}if(ie.nodeName==="FORM")break;ie=ie.parentElement,oe+=1}}function normalizeWhitespace(ee){return ee.replace(/\s+/g," ")}function truncate(ee){return ee.length>100?`${safeTruncate(ee,100)} [...]`:ee}function getElementById(ee,re){return ee.ownerDocument?ee.ownerDocument.getElementById(re):null}function getActionNameFromStandardAttribute(ee,re){return{name:ee.getAttribute(re)||"",nameSource:"standard_attribute"}}function getActionNameFromTextualContent(ee,re,te){return{name:getTextualContent(ee,re,te)||"",nameSource:"text_content"}}function getTextualContent(ee,re,te){if(!ee.isContentEditable){if("innerText"in ee){let ne=ee.innerText;const ie=oe=>{const se=ee.querySelectorAll(oe);for(let ae=0;ae<se.length;ae+=1){const ue=se[ae];if("innerText"in ue){const ce=ue.innerText;ce&&ce.trim().length>0&&(ne=ne.replace(ce,""))}}};return ie(`[${DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE}]`),re&&ie(`[${re}]`),te&&ie(`${getPrivacySelector(NodePrivacyLevel.HIDDEN)}, ${getPrivacySelector(NodePrivacyLevel.MASK)}`),ne}return ee.textContent}}const STABLE_ATTRIBUTES=[DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],GLOBALLY_UNIQUE_SELECTOR_GETTERS=[getStableAttributeSelector,getIDSelector],UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS=[getStableAttributeSelector,getClassSelector,getTagNameSelector];function getSelectorFromElement(ee,re){if(!ee.isConnected)return;let te,ne=ee;for(;ne&&ne.nodeName!=="HTML";){const ie=findSelector(ne,GLOBALLY_UNIQUE_SELECTOR_GETTERS,isSelectorUniqueGlobally,re,te);if(ie)return ie;te=findSelector(ne,UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS,isSelectorUniqueAmongSiblings,re,te)||combineSelector(getPositionSelector(ne),te),ne=ne.parentElement}return te}function isGeneratedValue(ee){return/[0-9]/.test(ee)}function getIDSelector(ee){if(ee.id&&!isGeneratedValue(ee.id))return`#${CSS.escape(ee.id)}`}function getClassSelector(ee){if(ee.tagName==="BODY")return;const re=ee.classList;for(let te=0;te<re.length;te+=1){const ne=re[te];if(!isGeneratedValue(ne))return`${CSS.escape(ee.tagName)}.${CSS.escape(ne)}`}}function getTagNameSelector(ee){return CSS.escape(ee.tagName)}function getStableAttributeSelector(ee,re){if(re){const ne=te(re);if(ne)return ne}for(const ne of STABLE_ATTRIBUTES){const ie=te(ne);if(ie)return ie}function te(ne){if(ee.hasAttribute(ne))return`${CSS.escape(ee.tagName)}[${ne}="${CSS.escape(ee.getAttribute(ne))}"]`}}function getPositionSelector(ee){let re=ee.parentElement.firstElementChild,te=1;for(;re&&re!==ee;)re.tagName===ee.tagName&&(te+=1),re=re.nextElementSibling;return`${CSS.escape(ee.tagName)}:nth-of-type(${te})`}function findSelector(ee,re,te,ne,ie){for(const oe of re){const se=oe(ee,ne);if(se&&te(ee,se,ie))return combineSelector(se,ie)}}function isSelectorUniqueGlobally(ee,re,te){return ee.ownerDocument.querySelectorAll(combineSelector(re,te)).length===1}function isSelectorUniqueAmongSiblings(ee,re,te){let ne;if(te===void 0)ne=se=>se.matches(re);else{const se=combineSelector(`${re}:scope`,te);ne=ae=>ae.querySelector(se)!==null}let oe=ee.parentElement.firstElementChild;for(;oe;){if(oe!==ee&&ne(oe))return!1;oe=oe.nextElementSibling}return!0}function combineSelector(ee,re){return re?`${ee}>${re}`:ee}const MAX_DURATION_BETWEEN_CLICKS=ONE_SECOND,MAX_DISTANCE_BETWEEN_CLICKS=100;function createClickChain(ee,re){const te=[];let ne=0,ie;oe(ee);function oe(ue){ue.stopObservable.subscribe(se),te.push(ue),clearTimeout$1(ie),ie=setTimeout$1(ae,MAX_DURATION_BETWEEN_CLICKS)}function se(){ne===1&&te.every(ue=>ue.isStopped())&&(ne=2,re(te))}function ae(){clearTimeout$1(ie),ne===0&&(ne=1,se())}return{tryAppend:ue=>ne!==0?!1:te.length>0&&!areEventsSimilar(te[te.length-1].event,ue.event)?(ae(),!1):(oe(ue),!0),stop:()=>{ae()}}}function areEventsSimilar(ee,re){return ee.target===re.target&&mouseEventDistance(ee,re)<=MAX_DISTANCE_BETWEEN_CLICKS&&ee.timeStamp-re.timeStamp<=MAX_DURATION_BETWEEN_CLICKS}function mouseEventDistance(ee,re){return Math.sqrt(Math.pow(ee.clientX-re.clientX,2)+Math.pow(ee.clientY-re.clientY,2))}function listenActionEvents(ee,{onPointerDown:re,onPointerUp:te}){let ne,ie={selection:!1,input:!1,scroll:!1},oe;const se=[addEventListener$1(ee,window,"pointerdown",ae=>{isValidPointerEvent(ae)&&(ne=isSelectionEmpty(),ie={selection:!1,input:!1,scroll:!1},oe=re(ae))},{capture:!0}),addEventListener$1(ee,window,"selectionchange",()=>{(!ne||!isSelectionEmpty())&&(ie.selection=!0)},{capture:!0}),addEventListener$1(ee,window,"scroll",()=>{ie.scroll=!0},{capture:!0,passive:!0}),addEventListener$1(ee,window,"pointerup",ae=>{if(isValidPointerEvent(ae)&&oe){const ue=ie;te(oe,ae,()=>ue),oe=void 0}},{capture:!0}),addEventListener$1(ee,window,"input",()=>{ie.input=!0},{capture:!0})];return{stop:()=>{se.forEach(ae=>ae.stop())}}}function isSelectionEmpty(){const ee=window.getSelection();return!ee||ee.isCollapsed}function isValidPointerEvent(ee){return ee.target instanceof Element&&ee.isPrimary!==!1}const MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE=3;function computeFrustration(ee,re){if(isRage(ee))return re.addFrustration("rage_click"),ee.some(isDead)&&re.addFrustration("dead_click"),re.hasError&&re.addFrustration("error_click"),{isRage:!0};const te=ee.some(ne=>ne.getUserActivity().selection);return ee.forEach(ne=>{ne.hasError&&ne.addFrustration("error_click"),isDead(ne)&&!te&&ne.addFrustration("dead_click")}),{isRage:!1}}function isRage(ee){if(ee.some(re=>re.getUserActivity().selection||re.getUserActivity().scroll))return!1;for(let re=0;re<ee.length-(MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE-1);re+=1)if(ee[re+MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE-1].event.timeStamp-ee[re].event.timeStamp<=ONE_SECOND)return!0;return!1}const DEAD_CLICK_EXCLUDE_SELECTOR='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function isDead(ee){return ee.hasPageActivity||ee.getUserActivity().input||ee.getUserActivity().scroll?!1:!ee.event.target.matches(DEAD_CLICK_EXCLUDE_SELECTOR)}const CLICK_ACTION_MAX_DURATION=10*ONE_SECOND,interactionSelectorCache=new Map;function getInteractionSelector(ee){const re=interactionSelectorCache.get(ee);return interactionSelectorCache.delete(ee),re}function updateInteractionSelector(ee,re){interactionSelectorCache.set(ee,re),interactionSelectorCache.forEach((te,ne)=>{elapsed(ne,relativeNow())>CLICK_ACTION_MAX_DURATION&&interactionSelectorCache.delete(ne)})}const ACTION_CONTEXT_TIME_OUT_DELAY=5*ONE_MINUTE;function trackClickActions(ee,re,te,ne){const ie=createValueHistory({expireDelay:ACTION_CONTEXT_TIME_OUT_DELAY}),oe=new Observable$1;let se;ee.subscribe(10,()=>{ie.reset()}),ee.subscribe(5,le),ee.subscribe(11,de=>{de.reason===PageExitReason.UNLOADING&&le()});const{stop:ae}=listenActionEvents(ne,{onPointerDown:de=>processPointerDown(ne,ee,re,de,te),onPointerUp:({clickActionBase:de,hadActivityOnPointerDown:fe},he,pe)=>{startClickAction(ne,ee,re,te,ie,oe,ce,de,he,pe,fe)}});return{stop:()=>{le(),oe.notify(),ae()},actionContexts:{findActionId:de=>ie.findAll(de)}};function ce(de){if(!se||!se.tryAppend(de)){const fe=de.clone();se=createClickChain(de,he=>{finalizeClicks(he,fe)})}}function le(){se&&se.stop()}}function processPointerDown(ee,re,te,ne,ie){const oe=ee.enablePrivacyForActionName?getNodePrivacyLevel(ne.target,ee.defaultPrivacyLevel):NodePrivacyLevel.ALLOW;if(oe===NodePrivacyLevel.HIDDEN)return;const se=computeClickActionBase(ne,oe,ee);let ae=!1;return waitPageActivityEnd(re,te,ie,ee,ue=>{ae=ue.hadActivity},PAGE_ACTIVITY_VALIDATION_DELAY),{clickActionBase:se,hadActivityOnPointerDown:()=>ae}}function startClickAction(ee,re,te,ne,ie,oe,se,ae,ue,ce,le){var de;const fe=newClick(re,ie,ce,ae,ue);se(fe);const he=(de=ae==null?void 0:ae.target)===null||de===void 0?void 0:de.selector;he&&updateInteractionSelector(ue.timeStamp,he);const{stop:pe}=waitPageActivityEnd(re,te,ne,ee,ye=>{ye.hadActivity&&ye.end<fe.startClocks.timeStamp?fe.discard():ye.hadActivity?fe.stop(ye.end):le()?fe.stop(fe.startClocks.timeStamp):fe.stop()},CLICK_ACTION_MAX_DURATION),ge=re.subscribe(5,({endClocks:ye})=>{fe.stop(ye.timeStamp)}),me=oe.subscribe(()=>{fe.stop()});fe.stopObservable.subscribe(()=>{ge.unsubscribe(),pe(),me.unsubscribe()})}function computeClickActionBase(ee,re,te){const ne=ee.target.getBoundingClientRect(),ie=getSelectorFromElement(ee.target,te.actionNameAttribute);ie&&updateInteractionSelector(ee.timeStamp,ie);const oe=getActionNameFromElement(ee.target,te,re);return{type:"click",target:{width:Math.round(ne.width),height:Math.round(ne.height),selector:ie},position:{x:Math.round(ee.clientX-ne.left),y:Math.round(ee.clientY-ne.top)},name:oe.name,nameSource:oe.nameSource}}function newClick(ee,re,te,ne,ie){const oe=generateUUID(),se=clocksNow(),ae=re.add(oe,se.relative),ue=trackEventCounts({lifeCycle:ee,isChildEvent:pe=>pe.action!==void 0&&(Array.isArray(pe.action.id)?pe.action.id.includes(oe):pe.action.id===oe)});let ce=0,le;const de=[],fe=new Observable$1;function he(pe){ce===0&&(le=pe,ce=1,le?ae.close(getRelativeTime(le)):ae.remove(),ue.stop(),fe.notify())}return{event:ie,stop:he,stopObservable:fe,get hasError(){return ue.eventCounts.errorCount>0},get hasPageActivity(){return le!==void 0},getUserActivity:te,addFrustration:pe=>{de.push(pe)},startClocks:se,isStopped:()=>ce===1||ce===2,clone:()=>newClick(ee,re,te,ne,ie),validate:pe=>{if(he(),ce!==1)return;const{resourceCount:ge,errorCount:me,longTaskCount:ye}=ue.eventCounts,ve={duration:le&&elapsed(se.timeStamp,le),startClocks:se,id:oe,frustrationTypes:de,counts:{resourceCount:ge,errorCount:me,longTaskCount:ye},events:pe??[ie],event:ie,...ne};ee.notify(0,ve),ce=2},discard:()=>{he(),ce=2}}}function finalizeClicks(ee,re){const{isRage:te}=computeFrustration(ee,re);te?(ee.forEach(ne=>ne.discard()),re.stop(timeStampNow()),re.validate(ee.map(ne=>ne.event))):(re.discard(),ee.forEach(ne=>ne.validate()))}function startActionCollection(ee,re,te,ne,ie){ee.subscribe(0,ae=>ee.notify(12,processAction(ae))),re.register(0,({startTime:ae,eventType:ue})=>{if(ue!=="error"&&ue!=="resource"&&ue!=="long_task")return;const ce=oe.findActionId(ae);if(ce)return{type:ue,action:{id:ce}}});let oe={findActionId:noop$2},se=noop$2;return ie.trackUserInteractions&&({actionContexts:oe,stop:se}=trackClickActions(ee,te,ne,ie)),{addAction:ae=>{ee.notify(12,processAction(ae))},actionContexts:oe,stop:se}}function processAction(ee){const re=isAutoAction(ee)?{action:{id:ee.id,loading_time:discardNegativeDuration(toServerDuration(ee.duration)),frustration:{type:ee.frustrationTypes},error:{count:ee.counts.errorCount},long_task:{count:ee.counts.longTaskCount},resource:{count:ee.counts.resourceCount}},_dd:{action:{target:ee.target,position:ee.position,name_source:ee.nameSource}}}:void 0,te=combine({action:{id:generateUUID(),target:{name:ee.name},type:ee.type},date:ee.startClocks.timeStamp,type:"action"},re),ne=isAutoAction(ee)?ee.duration:void 0,ie=isAutoAction(ee)?void 0:ee.context,oe=isAutoAction(ee)?{events:ee.events}:{handlingStack:ee.handlingStack};return{customerContext:ie,rawRumEvent:te,duration:ne,startTime:ee.startClocks.relative,domainContext:oe}}function isAutoAction(ee){return ee.type!=="custom"}function trackConsoleError(ee){const re=initConsoleObservable([ConsoleApiName.error]).subscribe(te=>ee.notify(te.error));return{stop:()=>{re.unsubscribe()}}}function trackReportError(ee,re){const te=initReportObservable(ee,[RawReportType.cspViolation,RawReportType.intervention]).subscribe(ne=>re.notify(ne));return{stop:()=>{te.unsubscribe()}}}function startErrorCollection(ee,re){const te=new Observable$1;return trackConsoleError(te),trackRuntimeError(te),trackReportError(re,te),te.subscribe(ne=>ee.notify(14,{error:ne})),doStartErrorCollection(ee)}function doStartErrorCollection(ee){return ee.subscribe(14,({error:re,customerContext:te})=>{te=combine(re.context,te),ee.notify(12,{customerContext:te,...processError(re)})}),{addError:({error:re,handlingStack:te,componentStack:ne,startClocks:ie,context:oe})=>{const se=isError(re)?computeStackTrace(re):void 0,ae=computeRawError({stackTrace:se,originalError:re,handlingStack:te,componentStack:ne,startClocks:ie,nonErrorPrefix:"Provided",source:ErrorSource.CUSTOM,handling:"handled"});ee.notify(14,{customerContext:oe,error:ae})}}}function processError(ee){const re={date:ee.startClocks.timeStamp,error:{id:generateUUID(),message:ee.message,source:ee.source,stack:ee.stack,handling_stack:ee.handlingStack,component_stack:ee.componentStack,type:ee.type,handling:ee.handling,causes:ee.causes,source_type:"browser",fingerprint:ee.fingerprint,csp:ee.csp},type:"error"},te={error:ee.originalError,handlingStack:ee.handlingStack};return{rawRumEvent:re,startTime:ee.startClocks.relative,domainContext:te}}const alreadyMatchedEntries=new WeakSet;function matchRequestResourceEntry(ee){if(!performance||!("getEntriesByName"in performance))return;const re=performance.getEntriesByName(ee.url,"resource");if(!re.length||!("toJSON"in re[0]))return;const te=re.filter(ne=>!alreadyMatchedEntries.has(ne)).filter(ne=>hasValidResourceEntryDuration(ne)&&hasValidResourceEntryTimings(ne)).filter(ne=>isBetween(ne,ee.startClocks.relative,endTime({startTime:ee.startClocks.relative,duration:ee.duration})));if(te.length===1)return alreadyMatchedEntries.add(te[0]),te[0].toJSON()}function endTime(ee){return addDuration(ee.startTime,ee.duration)}function isBetween(ee,re,te){return ee.startTime>=re-1&&endTime(ee)<=addDuration(te,1)}const INITIAL_DOCUMENT_OUTDATED_TRACE_ID_THRESHOLD=2*ONE_MINUTE;function getDocumentTraceId(ee){const re=getDocumentTraceDataFromMeta(ee)||getDocumentTraceDataFromComment(ee);if(!(!re||re.traceTime<=dateNow()-INITIAL_DOCUMENT_OUTDATED_TRACE_ID_THRESHOLD))return re.traceId}function getDocumentTraceDataFromMeta(ee){const re=ee.querySelector("meta[name=dd-trace-id]"),te=ee.querySelector("meta[name=dd-trace-time]");return createDocumentTraceData(re&&re.content,te&&te.content)}function getDocumentTraceDataFromComment(ee){const re=findTraceComment(ee);if(re)return createDocumentTraceData(findCommaSeparatedValue(re,"trace-id"),findCommaSeparatedValue(re,"trace-time"))}function createDocumentTraceData(ee,re){const te=re&&Number(re);if(!(!ee||!te))return{traceId:ee,traceTime:te}}function findTraceComment(ee){for(let re=0;re<ee.childNodes.length;re+=1){const te=getTraceCommentFromNode(ee.childNodes[re]);if(te)return te}if(ee.body)for(let re=ee.body.childNodes.length-1;re>=0;re-=1){const te=ee.body.childNodes[re],ne=getTraceCommentFromNode(te);if(ne)return ne;if(!isTextNode(te))break}}function getTraceCommentFromNode(ee){if(ee&&isCommentNode(ee)){const re=/^\s*DATADOG;(.*?)\s*$/.exec(ee.data);if(re)return re[1]}}function getNavigationEntry(){if(supportPerformanceTimingEvent(RumPerformanceEntryType.NAVIGATION)){const te=performance.getEntriesByType(RumPerformanceEntryType.NAVIGATION)[0];if(te)return te}const ee=computeTimingsFromDeprecatedPerformanceTiming(),re={entryType:RumPerformanceEntryType.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:ee.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...re,toJSON:void 0}),...ee};return re}function computeTimingsFromDeprecatedPerformanceTiming(){const ee={},re=performance.timing;for(const te in re)if(isNumber$1(re[te])){const ne=te,ie=re[ne];ee[ne]=ie===0?0:getRelativeTime(ie)}return ee}function retrieveInitialDocumentResourceTiming(ee,re,te=getNavigationEntry){runOnReadyState(ee,"interactive",()=>{const ne=te(),ie=Object.assign(ne.toJSON(),{entryType:RumPerformanceEntryType.RESOURCE,initiatorType:FAKE_INITIAL_DOCUMENT,duration:ne.responseEnd,traceId:getDocumentTraceId(document),toJSON:()=>({...ie,toJSON:void 0})});re(ie)})}function startResourceCollection(ee,re,te,ne=createTaskQueue(),ie=retrieveInitialDocumentResourceTiming){ee.subscribe(8,ae=>{se(()=>processRequest(ae,re,te))});const oe=createPerformanceObservable(re,{type:RumPerformanceEntryType.RESOURCE,buffered:!0}).subscribe(ae=>{for(const ue of ae)isResourceEntryRequestType(ue)||se(()=>processResourceEntry(ue,re))});ie(re,ae=>{se(()=>processResourceEntry(ae,re))});function se(ae){ne.push(()=>{const ue=ae();ue&&ee.notify(12,ue)})}return{stop:()=>{oe.unsubscribe()}}}function processRequest(ee,re,te){const ne=matchRequestResourceEntry(ee),ie=ne?relativeToClocks(ne.startTime):ee.startClocks,oe=computeRequestTracingInfo(ee,re);if(!re.trackResources&&!oe)return;const se=ee.type==="xhr"?"xhr":"fetch",ae=ne?computeResourceEntryMetrics(ne):void 0,ue=ne?computeResourceEntryDuration(ne):computeRequestDuration(te,ie,ee.duration),ce=combine({date:ie.timeStamp,resource:{id:generateUUID(),type:se,duration:toServerDuration(ue),method:ee.method,status_code:ee.status,protocol:ne&&computeResourceEntryProtocol(ne),url:isLongDataUrl(ee.url)?sanitizeDataUrl(ee.url):ee.url,delivery_type:ne&&computeResourceEntryDeliveryType(ne)},type:"resource",_dd:{discarded:!re.trackResources}},oe,ae);return{startTime:ie.relative,duration:ue,rawRumEvent:ce,domainContext:{performanceEntry:ne,xhr:ee.xhr,response:ee.response,requestInput:ee.input,requestInit:ee.init,error:ee.error,isAborted:ee.isAborted,handlingStack:ee.handlingStack}}}function processResourceEntry(ee,re){const te=relativeToClocks(ee.startTime),ne=computeResourceEntryTracingInfo(ee,re);if(!re.trackResources&&!ne)return;const ie=computeResourceEntryType(ee),oe=computeResourceEntryMetrics(ee),se=computeResourceEntryDuration(ee),ae=combine({date:te.timeStamp,resource:{id:generateUUID(),type:ie,duration:toServerDuration(se),url:ee.name,status_code:discardZeroStatus(ee.responseStatus),protocol:computeResourceEntryProtocol(ee),delivery_type:computeResourceEntryDeliveryType(ee)},type:"resource",_dd:{discarded:!re.trackResources}},ne,oe);return{startTime:te.relative,duration:se,rawRumEvent:ae,domainContext:{performanceEntry:ee}}}function computeResourceEntryMetrics(ee){const{renderBlockingStatus:re}=ee;return{resource:{render_blocking_status:re,...computeResourceEntrySize(ee),...computeResourceEntryDetails(ee)}}}function computeRequestTracingInfo(ee,re){if(ee.traceSampled&&ee.traceId&&ee.spanId)return{_dd:{span_id:ee.spanId.toString(),trace_id:ee.traceId.toString(),rule_psr:re.rulePsr}}}function computeResourceEntryTracingInfo(ee,re){if(ee.traceId)return{_dd:{trace_id:ee.traceId,span_id:createSpanIdentifier().toString(),rule_psr:re.rulePsr}}}function computeRequestDuration(ee,re,te){return ee.wasInPageStateDuringPeriod("frozen",re.relative,te)?void 0:te}function discardZeroStatus(ee){return ee===0?void 0:ee}function trackViewEventCounts(ee,re,te){const{stop:ne,eventCounts:ie}=trackEventCounts({lifeCycle:ee,isChildEvent:oe=>oe.view.id===re,onChange:te});return{stop:ne,eventCounts:ie}}const FCP_MAXIMUM_DELAY=10*ONE_MINUTE;function trackFirstContentfulPaint(ee,re,te){return{stop:createPerformanceObservable(ee,{type:RumPerformanceEntryType.PAINT,buffered:!0}).subscribe(ie=>{const oe=ie.find(se=>se.name==="first-contentful-paint"&&se.startTime<re.timeStamp&&se.startTime<FCP_MAXIMUM_DELAY);oe&&te(oe.startTime)}).unsubscribe}}function trackFirstInput(ee,re,te){const ne=createPerformanceObservable(ee,{type:RumPerformanceEntryType.FIRST_INPUT,buffered:!0}).subscribe(ie=>{const oe=ie.find(se=>se.startTime<re.timeStamp);if(oe){const se=elapsed(oe.startTime,oe.processingStart);let ae;oe.target&&isElementNode(oe.target)&&(ae=getSelectorFromElement(oe.target,ee.actionNameAttribute)),te({delay:se>=0?se:0,time:oe.startTime,targetSelector:ae})}});return{stop:()=>{ne.unsubscribe()}}}function trackNavigationTimings(ee,re,te=getNavigationEntry){return waitAfterLoadEvent(ee,()=>{const ne=te();isIncompleteNavigation(ne)||re(processNavigationEntry(ne))})}function processNavigationEntry(ee){return{domComplete:ee.domComplete,domContentLoaded:ee.domContentLoadedEventEnd,domInteractive:ee.domInteractive,loadEvent:ee.loadEventEnd,firstByte:ee.responseStart>=0&&ee.responseStart<=relativeNow()?ee.responseStart:void 0}}function isIncompleteNavigation(ee){return ee.loadEventEnd<=0}function waitAfterLoadEvent(ee,re){let te;const{stop:ne}=runOnReadyState(ee,"complete",()=>{te=setTimeout$1(()=>re())});return{stop:()=>{ne(),clearTimeout$1(te)}}}const LCP_MAXIMUM_DELAY=10*ONE_MINUTE;function trackLargestContentfulPaint(ee,re,te,ne){let ie=1/0;const{stop:oe}=addEventListeners(ee,te,["pointerdown","keydown"],ue=>{ie=ue.timeStamp},{capture:!0,once:!0});let se=0;const ae=createPerformanceObservable(ee,{type:RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(ue=>{const ce=findLast(ue,le=>le.entryType===RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT&&le.startTime<ie&&le.startTime<re.timeStamp&&le.startTime<LCP_MAXIMUM_DELAY&&le.size>se);if(ce){let le;ce.element&&(le=getSelectorFromElement(ce.element,ee.actionNameAttribute)),ne({value:ce.startTime,targetSelector:le,resourceUrl:computeLcpEntryUrl(ce)}),se=ce.size}});return{stop:()=>{oe(),ae.unsubscribe()}}}function computeLcpEntryUrl(ee){return ee.url===""?void 0:ee.url}function trackFirstHidden(ee,re=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:noop$2};if(supportPerformanceTimingEvent(RumPerformanceEntryType.VISIBILITY_STATE)){const ie=performance.getEntriesByType(RumPerformanceEntryType.VISIBILITY_STATE).find(oe=>oe.name==="hidden");if(ie)return{timeStamp:ie.startTime,stop:noop$2}}let te=1/0;const{stop:ne}=addEventListeners(ee,re,["pagehide","visibilitychange"],ie=>{(ie.type==="pagehide"||document.visibilityState==="hidden")&&(te=ie.timeStamp,ne())},{capture:!0});return{get timeStamp(){return te},stop:ne}}function trackInitialViewMetrics(ee,re,te){const ne={},{stop:ie}=trackNavigationTimings(ee,le=>{re(le.loadEvent),ne.navigationTimings=le,te()}),oe=trackFirstHidden(ee),{stop:se}=trackFirstContentfulPaint(ee,oe,le=>{ne.firstContentfulPaint=le,te()}),{stop:ae}=trackLargestContentfulPaint(ee,oe,window,le=>{ne.largestContentfulPaint=le,te()}),{stop:ue}=trackFirstInput(ee,oe,le=>{ne.firstInput=le,te()});function ce(){ie(),se(),ae(),ue(),oe.stop()}return{stop:ce,initialViewMetrics:ne}}function trackCumulativeLayoutShift(ee,re,te){if(!isLayoutShiftSupported())return{stop:noop$2};let ne=0,ie;te({value:0});const oe=slidingSessionWindow(),se=createPerformanceObservable(ee,{type:RumPerformanceEntryType.LAYOUT_SHIFT,buffered:!0}).subscribe(ae=>{var ue;for(const ce of ae){if(ce.hadRecentInput||ce.startTime<re)continue;const{cumulatedValue:le,isMaxValue:de}=oe.update(ce);if(de){const fe=getFirstElementAttribution(ce.sources);ie={target:fe!=null&&fe.node?new WeakRef(fe.node):void 0,time:elapsed(re,ce.startTime),previousRect:fe==null?void 0:fe.previousRect,currentRect:fe==null?void 0:fe.currentRect,devicePixelRatio:window.devicePixelRatio}}if(le>ne){ne=le;const fe=(ue=ie==null?void 0:ie.target)===null||ue===void 0?void 0:ue.deref();te({value:round(ne,4),targetSelector:fe&&getSelectorFromElement(fe,ee.actionNameAttribute),time:ie==null?void 0:ie.time,previousRect:ie!=null&&ie.previousRect?asRumRect(ie.previousRect):void 0,currentRect:ie!=null&&ie.currentRect?asRumRect(ie.currentRect):void 0,devicePixelRatio:ie==null?void 0:ie.devicePixelRatio})}}});return{stop:()=>{se.unsubscribe()}}}function getFirstElementAttribution(ee){return ee.find(re=>!!re.node&&isElementNode(re.node))}function asRumRect({x:ee,y:re,width:te,height:ne}){return{x:ee,y:re,width:te,height:ne}}const MAX_WINDOW_DURATION=5*ONE_SECOND,MAX_UPDATE_GAP=ONE_SECOND;function slidingSessionWindow(){let ee=0,re,te,ne=0;return{update:ie=>{const oe=re===void 0||ie.startTime-te>=MAX_UPDATE_GAP||ie.startTime-re>=MAX_WINDOW_DURATION;let se;return oe?(re=te=ie.startTime,ne=ee=ie.value,se=!0):(ee+=ie.value,te=ie.startTime,se=ie.value>ne,se&&(ne=ie.value)),{cumulatedValue:ee,isMaxValue:se}}}}function isLayoutShiftSupported(){return supportPerformanceTimingEvent(RumPerformanceEntryType.LAYOUT_SHIFT)&&"WeakRef"in window}let observer,interactionCountEstimate=0,minKnownInteractionId=1/0,maxKnownInteractionId=0;function initInteractionCountPolyfill(){"interactionCount"in performance||observer||(observer=new window.PerformanceObserver(monitor(ee=>{ee.getEntries().forEach(re=>{const te=re;te.interactionId&&(minKnownInteractionId=Math.min(minKnownInteractionId,te.interactionId),maxKnownInteractionId=Math.max(maxKnownInteractionId,te.interactionId),interactionCountEstimate=(maxKnownInteractionId-minKnownInteractionId)/7+1)})})),observer.observe({type:"event",buffered:!0,durationThreshold:0}))}const getInteractionCount=()=>observer?interactionCountEstimate:window.performance.interactionCount||0,MAX_INTERACTION_ENTRIES=10,MAX_INP_VALUE=1*ONE_MINUTE;function trackInteractionToNextPaint(ee,re,te){if(!isInteractionToNextPaintSupported())return{getInteractionToNextPaint:()=>{},setViewEnd:noop$2,stop:noop$2};const{getViewInteractionCount:ne,stopViewInteractionCount:ie}=trackViewInteractionCount(te);let oe=1/0;const se=trackLongestInteractions(ne);let ae=-1,ue,ce;function le(he){for(const ge of he)ge.interactionId&&ge.startTime>=re&&ge.startTime<=oe&&se.process(ge);const pe=se.estimateP98Interaction();pe&&pe.duration!==ae&&(ae=pe.duration,ce=elapsed(re,pe.startTime),ue=getInteractionSelector(pe.startTime),!ue&&pe.target&&isElementNode(pe.target)&&(ue=getSelectorFromElement(pe.target,ee.actionNameAttribute)))}const de=createPerformanceObservable(ee,{type:RumPerformanceEntryType.FIRST_INPUT,buffered:!0}).subscribe(le),fe=createPerformanceObservable(ee,{type:RumPerformanceEntryType.EVENT,durationThreshold:40,buffered:!0}).subscribe(le);return{getInteractionToNextPaint:()=>{if(ae>=0)return{value:Math.min(ae,MAX_INP_VALUE),targetSelector:ue,time:ce};if(ne())return{value:0}},setViewEnd:he=>{oe=he,ie()},stop:()=>{fe.unsubscribe(),de.unsubscribe()}}}function trackLongestInteractions(ee){const re=[];function te(){re.sort((ne,ie)=>ie.duration-ne.duration).splice(MAX_INTERACTION_ENTRIES)}return{process(ne){const ie=re.findIndex(se=>ne.interactionId===se.interactionId),oe=re[re.length-1];ie!==-1?ne.duration>re[ie].duration&&(re[ie]=ne,te()):(re.length<MAX_INTERACTION_ENTRIES||ne.duration>oe.duration)&&(re.push(ne),te())},estimateP98Interaction(){const ne=Math.min(re.length-1,Math.floor(ee()/50));return re[ne]}}}function trackViewInteractionCount(ee){initInteractionCountPolyfill();const re=ee==="initial_load"?0:getInteractionCount();let te={stopped:!1};function ne(){return getInteractionCount()-re}return{getViewInteractionCount:()=>te.stopped?te.interactionCount:ne(),stopViewInteractionCount:()=>{te={stopped:!0,interactionCount:ne()}}}}function isInteractionToNextPaintSupported(){return supportPerformanceTimingEvent(RumPerformanceEntryType.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function trackLoadingTime(ee,re,te,ne,ie,oe,se){let ae=ie==="initial_load",ue=!0;const ce=[],le=trackFirstHidden(ne);function de(){if(!ue&&!ae&&ce.length>0){const he=Math.max(...ce);he<le.timeStamp&&se(he)}}const{stop:fe}=waitPageActivityEnd(ee,re,te,ne,he=>{ue&&(ue=!1,he.hadActivity&&ce.push(elapsed(oe.timeStamp,he.end)),de())});return{stop:()=>{fe(),le.stop()},setLoadEvent:he=>{ae&&(ae=!1,ce.push(he),de())}}}function getScrollX(){let ee;const re=window.visualViewport;return re?ee=re.pageLeft-re.offsetLeft:window.scrollX!==void 0?ee=window.scrollX:ee=window.pageXOffset||0,Math.round(ee)}function getScrollY(){let ee;const re=window.visualViewport;return re?ee=re.pageTop-re.offsetTop:window.scrollY!==void 0?ee=window.scrollY:ee=window.pageYOffset||0,Math.round(ee)}let viewportObservable;function initViewportObservable(ee){return viewportObservable||(viewportObservable=createViewportObservable(ee)),viewportObservable}function createViewportObservable(ee){return new Observable$1(re=>{const{throttled:te}=throttle$2(()=>{re.notify(getViewportDimension())},200);return addEventListener$1(ee,window,"resize",te,{capture:!0,passive:!0}).stop})}function getViewportDimension(){const ee=window.visualViewport;return ee?{width:Number(ee.width*ee.scale),height:Number(ee.height*ee.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const THROTTLE_SCROLL_DURATION=ONE_SECOND;function trackScrollMetrics(ee,re,te,ne=createScrollValuesObservable(ee)){let ie=0,oe=0,se=0;const ae=ne.subscribe(({scrollDepth:ue,scrollTop:ce,scrollHeight:le})=>{let de=!1;if(ue>ie&&(ie=ue,de=!0),le>oe){oe=le;const fe=relativeNow();se=elapsed(re.relative,fe),de=!0}de&&te({maxDepth:Math.min(ie,oe),maxDepthScrollTop:ce,maxScrollHeight:oe,maxScrollHeightTime:se})});return{stop:()=>ae.unsubscribe()}}function computeScrollValues(){const ee=getScrollY(),{height:re}=getViewportDimension(),te=Math.round((document.scrollingElement||document.documentElement).scrollHeight),ne=Math.round(re+ee);return{scrollHeight:te,scrollDepth:ne,scrollTop:ee}}function createScrollValuesObservable(ee,re=THROTTLE_SCROLL_DURATION){return new Observable$1(te=>{function ne(){te.notify(computeScrollValues())}if(window.ResizeObserver){const ie=throttle$2(ne,re,{leading:!1,trailing:!0}),oe=document.scrollingElement||document.documentElement,se=new ResizeObserver(monitor(ie.throttled));oe&&se.observe(oe);const ae=addEventListener$1(ee,window,"scroll",ie.throttled,{passive:!0});return()=>{ie.cancel(),se.disconnect(),ae.stop()}}})}function trackCommonViewMetrics(ee,re,te,ne,ie,oe,se){const ae={},{stop:ue,setLoadEvent:ce}=trackLoadingTime(ee,re,te,ne,oe,se,ge=>{ae.loadingTime=ge,ie()}),{stop:le}=trackScrollMetrics(ne,se,ge=>{ae.scroll=ge}),{stop:de}=trackCumulativeLayoutShift(ne,se.relative,ge=>{ae.cumulativeLayoutShift=ge,ie()}),{stop:fe,getInteractionToNextPaint:he,setViewEnd:pe}=trackInteractionToNextPaint(ne,se.relative,oe);return{stop:()=>{ue(),de(),le()},stopINPTracking:fe,setLoadEvent:ce,setViewEnd:pe,getCommonViewMetrics:()=>(ae.interactionToNextPaint=he(),ae)}}const THROTTLE_VIEW_UPDATE_PERIOD=3e3,SESSION_KEEP_ALIVE_INTERVAL=5*ONE_MINUTE,KEEP_TRACKING_AFTER_VIEW_DELAY=5*ONE_MINUTE;function trackViews(ee,re,te,ne,ie,oe,se,ae){const ue=new Set;let ce=de("initial_load",clocksOrigin(),ae);fe();let le;se&&(le=he(oe));function de(pe,ge,me){const ye=newView(re,te,ne,ie,ee,pe,ge,me);return ue.add(ye),ye.stopObservable.subscribe(()=>{ue.delete(ye)}),ye}function fe(){re.subscribe(10,()=>{ce=de("route_change",void 0,{name:ce.name,service:ce.service,version:ce.version,context:ce.contextManager.getContext()})}),re.subscribe(9,()=>{ce.end({sessionIsActive:!1})})}function he(pe){return pe.subscribe(({oldLocation:ge,newLocation:me})=>{areDifferentLocation(ge,me)&&(ce.end(),ce=de("route_change"))})}return{addTiming:(pe,ge=timeStampNow())=>{ce.addTiming(pe,ge)},startView:(pe,ge)=>{ce.end({endClocks:ge}),ce=de("route_change",ge,pe)},setViewContext:pe=>{ce.contextManager.setContext(pe)},setViewContextProperty:(pe,ge)=>{ce.contextManager.setContextProperty(pe,ge)},setViewName:pe=>{ce.setViewName(pe)},getViewContext:()=>ce.contextManager.getContext(),stop:()=>{le&&le.unsubscribe(),ce.end(),ue.forEach(pe=>pe.stop())}}}function newView(ee,re,te,ne,ie,oe,se=clocksNow(),ae){const ue=generateUUID(),ce=new Observable$1,le={};let de=0,fe;const he=shallowClone(ie),pe=createContextManager();let ge=!0,me=ae==null?void 0:ae.name;const ye=(ae==null?void 0:ae.service)||ne.service,ve=(ae==null?void 0:ae.version)||ne.version,be=ae==null?void 0:ae.context;be&&pe.setContext(be);const _e={id:ue,name:me,startClocks:se,service:ye,version:ve,context:be};ee.notify(1,_e),ee.notify(2,_e);const{throttled:Ie,cancel:Te}=throttle$2(fr,THROTTLE_VIEW_UPDATE_PERIOD,{leading:!1}),{setLoadEvent:Se,setViewEnd:Oe,stop:Ce,stopINPTracking:we,getCommonViewMetrics:Re}=trackCommonViewMetrics(ee,re,te,ne,hr,oe,se),{stop:Ne,initialViewMetrics:Ue}=oe==="initial_load"?trackInitialViewMetrics(ne,Se,hr):{stop:noop$2,initialViewMetrics:{}},{stop:Fe,eventCounts:Ve}=trackViewEventCounts(ee,ue,hr),He=setInterval$1(fr,SESSION_KEEP_ALIVE_INTERVAL),ur=ee.subscribe(11,dr=>{dr.reason===PageExitReason.UNLOADING&&fr()});fr(),pe.changeObservable.subscribe(hr);function Ge(){ee.notify(3,{id:ue,name:me,context:pe.getContext(),startClocks:se})}function hr(){Ge(),Ie()}function fr(){Te(),Ge(),de+=1;const dr=fe===void 0?timeStampNow():fe.timeStamp;ee.notify(4,{customTimings:le,documentVersion:de,id:ue,name:me,service:ye,version:ve,context:pe.getContext(),loadingType:oe,location:he,startClocks:se,commonViewMetrics:Re(),initialViewMetrics:Ue,duration:elapsed(se.timeStamp,dr),isActive:fe===void 0,sessionIsActive:ge,eventCounts:Ve})}return{get name(){return me},service:ye,version:ve,contextManager:pe,stopObservable:ce,end(dr={}){var Qe,Bt;fe||(fe=(Qe=dr.endClocks)!==null&&Qe!==void 0?Qe:clocksNow(),ge=(Bt=dr.sessionIsActive)!==null&&Bt!==void 0?Bt:!0,ee.notify(5,{endClocks:fe}),ee.notify(6,{endClocks:fe}),clearInterval$1(He),Oe(fe.relative),Ce(),ur.unsubscribe(),fr(),setTimeout$1(()=>{this.stop()},KEEP_TRACKING_AFTER_VIEW_DELAY))},stop(){Ne(),Fe(),we(),ce.notify()},addTiming(dr,Qe){if(fe)return;const Bt=looksLikeRelativeTime(Qe)?Qe:elapsed(se.timeStamp,Qe);le[sanitizeTiming(dr)]=Bt,hr()},setViewName(dr){me=dr,fr()}}}function sanitizeTiming(ee){const re=ee.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return re!==ee&&display.warn(`Invalid timing name: ${ee}, sanitized to: ${re}`),re}function areDifferentLocation(ee,re){return ee.pathname!==re.pathname||!isHashAnAnchor(re.hash)&&getPathFromHash(re.hash)!==getPathFromHash(ee.hash)}function isHashAnAnchor(ee){const re=ee.substring(1);return re!==""&&!!document.getElementById(re)}function getPathFromHash(ee){const re=ee.indexOf("?");return re<0?ee:ee.slice(0,re)}function startViewCollection(ee,re,te,ne,ie,oe,se,ae,ue,ce){return ee.subscribe(4,le=>ee.notify(12,processViewUpdate(le,te,ae))),re.register(0,({startTime:le,eventType:de})=>{const{service:fe,version:he,id:pe,name:ge,context:me}=ue.findView(le);return{type:de,service:fe,version:he,context:me,view:{id:pe,name:ge}}}),trackViews(ne,ee,ie,oe,te,se,!te.trackViewsManually,ce)}function processViewUpdate(ee,re,te){var ne,ie,oe,se,ae,ue,ce,le,de,fe,he,pe,ge,me,ye,ve,be,_e;const Ie=te.getReplayStats(ee.id),Te=(ie=(ne=ee.commonViewMetrics)===null||ne===void 0?void 0:ne.cumulativeLayoutShift)===null||ie===void 0?void 0:ie.devicePixelRatio,Se={_dd:{document_version:ee.documentVersion,replay_stats:Ie,cls:Te?{device_pixel_ratio:Te}:void 0,configuration:{start_session_replay_recording_manually:re.startSessionReplayRecordingManually}},date:ee.startClocks.timeStamp,type:"view",view:{action:{count:ee.eventCounts.actionCount},frustration:{count:ee.eventCounts.frustrationCount},cumulative_layout_shift:(oe=ee.commonViewMetrics.cumulativeLayoutShift)===null||oe===void 0?void 0:oe.value,cumulative_layout_shift_time:toServerDuration((se=ee.commonViewMetrics.cumulativeLayoutShift)===null||se===void 0?void 0:se.time),cumulative_layout_shift_target_selector:(ae=ee.commonViewMetrics.cumulativeLayoutShift)===null||ae===void 0?void 0:ae.targetSelector,first_byte:toServerDuration((ue=ee.initialViewMetrics.navigationTimings)===null||ue===void 0?void 0:ue.firstByte),dom_complete:toServerDuration((ce=ee.initialViewMetrics.navigationTimings)===null||ce===void 0?void 0:ce.domComplete),dom_content_loaded:toServerDuration((le=ee.initialViewMetrics.navigationTimings)===null||le===void 0?void 0:le.domContentLoaded),dom_interactive:toServerDuration((de=ee.initialViewMetrics.navigationTimings)===null||de===void 0?void 0:de.domInteractive),error:{count:ee.eventCounts.errorCount},first_contentful_paint:toServerDuration(ee.initialViewMetrics.firstContentfulPaint),first_input_delay:toServerDuration((fe=ee.initialViewMetrics.firstInput)===null||fe===void 0?void 0:fe.delay),first_input_time:toServerDuration((he=ee.initialViewMetrics.firstInput)===null||he===void 0?void 0:he.time),first_input_target_selector:(pe=ee.initialViewMetrics.firstInput)===null||pe===void 0?void 0:pe.targetSelector,interaction_to_next_paint:toServerDuration((ge=ee.commonViewMetrics.interactionToNextPaint)===null||ge===void 0?void 0:ge.value),interaction_to_next_paint_time:toServerDuration((me=ee.commonViewMetrics.interactionToNextPaint)===null||me===void 0?void 0:me.time),interaction_to_next_paint_target_selector:(ye=ee.commonViewMetrics.interactionToNextPaint)===null||ye===void 0?void 0:ye.targetSelector,is_active:ee.isActive,name:ee.name,largest_contentful_paint:toServerDuration((ve=ee.initialViewMetrics.largestContentfulPaint)===null||ve===void 0?void 0:ve.value),largest_contentful_paint_target_selector:(be=ee.initialViewMetrics.largestContentfulPaint)===null||be===void 0?void 0:be.targetSelector,load_event:toServerDuration((_e=ee.initialViewMetrics.navigationTimings)===null||_e===void 0?void 0:_e.loadEvent),loading_time:discardNegativeDuration(toServerDuration(ee.commonViewMetrics.loadingTime)),loading_type:ee.loadingType,long_task:{count:ee.eventCounts.longTaskCount},performance:computeViewPerformanceData(ee.commonViewMetrics,ee.initialViewMetrics),resource:{count:ee.eventCounts.resourceCount},time_spent:toServerDuration(ee.duration)},display:ee.commonViewMetrics.scroll?{scroll:{max_depth:ee.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:ee.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:ee.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:toServerDuration(ee.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,session:{has_replay:Ie?!0:void 0,is_active:ee.sessionIsActive?void 0:!1},privacy:{replay_level:re.defaultPrivacyLevel}};return isEmptyObject$1(ee.customTimings)||(Se.view.custom_timings=mapValues(ee.customTimings,toServerDuration)),{rawRumEvent:Se,startTime:ee.startClocks.relative,duration:ee.duration,domainContext:{location:ee.location}}}function computeViewPerformanceData({cumulativeLayoutShift:ee,interactionToNextPaint:re},{firstContentfulPaint:te,firstInput:ne,largestContentfulPaint:ie}){return{cls:ee&&{score:ee.value,timestamp:toServerDuration(ee.time),target_selector:ee.targetSelector,previous_rect:ee.previousRect,current_rect:ee.currentRect},fcp:te&&{timestamp:toServerDuration(te)},fid:ne&&{duration:toServerDuration(ne.delay),timestamp:toServerDuration(ne.time),target_selector:ne.targetSelector},inp:re&&{duration:toServerDuration(re.value),timestamp:toServerDuration(re.time),target_selector:re.targetSelector},lcp:ie&&{timestamp:toServerDuration(ie.value),target_selector:ie.targetSelector,resource_url:ie.resourceUrl}}}const RUM_SESSION_KEY="rum";function startRumSessionManager(ee,re,te){const ne=startSessionManager(ee,RUM_SESSION_KEY,ie=>computeSessionState(ee,ie),te);return ne.expireObservable.subscribe(()=>{re.notify(9)}),ne.renewObservable.subscribe(()=>{re.notify(10)}),ne.sessionStateUpdateObservable.subscribe(({previousState:ie,newState:oe})=>{if(!ie.forcedReplay&&oe.forcedReplay){const se=ne.findSession();se&&(se.isReplayForced=!0)}}),{findTrackedSession:ie=>{const oe=ne.findSession(ie);if(!(!oe||!isTypeTracked(oe.trackingType)))return{id:oe.id,sessionReplay:oe.trackingType==="1"?1:oe.isReplayForced?2:0,anonymousId:oe.anonymousId}},expire:ne.expire,expireObservable:ne.expireObservable,setForcedReplay:()=>ne.updateSessionState({forcedReplay:"1"})}}function startRumSessionManagerStub(){const ee={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:bridgeSupports("records")?1:0};return{findTrackedSession:()=>ee,expire:noop$2,expireObservable:new Observable$1,setForcedReplay:noop$2}}function computeSessionState(ee,re){let te;return hasValidRumSession(re)?te=re:performDraw(ee.sessionSampleRate)?performDraw(ee.sessionReplaySampleRate)?te="1":te="2":te="0",{trackingType:te,isTracked:isTypeTracked(te)}}function hasValidRumSession(ee){return ee==="0"||ee==="1"||ee==="2"}function isTypeTracked(ee){return ee==="2"||ee==="1"}function startRumBatch(ee,re,te,ne,ie,oe,se){const ae=ee.replica,ue=startBatchWithReplica(ee,{endpoint:ee.rumEndpointBuilder,encoder:se(2)},ae&&{endpoint:ae.rumEndpointBuilder,transformMessage:ce=>combine(ce,{application:{id:ae.applicationId}}),encoder:se(3)},ne,ie,oe);return re.subscribe(13,ce=>{ce.type==="view"?ue.upsert(ce,ce.view.id):ue.add(ce)}),te.subscribe(ce=>ue.add(ce,isTelemetryReplicationAllowed(ee))),ue}function startRumEventBridge(ee){const re=getEventBridge();ee.subscribe(13,te=>{re.send("rum",te)})}const URL_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startUrlContexts(ee,re,te,ne){const ie=createValueHistory({expireDelay:URL_CONTEXT_TIME_OUT_DELAY});let oe;ee.subscribe(1,({startClocks:ue})=>{const ce=ne.href;ie.add(ae({url:ce,referrer:oe||document.referrer}),ue.relative),oe=ce}),ee.subscribe(6,({endClocks:ue})=>{ie.closeActive(ue.relative)});const se=te.subscribe(({newLocation:ue})=>{const ce=ie.find();if(ce){const le=relativeNow();ie.closeActive(le),ie.add(ae({url:ue.href,referrer:ce.referrer}),le)}});function ae({url:ue,referrer:ce}){return{url:ue,referrer:ce}}return re.register(0,({startTime:ue,eventType:ce})=>{const{url:le,referrer:de}=ie.find(ue);return{type:ce,view:{url:le,referrer:de}}}),{findUrl:ue=>ie.find(ue),getAllEntries:()=>ie.getAllEntries(),getDeletedEntries:()=>ie.getDeletedEntries(),stop:()=>{se.unsubscribe(),ie.stop()}}}function createLocationChangeObservable(ee,re){let te=shallowClone(re);return new Observable$1(ne=>{const{stop:ie}=trackHistory(ee,se),{stop:oe}=trackHash(ee,se);function se(){if(te.href===re.href)return;const ae=shallowClone(re);ne.notify({newLocation:ae,oldLocation:te}),te=ae}return()=>{ie(),oe()}})}function trackHistory(ee,re){const{stop:te}=instrumentMethod(getHistoryInstrumentationTarget("pushState"),"pushState",({onPostCall:oe})=>{oe(re)}),{stop:ne}=instrumentMethod(getHistoryInstrumentationTarget("replaceState"),"replaceState",({onPostCall:oe})=>{oe(re)}),{stop:ie}=addEventListener$1(ee,window,"popstate",re);return{stop:()=>{te(),ne(),ie()}}}function trackHash(ee,re){return addEventListener$1(ee,window,"hashchange",re)}function getHistoryInstrumentationTarget(ee){return Object.prototype.hasOwnProperty.call(history,ee)?history:History.prototype}const FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startFeatureFlagContexts(ee,re,te){const ne=createValueHistory({expireDelay:FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY});return ee.subscribe(1,({startClocks:ie})=>{ne.add({},ie.relative)}),ee.subscribe(6,({endClocks:ie})=>{ne.closeActive(ie.relative)}),re.register(0,({startTime:ie,eventType:oe})=>{if(!te.trackFeatureFlagsForEvents.concat(["view","error"]).includes(oe))return;const ae=ne.find(ie);if(!(!ae||isEmptyObject$1(ae)))return{type:oe,feature_flags:ae}}),{addFeatureFlagEvaluation:(ie,oe)=>{const se=ne.find();se&&(se[ie]=oe)}}}const MEASURES_PERIOD_DURATION=10*ONE_SECOND;let currentPeriodMeasures,batchHasRumEvent;function startCustomerDataTelemetry(ee,re,te,ne){re.enabled&&performDraw(ee.customerDataTelemetrySampleRate)&&(initCurrentPeriodMeasures(),batchHasRumEvent=!1,te.subscribe(13,()=>{batchHasRumEvent=!0}),ne.subscribe(({bytesCount:oe,messagesCount:se})=>{batchHasRumEvent&&(currentPeriodMeasures.batchCount+=1,updateMeasure(currentPeriodMeasures.batchBytesCount,oe),updateMeasure(currentPeriodMeasures.batchMessagesCount,se))}),setInterval$1(sendCurrentPeriodMeasures,MEASURES_PERIOD_DURATION))}function sendCurrentPeriodMeasures(){currentPeriodMeasures.batchCount!==0&&(addTelemetryDebug("Customer data measures",currentPeriodMeasures),initCurrentPeriodMeasures())}function createMeasure(){return{min:1/0,max:0,sum:0}}function updateMeasure(ee,re){ee.sum+=re,ee.min=Math.min(ee.min,re),ee.max=Math.max(ee.max,re)}function initCurrentPeriodMeasures(){currentPeriodMeasures={batchCount:0,batchBytesCount:createMeasure(),batchMessagesCount:createMeasure()}}const MAX_PAGE_STATE_ENTRIES=4e3,MAX_PAGE_STATE_ENTRIES_SELECTABLE=500,PAGE_STATE_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startPageStateHistory(ee,re,te=MAX_PAGE_STATE_ENTRIES_SELECTABLE){const ne=createValueHistory({expireDelay:PAGE_STATE_CONTEXT_TIME_OUT_DELAY,maxEntries:MAX_PAGE_STATE_ENTRIES});let ie;se(getPageState(),relativeNow());const{stop:oe}=addEventListeners(re,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],ue=>{se(computePageState(ue),ue.timeStamp)},{capture:!0});function se(ue,ce=relativeNow()){ue!==ie&&(ie=ue,ne.closeActive(ce),ne.add({state:ie,startTime:ce},ce))}function ae(ue,ce,le){return ne.findAll(ce,le).some(de=>de.state===ue)}return ee.register(0,({startTime:ue,duration:ce=0,eventType:le})=>{if(le==="view"){const de=ne.findAll(ue,ce);return{type:le,_dd:{page_states:processPageStates(de,ue,te)}}}if(le==="action"||le==="error")return{type:le,view:{in_foreground:ae("active",ue,0)}}}),{wasInPageStateDuringPeriod:ae,addPageState:se,stop:()=>{oe(),ne.stop()}}}function processPageStates(ee,re,te){if(ee.length!==0)return ee.slice(-te).reverse().map(({state:ne,startTime:ie})=>({state:ne,start:toServerDuration(elapsed(re,ie))}))}function computePageState(ee){return ee.type==="freeze"?"frozen":ee.type==="pagehide"?ee.persisted?"frozen":"terminated":getPageState()}function getPageState(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function startDisplayContext(ee){let re;const te=requestAnimationFrame(monitor(()=>{re=getViewportDimension()})),ne=initViewportObservable(ee).subscribe(ie=>{re=ie}).unsubscribe;return{get:()=>re?{viewport:re}:void 0,stop:()=>{ne(),te&&cancelAnimationFrame(te)}}}const WATCH_COOKIE_INTERVAL_DELAY=ONE_SECOND;function createCookieObservable(ee){return new Observable$1(re=>watchCookieStrategy(ee,te=>re.notify(te)))}function watchCookieStrategy(ee,re){const te=findCommaSeparatedValue(document.cookie,ee),ne=setInterval$1(()=>{const ie=findCommaSeparatedValue(document.cookie,ee);ie!==te&&re(ie)},WATCH_COOKIE_INTERVAL_DELAY);return()=>clearInterval$1(ne)}const CI_VISIBILITY_TEST_ID_COOKIE_NAME="datadog-ci-visibility-test-execution-id";function startCiVisibilityContext(ee,re=createCookieObservable(CI_VISIBILITY_TEST_ID_COOKIE_NAME)){var te;let ne=getInitCookie(CI_VISIBILITY_TEST_ID_COOKIE_NAME)||((te=window.Cypress)===null||te===void 0?void 0:te.env("traceId"));const ie=re.subscribe(oe=>{ne=oe});return ee.register(0,({eventType:oe})=>{if(typeof ne=="string")return{type:oe,session:{type:"ci_test"},ci_test:{test_execution_id:ne}}}),{stop:()=>{ie.unsubscribe()}}}function startLongAnimationFrameCollection(ee,re){const te=createPerformanceObservable(re,{type:RumPerformanceEntryType.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(ne=>{for(const ie of ne){const oe=relativeToClocks(ie.startTime),se={date:oe.timeStamp,long_task:{id:generateUUID(),entry_type:"long-animation-frame",duration:toServerDuration(ie.duration),blocking_duration:toServerDuration(ie.blockingDuration),first_ui_event_timestamp:toServerDuration(ie.firstUIEventTimestamp),render_start:toServerDuration(ie.renderStart),style_and_layout_start:toServerDuration(ie.styleAndLayoutStart),start_time:toServerDuration(ie.startTime),scripts:ie.scripts.map(ae=>({duration:toServerDuration(ae.duration),pause_duration:toServerDuration(ae.pauseDuration),forced_style_and_layout_duration:toServerDuration(ae.forcedStyleAndLayoutDuration),start_time:toServerDuration(ae.startTime),execution_start:toServerDuration(ae.executionStart),source_url:ae.sourceURL,source_function_name:ae.sourceFunctionName,source_char_position:ae.sourceCharPosition,invoker:ae.invoker,invoker_type:ae.invokerType,window_attribution:ae.windowAttribution}))},type:"long_task",_dd:{discarded:!1}};ee.notify(12,{rawRumEvent:se,startTime:oe.relative,duration:ie.duration,domainContext:{performanceEntry:ie}})}});return{stop:()=>te.unsubscribe()}}function startLongTaskCollection(ee,re){const te=createPerformanceObservable(re,{type:RumPerformanceEntryType.LONG_TASK,buffered:!0}).subscribe(ne=>{for(const ie of ne){if(ie.entryType!==RumPerformanceEntryType.LONG_TASK||!re.trackLongTasks)break;const oe=relativeToClocks(ie.startTime),se={date:oe.timeStamp,long_task:{id:generateUUID(),entry_type:"long-task",duration:toServerDuration(ie.duration)},type:"long_task",_dd:{discarded:!1}};ee.notify(12,{rawRumEvent:se,startTime:oe.relative,duration:ie.duration,domainContext:{performanceEntry:ie}})}});return{stop(){te.unsubscribe()}}}function createHooks(){const ee={};return{register(re,te){return ee[re]||(ee[re]=[]),ee[re].push(te),{unregister:()=>{ee[re]=ee[re].filter(ne=>ne!==te)}}},triggerHook(re,te){const ie=(ee[re]||[]).map(oe=>oe(te));return combine(...ie)}}}function startSyntheticsContext(ee){ee.register(0,({eventType:re})=>{const te=getSyntheticsTestId(),ne=getSyntheticsResultId();if(!(!te||!ne))return{type:re,session:{type:"synthetics"},synthetics:{test_id:te,result_id:ne,injected:willSyntheticsInjectRum()}}})}function limitModification(ee,re,te){const ne=deepClone(ee),ie=te(ne);return objectEntries(re).forEach(([oe,se])=>setValueAtPath(ee,ne,oe.split(/\.|(?=\[\])/),se)),ie}function setValueAtPath(ee,re,te,ne){const[ie,...oe]=te;if(ie==="[]"){Array.isArray(ee)&&Array.isArray(re)&&ee.forEach((se,ae)=>setValueAtPath(se,re[ae],oe,ne));return}if(!(!isValidObject$1(ee)||!isValidObject$1(re))){if(oe.length>0)return setValueAtPath(ee[ie],re[ie],oe,ne);setNestedValue(ee,ie,re[ie],ne)}}function setNestedValue(ee,re,te,ne){const ie=getType(te);ie===ne?ee[re]=sanitize(te):ne==="object"&&(ie==="undefined"||ie==="null")&&(ee[re]={})}function isValidObject$1(ee){return getType(ee)==="object"}const VIEW_MODIFIABLE_FIELD_PATHS={"view.name":"string","view.url":"string","view.referrer":"string"},USER_CUSTOMIZABLE_FIELD_PATHS={context:"object"},ROOT_MODIFIABLE_FIELD_PATHS={service:"string",version:"string"};let modifiableFieldPathsByEvent;function startRumAssembly(ee,re,te,ne,ie,oe,se,ae,ue){modifiableFieldPathsByEvent={view:{"view.performance.lcp.resource_url":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS},error:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},resource:{"resource.url":"string",...isExperimentalFeatureEnabled(ExperimentalFeature.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},action:{"action.target.name":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},long_task:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS},vital:{...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS}};const ce={error:createEventRateLimiter("error",ee.eventRateLimiterThreshold,ue),action:createEventRateLimiter("action",ee.eventRateLimiterThreshold,ue),vital:createEventRateLimiter("vital",ee.eventRateLimiterThreshold,ue)};re.subscribe(12,({startTime:le,duration:de,rawRumEvent:fe,domainContext:he,customerContext:pe})=>{const ge=ie.findView(le),me=oe.findUrl(le),ye=ne.findTrackedSession(le);if(ye&&ge&&!me&&isExperimentalFeatureEnabled(ExperimentalFeature.MISSING_URL_CONTEXT_TELEMETRY)&&addTelemetryDebug("Missing URL entry",{debug:{eventType:fe.type,startTime:le,urlEntries:oe.getAllEntries(),urlDeletedEntries:oe.getDeletedEntries(),viewEntries:ie.getAllEntries(),viewDeletedEntries:ie.getDeletedEntries()}}),ye&&ge&&me){const ve=ae(),be={_dd:{format_version:2,drift:currentDrift(),configuration:{session_sample_rate:round(ee.sessionSampleRate,3),session_replay_sample_rate:round(ee.sessionReplaySampleRate,3)},browser_sdk_version:canUseEventBridge()?"6.6.3":void 0},application:{id:ee.applicationId},date:timeStampNow(),source:"browser",session:{id:ye.id,type:"user"},display:se.get(),connectivity:getConnectivity(),context:ve.context},_e=combine(be,te.triggerHook(0,{eventType:fe.type,startTime:le,duration:de}),{context:pe},fe);"has_replay"in _e.session||(_e.session.has_replay=ve.hasReplay),_e.type==="view"&&(_e.session.sampled_for_replay=ye.sessionReplay===1),ye.anonymousId&&!ve.user.anonymous_id&&ee.trackAnonymousUser&&(ve.user.anonymous_id=ye.anonymousId),isEmptyObject$1(ve.user)||(_e.usr=ve.user),!isEmptyObject$1(ve.account)&&ve.account.id&&(_e.account=ve.account),shouldSend(_e,ee.beforeSend,he,ce)&&(isEmptyObject$1(_e.context)&&delete _e.context,re.notify(13,_e))}})}function shouldSend(ee,re,te,ne){var ie;if(re){const se=limitModification(ee,modifiableFieldPathsByEvent[ee.type],ae=>re(ae,te));if(se===!1&&ee.type!=="view")return!1;se===!1&&display.warn("Can't dismiss view events using beforeSend!")}return!((ie=ne[ee.type])===null||ie===void 0?void 0:ie.isLimitReached())}function buildCommonContext(ee,re,te,ne){return{context:ee.getContext(),user:re.getContext(),account:te.getContext(),hasReplay:ne.isRecording()?!0:void 0}}function startRum(ee,re,te,ne,ie,oe,se){const ae=[],ue=new LifeCycle,ce=createHooks();ue.subscribe(13,$e=>sendToExtension("rum",$e));const le=startRumTelemetry(ee);le.setContextProvider(()=>{var $e,ke;return{application:{id:ee.applicationId},session:{id:($e=pe.findTrackedSession())===null||$e===void 0?void 0:$e.id},view:{id:(ke=ve.findView())===null||ke===void 0?void 0:ke.id},action:{id:Re.findActionId()}}});const de=$e=>{ue.notify(14,{error:$e}),addTelemetryDebug("Error reported to customer",{"error.message":$e.message})},fe=createPageMayExitObservable(ee),he=fe.subscribe($e=>{ue.notify(11,$e)});ae.push(()=>he.unsubscribe());const pe=canUseEventBridge()?startRumSessionManagerStub():startRumSessionManager(ee,ue,oe);if(canUseEventBridge())startRumEventBridge(ue);else{const $e=startRumBatch(ee,ue,le.observable,de,fe,pe.expireObservable,ie);ae.push(()=>$e.stop()),startCustomerDataTelemetry(ee,le,ue,$e.flushObservable)}const ge=createDOMMutationObservable(),me=createLocationChangeObservable(ee,location),ye=startPageStateHistory(ce,ee),ve=startViewHistory(ue),be=startUrlContexts(ue,ce,me,location),_e=startFeatureFlagContexts(ue,ce,ee),{observable:Ie,stop:Te}=createWindowOpenObservable();ae.push(Te);const Se=startGlobalContext(ee),Oe=startUserContext(ee),Ce=startAccountContext(ee),we=()=>buildCommonContext(Se,Oe,Ce,re),{actionContexts:Re,addAction:Ne,stop:Ue}=startRumEventCollection(ue,ce,ee,pe,ye,ge,Ie,be,ve,we,de);ae.push(Ue),drainPreStartTelemetry();const{addTiming:Fe,startView:Ve,setViewName:He,setViewContext:ur,setViewContextProperty:Ge,getViewContext:hr,stop:fr}=startViewCollection(ue,ce,ee,location,ge,Ie,me,re,ve,ne);ae.push(fr);const{stop:dr}=startResourceCollection(ue,ee,ye);if(ae.push(dr),ee.trackLongTasks)if(supportPerformanceTimingEvent(RumPerformanceEntryType.LONG_ANIMATION_FRAME)){const{stop:$e}=startLongAnimationFrameCollection(ue,ee);ae.push($e)}else startLongTaskCollection(ue,ee);const{addError:Qe}=startErrorCollection(ue,ee);startRequestCollection(ue,ee,pe,we);const Bt=startVitalCollection(ue,ye,se),Ir=startInternalContext(ee.applicationId,pe,ve,Re,be);return ae.push(()=>te.stop()),{addAction:Ne,addError:Qe,addTiming:Fe,addFeatureFlagEvaluation:_e.addFeatureFlagEvaluation,startView:Ve,setViewContext:ur,setViewContextProperty:Ge,getViewContext:hr,setViewName:He,lifeCycle:ue,viewHistory:ve,session:pe,stopSession:()=>pe.expire(),getInternalContext:Ir.get,startDurationVital:Bt.startDurationVital,stopDurationVital:Bt.stopDurationVital,addDurationVital:Bt.addDurationVital,globalContext:Se,userContext:Oe,accountContext:Ce,stop:()=>{ae.forEach($e=>$e())}}}function startRumTelemetry(ee){const re=startTelemetry("browser-rum-sdk",ee);if(canUseEventBridge()){const te=getEventBridge();re.observable.subscribe(ne=>te.send("internal_telemetry",ne))}return re}function startRumEventCollection(ee,re,te,ne,ie,oe,se,ae,ue,ce,le){const de=startActionCollection(ee,re,oe,se,te),fe=startDisplayContext(te),he=startCiVisibilityContext(re);return startSyntheticsContext(re),startRumAssembly(te,ee,re,ne,ue,ae,fe,ce,le),{pageStateHistory:ie,addAction:de.addAction,actionContexts:de.actionContexts,stop:()=>{de.stop(),he.stop(),fe.stop(),ue.stop(),ie.stop(),ae.stop()}}}function getSessionReplayUrl(ee,{session:re,viewContext:te,errorType:ne}){const ie=re?re.id:"no-session-id",oe=[];ne!==void 0&&oe.push(`error-type=${ne}`),te&&(oe.push(`seed=${te.id}`),oe.push(`from=${te.startClocks.timeStamp}`));const se=getDatadogSiteUrl(ee),ae=`/rum/replay/sessions/${ie}`;return`${se}${ae}?${oe.join("&")}`}function getDatadogSiteUrl(ee){const re=ee.site,te=ee.subdomain||getSiteDefaultSubdomain(ee);return`https://${te?`${te}.`:""}${re}`}function getSiteDefaultSubdomain(ee){switch(ee.site){case INTAKE_SITE_US1:case INTAKE_SITE_EU1:return"app";case INTAKE_SITE_STAGING:return"dd";default:return}}const MAX_STATS_HISTORY=1e3;let statsPerView;function getSegmentsCount(ee){return getOrCreateReplayStats(ee).segments_count}function addSegment(ee){getOrCreateReplayStats(ee).segments_count+=1}function addRecord(ee){getOrCreateReplayStats(ee).records_count+=1}function addWroteData(ee,re){getOrCreateReplayStats(ee).segments_total_raw_size+=re}function getReplayStats(ee){return statsPerView==null?void 0:statsPerView.get(ee)}function getOrCreateReplayStats(ee){statsPerView||(statsPerView=new Map);let re;return statsPerView.has(ee)?re=statsPerView.get(ee):(re={records_count:0,segments_count:0,segments_total_raw_size:0},statsPerView.set(ee,re),statsPerView.size>MAX_STATS_HISTORY&&deleteOldestStats()),re}function deleteOldestStats(){if(!statsPerView)return;const ee=statsPerView.keys().next().value;ee&&statsPerView.delete(ee)}function createDeflateEncoder(ee,re,te){let ne=0,ie=[],oe,se=0;const ae=[],{stop:ue}=addEventListener$1(ee,re,"message",({data:de})=>{if(de.type!=="wrote"||de.streamId!==te)return;ne+=de.additionalBytesCount,ie.push(de.result),oe=de.trailer;const fe=ae.shift();fe&&fe.id===de.id?fe.writeCallback?fe.writeCallback(de.result.byteLength):fe.finishCallback&&fe.finishCallback():(ue(),addTelemetryDebug("Worker responses received out of order."))});function ce(){const de=ie.length===0?new Uint8Array(0):concatBuffers(ie.concat(oe)),fe={rawBytesCount:ne,output:de,outputBytesCount:de.byteLength,encoding:"deflate"};return ne=0,ie=[],fe}function le(){se>0&&(re.postMessage({action:"reset",streamId:te}),se=0)}return{isAsync:!0,get isEmpty(){return se===0},write(de,fe){re.postMessage({action:"write",id:se,data:de,streamId:te}),ae.push({id:se,writeCallback:fe,data:de}),se+=1},finish(de){le(),ae.length?(ae.forEach(fe=>{delete fe.writeCallback}),ae[ae.length-1].finishCallback=()=>de(ce())):de(ce())},finishSync(){le();const de=ae.map(fe=>(delete fe.writeCallback,delete fe.finishCallback,fe.data)).join("");return{...ce(),pendingData:de}},estimateEncodedBytesCount(de){return de.length/8},stop(){ue()}}}function reportScriptLoadingError({configuredUrl:ee,error:re,source:te,scriptType:ne}){if(display.error(`${te} failed to start: an error occurred while initializing the ${ne}:`,re),re instanceof Event||re instanceof Error&&isMessageCspRelated(re.message)){let ie;ee?ie=`Please make sure the ${ne} URL ${ee} is correct and CSP is correctly configured.`:ie="Please make sure CSP is correctly configured.",display.error(`${ie} See documentation at ${DOCS_ORIGIN}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else ne==="worker"&&addTelemetryError(re)}function isMessageCspRelated(ee){return ee.includes("Content Security Policy")||ee.includes("requires 'TrustedScriptURL'")}const INITIALIZATION_TIME_OUT_DELAY=30*ONE_SECOND;function createDeflateWorker(ee){return new Worker(ee.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){const e=t.reduce(((t,e)=>t+e.length),0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},et=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-J)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=L(s.adler,h,o,l):2===s.state.wrap&&(s.adler=T(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},at=function(t,e){for(var a,n;;){if(t.lookahead<J){if(et(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=tt(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},nt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(et(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=tt(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var it=[new rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(et(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)})),new rt(4,4,8,4,at),new rt(4,5,16,8,at),new rt(4,6,32,32,at),new rt(4,4,16,16,nt),new rt(8,16,32,32,nt),new rt(8,16,128,128,nt),new rt(8,32,128,256,nt),new rt(32,128,258,1024,nt),new rt(32,258,258,4096,nt)];function st(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var ht=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=it[e.level].max_lazy,e.good_match=it[e.level].good_length,e.nice_match=it[e.level].nice_length,e.max_chain_length=it[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},lt=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(et(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(et(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):it[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},_t=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},ot=new Uint8Array(256),dt=0;dt<256;dt++)ot[dt]=dt>=252?6:dt>=248?5:dt>=240?4:dt>=224?3:dt>=192?2:1;ot[254]=ot[254]=1;var ut=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ft=Object.prototype.toString;function ct(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ut,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new st;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,ht(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ft.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,et(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,et(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function pt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function gt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}ct.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ft.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=lt(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=_t(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},ct.prototype.onData=function(t){this.chunks.push(t)},ct.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",(n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.6.3"};case"write":{let n=e.get(a.streamId);n||(n=new ct,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:gt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){pt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}}))}catch(t){pt(e,t)}}()})();'])))}let state={status:0};function startDeflateWorker(ee,re,te,ne=createDeflateWorker){switch(state.status===0&&doStartDeflateWorker(ee,re,ne),state.status){case 1:return state.initializationFailureCallbacks.push(te),state.worker;case 3:return state.worker}}function getDeflateWorkerStatus(){return state.status}function doStartDeflateWorker(ee,re,te=createDeflateWorker){try{const ne=te(ee),{stop:ie}=addEventListener$1(ee,ne,"error",ae=>{onError(ee,re,ae)}),{stop:oe}=addEventListener$1(ee,ne,"message",({data:ae})=>{ae.type==="errored"?onError(ee,re,ae.error,ae.streamId):ae.type==="initialized"&&onInitialized(ae.version)});ne.postMessage({action:"init"}),setTimeout$1(()=>onTimeout(re),INITIALIZATION_TIME_OUT_DELAY),state={status:1,worker:ne,stop:()=>{ie(),oe()},initializationFailureCallbacks:[]}}catch(ne){onError(ee,re,ne)}}function onTimeout(ee){state.status===1&&(display.error(`${ee} failed to start: a timeout occurred while initializing the Worker`),state.initializationFailureCallbacks.forEach(re=>re()),state={status:2})}function onInitialized(ee){state.status===1&&(state={status:3,worker:state.worker,stop:state.stop,version:ee})}function onError(ee,re,te,ne){state.status===1||state.status===0?(reportScriptLoadingError({configuredUrl:ee.workerUrl,error:te,source:re,scriptType:"worker"}),state.status===1&&state.initializationFailureCallbacks.forEach(ie=>ie()),state={status:2}):addTelemetryError(te,{worker_version:state.status===3&&state.version,stream_id:ne})}function isBrowserSupported(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function getSessionReplayLink(ee,re,te,ne){const ie=re.findTrackedSession(),oe=getErrorType(ie,ne),se=te.findView();return getSessionReplayUrl(ee,{viewContext:se,errorType:oe,session:ie})}function getErrorType(ee,re){if(!isBrowserSupported())return"browser-not-supported";if(!ee)return"rum-not-tracked";if(ee.sessionReplay===0)return"incorrect-session-plan";if(!re)return"replay-not-started"}function createPostStartStrategy(ee,re,te,ne,ie,oe){let se=0,ae;re.subscribe(9,()=>{(se===2||se===3)&&(le(),se=1)}),re.subscribe(10,()=>{se===1&&ce()});const ue=async()=>{const[de]=await Promise.all([ie(),asyncRunOnReadyState(ee,"interactive")]);if(se!==2)return;const fe=oe();if(!fe||!de){se=0;return}({stop:ae}=de(re,ee,te,ne,fe)),se=3};function ce(de){const fe=te.findTrackedSession();if(canStartRecording(fe,de)){se=1;return}isRecordingInProgress(se)||(se=2,ue().catch(monitorError),shouldForceReplay(fe,de)&&te.setForcedReplay())}function le(){se===3&&(ae==null||ae()),se=0}return{start:ce,stop:le,getSessionReplayLink(){return getSessionReplayLink(ee,te,ne,se!==0)},isRecording:()=>se===3}}function canStartRecording(ee,re){return!ee||ee.sessionReplay===0&&(!re||!re.force)}function isRecordingInProgress(ee){return ee===2||ee===3}function shouldForceReplay(ee,re){return re&&re.force&&ee.sessionReplay===0}function createPreStartStrategy(){let ee=0;return{strategy:{start(){ee=1},stop(){ee=2},isRecording:()=>!1,getSessionReplayLink:noop$2},shouldStartImmediately(re){return ee===1||ee===0&&!re.startSessionReplayRecordingManually}}}function makeRecorderApi(ee,re){if(canUseEventBridge()&&!bridgeSupports("records")||!isBrowserSupported())return{start:noop$2,stop:noop$2,getReplayStats:()=>{},onRumStart:noop$2,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:te,shouldStartImmediately:ne}=createPreStartStrategy();return{start:oe=>te.start(oe),stop:()=>te.stop(),getSessionReplayLink:()=>te.getSessionReplayLink(),onRumStart:ie,isRecording:()=>getDeflateWorkerStatus()===3&&te.isRecording(),getReplayStats:oe=>getDeflateWorkerStatus()===3?getReplayStats(oe):void 0};function ie(oe,se,ae,ue,ce){let le;function de(){return le||(ce??(ce=startDeflateWorker(se,"Datadog Session Replay",()=>{te.stop()},re)),ce&&(le=createDeflateEncoder(se,ce,1))),le}te=createPostStartStrategy(se,oe,ae,ue,ee,de),ne(se)&&te.start()}}async function lazyLoadRecorder(ee=importRecorder){try{return await ee()}catch(re){reportScriptLoadingError({error:re,source:"Recorder",scriptType:"module"})}}async function importRecorder(){return(await Promise.resolve().then(()=>startRecording$1)).startRecording}function isProfilingSupported(){return getGlobalObject().Profiler!==void 0}async function lazyLoadProfiler(ee=importProfiler){try{return await ee()}catch(re){reportScriptLoadingError({error:re,source:"Profiler",scriptType:"module"})}}async function importProfiler(){return(await Promise.resolve().then(()=>profiler)).createRumProfiler}function makeProfilerApi(){let ee;function re(te,ne,ie,oe){!isProfilingSupported()||!performDraw(ne.profilingSampleRate)||lazyLoadProfiler().then(se=>{if(!se){addTelemetryDebug("[DD_RUM] Failed to lazy load the RUM Profiler");return}ee=se(ne,te,ie),ee.start(oe.findView())}).catch(monitorError)}return{onRumStart:re,stop:()=>{ee==null||ee.stop().catch(monitorError)}}}const recorderApi=makeRecorderApi(lazyLoadRecorder),profilerApi=makeProfilerApi(),datadogRum=makeRumPublicApi(startRum,recorderApi,profilerApi,{startDeflateWorker,createDeflateEncoder});defineGlobal(getGlobalObject(),"DD_RUM",datadogRum);const xi=class xi{init(){if(xi.isInitialized){console.info("Tracker [DD]: already initialized");return}datadogRum.init({applicationId:"3ea6bf90-69cc-42fe-9e69-d461f783221d",clientToken:"pub51a171e3f587fb85f6d3f0ed2bf8f531",site:"datadoghq.com",service:"astropay-payments-library",env:AstroPayConfig.getRuntimeConfig().MODE,version:AstroPayConfig.getRuntimeConfig().VERSION,sessionSampleRate:50,sessionReplaySampleRate:10,defaultPrivacyLevel:"mask-user-input",trackViewsManually:!0,trackResources:!1,trackUserInteractions:!1,beforeSend:re=>this.filterEvents(re)}),datadogRum.startView({name:"ap_cl_view_mounted"}),datadogRum.startSessionReplayRecording(),xi.isInitialized=!0,console.info("Tracker [DD]: initialized")}track(re,te){datadogRum==null||datadogRum.addAction(re,te||{})}trackError(re,te){datadogRum==null||datadogRum.addError(re,{context:te})}destroy(){console.info("Tracker [DD]: destroying"),typeof datadogRum.stopSessionReplayRecording=="function"&&datadogRum.stopSessionReplayRecording(),datadogRum.addAction("ap_cl_view_unmounted",{reason:"component_destroyed"}),xi.isInitialized=!1}filterEvents(re){var te,ne,ie;return!!(re.type==="view"&&((te=re.view.name)!=null&&te.startsWith("ap_cl_"))||re.type==="action"&&typeof((ne=re.action.target)==null?void 0:ne.name)=="string"&&re.action.target.name.startsWith("ap_cl_")||re.type==="error"&&((ie=re.error)==null?void 0:ie.source)==="custom")}};xe(xi,"isInitialized",!1);let DatadogTracker=xi;class DataDogTracker{static init(re){if(!re){console.info("Tracking disabled");return}this.initialized||(this.trackers=[new DatadogTracker],this.trackers.forEach(te=>te.init()),this.initialized=!0)}static isReady(){return this.initialized&&this.trackers.length>0}static trackEvent(re,te){this.isReady()&&this.trackers.forEach(ne=>ne.track(re,te))}static trackError(re,te){this.isReady()&&this.trackers.forEach(ne=>ne.trackError(re,te))}static destroy(){this.trackers.forEach(re=>re.destroy()),this.trackers=[],this.initialized=!1}}xe(DataDogTracker,"initialized",!1),xe(DataDogTracker,"trackers",[]);const getResultScreenStyles=()=>css`
|
|
231
|
+
${fe}`),ee.finish(ge=>{pe(formatPayloadFromEncoder(ge))})}return{flushController:te,add:ce,upsert:ce,stop:oe.unsubscribe}}function formatPayloadFromEncoder(ee){let re;return typeof ee.output=="string"?re=ee.output:re=new Blob([ee.output],{type:"text/plain"}),{data:re,bytesCount:ee.outputBytesCount,encoding:ee.encoding}}function createFlushController({messagesLimit:ee,bytesLimit:re,durationLimit:te,pageMayExitObservable:ne,sessionExpireObservable:ie}){const oe=ne.subscribe(pe=>le(pe.reason)),se=ie.subscribe(()=>le("session_expire")),ae=new Observable$1(()=>()=>{oe.unsubscribe(),se.unsubscribe()});let ue=0,ce=0;function le(pe){if(ce===0)return;const ge=ce,me=ue;ce=0,ue=0,he(),ae.notify({reason:pe,messagesCount:ge,bytesCount:me})}let de;function fe(){de===void 0&&(de=setTimeout$1(()=>{le("duration_limit")},te))}function he(){clearTimeout$1(de),de=void 0}return{flushObservable:ae,get messagesCount(){return ce},notifyBeforeAddMessage(pe){ue+pe>=re&&le("bytes_limit"),ce+=1,ue+=pe,fe()},notifyAfterAddMessage(pe=0){ue+=pe,ce>=ee?le("messages_limit"):ue>=re&&le("bytes_limit")},notifyAfterRemoveMessage(pe){ue-=pe,ce-=1,ce===0&&he()}}}function startBatchWithReplica(ee,re,te,ne,ie,oe,se=createBatch){const ae=ce(ee,re),ue=te&&ce(ee,te);function ce(le,{endpoint:de,encoder:fe}){return se({encoder:fe,request:createHttpRequest(de,le.batchBytesLimit,ne),flushController:createFlushController({messagesLimit:le.batchMessagesLimit,bytesLimit:le.batchBytesLimit,durationLimit:le.flushTimeout,pageMayExitObservable:ie,sessionExpireObservable:oe}),messageBytesLimit:le.messageBytesLimit})}return{flushObservable:ae.flushController.flushObservable,add(le,de=!0){ae.add(le),ue&&de&&ue.add(te.transformMessage?te.transformMessage(le):le)},upsert:(le,de)=>{ae.upsert(le,de),ue&&ue.upsert(te.transformMessage?te.transformMessage(le):le,de)},stop:()=>{ae.stop(),ue&&ue.stop()}}}function createIdentityEncoder(){let ee="",re=0;return{isAsync:!1,get isEmpty(){return!ee},write(te,ne){const ie=computeBytesCount(te);re+=ie,ee+=te,ne&&ne(ie)},finish(te){te(this.finishSync())},finishSync(){const te={output:ee,outputBytesCount:re,rawBytesCount:re,pendingData:""};return ee="",re=0,te},estimateEncodedBytesCount(te){return te.length}}}class AbstractLifeCycle{constructor(){this.callbacks={}}notify(re,te){const ne=this.callbacks[re];ne&&ne.forEach(ie=>ie(te))}subscribe(re,te){return this.callbacks[re]||(this.callbacks[re]=[]),this.callbacks[re].push(te),{unsubscribe:()=>{this.callbacks[re]=this.callbacks[re].filter(ne=>te!==ne)}}}}function createEventRateLimiter(ee,re,te){let ne=0,ie=!1;return{isLimitReached(){if(ne===0&&setTimeout$1(()=>{ne=0},ONE_MINUTE),ne+=1,ne<=re||ie)return ie=!1,!1;if(ne===re+1){ie=!0;try{te({message:`Reached max number of ${ee}s by minute: ${re}`,source:ErrorSource.AGENT,startClocks:clocksNow()})}finally{ie=!1}}return!0}}}function runOnReadyState(ee,re,te){return document.readyState===re||document.readyState==="complete"?(te(),{stop:noop$2}):addEventListener$1(ee,window,re==="complete"?"load":"DOMContentLoaded",te,{once:!0})}function asyncRunOnReadyState(ee,re){return new Promise(te=>{runOnReadyState(ee,re,te)})}let xhrObservable;const xhrContexts=new WeakMap;function initXhrObservable(ee){return xhrObservable||(xhrObservable=createXhrObservable(ee)),xhrObservable}function createXhrObservable(ee){return new Observable$1(re=>{const{stop:te}=instrumentMethod(XMLHttpRequest.prototype,"open",openXhr),{stop:ne}=instrumentMethod(XMLHttpRequest.prototype,"send",oe=>{sendXhr(oe,ee,re)},{computeHandlingStack:!0}),{stop:ie}=instrumentMethod(XMLHttpRequest.prototype,"abort",abortXhr);return()=>{te(),ne(),ie()}})}function openXhr({target:ee,parameters:[re,te]}){xhrContexts.set(ee,{state:"open",method:String(re).toUpperCase(),url:normalizeUrl(String(te))})}function sendXhr({target:ee,handlingStack:re},te,ne){const ie=xhrContexts.get(ee);if(!ie)return;const oe=ie;oe.state="start",oe.startClocks=clocksNow(),oe.isAborted=!1,oe.xhr=ee,oe.handlingStack=re;let se=!1;const{stop:ae}=instrumentMethod(ee,"onreadystatechange",()=>{ee.readyState===XMLHttpRequest.DONE&&ue()}),ue=()=>{if(ce(),ae(),se)return;se=!0;const le=ie;le.state="complete",le.duration=elapsed(oe.startClocks.timeStamp,timeStampNow()),le.status=ee.status,ne.notify(shallowClone(le))},{stop:ce}=addEventListener$1(te,ee,"loadend",ue);ne.notify(oe)}function abortXhr({target:ee}){const re=xhrContexts.get(ee);re&&(re.isAborted=!0)}let fetchObservable;function initFetchObservable(){return fetchObservable||(fetchObservable=createFetchObservable()),fetchObservable}function createFetchObservable(){return new Observable$1(ee=>{if(!window.fetch)return;const{stop:re}=instrumentMethod(window,"fetch",te=>beforeSend(te,ee),{computeHandlingStack:!0});return re})}function beforeSend({parameters:ee,onPostCall:re,handlingStack:te},ne){const[ie,oe]=ee;let se=oe&&oe.method;se===void 0&&ie instanceof Request&&(se=ie.method);const ae=se!==void 0?String(se).toUpperCase():"GET",ue=ie instanceof Request?ie.url:normalizeUrl(String(ie)),ce=clocksNow(),le={state:"start",init:oe,input:ie,method:ae,startClocks:ce,url:ue,handlingStack:te};ne.notify(le),ee[0]=le.input,ee[1]=le.init,re(de=>afterSend(ne,de,le))}function afterSend(ee,re,te){const ne=te;function ie(oe){ne.state="resolve",Object.assign(ne,oe),ee.notify(ne)}re.then(monitor(oe=>{ie({response:oe,responseType:oe.type,status:oe.status,isAborted:!1})}),monitor(oe=>{var se,ae;ie({status:0,isAborted:((ae=(se=ne.init)===null||se===void 0?void 0:se.signal)===null||ae===void 0?void 0:ae.aborted)||oe instanceof DOMException&&oe.code===DOMException.ABORT_ERR,error:oe})}))}function requestIdleCallback(ee,re){if(window.requestIdleCallback&&window.cancelIdleCallback){const te=window.requestIdleCallback(monitor(ee),re);return()=>window.cancelIdleCallback(te)}return requestIdleCallbackShim(ee)}const MAX_TASK_TIME=50;function requestIdleCallbackShim(ee){const re=dateNow(),te=setTimeout$1(()=>{ee({didTimeout:!1,timeRemaining:()=>Math.max(0,MAX_TASK_TIME-(dateNow()-re))})},0);return()=>clearTimeout$1(te)}const IDLE_CALLBACK_TIMEOUT=ONE_SECOND,MAX_EXECUTION_TIME_ON_TIMEOUT=30;function createTaskQueue(){const ee=[];function re(ne){let ie;if(ne.didTimeout){const oe=performance.now();ie=()=>MAX_EXECUTION_TIME_ON_TIMEOUT-(performance.now()-oe)}else ie=ne.timeRemaining.bind(ne);for(;ie()>0&&ee.length;)ee.shift()();ee.length&&te()}function te(){requestIdleCallback(re,{timeout:IDLE_CALLBACK_TIMEOUT})}return{push(ne){ee.push(ne)===1&&te()}}}let consoleObservablesByApi={};function initConsoleObservable(ee){const re=ee.map(te=>(consoleObservablesByApi[te]||(consoleObservablesByApi[te]=createConsoleObservable(te)),consoleObservablesByApi[te]));return mergeObservables(...re)}function createConsoleObservable(ee){return new Observable$1(re=>{const te=globalConsole[ee];return globalConsole[ee]=(...ne)=>{te.apply(console,ne);const ie=createHandlingStack("console error");callMonitored(()=>{re.notify(buildConsoleLog(ne,ee,ie))})},()=>{globalConsole[ee]=te}})}function buildConsoleLog(ee,re,te){const ne=ee.map(oe=>formatConsoleParameters(oe)).join(" ");let ie;if(re===ConsoleApiName.error){const oe=ee.find(isError);ie={stack:oe?toStackTraceString(computeStackTrace(oe)):void 0,fingerprint:tryToGetFingerprint(oe),causes:oe?flattenErrorCauses(oe,"console"):void 0,startClocks:clocksNow(),message:ne,source:ErrorSource.CONSOLE,handling:"handled",handlingStack:te,context:tryToGetErrorContext(oe),originalError:oe}}return{api:re,message:ne,error:ie,handlingStack:te}}function formatConsoleParameters(ee){return typeof ee=="string"?sanitize(ee):isError(ee)?formatErrorMessage(computeStackTrace(ee)):jsonStringify(sanitize(ee),void 0,2)}function checkContext(ee){const re=getType(ee)==="object";return re||display.error("Unsupported context:",ee),re}function ensureProperties(ee,re,te){const ne={...ee};for(const[ie,{required:oe,type:se}]of Object.entries(re))se==="string"&&ie in ne&&(ne[ie]=String(ne[ie])),oe&&!(ie in ee)&&display.warn(`The property ${ie} of ${te} is required; context will not be sent to the intake.`);return ne}function createContextManager(ee="",{propertiesConfig:re={}}={}){let te={};const ne=new Observable$1,ie={getContext:()=>deepClone(te),setContext:oe=>{checkContext(oe)?te=sanitize(ensureProperties(oe,re,ee)):ie.clearContext(),ne.notify()},setContextProperty:(oe,se)=>{te=sanitize(ensureProperties({...te,[oe]:se},re,ee)),ne.notify()},removeContextProperty:oe=>{delete te[oe],ensureProperties(te,re,ee),ne.notify()},clearContext:()=>{te={},ne.notify()},changeObservable:ne};return ie}const CONTEXT_STORE_KEY_PREFIX="_dd_c",storageListeners=[];function storeContextManager(ee,re,te,ne){const ie=buildStorageKey(te,ne);storageListeners.push(addEventListener$1(ee,window,"storage",({key:ce})=>{ie===ce&&se()})),re.changeObservable.subscribe(ae);const oe=combine(ue(),re.getContext());isEmptyObject$1(oe)||re.setContext(oe);function se(){re.setContext(ue())}function ae(){localStorage.setItem(ie,JSON.stringify(re.getContext()))}function ue(){const ce=localStorage.getItem(ie);return ce?JSON.parse(ce):{}}}function buildStorageKey(ee,re){return`${CONTEXT_STORE_KEY_PREFIX}_${ee}_${re}`}const CustomerContextKey={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},ContextManagerMethod={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};function readBytesFromStream(ee,re,te){const ne=ee.getReader();let ie=0;oe();function oe(){ne.read().then(monitor(ae=>{if(ae.done){se();return}ie+=ae.value.length,ie>te.bytesLimit?se():oe()}),monitor(ae=>re(ae)))}function se(){ne.cancel().catch(noop$2),re(void 0,void 0,void 0)}}const SYNTHETICS_TEST_ID_COOKIE_NAME="datadog-synthetics-public-id",SYNTHETICS_RESULT_ID_COOKIE_NAME="datadog-synthetics-result-id",SYNTHETICS_INJECTS_RUM_COOKIE_NAME="datadog-synthetics-injects-rum";function willSyntheticsInjectRum(){return!!(window._DATADOG_SYNTHETICS_INJECTS_RUM||getInitCookie(SYNTHETICS_INJECTS_RUM_COOKIE_NAME))}function getSyntheticsTestId(){const ee=window._DATADOG_SYNTHETICS_PUBLIC_ID||getInitCookie(SYNTHETICS_TEST_ID_COOKIE_NAME);return typeof ee=="string"?ee:void 0}function getSyntheticsResultId(){const ee=window._DATADOG_SYNTHETICS_RESULT_ID||getInitCookie(SYNTHETICS_RESULT_ID_COOKIE_NAME);return typeof ee=="string"?ee:void 0}function isMatchOption(ee){const re=getType(ee);return re==="string"||re==="function"||ee instanceof RegExp}function matchList(ee,re,te=!1){return ee.some(ne=>{try{if(typeof ne=="function")return ne(re);if(ne instanceof RegExp)return ne.test(re);if(typeof ne=="string")return te?re.startsWith(ne):ne===re}catch(ie){display.error(ie)}return!1})}function createCustomVitalsState(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function startVitalCollection(ee,re,te){function ne(oe){return!re.wasInPageStateDuringPeriod("frozen",oe.startClocks.relative,oe.duration)}function ie(oe){ne(oe)&&ee.notify(12,processVital(oe))}return{addDurationVital:ie,startDurationVital:(oe,se={})=>startDurationVital(te,oe,se),stopDurationVital:(oe,se={})=>{stopDurationVital(ie,te,oe,se)}}}function startDurationVital({vitalsByName:ee,vitalsByReference:re},te,ne={}){const ie={name:te,startClocks:clocksNow(),context:ne.context,description:ne.description},oe={__dd_vital_reference:!0};return ee.set(te,ie),re.set(oe,ie),oe}function stopDurationVital(ee,{vitalsByName:re,vitalsByReference:te},ne,ie={}){const oe=typeof ne=="string"?re.get(ne):te.get(ne);oe&&(ee(buildDurationVital(oe,oe.startClocks,ie,clocksNow())),typeof ne=="string"?re.delete(ne):te.delete(ne))}function buildDurationVital(ee,re,te,ne){var ie;return{name:ee.name,type:"duration",startClocks:re,duration:elapsed(re.timeStamp,ne.timeStamp),context:combine(ee.context,te.context),description:(ie=te.description)!==null&&ie!==void 0?ie:ee.description}}function processVital(ee,re){const te={date:ee.startClocks.timeStamp,vital:{id:generateUUID(),type:ee.type,name:ee.name,duration:toServerDuration(ee.duration),description:ee.description},type:"vital"};return te._dd={vital:{computed_value:!0}},{rawRumEvent:te,startTime:ee.startClocks.relative,duration:ee.duration,customerContext:ee.context,domainContext:{}}}function callPluginsMethod(ee,re,te){if(ee)for(const ne of ee){const ie=ne[re];ie&&ie(te)}}function createTraceIdentifier(){return createIdentifier(64)}function createSpanIdentifier(){return createIdentifier(63)}function createIdentifier(ee){const re=crypto.getRandomValues(new Uint32Array(2));return ee===63&&(re[re.length-1]>>>=1),{toString(te=10){let ne=re[1],ie=re[0],oe="";do{const se=ne%te*4294967296+ie;ne=Math.floor(ne/te),ie=Math.floor(se/te),oe=(se%te).toString(te)+oe}while(ne||ie);return oe}}}function toPaddedHexadecimalString(ee){return ee.toString(16).padStart(16,"0")}let sampleDecisionCache;function isTraceSampled(ee,re){if(re===100)return!0;if(re===0)return!1;if(sampleDecisionCache&&ee===sampleDecisionCache.sessionId)return sampleDecisionCache.decision;let te;return window.BigInt?te=sampleUsingKnuthFactor(BigInt(`0x${ee.split("-")[4]}`),re):te=performDraw(re),sampleDecisionCache={sessionId:ee,decision:te},te}function sampleUsingKnuthFactor(ee,re){const te=BigInt("1111111111111111111"),ne=BigInt("0x10000000000000000"),ie=ee*te%ne;return Number(ie)<=re/100*Number(ne)}function isTracingOption(ee){const re=ee;return getType(re)==="object"&&isMatchOption(re.match)&&Array.isArray(re.propagatorTypes)}function clearTracingIfNeeded(ee){ee.status===0&&!ee.isAborted&&(ee.traceId=void 0,ee.spanId=void 0,ee.traceSampled=void 0)}function startTracer(ee,re,te){return{clearTracingIfNeeded,traceFetch:ne=>injectHeadersIfTracingAllowed(ee,ne,re,te,ie=>{var oe;if(ne.input instanceof Request&&!(!((oe=ne.init)===null||oe===void 0)&&oe.headers))ne.input=new Request(ne.input),Object.keys(ie).forEach(se=>{ne.input.headers.append(se,ie[se])});else{ne.init=shallowClone(ne.init);const se=[];ne.init.headers instanceof Headers?ne.init.headers.forEach((ae,ue)=>{se.push([ue,ae])}):Array.isArray(ne.init.headers)?ne.init.headers.forEach(ae=>{se.push(ae)}):ne.init.headers&&Object.keys(ne.init.headers).forEach(ae=>{se.push([ae,ne.init.headers[ae]])}),ne.init.headers=se.concat(objectEntries(ie))}}),traceXhr:(ne,ie)=>injectHeadersIfTracingAllowed(ee,ne,re,te,oe=>{Object.keys(oe).forEach(se=>{ie.setRequestHeader(se,oe[se])})})}}function injectHeadersIfTracingAllowed(ee,re,te,ne,ie){const oe=te.findTrackedSession();if(!oe)return;const se=ee.allowedTracingUrls.find(ce=>matchList([ce.match],re.url,!0));if(!se)return;const ae=isTraceSampled(oe.id,ee.traceSampleRate);(ae||ee.traceContextInjection===TraceContextInjection.ALL)&&(re.traceSampled=ae,re.traceId=createTraceIdentifier(),re.spanId=createSpanIdentifier(),ie(makeTracingHeaders(re.traceId,re.spanId,re.traceSampled,se.propagatorTypes,ne,ee)))}function makeTracingHeaders(ee,re,te,ne,ie,oe){const se={};if(ne.forEach(ae=>{switch(ae){case"datadog":{Object.assign(se,{"x-datadog-origin":"rum","x-datadog-parent-id":re.toString(),"x-datadog-sampling-priority":te?"1":"0","x-datadog-trace-id":ee.toString()});break}case"tracecontext":{Object.assign(se,{traceparent:`00-0000000000000000${toPaddedHexadecimalString(ee)}-${toPaddedHexadecimalString(re)}-0${te?"1":"0"}`,tracestate:`dd=s:${te?"1":"0"};o:rum`});break}case"b3":{Object.assign(se,{b3:`${toPaddedHexadecimalString(ee)}-${toPaddedHexadecimalString(re)}-${te?"1":"0"}`});break}case"b3multi":{Object.assign(se,{"X-B3-TraceId":toPaddedHexadecimalString(ee),"X-B3-SpanId":toPaddedHexadecimalString(re),"X-B3-Sampled":te?"1":"0"});break}}}),isExperimentalFeatureEnabled(ExperimentalFeature.USER_ACCOUNT_TRACE_HEADER)&&oe.propagateTraceBaggage){const ae=ie().user.id,ue=ie().account.id,ce=[];typeof ae=="string"&&ce.push(`usr.id=${encodeURIComponent(ae)}`),typeof ue=="string"&&ce.push(`account.id=${encodeURIComponent(ue)}`),ce.length>0&&(se.baggage=ce.join(","))}return se}const DEFAULT_PROPAGATOR_TYPES=["tracecontext","datadog"];function validateAndBuildRumConfiguration(ee){var re,te,ne,ie,oe,se,ae;if(ee.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(ee.trackFeatureFlagsForEvents)&&display.warn("trackFeatureFlagsForEvents should be an array"),!ee.applicationId){display.error("Application ID is not configured, no RUM data will be collected.");return}if(!isSampleRate(ee.sessionReplaySampleRate,"Session Replay")||!isSampleRate(ee.traceSampleRate,"Trace"))return;if(ee.excludedActivityUrls!==void 0&&!Array.isArray(ee.excludedActivityUrls)){display.error("Excluded Activity Urls should be an array");return}const ue=validateAndBuildTracingOptions(ee);if(!ue)return;const ce=validateAndBuildConfiguration(ee);if(!ce)return;const le=isExperimentalFeatureEnabled(ExperimentalFeature.PROFILING),de=(re=ee.sessionReplaySampleRate)!==null&&re!==void 0?re:0;return{applicationId:ee.applicationId,version:ee.version||void 0,actionNameAttribute:ee.actionNameAttribute,sessionReplaySampleRate:de,startSessionReplayRecordingManually:ee.startSessionReplayRecordingManually!==void 0?!!ee.startSessionReplayRecordingManually:de===0,traceSampleRate:(te=ee.traceSampleRate)!==null&&te!==void 0?te:100,rulePsr:isNumber$1(ee.traceSampleRate)?ee.traceSampleRate/100:void 0,allowedTracingUrls:ue,excludedActivityUrls:(ne=ee.excludedActivityUrls)!==null&&ne!==void 0?ne:[],workerUrl:ee.workerUrl,compressIntakeRequests:!!ee.compressIntakeRequests,trackUserInteractions:!!(!((ie=ee.trackUserInteractions)!==null&&ie!==void 0)||ie),trackViewsManually:!!ee.trackViewsManually,trackResources:!!(!((oe=ee.trackResources)!==null&&oe!==void 0)||oe),trackLongTasks:!!(!((se=ee.trackLongTasks)!==null&&se!==void 0)||se),subdomain:ee.subdomain,defaultPrivacyLevel:objectHasValue(DefaultPrivacyLevel,ee.defaultPrivacyLevel)?ee.defaultPrivacyLevel:DefaultPrivacyLevel.MASK,enablePrivacyForActionName:!!ee.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,traceContextInjection:objectHasValue(TraceContextInjection,ee.traceContextInjection)?ee.traceContextInjection:TraceContextInjection.SAMPLED,plugins:ee.plugins||[],trackFeatureFlagsForEvents:ee.trackFeatureFlagsForEvents||[],profilingSampleRate:le&&(ae=ee.profilingSampleRate)!==null&&ae!==void 0?ae:0,propagateTraceBaggage:!!ee.propagateTraceBaggage,...ce}}function validateAndBuildTracingOptions(ee){if(ee.allowedTracingUrls===void 0)return[];if(!Array.isArray(ee.allowedTracingUrls)){display.error("Allowed Tracing URLs should be an array");return}if(ee.allowedTracingUrls.length!==0&&ee.service===void 0){display.error("Service needs to be configured when tracing is enabled");return}const re=[];return ee.allowedTracingUrls.forEach(te=>{isMatchOption(te)?re.push({match:te,propagatorTypes:DEFAULT_PROPAGATOR_TYPES}):isTracingOption(te)?re.push(te):display.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",te)}),re}function getSelectedTracingPropagators(ee){const re=new Set;return Array.isArray(ee.allowedTracingUrls)&&ee.allowedTracingUrls.length>0&&ee.allowedTracingUrls.forEach(te=>{isMatchOption(te)?DEFAULT_PROPAGATOR_TYPES.forEach(ne=>re.add(ne)):getType(te)==="object"&&Array.isArray(te.propagatorTypes)&&te.propagatorTypes.forEach(ne=>re.add(ne))}),Array.from(re)}function serializeRumConfiguration(ee){var re;const te=serializeConfiguration(ee);return{session_replay_sample_rate:ee.sessionReplaySampleRate,start_session_replay_recording_manually:ee.startSessionReplayRecordingManually,trace_sample_rate:ee.traceSampleRate,trace_context_injection:ee.traceContextInjection,action_name_attribute:ee.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(ee.allowedTracingUrls)&&ee.allowedTracingUrls.length>0,selected_tracing_propagators:getSelectedTracingPropagators(ee),default_privacy_level:ee.defaultPrivacyLevel,enable_privacy_for_action_name:ee.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(ee.excludedActivityUrls)&&ee.excludedActivityUrls.length>0,use_worker_url:!!ee.workerUrl,compress_intake_requests:ee.compressIntakeRequests,track_views_manually:ee.trackViewsManually,track_user_interactions:ee.trackUserInteractions,track_resources:ee.trackResources,track_long_task:ee.trackLongTasks,plugins:(re=ee.plugins)===null||re===void 0?void 0:re.map(ne=>{var ie;return{name:ne.name,...(ie=ne.getConfigurationTelemetry)===null||ie===void 0?void 0:ie.call(ne)}}),track_feature_flags_for_events:ee.trackFeatureFlagsForEvents,...te}}const REMOTE_CONFIGURATION_VERSION="v1";function fetchAndApplyRemoteConfiguration(ee,re){fetchRemoteConfiguration(ee,te=>{re(applyRemoteConfiguration(ee,te))})}function applyRemoteConfiguration(ee,re){return{...ee,...re}}function fetchRemoteConfiguration(ee,re){const te=new XMLHttpRequest;addEventListener$1(ee,te,"load",function(){if(te.status===200){const ne=JSON.parse(te.responseText);re(ne.rum)}else displayRemoteConfigurationFetchingError()}),addEventListener$1(ee,te,"error",function(){displayRemoteConfigurationFetchingError()}),te.open("GET",buildEndpoint(ee)),te.send()}function buildEndpoint(ee){return`https://sdk-configuration.${buildEndpointHost("rum",ee)}/${REMOTE_CONFIGURATION_VERSION}/${encodeURIComponent(ee.remoteConfigurationId)}.json`}function displayRemoteConfigurationFetchingError(){display.error("Error fetching the remote configuration.")}function startGlobalContext(ee){const re=buildGlobalContextManager();return ee.storeContextsAcrossPages&&storeContextManager(ee,re,"rum",2),re}function buildGlobalContextManager(){return createContextManager("global context")}function startUserContext(ee){const re=buildUserContextManager();return ee.storeContextsAcrossPages&&storeContextManager(ee,re,"rum",1),re}function buildUserContextManager(){return createContextManager("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}function startAccountContext(ee){const re=buildAccountContextManager();return ee.storeContextsAcrossPages&&storeContextManager(ee,re,"rum",4),re}function buildAccountContextManager(){return createContextManager("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function createPreStartStrategy$1({ignoreInitIfSyntheticsWillInjectRum:ee,startDeflateWorker:re},te,ne,ie){const oe=createBoundedBuffer(),se=buildGlobalContextManager();bufferContextCalls(se,CustomerContextKey.globalContext,oe);const ae=buildUserContextManager();bufferContextCalls(ae,CustomerContextKey.userContext,oe);const ue=buildAccountContextManager();bufferContextCalls(ue,CustomerContextKey.accountContext,oe);let ce,le,de,fe;const he=te.observable.subscribe(ge),pe={};function ge(){if(!de||!fe||!te.isGranted())return;he.unsubscribe();let be;if(fe.trackViewsManually){if(!ce)return;oe.remove(ce.callback),be=ce.options}const _e=ie(fe,le,be);oe.drain(_e)}function me(be){const _e=canUseEventBridge();if(_e&&(be=overrideInitConfigurationForBridge(be)),de=be,addTelemetryConfiguration(serializeRumConfiguration(be)),fe){displayAlreadyInitializedError("DD_RUM",be);return}const Ie=validateAndBuildRumConfiguration(be);if(Ie){if(!_e&&!Ie.sessionStoreStrategyType){display.warn("No storage available for session. We will not send any data.");return}Ie.compressIntakeRequests&&!_e&&re&&(le=re(Ie,"Datadog RUM",noop$2),!le)||(fe=Ie,initFetchObservable().subscribe(noop$2),te.tryToInit(Ie.trackingConsent),ge())}}const ye=be=>{oe.add(_e=>_e.addDurationVital(be))};return{init(be,_e){if(!be){display.error("Missing configuration");return}initFeatureFlags(be.enableExperimentalFeatures),de=be,!(ee&&willSyntheticsInjectRum())&&(callPluginsMethod(be.plugins,"onInit",{initConfiguration:be,publicApi:_e}),be.remoteConfigurationId?fetchAndApplyRemoteConfiguration(be,me):me(be))},get initConfiguration(){return de},getInternalContext:noop$2,stopSession:noop$2,addTiming(be,_e=timeStampNow()){oe.add(Ie=>Ie.addTiming(be,_e))},startView(be,_e=clocksNow()){const Ie=Te=>{Te.startView(be,_e)};oe.add(Ie),ce||(ce={options:be,callback:Ie},ge())},setViewName(be){oe.add(_e=>_e.setViewName(be))},setViewContext(be){oe.add(_e=>_e.setViewContext(be))},setViewContextProperty(be,_e){oe.add(Ie=>Ie.setViewContextProperty(be,_e))},getViewContext:()=>pe,globalContext:se,userContext:ae,accountContext:ue,addAction(be){oe.add(_e=>_e.addAction(be))},addError(be){oe.add(_e=>_e.addError(be))},addFeatureFlagEvaluation(be,_e){oe.add(Ie=>Ie.addFeatureFlagEvaluation(be,_e))},startDurationVital(be,_e){return startDurationVital(ne,be,_e)},stopDurationVital(be,_e){stopDurationVital(ye,ne,be,_e)},addDurationVital:ye}}function overrideInitConfigurationForBridge(ee){var re,te;return{...ee,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(re=ee.defaultPrivacyLevel)!==null&&re!==void 0?re:(te=getEventBridge())===null||te===void 0?void 0:te.getPrivacyLevel()}}function bufferContextCalls(ee,re,te){ee.changeObservable.subscribe(()=>{const ne=ee.getContext();te.add(ie=>ie[re].setContext(ne))})}function makeRumPublicApi(ee,re,te,ne={}){const ie=createTrackingConsentState(),oe=createCustomVitalsState();let se=createPreStartStrategy$1(ne,ie,oe,(le,de,fe)=>{const he=ee(le,re,te,fe,de&&ne.createDeflateEncoder?pe=>ne.createDeflateEncoder(le,de,pe):createIdentityEncoder,ie,oe);return re.onRumStart(he.lifeCycle,le,he.session,he.viewHistory,de),te.onRumStart(he.lifeCycle,le,he.session,he.viewHistory),se=createPostStartStrategy$1(se,he),callPluginsMethod(le.plugins,"onRumStart",{strategy:se}),he});const ae=monitor(le=>{const de=typeof le=="object"?le:{name:le};se.startView(de),addTelemetryUsage({feature:"start-view"})});function ue(le,de,fe){return monitor((...he)=>(addTelemetryUsage({feature:fe}),se[le][de](...he)))}const ce=makePublicApi({init:monitor(le=>{se.init(le,ce)}),setTrackingConsent:monitor(le=>{ie.update(le),addTelemetryUsage({feature:"set-tracking-consent",tracking_consent:le})}),setViewName:monitor(le=>{se.setViewName(le),addTelemetryUsage({feature:"set-view-name"})}),setViewContext:monitor(le=>{se.setViewContext(le),addTelemetryUsage({feature:"set-view-context"})}),setViewContextProperty:monitor((le,de)=>{se.setViewContextProperty(le,de),addTelemetryUsage({feature:"set-view-context-property"})}),getViewContext:monitor(()=>(addTelemetryUsage({feature:"set-view-context-property"}),se.getViewContext())),getInternalContext:monitor(le=>se.getInternalContext(le)),getInitConfiguration:monitor(()=>deepClone(se.initConfiguration)),addAction:(le,de)=>{const fe=createHandlingStack("action");callMonitored(()=>{se.addAction({name:sanitize(le),context:sanitize(de),startClocks:clocksNow(),type:"custom",handlingStack:fe}),addTelemetryUsage({feature:"add-action"})})},addError:(le,de)=>{const fe=createHandlingStack("error");callMonitored(()=>{se.addError({error:le,handlingStack:fe,context:sanitize(de),startClocks:clocksNow()}),addTelemetryUsage({feature:"add-error"})})},addTiming:monitor((le,de)=>{se.addTiming(sanitize(le),de)}),setGlobalContext:ue(CustomerContextKey.globalContext,ContextManagerMethod.setContext,"set-global-context"),getGlobalContext:ue(CustomerContextKey.globalContext,ContextManagerMethod.getContext,"get-global-context"),setGlobalContextProperty:ue(CustomerContextKey.globalContext,ContextManagerMethod.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:ue(CustomerContextKey.globalContext,ContextManagerMethod.removeContextProperty,"remove-global-context-property"),clearGlobalContext:ue(CustomerContextKey.globalContext,ContextManagerMethod.clearContext,"clear-global-context"),setUser:ue(CustomerContextKey.userContext,ContextManagerMethod.setContext,"set-user"),getUser:ue(CustomerContextKey.userContext,ContextManagerMethod.getContext,"get-user"),setUserProperty:ue(CustomerContextKey.userContext,ContextManagerMethod.setContextProperty,"set-user-property"),removeUserProperty:ue(CustomerContextKey.userContext,ContextManagerMethod.removeContextProperty,"remove-user-property"),clearUser:ue(CustomerContextKey.userContext,ContextManagerMethod.clearContext,"clear-user"),setAccount:ue(CustomerContextKey.accountContext,ContextManagerMethod.setContext,"set-account"),getAccount:ue(CustomerContextKey.accountContext,ContextManagerMethod.getContext,"get-account"),setAccountProperty:ue(CustomerContextKey.accountContext,ContextManagerMethod.setContextProperty,"set-account-property"),removeAccountProperty:ue(CustomerContextKey.accountContext,ContextManagerMethod.removeContextProperty,"remove-account-property"),clearAccount:ue(CustomerContextKey.accountContext,ContextManagerMethod.clearContext,"clear-account"),startView:ae,stopSession:monitor(()=>{se.stopSession(),addTelemetryUsage({feature:"stop-session"})}),addFeatureFlagEvaluation:monitor((le,de)=>{se.addFeatureFlagEvaluation(sanitize(le),sanitize(de)),addTelemetryUsage({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:monitor(()=>re.getSessionReplayLink()),startSessionReplayRecording:monitor(le=>{re.start(le),addTelemetryUsage({feature:"start-session-replay-recording",force:le&&le.force})}),stopSessionReplayRecording:monitor(()=>re.stop()),addDurationVital:monitor((le,de)=>{addTelemetryUsage({feature:"add-duration-vital"}),se.addDurationVital({name:sanitize(le),type:"duration",startClocks:timeStampToClocks(de.startTime),duration:de.duration,context:sanitize(de&&de.context),description:sanitize(de&&de.description)})}),startDurationVital:monitor((le,de)=>(addTelemetryUsage({feature:"start-duration-vital"}),se.startDurationVital(sanitize(le),{context:sanitize(de&&de.context),description:sanitize(de&&de.description)}))),stopDurationVital:monitor((le,de)=>{addTelemetryUsage({feature:"stop-duration-vital"}),se.stopDurationVital(typeof le=="string"?sanitize(le):le,{context:sanitize(de&&de.context),description:sanitize(de&&de.description)})})});return ce}function createPostStartStrategy$1(ee,re){return{init:te=>{displayAlreadyInitializedError("DD_RUM",te)},initConfiguration:ee.initConfiguration,...re}}function createDOMMutationObservable(){const ee=getMutationObserverConstructor();return new Observable$1(re=>{if(!ee)return;const te=new ee(monitor(()=>re.notify()));return te.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>te.disconnect()})}function getMutationObserverConstructor(){let ee;const re=window;if(re.Zone&&(ee=getZoneJsOriginalValue(re,"MutationObserver"),re.MutationObserver&&ee===re.MutationObserver)){const te=new re.MutationObserver(noop$2),ne=getZoneJsOriginalValue(te,"originalInstance");ee=ne&&ne.constructor}return ee||(ee=re.MutationObserver),ee}function createWindowOpenObservable(){const ee=new Observable$1,{stop:re}=instrumentMethod(window,"open",()=>ee.notify());return{observable:ee,stop:re}}function startInternalContext(ee,re,te,ne,ie){return{get:oe=>{const se=te.findView(oe),ae=ie.findUrl(oe),ue=re.findTrackedSession(oe);if(ue&&se&&ae){const ce=ne.findActionId(oe);return{application_id:ee,session_id:ue.id,user_action:ce?{id:ce}:void 0,view:{id:se.id,name:se.name,referrer:ae.referrer,url:ae.url}}}}}}const LifeCycle=AbstractLifeCycle,VIEW_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startViewHistory(ee){const re=createValueHistory({expireDelay:VIEW_CONTEXT_TIME_OUT_DELAY});ee.subscribe(1,ne=>{re.add(te(ne),ne.startClocks.relative)}),ee.subscribe(6,({endClocks:ne})=>{re.closeActive(ne.relative)}),ee.subscribe(3,ne=>{const ie=re.find(ne.startClocks.relative);ie&&ne.name&&(ie.name=ne.name),ie&&ne.context&&(ie.context=ne.context)}),ee.subscribe(10,()=>{re.reset()});function te(ne){return{service:ne.service,version:ne.version,context:ne.context,id:ne.id,name:ne.name,startClocks:ne.startClocks}}return{findView:ne=>re.find(ne),getAllEntries:()=>re.getAllEntries(),getDeletedEntries:()=>re.getDeletedEntries(),stop:()=>{re.stop()}}}const FAKE_INITIAL_DOCUMENT="initial_document",RESOURCE_TYPES=[["document",ee=>FAKE_INITIAL_DOCUMENT===ee],["xhr",ee=>ee==="xmlhttprequest"],["fetch",ee=>ee==="fetch"],["beacon",ee=>ee==="beacon"],["css",(ee,re)=>/\.css$/i.test(re)],["js",(ee,re)=>/\.js$/i.test(re)],["image",(ee,re)=>["image","img","icon"].includes(ee)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(re)!==null],["font",(ee,re)=>/\.(woff|eot|woff2|ttf)$/i.exec(re)!==null],["media",(ee,re)=>["audio","video"].includes(ee)||/\.(mp3|mp4)$/i.exec(re)!==null]];function computeResourceEntryType(ee){const re=ee.name;if(!isValidUrl(re))return addTelemetryDebug(`Failed to construct URL for "${ee.name}"`),"other";const te=getPathName(re);for(const[ne,ie]of RESOURCE_TYPES)if(ie(ee.initiatorType,te))return ne;return"other"}function areInOrder(...ee){for(let re=1;re<ee.length;re+=1)if(ee[re-1]>ee[re])return!1;return!0}function isResourceEntryRequestType(ee){return ee.initiatorType==="xmlhttprequest"||ee.initiatorType==="fetch"}function computeResourceEntryDuration(ee){const{duration:re,startTime:te,responseEnd:ne}=ee;return re===0&&te<ne?elapsed(te,ne):re}function computeResourceEntryDetails(ee){if(!hasValidResourceEntryTimings(ee))return;const{startTime:re,fetchStart:te,workerStart:ne,redirectStart:ie,redirectEnd:oe,domainLookupStart:se,domainLookupEnd:ae,connectStart:ue,secureConnectionStart:ce,connectEnd:le,requestStart:de,responseStart:fe,responseEnd:he}=ee,pe={download:formatTiming(re,fe,he),first_byte:formatTiming(re,de,fe)};return 0<ne&&ne<te&&(pe.worker=formatTiming(re,ne,te)),te<le&&(pe.connect=formatTiming(re,ue,le),ue<=ce&&ce<=le&&(pe.ssl=formatTiming(re,ce,le))),te<ae&&(pe.dns=formatTiming(re,se,ae)),re<oe&&(pe.redirect=formatTiming(re,ie,oe)),pe}function hasValidResourceEntryDuration(ee){return ee.duration>=0}function hasValidResourceEntryTimings(ee){const re=areInOrder(ee.startTime,ee.fetchStart,ee.domainLookupStart,ee.domainLookupEnd,ee.connectStart,ee.connectEnd,ee.requestStart,ee.responseStart,ee.responseEnd),te=hasRedirection(ee)?areInOrder(ee.startTime,ee.redirectStart,ee.redirectEnd,ee.fetchStart):!0;return re&&te}function hasRedirection(ee){return ee.redirectEnd>ee.startTime}function formatTiming(ee,re,te){if(ee<=re&&re<=te)return{duration:toServerDuration(elapsed(re,te)),start:toServerDuration(elapsed(ee,re))}}function computeResourceEntryProtocol(ee){return ee.nextHopProtocol===""?void 0:ee.nextHopProtocol}function computeResourceEntryDeliveryType(ee){return ee.deliveryType===""?"other":ee.deliveryType}function computeResourceEntrySize(ee){if(ee.startTime<ee.responseStart){const{encodedBodySize:re,decodedBodySize:te,transferSize:ne}=ee;return{size:te,encoded_body_size:re,decoded_body_size:te,transfer_size:ne}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function isAllowedRequestUrl(ee){return ee&&!isIntakeUrl(ee)}const DATA_URL_REGEX=/data:(.+)?(;base64)?,/g,MAX_ATTRIBUTE_VALUE_CHAR_LENGTH=24e3;function isLongDataUrl(ee){return ee.length<=MAX_ATTRIBUTE_VALUE_CHAR_LENGTH?!1:ee.substring(0,5)==="data:"?(ee=ee.substring(0,MAX_ATTRIBUTE_VALUE_CHAR_LENGTH),!0):!1}function sanitizeDataUrl(ee){return`${ee.match(DATA_URL_REGEX)[0]}[...]`}let nextRequestIndex=1;function startRequestCollection(ee,re,te,ne){const ie=startTracer(re,te,ne);trackXhr(ee,re,ie),trackFetch(ee,ie)}function trackXhr(ee,re,te){const ne=initXhrObservable(re).subscribe(ie=>{const oe=ie;if(isAllowedRequestUrl(oe.url))switch(oe.state){case"start":te.traceXhr(oe,oe.xhr),oe.requestIndex=getNextRequestIndex(),ee.notify(7,{requestIndex:oe.requestIndex,url:oe.url});break;case"complete":te.clearTracingIfNeeded(oe),ee.notify(8,{duration:oe.duration,method:oe.method,requestIndex:oe.requestIndex,spanId:oe.spanId,startClocks:oe.startClocks,status:oe.status,traceId:oe.traceId,traceSampled:oe.traceSampled,type:"xhr",url:oe.url,xhr:oe.xhr,isAborted:oe.isAborted,handlingStack:oe.handlingStack});break}});return{stop:()=>ne.unsubscribe()}}function trackFetch(ee,re){const te=initFetchObservable().subscribe(ne=>{const ie=ne;if(isAllowedRequestUrl(ie.url))switch(ie.state){case"start":re.traceFetch(ie),ie.requestIndex=getNextRequestIndex(),ee.notify(7,{requestIndex:ie.requestIndex,url:ie.url});break;case"resolve":waitForResponseToComplete(ie,oe=>{re.clearTracingIfNeeded(ie),ee.notify(8,{duration:oe,method:ie.method,requestIndex:ie.requestIndex,responseType:ie.responseType,spanId:ie.spanId,startClocks:ie.startClocks,status:ie.status,traceId:ie.traceId,traceSampled:ie.traceSampled,type:"fetch",url:ie.url,response:ie.response,init:ie.init,input:ie.input,isAborted:ie.isAborted,handlingStack:ie.handlingStack})});break}});return{stop:()=>te.unsubscribe()}}function getNextRequestIndex(){const ee=nextRequestIndex;return nextRequestIndex+=1,ee}function waitForResponseToComplete(ee,re){const te=ee.response&&tryToClone(ee.response);!te||!te.body?re(elapsed(ee.startClocks.timeStamp,timeStampNow())):readBytesFromStream(te.body,()=>{re(elapsed(ee.startClocks.timeStamp,timeStampNow()))},{bytesLimit:Number.POSITIVE_INFINITY})}function discardNegativeDuration(ee){return isNumber$1(ee)&&ee<0?void 0:ee}function trackEventCounts({lifeCycle:ee,isChildEvent:re,onChange:te=noop$2}){const ne={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},ie=ee.subscribe(13,oe=>{var se;if(!(oe.type==="view"||oe.type==="vital"||!re(oe)))switch(oe.type){case"error":ne.errorCount+=1,te();break;case"action":ne.actionCount+=1,oe.action.frustration&&(ne.frustrationCount+=oe.action.frustration.type.length),te();break;case"long_task":ne.longTaskCount+=1,te();break;case"resource":!((se=oe._dd)===null||se===void 0)&&se.discarded||(ne.resourceCount+=1,te());break}});return{stop:()=>{ie.unsubscribe()},eventCounts:ne}}function retrieveFirstInputTiming(ee,re){const te=dateNow();let ne=!1;const{stop:ie}=addEventListeners(ee,window,["click","mousedown","keydown","touchstart","pointerdown"],ae=>{if(!ae.cancelable)return;const ue={entryType:"first-input",processingStart:relativeNow(),processingEnd:relativeNow(),startTime:ae.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};ae.type==="pointerdown"?oe(ee,ue):se(ue)},{passive:!0,capture:!0});return{stop:ie};function oe(ae,ue){addEventListeners(ae,window,["pointerup","pointercancel"],ce=>{ce.type==="pointerup"&&se(ue)},{once:!0})}function se(ae){if(!ne){ne=!0,ie();const ue=ae.processingStart-ae.startTime;ue>=0&&ue<dateNow()-te&&re(ae)}}}var RumPerformanceEntryType;(function(ee){ee.EVENT="event",ee.FIRST_INPUT="first-input",ee.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",ee.LAYOUT_SHIFT="layout-shift",ee.LONG_TASK="longtask",ee.LONG_ANIMATION_FRAME="long-animation-frame",ee.NAVIGATION="navigation",ee.PAINT="paint",ee.RESOURCE="resource",ee.VISIBILITY_STATE="visibility-state"})(RumPerformanceEntryType||(RumPerformanceEntryType={}));function createPerformanceObservable(ee,re){return new Observable$1(te=>{if(!window.PerformanceObserver)return;const ne=ue=>{const ce=filterRumPerformanceEntries(ue);ce.length>0&&te.notify(ce)};let ie,oe=!0;const se=new PerformanceObserver(monitor(ue=>{oe?ie=setTimeout$1(()=>ne(ue.getEntries())):ne(ue.getEntries())}));try{se.observe(re)}catch{if([RumPerformanceEntryType.RESOURCE,RumPerformanceEntryType.NAVIGATION,RumPerformanceEntryType.LONG_TASK,RumPerformanceEntryType.PAINT].includes(re.type)){re.buffered&&(ie=setTimeout$1(()=>ne(performance.getEntriesByType(re.type))));try{se.observe({entryTypes:[re.type]})}catch{return}}}oe=!1,manageResourceTimingBufferFull(ee);let ae;return!supportPerformanceTimingEvent(RumPerformanceEntryType.FIRST_INPUT)&&re.type===RumPerformanceEntryType.FIRST_INPUT&&({stop:ae}=retrieveFirstInputTiming(ee,ue=>{ne([ue])})),()=>{se.disconnect(),ae&&ae(),clearTimeout$1(ie)}})}let resourceTimingBufferFullListener;function manageResourceTimingBufferFull(ee){return!resourceTimingBufferFullListener&&supportPerformanceObject()&&"addEventListener"in performance&&(resourceTimingBufferFullListener=addEventListener$1(ee,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{resourceTimingBufferFullListener==null||resourceTimingBufferFullListener.stop()}}function supportPerformanceObject(){return window.performance!==void 0&&"getEntries"in performance}function supportPerformanceTimingEvent(ee){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(ee)}function filterRumPerformanceEntries(ee){return ee.filter(re=>!isForbiddenResource(re))}function isForbiddenResource(ee){return ee.entryType===RumPerformanceEntryType.RESOURCE&&(!isAllowedRequestUrl(ee.name)||!hasValidResourceEntryDuration(ee))}const PAGE_ACTIVITY_VALIDATION_DELAY=100,PAGE_ACTIVITY_END_DELAY=100;function waitPageActivityEnd(ee,re,te,ne,ie,oe){const se=createPageActivityObservable(ee,re,te,ne);return doWaitPageActivityEnd(se,ie,oe)}function doWaitPageActivityEnd(ee,re,te){let ne,ie=!1;const oe=setTimeout$1(monitor(()=>ce({hadActivity:!1})),PAGE_ACTIVITY_VALIDATION_DELAY),se=te!==void 0?setTimeout$1(monitor(()=>ce({hadActivity:!0,end:timeStampNow()})),te):void 0,ae=ee.subscribe(({isBusy:le})=>{clearTimeout$1(oe),clearTimeout$1(ne);const de=timeStampNow();le||(ne=setTimeout$1(monitor(()=>ce({hadActivity:!0,end:de})),PAGE_ACTIVITY_END_DELAY))}),ue=()=>{ie=!0,clearTimeout$1(oe),clearTimeout$1(ne),clearTimeout$1(se),ae.unsubscribe()};function ce(le){ie||(ue(),re(le))}return{stop:ue}}function createPageActivityObservable(ee,re,te,ne){return new Observable$1(ie=>{const oe=[];let se,ae=0;return oe.push(re.subscribe(ue),te.subscribe(ue),createPerformanceObservable(ne,{type:RumPerformanceEntryType.RESOURCE}).subscribe(ce=>{ce.some(le=>!isExcludedUrl(ne,le.name))&&ue()}),ee.subscribe(7,ce=>{isExcludedUrl(ne,ce.url)||(se===void 0&&(se=ce.requestIndex),ae+=1,ue())}),ee.subscribe(8,ce=>{isExcludedUrl(ne,ce.url)||se===void 0||ce.requestIndex<se||(ae-=1,ue())})),()=>{oe.forEach(ce=>ce.unsubscribe())};function ue(){ie.notify({isBusy:ae>0})}})}function isExcludedUrl(ee,re){return matchList(ee.excludedActivityUrls,re)}function isTextNode(ee){return ee.nodeType===Node.TEXT_NODE}function isCommentNode(ee){return ee.nodeType===Node.COMMENT_NODE}function isElementNode(ee){return ee.nodeType===Node.ELEMENT_NODE}function isNodeShadowHost(ee){return isElementNode(ee)&&!!ee.shadowRoot}function isNodeShadowRoot(ee){const re=ee;return!!re.host&&re.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&isElementNode(re.host)}function hasChildNodes(ee){return ee.childNodes.length>0||isNodeShadowHost(ee)}function forEachChildNodes(ee,re){let te=ee.firstChild;for(;te;)re(te),te=te.nextSibling;isNodeShadowHost(ee)&&re(ee.shadowRoot)}function getParentNode(ee){return isNodeShadowRoot(ee)?ee.host:ee.parentNode}const NodePrivacyLevel={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:DefaultPrivacyLevel.ALLOW,MASK:DefaultPrivacyLevel.MASK,MASK_USER_INPUT:DefaultPrivacyLevel.MASK_USER_INPUT},PRIVACY_ATTR_NAME="data-dd-privacy",PRIVACY_ATTR_VALUE_HIDDEN="hidden",PRIVACY_CLASS_PREFIX="dd-privacy-",CENSORED_STRING_MARK="***",CENSORED_IMG_MARK="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",FORM_PRIVATE_TAG_NAMES={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},TEXT_MASKING_CHAR="x";function getNodePrivacyLevel(ee,re,te){if(te&&te.has(ee))return te.get(ee);const ne=getParentNode(ee),ie=ne?getNodePrivacyLevel(ne,re,te):re,oe=getNodeSelfPrivacyLevel(ee),se=reducePrivacyLevel(oe,ie);return te&&te.set(ee,se),se}function reducePrivacyLevel(ee,re){switch(re){case NodePrivacyLevel.HIDDEN:case NodePrivacyLevel.IGNORE:return re}switch(ee){case NodePrivacyLevel.ALLOW:case NodePrivacyLevel.MASK:case NodePrivacyLevel.MASK_USER_INPUT:case NodePrivacyLevel.HIDDEN:case NodePrivacyLevel.IGNORE:return ee;default:return re}}function getNodeSelfPrivacyLevel(ee){if(isElementNode(ee)){if(ee.tagName==="BASE")return NodePrivacyLevel.ALLOW;if(ee.tagName==="INPUT"){const re=ee;if(re.type==="password"||re.type==="email"||re.type==="tel"||re.type==="hidden")return NodePrivacyLevel.MASK;const te=re.getAttribute("autocomplete");if(te&&(te.startsWith("cc-")||te.endsWith("-password")))return NodePrivacyLevel.MASK}if(ee.matches(getPrivacySelector(NodePrivacyLevel.HIDDEN)))return NodePrivacyLevel.HIDDEN;if(ee.matches(getPrivacySelector(NodePrivacyLevel.MASK)))return NodePrivacyLevel.MASK;if(ee.matches(getPrivacySelector(NodePrivacyLevel.MASK_USER_INPUT)))return NodePrivacyLevel.MASK_USER_INPUT;if(ee.matches(getPrivacySelector(NodePrivacyLevel.ALLOW)))return NodePrivacyLevel.ALLOW;if(shouldIgnoreElement(ee))return NodePrivacyLevel.IGNORE}}function shouldMaskNode(ee,re){switch(re){case NodePrivacyLevel.MASK:case NodePrivacyLevel.HIDDEN:case NodePrivacyLevel.IGNORE:return!0;case NodePrivacyLevel.MASK_USER_INPUT:return isTextNode(ee)?isFormElement(ee.parentNode):isFormElement(ee);default:return!1}}function isFormElement(ee){if(!ee||ee.nodeType!==ee.ELEMENT_NODE)return!1;const re=ee;if(re.tagName==="INPUT")switch(re.type){case"button":case"color":case"reset":case"submit":return!1}return!!FORM_PRIVATE_TAG_NAMES[re.tagName]}const censorText=ee=>ee.replace(/\S/g,TEXT_MASKING_CHAR);function getTextContent(ee,re,te){var ne;const ie=(ne=ee.parentElement)===null||ne===void 0?void 0:ne.tagName;let oe=ee.textContent||"";if(re&&!oe.trim())return;const se=te;if(ie==="SCRIPT")oe=CENSORED_STRING_MARK;else if(se===NodePrivacyLevel.HIDDEN)oe=CENSORED_STRING_MARK;else if(shouldMaskNode(ee,se))if(ie==="DATALIST"||ie==="SELECT"||ie==="OPTGROUP"){if(!oe.trim())return}else ie==="OPTION"?oe=CENSORED_STRING_MARK:oe=censorText(oe);return oe}function shouldIgnoreElement(ee){if(ee.nodeName==="SCRIPT")return!0;if(ee.nodeName==="LINK"){const te=re("rel");return/preload|prefetch/i.test(te)&&re("as")==="script"||te==="shortcut icon"||te==="icon"}if(ee.nodeName==="META"){const te=re("name"),ne=re("rel"),ie=re("property");return/^msapplication-tile(image|color)$/.test(te)||te==="application-name"||ne==="icon"||ne==="apple-touch-icon"||ne==="shortcut icon"||te==="keywords"||te==="description"||/^(og|twitter|fb):/.test(ie)||/^(og|twitter):/.test(te)||te==="pinterest"||te==="robots"||te==="googlebot"||te==="bingbot"||ee.hasAttribute("http-equiv")||te==="author"||te==="generator"||te==="framework"||te==="publisher"||te==="progid"||/^article:/.test(ie)||/^product:/.test(ie)||te==="google-site-verification"||te==="yandex-verification"||te==="csrf-token"||te==="p:domain_verify"||te==="verify-v1"||te==="verification"||te==="shopify-checkout-api-token"}function re(te){return(ee.getAttribute(te)||"").toLowerCase()}return!1}function getPrivacySelector(ee){return`[${PRIVACY_ATTR_NAME}="${ee}"], .${PRIVACY_CLASS_PREFIX}${ee}`}const DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE="data-dd-action-name",ACTION_NAME_PLACEHOLDER="Masked Element";function getActionNameFromElement(ee,{enablePrivacyForActionName:re,actionNameAttribute:te},ne){const ie=getActionNameFromElementProgrammatically(ee,DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE)||te&&getActionNameFromElementProgrammatically(ee,te);return ie?{name:ie,nameSource:"custom_attribute"}:ne===NodePrivacyLevel.MASK?{name:ACTION_NAME_PLACEHOLDER,nameSource:"mask_placeholder"}:getActionNameFromElementForStrategies(ee,te,priorityStrategies,re)||getActionNameFromElementForStrategies(ee,te,fallbackStrategies,re)||{name:"",nameSource:"blank"}}function getActionNameFromElementProgrammatically(ee,re){const te=ee.closest(`[${re}]`);if(!te)return;const ne=te.getAttribute(re);return truncate(normalizeWhitespace(ne.trim()))}const priorityStrategies=[(ee,re)=>{if("labels"in ee&&ee.labels&&ee.labels.length>0)return getActionNameFromTextualContent(ee.labels[0],re)},ee=>{if(ee.nodeName==="INPUT"){const re=ee,te=re.getAttribute("type");if(te==="button"||te==="submit"||te==="reset")return{name:re.value,nameSource:"text_content"}}},(ee,re,te)=>{if(ee.nodeName==="BUTTON"||ee.nodeName==="LABEL"||ee.getAttribute("role")==="button")return getActionNameFromTextualContent(ee,re,te)},ee=>getActionNameFromStandardAttribute(ee,"aria-label"),(ee,re,te)=>{const ne=ee.getAttribute("aria-labelledby");if(ne)return{name:ne.split(/\s+/).map(ie=>getElementById(ee,ie)).filter(ie=>!!ie).map(ie=>getTextualContent(ie,re,te)).join(" "),nameSource:"text_content"}},ee=>getActionNameFromStandardAttribute(ee,"alt"),ee=>getActionNameFromStandardAttribute(ee,"name"),ee=>getActionNameFromStandardAttribute(ee,"title"),ee=>getActionNameFromStandardAttribute(ee,"placeholder"),(ee,re)=>{if("options"in ee&&ee.options.length>0)return getActionNameFromTextualContent(ee.options[0],re)}],fallbackStrategies=[(ee,re,te)=>getActionNameFromTextualContent(ee,re,te)],MAX_PARENTS_TO_CONSIDER=10;function getActionNameFromElementForStrategies(ee,re,te,ne){let ie=ee,oe=0;for(;oe<=MAX_PARENTS_TO_CONSIDER&&ie&&ie.nodeName!=="BODY"&&ie.nodeName!=="HTML"&&ie.nodeName!=="HEAD";){for(const se of te){const ae=se(ie,re,ne);if(ae){const{name:ue,nameSource:ce}=ae,le=ue&&ue.trim();if(le)return{name:truncate(normalizeWhitespace(le)),nameSource:ce}}}if(ie.nodeName==="FORM")break;ie=ie.parentElement,oe+=1}}function normalizeWhitespace(ee){return ee.replace(/\s+/g," ")}function truncate(ee){return ee.length>100?`${safeTruncate(ee,100)} [...]`:ee}function getElementById(ee,re){return ee.ownerDocument?ee.ownerDocument.getElementById(re):null}function getActionNameFromStandardAttribute(ee,re){return{name:ee.getAttribute(re)||"",nameSource:"standard_attribute"}}function getActionNameFromTextualContent(ee,re,te){return{name:getTextualContent(ee,re,te)||"",nameSource:"text_content"}}function getTextualContent(ee,re,te){if(!ee.isContentEditable){if("innerText"in ee){let ne=ee.innerText;const ie=oe=>{const se=ee.querySelectorAll(oe);for(let ae=0;ae<se.length;ae+=1){const ue=se[ae];if("innerText"in ue){const ce=ue.innerText;ce&&ce.trim().length>0&&(ne=ne.replace(ce,""))}}};return ie(`[${DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE}]`),re&&ie(`[${re}]`),te&&ie(`${getPrivacySelector(NodePrivacyLevel.HIDDEN)}, ${getPrivacySelector(NodePrivacyLevel.MASK)}`),ne}return ee.textContent}}const STABLE_ATTRIBUTES=[DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],GLOBALLY_UNIQUE_SELECTOR_GETTERS=[getStableAttributeSelector,getIDSelector],UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS=[getStableAttributeSelector,getClassSelector,getTagNameSelector];function getSelectorFromElement(ee,re){if(!ee.isConnected)return;let te,ne=ee;for(;ne&&ne.nodeName!=="HTML";){const ie=findSelector(ne,GLOBALLY_UNIQUE_SELECTOR_GETTERS,isSelectorUniqueGlobally,re,te);if(ie)return ie;te=findSelector(ne,UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS,isSelectorUniqueAmongSiblings,re,te)||combineSelector(getPositionSelector(ne),te),ne=ne.parentElement}return te}function isGeneratedValue(ee){return/[0-9]/.test(ee)}function getIDSelector(ee){if(ee.id&&!isGeneratedValue(ee.id))return`#${CSS.escape(ee.id)}`}function getClassSelector(ee){if(ee.tagName==="BODY")return;const re=ee.classList;for(let te=0;te<re.length;te+=1){const ne=re[te];if(!isGeneratedValue(ne))return`${CSS.escape(ee.tagName)}.${CSS.escape(ne)}`}}function getTagNameSelector(ee){return CSS.escape(ee.tagName)}function getStableAttributeSelector(ee,re){if(re){const ne=te(re);if(ne)return ne}for(const ne of STABLE_ATTRIBUTES){const ie=te(ne);if(ie)return ie}function te(ne){if(ee.hasAttribute(ne))return`${CSS.escape(ee.tagName)}[${ne}="${CSS.escape(ee.getAttribute(ne))}"]`}}function getPositionSelector(ee){let re=ee.parentElement.firstElementChild,te=1;for(;re&&re!==ee;)re.tagName===ee.tagName&&(te+=1),re=re.nextElementSibling;return`${CSS.escape(ee.tagName)}:nth-of-type(${te})`}function findSelector(ee,re,te,ne,ie){for(const oe of re){const se=oe(ee,ne);if(se&&te(ee,se,ie))return combineSelector(se,ie)}}function isSelectorUniqueGlobally(ee,re,te){return ee.ownerDocument.querySelectorAll(combineSelector(re,te)).length===1}function isSelectorUniqueAmongSiblings(ee,re,te){let ne;if(te===void 0)ne=se=>se.matches(re);else{const se=combineSelector(`${re}:scope`,te);ne=ae=>ae.querySelector(se)!==null}let oe=ee.parentElement.firstElementChild;for(;oe;){if(oe!==ee&&ne(oe))return!1;oe=oe.nextElementSibling}return!0}function combineSelector(ee,re){return re?`${ee}>${re}`:ee}const MAX_DURATION_BETWEEN_CLICKS=ONE_SECOND,MAX_DISTANCE_BETWEEN_CLICKS=100;function createClickChain(ee,re){const te=[];let ne=0,ie;oe(ee);function oe(ue){ue.stopObservable.subscribe(se),te.push(ue),clearTimeout$1(ie),ie=setTimeout$1(ae,MAX_DURATION_BETWEEN_CLICKS)}function se(){ne===1&&te.every(ue=>ue.isStopped())&&(ne=2,re(te))}function ae(){clearTimeout$1(ie),ne===0&&(ne=1,se())}return{tryAppend:ue=>ne!==0?!1:te.length>0&&!areEventsSimilar(te[te.length-1].event,ue.event)?(ae(),!1):(oe(ue),!0),stop:()=>{ae()}}}function areEventsSimilar(ee,re){return ee.target===re.target&&mouseEventDistance(ee,re)<=MAX_DISTANCE_BETWEEN_CLICKS&&ee.timeStamp-re.timeStamp<=MAX_DURATION_BETWEEN_CLICKS}function mouseEventDistance(ee,re){return Math.sqrt(Math.pow(ee.clientX-re.clientX,2)+Math.pow(ee.clientY-re.clientY,2))}function listenActionEvents(ee,{onPointerDown:re,onPointerUp:te}){let ne,ie={selection:!1,input:!1,scroll:!1},oe;const se=[addEventListener$1(ee,window,"pointerdown",ae=>{isValidPointerEvent(ae)&&(ne=isSelectionEmpty(),ie={selection:!1,input:!1,scroll:!1},oe=re(ae))},{capture:!0}),addEventListener$1(ee,window,"selectionchange",()=>{(!ne||!isSelectionEmpty())&&(ie.selection=!0)},{capture:!0}),addEventListener$1(ee,window,"scroll",()=>{ie.scroll=!0},{capture:!0,passive:!0}),addEventListener$1(ee,window,"pointerup",ae=>{if(isValidPointerEvent(ae)&&oe){const ue=ie;te(oe,ae,()=>ue),oe=void 0}},{capture:!0}),addEventListener$1(ee,window,"input",()=>{ie.input=!0},{capture:!0})];return{stop:()=>{se.forEach(ae=>ae.stop())}}}function isSelectionEmpty(){const ee=window.getSelection();return!ee||ee.isCollapsed}function isValidPointerEvent(ee){return ee.target instanceof Element&&ee.isPrimary!==!1}const MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE=3;function computeFrustration(ee,re){if(isRage(ee))return re.addFrustration("rage_click"),ee.some(isDead)&&re.addFrustration("dead_click"),re.hasError&&re.addFrustration("error_click"),{isRage:!0};const te=ee.some(ne=>ne.getUserActivity().selection);return ee.forEach(ne=>{ne.hasError&&ne.addFrustration("error_click"),isDead(ne)&&!te&&ne.addFrustration("dead_click")}),{isRage:!1}}function isRage(ee){if(ee.some(re=>re.getUserActivity().selection||re.getUserActivity().scroll))return!1;for(let re=0;re<ee.length-(MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE-1);re+=1)if(ee[re+MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE-1].event.timeStamp-ee[re].event.timeStamp<=ONE_SECOND)return!0;return!1}const DEAD_CLICK_EXCLUDE_SELECTOR='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function isDead(ee){return ee.hasPageActivity||ee.getUserActivity().input||ee.getUserActivity().scroll?!1:!ee.event.target.matches(DEAD_CLICK_EXCLUDE_SELECTOR)}const CLICK_ACTION_MAX_DURATION=10*ONE_SECOND,interactionSelectorCache=new Map;function getInteractionSelector(ee){const re=interactionSelectorCache.get(ee);return interactionSelectorCache.delete(ee),re}function updateInteractionSelector(ee,re){interactionSelectorCache.set(ee,re),interactionSelectorCache.forEach((te,ne)=>{elapsed(ne,relativeNow())>CLICK_ACTION_MAX_DURATION&&interactionSelectorCache.delete(ne)})}const ACTION_CONTEXT_TIME_OUT_DELAY=5*ONE_MINUTE;function trackClickActions(ee,re,te,ne){const ie=createValueHistory({expireDelay:ACTION_CONTEXT_TIME_OUT_DELAY}),oe=new Observable$1;let se;ee.subscribe(10,()=>{ie.reset()}),ee.subscribe(5,le),ee.subscribe(11,de=>{de.reason===PageExitReason.UNLOADING&&le()});const{stop:ae}=listenActionEvents(ne,{onPointerDown:de=>processPointerDown(ne,ee,re,de,te),onPointerUp:({clickActionBase:de,hadActivityOnPointerDown:fe},he,pe)=>{startClickAction(ne,ee,re,te,ie,oe,ce,de,he,pe,fe)}});return{stop:()=>{le(),oe.notify(),ae()},actionContexts:{findActionId:de=>ie.findAll(de)}};function ce(de){if(!se||!se.tryAppend(de)){const fe=de.clone();se=createClickChain(de,he=>{finalizeClicks(he,fe)})}}function le(){se&&se.stop()}}function processPointerDown(ee,re,te,ne,ie){const oe=ee.enablePrivacyForActionName?getNodePrivacyLevel(ne.target,ee.defaultPrivacyLevel):NodePrivacyLevel.ALLOW;if(oe===NodePrivacyLevel.HIDDEN)return;const se=computeClickActionBase(ne,oe,ee);let ae=!1;return waitPageActivityEnd(re,te,ie,ee,ue=>{ae=ue.hadActivity},PAGE_ACTIVITY_VALIDATION_DELAY),{clickActionBase:se,hadActivityOnPointerDown:()=>ae}}function startClickAction(ee,re,te,ne,ie,oe,se,ae,ue,ce,le){var de;const fe=newClick(re,ie,ce,ae,ue);se(fe);const he=(de=ae==null?void 0:ae.target)===null||de===void 0?void 0:de.selector;he&&updateInteractionSelector(ue.timeStamp,he);const{stop:pe}=waitPageActivityEnd(re,te,ne,ee,ye=>{ye.hadActivity&&ye.end<fe.startClocks.timeStamp?fe.discard():ye.hadActivity?fe.stop(ye.end):le()?fe.stop(fe.startClocks.timeStamp):fe.stop()},CLICK_ACTION_MAX_DURATION),ge=re.subscribe(5,({endClocks:ye})=>{fe.stop(ye.timeStamp)}),me=oe.subscribe(()=>{fe.stop()});fe.stopObservable.subscribe(()=>{ge.unsubscribe(),pe(),me.unsubscribe()})}function computeClickActionBase(ee,re,te){const ne=ee.target.getBoundingClientRect(),ie=getSelectorFromElement(ee.target,te.actionNameAttribute);ie&&updateInteractionSelector(ee.timeStamp,ie);const oe=getActionNameFromElement(ee.target,te,re);return{type:"click",target:{width:Math.round(ne.width),height:Math.round(ne.height),selector:ie},position:{x:Math.round(ee.clientX-ne.left),y:Math.round(ee.clientY-ne.top)},name:oe.name,nameSource:oe.nameSource}}function newClick(ee,re,te,ne,ie){const oe=generateUUID(),se=clocksNow(),ae=re.add(oe,se.relative),ue=trackEventCounts({lifeCycle:ee,isChildEvent:pe=>pe.action!==void 0&&(Array.isArray(pe.action.id)?pe.action.id.includes(oe):pe.action.id===oe)});let ce=0,le;const de=[],fe=new Observable$1;function he(pe){ce===0&&(le=pe,ce=1,le?ae.close(getRelativeTime(le)):ae.remove(),ue.stop(),fe.notify())}return{event:ie,stop:he,stopObservable:fe,get hasError(){return ue.eventCounts.errorCount>0},get hasPageActivity(){return le!==void 0},getUserActivity:te,addFrustration:pe=>{de.push(pe)},startClocks:se,isStopped:()=>ce===1||ce===2,clone:()=>newClick(ee,re,te,ne,ie),validate:pe=>{if(he(),ce!==1)return;const{resourceCount:ge,errorCount:me,longTaskCount:ye}=ue.eventCounts,ve={duration:le&&elapsed(se.timeStamp,le),startClocks:se,id:oe,frustrationTypes:de,counts:{resourceCount:ge,errorCount:me,longTaskCount:ye},events:pe??[ie],event:ie,...ne};ee.notify(0,ve),ce=2},discard:()=>{he(),ce=2}}}function finalizeClicks(ee,re){const{isRage:te}=computeFrustration(ee,re);te?(ee.forEach(ne=>ne.discard()),re.stop(timeStampNow()),re.validate(ee.map(ne=>ne.event))):(re.discard(),ee.forEach(ne=>ne.validate()))}function startActionCollection(ee,re,te,ne,ie){ee.subscribe(0,ae=>ee.notify(12,processAction(ae))),re.register(0,({startTime:ae,eventType:ue})=>{if(ue!=="error"&&ue!=="resource"&&ue!=="long_task")return;const ce=oe.findActionId(ae);if(ce)return{type:ue,action:{id:ce}}});let oe={findActionId:noop$2},se=noop$2;return ie.trackUserInteractions&&({actionContexts:oe,stop:se}=trackClickActions(ee,te,ne,ie)),{addAction:ae=>{ee.notify(12,processAction(ae))},actionContexts:oe,stop:se}}function processAction(ee){const re=isAutoAction(ee)?{action:{id:ee.id,loading_time:discardNegativeDuration(toServerDuration(ee.duration)),frustration:{type:ee.frustrationTypes},error:{count:ee.counts.errorCount},long_task:{count:ee.counts.longTaskCount},resource:{count:ee.counts.resourceCount}},_dd:{action:{target:ee.target,position:ee.position,name_source:ee.nameSource}}}:void 0,te=combine({action:{id:generateUUID(),target:{name:ee.name},type:ee.type},date:ee.startClocks.timeStamp,type:"action"},re),ne=isAutoAction(ee)?ee.duration:void 0,ie=isAutoAction(ee)?void 0:ee.context,oe=isAutoAction(ee)?{events:ee.events}:{handlingStack:ee.handlingStack};return{customerContext:ie,rawRumEvent:te,duration:ne,startTime:ee.startClocks.relative,domainContext:oe}}function isAutoAction(ee){return ee.type!=="custom"}function trackConsoleError(ee){const re=initConsoleObservable([ConsoleApiName.error]).subscribe(te=>ee.notify(te.error));return{stop:()=>{re.unsubscribe()}}}function trackReportError(ee,re){const te=initReportObservable(ee,[RawReportType.cspViolation,RawReportType.intervention]).subscribe(ne=>re.notify(ne));return{stop:()=>{te.unsubscribe()}}}function startErrorCollection(ee,re){const te=new Observable$1;return trackConsoleError(te),trackRuntimeError(te),trackReportError(re,te),te.subscribe(ne=>ee.notify(14,{error:ne})),doStartErrorCollection(ee)}function doStartErrorCollection(ee){return ee.subscribe(14,({error:re,customerContext:te})=>{te=combine(re.context,te),ee.notify(12,{customerContext:te,...processError(re)})}),{addError:({error:re,handlingStack:te,componentStack:ne,startClocks:ie,context:oe})=>{const se=isError(re)?computeStackTrace(re):void 0,ae=computeRawError({stackTrace:se,originalError:re,handlingStack:te,componentStack:ne,startClocks:ie,nonErrorPrefix:"Provided",source:ErrorSource.CUSTOM,handling:"handled"});ee.notify(14,{customerContext:oe,error:ae})}}}function processError(ee){const re={date:ee.startClocks.timeStamp,error:{id:generateUUID(),message:ee.message,source:ee.source,stack:ee.stack,handling_stack:ee.handlingStack,component_stack:ee.componentStack,type:ee.type,handling:ee.handling,causes:ee.causes,source_type:"browser",fingerprint:ee.fingerprint,csp:ee.csp},type:"error"},te={error:ee.originalError,handlingStack:ee.handlingStack};return{rawRumEvent:re,startTime:ee.startClocks.relative,domainContext:te}}const alreadyMatchedEntries=new WeakSet;function matchRequestResourceEntry(ee){if(!performance||!("getEntriesByName"in performance))return;const re=performance.getEntriesByName(ee.url,"resource");if(!re.length||!("toJSON"in re[0]))return;const te=re.filter(ne=>!alreadyMatchedEntries.has(ne)).filter(ne=>hasValidResourceEntryDuration(ne)&&hasValidResourceEntryTimings(ne)).filter(ne=>isBetween(ne,ee.startClocks.relative,endTime({startTime:ee.startClocks.relative,duration:ee.duration})));if(te.length===1)return alreadyMatchedEntries.add(te[0]),te[0].toJSON()}function endTime(ee){return addDuration(ee.startTime,ee.duration)}function isBetween(ee,re,te){return ee.startTime>=re-1&&endTime(ee)<=addDuration(te,1)}const INITIAL_DOCUMENT_OUTDATED_TRACE_ID_THRESHOLD=2*ONE_MINUTE;function getDocumentTraceId(ee){const re=getDocumentTraceDataFromMeta(ee)||getDocumentTraceDataFromComment(ee);if(!(!re||re.traceTime<=dateNow()-INITIAL_DOCUMENT_OUTDATED_TRACE_ID_THRESHOLD))return re.traceId}function getDocumentTraceDataFromMeta(ee){const re=ee.querySelector("meta[name=dd-trace-id]"),te=ee.querySelector("meta[name=dd-trace-time]");return createDocumentTraceData(re&&re.content,te&&te.content)}function getDocumentTraceDataFromComment(ee){const re=findTraceComment(ee);if(re)return createDocumentTraceData(findCommaSeparatedValue(re,"trace-id"),findCommaSeparatedValue(re,"trace-time"))}function createDocumentTraceData(ee,re){const te=re&&Number(re);if(!(!ee||!te))return{traceId:ee,traceTime:te}}function findTraceComment(ee){for(let re=0;re<ee.childNodes.length;re+=1){const te=getTraceCommentFromNode(ee.childNodes[re]);if(te)return te}if(ee.body)for(let re=ee.body.childNodes.length-1;re>=0;re-=1){const te=ee.body.childNodes[re],ne=getTraceCommentFromNode(te);if(ne)return ne;if(!isTextNode(te))break}}function getTraceCommentFromNode(ee){if(ee&&isCommentNode(ee)){const re=/^\s*DATADOG;(.*?)\s*$/.exec(ee.data);if(re)return re[1]}}function getNavigationEntry(){if(supportPerformanceTimingEvent(RumPerformanceEntryType.NAVIGATION)){const te=performance.getEntriesByType(RumPerformanceEntryType.NAVIGATION)[0];if(te)return te}const ee=computeTimingsFromDeprecatedPerformanceTiming(),re={entryType:RumPerformanceEntryType.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:ee.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...re,toJSON:void 0}),...ee};return re}function computeTimingsFromDeprecatedPerformanceTiming(){const ee={},re=performance.timing;for(const te in re)if(isNumber$1(re[te])){const ne=te,ie=re[ne];ee[ne]=ie===0?0:getRelativeTime(ie)}return ee}function retrieveInitialDocumentResourceTiming(ee,re,te=getNavigationEntry){runOnReadyState(ee,"interactive",()=>{const ne=te(),ie=Object.assign(ne.toJSON(),{entryType:RumPerformanceEntryType.RESOURCE,initiatorType:FAKE_INITIAL_DOCUMENT,duration:ne.responseEnd,traceId:getDocumentTraceId(document),toJSON:()=>({...ie,toJSON:void 0})});re(ie)})}function startResourceCollection(ee,re,te,ne=createTaskQueue(),ie=retrieveInitialDocumentResourceTiming){ee.subscribe(8,ae=>{se(()=>processRequest(ae,re,te))});const oe=createPerformanceObservable(re,{type:RumPerformanceEntryType.RESOURCE,buffered:!0}).subscribe(ae=>{for(const ue of ae)isResourceEntryRequestType(ue)||se(()=>processResourceEntry(ue,re))});ie(re,ae=>{se(()=>processResourceEntry(ae,re))});function se(ae){ne.push(()=>{const ue=ae();ue&&ee.notify(12,ue)})}return{stop:()=>{oe.unsubscribe()}}}function processRequest(ee,re,te){const ne=matchRequestResourceEntry(ee),ie=ne?relativeToClocks(ne.startTime):ee.startClocks,oe=computeRequestTracingInfo(ee,re);if(!re.trackResources&&!oe)return;const se=ee.type==="xhr"?"xhr":"fetch",ae=ne?computeResourceEntryMetrics(ne):void 0,ue=ne?computeResourceEntryDuration(ne):computeRequestDuration(te,ie,ee.duration),ce=combine({date:ie.timeStamp,resource:{id:generateUUID(),type:se,duration:toServerDuration(ue),method:ee.method,status_code:ee.status,protocol:ne&&computeResourceEntryProtocol(ne),url:isLongDataUrl(ee.url)?sanitizeDataUrl(ee.url):ee.url,delivery_type:ne&&computeResourceEntryDeliveryType(ne)},type:"resource",_dd:{discarded:!re.trackResources}},oe,ae);return{startTime:ie.relative,duration:ue,rawRumEvent:ce,domainContext:{performanceEntry:ne,xhr:ee.xhr,response:ee.response,requestInput:ee.input,requestInit:ee.init,error:ee.error,isAborted:ee.isAborted,handlingStack:ee.handlingStack}}}function processResourceEntry(ee,re){const te=relativeToClocks(ee.startTime),ne=computeResourceEntryTracingInfo(ee,re);if(!re.trackResources&&!ne)return;const ie=computeResourceEntryType(ee),oe=computeResourceEntryMetrics(ee),se=computeResourceEntryDuration(ee),ae=combine({date:te.timeStamp,resource:{id:generateUUID(),type:ie,duration:toServerDuration(se),url:ee.name,status_code:discardZeroStatus(ee.responseStatus),protocol:computeResourceEntryProtocol(ee),delivery_type:computeResourceEntryDeliveryType(ee)},type:"resource",_dd:{discarded:!re.trackResources}},ne,oe);return{startTime:te.relative,duration:se,rawRumEvent:ae,domainContext:{performanceEntry:ee}}}function computeResourceEntryMetrics(ee){const{renderBlockingStatus:re}=ee;return{resource:{render_blocking_status:re,...computeResourceEntrySize(ee),...computeResourceEntryDetails(ee)}}}function computeRequestTracingInfo(ee,re){if(ee.traceSampled&&ee.traceId&&ee.spanId)return{_dd:{span_id:ee.spanId.toString(),trace_id:ee.traceId.toString(),rule_psr:re.rulePsr}}}function computeResourceEntryTracingInfo(ee,re){if(ee.traceId)return{_dd:{trace_id:ee.traceId,span_id:createSpanIdentifier().toString(),rule_psr:re.rulePsr}}}function computeRequestDuration(ee,re,te){return ee.wasInPageStateDuringPeriod("frozen",re.relative,te)?void 0:te}function discardZeroStatus(ee){return ee===0?void 0:ee}function trackViewEventCounts(ee,re,te){const{stop:ne,eventCounts:ie}=trackEventCounts({lifeCycle:ee,isChildEvent:oe=>oe.view.id===re,onChange:te});return{stop:ne,eventCounts:ie}}const FCP_MAXIMUM_DELAY=10*ONE_MINUTE;function trackFirstContentfulPaint(ee,re,te){return{stop:createPerformanceObservable(ee,{type:RumPerformanceEntryType.PAINT,buffered:!0}).subscribe(ie=>{const oe=ie.find(se=>se.name==="first-contentful-paint"&&se.startTime<re.timeStamp&&se.startTime<FCP_MAXIMUM_DELAY);oe&&te(oe.startTime)}).unsubscribe}}function trackFirstInput(ee,re,te){const ne=createPerformanceObservable(ee,{type:RumPerformanceEntryType.FIRST_INPUT,buffered:!0}).subscribe(ie=>{const oe=ie.find(se=>se.startTime<re.timeStamp);if(oe){const se=elapsed(oe.startTime,oe.processingStart);let ae;oe.target&&isElementNode(oe.target)&&(ae=getSelectorFromElement(oe.target,ee.actionNameAttribute)),te({delay:se>=0?se:0,time:oe.startTime,targetSelector:ae})}});return{stop:()=>{ne.unsubscribe()}}}function trackNavigationTimings(ee,re,te=getNavigationEntry){return waitAfterLoadEvent(ee,()=>{const ne=te();isIncompleteNavigation(ne)||re(processNavigationEntry(ne))})}function processNavigationEntry(ee){return{domComplete:ee.domComplete,domContentLoaded:ee.domContentLoadedEventEnd,domInteractive:ee.domInteractive,loadEvent:ee.loadEventEnd,firstByte:ee.responseStart>=0&&ee.responseStart<=relativeNow()?ee.responseStart:void 0}}function isIncompleteNavigation(ee){return ee.loadEventEnd<=0}function waitAfterLoadEvent(ee,re){let te;const{stop:ne}=runOnReadyState(ee,"complete",()=>{te=setTimeout$1(()=>re())});return{stop:()=>{ne(),clearTimeout$1(te)}}}const LCP_MAXIMUM_DELAY=10*ONE_MINUTE;function trackLargestContentfulPaint(ee,re,te,ne){let ie=1/0;const{stop:oe}=addEventListeners(ee,te,["pointerdown","keydown"],ue=>{ie=ue.timeStamp},{capture:!0,once:!0});let se=0;const ae=createPerformanceObservable(ee,{type:RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(ue=>{const ce=findLast(ue,le=>le.entryType===RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT&&le.startTime<ie&&le.startTime<re.timeStamp&&le.startTime<LCP_MAXIMUM_DELAY&&le.size>se);if(ce){let le;ce.element&&(le=getSelectorFromElement(ce.element,ee.actionNameAttribute)),ne({value:ce.startTime,targetSelector:le,resourceUrl:computeLcpEntryUrl(ce)}),se=ce.size}});return{stop:()=>{oe(),ae.unsubscribe()}}}function computeLcpEntryUrl(ee){return ee.url===""?void 0:ee.url}function trackFirstHidden(ee,re=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:noop$2};if(supportPerformanceTimingEvent(RumPerformanceEntryType.VISIBILITY_STATE)){const ie=performance.getEntriesByType(RumPerformanceEntryType.VISIBILITY_STATE).find(oe=>oe.name==="hidden");if(ie)return{timeStamp:ie.startTime,stop:noop$2}}let te=1/0;const{stop:ne}=addEventListeners(ee,re,["pagehide","visibilitychange"],ie=>{(ie.type==="pagehide"||document.visibilityState==="hidden")&&(te=ie.timeStamp,ne())},{capture:!0});return{get timeStamp(){return te},stop:ne}}function trackInitialViewMetrics(ee,re,te){const ne={},{stop:ie}=trackNavigationTimings(ee,le=>{re(le.loadEvent),ne.navigationTimings=le,te()}),oe=trackFirstHidden(ee),{stop:se}=trackFirstContentfulPaint(ee,oe,le=>{ne.firstContentfulPaint=le,te()}),{stop:ae}=trackLargestContentfulPaint(ee,oe,window,le=>{ne.largestContentfulPaint=le,te()}),{stop:ue}=trackFirstInput(ee,oe,le=>{ne.firstInput=le,te()});function ce(){ie(),se(),ae(),ue(),oe.stop()}return{stop:ce,initialViewMetrics:ne}}function trackCumulativeLayoutShift(ee,re,te){if(!isLayoutShiftSupported())return{stop:noop$2};let ne=0,ie;te({value:0});const oe=slidingSessionWindow(),se=createPerformanceObservable(ee,{type:RumPerformanceEntryType.LAYOUT_SHIFT,buffered:!0}).subscribe(ae=>{var ue;for(const ce of ae){if(ce.hadRecentInput||ce.startTime<re)continue;const{cumulatedValue:le,isMaxValue:de}=oe.update(ce);if(de){const fe=getFirstElementAttribution(ce.sources);ie={target:fe!=null&&fe.node?new WeakRef(fe.node):void 0,time:elapsed(re,ce.startTime),previousRect:fe==null?void 0:fe.previousRect,currentRect:fe==null?void 0:fe.currentRect,devicePixelRatio:window.devicePixelRatio}}if(le>ne){ne=le;const fe=(ue=ie==null?void 0:ie.target)===null||ue===void 0?void 0:ue.deref();te({value:round(ne,4),targetSelector:fe&&getSelectorFromElement(fe,ee.actionNameAttribute),time:ie==null?void 0:ie.time,previousRect:ie!=null&&ie.previousRect?asRumRect(ie.previousRect):void 0,currentRect:ie!=null&&ie.currentRect?asRumRect(ie.currentRect):void 0,devicePixelRatio:ie==null?void 0:ie.devicePixelRatio})}}});return{stop:()=>{se.unsubscribe()}}}function getFirstElementAttribution(ee){return ee.find(re=>!!re.node&&isElementNode(re.node))}function asRumRect({x:ee,y:re,width:te,height:ne}){return{x:ee,y:re,width:te,height:ne}}const MAX_WINDOW_DURATION=5*ONE_SECOND,MAX_UPDATE_GAP=ONE_SECOND;function slidingSessionWindow(){let ee=0,re,te,ne=0;return{update:ie=>{const oe=re===void 0||ie.startTime-te>=MAX_UPDATE_GAP||ie.startTime-re>=MAX_WINDOW_DURATION;let se;return oe?(re=te=ie.startTime,ne=ee=ie.value,se=!0):(ee+=ie.value,te=ie.startTime,se=ie.value>ne,se&&(ne=ie.value)),{cumulatedValue:ee,isMaxValue:se}}}}function isLayoutShiftSupported(){return supportPerformanceTimingEvent(RumPerformanceEntryType.LAYOUT_SHIFT)&&"WeakRef"in window}let observer,interactionCountEstimate=0,minKnownInteractionId=1/0,maxKnownInteractionId=0;function initInteractionCountPolyfill(){"interactionCount"in performance||observer||(observer=new window.PerformanceObserver(monitor(ee=>{ee.getEntries().forEach(re=>{const te=re;te.interactionId&&(minKnownInteractionId=Math.min(minKnownInteractionId,te.interactionId),maxKnownInteractionId=Math.max(maxKnownInteractionId,te.interactionId),interactionCountEstimate=(maxKnownInteractionId-minKnownInteractionId)/7+1)})})),observer.observe({type:"event",buffered:!0,durationThreshold:0}))}const getInteractionCount=()=>observer?interactionCountEstimate:window.performance.interactionCount||0,MAX_INTERACTION_ENTRIES=10,MAX_INP_VALUE=1*ONE_MINUTE;function trackInteractionToNextPaint(ee,re,te){if(!isInteractionToNextPaintSupported())return{getInteractionToNextPaint:()=>{},setViewEnd:noop$2,stop:noop$2};const{getViewInteractionCount:ne,stopViewInteractionCount:ie}=trackViewInteractionCount(te);let oe=1/0;const se=trackLongestInteractions(ne);let ae=-1,ue,ce;function le(he){for(const ge of he)ge.interactionId&&ge.startTime>=re&&ge.startTime<=oe&&se.process(ge);const pe=se.estimateP98Interaction();pe&&pe.duration!==ae&&(ae=pe.duration,ce=elapsed(re,pe.startTime),ue=getInteractionSelector(pe.startTime),!ue&&pe.target&&isElementNode(pe.target)&&(ue=getSelectorFromElement(pe.target,ee.actionNameAttribute)))}const de=createPerformanceObservable(ee,{type:RumPerformanceEntryType.FIRST_INPUT,buffered:!0}).subscribe(le),fe=createPerformanceObservable(ee,{type:RumPerformanceEntryType.EVENT,durationThreshold:40,buffered:!0}).subscribe(le);return{getInteractionToNextPaint:()=>{if(ae>=0)return{value:Math.min(ae,MAX_INP_VALUE),targetSelector:ue,time:ce};if(ne())return{value:0}},setViewEnd:he=>{oe=he,ie()},stop:()=>{fe.unsubscribe(),de.unsubscribe()}}}function trackLongestInteractions(ee){const re=[];function te(){re.sort((ne,ie)=>ie.duration-ne.duration).splice(MAX_INTERACTION_ENTRIES)}return{process(ne){const ie=re.findIndex(se=>ne.interactionId===se.interactionId),oe=re[re.length-1];ie!==-1?ne.duration>re[ie].duration&&(re[ie]=ne,te()):(re.length<MAX_INTERACTION_ENTRIES||ne.duration>oe.duration)&&(re.push(ne),te())},estimateP98Interaction(){const ne=Math.min(re.length-1,Math.floor(ee()/50));return re[ne]}}}function trackViewInteractionCount(ee){initInteractionCountPolyfill();const re=ee==="initial_load"?0:getInteractionCount();let te={stopped:!1};function ne(){return getInteractionCount()-re}return{getViewInteractionCount:()=>te.stopped?te.interactionCount:ne(),stopViewInteractionCount:()=>{te={stopped:!0,interactionCount:ne()}}}}function isInteractionToNextPaintSupported(){return supportPerformanceTimingEvent(RumPerformanceEntryType.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function trackLoadingTime(ee,re,te,ne,ie,oe,se){let ae=ie==="initial_load",ue=!0;const ce=[],le=trackFirstHidden(ne);function de(){if(!ue&&!ae&&ce.length>0){const he=Math.max(...ce);he<le.timeStamp&&se(he)}}const{stop:fe}=waitPageActivityEnd(ee,re,te,ne,he=>{ue&&(ue=!1,he.hadActivity&&ce.push(elapsed(oe.timeStamp,he.end)),de())});return{stop:()=>{fe(),le.stop()},setLoadEvent:he=>{ae&&(ae=!1,ce.push(he),de())}}}function getScrollX(){let ee;const re=window.visualViewport;return re?ee=re.pageLeft-re.offsetLeft:window.scrollX!==void 0?ee=window.scrollX:ee=window.pageXOffset||0,Math.round(ee)}function getScrollY(){let ee;const re=window.visualViewport;return re?ee=re.pageTop-re.offsetTop:window.scrollY!==void 0?ee=window.scrollY:ee=window.pageYOffset||0,Math.round(ee)}let viewportObservable;function initViewportObservable(ee){return viewportObservable||(viewportObservable=createViewportObservable(ee)),viewportObservable}function createViewportObservable(ee){return new Observable$1(re=>{const{throttled:te}=throttle$2(()=>{re.notify(getViewportDimension())},200);return addEventListener$1(ee,window,"resize",te,{capture:!0,passive:!0}).stop})}function getViewportDimension(){const ee=window.visualViewport;return ee?{width:Number(ee.width*ee.scale),height:Number(ee.height*ee.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const THROTTLE_SCROLL_DURATION=ONE_SECOND;function trackScrollMetrics(ee,re,te,ne=createScrollValuesObservable(ee)){let ie=0,oe=0,se=0;const ae=ne.subscribe(({scrollDepth:ue,scrollTop:ce,scrollHeight:le})=>{let de=!1;if(ue>ie&&(ie=ue,de=!0),le>oe){oe=le;const fe=relativeNow();se=elapsed(re.relative,fe),de=!0}de&&te({maxDepth:Math.min(ie,oe),maxDepthScrollTop:ce,maxScrollHeight:oe,maxScrollHeightTime:se})});return{stop:()=>ae.unsubscribe()}}function computeScrollValues(){const ee=getScrollY(),{height:re}=getViewportDimension(),te=Math.round((document.scrollingElement||document.documentElement).scrollHeight),ne=Math.round(re+ee);return{scrollHeight:te,scrollDepth:ne,scrollTop:ee}}function createScrollValuesObservable(ee,re=THROTTLE_SCROLL_DURATION){return new Observable$1(te=>{function ne(){te.notify(computeScrollValues())}if(window.ResizeObserver){const ie=throttle$2(ne,re,{leading:!1,trailing:!0}),oe=document.scrollingElement||document.documentElement,se=new ResizeObserver(monitor(ie.throttled));oe&&se.observe(oe);const ae=addEventListener$1(ee,window,"scroll",ie.throttled,{passive:!0});return()=>{ie.cancel(),se.disconnect(),ae.stop()}}})}function trackCommonViewMetrics(ee,re,te,ne,ie,oe,se){const ae={},{stop:ue,setLoadEvent:ce}=trackLoadingTime(ee,re,te,ne,oe,se,ge=>{ae.loadingTime=ge,ie()}),{stop:le}=trackScrollMetrics(ne,se,ge=>{ae.scroll=ge}),{stop:de}=trackCumulativeLayoutShift(ne,se.relative,ge=>{ae.cumulativeLayoutShift=ge,ie()}),{stop:fe,getInteractionToNextPaint:he,setViewEnd:pe}=trackInteractionToNextPaint(ne,se.relative,oe);return{stop:()=>{ue(),de(),le()},stopINPTracking:fe,setLoadEvent:ce,setViewEnd:pe,getCommonViewMetrics:()=>(ae.interactionToNextPaint=he(),ae)}}const THROTTLE_VIEW_UPDATE_PERIOD=3e3,SESSION_KEEP_ALIVE_INTERVAL=5*ONE_MINUTE,KEEP_TRACKING_AFTER_VIEW_DELAY=5*ONE_MINUTE;function trackViews(ee,re,te,ne,ie,oe,se,ae){const ue=new Set;let ce=de("initial_load",clocksOrigin(),ae);fe();let le;se&&(le=he(oe));function de(pe,ge,me){const ye=newView(re,te,ne,ie,ee,pe,ge,me);return ue.add(ye),ye.stopObservable.subscribe(()=>{ue.delete(ye)}),ye}function fe(){re.subscribe(10,()=>{ce=de("route_change",void 0,{name:ce.name,service:ce.service,version:ce.version,context:ce.contextManager.getContext()})}),re.subscribe(9,()=>{ce.end({sessionIsActive:!1})})}function he(pe){return pe.subscribe(({oldLocation:ge,newLocation:me})=>{areDifferentLocation(ge,me)&&(ce.end(),ce=de("route_change"))})}return{addTiming:(pe,ge=timeStampNow())=>{ce.addTiming(pe,ge)},startView:(pe,ge)=>{ce.end({endClocks:ge}),ce=de("route_change",ge,pe)},setViewContext:pe=>{ce.contextManager.setContext(pe)},setViewContextProperty:(pe,ge)=>{ce.contextManager.setContextProperty(pe,ge)},setViewName:pe=>{ce.setViewName(pe)},getViewContext:()=>ce.contextManager.getContext(),stop:()=>{le&&le.unsubscribe(),ce.end(),ue.forEach(pe=>pe.stop())}}}function newView(ee,re,te,ne,ie,oe,se=clocksNow(),ae){const ue=generateUUID(),ce=new Observable$1,le={};let de=0,fe;const he=shallowClone(ie),pe=createContextManager();let ge=!0,me=ae==null?void 0:ae.name;const ye=(ae==null?void 0:ae.service)||ne.service,ve=(ae==null?void 0:ae.version)||ne.version,be=ae==null?void 0:ae.context;be&&pe.setContext(be);const _e={id:ue,name:me,startClocks:se,service:ye,version:ve,context:be};ee.notify(1,_e),ee.notify(2,_e);const{throttled:Ie,cancel:Te}=throttle$2(fr,THROTTLE_VIEW_UPDATE_PERIOD,{leading:!1}),{setLoadEvent:Se,setViewEnd:Oe,stop:Ce,stopINPTracking:we,getCommonViewMetrics:Re}=trackCommonViewMetrics(ee,re,te,ne,hr,oe,se),{stop:Ne,initialViewMetrics:Ue}=oe==="initial_load"?trackInitialViewMetrics(ne,Se,hr):{stop:noop$2,initialViewMetrics:{}},{stop:Fe,eventCounts:Ve}=trackViewEventCounts(ee,ue,hr),He=setInterval$1(fr,SESSION_KEEP_ALIVE_INTERVAL),ur=ee.subscribe(11,dr=>{dr.reason===PageExitReason.UNLOADING&&fr()});fr(),pe.changeObservable.subscribe(hr);function Ge(){ee.notify(3,{id:ue,name:me,context:pe.getContext(),startClocks:se})}function hr(){Ge(),Ie()}function fr(){Te(),Ge(),de+=1;const dr=fe===void 0?timeStampNow():fe.timeStamp;ee.notify(4,{customTimings:le,documentVersion:de,id:ue,name:me,service:ye,version:ve,context:pe.getContext(),loadingType:oe,location:he,startClocks:se,commonViewMetrics:Re(),initialViewMetrics:Ue,duration:elapsed(se.timeStamp,dr),isActive:fe===void 0,sessionIsActive:ge,eventCounts:Ve})}return{get name(){return me},service:ye,version:ve,contextManager:pe,stopObservable:ce,end(dr={}){var Qe,Bt;fe||(fe=(Qe=dr.endClocks)!==null&&Qe!==void 0?Qe:clocksNow(),ge=(Bt=dr.sessionIsActive)!==null&&Bt!==void 0?Bt:!0,ee.notify(5,{endClocks:fe}),ee.notify(6,{endClocks:fe}),clearInterval$1(He),Oe(fe.relative),Ce(),ur.unsubscribe(),fr(),setTimeout$1(()=>{this.stop()},KEEP_TRACKING_AFTER_VIEW_DELAY))},stop(){Ne(),Fe(),we(),ce.notify()},addTiming(dr,Qe){if(fe)return;const Bt=looksLikeRelativeTime(Qe)?Qe:elapsed(se.timeStamp,Qe);le[sanitizeTiming(dr)]=Bt,hr()},setViewName(dr){me=dr,fr()}}}function sanitizeTiming(ee){const re=ee.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return re!==ee&&display.warn(`Invalid timing name: ${ee}, sanitized to: ${re}`),re}function areDifferentLocation(ee,re){return ee.pathname!==re.pathname||!isHashAnAnchor(re.hash)&&getPathFromHash(re.hash)!==getPathFromHash(ee.hash)}function isHashAnAnchor(ee){const re=ee.substring(1);return re!==""&&!!document.getElementById(re)}function getPathFromHash(ee){const re=ee.indexOf("?");return re<0?ee:ee.slice(0,re)}function startViewCollection(ee,re,te,ne,ie,oe,se,ae,ue,ce){return ee.subscribe(4,le=>ee.notify(12,processViewUpdate(le,te,ae))),re.register(0,({startTime:le,eventType:de})=>{const{service:fe,version:he,id:pe,name:ge,context:me}=ue.findView(le);return{type:de,service:fe,version:he,context:me,view:{id:pe,name:ge}}}),trackViews(ne,ee,ie,oe,te,se,!te.trackViewsManually,ce)}function processViewUpdate(ee,re,te){var ne,ie,oe,se,ae,ue,ce,le,de,fe,he,pe,ge,me,ye,ve,be,_e;const Ie=te.getReplayStats(ee.id),Te=(ie=(ne=ee.commonViewMetrics)===null||ne===void 0?void 0:ne.cumulativeLayoutShift)===null||ie===void 0?void 0:ie.devicePixelRatio,Se={_dd:{document_version:ee.documentVersion,replay_stats:Ie,cls:Te?{device_pixel_ratio:Te}:void 0,configuration:{start_session_replay_recording_manually:re.startSessionReplayRecordingManually}},date:ee.startClocks.timeStamp,type:"view",view:{action:{count:ee.eventCounts.actionCount},frustration:{count:ee.eventCounts.frustrationCount},cumulative_layout_shift:(oe=ee.commonViewMetrics.cumulativeLayoutShift)===null||oe===void 0?void 0:oe.value,cumulative_layout_shift_time:toServerDuration((se=ee.commonViewMetrics.cumulativeLayoutShift)===null||se===void 0?void 0:se.time),cumulative_layout_shift_target_selector:(ae=ee.commonViewMetrics.cumulativeLayoutShift)===null||ae===void 0?void 0:ae.targetSelector,first_byte:toServerDuration((ue=ee.initialViewMetrics.navigationTimings)===null||ue===void 0?void 0:ue.firstByte),dom_complete:toServerDuration((ce=ee.initialViewMetrics.navigationTimings)===null||ce===void 0?void 0:ce.domComplete),dom_content_loaded:toServerDuration((le=ee.initialViewMetrics.navigationTimings)===null||le===void 0?void 0:le.domContentLoaded),dom_interactive:toServerDuration((de=ee.initialViewMetrics.navigationTimings)===null||de===void 0?void 0:de.domInteractive),error:{count:ee.eventCounts.errorCount},first_contentful_paint:toServerDuration(ee.initialViewMetrics.firstContentfulPaint),first_input_delay:toServerDuration((fe=ee.initialViewMetrics.firstInput)===null||fe===void 0?void 0:fe.delay),first_input_time:toServerDuration((he=ee.initialViewMetrics.firstInput)===null||he===void 0?void 0:he.time),first_input_target_selector:(pe=ee.initialViewMetrics.firstInput)===null||pe===void 0?void 0:pe.targetSelector,interaction_to_next_paint:toServerDuration((ge=ee.commonViewMetrics.interactionToNextPaint)===null||ge===void 0?void 0:ge.value),interaction_to_next_paint_time:toServerDuration((me=ee.commonViewMetrics.interactionToNextPaint)===null||me===void 0?void 0:me.time),interaction_to_next_paint_target_selector:(ye=ee.commonViewMetrics.interactionToNextPaint)===null||ye===void 0?void 0:ye.targetSelector,is_active:ee.isActive,name:ee.name,largest_contentful_paint:toServerDuration((ve=ee.initialViewMetrics.largestContentfulPaint)===null||ve===void 0?void 0:ve.value),largest_contentful_paint_target_selector:(be=ee.initialViewMetrics.largestContentfulPaint)===null||be===void 0?void 0:be.targetSelector,load_event:toServerDuration((_e=ee.initialViewMetrics.navigationTimings)===null||_e===void 0?void 0:_e.loadEvent),loading_time:discardNegativeDuration(toServerDuration(ee.commonViewMetrics.loadingTime)),loading_type:ee.loadingType,long_task:{count:ee.eventCounts.longTaskCount},performance:computeViewPerformanceData(ee.commonViewMetrics,ee.initialViewMetrics),resource:{count:ee.eventCounts.resourceCount},time_spent:toServerDuration(ee.duration)},display:ee.commonViewMetrics.scroll?{scroll:{max_depth:ee.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:ee.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:ee.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:toServerDuration(ee.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,session:{has_replay:Ie?!0:void 0,is_active:ee.sessionIsActive?void 0:!1},privacy:{replay_level:re.defaultPrivacyLevel}};return isEmptyObject$1(ee.customTimings)||(Se.view.custom_timings=mapValues(ee.customTimings,toServerDuration)),{rawRumEvent:Se,startTime:ee.startClocks.relative,duration:ee.duration,domainContext:{location:ee.location}}}function computeViewPerformanceData({cumulativeLayoutShift:ee,interactionToNextPaint:re},{firstContentfulPaint:te,firstInput:ne,largestContentfulPaint:ie}){return{cls:ee&&{score:ee.value,timestamp:toServerDuration(ee.time),target_selector:ee.targetSelector,previous_rect:ee.previousRect,current_rect:ee.currentRect},fcp:te&&{timestamp:toServerDuration(te)},fid:ne&&{duration:toServerDuration(ne.delay),timestamp:toServerDuration(ne.time),target_selector:ne.targetSelector},inp:re&&{duration:toServerDuration(re.value),timestamp:toServerDuration(re.time),target_selector:re.targetSelector},lcp:ie&&{timestamp:toServerDuration(ie.value),target_selector:ie.targetSelector,resource_url:ie.resourceUrl}}}const RUM_SESSION_KEY="rum";function startRumSessionManager(ee,re,te){const ne=startSessionManager(ee,RUM_SESSION_KEY,ie=>computeSessionState(ee,ie),te);return ne.expireObservable.subscribe(()=>{re.notify(9)}),ne.renewObservable.subscribe(()=>{re.notify(10)}),ne.sessionStateUpdateObservable.subscribe(({previousState:ie,newState:oe})=>{if(!ie.forcedReplay&&oe.forcedReplay){const se=ne.findSession();se&&(se.isReplayForced=!0)}}),{findTrackedSession:ie=>{const oe=ne.findSession(ie);if(!(!oe||!isTypeTracked(oe.trackingType)))return{id:oe.id,sessionReplay:oe.trackingType==="1"?1:oe.isReplayForced?2:0,anonymousId:oe.anonymousId}},expire:ne.expire,expireObservable:ne.expireObservable,setForcedReplay:()=>ne.updateSessionState({forcedReplay:"1"})}}function startRumSessionManagerStub(){const ee={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:bridgeSupports("records")?1:0};return{findTrackedSession:()=>ee,expire:noop$2,expireObservable:new Observable$1,setForcedReplay:noop$2}}function computeSessionState(ee,re){let te;return hasValidRumSession(re)?te=re:performDraw(ee.sessionSampleRate)?performDraw(ee.sessionReplaySampleRate)?te="1":te="2":te="0",{trackingType:te,isTracked:isTypeTracked(te)}}function hasValidRumSession(ee){return ee==="0"||ee==="1"||ee==="2"}function isTypeTracked(ee){return ee==="2"||ee==="1"}function startRumBatch(ee,re,te,ne,ie,oe,se){const ae=ee.replica,ue=startBatchWithReplica(ee,{endpoint:ee.rumEndpointBuilder,encoder:se(2)},ae&&{endpoint:ae.rumEndpointBuilder,transformMessage:ce=>combine(ce,{application:{id:ae.applicationId}}),encoder:se(3)},ne,ie,oe);return re.subscribe(13,ce=>{ce.type==="view"?ue.upsert(ce,ce.view.id):ue.add(ce)}),te.subscribe(ce=>ue.add(ce,isTelemetryReplicationAllowed(ee))),ue}function startRumEventBridge(ee){const re=getEventBridge();ee.subscribe(13,te=>{re.send("rum",te)})}const URL_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startUrlContexts(ee,re,te,ne){const ie=createValueHistory({expireDelay:URL_CONTEXT_TIME_OUT_DELAY});let oe;ee.subscribe(1,({startClocks:ue})=>{const ce=ne.href;ie.add(ae({url:ce,referrer:oe||document.referrer}),ue.relative),oe=ce}),ee.subscribe(6,({endClocks:ue})=>{ie.closeActive(ue.relative)});const se=te.subscribe(({newLocation:ue})=>{const ce=ie.find();if(ce){const le=relativeNow();ie.closeActive(le),ie.add(ae({url:ue.href,referrer:ce.referrer}),le)}});function ae({url:ue,referrer:ce}){return{url:ue,referrer:ce}}return re.register(0,({startTime:ue,eventType:ce})=>{const{url:le,referrer:de}=ie.find(ue);return{type:ce,view:{url:le,referrer:de}}}),{findUrl:ue=>ie.find(ue),getAllEntries:()=>ie.getAllEntries(),getDeletedEntries:()=>ie.getDeletedEntries(),stop:()=>{se.unsubscribe(),ie.stop()}}}function createLocationChangeObservable(ee,re){let te=shallowClone(re);return new Observable$1(ne=>{const{stop:ie}=trackHistory(ee,se),{stop:oe}=trackHash(ee,se);function se(){if(te.href===re.href)return;const ae=shallowClone(re);ne.notify({newLocation:ae,oldLocation:te}),te=ae}return()=>{ie(),oe()}})}function trackHistory(ee,re){const{stop:te}=instrumentMethod(getHistoryInstrumentationTarget("pushState"),"pushState",({onPostCall:oe})=>{oe(re)}),{stop:ne}=instrumentMethod(getHistoryInstrumentationTarget("replaceState"),"replaceState",({onPostCall:oe})=>{oe(re)}),{stop:ie}=addEventListener$1(ee,window,"popstate",re);return{stop:()=>{te(),ne(),ie()}}}function trackHash(ee,re){return addEventListener$1(ee,window,"hashchange",re)}function getHistoryInstrumentationTarget(ee){return Object.prototype.hasOwnProperty.call(history,ee)?history:History.prototype}const FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startFeatureFlagContexts(ee,re,te){const ne=createValueHistory({expireDelay:FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY});return ee.subscribe(1,({startClocks:ie})=>{ne.add({},ie.relative)}),ee.subscribe(6,({endClocks:ie})=>{ne.closeActive(ie.relative)}),re.register(0,({startTime:ie,eventType:oe})=>{if(!te.trackFeatureFlagsForEvents.concat(["view","error"]).includes(oe))return;const ae=ne.find(ie);if(!(!ae||isEmptyObject$1(ae)))return{type:oe,feature_flags:ae}}),{addFeatureFlagEvaluation:(ie,oe)=>{const se=ne.find();se&&(se[ie]=oe)}}}const MEASURES_PERIOD_DURATION=10*ONE_SECOND;let currentPeriodMeasures,batchHasRumEvent;function startCustomerDataTelemetry(ee,re,te,ne){re.enabled&&performDraw(ee.customerDataTelemetrySampleRate)&&(initCurrentPeriodMeasures(),batchHasRumEvent=!1,te.subscribe(13,()=>{batchHasRumEvent=!0}),ne.subscribe(({bytesCount:oe,messagesCount:se})=>{batchHasRumEvent&&(currentPeriodMeasures.batchCount+=1,updateMeasure(currentPeriodMeasures.batchBytesCount,oe),updateMeasure(currentPeriodMeasures.batchMessagesCount,se))}),setInterval$1(sendCurrentPeriodMeasures,MEASURES_PERIOD_DURATION))}function sendCurrentPeriodMeasures(){currentPeriodMeasures.batchCount!==0&&(addTelemetryDebug("Customer data measures",currentPeriodMeasures),initCurrentPeriodMeasures())}function createMeasure(){return{min:1/0,max:0,sum:0}}function updateMeasure(ee,re){ee.sum+=re,ee.min=Math.min(ee.min,re),ee.max=Math.max(ee.max,re)}function initCurrentPeriodMeasures(){currentPeriodMeasures={batchCount:0,batchBytesCount:createMeasure(),batchMessagesCount:createMeasure()}}const MAX_PAGE_STATE_ENTRIES=4e3,MAX_PAGE_STATE_ENTRIES_SELECTABLE=500,PAGE_STATE_CONTEXT_TIME_OUT_DELAY=SESSION_TIME_OUT_DELAY;function startPageStateHistory(ee,re,te=MAX_PAGE_STATE_ENTRIES_SELECTABLE){const ne=createValueHistory({expireDelay:PAGE_STATE_CONTEXT_TIME_OUT_DELAY,maxEntries:MAX_PAGE_STATE_ENTRIES});let ie;se(getPageState(),relativeNow());const{stop:oe}=addEventListeners(re,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],ue=>{se(computePageState(ue),ue.timeStamp)},{capture:!0});function se(ue,ce=relativeNow()){ue!==ie&&(ie=ue,ne.closeActive(ce),ne.add({state:ie,startTime:ce},ce))}function ae(ue,ce,le){return ne.findAll(ce,le).some(de=>de.state===ue)}return ee.register(0,({startTime:ue,duration:ce=0,eventType:le})=>{if(le==="view"){const de=ne.findAll(ue,ce);return{type:le,_dd:{page_states:processPageStates(de,ue,te)}}}if(le==="action"||le==="error")return{type:le,view:{in_foreground:ae("active",ue,0)}}}),{wasInPageStateDuringPeriod:ae,addPageState:se,stop:()=>{oe(),ne.stop()}}}function processPageStates(ee,re,te){if(ee.length!==0)return ee.slice(-te).reverse().map(({state:ne,startTime:ie})=>({state:ne,start:toServerDuration(elapsed(re,ie))}))}function computePageState(ee){return ee.type==="freeze"?"frozen":ee.type==="pagehide"?ee.persisted?"frozen":"terminated":getPageState()}function getPageState(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function startDisplayContext(ee){let re;const te=requestAnimationFrame(monitor(()=>{re=getViewportDimension()})),ne=initViewportObservable(ee).subscribe(ie=>{re=ie}).unsubscribe;return{get:()=>re?{viewport:re}:void 0,stop:()=>{ne(),te&&cancelAnimationFrame(te)}}}const WATCH_COOKIE_INTERVAL_DELAY=ONE_SECOND;function createCookieObservable(ee){return new Observable$1(re=>watchCookieStrategy(ee,te=>re.notify(te)))}function watchCookieStrategy(ee,re){const te=findCommaSeparatedValue(document.cookie,ee),ne=setInterval$1(()=>{const ie=findCommaSeparatedValue(document.cookie,ee);ie!==te&&re(ie)},WATCH_COOKIE_INTERVAL_DELAY);return()=>clearInterval$1(ne)}const CI_VISIBILITY_TEST_ID_COOKIE_NAME="datadog-ci-visibility-test-execution-id";function startCiVisibilityContext(ee,re=createCookieObservable(CI_VISIBILITY_TEST_ID_COOKIE_NAME)){var te;let ne=getInitCookie(CI_VISIBILITY_TEST_ID_COOKIE_NAME)||((te=window.Cypress)===null||te===void 0?void 0:te.env("traceId"));const ie=re.subscribe(oe=>{ne=oe});return ee.register(0,({eventType:oe})=>{if(typeof ne=="string")return{type:oe,session:{type:"ci_test"},ci_test:{test_execution_id:ne}}}),{stop:()=>{ie.unsubscribe()}}}function startLongAnimationFrameCollection(ee,re){const te=createPerformanceObservable(re,{type:RumPerformanceEntryType.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(ne=>{for(const ie of ne){const oe=relativeToClocks(ie.startTime),se={date:oe.timeStamp,long_task:{id:generateUUID(),entry_type:"long-animation-frame",duration:toServerDuration(ie.duration),blocking_duration:toServerDuration(ie.blockingDuration),first_ui_event_timestamp:toServerDuration(ie.firstUIEventTimestamp),render_start:toServerDuration(ie.renderStart),style_and_layout_start:toServerDuration(ie.styleAndLayoutStart),start_time:toServerDuration(ie.startTime),scripts:ie.scripts.map(ae=>({duration:toServerDuration(ae.duration),pause_duration:toServerDuration(ae.pauseDuration),forced_style_and_layout_duration:toServerDuration(ae.forcedStyleAndLayoutDuration),start_time:toServerDuration(ae.startTime),execution_start:toServerDuration(ae.executionStart),source_url:ae.sourceURL,source_function_name:ae.sourceFunctionName,source_char_position:ae.sourceCharPosition,invoker:ae.invoker,invoker_type:ae.invokerType,window_attribution:ae.windowAttribution}))},type:"long_task",_dd:{discarded:!1}};ee.notify(12,{rawRumEvent:se,startTime:oe.relative,duration:ie.duration,domainContext:{performanceEntry:ie}})}});return{stop:()=>te.unsubscribe()}}function startLongTaskCollection(ee,re){const te=createPerformanceObservable(re,{type:RumPerformanceEntryType.LONG_TASK,buffered:!0}).subscribe(ne=>{for(const ie of ne){if(ie.entryType!==RumPerformanceEntryType.LONG_TASK||!re.trackLongTasks)break;const oe=relativeToClocks(ie.startTime),se={date:oe.timeStamp,long_task:{id:generateUUID(),entry_type:"long-task",duration:toServerDuration(ie.duration)},type:"long_task",_dd:{discarded:!1}};ee.notify(12,{rawRumEvent:se,startTime:oe.relative,duration:ie.duration,domainContext:{performanceEntry:ie}})}});return{stop(){te.unsubscribe()}}}function createHooks(){const ee={};return{register(re,te){return ee[re]||(ee[re]=[]),ee[re].push(te),{unregister:()=>{ee[re]=ee[re].filter(ne=>ne!==te)}}},triggerHook(re,te){const ie=(ee[re]||[]).map(oe=>oe(te));return combine(...ie)}}}function startSyntheticsContext(ee){ee.register(0,({eventType:re})=>{const te=getSyntheticsTestId(),ne=getSyntheticsResultId();if(!(!te||!ne))return{type:re,session:{type:"synthetics"},synthetics:{test_id:te,result_id:ne,injected:willSyntheticsInjectRum()}}})}function limitModification(ee,re,te){const ne=deepClone(ee),ie=te(ne);return objectEntries(re).forEach(([oe,se])=>setValueAtPath(ee,ne,oe.split(/\.|(?=\[\])/),se)),ie}function setValueAtPath(ee,re,te,ne){const[ie,...oe]=te;if(ie==="[]"){Array.isArray(ee)&&Array.isArray(re)&&ee.forEach((se,ae)=>setValueAtPath(se,re[ae],oe,ne));return}if(!(!isValidObject$1(ee)||!isValidObject$1(re))){if(oe.length>0)return setValueAtPath(ee[ie],re[ie],oe,ne);setNestedValue(ee,ie,re[ie],ne)}}function setNestedValue(ee,re,te,ne){const ie=getType(te);ie===ne?ee[re]=sanitize(te):ne==="object"&&(ie==="undefined"||ie==="null")&&(ee[re]={})}function isValidObject$1(ee){return getType(ee)==="object"}const VIEW_MODIFIABLE_FIELD_PATHS={"view.name":"string","view.url":"string","view.referrer":"string"},USER_CUSTOMIZABLE_FIELD_PATHS={context:"object"},ROOT_MODIFIABLE_FIELD_PATHS={service:"string",version:"string"};let modifiableFieldPathsByEvent;function startRumAssembly(ee,re,te,ne,ie,oe,se,ae,ue){modifiableFieldPathsByEvent={view:{"view.performance.lcp.resource_url":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS},error:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},resource:{"resource.url":"string",...isExperimentalFeatureEnabled(ExperimentalFeature.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},action:{"action.target.name":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS,...ROOT_MODIFIABLE_FIELD_PATHS},long_task:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS},vital:{...USER_CUSTOMIZABLE_FIELD_PATHS,...VIEW_MODIFIABLE_FIELD_PATHS}};const ce={error:createEventRateLimiter("error",ee.eventRateLimiterThreshold,ue),action:createEventRateLimiter("action",ee.eventRateLimiterThreshold,ue),vital:createEventRateLimiter("vital",ee.eventRateLimiterThreshold,ue)};re.subscribe(12,({startTime:le,duration:de,rawRumEvent:fe,domainContext:he,customerContext:pe})=>{const ge=ie.findView(le),me=oe.findUrl(le),ye=ne.findTrackedSession(le);if(ye&&ge&&!me&&isExperimentalFeatureEnabled(ExperimentalFeature.MISSING_URL_CONTEXT_TELEMETRY)&&addTelemetryDebug("Missing URL entry",{debug:{eventType:fe.type,startTime:le,urlEntries:oe.getAllEntries(),urlDeletedEntries:oe.getDeletedEntries(),viewEntries:ie.getAllEntries(),viewDeletedEntries:ie.getDeletedEntries()}}),ye&&ge&&me){const ve=ae(),be={_dd:{format_version:2,drift:currentDrift(),configuration:{session_sample_rate:round(ee.sessionSampleRate,3),session_replay_sample_rate:round(ee.sessionReplaySampleRate,3)},browser_sdk_version:canUseEventBridge()?"6.6.3":void 0},application:{id:ee.applicationId},date:timeStampNow(),source:"browser",session:{id:ye.id,type:"user"},display:se.get(),connectivity:getConnectivity(),context:ve.context},_e=combine(be,te.triggerHook(0,{eventType:fe.type,startTime:le,duration:de}),{context:pe},fe);"has_replay"in _e.session||(_e.session.has_replay=ve.hasReplay),_e.type==="view"&&(_e.session.sampled_for_replay=ye.sessionReplay===1),ye.anonymousId&&!ve.user.anonymous_id&&ee.trackAnonymousUser&&(ve.user.anonymous_id=ye.anonymousId),isEmptyObject$1(ve.user)||(_e.usr=ve.user),!isEmptyObject$1(ve.account)&&ve.account.id&&(_e.account=ve.account),shouldSend(_e,ee.beforeSend,he,ce)&&(isEmptyObject$1(_e.context)&&delete _e.context,re.notify(13,_e))}})}function shouldSend(ee,re,te,ne){var ie;if(re){const se=limitModification(ee,modifiableFieldPathsByEvent[ee.type],ae=>re(ae,te));if(se===!1&&ee.type!=="view")return!1;se===!1&&display.warn("Can't dismiss view events using beforeSend!")}return!((ie=ne[ee.type])===null||ie===void 0?void 0:ie.isLimitReached())}function buildCommonContext(ee,re,te,ne){return{context:ee.getContext(),user:re.getContext(),account:te.getContext(),hasReplay:ne.isRecording()?!0:void 0}}function startRum(ee,re,te,ne,ie,oe,se){const ae=[],ue=new LifeCycle,ce=createHooks();ue.subscribe(13,$e=>sendToExtension("rum",$e));const le=startRumTelemetry(ee);le.setContextProvider(()=>{var $e,ke;return{application:{id:ee.applicationId},session:{id:($e=pe.findTrackedSession())===null||$e===void 0?void 0:$e.id},view:{id:(ke=ve.findView())===null||ke===void 0?void 0:ke.id},action:{id:Re.findActionId()}}});const de=$e=>{ue.notify(14,{error:$e}),addTelemetryDebug("Error reported to customer",{"error.message":$e.message})},fe=createPageMayExitObservable(ee),he=fe.subscribe($e=>{ue.notify(11,$e)});ae.push(()=>he.unsubscribe());const pe=canUseEventBridge()?startRumSessionManagerStub():startRumSessionManager(ee,ue,oe);if(canUseEventBridge())startRumEventBridge(ue);else{const $e=startRumBatch(ee,ue,le.observable,de,fe,pe.expireObservable,ie);ae.push(()=>$e.stop()),startCustomerDataTelemetry(ee,le,ue,$e.flushObservable)}const ge=createDOMMutationObservable(),me=createLocationChangeObservable(ee,location),ye=startPageStateHistory(ce,ee),ve=startViewHistory(ue),be=startUrlContexts(ue,ce,me,location),_e=startFeatureFlagContexts(ue,ce,ee),{observable:Ie,stop:Te}=createWindowOpenObservable();ae.push(Te);const Se=startGlobalContext(ee),Oe=startUserContext(ee),Ce=startAccountContext(ee),we=()=>buildCommonContext(Se,Oe,Ce,re),{actionContexts:Re,addAction:Ne,stop:Ue}=startRumEventCollection(ue,ce,ee,pe,ye,ge,Ie,be,ve,we,de);ae.push(Ue),drainPreStartTelemetry();const{addTiming:Fe,startView:Ve,setViewName:He,setViewContext:ur,setViewContextProperty:Ge,getViewContext:hr,stop:fr}=startViewCollection(ue,ce,ee,location,ge,Ie,me,re,ve,ne);ae.push(fr);const{stop:dr}=startResourceCollection(ue,ee,ye);if(ae.push(dr),ee.trackLongTasks)if(supportPerformanceTimingEvent(RumPerformanceEntryType.LONG_ANIMATION_FRAME)){const{stop:$e}=startLongAnimationFrameCollection(ue,ee);ae.push($e)}else startLongTaskCollection(ue,ee);const{addError:Qe}=startErrorCollection(ue,ee);startRequestCollection(ue,ee,pe,we);const Bt=startVitalCollection(ue,ye,se),Ir=startInternalContext(ee.applicationId,pe,ve,Re,be);return ae.push(()=>te.stop()),{addAction:Ne,addError:Qe,addTiming:Fe,addFeatureFlagEvaluation:_e.addFeatureFlagEvaluation,startView:Ve,setViewContext:ur,setViewContextProperty:Ge,getViewContext:hr,setViewName:He,lifeCycle:ue,viewHistory:ve,session:pe,stopSession:()=>pe.expire(),getInternalContext:Ir.get,startDurationVital:Bt.startDurationVital,stopDurationVital:Bt.stopDurationVital,addDurationVital:Bt.addDurationVital,globalContext:Se,userContext:Oe,accountContext:Ce,stop:()=>{ae.forEach($e=>$e())}}}function startRumTelemetry(ee){const re=startTelemetry("browser-rum-sdk",ee);if(canUseEventBridge()){const te=getEventBridge();re.observable.subscribe(ne=>te.send("internal_telemetry",ne))}return re}function startRumEventCollection(ee,re,te,ne,ie,oe,se,ae,ue,ce,le){const de=startActionCollection(ee,re,oe,se,te),fe=startDisplayContext(te),he=startCiVisibilityContext(re);return startSyntheticsContext(re),startRumAssembly(te,ee,re,ne,ue,ae,fe,ce,le),{pageStateHistory:ie,addAction:de.addAction,actionContexts:de.actionContexts,stop:()=>{de.stop(),he.stop(),fe.stop(),ue.stop(),ie.stop(),ae.stop()}}}function getSessionReplayUrl(ee,{session:re,viewContext:te,errorType:ne}){const ie=re?re.id:"no-session-id",oe=[];ne!==void 0&&oe.push(`error-type=${ne}`),te&&(oe.push(`seed=${te.id}`),oe.push(`from=${te.startClocks.timeStamp}`));const se=getDatadogSiteUrl(ee),ae=`/rum/replay/sessions/${ie}`;return`${se}${ae}?${oe.join("&")}`}function getDatadogSiteUrl(ee){const re=ee.site,te=ee.subdomain||getSiteDefaultSubdomain(ee);return`https://${te?`${te}.`:""}${re}`}function getSiteDefaultSubdomain(ee){switch(ee.site){case INTAKE_SITE_US1:case INTAKE_SITE_EU1:return"app";case INTAKE_SITE_STAGING:return"dd";default:return}}const MAX_STATS_HISTORY=1e3;let statsPerView;function getSegmentsCount(ee){return getOrCreateReplayStats(ee).segments_count}function addSegment(ee){getOrCreateReplayStats(ee).segments_count+=1}function addRecord(ee){getOrCreateReplayStats(ee).records_count+=1}function addWroteData(ee,re){getOrCreateReplayStats(ee).segments_total_raw_size+=re}function getReplayStats(ee){return statsPerView==null?void 0:statsPerView.get(ee)}function getOrCreateReplayStats(ee){statsPerView||(statsPerView=new Map);let re;return statsPerView.has(ee)?re=statsPerView.get(ee):(re={records_count:0,segments_count:0,segments_total_raw_size:0},statsPerView.set(ee,re),statsPerView.size>MAX_STATS_HISTORY&&deleteOldestStats()),re}function deleteOldestStats(){if(!statsPerView)return;const ee=statsPerView.keys().next().value;ee&&statsPerView.delete(ee)}function createDeflateEncoder(ee,re,te){let ne=0,ie=[],oe,se=0;const ae=[],{stop:ue}=addEventListener$1(ee,re,"message",({data:de})=>{if(de.type!=="wrote"||de.streamId!==te)return;ne+=de.additionalBytesCount,ie.push(de.result),oe=de.trailer;const fe=ae.shift();fe&&fe.id===de.id?fe.writeCallback?fe.writeCallback(de.result.byteLength):fe.finishCallback&&fe.finishCallback():(ue(),addTelemetryDebug("Worker responses received out of order."))});function ce(){const de=ie.length===0?new Uint8Array(0):concatBuffers(ie.concat(oe)),fe={rawBytesCount:ne,output:de,outputBytesCount:de.byteLength,encoding:"deflate"};return ne=0,ie=[],fe}function le(){se>0&&(re.postMessage({action:"reset",streamId:te}),se=0)}return{isAsync:!0,get isEmpty(){return se===0},write(de,fe){re.postMessage({action:"write",id:se,data:de,streamId:te}),ae.push({id:se,writeCallback:fe,data:de}),se+=1},finish(de){le(),ae.length?(ae.forEach(fe=>{delete fe.writeCallback}),ae[ae.length-1].finishCallback=()=>de(ce())):de(ce())},finishSync(){le();const de=ae.map(fe=>(delete fe.writeCallback,delete fe.finishCallback,fe.data)).join("");return{...ce(),pendingData:de}},estimateEncodedBytesCount(de){return de.length/8},stop(){ue()}}}function reportScriptLoadingError({configuredUrl:ee,error:re,source:te,scriptType:ne}){if(display.error(`${te} failed to start: an error occurred while initializing the ${ne}:`,re),re instanceof Event||re instanceof Error&&isMessageCspRelated(re.message)){let ie;ee?ie=`Please make sure the ${ne} URL ${ee} is correct and CSP is correctly configured.`:ie="Please make sure CSP is correctly configured.",display.error(`${ie} See documentation at ${DOCS_ORIGIN}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else ne==="worker"&&addTelemetryError(re)}function isMessageCspRelated(ee){return ee.includes("Content Security Policy")||ee.includes("requires 'TrustedScriptURL'")}const INITIALIZATION_TIME_OUT_DELAY=30*ONE_SECOND;function createDeflateWorker(ee){return new Worker(ee.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){const e=t.reduce(((t,e)=>t+e.length),0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},et=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-J)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=L(s.adler,h,o,l):2===s.state.wrap&&(s.adler=T(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},at=function(t,e){for(var a,n;;){if(t.lookahead<J){if(et(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=tt(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},nt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(et(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=tt(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var it=[new rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(et(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)})),new rt(4,4,8,4,at),new rt(4,5,16,8,at),new rt(4,6,32,32,at),new rt(4,4,16,16,nt),new rt(8,16,32,32,nt),new rt(8,16,128,128,nt),new rt(8,32,128,256,nt),new rt(32,128,258,1024,nt),new rt(32,258,258,4096,nt)];function st(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var ht=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=it[e.level].max_lazy,e.good_match=it[e.level].good_length,e.nice_match=it[e.level].nice_length,e.max_chain_length=it[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},lt=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(et(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(et(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):it[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},_t=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},ot=new Uint8Array(256),dt=0;dt<256;dt++)ot[dt]=dt>=252?6:dt>=248?5:dt>=240?4:dt>=224?3:dt>=192?2:1;ot[254]=ot[254]=1;var ut=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ft=Object.prototype.toString;function ct(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ut,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new st;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,ht(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ft.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,et(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,et(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function pt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function gt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}ct.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ft.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=lt(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=_t(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},ct.prototype.onData=function(t){this.chunks.push(t)},ct.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",(n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.6.3"};case"write":{let n=e.get(a.streamId);n||(n=new ct,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:gt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){pt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}}))}catch(t){pt(e,t)}}()})();'])))}let state={status:0};function startDeflateWorker(ee,re,te,ne=createDeflateWorker){switch(state.status===0&&doStartDeflateWorker(ee,re,ne),state.status){case 1:return state.initializationFailureCallbacks.push(te),state.worker;case 3:return state.worker}}function getDeflateWorkerStatus(){return state.status}function doStartDeflateWorker(ee,re,te=createDeflateWorker){try{const ne=te(ee),{stop:ie}=addEventListener$1(ee,ne,"error",ae=>{onError(ee,re,ae)}),{stop:oe}=addEventListener$1(ee,ne,"message",({data:ae})=>{ae.type==="errored"?onError(ee,re,ae.error,ae.streamId):ae.type==="initialized"&&onInitialized(ae.version)});ne.postMessage({action:"init"}),setTimeout$1(()=>onTimeout(re),INITIALIZATION_TIME_OUT_DELAY),state={status:1,worker:ne,stop:()=>{ie(),oe()},initializationFailureCallbacks:[]}}catch(ne){onError(ee,re,ne)}}function onTimeout(ee){state.status===1&&(display.error(`${ee} failed to start: a timeout occurred while initializing the Worker`),state.initializationFailureCallbacks.forEach(re=>re()),state={status:2})}function onInitialized(ee){state.status===1&&(state={status:3,worker:state.worker,stop:state.stop,version:ee})}function onError(ee,re,te,ne){state.status===1||state.status===0?(reportScriptLoadingError({configuredUrl:ee.workerUrl,error:te,source:re,scriptType:"worker"}),state.status===1&&state.initializationFailureCallbacks.forEach(ie=>ie()),state={status:2}):addTelemetryError(te,{worker_version:state.status===3&&state.version,stream_id:ne})}function isBrowserSupported(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function getSessionReplayLink(ee,re,te,ne){const ie=re.findTrackedSession(),oe=getErrorType(ie,ne),se=te.findView();return getSessionReplayUrl(ee,{viewContext:se,errorType:oe,session:ie})}function getErrorType(ee,re){if(!isBrowserSupported())return"browser-not-supported";if(!ee)return"rum-not-tracked";if(ee.sessionReplay===0)return"incorrect-session-plan";if(!re)return"replay-not-started"}function createPostStartStrategy(ee,re,te,ne,ie,oe){let se=0,ae;re.subscribe(9,()=>{(se===2||se===3)&&(le(),se=1)}),re.subscribe(10,()=>{se===1&&ce()});const ue=async()=>{const[de]=await Promise.all([ie(),asyncRunOnReadyState(ee,"interactive")]);if(se!==2)return;const fe=oe();if(!fe||!de){se=0;return}({stop:ae}=de(re,ee,te,ne,fe)),se=3};function ce(de){const fe=te.findTrackedSession();if(canStartRecording(fe,de)){se=1;return}isRecordingInProgress(se)||(se=2,ue().catch(monitorError),shouldForceReplay(fe,de)&&te.setForcedReplay())}function le(){se===3&&(ae==null||ae()),se=0}return{start:ce,stop:le,getSessionReplayLink(){return getSessionReplayLink(ee,te,ne,se!==0)},isRecording:()=>se===3}}function canStartRecording(ee,re){return!ee||ee.sessionReplay===0&&(!re||!re.force)}function isRecordingInProgress(ee){return ee===2||ee===3}function shouldForceReplay(ee,re){return re&&re.force&&ee.sessionReplay===0}function createPreStartStrategy(){let ee=0;return{strategy:{start(){ee=1},stop(){ee=2},isRecording:()=>!1,getSessionReplayLink:noop$2},shouldStartImmediately(re){return ee===1||ee===0&&!re.startSessionReplayRecordingManually}}}function makeRecorderApi(ee,re){if(canUseEventBridge()&&!bridgeSupports("records")||!isBrowserSupported())return{start:noop$2,stop:noop$2,getReplayStats:()=>{},onRumStart:noop$2,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:te,shouldStartImmediately:ne}=createPreStartStrategy();return{start:oe=>te.start(oe),stop:()=>te.stop(),getSessionReplayLink:()=>te.getSessionReplayLink(),onRumStart:ie,isRecording:()=>getDeflateWorkerStatus()===3&&te.isRecording(),getReplayStats:oe=>getDeflateWorkerStatus()===3?getReplayStats(oe):void 0};function ie(oe,se,ae,ue,ce){let le;function de(){return le||(ce??(ce=startDeflateWorker(se,"Datadog Session Replay",()=>{te.stop()},re)),ce&&(le=createDeflateEncoder(se,ce,1))),le}te=createPostStartStrategy(se,oe,ae,ue,ee,de),ne(se)&&te.start()}}async function lazyLoadRecorder(ee=importRecorder){try{return await ee()}catch(re){reportScriptLoadingError({error:re,source:"Recorder",scriptType:"module"})}}async function importRecorder(){return(await Promise.resolve().then(()=>startRecording$1)).startRecording}function isProfilingSupported(){return getGlobalObject().Profiler!==void 0}async function lazyLoadProfiler(ee=importProfiler){try{return await ee()}catch(re){reportScriptLoadingError({error:re,source:"Profiler",scriptType:"module"})}}async function importProfiler(){return(await Promise.resolve().then(()=>profiler)).createRumProfiler}function makeProfilerApi(){let ee;function re(te,ne,ie,oe){!isProfilingSupported()||!performDraw(ne.profilingSampleRate)||lazyLoadProfiler().then(se=>{if(!se){addTelemetryDebug("[DD_RUM] Failed to lazy load the RUM Profiler");return}ee=se(ne,te,ie),ee.start(oe.findView())}).catch(monitorError)}return{onRumStart:re,stop:()=>{ee==null||ee.stop().catch(monitorError)}}}const recorderApi=makeRecorderApi(lazyLoadRecorder),profilerApi=makeProfilerApi(),datadogRum=makeRumPublicApi(startRum,recorderApi,profilerApi,{startDeflateWorker,createDeflateEncoder});defineGlobal(getGlobalObject(),"DD_RUM",datadogRum);const xi=class xi{init(){if(xi.isInitialized){console.info("Tracker [DD]: already initialized");return}datadogRum.init({applicationId:"3ea6bf90-69cc-42fe-9e69-d461f783221d",clientToken:"pub51a171e3f587fb85f6d3f0ed2bf8f531",site:"datadoghq.com",service:"astropay-payments-library",env:AstroPayConfig.getRuntimeConfig().MODE,version:AstroPayConfig.getRuntimeConfig().VERSION,sessionSampleRate:50,sessionReplaySampleRate:100,defaultPrivacyLevel:"mask-user-input",trackViewsManually:!0,trackResources:!1,trackUserInteractions:!1,beforeSend:re=>this.filterEvents(re)}),datadogRum.startView({name:"ap_cl_view_mounted"}),datadogRum.startSessionReplayRecording(),xi.isInitialized=!0,console.info("Tracker [DD]: initialized")}track(re,te){datadogRum==null||datadogRum.addAction(re,te||{})}trackError(re,te){datadogRum==null||datadogRum.addError(re,{context:te})}destroy(){console.info("Tracker [DD]: destroying"),typeof datadogRum.stopSessionReplayRecording=="function"&&datadogRum.stopSessionReplayRecording(),datadogRum.addAction("ap_cl_view_unmounted",{reason:"component_destroyed"}),xi.isInitialized=!1}filterEvents(re){var te,ne,ie;return!!(re.type==="view"&&((te=re.view.name)!=null&&te.startsWith("ap_cl_"))||re.type==="action"&&typeof((ne=re.action.target)==null?void 0:ne.name)=="string"&&re.action.target.name.startsWith("ap_cl_")||re.type==="error"&&((ie=re.error)==null?void 0:ie.source)==="custom")}};xe(xi,"isInitialized",!1);let DatadogTracker=xi;class DataDogTracker{static init(re){if(!re){console.info("Tracking disabled");return}this.initialized||(this.trackers=[new DatadogTracker],this.trackers.forEach(te=>te.init()),this.initialized=!0)}static isReady(){return this.initialized&&this.trackers.length>0}static trackEvent(re,te){this.isReady()&&this.trackers.forEach(ne=>ne.track(re,te))}static trackError(re,te){this.isReady()&&this.trackers.forEach(ne=>ne.trackError(re,te))}static destroy(){this.trackers.forEach(re=>re.destroy()),this.trackers=[],this.initialized=!1}}xe(DataDogTracker,"initialized",!1),xe(DataDogTracker,"trackers",[]);const getResultScreenStyles=()=>css`
|
|
232
232
|
display: flex;
|
|
233
233
|
flex-direction: column;
|
|
234
234
|
align-items: center;
|
|
@@ -613,7 +613,7 @@ Minimum version required to store current data is: `+Re+`.
|
|
|
613
613
|
.select-icon {
|
|
614
614
|
margin-left: 8px;
|
|
615
615
|
}
|
|
616
|
-
`};class InputSelect extends Component{constructor({name:te,label:ne,options:ie,helperText:oe,placeholder:se=AstroPayI18n.translate("select"),emptyMessage:ae=AstroPayI18n.translate("select_item"),error:ue=!1,disabled:ce=!1,maxWidth:le="100%",showValue:de=!1,validateOn:fe,onChange:he}){super({tag:"div",styles:ge=>getSelectStyles(ge,{error:ue,disabled:ce,maxWidth:le})});xe(this,"selectContainer");xe(this,"inputElement");xe(this,"dropdownIcon");xe(this,"optionsList");xe(this,"helperTextElement",null);xe(this,"labelElement",null);xe(this,"isOpen",!1);xe(this,"filteredOptions",[]);xe(this,"selectedValue",null);xe(this,"highlightedIndex",-1);xe(this,"currentErrorState");xe(this,"currentDisabledState");xe(this,"currentHelperText");xe(this,"name");xe(this,"label");xe(this,"options");xe(this,"emptyMessage");xe(this,"showValue");xe(this,"validateOn");xe(this,"maxWidth");xe(this,"onChange");this.name=te,this.label=ne,this.options=ie,this.emptyMessage=ae,this.showValue=de,this.currentErrorState=ue,this.currentDisabledState=ce,this.currentHelperText=oe,this.validateOn=fe,this.maxWidth=le,this.onChange=he,ne&&this.renderLabel(),this.selectContainer=document.createElement("div"),this.selectContainer.classList.add("select-input-container"),this.element.append(this.selectContainer),this.inputElement=document.createElement("input"),this.inputElement.classList.add("select-input-field"),this.inputElement.name=te,this.inputElement.id=te,this.inputElement.autocomplete="off",this.inputElement.disabled=ce,se&&(this.inputElement.placeholder=se),this.selectContainer.append(this.inputElement),this.dropdownIcon=document.createElement("span"),this.dropdownIcon.classList.add("dropdown-icon-wrapper");const pe=new Icon({name:"arrow_down_line",size:24}).element;this.dropdownIcon.appendChild(pe),this.selectContainer.appendChild(this.dropdownIcon),this.optionsList=document.createElement("ul"),this.optionsList.classList.add("select-options-list"),this.selectContainer.append(this.optionsList),this.renderOptions(ie),this.selectContainer.addEventListener("click",ge=>{this.optionsList.contains(ge.target)||(this.toggleDropdown(!0),this.inputElement.setSelectionRange(0,this.inputElement.value.length),this.inputElement.focus())}),this.inputElement.addEventListener("input",ge=>{var me;this.handleInput(ge),(me=this.onChange)==null||me.call(this)}),this.selectContainer.addEventListener("change",this.handleInputChange.bind(this)),this.inputElement.addEventListener("keydown",ge=>this.handleKeyDown(ge)),oe&&this.renderHelperText(oe),document.addEventListener("click",this.handleClickOutside.bind(this))}handleInputChange(){var te;this!=null&&this.validateOn&&this.validate(),(te=this.onChange)==null||te.call(this)}renderLabel(){if(!this.label)return;const te=inputStyle(this.currentErrorState,this.currentDisabledState);this.labelElement?(this.labelElement.textContent=this.label,this.labelElement.style.color=te.label.color):(this.labelElement=new Typography({text:this.label,size:te.label.size,weight:te.label.weight,color:te.label.color,variant:"label"}).element,this.element.append(this.labelElement)),this.labelElement.htmlFor=this.name}renderHelperText(te){if(!te){this.helperTextElement&&(this.helperTextElement.remove(),this.helperTextElement=null);return}const ne=inputStyle(this.currentErrorState,this.currentDisabledState);this.helperTextElement?(this.helperTextElement.textContent=te,this.helperTextElement.style.color=ne.helperText.color):(this.helperTextElement=new Typography({text:te,size:ne.helperText.size,weight:ne.helperText.weight,color:ne.helperText.color}).element,this.element.append(this.helperTextElement))}updateComponentStyles(){const te=ne=>getSelectStyles(ne,{error:this.currentErrorState,disabled:this.currentDisabledState,maxWidth:this.maxWidth});this.element.className=te(ThemeManager.getStyles())}renderOptions(te){if(this.optionsList.innerHTML="",this.filteredOptions=te,te.length>0)te.forEach(ne=>{const ie=document.createElement("li");if(ie.classList.add("select-option"),ne.icon){const se=new Icon({name:ne.icon,size:20}).element;ie.appendChild(se)}const oe=new Typography({text:`${ne.name} ${this.showValue?ne.value:""}`,size:16,lineHeight:24,weight:400}).element;ie.appendChild(oe),ie.dataset.value=String(ne.value),ie.addEventListener("click",()=>this.handleOptionClick(ne)),this.optionsList.append(ie)});else{const ne=document.createElement("div");ne.classList.add("empty-option");const ie=new Typography({text:this.emptyMessage??""}).element;ne.append(ie),this.optionsList.append(ne)}}handleInput(te){const ne=te.target.value.toLowerCase();if(ne===""){const oe=this.selectContainer.querySelector(".select-icon");oe&&oe.remove(),this.selectedValue=null}const ie=this.options.filter(oe=>{const se=oe.name.toLowerCase().includes(ne),ae=this.showValue?String(oe.value).toLowerCase().includes(ne):!1;return se||ae});this.renderOptions(ie),this.toggleDropdown(!0)}toggleDropdown(te){this.isOpen=te,this.optionsList.style.display=this.isOpen?"block":"none",this.dropdownIcon.style.transform=this.isOpen?"rotate(-180deg)":"rotate(0deg)"}handleOptionClick({name:te,value:ne,icon:ie}){const oe=this.selectContainer.querySelector(".select-icon");if(oe&&oe.remove(),ie){const ae=new Icon({name:ie,size:24}).element;ae.classList.add("select-icon"),this.selectContainer.insertBefore(ae,this.inputElement)}this.inputElement.value=this.showValue?String(ne):te,this.selectedValue=ne,this.renderOptions(this.options),this.toggleDropdown(!1),this.highlightedIndex=-1;const se=new Event("change",{bubbles:!0});this.inputElement.dispatchEvent(se)}handleClickOutside(te){this.selectContainer.contains(te.target)||this.toggleDropdown(!1)}handleKeyDown(te){const{key:ne}=te;if(ne==="Escape"){this.toggleDropdown(!1);return}if(!this.isOpen)return;const ie=this.optionsList.querySelectorAll(".select-option");switch(ne){case"ArrowDown":te.preventDefault(),this.highlightedIndex=(this.highlightedIndex+1)%ie.length,this.highlightOption(this.highlightedIndex);break;case"ArrowUp":te.preventDefault(),this.highlightedIndex=(this.highlightedIndex-1+ie.length)%ie.length,this.highlightOption(this.highlightedIndex);break;case"Enter":if(te.preventDefault(),this.highlightedIndex>=0&&this.highlightedIndex<this.filteredOptions.length){const oe=this.filteredOptions[this.highlightedIndex];this.handleOptionClick(oe)}break}}highlightOption(te){const ne=this.optionsList.querySelectorAll(".select-option");if(ne.forEach(ie=>ie.classList.remove("highlighted")),te>=0&&te<ne.length){const ie=ne[te];ie.classList.add("highlighted"),ie.scrollIntoView({block:"nearest"})}}getValue(){return this.selectedValue}setValue(te){const ne=this.options.find(ie=>ie.value===te);ne&&this.handleOptionClick(ne)}setHelperText(te){te?this.renderHelperText(te):this.helperTextElement&&(this.helperTextElement.remove(),this.helperTextElement=null),this.updateComponentStyles()}setErrorState(te){this.currentErrorState!==te&&(this.currentErrorState=te,this.renderLabel(),this.renderHelperText(this.currentHelperText),this.updateComponentStyles())}setDisabled(te){this.currentDisabledState!==te&&(this.currentDisabledState=te,this.inputElement.disabled=te,this.renderLabel(),this.renderHelperText(this.currentHelperText),this.updateComponentStyles())}validate(te){const ne=this.selectedValue!==null;if(this.setErrorState(!ne),this.renderLabel(),!ne){const ie=te||(this.getValue()?AstroPayI18n.translate("invalid_field"):AstroPayI18n.translate("required_field"));this.renderHelperText(ie)}return ne}destroy(){document.removeEventListener("click",this.handleClickOutside.bind(this)),document.removeEventListener("keydown",this.handleKeyDown.bind(this)),super.destroy()}}const getInputTextStyles=(ee,{error:re,disabled:te})=>{const ne=defineInputStyles(re,te);return css`
|
|
616
|
+
`};class InputSelect extends Component{constructor({name:te,label:ne,options:ie,helperText:oe,placeholder:se=AstroPayI18n.translate("select"),emptyMessage:ae=AstroPayI18n.translate("select_item"),error:ue=!1,disabled:ce=!1,maxWidth:le="100%",showValue:de=!1,validateOn:fe,onChange:he}){super({tag:"div",styles:ge=>getSelectStyles(ge,{error:ue,disabled:ce,maxWidth:le})});xe(this,"selectContainer");xe(this,"inputElement");xe(this,"dropdownIcon");xe(this,"optionsList");xe(this,"helperTextElement",null);xe(this,"labelElement",null);xe(this,"isOpen",!1);xe(this,"filteredOptions",[]);xe(this,"selectedValue",null);xe(this,"highlightedIndex",-1);xe(this,"currentErrorState");xe(this,"currentDisabledState");xe(this,"currentHelperText");xe(this,"name");xe(this,"label");xe(this,"options");xe(this,"emptyMessage");xe(this,"showValue");xe(this,"validateOn");xe(this,"maxWidth");xe(this,"onChange");this.name=te,this.label=ne,this.options=ie,this.emptyMessage=ae,this.showValue=de,this.currentErrorState=ue,this.currentDisabledState=ce,this.currentHelperText=oe,this.validateOn=fe,this.maxWidth=le,this.onChange=he,ne&&this.renderLabel(),this.selectContainer=document.createElement("div"),this.selectContainer.classList.add("select-input-container"),this.element.append(this.selectContainer),this.inputElement=document.createElement("input"),this.inputElement.classList.add("select-input-field"),this.inputElement.name=te,this.inputElement.id=te,this.inputElement.autocomplete="off",this.inputElement.disabled=ce,se&&(this.inputElement.placeholder=se),this.selectContainer.append(this.inputElement),this.dropdownIcon=document.createElement("span"),this.dropdownIcon.classList.add("dropdown-icon-wrapper");const pe=new Icon({name:"arrow_down_line",size:24}).element;this.dropdownIcon.appendChild(pe),this.selectContainer.appendChild(this.dropdownIcon),this.optionsList=document.createElement("ul"),this.optionsList.classList.add("select-options-list"),this.selectContainer.append(this.optionsList),this.renderOptions(ie),this.selectContainer.addEventListener("click",ge=>{this.optionsList.contains(ge.target)||(this.toggleDropdown(!0),this.inputElement.setSelectionRange(0,this.inputElement.value.length),this.inputElement.focus())}),this.inputElement.addEventListener("input",ge=>{var me;this.handleInput(ge),(me=this.onChange)==null||me.call(this)}),this.selectContainer.addEventListener("change",this.handleInputChange.bind(this)),this.inputElement.addEventListener("keydown",ge=>this.handleKeyDown(ge)),oe&&this.renderHelperText(oe),document.addEventListener("click",this.handleClickOutside.bind(this))}handleInputChange(){var te;this!=null&&this.validateOn&&this.validate(),(te=this.onChange)==null||te.call(this)}renderLabel(){if(!this.label)return;const te=inputStyle(this.currentErrorState,this.currentDisabledState);this.labelElement?(this.labelElement.textContent=this.label,this.labelElement.style.color=te.label.color):(this.labelElement=new Typography({text:this.label,size:te.label.size,weight:te.label.weight,color:te.label.color,variant:"label"}).element,this.element.append(this.labelElement)),this.labelElement.htmlFor=this.name}renderHelperText(te){if(!te){this.helperTextElement&&(this.helperTextElement.remove(),this.helperTextElement=null);return}const ne=inputStyle(this.currentErrorState,this.currentDisabledState);this.helperTextElement?(this.helperTextElement.textContent=te,this.helperTextElement.style.color=ne.helperText.color):(this.helperTextElement=new Typography({text:te,size:ne.helperText.size,lineHeight:ne.helperText.size,weight:ne.helperText.weight,color:ne.helperText.color}).element,this.element.append(this.helperTextElement))}updateComponentStyles(){const te=ne=>getSelectStyles(ne,{error:this.currentErrorState,disabled:this.currentDisabledState,maxWidth:this.maxWidth});this.element.className=te(ThemeManager.getStyles())}renderOptions(te){if(this.optionsList.innerHTML="",this.filteredOptions=te,te.length>0)te.forEach(ne=>{const ie=document.createElement("li");if(ie.classList.add("select-option"),ne.icon){const se=new Icon({name:ne.icon,size:20}).element;ie.appendChild(se)}const oe=new Typography({text:`${ne.name} ${this.showValue?ne.value:""}`,size:16,lineHeight:24,weight:400}).element;ie.appendChild(oe),ie.dataset.value=String(ne.value),ie.addEventListener("click",()=>this.handleOptionClick(ne)),this.optionsList.append(ie)});else{const ne=document.createElement("div");ne.classList.add("empty-option");const ie=new Typography({text:this.emptyMessage??""}).element;ne.append(ie),this.optionsList.append(ne)}}handleInput(te){const ne=te.target.value.toLowerCase();if(ne===""){const oe=this.selectContainer.querySelector(".select-icon");oe&&oe.remove(),this.selectedValue=null}const ie=this.options.filter(oe=>{const se=oe.name.toLowerCase().includes(ne),ae=this.showValue?String(oe.value).toLowerCase().includes(ne):!1;return se||ae});this.renderOptions(ie),this.toggleDropdown(!0)}toggleDropdown(te){this.isOpen=te,this.optionsList.style.display=this.isOpen?"block":"none",this.dropdownIcon.style.transform=this.isOpen?"rotate(-180deg)":"rotate(0deg)"}handleOptionClick({name:te,value:ne,icon:ie}){const oe=this.selectContainer.querySelector(".select-icon");if(oe&&oe.remove(),ie){const ae=new Icon({name:ie,size:24}).element;ae.classList.add("select-icon"),this.selectContainer.insertBefore(ae,this.inputElement)}this.inputElement.value=this.showValue?String(ne):te,this.selectedValue=ne,this.renderOptions(this.options),this.toggleDropdown(!1),this.highlightedIndex=-1;const se=new Event("change",{bubbles:!0});this.inputElement.dispatchEvent(se)}handleClickOutside(te){this.selectContainer.contains(te.target)||this.toggleDropdown(!1)}handleKeyDown(te){const{key:ne}=te;if(ne==="Escape"){this.toggleDropdown(!1);return}if(!this.isOpen)return;const ie=this.optionsList.querySelectorAll(".select-option");switch(ne){case"ArrowDown":te.preventDefault(),this.highlightedIndex=(this.highlightedIndex+1)%ie.length,this.highlightOption(this.highlightedIndex);break;case"ArrowUp":te.preventDefault(),this.highlightedIndex=(this.highlightedIndex-1+ie.length)%ie.length,this.highlightOption(this.highlightedIndex);break;case"Enter":if(te.preventDefault(),this.highlightedIndex>=0&&this.highlightedIndex<this.filteredOptions.length){const oe=this.filteredOptions[this.highlightedIndex];this.handleOptionClick(oe)}break}}highlightOption(te){const ne=this.optionsList.querySelectorAll(".select-option");if(ne.forEach(ie=>ie.classList.remove("highlighted")),te>=0&&te<ne.length){const ie=ne[te];ie.classList.add("highlighted"),ie.scrollIntoView({block:"nearest"})}}getValue(){return this.selectedValue}setValue(te){const ne=this.options.find(ie=>ie.value===te);ne&&this.handleOptionClick(ne)}setHelperText(te){te?this.renderHelperText(te):this.helperTextElement&&(this.helperTextElement.remove(),this.helperTextElement=null),this.updateComponentStyles()}setErrorState(te){this.currentErrorState!==te&&(this.currentErrorState=te,this.renderLabel(),this.renderHelperText(this.currentHelperText),this.updateComponentStyles())}setDisabled(te){this.currentDisabledState!==te&&(this.currentDisabledState=te,this.inputElement.disabled=te,this.renderLabel(),this.renderHelperText(this.currentHelperText),this.updateComponentStyles())}validate(te){const ne=this.selectedValue!==null;if(this.setErrorState(!ne),this.renderLabel(),!ne){const ie=te||(this.getValue()?AstroPayI18n.translate("invalid_field"):AstroPayI18n.translate("required_field"));this.renderHelperText(ie)}return ne}destroy(){document.removeEventListener("click",this.handleClickOutside.bind(this)),document.removeEventListener("keydown",this.handleKeyDown.bind(this)),super.destroy()}}const getInputTextStyles=(ee,{error:re,disabled:te})=>{const ne=defineInputStyles(re,te);return css`
|
|
617
617
|
display: flex;
|
|
618
618
|
flex-direction: column;
|
|
619
619
|
gap: 4px;
|
|
@@ -688,7 +688,7 @@ Minimum version required to store current data is: `+Re+`.
|
|
|
688
688
|
pointer-events: none;
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
|
-
`};class InputText extends Component{constructor({name:te,label:ne,helperText:ie,type:oe="text",placeholder:se,error:ae=!1,disabled:ue=!1,validationRegex:ce,validateOn:le,mask:de,maxLength:fe,minLength:he,onChange:pe,onBlur:ge}){super({tag:"div",styles:me=>getInputTextStyles(me,{error:ae,disabled:ue})});xe(this,"inputElement");xe(this,"helperTextElement",null);xe(this,"labelElement",null);xe(this,"currentErrorState");xe(this,"currentDisabledState");xe(this,"name");xe(this,"label");xe(this,"currentHelperText");xe(this,"validationRegex");xe(this,"validateOn");xe(this,"mask");xe(this,"onChange");xe(this,"onBlur");this.currentErrorState=ae,this.currentDisabledState=ue,this.name=te,this.label=ne,this.currentHelperText=ie,this.validateOn=le,this.validationRegex=ce,this.mask=de,this.onChange=pe,this.onBlur=ge,ne&&this.renderLabel(),this.inputElement=document.createElement("input"),this.inputElement.type=oe==="number"?"number":"text",this.inputElement.inputMode=oe,this.inputElement.name=te,this.inputElement.id=te,this.inputElement.autocomplete="off",this.inputElement.disabled=ue,se&&(this.inputElement.placeholder=se),fe&&(this.inputElement.maxLength=fe),he&&(this.inputElement.minLength=he),this.inputElement.classList.add("input-field"),this.element.append(this.inputElement),["number","tel"].includes(oe)&&this.inputElement.addEventListener("input",this.handleNumericInput.bind(this)),this.inputElement.addEventListener("input",this.handleInputChange.bind(this)),this.inputElement.addEventListener("blur",this.handleInputBlur.bind(this)),ie&&this.renderHelperText(ie)}handleInputChange(){var te;this.inputElement.value=applyMask(this.inputElement.value,this.mask),(this==null?void 0:this.validateOn)==="onChange"&&this.validate(),(te=this.onChange)==null||te.call(this)}handleInputBlur(){var te;(this==null?void 0:this.validateOn)==="onBlur"&&this.validate(),(te=this.onBlur)==null||te.call(this)}renderLabel(){if(!this.label)return;const te=inputStyle(this.currentErrorState,this.currentDisabledState);this.labelElement?(this.labelElement.textContent=this.label,this.labelElement.style.color=te.label.color):(this.labelElement=new Typography({text:this.label,size:te.label.size,weight:te.label.weight,color:te.label.color,variant:"label"}).element,this.element.append(this.labelElement)),this.labelElement.htmlFor=this.name}renderHelperText(te){if(!te){this.helperTextElement&&(this.helperTextElement.remove(),this.helperTextElement=null);return}const ne=inputStyle(this.currentErrorState,this.currentDisabledState);this.helperTextElement?(this.helperTextElement.textContent=te,this.helperTextElement.style.color=ne.helperText.color):(this.helperTextElement=new Typography({text:te,size:ne.helperText.size,weight:ne.helperText.weight,color:ne.helperText.color}).element,this.element.append(this.helperTextElement))}updateComponentStyles(){const te=ne=>getInputTextStyles(ne,{error:this.currentErrorState,disabled:this.currentDisabledState});this.element.className=te(ThemeManager.getStyles())}handleNumericInput(te){const ne=te.target;ne.value=ne.value.replace(/[^0-9]/g,"")}getValue(){return this.inputElement.value}setValue(te){this.inputElement.value=te}setHelperText(te){te?this.renderHelperText(te):this.helperTextElement&&(this.helperTextElement.remove(),this.helperTextElement=null),this.updateComponentStyles()}setErrorState(te){this.currentErrorState!==te&&(this.currentErrorState=te,this.renderLabel(),this.renderHelperText(this.currentHelperText),this.updateComponentStyles())}setDisabled(te){this.currentDisabledState!==te&&(this.currentDisabledState=te,this.inputElement.disabled=te,this.renderLabel(),this.renderHelperText(this.currentHelperText),this.updateComponentStyles())}validate(te){if(!this.validationRegex)return!0;const ne=removeMask(this.inputElement.value,this.mask),ie=this.validationRegex.test(ne);if(this.setErrorState(!ie),this.renderLabel(),!ie){const oe=te||(this.getValue().trim()?AstroPayI18n.translate("invalid_field"):AstroPayI18n.translate("required_field"));this.renderHelperText(oe)}return ie}}const getFlagByIso=ee=>`${AstroPayConfig.getRuntimeConfig().RESOURCES_BUCKET}/img/flags/${ee}.webp`,getPhoneInputStyles=()=>css`
|
|
691
|
+
`};class InputText extends Component{constructor({name:te,label:ne,helperText:ie,type:oe="text",placeholder:se,error:ae=!1,disabled:ue=!1,validationRegex:ce,validateOn:le,mask:de,maxLength:fe,minLength:he,onChange:pe,onBlur:ge}){super({tag:"div",styles:me=>getInputTextStyles(me,{error:ae,disabled:ue})});xe(this,"inputElement");xe(this,"helperTextElement",null);xe(this,"labelElement",null);xe(this,"currentErrorState");xe(this,"currentDisabledState");xe(this,"name");xe(this,"label");xe(this,"currentHelperText");xe(this,"validationRegex");xe(this,"validateOn");xe(this,"mask");xe(this,"onChange");xe(this,"onBlur");this.currentErrorState=ae,this.currentDisabledState=ue,this.name=te,this.label=ne,this.currentHelperText=ie,this.validateOn=le,this.validationRegex=ce,this.mask=de,this.onChange=pe,this.onBlur=ge,ne&&this.renderLabel(),this.inputElement=document.createElement("input"),this.inputElement.type=oe==="number"?"number":"text",this.inputElement.inputMode=oe,this.inputElement.name=te,this.inputElement.id=te,this.inputElement.autocomplete="off",this.inputElement.disabled=ue,se&&(this.inputElement.placeholder=se),fe&&(this.inputElement.maxLength=fe),he&&(this.inputElement.minLength=he),this.inputElement.classList.add("input-field"),this.element.append(this.inputElement),["number","tel"].includes(oe)&&this.inputElement.addEventListener("input",this.handleNumericInput.bind(this)),this.inputElement.addEventListener("input",this.handleInputChange.bind(this)),this.inputElement.addEventListener("blur",this.handleInputBlur.bind(this)),ie&&this.renderHelperText(ie)}handleInputChange(){var te;this.inputElement.value=applyMask(this.inputElement.value,this.mask),(this==null?void 0:this.validateOn)==="onChange"&&this.validate(),(te=this.onChange)==null||te.call(this)}handleInputBlur(){var te;(this==null?void 0:this.validateOn)==="onBlur"&&this.validate(),(te=this.onBlur)==null||te.call(this)}renderLabel(){if(!this.label)return;const te=inputStyle(this.currentErrorState,this.currentDisabledState);this.labelElement?(this.labelElement.textContent=this.label,this.labelElement.style.color=te.label.color):(this.labelElement=new Typography({text:this.label,size:te.label.size,weight:te.label.weight,color:te.label.color,variant:"label"}).element,this.element.append(this.labelElement)),this.labelElement.htmlFor=this.name}renderHelperText(te){if(!te){this.helperTextElement&&(this.helperTextElement.remove(),this.helperTextElement=null);return}const ne=inputStyle(this.currentErrorState,this.currentDisabledState);this.helperTextElement?(this.helperTextElement.textContent=te,this.helperTextElement.style.color=ne.helperText.color):(this.helperTextElement=new Typography({text:te,size:ne.helperText.size,lineHeight:ne.helperText.size,weight:ne.helperText.weight,color:ne.helperText.color}).element,this.element.append(this.helperTextElement))}updateComponentStyles(){const te=ne=>getInputTextStyles(ne,{error:this.currentErrorState,disabled:this.currentDisabledState});this.element.className=te(ThemeManager.getStyles())}handleNumericInput(te){const ne=te.target;ne.value=ne.value.replace(/[^0-9]/g,"")}getValue(){return this.inputElement.value}setValue(te){this.inputElement.value=te}setHelperText(te){te?this.renderHelperText(te):this.helperTextElement&&(this.helperTextElement.remove(),this.helperTextElement=null),this.updateComponentStyles()}setErrorState(te){this.currentErrorState!==te&&(this.currentErrorState=te,this.renderLabel(),this.renderHelperText(this.currentHelperText),this.updateComponentStyles())}setDisabled(te){this.currentDisabledState!==te&&(this.currentDisabledState=te,this.inputElement.disabled=te,this.renderLabel(),this.renderHelperText(this.currentHelperText),this.updateComponentStyles())}validate(te){if(!this.validationRegex)return!0;const ne=removeMask(this.inputElement.value,this.mask),ie=this.validationRegex.test(ne);if(this.setErrorState(!ie),this.renderLabel(),!ie){const oe=te||(this.getValue().trim()?AstroPayI18n.translate("invalid_field"):AstroPayI18n.translate("required_field"));this.renderHelperText(oe)}return ie}}const getFlagByIso=ee=>`${AstroPayConfig.getRuntimeConfig().RESOURCES_BUCKET}/img/flags/${ee}.webp`,getPhoneInputStyles=()=>css`
|
|
692
692
|
display: flex;
|
|
693
693
|
flex-direction: column;
|
|
694
694
|
gap: 12px;
|
|
@@ -909,7 +909,7 @@ Minimum version required to store current data is: `+Re+`.
|
|
|
909
909
|
`};class SelectDropdown extends Component{constructor({label:te,options:ne,disabled:ie=!1,maxWidth:oe="100%",onChange:se}){super({tag:"div",styles:ce=>getSelectDropdownStyles(ce,{disabled:ie,maxWidth:oe})});xe(this,"selectContainer");xe(this,"displayContent");xe(this,"selectedDisplay");xe(this,"dropdownIcon");xe(this,"optionsList");xe(this,"isOpen",!1);xe(this,"blurTimeout",null);xe(this,"selectedOption",null);xe(this,"highlightedIndex",-1);xe(this,"options");xe(this,"onChange");xe(this,"disabled");xe(this,"boundHandleClick");xe(this,"boundHandleKeyDown");xe(this,"boundHandleClickOutside");this.options=ne,this.onChange=se,this.disabled=ie,this.selectContainer=document.createElement("div"),this.selectContainer.classList.add("select-dropdown-container"),ie&&this.selectContainer.classList.add("disabled"),this.selectContainer.tabIndex=ie?-1:0,this.displayContent=document.createElement("div"),this.displayContent.classList.add("display-content");const ae=new Typography({text:te,size:"medium",weight:500,color:defineInputStyles(!1,ie).textColor}).element;this.displayContent.appendChild(ae),this.selectedDisplay=document.createElement("div"),this.selectedDisplay.classList.add("selected-display"),this.displayContent.appendChild(this.selectedDisplay),this.selectContainer.append(this.displayContent),this.dropdownIcon=document.createElement("span"),this.dropdownIcon.classList.add("dropdown-icon-wrapper");const ue=new Icon({name:"arrow_down_line",size:24,color:defineInputStyles(!1,ie).textColor}).element;this.dropdownIcon.appendChild(ue),this.selectContainer.appendChild(this.dropdownIcon),this.element.appendChild(this.selectContainer),this.optionsList=document.createElement("ul"),this.optionsList.classList.add("dropdown-options"),this.element.appendChild(this.optionsList),this.renderOptions(ne),ne.length>0&&this.setSelectedOption(ne[0],!0),ie||(this.boundHandleClick=this.handleContainerClick.bind(this),this.boundHandleKeyDown=this.handleKeyDown.bind(this),this.boundHandleClickOutside=this.handleClickOutside.bind(this),this.selectContainer.addEventListener("click",this.boundHandleClick),this.selectContainer.addEventListener("keydown",this.boundHandleKeyDown),document.addEventListener("click",this.boundHandleClickOutside),this.selectContainer.addEventListener("blur",()=>{this.blurTimeout=window.setTimeout(()=>{!this.selectContainer.contains(document.activeElement)&&!this.optionsList.contains(document.activeElement)&&this.toggleDropdown(!1)},150)}))}setSelectedOption(te,ne=!1){var oe;const ie=((oe=this.selectedOption)==null?void 0:oe.value)===te.value;this.selectedOption=te,this.updateSelectedDisplay(te),this.onChange&&(ne||!ie)&&this.onChange(te)}handleContainerClick(te){this.optionsList.contains(te.target)||this.toggleDropdown(!this.isOpen)}updateSelectedDisplay(te){this.selectedDisplay.innerHTML="";const ne=new Typography({text:te.content,size:"small",weight:400,color:defineInputStyles(!1,this.disabled).textColor}).element;this.selectedDisplay.appendChild(ne)}renderOptions(te){this.optionsList.innerHTML="",te.length>0&&te.forEach((ne,ie)=>{var ue;const oe=document.createElement("li");oe.classList.add("dropdown-option"),oe.setAttribute("role","option"),oe.setAttribute("aria-selected",String(((ue=this.selectedOption)==null?void 0:ue.value)===ne.value)),oe.id=`select-dropdown-option-${ie}`,this.highlightedIndex===ie&&(oe.classList.add("highlighted"),this.scrollOptionIntoView(oe));const se=document.createElement("div");se.classList.add("option-content");const ae=new Typography({text:ne.content,size:"medium",weight:500}).element;se.appendChild(ae),ne.rightContent&&se.appendChild(ne.rightContent),oe.appendChild(se),oe.dataset.value=String(ne.value),oe.dataset.index=String(ie),oe.addEventListener("click",ce=>{ce.stopPropagation(),this.handleOptionClick(ne)}),this.optionsList.append(oe)})}handleOptionClick(te){this.setSelectedOption(te),this.renderOptions(this.options),this.toggleDropdown(!1),this.highlightedIndex=-1,this.selectContainer.focus()}toggleDropdown(te){if(!this.disabled)if(this.isOpen=te,this.optionsList.style.display=this.isOpen?"block":"none",this.dropdownIcon.style.transform=this.isOpen?"rotate(-180deg)":"rotate(0deg)",this.isOpen){if(this.selectedOption){const ne=this.options.findIndex(ie=>{var oe;return ie.value===((oe=this.selectedOption)==null?void 0:oe.value)});this.highlightedIndex=ne!==-1?ne:0}else this.highlightedIndex=0;this.renderOptions(this.options)}else this.highlightedIndex=-1}handleClickOutside(te){!this.selectContainer.contains(te.target)&&!this.optionsList.contains(te.target)&&this.toggleDropdown(!1)}handleKeyDown(te){if(!this.disabled)switch(te.key){case"ArrowDown":te.preventDefault(),this.isOpen?this.highlightNextOption():this.toggleDropdown(!0);break;case"ArrowUp":te.preventDefault(),this.isOpen&&this.highlightPreviousOption();break;case"Enter":case" ":if(te.preventDefault(),this.isOpen&&this.highlightedIndex!==-1){const ne=this.options[this.highlightedIndex];ne&&this.handleOptionClick(ne)}else this.toggleDropdown(!this.isOpen);break;case"Tab":this.isOpen&&this.toggleDropdown(!1);break;case"Escape":te.preventDefault(),this.isOpen&&this.toggleDropdown(!1);break}}highlightNextOption(){this.options.length!==0&&(this.highlightedIndex=(this.highlightedIndex+1)%this.options.length,this.renderOptions(this.options))}highlightPreviousOption(){this.options.length!==0&&(this.highlightedIndex=this.highlightedIndex-1,this.highlightedIndex<0&&(this.highlightedIndex=this.options.length-1),this.renderOptions(this.options))}scrollOptionIntoView(te){if(te){const ne=this.optionsList.getBoundingClientRect(),ie=te.getBoundingClientRect();ie.bottom>ne.bottom?te.scrollIntoView({block:"nearest"}):ie.top<ne.top&&te.scrollIntoView({block:"nearest"})}}destroy(){this.disabled||(document.removeEventListener("click",this.boundHandleClickOutside),this.selectContainer.removeEventListener("click",this.boundHandleClick),this.selectContainer.removeEventListener("keydown",this.boundHandleKeyDown),this.blurTimeout&&window.clearTimeout(this.blurTimeout)),super.destroy()}}var EComponentType=(ee=>(ee.AMOUNT_DISPLAY="AMOUNT_DISPLAY",ee.COPY="COPY",ee.DESCRIPTION="DESCRIPTION",ee.EXPIRATION_TIMER="EXPIRATION_TIMER",ee.QR_CODE="QR_CODE",ee.SHARE="SHARE",ee))(EComponentType||{}),EFieldType=(ee=>(ee.TEXT="TEXT",ee.SELECT="SELECT",ee))(EFieldType||{});const parseRegex=ee=>{if(ee)try{return new RegExp(ee)}catch{console.warn("Invalid regex from backend:",ee);return}},mountSelectOptions=ee=>ee.map(re=>({name:re.value,value:re.key}));var EBreakpoints=(ee=>(ee.MOBILE="480px",ee.TABLET="768px",ee.LAPTOP="1024px",ee.DESKTOP="1280px",ee))(EBreakpoints||{});const getFormTemplateStyles=()=>css`
|
|
910
910
|
display: flex;
|
|
911
911
|
flex-direction: column;
|
|
912
|
-
gap:
|
|
912
|
+
gap: 8px;
|
|
913
913
|
|
|
914
914
|
.row-container {
|
|
915
915
|
display: flex;
|
|
@@ -920,7 +920,7 @@ Minimum version required to store current data is: `+Re+`.
|
|
|
920
920
|
flex-direction: column;
|
|
921
921
|
}
|
|
922
922
|
}
|
|
923
|
-
`;class FormTemplate extends Component{constructor(te){super({tag:"div",styles:()=>getFormTemplateStyles()});xe(this,"componentProps");xe(this,"dynamicInputs",{});xe(this,"onValidationChange",()=>{});if(this.componentProps=te,te.title){const ne=new Typography({text:te.title,size:"medium",weight:600}).element;ne.style.padding="12px 0",this.element.append(ne)}this.renderDynamicInputs()}renderDynamicInputs(){if(!this.componentProps.requiredFields)return;const te=this.componentProps.requiredFields.find(oe=>oe.field==="document_type"),ne=this.componentProps.requiredFields.find(oe=>oe.field==="document_number"),ie=this.componentProps.requiredFields.filter(oe=>oe.field!=="document_type"&&oe.field!=="document_number");te&&ne?this.renderDocumentNumberWithType(te,ne):(te&&this.renderStandardInput(te),ne&&this.renderStandardInput(ne)),ie.forEach(oe=>{this.renderStandardInput(oe)})}renderDocumentNumberWithType(te,ne){const ie=document.createElement("div");ie.classList.add("row-container");const oe=this.createInputElement(te),se=this.createInputElement(ne);this.dynamicInputs[te.field]=oe,this.dynamicInputs[ne.field]=se,this.addInputEventListeners(oe,te.type),this.addInputEventListeners(se,ne.type),ie.append(oe.element,se.element),this.element.append(ie)}renderStandardInput(te){const ne=this.createInputElement(te);this.dynamicInputs[te.field]=ne,this.addInputEventListeners(ne,te.type),this.element.append(ne.element)}createInputElement(te){return te.type===EFieldType.SELECT?this.createSelectInput({name:te.field,label:te.label,placeholder:te.placeholder,options:mountSelectOptions(te.values),validateOn:"onChange"}):this.createTextInput({name:te.field,label:te.label,placeholder:te.placeholder,type:"text",validationRegex:parseRegex(te.regex),validateOn:"onChange"})}createSelectInput(te){return new InputSelect(te)}createTextInput(te){return new InputText(te)}addInputEventListeners(te,ne){const ie=ne===EFieldType.TEXT?"input":"change";te.element.addEventListener(ie,()=>{this.validateForm(),this.triggerValidationChange()})}validateForm(){return Object.values(this.dynamicInputs).every(te=>te.getValue()&&te.validate())}getFormData(){const te={};return Object.entries(this.dynamicInputs).forEach(([ne,ie])=>{const oe=ie.getValue();te[ne]=oe!==null?String(oe):""}),te}setValidationChangeHandler(te){this.onValidationChange=te,this.triggerValidationChange()}triggerValidationChange(){this.onValidationChange&&this.onValidationChange(this.validateForm())}setFieldError(te,ne,ie){const oe=this.dynamicInputs[te];oe&&(oe.setErrorState(ne),ie&&oe.setHelperText(ie))}}const locales={AED:"ar-AE",AOA:"pt-AO",AND:"ca-AD",ARS:"es-AR",AUD:"en-AU",BDT:"bn-BD",BGN:"bg-BG",BOB:"es-BO",BRL:"pt-BR",CAD:"en-CA",CDF:"fr-CD",CLP:"es-CL",CNY:"zh-CN",COP:"es-CO",CZK:"cs-CZ",DKK:"da-DK",EGP:"ar-EG",ETB:"am-ET",EUR:"de-DE",GBP:"en-GB",GHS:"en-GH",GTQ:"es-GT",HNL:"es-HN",HKD:"zh-HK",HUF:"hu-HU",IDR:"id-ID",INR:"hi-IN",JPY:"ja-JP",KES:"en-KE",KRW:"ko-KR",KWD:"ar-KW",KZT:"kk-KZ",LKR:"si-LK",LSL:"st-LS",MAD:"ar-MA",MGA:"mg-MG",MKD:"mk-MK",MMK:"my-MM",MNT:"mn-MN",MOP:"zh-MO",MXN:"es-MX",MYR:"ms-MY",MZN:"pt-MZ",NGN:"en-NG",NIO:"es-NI",NOK:"no-NO",NPR:"ne-NP",NZD:"en-NZ",PAB:"es-PA",PEN:"es-PE",PKR:"ur-PK",PLN:"pl-PL",PYG:"es-PY",QAR:"ar-QA",RMB:"zh-CN",RSD:"sr-RS",RUB:"ru-RU",RWF:"rw-RW",SAR:"ar-SA",SEK:"sv-SE",SLL:"en-SL",SVC:"es-SV",THB:"th-TH",TND:"ar-TN",TRY:"tr-TR",TTD:"en-TT",TWD:"zh-TW",TZS:"sw-TZ",UAH:"uk-UA",UGX:"en-UG",USD:"en-US",UYU:"es-UY",UZS:"uz-UZ",VND:"vi-VN",XAF:"fr-CM",XOF:"fr-SN",ZAR:"en-ZA",ZWD:"en-ZW",ZWL:"en-ZW"},formatAmount=(ee,re)=>{const te=locales[re]||"en-US";return new Intl.NumberFormat(te,{style:"decimal",currency:re,minimumFractionDigits:2,maximumFractionDigits:2}).format(ee)},currencyCodeMap={AED:"د.إ",AOA:"Kz",AND:"€",ARS:"$",AUD:"$",BDT:"৳",BGN:"лв",BOB:"Bs.",BRL:"R$",CAD:"$",CDF:"FC",CLP:"$",CNY:"¥",COP:"$",CZK:"Kč",DKK:"kr",EGP:"£",ETB:"Br",EUR:"€",GBP:"£",GHS:"₵",GTQ:"Q",HNL:"L",HKD:"$",HUF:"Ft",IDR:"Rp",INR:"₹",JPY:"¥",KES:"KSh",KRW:"₩",KWD:"د.ك",KZT:"₸",LKR:"₨",LSL:"L",MAD:"د.م.",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MXN:"$",MYR:"RM",MZN:"MT",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",PAB:"B/.",PEN:"S/.",PKR:"₨",PLN:"zł",PYG:"₲",QAR:"﷼",RMB:"¥",RSD:"РСД",RUB:"₽",RWF:"FRw",SAR:"ر.س",SEK:"kr",SLL:"Le",SVC:"$",THB:"฿",TND:"د.ت",TRY:"₺",TTD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"US$",UYU:"$",UZS:"so'm",VND:"₫",XAF:"FCFA",XOF:"CFA",ZAR:"R",ZWD:"$",ZWL:"$"},codeToSymbol=ee=>ee===void 0?"":currencyCodeMap[ee.trim()]||ee,formatAmountCurrency=(ee,re,te)=>{const ne=formatAmount(ee,re);return te==="symbol"?`${codeToSymbol(re)} ${ne}`:`${ne} ${re}`},getPaymentSummaryStyles=ee=>css`
|
|
923
|
+
`;class FormTemplate extends Component{constructor(te){super({tag:"div",styles:()=>getFormTemplateStyles()});xe(this,"componentProps");xe(this,"dynamicInputs",{});xe(this,"onValidationChange",()=>{});if(this.componentProps=te,te.title){const ne=new Typography({text:te.title,size:"medium",weight:600}).element;ne.style.padding="12px 0",this.element.append(ne)}this.renderDynamicInputs()}renderDynamicInputs(){if(!this.componentProps.requiredFields)return;const te=this.componentProps.requiredFields.find(oe=>oe.field==="document_type"),ne=this.componentProps.requiredFields.find(oe=>oe.field==="document_number"),ie=this.componentProps.requiredFields.filter(oe=>oe.field!=="document_type"&&oe.field!=="document_number");te&&ne?this.renderDocumentNumberWithType(te,ne):(te&&this.renderStandardInput(te),ne&&this.renderStandardInput(ne)),ie.forEach(oe=>{this.renderStandardInput(oe)})}renderDocumentNumberWithType(te,ne){const ie=document.createElement("div");ie.classList.add("row-container");const oe=this.createInputElement(te),se=this.createInputElement(ne);this.dynamicInputs[te.field]=oe,this.dynamicInputs[ne.field]=se,this.addInputEventListeners(oe,te.type),this.addInputEventListeners(se,ne.type),ie.append(oe.element,se.element),this.element.append(ie)}renderStandardInput(te){const ne=this.createInputElement(te);this.dynamicInputs[te.field]=ne,this.addInputEventListeners(ne,te.type),this.element.append(ne.element)}createInputElement(te){return te.type===EFieldType.SELECT?this.createSelectInput({name:te.field,label:te.label,placeholder:te.placeholder,options:mountSelectOptions(te.values),validateOn:"onChange",helperText:NON_BREAKING_SPACE}):this.createTextInput({name:te.field,label:te.label,placeholder:te.placeholder,type:"text",validationRegex:parseRegex(te.regex),validateOn:"onChange",helperText:NON_BREAKING_SPACE})}createSelectInput(te){return new InputSelect(te)}createTextInput(te){return new InputText(te)}addInputEventListeners(te,ne){const ie=ne===EFieldType.TEXT?"input":"change";te.element.addEventListener(ie,()=>{this.validateForm(),this.triggerValidationChange()})}validateForm(){return Object.values(this.dynamicInputs).every(te=>te.getValue()&&te.validate())}getFormData(){const te={};return Object.entries(this.dynamicInputs).forEach(([ne,ie])=>{const oe=ie.getValue();te[ne]=oe!==null?String(oe):""}),te}setValidationChangeHandler(te){this.onValidationChange=te,this.triggerValidationChange()}triggerValidationChange(){this.onValidationChange&&this.onValidationChange(this.validateForm())}setFieldError(te,ne,ie){const oe=this.dynamicInputs[te];oe&&(oe.setErrorState(ne),ie&&oe.setHelperText(ie))}}const locales={AED:"ar-AE",AOA:"pt-AO",AND:"ca-AD",ARS:"es-AR",AUD:"en-AU",BDT:"bn-BD",BGN:"bg-BG",BOB:"es-BO",BRL:"pt-BR",CAD:"en-CA",CDF:"fr-CD",CLP:"es-CL",CNY:"zh-CN",COP:"es-CO",CZK:"cs-CZ",DKK:"da-DK",EGP:"ar-EG",ETB:"am-ET",EUR:"de-DE",GBP:"en-GB",GHS:"en-GH",GTQ:"es-GT",HNL:"es-HN",HKD:"zh-HK",HUF:"hu-HU",IDR:"id-ID",INR:"hi-IN",JPY:"ja-JP",KES:"en-KE",KRW:"ko-KR",KWD:"ar-KW",KZT:"kk-KZ",LKR:"si-LK",LSL:"st-LS",MAD:"ar-MA",MGA:"mg-MG",MKD:"mk-MK",MMK:"my-MM",MNT:"mn-MN",MOP:"zh-MO",MXN:"es-MX",MYR:"ms-MY",MZN:"pt-MZ",NGN:"en-NG",NIO:"es-NI",NOK:"no-NO",NPR:"ne-NP",NZD:"en-NZ",PAB:"es-PA",PEN:"es-PE",PKR:"ur-PK",PLN:"pl-PL",PYG:"es-PY",QAR:"ar-QA",RMB:"zh-CN",RSD:"sr-RS",RUB:"ru-RU",RWF:"rw-RW",SAR:"ar-SA",SEK:"sv-SE",SLL:"en-SL",SVC:"es-SV",THB:"th-TH",TND:"ar-TN",TRY:"tr-TR",TTD:"en-TT",TWD:"zh-TW",TZS:"sw-TZ",UAH:"uk-UA",UGX:"en-UG",USD:"en-US",UYU:"es-UY",UZS:"uz-UZ",VND:"vi-VN",XAF:"fr-CM",XOF:"fr-SN",ZAR:"en-ZA",ZWD:"en-ZW",ZWL:"en-ZW"},formatAmount=(ee,re)=>{const te=locales[re]||"en-US";return new Intl.NumberFormat(te,{style:"decimal",currency:re,minimumFractionDigits:2,maximumFractionDigits:2}).format(ee)},currencyCodeMap={AED:"د.إ",AOA:"Kz",AND:"€",ARS:"$",AUD:"$",BDT:"৳",BGN:"лв",BOB:"Bs.",BRL:"R$",CAD:"$",CDF:"FC",CLP:"$",CNY:"¥",COP:"$",CZK:"Kč",DKK:"kr",EGP:"£",ETB:"Br",EUR:"€",GBP:"£",GHS:"₵",GTQ:"Q",HNL:"L",HKD:"$",HUF:"Ft",IDR:"Rp",INR:"₹",JPY:"¥",KES:"KSh",KRW:"₩",KWD:"د.ك",KZT:"₸",LKR:"₨",LSL:"L",MAD:"د.م.",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MXN:"$",MYR:"RM",MZN:"MT",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",PAB:"B/.",PEN:"S/.",PKR:"₨",PLN:"zł",PYG:"₲",QAR:"﷼",RMB:"¥",RSD:"РСД",RUB:"₽",RWF:"FRw",SAR:"ر.س",SEK:"kr",SLL:"Le",SVC:"$",THB:"฿",TND:"د.ت",TRY:"₺",TTD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"US$",UYU:"$",UZS:"so'm",VND:"₫",XAF:"FCFA",XOF:"CFA",ZAR:"R",ZWD:"$",ZWL:"$"},codeToSymbol=ee=>ee===void 0?"":currencyCodeMap[ee.trim()]||ee,formatAmountCurrency=(ee,re,te)=>{const ne=formatAmount(ee,re);return te==="symbol"?`${codeToSymbol(re)} ${ne}`:`${ne} ${re}`},getPaymentSummaryStyles=ee=>css`
|
|
924
924
|
display: flex;
|
|
925
925
|
flex-direction: column;
|
|
926
926
|
background-color: ${ee.card.backgroundColor};
|
|
@@ -929,10 +929,10 @@ Minimum version required to store current data is: `+Re+`.
|
|
|
929
929
|
padding: ${ee.card.padding}px;
|
|
930
930
|
border: ${ee.card.borderWidth}px ${ee.card.borderStyle} ${ee.card.borderColor};
|
|
931
931
|
border-radius: ${ee.card.borderRadius}px;
|
|
932
|
-
`;class PaymentSummary extends Component{constructor(te){super({tag:"div",styles:ie=>getPaymentSummaryStyles(ie)});xe(this,"amount");xe(this,"currency");xe(this,"valueContainer");this.amount=te.amount,this.currency=te.currency;const ne=new Typography({text:AstroPayI18n.translate("payment_amount"),size:"medium",weight:400,align:"center",variant:"div"}).element;this.valueContainer=document.createElement("div"),this.updateValueDisplay(),this.element.append(ne,this.valueContainer)}updateValueDisplay(){this.valueContainer.innerHTML="";const te=new Typography({text:this.getFormattedAmount(),size:"large",weight:600,align:"center",variant:"div"});this.valueContainer.appendChild(te.element)}getFormattedAmount(){return formatAmountCurrency(this.amount,this.currency,AstroPayConfig.getCurrencyMode())}setAmount(te){this.amount=te,this.updateValueDisplay()}setCurrency(te){this.currency=te,this.updateValueDisplay()}setAmountAndCurrency(te,ne){this.amount=te,this.currency=ne,this.updateValueDisplay()}}var t=rn;function n(){var ee=rn;const re=["clear","127830LZHlSi",ee(795),ee(743),ee(794),ee(649),ee(511),"1048780OzWlkN",ee(668),ee(412),ee(465),ee(180),ee(520),ee(373),ee(419),ee(562),ee(422),"off"];return(n=function(){return re})()}(function(){for(var ee=rn,re=e();;)try{if(-parseInt(ee(329))/1*(parseInt(ee(274))/2)+-parseInt(ee(369))/3*(-parseInt(ee(367))/4)+-parseInt(ee(233))/5+parseInt(ee(145))/6*(-parseInt(ee(701))/7)+-parseInt(ee(655))/8*(-parseInt(ee(270))/9)+parseInt(ee(315))/10*(parseInt(ee(142))/11)+parseInt(ee(685))/12===588751)break;re.push(re.shift())}catch{re.push(re.shift())}})();const r=a;function e(){var ee=["3448vNCtZZ","761436JoNrAO","5310140VtlWwy","Request timeout","7672278JDWNZO","90ZjyTbp","3104038VhHmhJ","341079ldogSu","3114441jTKeeA","key","PRODUCTION","getAttribute","toDotCase","send","102532iujTOj","757371vntIDP","rule","28497zqLGhH","1965484iDLxVf","justify","10QefxGX","5066250nuHGFb","append","1380400kMJPdd","tags","3598075UDNdui","rel","latest","5679575iNTExO","@font-feature-values","700156cwVhpM","13090752DcUgRT","count","lowerFirst","box-pack:$3","@keyframes","6990495zFYjlD","timeout","SANDBOX","1764180DwriBQ","28900hQasRN","get","$2box$3","592uldMpH","1906140GGDNCn","forEach","6lcQlGI","timeZone","330066EfbpyJ","2180136rfoyVo","2548490MycJlj","3489ZHTUlC","includes","902079TZNeVj","hasOwnProperty","20cFIzva","flex-line-pack","5421zZCtjq","anim","1685971anZxDF","1118807BrroiT","633515GvGIbN","href","612712APocYB","-ms-","34347599FblyIU","5oIWUit",'/"]',"styleSheets","1149940kbRkDq","18emqyKv","216768ATlgsw","REQUIRED","1538910aqOPES","167058fDTlal","1802382UuEKog","11928996WPgChJ","297544AzCjab","7cCQubY","210052cCRFdo","15365691CaBpSv","prepend","1837320JmVWKN","apply","5488040tLgchU","6404728IJjHNF","cssRules","[HTTP]: ","function","538328lGaoiz","3WyhRFj","set","document.head or document.body","18KOgRUC","3PpNGVC","frames","request","formatKeys","2515230SGPlYS","1557YOosgA","container","4144596Ukwkkq","14mcAgvY","_createCaseFirst","80179OoRuKl","NOT_FOUND","test","1063965TOYbKD","112560WXZvtM","5855416GyXitv","authorization","insertionPoint","ctx","3122830eGkjjc","173392QMdDYZ","197776ZnKCeZ","comm","42CEhiUc","3UDJFFS","8znKpbY","1rkGFTj","1103656RUOYui","5297088ciYuDR","CopyButton","random","5589390vSVLAu","done","969632YGVaMk","flex-pack:$3","setPrototypeOf","negative","$2$3","8766CUlXUX","6555474dHVLiB","16hoClBR","10399347ouOdzC","1731331adTcvK","6011170PFMfeO","box-","2QsMDbx","396880hxDmUW","5lLsGOe","lower","288762yBOcUy","927680PXUBpa","5272970jsKcdl","210wvAPTz","4390984qBtQNZ","1042915vBnDcJ","slice","18146574kLGOdt","Content-Type","@counter-style","1635840LijluJ","assign","then","148iTkCvR","upperFirst","4586523dESxoU","102UdDlbM","13480IirCBl","application/json","-$&","snake","startCase","3782506eozEyq","[UNHANDLED]: ","1586289ZbsznC","parent","compat","style[data-emotion]:not([data-s])","41346sAgKHc","origin","1542472UUshgd","toPascalCase","domians","187957vMwqit","toSnakeCase","568pAcJOy","5590kjPEGP","@font-face","34057TCsfxk","9621207ZSMPqN","data-emotion","_startCase","print-","@media","link",":read-write","NOT_LOADED","9356KfJoDB","animationName","4mPQIOh","animation","2696336QqSQcN","start","3363787mMyewX","12991583mFbRDh","35tYPZLV","35168opQkvL","32WPbhAk","hydrate","/public/v1/token/reveal","36hVbjtN","basis","$1$2","cdn","__emotion_styles","22apMIFO","3goapWe","3275226iDBkQv","push","221142kMnpSu","querySelectorAll","114RSjmoG","reveal","2672020NupvKQ","5voBSrt","5280612FAmHRj","2YDvJFs","121946FvfpOL","TIMEOUT","BAD_REQUEST","308070mzXybL","7704828AlyWpW","4136vTyAoM","42WATbWV","17375868QkLWYY","1961979ltppkW","369356uTNDzr","5112212jRFQZI","24746700nYUjHu","$1 $2","6521168AcnhGa","style","12tOiqGC","https://tokenizer-tst.cc.astropay.com","speedy","60VyHydS","793022whjRWB","bind","kebab","10Oqises","add","1470645xRoijs","object","captureStackTrace","781649cCTwXr","182824NOFIwU","4817756GOdPsv","BASE_CDN","isArray","@supports","1244744kHEZvp","1204400cULrpT","449711XSjyNn","@namespace","57gVyDRX","emit","6236046SweZxs","defineProperties","@@INIT","3014374nROcbQ","params","sheet","1671942sLAGQH","Unable to find ","shift","canExecute","upper","UNHANDLED","321246WzqUuK","2416zstDHz","78TjMsRA","@document","486479crVyAA","1274230eUYpuD","7476MqGCll","https://tokenizer.cc.astropay.com","9qEwJkj","94mlxQmC","_insertTag","@viewport","copy-button","2oFrXUh","css","707329nPsPGZ","3903120ZTbQWm","1250232QMjwkz","993063ECHrBH","off","box$3","2387410tdnXlE","environment","type","4XTbgyi","207494VIJaqZ","207VWsTHT","6MQcvFH","35KTILAE","623aFRIRv","104MtyiFW","70fByxgL","1328390hcsUJy","11965976myZRSf","2932168wOOQED","7CAfDgU","27xTvXzF","5139khheWn","18298ErvNda","15qVcyAs","2581385zzzlSz","1531173EygmBU","5013TdEGGQ","39251454EyvEGu","1szHVRr","nextSibling","171eGkepJ","995792ZXdNpW","getFullCdn","49fgToOT","141238OYIhFf","3604728wtPlZt","9byfBJF","exec","next","message","70759QyvmDC","isSpeedy","128yfgIdV","data-s","200ROoAmA","shrink","length","282358JpRRgN","isOperational","insert","3278505kVkcHW","2558421fHqYVU","1165706VPRSLL","split","360993lzNNst","3986rrEZYp","return","3480945BQAAYg","2nMBmkS","2281844ROitQp","BASE_API","27HmsHKI","679404ZmaTyg","20xkgBFi","3908064tZgPPb","1790914KWViXl","inserted","stylisPlugins","reduce","insertBefore","26oJRKGO","119987EZDfNd","565eyruQF","Access-Control-Allow-Origin","595876LgUVRS","1992206jKEGfb","join","193550GoZXIJ","202wLqUwO","replace","baseURL"," is invalid.","99amzLEi","12446nhMFLu","1856148uSihXJ","31566270qvtShe","56045nULafv","abs","5889208ocarfU","2206497yNbZFm","7WjjEbv","@keyframes ","firstChild","305907rAOuHi","1070106SrHRtP","1KlNACj","2829256VMfbYc","801054pmVKPQ","45296tjbJvx","399116yuJdxn","TimeZone","removeEventListener","UNDEFINED",' "]',"lastIndex","18388260JgPhmo","790sQdzeI","xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx","39nuPwxQ","nonce","1906825qFGXWA","102Qkfvvl","name","raw","20gywqiU","7308324sgDoMc","34825311qnCLyR","991531xZguiI","4593190CadDlo","INVALID","1uSGfgo","input-$1","1501542qKAixX","prototype","registered","456wJQuIj","347732LsCzct","parse","undefined","76385hkeDYT","inline-","115026FZBXCQ","5txmdnE","32HPdvVb","8954800LNVZHA","accessToken","3GcEFSv","props","5028BbqWZE","34672561hfhCnC","6522030iNQqBd","36TYjiRw","474fHLsgQ","365994YPzeNn","toKebabCase","6SBjYSO","1HxbtmM","toCamelCase","3xMbMIj","313859KKbbgd","keys","6LCyCWH","tb-rl","1145017tuPjtp","api","10895PHjSJt","boolean","flex-$1$2","2012180BGZvZq","5JHUgnG","6eqGueN","create","1483570zwTktD","366KnZgCn","14qDkMOo","8FUVWOn","38685lFcQsk","appendChild","4wswXHb","INTERNAL_SERVER_ERROR","315634dCJvdO","32039NIQJjh","trim","entries","143352vIzUva","-grow","6vPzjsU","getOwnPropertyDescriptors","192VVRXxR","2013040uXGWiH","grow","10gWvkPZ","getOwnPropertySymbols","!important","5028340uiCobm","splitWords","1398012AIJUyj","1632420YnhDrH","ctr"," is undefined.","41812yDXNFv","2495164uYJjkv","-moz-","version","502691MEcBqX","getHeaders","3kPtUIZ","stringify","14822650JPeFEZ","@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ","42054ESbccP","_toWords","4242528bXZfiT","3344667OIHhxe","5750396vrmTdj","head","268152SJsZnw","427cxPooO","isUndefined","3930zrQOch","listeners","decl","@import","filter","stop","location","79674ZpwWYN","293732SBYxst","/public/v1/token","fromCharCode","toLowerCase","toUpperCase","call","GET","addEventListener","setAttribute","26941288CkDEbN","post","11oqlwuN","Access token not set","87GWhrFE","emitter","before","isRequired","1369700dRAXAo","5GSCGHS","string","toString","24384006yWcRvg","_canExecute","8765008liwqJC","sourceWindow","sandbox","7368UiaItP","12GMrAvZ","HTTP","dns-prefetch","4410036tOJnlJ","264834CkfPaR","children","4214610DepdAD","1472518dXJTTo","3379032afmmzz","Component selectors can only be used in conjunction with ","8ZmfgGJ","44cPbEBd","582SAPPev","350313NZGJmJ","4249880hofxWm",":read-only","436145BXkDSV","toSentenceCase","24qGiocM","flex-item-","REQUEST_TIMEOUT","UNAUTHORIZED","2924874IDKzfu","11ozoHrq","20380sohzME","284730CeOziu","6521911DlQhaK","resolve","175pzlaDH","12Wntbrz","153CwXsSP","6807462wcVIbh","$`$1","99255obnocz","8565340BeQZTN","frameId","3220704wvCPTK","9vcUkeB","5163599fsttEm","983742ZSzkPs","1880YXBEgQ","postMessage","6676776VbOJGf","value","72700aKFNWB","Request error! status: ","2685321kQBtXq","2011122iTUboz","784830EiOgSk","4Shhqxd","concat","throw","777225SHDgSu","resolvedOptions","search","24brqEuT","stretch","2353821ouiOcG","16BpXaTH","body","4168339BVBfRq","_upperFirst","styles","5GkJNGS","2498022TthXHp","match","4399206zUvsoU","defineProperty","45vUgLOB",'script[src^="',"box-$1$2","1915506xRzusT","targetOrigin","10vjgZog","map","3084189TBfDxs","2617015rxAdDp","20057BCeMKK","692668yJTffY","3275913IwuUbo","5yABJbK","charCodeAt","4DRtert","formatKey","5gnwpyW","_lowerCase","4622320DSbOxK","createElement","1428025rswbrb","AbortError","272928GGfFVj","737mdBFHW","4950912kToKgF","handleMessage","8310840DVoCar","getOwnPropertyDescriptor","109064imVtqW","createTextNode","6XsYOJz","24899zSajlN","127845nWOlks","21ZAugTX","11860803tMqYZp","3898532gnOkwM","5015045AqKKoB","1371378msYiaj","5167656aUcLyl","209740ohkUFh","7903578rApVjM","378mIpYul","UNABLE_TO_FIND","586668OMSavw","https://tokenizer-web.cc.astropay.com","39728XQruux","::placeholder","2hgGSIR","3799864GhLwZS","removeChild","toLocaleLowerCase","40869670rNPvRw","flush","235779fIEMDA","enumerable","5CDMHbY","Reveal","773584eZyLko","1907948myHfGb","61554tirTmC","4269661uBmwSk","23881380dQaLeD","296368dsyAUL"];return(e=function(){return ee})()}function a(ee,re){const te=n();return(a=function(ne,ie){return te[ne-=160]})(ee,re)}(function(){var ee=rn;const re=a,te=n();for(;;)try{if(-parseInt(re(176))/1*(-parseInt(re(169))/2)+-parseInt(re(175))/3+parseInt(re(172))/4*(parseInt(re(173))/5)+parseInt(re(170))/6*(-parseInt(re(161))/7)+-parseInt(re(174))/8+-parseInt(re(163))/9*(parseInt(re(167))/10)+parseInt(re(171))/11==561693)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),r(165),r(177),r(166);var s,o,p,c,i,u,I,f,h,v,l,d;function b(){var ee=rn,re=[ee(350),ee(396),ee(311),ee(474),"837xAVhUS","HTTP",ee(724),ee(144),ee(264),ee(473),ee(689),ee(226),ee(221),"TIMEOUT","NOT_LOADED",ee(328),ee(378),ee(179),ee(656),ee(563),"6960805uGgNwo",ee(192),ee(426),"12267310uEVrHO"];return(b=function(){return re})()}function y(ee,re){var te=b();return(y=function(ne,ie){return te[ne-=191]})(ee,re)}function k(ee,re){var te=m();return(k=function(ne,ie){return te[ne-=203]})(ee,re)}function m(){var ee=rn,re=[ee(718),ee(707),"41710840nWONlY",ee(731),ee(659),ee(799),"7OXGKyG",ee(198),ee(766),ee(243),ee(490),ee(263)];return(m=function(){return re})()}function O(ee,re){var te=E();return(O=function(ne,ie){return te[ne-=166]})(ee,re)}function E(){var ee=rn,re=[ee(622),ee(657),ee(242),ee(732),"production",ee(499),"83274xOmQWJ","4mtYUAV",ee(451),ee(543),ee(594),"65587catFQe",ee(415)];return(E=function(){return re})()}function w(ee,re){var te=D();return(w=function(ne,ie){return te[ne-=472]})(ee,re)}function D(){var ee=rn,re=[ee(308),ee(157),ee(444),ee(335),ee(279),ee(169),"2vZiVLA","1287DSJSxR",ee(240),ee(251),ee(456),ee(477),ee(692),"96LHSqDE"];return(D=function(){return re})()}(function(){for(var ee=rn,re=y,te=b();;)try{if(parseInt(re(196))/1*(parseInt(re(200))/2)+-parseInt(re(209))/3*(parseInt(re(214))/4)+parseInt(re(212))/5+parseInt(re(193))/6*(-parseInt(re(204))/7)+parseInt(re(203))/8+parseInt(re(192))/9*(parseInt(re(198))/10)+-parseInt(re(191))/11==844014)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te.shift())}})(),(o=s||(s={}))[(p=y)(210)]=p(210),o[p(194)]=p(194),o[p(211)]=p(211),o[t(773)]=p(206),o[p(207)]=p(207),o[p(197)]=p(197),o[p(205)]=t(143),o.UNHANDLED=p(213),u=y,(i=c||(c={}))[i.OK=200]="OK",i[i[u(199)]=400]=u(199),i[i[u(202)]=404]=u(202),i[i[u(208)]=500]=t(378),i[i[u(201)]=408]=u(201),i[i[u(195)]=401]=u(195),(function(){for(var ee=t,re=k,te=m();;)try{if(-parseInt(re(211))/1+-parseInt(re(209))/2*(parseInt(re(210))/3)+-parseInt(re(212))/4*(parseInt(re(207))/5)+-parseInt(re(204))/6+-parseInt(re(206))/7*(parseInt(re(203))/8)+-parseInt(re(208))/9+parseInt(re(214))/10==660557)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),h=k,(f=I||(I={}))[t(577)]=h(205),f[h(213)]=t(205),(function(){for(var ee=t,re=O,te=E();;)try{if(parseInt(re(167))/1+parseInt(re(175))/2+parseInt(re(178))/3+parseInt(re(176))/4*(-parseInt(re(172))/5)+-parseInt(re(170))/6+-parseInt(re(171))/7*(-parseInt(re(168))/8)+parseInt(re(174))/9==266134)break;te[ee(795)](te.shift())}catch{te[ee(795)](te.shift())}})(),(l=v||(v={}))[(d=O)(166)]=d(173),l[d(169)]=d(177),(function(){for(var ee=t,re=w,te=D();;)try{if(parseInt(re(479))/1*(-parseInt(re(485))/2)+parseInt(re(478))/3*(parseInt(re(477))/4)+parseInt(re(481))/5*(-parseInt(re(475))/6)+parseInt(re(482))/7*(parseInt(re(474))/8)+parseInt(re(472))/9*(parseInt(re(476))/10)+-parseInt(re(484))/11*(parseInt(re(480))/12)+-parseInt(re(483))/13*(parseInt(re(473))/14)==639293)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();const T=N;(function(){var ee=t;const re=N,te=U();for(;;)try{if(parseInt(re(494))/1+parseInt(re(487))/2*(-parseInt(re(497))/3)+-parseInt(re(485))/4*(parseInt(re(483))/5)+-parseInt(re(488))/6+parseInt(re(484))/7*(-parseInt(re(499))/8)+parseInt(re(469))/9*(-parseInt(re(480))/10)+parseInt(re(468))/11==507588)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();const g={isRequired:ee=>ee+T(475),isUndefined:ee=>ee+T(492),isInvalid:ee=>ee+T(490),unableToFind:ee=>T(466)+ee+".",notLoaded:ee=>T(473)+ee+"."};class C extends Error{constructor(re,te,ne=!1){var ie=t;const oe=T;let se=te;switch(re){case s[oe(491)]:se=g[oe(470)](te);break;case s[oe(479)]:se=g.isInvalid(te);break;case s[oe(486)]:se=g[oe(476)](te);break;case s[ie(563)]:se=g[oe(495)](te);break;case s[oe(481)]:se=g[oe(493)](te);break;case s[ie(454)]:se=oe(478)+te;break;case s[oe(471)]:se=oe(496)+te;break;case s[oe(477)]:default:se=oe(474)+te}var ae,ue,ce;super(se),ae=this,ce=void 0,(ue=oe(482))in ae?Object[N(489)](ae,ue,{value:ce,enumerable:!0,configurable:!0,writable:!0}):ae[ue]=ce,Object[oe(472)](this,new.target.prototype),this[oe(467)]=re,this[oe(482)]=ne,Error[oe(498)](this)}}function N(ee,re){const te=U();return(N=function(ne,ie){return te[ne-=466]})(ee,re)}function U(){var ee=t;const re=[ee(348),ee(524),ee(442),ee(143),ee(713),"Failed to load the ",ee(750)," is required.",ee(417),ee(192),ee(671),ee(328),ee(164),ee(773),ee(257),ee(645),ee(358),ee(784),"UNDEFINED","618834PMzmgD",ee(519),ee(520),ee(290),ee(656),ee(398),"notLoaded",ee(218),"unableToFind","[TIMEOUT]: ",ee(357),"captureStackTrace",ee(223),ee(188),ee(321)];return(U=function(){return re})()}function A(ee,re){var te=x();return(A=function(ne,ie){return te[ne-=363]})(ee,re)}function x(){var ee=t,re=[ee(699),"10296792NSbaBf",ee(144),ee(237),ee(713),ee(171),"3JrHjWm",ee(467),ee(520),ee(239),"httpCode",ee(390),ee(590),ee(280),ee(303)];return(x=function(){return re})()}(function(){for(var ee=t,re=A,te=x();;)try{if(parseInt(re(365))/1*(-parseInt(re(374))/2)+-parseInt(re(368))/3*(-parseInt(re(367))/4)+-parseInt(re(373))/5*(-parseInt(re(376))/6)+parseInt(re(375))/7+-parseInt(re(377))/8*(parseInt(re(371))/9)+parseInt(re(369))/10+parseInt(re(363))/11==917605)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te.shift())}})();const R=P;function S(){var ee=t;const re=[ee(683),ee(336),ee(629),ee(541),ee(446),"143705UhzlIi",ee(141),ee(193),ee(176),ee(147),ee(674),ee(688),ee(234),ee(173),ee(406),ee(606),"940hBWQzM"];return(S=function(){return re})()}function P(ee,re){const te=S();return(P=function(ne,ie){return te[ne-=127]})(ee,re)}(function(){var ee=t;const re=P,te=S();for(;;)try{if(parseInt(re(139))/1*(-parseInt(re(140))/2)+parseInt(re(127))/3*(parseInt(re(142))/4)+-parseInt(re(137))/5+-parseInt(re(141))/6+-parseInt(re(129))/7+-parseInt(re(143))/8*(parseInt(re(134))/9)+-parseInt(re(133))/10*(-parseInt(re(128))/11)==195235)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();class L{static[R(135)](re){const te=R,ne=new URLSearchParams(re),ie={};return ne[te(136)](((oe,se)=>{var ae=rn;const ue=te;ie[se]?Array[ue(130)](ie[se])?ie[se][ae(795)](oe):ie[se]=[ie[se],oe]:ie[se]=oe})),ie}static parseObject(re){return this[R(135)](re)}static[R(131)](re){const te=R,ne=new URLSearchParams;for(const ie in re){const oe=re[ie];if(Array[te(130)](oe))for(const se of oe)ne[te(132)](ie,se);else ne[te(132)](ie,oe?oe[te(138)]():"")}return ne[te(138)]()}}const j=z;function z(ee,re){const te=F();return(z=function(ne,ie){return te[ne-=358]})(ee,re)}(function(){var ee=t;const re=z,te=F();for(;;)try{if(parseInt(re(368))/1+parseInt(re(367))/2*(parseInt(re(361))/3)+-parseInt(re(371))/4+-parseInt(re(358))/5*(-parseInt(re(370))/6)+parseInt(re(362))/7*(parseInt(re(366))/8)+parseInt(re(363))/9*(parseInt(re(364))/10)+-parseInt(re(372))/11==832538)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();const H={endpoints:{tokenizer:t(427),reveal:j(365)},domians:{cdn:{production:j(369),sandbox:"https://tokenizer-web-tst.cc.astropay.com"},api:{production:j(359),sandbox:j(360)}}};function F(){var ee=t;const re=[ee(393),ee(786),ee(471),"107952fYoopL",ee(644),ee(565),"5250978IBLHHK","2968388TUhYeT",ee(236),ee(537),ee(200),ee(158),ee(317),ee(780),ee(677)];return(F=function(){return re})()}const Q=Z;function Z(ee,re){const te=B();return(Z=function(ne,ie){return te[ne-=466]})(ee,re)}(function(){var ee=t;const re=Z,te=B();for(;;)try{if(parseInt(re(475))/1+parseInt(re(466))/2*(-parseInt(re(472))/3)+parseInt(re(471))/4+-parseInt(re(467))/5*(parseInt(re(473))/6)+parseInt(re(474))/7*(-parseInt(re(469))/8)+-parseInt(re(470))/9*(-parseInt(re(477))/10)+-parseInt(re(476))/11==221555)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te.shift())}})();const G={environment:v[Q(468)],version:t(611)};function B(){var ee=t;const re=["50qDamSZ",ee(568),"44535lKGnAe",ee(622),"1198616psasvq","544302QFKtCW","162808fuaUJw","234726FeLlSb",ee(798),ee(662),ee(469),ee(623)];return(B=function(){return re})()}function q(){var ee=t;const re=["946575WsgUvq",ee(268),ee(533),"12681sdIGeC",ee(635),"4355436uZDbJG","24iPqPHQ",ee(592),ee(351),ee(418),ee(166)];return(q=function(){return re})()}function J(ee,re){const te=q();return(J=function(ne,ie){return te[ne-=155]})(ee,re)}(function(){var ee=t;const re=J,te=q();for(;;)try{if(parseInt(re(162))/1*(parseInt(re(155))/2)+parseInt(re(157))/3+-parseInt(re(159))/4+parseInt(re(160))/5*(-parseInt(re(163))/6)+-parseInt(re(158))/7*(parseInt(re(164))/8)+parseInt(re(161))/9*(parseInt(re(156))/10)+parseInt(re(165))/11==451934)break;te[ee(795)](te.shift())}catch{te.push(te[ee(189)]())}})();let Y=G;const V=()=>Y,W=M;function M(ee,re){const te=K();return(M=function(ne,ie){return te[ne-=379]})(ee,re)}(function(){var ee=t;const re=M,te=K();for(;;)try{if(parseInt(re(384))/1+-parseInt(re(389))/2+-parseInt(re(383))/3*(-parseInt(re(387))/4)+parseInt(re(388))/5+-parseInt(re(381))/6*(parseInt(re(385))/7)+-parseInt(re(382))/8+parseInt(re(379))/9*(parseInt(re(386))/10)==645524)break;te[ee(795)](te.shift())}catch{te[ee(795)](te.shift())}})();const X=(ee,re)=>ee[W(380)](new RegExp(re+"$"),"");function K(){var ee=t;const re=[ee(306),ee(288),ee(372),ee(155),ee(232),ee(632),"83594fyhqnZ",ee(730),ee(399),"3139375mafbsW",ee(607)];return(K=function(){return re})()}const _=tt;function $(){var ee=t;const re=[ee(535),ee(602),ee(582),ee(266),ee(416),ee(172),"11uyatGf",ee(402),ee(269),"6nfgxja",ee(698),ee(150),ee(219),"domians",ee(363),ee(790),ee(720),ee(501),ee(215)];return($=function(){return re})()}function tt(ee,re){const te=$();return(tt=function(ne,ie){return te[ne-=110]})(ee,re)}(function(){var ee=t;const re=tt,te=$();for(;;)try{if(parseInt(re(124))/1+-parseInt(re(128))/2+parseInt(re(119))/3*(parseInt(re(127))/4)+parseInt(re(111))/5*(parseInt(re(117))/6)+parseInt(re(112))/7*(-parseInt(re(118))/8)+parseInt(re(120))/9*(-parseInt(re(125))/10)+parseInt(re(114))/11*(parseInt(re(110))/12)==961663)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();class nt{static get[_(113)](){const re=_;return X(H[re(121)][re(123)][V()[re(126)]],"/")}static get[_(116)](){const re=_;return X(H[re(121)][re(122)][V()[re(126)]],"/")}static[t(241)](re,te,ne){var ie=t;const oe=_,se=L[ie(406)](ne??{}),ae=V(),ue=se?te[ie(636)]("?")?"&":"?":"";return nt[oe(113)]+"/"+re+"/"+ae[oe(115)]+"/"+te+ue+se}}var rt=at;function et(){var ee=t,re=[ee(559),ee(634),ee(630),ee(739),ee(548),ee(503),ee(436),ee(480),ee(404),"1042584XPmVvk",ee(172),ee(473),ee(289),ee(745),"json",ee(795),"2166WIGGYn",ee(438),ee(385),ee(606),ee(629),"173LKkRgC",ee(391),ee(498),ee(282),ee(614),ee(710),ee(247),ee(621),ee(255),"14XmrYdp",ee(182),ee(735),ee(504),"Bearer ",ee(697),ee(694),ee(474),"abort","defineProperty",ee(321),ee(680),ee(496),ee(587),ee(309),ee(344),ee(406),ee(248),"status",ee(542),ee(386),"keys",ee(586)];return(et=function(){return re})()}function at(ee,re){var te=et();return(at=function(ne,ie){return te[ne-=115]})(ee,re)}(function(){for(var ee=t,re=at,te=et();;)try{if(-parseInt(re(126))/1*(-parseInt(re(121))/2)+-parseInt(re(160))/3*(-parseInt(re(130))/4)+parseInt(re(140))/5*(-parseInt(re(123))/6)+parseInt(re(135))/7*(parseInt(re(167))/8)+-parseInt(re(158))/9+parseInt(re(159))/10+parseInt(re(157))/11==336922)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),rt(146),rt(164),rt(166);var st=ot;function ot(ee,re){var te=pt();return(ot=function(ne,ie){return te[ne-=291]})(ee,re)}(function(){for(var ee=t,re=ot,te=pt();;)try{if(-parseInt(re(301))/1+parseInt(re(307))/2+-parseInt(re(292))/3*(-parseInt(re(306))/4)+parseInt(re(291))/5+-parseInt(re(314))/6*(-parseInt(re(300))/7)+-parseInt(re(302))/8*(parseInt(re(303))/9)+-parseInt(re(293))/10==616185)break;te.push(te[ee(189)]())}catch{te.push(te[ee(189)]())}})(),t(597),st(294),t(779),st(305),st(296),st(315);function pt(){var ee=t,re=[ee(208),ee(302),"336OqQgfm",ee(755),ee(494),ee(423),ee(647),"1179086uaDkqa",ee(752),"emit","message",ee(756),ee(190),ee(520),ee(148),ee(546),ee(216),ee(779),ee(450),"listener",ee(319),ee(654),ee(407),ee(212),ee(162),ee(448),ee(440),ee(525),ee(310)];return(pt=function(){return re})()}function ct(){var ee=t;const re=[ee(676),ee(331),ee(362),"2228304EqXFLn",ee(512),ee(778),ee(387),ee(721),ee(673),"207AHFLGs",ee(376),ee(425)];return(ct=function(){return re})()}function it(ee,re){const te=ct();return(it=function(ne,ie){return te[ne-=254]})(ee,re)}(function(){var ee=t;const re=it,te=ct();for(;;)try{if(parseInt(re(257))/1+parseInt(re(260))/2+parseInt(re(254))/3*(-parseInt(re(261))/4)+parseInt(re(262))/5+-parseInt(re(258))/6+parseInt(re(256))/7+-parseInt(re(263))/8*(parseInt(re(264))/9)==716064)break;te[ee(795)](te.shift())}catch{te[ee(795)](te[ee(189)]())}})();const ut=function(ee){var re=t;const te=it,ne=document[re(414)]||document[te(259)];if(!ne)throw new C(s[re(563)],te(255),!0);return ne[te(265)](ee),ee};(function(){var ee=t;const re=ft,te=ht();for(;;)try{if(parseInt(re(128))/1+parseInt(re(125))/2+-parseInt(re(127))/3+parseInt(re(132))/4+-parseInt(re(131))/5+parseInt(re(133))/6+-parseInt(re(134))/7==688465)break;te.push(te[ee(189)]())}catch{te[ee(795)](te.shift())}})();const It=function(ee,re){const te=ft,ne=document.createElement(te(126));ne[te(129)]=ee,ne[te(130)]=re,ut(ne)};function ft(ee,re){const te=ht();return(ft=function(ne,ie){return te[ne-=125]})(ee,re)}function ht(){var ee=t;const re=["2178600xJfnAD",ee(771),ee(259),ee(225),ee(610),ee(646),ee(691),ee(556),ee(588),"18738601iJYruu"];return(ht=function(){return re})()}function vt(){var ee=t,re=[ee(608),ee(186),ee(570),ee(376),ee(652),ee(301),"10439181hcqJpc",ee(593),ee(434),ee(441),"createTextNode",ee(695),ee(250),ee(604),"ctr",ee(665),ee(785),"9136jiXoxV",ee(238),ee(203),ee(324),ee(723),ee(177),ee(278),"insertRule",ee(540),"nonce",ee(670),"flush",ee(767),"forEach","7294661PRwxon",ee(774),ee(742),ee(159),"ownerNode",ee(795),ee(255),"2555lCYkVH",ee(252),ee(684),ee(481)];return(vt=function(){return re})()}function lt(ee,re){var te=vt();return(lt=function(ne,ie){return te[ne-=379]})(ee,re)}(function(){for(var ee=t,re=lt,te=vt();;)try{if(parseInt(re(413))/1*(-parseInt(re(412))/2)+-parseInt(re(382))/3+-parseInt(re(381))/4*(-parseInt(re(387))/5)+parseInt(re(411))/6+parseInt(re(390))/7*(parseInt(re(408))/8)+parseInt(re(397))/9+-parseInt(re(404))/10*(parseInt(re(380))/11)==960039)break;te.push(te.shift())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){var ee=t,re=lt;function te(ie){var oe=rn,se=lt,ae=this;this[oe(203)]=function(ue){var ce,le=oe,de=lt;ce=ae[de(391)][de(386)]===0?ae[de(402)]?ae[de(402)][de(409)]:ae[de(406)]?ae[de(389)][de(396)]:ae[de(400)]:ae[de(391)][ae[de(391)][de(386)]-1][le(238)],ae[de(389)][de(414)](ue,ce),ae[de(391)][de(385)](ue)},this[se(403)]=ie[se(383)]===void 0||ie[se(383)],this[se(391)]=[],this.ctr=0,this[se(417)]=ie[oe(318)],this[se(398)]=ie[se(398)],this[se(389)]=ie[oe(684)],this[se(406)]=ie[se(406)],this[se(402)]=ie[se(402)],this.before=null}var ne=te[ee(332)];ne[re(407)]=function(ie){var oe=ee;ie[re(379)](this[oe(203)])},ne[ee(258)]=function(ie){var oe,se,ae,ue=ee,ce=re;this[ce(405)]%(this[ce(403)]?65e3:1)==0&&this[ce(410)]((oe=this,se=lt,(ae=document[se(416)](ue(156)))[se(399)](se(420),oe[se(398)]),oe[se(417)]!==void 0&&ae[ue(434)](ue(318),oe[ue(318)]),ae[se(394)](document[se(401)]("")),ae[se(399)](se(388),""),ae));var le=this[ue(608)][this[ce(391)][ce(386)]-1];if(this[ce(403)]){var de=(function(fe){var he=ue,pe=lt;if(fe[pe(392)])return fe.sheet;for(var ge=0;ge<document[pe(395)][pe(386)];ge++)if(document[pe(395)][ge][pe(384)]===fe)return document[he(652)][ge]})(le);try{de[ce(415)](ie,de[ce(418)][ce(386)])}catch{}}else le[ce(394)](document[ue(550)](ie));this.ctr++},ne[re(419)]=function(){var ie=ee,oe=re;this[oe(391)][ie(629)]((function(se){var ae,ue=oe;return(ae=se.parentNode)==null?void 0:ae[ue(393)](se)})),this[oe(391)]=[],this[ie(397)]=0}})();var dt=bt;function bt(ee,re){var te=yt();return(bt=function(ne,ie){return te[ne-=110]})(ee,re)}function yt(){var ee=t,re=[ee(196),"152336OQhHhe",ee(420),ee(492),ee(783),ee(770),ee(349),ee(204),ee(598),ee(178),ee(401),ee(650),"4724nuSFUK",ee(439),ee(736),"@page",ee(613),ee(619),ee(443),"@layer",ee(174)];return(yt=function(){return re})()}(function(){for(var ee=t,re=bt,te=yt();;)try{if(-parseInt(re(119))/1+-parseInt(re(123))/2*(-parseInt(re(124))/3)+-parseInt(re(129))/4*(parseInt(re(122))/5)+-parseInt(re(114))/6+-parseInt(re(115))/7+parseInt(re(112))/8+parseInt(re(117))/9==198272)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),t(648),dt(121),t(700),t(600),dt(113),dt(126),dt(116),dt(118),dt(110),dt(111),dt(120),dt(128),dt(125),dt(127),dt(130);var kt=mt;function mt(ee,re){var te=Ot();return(mt=function(ne,ie){return te[ne-=258]})(ee,re)}function Ot(){var ee=t,re=[ee(347),ee(371),ee(260),ee(288),ee(227),ee(409),ee(255),ee(795),ee(246),"10opKczI","charCodeAt",ee(733),ee(377),ee(428),ee(738),ee(281),ee(296),ee(510),ee(381),ee(464),"3836294AMJKLE"];return(Ot=function(){return re})()}function Et(){var ee=t,re=[ee(327),ee(255),ee(566),ee(334),ee(323),"14ejudnZ",ee(201),"862542dyuBTR",ee(552),"401898SBLqqH",ee(184),ee(705)];return(Et=function(){return re})()}function wt(ee,re){var te=Et();return(wt=function(ne,ie){return te[ne-=123]})(ee,re)}function Dt(ee,re){var te=Tt();return(Dt=function(ne,ie){return te[ne-=435]})(ee,re)}function Tt(){var ee=t,re=["680775fQHTmS",ee(364),ee(493),ee(528),ee(206),ee(669),"3255819aCtDxV",ee(447),ee(187)];return(Tt=function(){return re})()}function gt(){var ee=t,re=[ee(458),"2134996QawHcC","return",ee(693),ee(558),"15490080Hutsfa",ee(496),ee(228),ee(216),ee(346),ee(255),"1837002hgOqZq",ee(531),ee(516),ee(484),"join"];return(gt=function(){return re})()}function Ct(ee,re){var te=gt();return(Ct=function(ne,ie){return te[ne-=147]})(ee,re)}function Nt(ee,re){var te=Ut();return(Nt=function(ne,ie){return te[ne-=398]})(ee,re)}function Ut(){var ee=t,re=[ee(551),"input-$1",ee(273),ee(468),"root",ee(749),ee(287),ee(567),ee(772),ee(549),ee(716),ee(346),"global",ee(229),ee(294),"1314449boGmmT",ee(527),"4549375QrRZcY",ee(265),"type"];return(Ut=function(){return re})()}function At(){var ee=t,re=[ee(271),ee(209),ee(453),ee(734),ee(545),"has","476346BHUYta","478714FKDyOG",ee(760),ee(253)];return(At=function(){return re})()}function xt(ee,re){var te=At();return(xt=function(ne,ie){return te[ne-=484]})(ee,re)}function Rt(ee,re){var te=St();return(Rt=function(ne,ie){return te[ne-=236]})(ee,re)}function St(){var ee=t,re=[ee(584),"953666lBllkt",ee(564),"48PHUuVy",ee(437),ee(214),ee(627),ee(149),ee(272),ee(307),ee(483),ee(800),ee(370)];return(St=function(){return re})()}(function(){for(var ee=t,re=mt,te=Ot();;)try{if(-parseInt(re(259))/1*(parseInt(re(278))/2)+-parseInt(re(276))/3*(-parseInt(re(271))/4)+-parseInt(re(274))/5*(-parseInt(re(264))/6)+-parseInt(re(258))/7+-parseInt(re(263))/8+parseInt(re(261))/9*(-parseInt(re(268))/10)+parseInt(re(260))/11==402046)break;te[ee(795)](te.shift())}catch{te[ee(795)](te[ee(189)]())}})(),Math[kt(275)],String[kt(272)],Object[kt(273)],(function(){for(var ee=t,re=wt,te=Et();;)try{if(-parseInt(re(132))/1*(parseInt(re(123))/2)+-parseInt(re(125))/3+parseInt(re(129))/4+parseInt(re(134))/5*(parseInt(re(127))/6)+parseInt(re(126))/7*(parseInt(re(133))/8)+-parseInt(re(124))/9*(-parseInt(re(130))/10)+-parseInt(re(128))/11==366270)break;te[ee(795)](te.shift())}catch{te.push(te[ee(189)]())}})(),(function(){for(var ee=t,re=Dt,te=Tt();;)try{if(parseInt(re(439))/1+parseInt(re(443))/2*(parseInt(re(442))/3)+parseInt(re(441))/4*(parseInt(re(440))/5)+parseInt(re(438))/6+-parseInt(re(436))/7+parseInt(re(435))/8+-parseInt(re(437))/9==637765)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te.shift())}})(),(function(){for(var ee=t,re=Ct,te=gt();;)try{if(-parseInt(re(158))/1+-parseInt(re(150))/2+parseInt(re(149))/3+-parseInt(re(155))/4*(-parseInt(re(151))/5)+-parseInt(re(152))/6+-parseInt(re(161))/7*(-parseInt(re(157))/8)+parseInt(re(159))/9==746841)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){for(var ee=t,re=Nt,te=Ut();;)try{if(parseInt(re(398))/1+-parseInt(re(409))/2*(-parseInt(re(413))/3)+parseInt(re(405))/4+parseInt(re(400))/5+-parseInt(re(403))/6*(-parseInt(re(408))/7)+-parseInt(re(412))/8*(-parseInt(re(416))/9)+-parseInt(re(417))/10==921092)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te.shift())}})(),(function(){for(var ee=t,re=xt,te=At();;)try{if(parseInt(re(484))/1+-parseInt(re(485))/2*(-parseInt(re(490))/3)+parseInt(re(488))/4+parseInt(re(489))/5+parseInt(re(492))/6+-parseInt(re(486))/7*(parseInt(re(487))/8)+-parseInt(re(491))/9==521840)break;te.push(te[ee(189)]())}catch{te.push(te[ee(189)]())}})(),(function(){for(var ee=t,re=Rt,te=St();;)try{if(parseInt(re(246))/1*(parseInt(re(239))/2)+parseInt(re(248))/3*(-parseInt(re(241))/4)+parseInt(re(244))/5+-parseInt(re(236))/6*(parseInt(re(247))/7)+-parseInt(re(242))/8*(parseInt(re(243))/9)+-parseInt(re(238))/10+parseInt(re(237))/11*(parseInt(re(240))/12)==600322)break;te.push(te[ee(189)]())}catch{te.push(te[ee(189)]())}})();var Pt=Lt;function Lt(ee,re){var te=jt();return(Lt=function(ne,ie){return te[ne-=373]})(ee,re)}function jt(){var ee=t,re=[ee(485),ee(252),ee(684),ee(523),"column",ee(337),ee(515),ee(275),ee(159),ee(366),ee(332),ee(312),ee(197),ee(265),ee(321),ee(601),ee(752),ee(603),"$2-$3",ee(258),ee(534),ee(376),ee(769),ee(254),ee(392),ee(788),ee(216),ee(521),ee(295),ee(267),ee(255),"preferred-size",ee(629),"line",ee(181),ee(797),ee(593),ee(330),ee(288),"compat",ee(595),ee(186),ee(767),ee(384),ee(508),ee(339),"prepend","push",ee(503),ee(496),ee(472),ee(276),'style[data-emotion^="',ee(695),ee(346),ee(213),ee(789),ee(715),"head",ee(567),"448GdQtAv",ee(600),ee(711),ee(262),ee(509),ee(434),"flex-",ee(626),ee(318),ee(389),ee(560),ee(468),ee(463),ee(431),ee(781),"indexOf",ee(618),ee(207),ee(640)];return(jt=function(){return re})()}function zt(){var ee=t,re=[ee(320),ee(388),ee(405),ee(579),"35AIBzSb",ee(534),ee(505),ee(411),"1274024Vuuviq","length",ee(572),ee(478)];return(zt=function(){return re})()}function Ht(ee,re){var te=zt();return(Ht=function(ne,ie){return te[ne-=484]})(ee,re)}function Ft(ee,re){var te=Qt();return(Ft=function(ne,ie){return te[ne-=106]})(ee,re)}function Qt(){var ee=t,re=[ee(526),ee(340),ee(765),ee(703),ee(487),ee(489),ee(146),ee(639),ee(729),ee(664)];return(Qt=function(){return re})()}(function(){for(var ee=t,re=Lt,te=jt();;)try{if(parseInt(re(444))/1+parseInt(re(411))/2*(-parseInt(re(397))/3)+-parseInt(re(442))/4*(-parseInt(re(410))/5)+parseInt(re(416))/6+parseInt(re(394))/7*(-parseInt(re(375))/8)+parseInt(re(409))/9*(parseInt(re(373))/10)+-parseInt(re(377))/11*(parseInt(re(426))/12)==928149)break;te.push(te.shift())}catch{te[ee(795)](te[ee(189)]())}})(),Pt(387),(function(){for(var ee=t,re=Ht,te=zt();;)try{if(-parseInt(re(487))/1+parseInt(re(489))/2+-parseInt(re(495))/3*(parseInt(re(484))/4)+-parseInt(re(492))/5*(parseInt(re(493))/6)+parseInt(re(485))/7*(-parseInt(re(494))/8)+-parseInt(re(488))/9+parseInt(re(491))/10==772143)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){for(var ee=t,re=Ft,te=Qt();;)try{if(-parseInt(re(106))/1*(-parseInt(re(114))/2)+parseInt(re(115))/3*(parseInt(re(107))/4)+parseInt(re(112))/5+parseInt(re(110))/6+parseInt(re(108))/7+parseInt(re(109))/8+parseInt(re(113))/9*(-parseInt(re(111))/10)==797311)break;te[ee(795)](te[ee(189)]())}catch{te.push(te[ee(189)]())}})();var Zt=qt;function Gt(){var ee=t,re=["animationName","2256550Ipcodt",ee(173),"compiler transform.",ee(746),ee(462),ee(288),ee(801),ee(211),ee(500),ee(255),"number",ee(791),"NO_COMPONENT_SELECTOR","1182279EAtwWa",ee(682),ee(321),"1304688UcogLI",ee(247),"string",ee(569),"styles","45ISzOCs",ee(246),ee(777),ee(167),ee(672)];return(Gt=function(){return re})()}(function(){for(var ee=t,re=qt,te=Gt();;)try{if(-parseInt(re(249))/1+-parseInt(re(242))/2+parseInt(re(250))/3+parseInt(re(258))/4+-parseInt(re(248))/5*(parseInt(re(256))/6)+-parseInt(re(255))/7+parseInt(re(261))/8*(parseInt(re(236))/9)==662021)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();function qt(ee,re){var te=Gt();return(qt=function(ne,ie){return te[ne-=236]})(ee,re)}function Jt(ee,re){var te=Yt();return(Jt=function(ne,ie){return te[ne-=142]})(ee,re)}function Yt(){var ee=t,re=[ee(368),ee(305),"registered",ee(262),"styles",ee(255),ee(374),ee(629),ee(633),ee(615),ee(663),ee(753),ee(275),ee(802),"push",ee(593),ee(321),ee(491),ee(258),ee(666)];return(Yt=function(){return re})()}function Vt(){var ee=t,re=[ee(578),ee(321),ee(258),ee(629),ee(255),ee(449),ee(250),ee(333),ee(502),"bind",ee(573),"281145OZnPDr",ee(547),"3uNmnOL",ee(159),ee(186),ee(291),ee(275),ee(476),ee(593),ee(365),ee(173),ee(515),ee(753),"6198910frrjDN",ee(413),ee(300),"animation-",ee(195),ee(599),"object"];return(Vt=function(){return re})()}function Wt(ee,re){var te=Vt();return(Wt=function(ne,ie){return te[ne-=250]})(ee,re)}Object[Rt(245)](null),Zt(246),t(408),Zt(244),(function(){for(var ee=t,re=Jt,te=Yt();;)try{if(-parseInt(re(146))/1+-parseInt(re(155))/2+-parseInt(re(144))/3+-parseInt(re(157))/4+parseInt(re(156))/5*(parseInt(re(149))/6)+parseInt(re(153))/7*(parseInt(re(142))/8)+parseInt(re(145))/9==509549)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){for(var ee=t,re=Wt,te=Vt();;)try{if(parseInt(re(274))/1*(-parseInt(re(253))/2)+-parseInt(re(258))/3*(-parseInt(re(270))/4)+parseInt(re(256))/5*(parseInt(re(273))/6)+parseInt(re(250))/7+-parseInt(re(276))/8*(parseInt(re(261))/9)+parseInt(re(269))/10*(parseInt(re(263))/11)+-parseInt(re(257))/12==769621)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();const Mt=$t;function Xt(){var ee=t;const re=[ee(191),ee(751),"toCamelCase",ee(446),ee(325),ee(210),"toPascalCase",ee(284),ee(154),ee(726),ee(288),ee(617),ee(768),ee(343),ee(394),"4804168lIEQdb",ee(410),ee(539),ee(430),ee(678),ee(353),"_lowerCase",ee(596),ee(733),ee(518),"charAt",ee(687),ee(527),ee(262),"42wLrOPC",ee(285),"toLowerCase",ee(470),ee(514)];return(Xt=function(){return re})()}function Kt(ee,re,te){return re in ee?Object.defineProperty(ee,re,{value:te,enumerable:!0,configurable:!0,writable:!0}):ee[re]=te,ee}(function(){var ee=t;const re=$t,te=Xt();for(;;)try{if(-parseInt(re(224))/1+parseInt(re(230))/2+-parseInt(re(242))/3*(parseInt(re(238))/4)+-parseInt(re(236))/5+-parseInt(re(228))/6*(-parseInt(re(252))/7)+-parseInt(re(240))/8+parseInt(re(227))/9==959733)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te.shift())}})();class _t{static[Mt(241)](re,te=!1){const ne=Mt;return te?this[ne(239)](re)[ne(253)](" ")[ne(241)]():re[ne(241)]()}static[t(429)](re,te=!1){var ne=t;const ie=Mt;return te?this[ie(244)](re)[ie(233)](/ /g," "):re[ne(429)]()}static[t(741)](re){const te=Mt;return this[te(249)](te(241))(re)}static[Mt(234)](re){const te=Mt;return this[te(249)](te(220))(re)}static[Mt(225)](re){var te=t;const ne=Mt;return this[ne(239)](re)[te(527)](((ie,oe)=>oe===0?ie[te(429)]():this[ne(222)](ie[ne(220)]())))[ne(253)]("")}static[Mt(229)](re){var te=t;const ne=Mt;return this._startCase(this[ne(225)](re))[te(288)](/ /g,"")}static[Mt(243)](re){const te=Mt;return this[te(239)](re)[te(253)]("-")}static[t(761)](re){const te=Mt;return this[t(410)](re)[te(253)]("_")}static[Mt(245)](re){return this[Mt(244)](re).replace(/ /g,".")}static[Mt(221)](re){const te=Mt;return this[te(222)](this[te(244)](re))}static toSlugCase(re){const te=Mt;return this[te(244)](re)[te(233)](/ /g,"-")}static[Mt(237)](re){return this[Mt(239)](re)}static[Mt(239)](re){const te=Mt;return re[te(233)](/([a-z])([A-Z])/g,te(231))[te(233)](/[\s_-]+/g," ")[te(220)]()[te(247)](/[a-zà-öø-ÿ0-9]+/gi)||[]}static[t(538)](re){var te=t;const ne=Mt;return this[ne(239)](re)[te(527)]((ie=>ie[ne(220)]()))[ne(253)](" ")}static[Mt(222)](re){const te=Mt;return re[te(248)](0)[te(241)]()+re[te(246)](1)[te(220)]()}static _startCase(re){const te=Mt;return this[t(410)](re)[te(250)]((ne=>this[te(222)](ne)))[te(253)](" ")}}function $t(ee,re){const te=Xt();return($t=function(ne,ie){return te[ne-=220]})(ee,re)}Kt(_t,t(748),((ee,re=!1,{splitChar:te=" ",joinChar:ne=" ",to:ie=Mt(223)}={splitChar:" ",joinChar:" ",to:Mt(223)})=>{const oe=Mt,se=ee!==void 0?ee[oe(226)]():"";return se?re?_t[oe(235)](se):se[oe(251)](te).map((ae=>{var ue=rn;const ce=oe;return ie===ce(232)?ae[ce(248)](0)[ue(571)]()+ae[ce(246)](1)[ue(429)]():ae[ce(248)](0).toUpperCase()+ae[ce(246)](1)[ce(220)]()}))[oe(253)](ne):""})),Kt(_t,Mt(249),(ee=>re=>{var te=t;const ne=Mt;if(!re)return"";const ie=re[ne(246)](0,1),oe=re[ne(246)](1);return ie[ee]!==void 0&&te(672)==typeof ie[ee]?ie[ee]()+oe:re}));const tn=nn;function nn(ee,re){const te=en();return(nn=function(ne,ie){return te[ne-=328]})(ee,re)}function rn(ee,re){var te=e();return(rn=function(ne,ie){return te[ne-=141]})(ee,re)}function en(){var ee=t;const re=[ee(460),ee(638),"pascal",ee(620),ee(152),ee(353),"object",ee(796),ee(719),ee(761),ee(536),ee(222),ee(758),ee(356),ee(747),ee(704),ee(527),ee(194),ee(681),ee(561)];return(en=function(){return re})()}(function(){var ee=t;const re=nn,te=en();for(;;)try{if(parseInt(re(337))/1*(parseInt(re(342))/2)+-parseInt(re(329))/3+parseInt(re(346))/4+parseInt(re(345))/5+-parseInt(re(341))/6+-parseInt(re(333))/7*(-parseInt(re(339))/8)+-parseInt(re(330))/9==892829)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),t(681),tn(332);function an(){var ee=t;const re=[ee(314),ee(249),ee(764),ee(792),"7920680CrCzXO",ee(776),"kebab",ee(532),ee(400),"1889976zPDrSf",ee(681),ee(165),"574270pCgwUB"];return(an=function(){return re})()}function sn(ee,re){const te=an();return(sn=function(ne,ie){return te[ne-=199]})(ee,re)}function on(ee,re){const te=pn();return(on=function(ne,ie){return te[ne-=310]})(ee,re)}function pn(){var ee=t;const re=["strategy","5941134AnJjDR",ee(435),"REQUIRED",ee(403),ee(298),ee(507),ee(277),ee(304),ee(185),ee(217),"168yAApGZ","210166RwrXjV",ee(288),"replacer",ee(660),ee(341),ee(431),ee(422),ee(497),"parameters.search"];return(pn=function(){return re})()}function cn(ee,re){const te=un();return(cn=function(ne,ie){return te[ne-=245]})(ee,re)}function un(){var ee=t;const re=[ee(757),ee(288),"749930AnkLQM",ee(345),ee(475),ee(244),ee(395),ee(316),"77UAdnad",ee(161),ee(245),ee(446),ee(286),ee(725)];return(un=function(){return re})()}function In(){var ee=t;const re=[ee(235),ee(583),ee(580),ee(224),ee(355),ee(787),ee(653),ee(256),ee(612),"90faVQnR",ee(486)];return(In=function(){return re})()}function fn(ee,re){const te=In();return(fn=function(ne,ie){return te[ne-=199]})(ee,re)}function hn(){var ee=t;const re=["location",ee(728),ee(574),"2xpcQKU","push","768628jYCGxS",ee(756),"24FLVsmp",ee(752),ee(293),"978200aOzrna",ee(488),"63KlvtSY",ee(277),ee(553),ee(231),ee(679),ee(336),ee(507),ee(422),ee(527)];return(hn=function(){return re})()}function vn(ee,re){const te=hn();return(vn=function(ne,ie){return te[ne-=482]})(ee,re)}function ln(ee,re){const te=dn();return(ln=function(ne,ie){return te[ne-=252]})(ee,re)}function dn(){var ee=t;const re=[ee(759),ee(605),ee(261),ee(585),ee(790),ee(383),ee(637),"104DOhoZO","preconnect",ee(215),ee(175),"5jiSoDi",ee(658)];return(dn=function(){return re})()}(function(){var ee=t;const re=sn,te=an();for(;;)try{if(parseInt(re(206))/1*(-parseInt(re(208))/2)+-parseInt(re(199))/3*(parseInt(re(210))/4)+parseInt(re(204))/5+-parseInt(re(201))/6+-parseInt(re(200))/7+parseInt(re(209))/8+parseInt(re(205))/9==606311)break;te[ee(795)](te[ee(189)]())}catch{te.push(te[ee(189)]())}})(),(function(){var ee=t;const re=on,te=pn();for(;;)try{if(parseInt(re(317))/1*(-parseInt(re(321))/2)+-parseInt(re(314))/3*(parseInt(re(319))/4)+parseInt(re(325))/5*(-parseInt(re(310))/6)+-parseInt(re(313))/7*(-parseInt(re(320))/8)+-parseInt(re(324))/9+parseInt(re(328))/10+parseInt(re(311))/11==808336)break;te.push(te[ee(189)]())}catch{te.push(te[ee(189)]())}})(),(function(){var ee=t;const re=cn,te=un();for(;;)try{if(-parseInt(re(252))/1+-parseInt(re(249))/2*(-parseInt(re(257))/3)+parseInt(re(254))/4+-parseInt(re(253))/5*(-parseInt(re(258))/6)+parseInt(re(246))/7+-parseInt(re(245))/8*(parseInt(re(250))/9)+-parseInt(re(256))/10*(parseInt(re(248))/11)==300232)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){var ee=t;const re=fn,te=In();for(;;)try{if(-parseInt(re(200))/1*(parseInt(re(203))/2)+parseInt(re(209))/3+parseInt(re(202))/4+-parseInt(re(206))/5*(parseInt(re(201))/6)+-parseInt(re(199))/7*(parseInt(re(208))/8)+parseInt(re(207))/9*(parseInt(re(205))/10)+parseInt(re(204))/11==198596)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){var ee=t;const re=vn,te=hn();for(;;)try{if(parseInt(re(488))/1+-parseInt(re(497))/2*(parseInt(re(496))/3)+-parseInt(re(501))/4*(parseInt(re(487))/5)+-parseInt(re(482))/6+parseInt(re(499))/7+-parseInt(re(495))/8+-parseInt(re(485))/9*(-parseInt(re(483))/10)==155517)break;te[ee(795)](te.shift())}catch{te[ee(795)](te.shift())}})(),(function(){var ee=t;const re=ln,te=dn();for(;;)try{if(parseInt(re(254))/1+parseInt(re(257))/2+parseInt(re(260))/3+-parseInt(re(252))/4*(-parseInt(re(253))/5)+-parseInt(re(258))/6+parseInt(re(256))/7+parseInt(re(262))/8*(-parseInt(re(261))/9)==402722)break;te[ee(795)](te.shift())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){var ee=t;const re=bn,te=yn();for(;;)try{if(parseInt(re(397))/1*(-parseInt(re(389))/2)+-parseInt(re(394))/3*(parseInt(re(383))/4)+parseInt(re(391))/5+-parseInt(re(384))/6*(-parseInt(re(388))/7)+parseInt(re(382))/8*(-parseInt(re(393))/9)+parseInt(re(386))/10+parseInt(re(392))/11==453357)break;te[ee(795)](te.shift())}catch{te[ee(795)](te[ee(189)]())}})();function bn(ee,re){const te=yn();return(bn=function(ne,ie){return te[ne-=382]})(ee,re)}function yn(){var ee=t;const re=[ee(581),ee(589),ee(702),ee(759),"api","9885ktAjwX","515144gJwABd",ee(461),ee(352),ee(455),ee(709),"environment",ee(782),ee(360),ee(790),ee(609)];return(yn=function(){return re})()}function kn(ee,re){const te=mn();return(kn=function(ne,ie){return te[ne-=188]})(ee,re)}function mn(){var ee=t;const re=[ee(513),ee(744),ee(230),ee(151),ee(354),ee(170),ee(638),"42ZfbLkm",ee(529),ee(527),"length",ee(656),ee(793),ee(328),ee(479),ee(737),"84AZtHRP"];return(mn=function(){return re})()}(function(){var ee=t;const re=kn,te=mn();for(;;)try{if(parseInt(re(200))/1*(-parseInt(re(191))/2)+parseInt(re(195))/3*(-parseInt(re(193))/4)+-parseInt(re(196))/5*(parseInt(re(192))/6)+-parseInt(re(188))/7+-parseInt(re(203))/8+-parseInt(re(190))/9*(parseInt(re(189))/10)+parseInt(re(202))/11*(parseInt(re(204))/12)==863321)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();const On=En;function En(ee,re){const te=Tn();return(En=function(ne,ie){return te[ne-=135]})(ee,re)}(function(){var ee=t;const re=En,te=Tn();for(;;)try{if(-parseInt(re(139))/1*(parseInt(re(147))/2)+-parseInt(re(142))/3+-parseInt(re(140))/4+-parseInt(re(143))/5*(-parseInt(re(148))/6)+parseInt(re(137))/7*(parseInt(re(141))/8)+-parseInt(re(138))/9+-parseInt(re(136))/10*(-parseInt(re(145))/11)==902131)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();const wn={environment:ee=>typeof ee===On(146)&&/^(sandbox|production)$/[t(690)](ee),version:ee=>ee===On(144)||typeof ee===On(146)&&/^v\d{1,2}(\.\d{0,3}){0,3}$/[On(135)](ee)},Dn=ee=>{var re;((te,ne)=>{var ie=t;const oe=kn;if(te&&ne){const se=Object[ie(359)](te)[ie(422)]((ae=>!ne[oe(194)](ae)||ne[ae]===void 0||!te[ae](ne[ae])))[oe(197)]((ae=>new C(s[oe(201)],ae,!0)));if(se[oe(198)]){const[ae]=se;throw ae}}})(wn,ee),(re=ee)&&(Y=Object.assign({},Y,re))};function Tn(){var ee=t;const re=[ee(591),ee(576),ee(611),"4202RbmDMY",ee(445),ee(727),ee(517),ee(690),ee(624),ee(292),ee(717),ee(299),"1611912xHkDlR",ee(452)];return(Tn=function(){return re})()}function gn(){var ee=t;const re=[ee(379),ee(380),ee(686),ee(522),"248VddyCN","1828569LfJoFC","11940faSemP",ee(661),ee(482),"9YYlhsV",ee(457),ee(651),ee(375),ee(255),ee(641),ee(160)];return(gn=function(){return re})()}(function(){var ee=t;const re=Cn,te=gn();for(;;)try{if(-parseInt(re(271))/1*(-parseInt(re(278))/2)+-parseInt(re(275))/3+-parseInt(re(274))/4*(-parseInt(re(266))/5)+-parseInt(re(280))/6*(-parseInt(re(272))/7)+parseInt(re(277))/8*(-parseInt(re(279))/9)+parseInt(re(269))/10*(-parseInt(re(270))/11)+-parseInt(re(276))/12*(-parseInt(re(268))/13)==356241)break;te[ee(795)](te.shift())}catch{te[ee(795)](te.shift())}})();function Cn(ee,re){const te=gn();return(Cn=function(ne,ie){return te[ne-=266]})(ee,re)}function Nn(){var ee=t;const re=[ee(422),ee(530),ee(338),ee(202),"push",ee(183),ee(740),ee(763),"137247nsOmnY",ee(544),ee(554),ee(628),ee(297),ee(555)];return(Nn=function(){return re})()}function Un(ee,re){const te=Nn();return(Un=function(ne,ie){return te[ne-=169]})(ee,re)}function An(ee,re){var te=xn();return(An=function(ne,ie){return te[ne-=337]})(ee,re)}function xn(){var ee=t,re=[ee(466),ee(762),ee(255),ee(548),ee(391),ee(557),ee(277),ee(706),"2051dwZdDh",ee(199),ee(503),ee(342),ee(422),"182295YeOYne",ee(382),ee(575),ee(520),ee(629),"apply","40247440IrIkgT",ee(672),"push","getOwnPropertyDescriptors","indexOf",ee(326),ee(359)];return(xn=function(){return re})()}function Rn(){var ee=t,re=["16oYUCaR",ee(495),ee(643),ee(220),"944418PqxCQU","808467xfwLHr",ee(283),"10QxKTBX",ee(153),ee(459)];return(Rn=function(){return re})()}function Sn(ee,re){var te=Rn();return(Sn=function(ne,ie){return te[ne-=171]})(ee,re)}function Pn(){var ee=["INVALID","UNHANDLED","HTTP","UNAUTHORIZED","13163230kGdpsc","856juyAkB","TIMEOUT","350256uPlzjN","5054ruXNQI","2450577zCNjjI","2339148NeQscF","REQUEST_TIMEOUT","REQUIRED","BAD_REQUEST","60389xcocgx","11tPlygx","NOT_FOUND","301vJXIvb","UNABLE_TO_FIND","NOT_LOADED","6497910YprBBF","40ngIbUX","UNDEFINED"];return(Pn=function(){return ee})()}var Ln,jn,zn,Hn,Fn,Qn,Zn,Gn,Bn,qn,Jn,Yn;function Vn(ee,re){var te=Pn();return(Vn=function(ne,ie){return te[ne-=335]})(ee,re)}function Wn(ee,re){var te=Mn();return(Wn=function(ne,ie){return te[ne-=341]})(ee,re)}function Mn(){var ee=["CopyButton","copy-button","reveal","2917173skLMeQ","1820964OqZzNt","510315wlwfez","441522swQxzn","3761920KVvMuv","8178336dFaxYN","Reveal","5qbCaQQ","4044603UhdGqT"];return(Mn=function(){return ee})()}function Xn(ee,re){var te=Kn();return(Xn=function(ne,ie){return te[ne-=235]})(ee,re)}function Kn(){var ee=["production","33vyRaSe","238515PNqZTX","2664777SEHPlq","200dnfHzp","4RQDQWC","14080653FGOkOA","sandbox","1893258distuZ","SANDBOX","1705123ZWIxjP","171829ajvFNO","7942010cWpsFH","84YuXwGF"];return(Kn=function(){return ee})()}function _n(){var ee=["270103qoQgEd","12itkIzk","14nsIwws","9iCTJgp","74736ETbfqk","44358azBwEp","10oyDFLF","4394507nLBhNm","2eigAEs","2127030LnauBX","11vgTOSS","164277JtqPnT","10312LfzXXQ"];return(_n=function(){return ee})()}function $n(ee,re){var te=_n();return($n=function(ne,ie){return te[ne-=366]})(ee,re)}function tr(ee,re){const te=rr();return(tr=function(ne,ie){return te[ne-=152]})(ee,re)}(function(){var ee=t;const re=Un,te=Nn();for(;;)try{if(-parseInt(re(172))/1*(-parseInt(re(174))/2)+parseInt(re(179))/3+parseInt(re(177))/4*(-parseInt(re(173))/5)+-parseInt(re(182))/6*(-parseInt(re(181))/7)+parseInt(re(169))/8+-parseInt(re(170))/9+parseInt(re(178))/10*(-parseInt(re(180))/11)==757080)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){for(var ee=t,re=An,te=xn();;)try{if(parseInt(re(355))/1+parseInt(re(342))/2*(parseInt(re(357))/3)+parseInt(re(338))/4+-parseInt(re(362))/5+parseInt(re(340))/6*(parseInt(re(339))/7)+parseInt(re(358))/8*(parseInt(re(344))/9)+-parseInt(re(350))/10==959569)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){for(var ee=t,re=Sn,te=Rn();;)try{if(-parseInt(re(172))/1+-parseInt(re(175))/2*(-parseInt(re(173))/3)+parseInt(re(174))/4+-parseInt(re(177))/5+-parseInt(re(171))/6*(-parseInt(re(180))/7)+-parseInt(re(178))/8*(parseInt(re(179))/9)+parseInt(re(176))/10==940869)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){for(var ee=Vn,re=Pn();;)try{if(parseInt(ee(336))/1*(-parseInt(ee(350))/2)+-parseInt(ee(351))/3+parseInt(ee(352))/4+parseInt(ee(340))/5*(parseInt(ee(349))/6)+parseInt(ee(356))/7*(-parseInt(ee(347))/8)+parseInt(ee(339))/9+-parseInt(ee(346))/10*(-parseInt(ee(357))/11)===589533)break;re.push(re.shift())}catch{re.push(re.shift())}})(),(jn=Ln||(Ln={}))[(zn=Vn)(354)]="REQUIRED",jn[zn(341)]=zn(341),jn[zn(337)]="UNABLE_TO_FIND",jn.NOT_LOADED=zn(338),jn[zn(342)]=zn(342),jn.HTTP=zn(344),jn[zn(348)]=zn(348),jn[zn(343)]=zn(343),Fn=Hn||(Hn={}),Qn=Vn,Fn[Fn.OK=200]="OK",Fn[Fn[Qn(355)]=400]=Qn(355),Fn[Fn[Qn(335)]=404]=Qn(335),Fn[Fn.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",Fn[Fn[Qn(353)]=408]=Qn(353),Fn[Fn.UNAUTHORIZED=401]=Qn(345),(function(){for(var ee=Wn,re=Mn();;)try{if(parseInt(ee(345))/1+-parseInt(ee(344))/2+-parseInt(ee(351))/3+parseInt(ee(347))/4+-parseInt(ee(350))/5*(-parseInt(ee(346))/6)+parseInt(ee(343))/7+parseInt(ee(348))/8===704730)break;re.push(re.shift())}catch{re.push(re.shift())}})(),(Gn=Zn||(Zn={}))[(Bn=Wn)(349)]=Bn(342),Gn[Bn(352)]=Bn(341),(function(){for(var ee=Xn,re=Kn();;)try{if(-parseInt(ee(236))/1+-parseInt(ee(248))/2+parseInt(ee(243))/3*(parseInt(ee(245))/4)+parseInt(ee(242))/5*(-parseInt(ee(239))/6)+parseInt(ee(237))/7*(-parseInt(ee(244))/8)+parseInt(ee(246))/9+-parseInt(ee(238))/10*(-parseInt(ee(241))/11)===902110)break;re.push(re.shift())}catch{re.push(re.shift())}})(),Jn=qn||(qn={}),Yn=Xn,Jn.PRODUCTION=Yn(240),Jn[Yn(235)]=Yn(247),(function(){for(var ee=$n,re=_n();;)try{if(-parseInt(ee(368))/1*(-parseInt(ee(376))/2)+-parseInt(ee(371))/3*(parseInt(ee(367))/4)+parseInt(ee(374))/5*(parseInt(ee(373))/6)+parseInt(ee(370))/7*(parseInt(ee(372))/8)+-parseInt(ee(366))/9+-parseInt(ee(377))/10*(-parseInt(ee(378))/11)+-parseInt(ee(369))/12*(parseInt(ee(375))/13)===152250)break;re.push(re.shift())}catch{re.push(re.shift())}})(),(function(){const ee=tr,re=rr();for(;;)try{if(-parseInt(ee(166))/1*(parseInt(ee(155))/2)+parseInt(ee(157))/3+parseInt(ee(164))/4+-parseInt(ee(159))/5+parseInt(ee(158))/6*(parseInt(ee(168))/7)+parseInt(ee(165))/8*(-parseInt(ee(152))/9)+parseInt(ee(154))/10===424938)break;re.push(re.shift())}catch{re.push(re.shift())}})();const nr=()=>new Promise(((ee,re)=>{const te=tr;if(((ne=nt[t(172)])=>{const ie=Cn;try{return document.querySelectorAll(ie(273)+ne+ie(281))[ie(267)]>0}catch{return!1}})()&&window[te(153)])ee(window[te(153)]);else if(!window[te(153)]){const ne=(()=>{const ie=tr,oe=document.createElement(ie(161));return oe.src=nt.getFullCdn(ie(156),ie(163)),ut(oe),oe})();return ne.onload=()=>{const ie=te;window[ie(153)]?ee(window.APTokenizer):re(new C(Ln[ie(167)],ie(160),!0))},void(ne[te(162)]=()=>re(new C(Ln[te(169)],"SCRIPT",!0)))}}));function rr(){const ee=["31456JYMHzf","928wCafiN","156wRIJHE","UNDEFINED","2317DECIua","NOT_LOADED","62802oYTinX","APTokenizer","20534150rAmYXS","8482vGJDwh","tokenizer-sdk","793641JyeeYi","2676hrMTeo","2887350YWJLUu","Astropay Web Tokenizer","script","onerror","astropay-tokenizer.min.js"];return(rr=function(){return ee})()}var er=cr;function ar(ee,re,te,ne,ie,oe,se){var ae=cr;try{var ue=ee[oe](se),ce=ue[ae(293)]}catch(le){return void te(le)}ue[ae(304)]?re(ce):Promise.resolve(ce)[ae(303)](ne,ie)}(function(){for(var ee=cr,re=ir();;)try{if(-parseInt(ee(297))/1+-parseInt(ee(301))/2*(parseInt(ee(302))/3)+parseInt(ee(292))/4+parseInt(ee(305))/5+-parseInt(ee(300))/6+parseInt(ee(295))/7*(parseInt(ee(294))/8)+parseInt(ee(306))/9*(parseInt(ee(298))/10)===667472)break;re.push(re.shift())}catch{re.push(re.shift())}})(),Promise[er(308)]()[er(303)]((()=>{var ee=er;typeof window!==ee(299)&&!window[ee(291)]&&((()=>{const re=bn;It(re(385),H[re(395)][re(390)][V()[re(387)]]),It(re(385),H[re(395)][re(396)][V()[re(387)]])})(),(()=>{var re=t;const te=ln;It(te(263),H[te(255)][te(259)][V()[te(264)]]),It(te(263),H[te(255)][re(363)][V()[te(264)]])})())}));const sr=(or=function*(ee){Dn(ee);const re={initRevealer:(te=ee)=>{var ne,ie=cr;return(ne=window[ie(291)])===null||ne===void 0?void 0:ne[ie(307)](te)},initCollector:(te=ee)=>{var ne,ie=cr;return(ne=window[ie(291)])===null||ne===void 0?void 0:ne[ie(289)](te)}};return new Promise(((te,ne)=>{var ie=cr;typeof window!==ie(299)?window[ie(291)]?te(re):nr()[ie(303)]((()=>{te(re)}))[ie(296)]((oe=>{ne(oe)})):ne(ie(290))}))},pr=function(){var ee=this,re=arguments;return new Promise((function(te,ne){var ie=or[cr(309)](ee,re);function oe(ae){ar(ie,te,ne,oe,se,"next",ae)}function se(ae){ar(ie,te,ne,oe,se,"throw",ae)}oe(void 0)}))},function(ee){return pr[cr(309)](this,arguments)});var or,pr;function cr(ee,re){var te=ir();return(cr=function(ne,ie){return te[ne-=289]})(ee,re)}function ir(){var ee=["APTokenizer","4582976tSGCgi","value","373232tEwSlg","63KVvFap","catch","1156122MmdZsQ","142260eHWUOj","undefined","7303908VsgDsd","6URBYWa","276963Gnzkoo","then","done","3355345JCZnlM","684orEnOE","initRevealer","resolve","apply","initCollector","new SDKError(ErrorType.UNDEFINED, 'window', true)"];return(ir=function(){return ee})()}class CardService{}xe(CardService,"getPciToken",async re=>{try{return await HttpClient.POST({url:END_POINTS.pciToken,data:re})}catch(te){return DataDogTracker.trackError(te),Promise.reject(te)}});const formatCardExpiryDate=ee=>{if(!ee)return"";const te=ee.replace(/\s+/g,"").split("/");if(te.length!==2)return"";let[ne,ie]=te;if(ne.length===1&&(ne="0"+ne),ie.length===2){const oe=new Date().getFullYear(),se=Math.floor(oe/100)*100;ie=String(se+Number(ie))}return`${ne}/${ie}`},APTokenizerVersion="v1.1.3";class CardApService{constructor(re,te){xe(this,"collector");xe(this,"form");xe(this,"fields");xe(this,"callback");this.fields=re,this.callback=te}async init(re){try{const te=await sr({environment:this.getCardEnvironment(),version:APTokenizerVersion});this.collector=te.initCollector(),this.form=this.collector.createForm(ne=>{if(this.callback){const ie=Object.entries(ne).reduce((oe,[se,ae])=>(oe[se]={isValid:ae.isValid||!ae.isDirty&&!ae.isTouched,isTouched:ae.isTouched||ae.isDirty},oe),{});this.callback(ie)}}),this.fields.forEach(({field:ne,...ie})=>{this.form.field(ne,ie)}),re==null||re()}catch(te){throw console.error(te),te}}async tokenizeCard(re,te,ne){try{const{accessToken:ie}=await CardService.getPciToken(re);return this.form.accessToken=ie,await new Promise(oe=>{this.form.submit(se=>{var le,de,fe,he,pe;const ae=(le=se.card_number)==null?void 0:le.details,ue=ae==null?void 0:ae.bin;if(!ue){ne(new Error(AstroPayI18n.translate("card_tokenization_error")));return}const ce={cardNumberTkn:((de=se.card_number)==null?void 0:de.value)||"",cvvToken:((fe=se.card_cvc)==null?void 0:fe.value)||"",holderName:(he=se.card_holder)==null?void 0:he.value,expirationDate:formatCardExpiryDate((pe=se.card_exp)==null?void 0:pe.value),firstSixDigits:ue?ue.substring(0,6):"",lastFourDigits:(ae==null?void 0:ae.lastFour)||"",brand:(ae==null?void 0:ae.brand)||"unknown"};te(ce),oe()},()=>{ne(new Error(AstroPayI18n.translate("card_tokenization_error")))})})}catch{ne(new Error(AstroPayI18n.translate("generic_error")))}}unmount(){var re;(re=this.form)==null||re.tearDown()}getCardEnvironment(){return AstroPayConfig.getEnvironment()==="production"?"production":"sandbox"}}var ECardPayStatus=(ee=>(ee.PENDING="PENDING",ee.REJECTED="REJECTED",ee))(ECardPayStatus||{});class PaymentMethodsService{}xe(PaymentMethodsService,"getPaymentMethodDetail",async re=>{try{return await HttpClient.GET({url:buildPathWithParams(END_POINTS.paymentMethodDetail,{paymentExternalId:re.paymentExternalId,methodCode:re.methodCode})})}catch(te){return Promise.reject(te)}});const CARD_STYLES=(ee,re)=>({fontSize:"16px",lineHeight:"24px",color:ee,backgroundColor:"inherit",fontFamily:`${re.fontFamily}, sans-serif;`}),getCardPaymentMethodStyles=(ee,{error:re=!1,disabled:te=!1})=>css`
|
|
932
|
+
`;class PaymentSummary extends Component{constructor(te){super({tag:"div",styles:ie=>getPaymentSummaryStyles(ie)});xe(this,"amount");xe(this,"currency");xe(this,"valueContainer");this.amount=te.amount,this.currency=te.currency;const ne=new Typography({text:AstroPayI18n.translate("payment_amount"),size:"medium",weight:400,align:"center",variant:"div"}).element;this.valueContainer=document.createElement("div"),this.updateValueDisplay(),this.element.append(ne,this.valueContainer)}updateValueDisplay(){this.valueContainer.innerHTML="";const te=new Typography({text:this.getFormattedAmount(),size:"large",weight:600,align:"center",variant:"div"});this.valueContainer.appendChild(te.element)}getFormattedAmount(){return formatAmountCurrency(this.amount,this.currency,AstroPayConfig.getCurrencyMode())}setAmount(te){this.amount=te,this.updateValueDisplay()}setCurrency(te){this.currency=te,this.updateValueDisplay()}setAmountAndCurrency(te,ne){this.amount=te,this.currency=ne,this.updateValueDisplay()}}var t=rn;function n(){var ee=rn;const re=["clear","127830LZHlSi",ee(795),ee(743),ee(794),ee(649),ee(511),"1048780OzWlkN",ee(668),ee(412),ee(465),ee(180),ee(520),ee(373),ee(419),ee(562),ee(422),"off"];return(n=function(){return re})()}(function(){for(var ee=rn,re=e();;)try{if(-parseInt(ee(329))/1*(parseInt(ee(274))/2)+-parseInt(ee(369))/3*(-parseInt(ee(367))/4)+-parseInt(ee(233))/5+parseInt(ee(145))/6*(-parseInt(ee(701))/7)+-parseInt(ee(655))/8*(-parseInt(ee(270))/9)+parseInt(ee(315))/10*(parseInt(ee(142))/11)+parseInt(ee(685))/12===588751)break;re.push(re.shift())}catch{re.push(re.shift())}})();const r=a;function e(){var ee=["3448vNCtZZ","761436JoNrAO","5310140VtlWwy","Request timeout","7672278JDWNZO","90ZjyTbp","3104038VhHmhJ","341079ldogSu","3114441jTKeeA","key","PRODUCTION","getAttribute","toDotCase","send","102532iujTOj","757371vntIDP","rule","28497zqLGhH","1965484iDLxVf","justify","10QefxGX","5066250nuHGFb","append","1380400kMJPdd","tags","3598075UDNdui","rel","latest","5679575iNTExO","@font-feature-values","700156cwVhpM","13090752DcUgRT","count","lowerFirst","box-pack:$3","@keyframes","6990495zFYjlD","timeout","SANDBOX","1764180DwriBQ","28900hQasRN","get","$2box$3","592uldMpH","1906140GGDNCn","forEach","6lcQlGI","timeZone","330066EfbpyJ","2180136rfoyVo","2548490MycJlj","3489ZHTUlC","includes","902079TZNeVj","hasOwnProperty","20cFIzva","flex-line-pack","5421zZCtjq","anim","1685971anZxDF","1118807BrroiT","633515GvGIbN","href","612712APocYB","-ms-","34347599FblyIU","5oIWUit",'/"]',"styleSheets","1149940kbRkDq","18emqyKv","216768ATlgsw","REQUIRED","1538910aqOPES","167058fDTlal","1802382UuEKog","11928996WPgChJ","297544AzCjab","7cCQubY","210052cCRFdo","15365691CaBpSv","prepend","1837320JmVWKN","apply","5488040tLgchU","6404728IJjHNF","cssRules","[HTTP]: ","function","538328lGaoiz","3WyhRFj","set","document.head or document.body","18KOgRUC","3PpNGVC","frames","request","formatKeys","2515230SGPlYS","1557YOosgA","container","4144596Ukwkkq","14mcAgvY","_createCaseFirst","80179OoRuKl","NOT_FOUND","test","1063965TOYbKD","112560WXZvtM","5855416GyXitv","authorization","insertionPoint","ctx","3122830eGkjjc","173392QMdDYZ","197776ZnKCeZ","comm","42CEhiUc","3UDJFFS","8znKpbY","1rkGFTj","1103656RUOYui","5297088ciYuDR","CopyButton","random","5589390vSVLAu","done","969632YGVaMk","flex-pack:$3","setPrototypeOf","negative","$2$3","8766CUlXUX","6555474dHVLiB","16hoClBR","10399347ouOdzC","1731331adTcvK","6011170PFMfeO","box-","2QsMDbx","396880hxDmUW","5lLsGOe","lower","288762yBOcUy","927680PXUBpa","5272970jsKcdl","210wvAPTz","4390984qBtQNZ","1042915vBnDcJ","slice","18146574kLGOdt","Content-Type","@counter-style","1635840LijluJ","assign","then","148iTkCvR","upperFirst","4586523dESxoU","102UdDlbM","13480IirCBl","application/json","-$&","snake","startCase","3782506eozEyq","[UNHANDLED]: ","1586289ZbsznC","parent","compat","style[data-emotion]:not([data-s])","41346sAgKHc","origin","1542472UUshgd","toPascalCase","domians","187957vMwqit","toSnakeCase","568pAcJOy","5590kjPEGP","@font-face","34057TCsfxk","9621207ZSMPqN","data-emotion","_startCase","print-","@media","link",":read-write","NOT_LOADED","9356KfJoDB","animationName","4mPQIOh","animation","2696336QqSQcN","start","3363787mMyewX","12991583mFbRDh","35tYPZLV","35168opQkvL","32WPbhAk","hydrate","/public/v1/token/reveal","36hVbjtN","basis","$1$2","cdn","__emotion_styles","22apMIFO","3goapWe","3275226iDBkQv","push","221142kMnpSu","querySelectorAll","114RSjmoG","reveal","2672020NupvKQ","5voBSrt","5280612FAmHRj","2YDvJFs","121946FvfpOL","TIMEOUT","BAD_REQUEST","308070mzXybL","7704828AlyWpW","4136vTyAoM","42WATbWV","17375868QkLWYY","1961979ltppkW","369356uTNDzr","5112212jRFQZI","24746700nYUjHu","$1 $2","6521168AcnhGa","style","12tOiqGC","https://tokenizer-tst.cc.astropay.com","speedy","60VyHydS","793022whjRWB","bind","kebab","10Oqises","add","1470645xRoijs","object","captureStackTrace","781649cCTwXr","182824NOFIwU","4817756GOdPsv","BASE_CDN","isArray","@supports","1244744kHEZvp","1204400cULrpT","449711XSjyNn","@namespace","57gVyDRX","emit","6236046SweZxs","defineProperties","@@INIT","3014374nROcbQ","params","sheet","1671942sLAGQH","Unable to find ","shift","canExecute","upper","UNHANDLED","321246WzqUuK","2416zstDHz","78TjMsRA","@document","486479crVyAA","1274230eUYpuD","7476MqGCll","https://tokenizer.cc.astropay.com","9qEwJkj","94mlxQmC","_insertTag","@viewport","copy-button","2oFrXUh","css","707329nPsPGZ","3903120ZTbQWm","1250232QMjwkz","993063ECHrBH","off","box$3","2387410tdnXlE","environment","type","4XTbgyi","207494VIJaqZ","207VWsTHT","6MQcvFH","35KTILAE","623aFRIRv","104MtyiFW","70fByxgL","1328390hcsUJy","11965976myZRSf","2932168wOOQED","7CAfDgU","27xTvXzF","5139khheWn","18298ErvNda","15qVcyAs","2581385zzzlSz","1531173EygmBU","5013TdEGGQ","39251454EyvEGu","1szHVRr","nextSibling","171eGkepJ","995792ZXdNpW","getFullCdn","49fgToOT","141238OYIhFf","3604728wtPlZt","9byfBJF","exec","next","message","70759QyvmDC","isSpeedy","128yfgIdV","data-s","200ROoAmA","shrink","length","282358JpRRgN","isOperational","insert","3278505kVkcHW","2558421fHqYVU","1165706VPRSLL","split","360993lzNNst","3986rrEZYp","return","3480945BQAAYg","2nMBmkS","2281844ROitQp","BASE_API","27HmsHKI","679404ZmaTyg","20xkgBFi","3908064tZgPPb","1790914KWViXl","inserted","stylisPlugins","reduce","insertBefore","26oJRKGO","119987EZDfNd","565eyruQF","Access-Control-Allow-Origin","595876LgUVRS","1992206jKEGfb","join","193550GoZXIJ","202wLqUwO","replace","baseURL"," is invalid.","99amzLEi","12446nhMFLu","1856148uSihXJ","31566270qvtShe","56045nULafv","abs","5889208ocarfU","2206497yNbZFm","7WjjEbv","@keyframes ","firstChild","305907rAOuHi","1070106SrHRtP","1KlNACj","2829256VMfbYc","801054pmVKPQ","45296tjbJvx","399116yuJdxn","TimeZone","removeEventListener","UNDEFINED",' "]',"lastIndex","18388260JgPhmo","790sQdzeI","xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx","39nuPwxQ","nonce","1906825qFGXWA","102Qkfvvl","name","raw","20gywqiU","7308324sgDoMc","34825311qnCLyR","991531xZguiI","4593190CadDlo","INVALID","1uSGfgo","input-$1","1501542qKAixX","prototype","registered","456wJQuIj","347732LsCzct","parse","undefined","76385hkeDYT","inline-","115026FZBXCQ","5txmdnE","32HPdvVb","8954800LNVZHA","accessToken","3GcEFSv","props","5028BbqWZE","34672561hfhCnC","6522030iNQqBd","36TYjiRw","474fHLsgQ","365994YPzeNn","toKebabCase","6SBjYSO","1HxbtmM","toCamelCase","3xMbMIj","313859KKbbgd","keys","6LCyCWH","tb-rl","1145017tuPjtp","api","10895PHjSJt","boolean","flex-$1$2","2012180BGZvZq","5JHUgnG","6eqGueN","create","1483570zwTktD","366KnZgCn","14qDkMOo","8FUVWOn","38685lFcQsk","appendChild","4wswXHb","INTERNAL_SERVER_ERROR","315634dCJvdO","32039NIQJjh","trim","entries","143352vIzUva","-grow","6vPzjsU","getOwnPropertyDescriptors","192VVRXxR","2013040uXGWiH","grow","10gWvkPZ","getOwnPropertySymbols","!important","5028340uiCobm","splitWords","1398012AIJUyj","1632420YnhDrH","ctr"," is undefined.","41812yDXNFv","2495164uYJjkv","-moz-","version","502691MEcBqX","getHeaders","3kPtUIZ","stringify","14822650JPeFEZ","@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ","42054ESbccP","_toWords","4242528bXZfiT","3344667OIHhxe","5750396vrmTdj","head","268152SJsZnw","427cxPooO","isUndefined","3930zrQOch","listeners","decl","@import","filter","stop","location","79674ZpwWYN","293732SBYxst","/public/v1/token","fromCharCode","toLowerCase","toUpperCase","call","GET","addEventListener","setAttribute","26941288CkDEbN","post","11oqlwuN","Access token not set","87GWhrFE","emitter","before","isRequired","1369700dRAXAo","5GSCGHS","string","toString","24384006yWcRvg","_canExecute","8765008liwqJC","sourceWindow","sandbox","7368UiaItP","12GMrAvZ","HTTP","dns-prefetch","4410036tOJnlJ","264834CkfPaR","children","4214610DepdAD","1472518dXJTTo","3379032afmmzz","Component selectors can only be used in conjunction with ","8ZmfgGJ","44cPbEBd","582SAPPev","350313NZGJmJ","4249880hofxWm",":read-only","436145BXkDSV","toSentenceCase","24qGiocM","flex-item-","REQUEST_TIMEOUT","UNAUTHORIZED","2924874IDKzfu","11ozoHrq","20380sohzME","284730CeOziu","6521911DlQhaK","resolve","175pzlaDH","12Wntbrz","153CwXsSP","6807462wcVIbh","$`$1","99255obnocz","8565340BeQZTN","frameId","3220704wvCPTK","9vcUkeB","5163599fsttEm","983742ZSzkPs","1880YXBEgQ","postMessage","6676776VbOJGf","value","72700aKFNWB","Request error! status: ","2685321kQBtXq","2011122iTUboz","784830EiOgSk","4Shhqxd","concat","throw","777225SHDgSu","resolvedOptions","search","24brqEuT","stretch","2353821ouiOcG","16BpXaTH","body","4168339BVBfRq","_upperFirst","styles","5GkJNGS","2498022TthXHp","match","4399206zUvsoU","defineProperty","45vUgLOB",'script[src^="',"box-$1$2","1915506xRzusT","targetOrigin","10vjgZog","map","3084189TBfDxs","2617015rxAdDp","20057BCeMKK","692668yJTffY","3275913IwuUbo","5yABJbK","charCodeAt","4DRtert","formatKey","5gnwpyW","_lowerCase","4622320DSbOxK","createElement","1428025rswbrb","AbortError","272928GGfFVj","737mdBFHW","4950912kToKgF","handleMessage","8310840DVoCar","getOwnPropertyDescriptor","109064imVtqW","createTextNode","6XsYOJz","24899zSajlN","127845nWOlks","21ZAugTX","11860803tMqYZp","3898532gnOkwM","5015045AqKKoB","1371378msYiaj","5167656aUcLyl","209740ohkUFh","7903578rApVjM","378mIpYul","UNABLE_TO_FIND","586668OMSavw","https://tokenizer-web.cc.astropay.com","39728XQruux","::placeholder","2hgGSIR","3799864GhLwZS","removeChild","toLocaleLowerCase","40869670rNPvRw","flush","235779fIEMDA","enumerable","5CDMHbY","Reveal","773584eZyLko","1907948myHfGb","61554tirTmC","4269661uBmwSk","23881380dQaLeD","296368dsyAUL"];return(e=function(){return ee})()}function a(ee,re){const te=n();return(a=function(ne,ie){return te[ne-=160]})(ee,re)}(function(){var ee=rn;const re=a,te=n();for(;;)try{if(-parseInt(re(176))/1*(-parseInt(re(169))/2)+-parseInt(re(175))/3+parseInt(re(172))/4*(parseInt(re(173))/5)+parseInt(re(170))/6*(-parseInt(re(161))/7)+-parseInt(re(174))/8+-parseInt(re(163))/9*(parseInt(re(167))/10)+parseInt(re(171))/11==561693)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),r(165),r(177),r(166);var s,o,p,c,i,u,I,f,h,v,l,d;function b(){var ee=rn,re=[ee(350),ee(396),ee(311),ee(474),"837xAVhUS","HTTP",ee(724),ee(144),ee(264),ee(473),ee(689),ee(226),ee(221),"TIMEOUT","NOT_LOADED",ee(328),ee(378),ee(179),ee(656),ee(563),"6960805uGgNwo",ee(192),ee(426),"12267310uEVrHO"];return(b=function(){return re})()}function y(ee,re){var te=b();return(y=function(ne,ie){return te[ne-=191]})(ee,re)}function k(ee,re){var te=m();return(k=function(ne,ie){return te[ne-=203]})(ee,re)}function m(){var ee=rn,re=[ee(718),ee(707),"41710840nWONlY",ee(731),ee(659),ee(799),"7OXGKyG",ee(198),ee(766),ee(243),ee(490),ee(263)];return(m=function(){return re})()}function O(ee,re){var te=E();return(O=function(ne,ie){return te[ne-=166]})(ee,re)}function E(){var ee=rn,re=[ee(622),ee(657),ee(242),ee(732),"production",ee(499),"83274xOmQWJ","4mtYUAV",ee(451),ee(543),ee(594),"65587catFQe",ee(415)];return(E=function(){return re})()}function w(ee,re){var te=D();return(w=function(ne,ie){return te[ne-=472]})(ee,re)}function D(){var ee=rn,re=[ee(308),ee(157),ee(444),ee(335),ee(279),ee(169),"2vZiVLA","1287DSJSxR",ee(240),ee(251),ee(456),ee(477),ee(692),"96LHSqDE"];return(D=function(){return re})()}(function(){for(var ee=rn,re=y,te=b();;)try{if(parseInt(re(196))/1*(parseInt(re(200))/2)+-parseInt(re(209))/3*(parseInt(re(214))/4)+parseInt(re(212))/5+parseInt(re(193))/6*(-parseInt(re(204))/7)+parseInt(re(203))/8+parseInt(re(192))/9*(parseInt(re(198))/10)+-parseInt(re(191))/11==844014)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te.shift())}})(),(o=s||(s={}))[(p=y)(210)]=p(210),o[p(194)]=p(194),o[p(211)]=p(211),o[t(773)]=p(206),o[p(207)]=p(207),o[p(197)]=p(197),o[p(205)]=t(143),o.UNHANDLED=p(213),u=y,(i=c||(c={}))[i.OK=200]="OK",i[i[u(199)]=400]=u(199),i[i[u(202)]=404]=u(202),i[i[u(208)]=500]=t(378),i[i[u(201)]=408]=u(201),i[i[u(195)]=401]=u(195),(function(){for(var ee=t,re=k,te=m();;)try{if(-parseInt(re(211))/1+-parseInt(re(209))/2*(parseInt(re(210))/3)+-parseInt(re(212))/4*(parseInt(re(207))/5)+-parseInt(re(204))/6+-parseInt(re(206))/7*(parseInt(re(203))/8)+-parseInt(re(208))/9+parseInt(re(214))/10==660557)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),h=k,(f=I||(I={}))[t(577)]=h(205),f[h(213)]=t(205),(function(){for(var ee=t,re=O,te=E();;)try{if(parseInt(re(167))/1+parseInt(re(175))/2+parseInt(re(178))/3+parseInt(re(176))/4*(-parseInt(re(172))/5)+-parseInt(re(170))/6+-parseInt(re(171))/7*(-parseInt(re(168))/8)+parseInt(re(174))/9==266134)break;te[ee(795)](te.shift())}catch{te[ee(795)](te.shift())}})(),(l=v||(v={}))[(d=O)(166)]=d(173),l[d(169)]=d(177),(function(){for(var ee=t,re=w,te=D();;)try{if(parseInt(re(479))/1*(-parseInt(re(485))/2)+parseInt(re(478))/3*(parseInt(re(477))/4)+parseInt(re(481))/5*(-parseInt(re(475))/6)+parseInt(re(482))/7*(parseInt(re(474))/8)+parseInt(re(472))/9*(parseInt(re(476))/10)+-parseInt(re(484))/11*(parseInt(re(480))/12)+-parseInt(re(483))/13*(parseInt(re(473))/14)==639293)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();const T=N;(function(){var ee=t;const re=N,te=U();for(;;)try{if(parseInt(re(494))/1+parseInt(re(487))/2*(-parseInt(re(497))/3)+-parseInt(re(485))/4*(parseInt(re(483))/5)+-parseInt(re(488))/6+parseInt(re(484))/7*(-parseInt(re(499))/8)+parseInt(re(469))/9*(-parseInt(re(480))/10)+parseInt(re(468))/11==507588)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();const g={isRequired:ee=>ee+T(475),isUndefined:ee=>ee+T(492),isInvalid:ee=>ee+T(490),unableToFind:ee=>T(466)+ee+".",notLoaded:ee=>T(473)+ee+"."};class C extends Error{constructor(re,te,ne=!1){var ie=t;const oe=T;let se=te;switch(re){case s[oe(491)]:se=g[oe(470)](te);break;case s[oe(479)]:se=g.isInvalid(te);break;case s[oe(486)]:se=g[oe(476)](te);break;case s[ie(563)]:se=g[oe(495)](te);break;case s[oe(481)]:se=g[oe(493)](te);break;case s[ie(454)]:se=oe(478)+te;break;case s[oe(471)]:se=oe(496)+te;break;case s[oe(477)]:default:se=oe(474)+te}var ae,ue,ce;super(se),ae=this,ce=void 0,(ue=oe(482))in ae?Object[N(489)](ae,ue,{value:ce,enumerable:!0,configurable:!0,writable:!0}):ae[ue]=ce,Object[oe(472)](this,new.target.prototype),this[oe(467)]=re,this[oe(482)]=ne,Error[oe(498)](this)}}function N(ee,re){const te=U();return(N=function(ne,ie){return te[ne-=466]})(ee,re)}function U(){var ee=t;const re=[ee(348),ee(524),ee(442),ee(143),ee(713),"Failed to load the ",ee(750)," is required.",ee(417),ee(192),ee(671),ee(328),ee(164),ee(773),ee(257),ee(645),ee(358),ee(784),"UNDEFINED","618834PMzmgD",ee(519),ee(520),ee(290),ee(656),ee(398),"notLoaded",ee(218),"unableToFind","[TIMEOUT]: ",ee(357),"captureStackTrace",ee(223),ee(188),ee(321)];return(U=function(){return re})()}function A(ee,re){var te=x();return(A=function(ne,ie){return te[ne-=363]})(ee,re)}function x(){var ee=t,re=[ee(699),"10296792NSbaBf",ee(144),ee(237),ee(713),ee(171),"3JrHjWm",ee(467),ee(520),ee(239),"httpCode",ee(390),ee(590),ee(280),ee(303)];return(x=function(){return re})()}(function(){for(var ee=t,re=A,te=x();;)try{if(parseInt(re(365))/1*(-parseInt(re(374))/2)+-parseInt(re(368))/3*(-parseInt(re(367))/4)+-parseInt(re(373))/5*(-parseInt(re(376))/6)+parseInt(re(375))/7+-parseInt(re(377))/8*(parseInt(re(371))/9)+parseInt(re(369))/10+parseInt(re(363))/11==917605)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te.shift())}})();const R=P;function S(){var ee=t;const re=[ee(683),ee(336),ee(629),ee(541),ee(446),"143705UhzlIi",ee(141),ee(193),ee(176),ee(147),ee(674),ee(688),ee(234),ee(173),ee(406),ee(606),"940hBWQzM"];return(S=function(){return re})()}function P(ee,re){const te=S();return(P=function(ne,ie){return te[ne-=127]})(ee,re)}(function(){var ee=t;const re=P,te=S();for(;;)try{if(parseInt(re(139))/1*(-parseInt(re(140))/2)+parseInt(re(127))/3*(parseInt(re(142))/4)+-parseInt(re(137))/5+-parseInt(re(141))/6+-parseInt(re(129))/7+-parseInt(re(143))/8*(parseInt(re(134))/9)+-parseInt(re(133))/10*(-parseInt(re(128))/11)==195235)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();class L{static[R(135)](re){const te=R,ne=new URLSearchParams(re),ie={};return ne[te(136)](((oe,se)=>{var ae=rn;const ue=te;ie[se]?Array[ue(130)](ie[se])?ie[se][ae(795)](oe):ie[se]=[ie[se],oe]:ie[se]=oe})),ie}static parseObject(re){return this[R(135)](re)}static[R(131)](re){const te=R,ne=new URLSearchParams;for(const ie in re){const oe=re[ie];if(Array[te(130)](oe))for(const se of oe)ne[te(132)](ie,se);else ne[te(132)](ie,oe?oe[te(138)]():"")}return ne[te(138)]()}}const j=z;function z(ee,re){const te=F();return(z=function(ne,ie){return te[ne-=358]})(ee,re)}(function(){var ee=t;const re=z,te=F();for(;;)try{if(parseInt(re(368))/1+parseInt(re(367))/2*(parseInt(re(361))/3)+-parseInt(re(371))/4+-parseInt(re(358))/5*(-parseInt(re(370))/6)+parseInt(re(362))/7*(parseInt(re(366))/8)+parseInt(re(363))/9*(parseInt(re(364))/10)+-parseInt(re(372))/11==832538)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();const H={endpoints:{tokenizer:t(427),reveal:j(365)},domians:{cdn:{production:j(369),sandbox:"https://tokenizer-web-tst.cc.astropay.com"},api:{production:j(359),sandbox:j(360)}}};function F(){var ee=t;const re=[ee(393),ee(786),ee(471),"107952fYoopL",ee(644),ee(565),"5250978IBLHHK","2968388TUhYeT",ee(236),ee(537),ee(200),ee(158),ee(317),ee(780),ee(677)];return(F=function(){return re})()}const Q=Z;function Z(ee,re){const te=B();return(Z=function(ne,ie){return te[ne-=466]})(ee,re)}(function(){var ee=t;const re=Z,te=B();for(;;)try{if(parseInt(re(475))/1+parseInt(re(466))/2*(-parseInt(re(472))/3)+parseInt(re(471))/4+-parseInt(re(467))/5*(parseInt(re(473))/6)+parseInt(re(474))/7*(-parseInt(re(469))/8)+-parseInt(re(470))/9*(-parseInt(re(477))/10)+-parseInt(re(476))/11==221555)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te.shift())}})();const G={environment:v[Q(468)],version:t(611)};function B(){var ee=t;const re=["50qDamSZ",ee(568),"44535lKGnAe",ee(622),"1198616psasvq","544302QFKtCW","162808fuaUJw","234726FeLlSb",ee(798),ee(662),ee(469),ee(623)];return(B=function(){return re})()}function q(){var ee=t;const re=["946575WsgUvq",ee(268),ee(533),"12681sdIGeC",ee(635),"4355436uZDbJG","24iPqPHQ",ee(592),ee(351),ee(418),ee(166)];return(q=function(){return re})()}function J(ee,re){const te=q();return(J=function(ne,ie){return te[ne-=155]})(ee,re)}(function(){var ee=t;const re=J,te=q();for(;;)try{if(parseInt(re(162))/1*(parseInt(re(155))/2)+parseInt(re(157))/3+-parseInt(re(159))/4+parseInt(re(160))/5*(-parseInt(re(163))/6)+-parseInt(re(158))/7*(parseInt(re(164))/8)+parseInt(re(161))/9*(parseInt(re(156))/10)+parseInt(re(165))/11==451934)break;te[ee(795)](te.shift())}catch{te.push(te[ee(189)]())}})();let Y=G;const V=()=>Y,W=M;function M(ee,re){const te=K();return(M=function(ne,ie){return te[ne-=379]})(ee,re)}(function(){var ee=t;const re=M,te=K();for(;;)try{if(parseInt(re(384))/1+-parseInt(re(389))/2+-parseInt(re(383))/3*(-parseInt(re(387))/4)+parseInt(re(388))/5+-parseInt(re(381))/6*(parseInt(re(385))/7)+-parseInt(re(382))/8+parseInt(re(379))/9*(parseInt(re(386))/10)==645524)break;te[ee(795)](te.shift())}catch{te[ee(795)](te.shift())}})();const X=(ee,re)=>ee[W(380)](new RegExp(re+"$"),"");function K(){var ee=t;const re=[ee(306),ee(288),ee(372),ee(155),ee(232),ee(632),"83594fyhqnZ",ee(730),ee(399),"3139375mafbsW",ee(607)];return(K=function(){return re})()}const _=tt;function $(){var ee=t;const re=[ee(535),ee(602),ee(582),ee(266),ee(416),ee(172),"11uyatGf",ee(402),ee(269),"6nfgxja",ee(698),ee(150),ee(219),"domians",ee(363),ee(790),ee(720),ee(501),ee(215)];return($=function(){return re})()}function tt(ee,re){const te=$();return(tt=function(ne,ie){return te[ne-=110]})(ee,re)}(function(){var ee=t;const re=tt,te=$();for(;;)try{if(parseInt(re(124))/1+-parseInt(re(128))/2+parseInt(re(119))/3*(parseInt(re(127))/4)+parseInt(re(111))/5*(parseInt(re(117))/6)+parseInt(re(112))/7*(-parseInt(re(118))/8)+parseInt(re(120))/9*(-parseInt(re(125))/10)+parseInt(re(114))/11*(parseInt(re(110))/12)==961663)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();class nt{static get[_(113)](){const re=_;return X(H[re(121)][re(123)][V()[re(126)]],"/")}static get[_(116)](){const re=_;return X(H[re(121)][re(122)][V()[re(126)]],"/")}static[t(241)](re,te,ne){var ie=t;const oe=_,se=L[ie(406)](ne??{}),ae=V(),ue=se?te[ie(636)]("?")?"&":"?":"";return nt[oe(113)]+"/"+re+"/"+ae[oe(115)]+"/"+te+ue+se}}var rt=at;function et(){var ee=t,re=[ee(559),ee(634),ee(630),ee(739),ee(548),ee(503),ee(436),ee(480),ee(404),"1042584XPmVvk",ee(172),ee(473),ee(289),ee(745),"json",ee(795),"2166WIGGYn",ee(438),ee(385),ee(606),ee(629),"173LKkRgC",ee(391),ee(498),ee(282),ee(614),ee(710),ee(247),ee(621),ee(255),"14XmrYdp",ee(182),ee(735),ee(504),"Bearer ",ee(697),ee(694),ee(474),"abort","defineProperty",ee(321),ee(680),ee(496),ee(587),ee(309),ee(344),ee(406),ee(248),"status",ee(542),ee(386),"keys",ee(586)];return(et=function(){return re})()}function at(ee,re){var te=et();return(at=function(ne,ie){return te[ne-=115]})(ee,re)}(function(){for(var ee=t,re=at,te=et();;)try{if(-parseInt(re(126))/1*(-parseInt(re(121))/2)+-parseInt(re(160))/3*(-parseInt(re(130))/4)+parseInt(re(140))/5*(-parseInt(re(123))/6)+parseInt(re(135))/7*(parseInt(re(167))/8)+-parseInt(re(158))/9+parseInt(re(159))/10+parseInt(re(157))/11==336922)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),rt(146),rt(164),rt(166);var st=ot;function ot(ee,re){var te=pt();return(ot=function(ne,ie){return te[ne-=291]})(ee,re)}(function(){for(var ee=t,re=ot,te=pt();;)try{if(-parseInt(re(301))/1+parseInt(re(307))/2+-parseInt(re(292))/3*(-parseInt(re(306))/4)+parseInt(re(291))/5+-parseInt(re(314))/6*(-parseInt(re(300))/7)+-parseInt(re(302))/8*(parseInt(re(303))/9)+-parseInt(re(293))/10==616185)break;te.push(te[ee(189)]())}catch{te.push(te[ee(189)]())}})(),t(597),st(294),t(779),st(305),st(296),st(315);function pt(){var ee=t,re=[ee(208),ee(302),"336OqQgfm",ee(755),ee(494),ee(423),ee(647),"1179086uaDkqa",ee(752),"emit","message",ee(756),ee(190),ee(520),ee(148),ee(546),ee(216),ee(779),ee(450),"listener",ee(319),ee(654),ee(407),ee(212),ee(162),ee(448),ee(440),ee(525),ee(310)];return(pt=function(){return re})()}function ct(){var ee=t;const re=[ee(676),ee(331),ee(362),"2228304EqXFLn",ee(512),ee(778),ee(387),ee(721),ee(673),"207AHFLGs",ee(376),ee(425)];return(ct=function(){return re})()}function it(ee,re){const te=ct();return(it=function(ne,ie){return te[ne-=254]})(ee,re)}(function(){var ee=t;const re=it,te=ct();for(;;)try{if(parseInt(re(257))/1+parseInt(re(260))/2+parseInt(re(254))/3*(-parseInt(re(261))/4)+parseInt(re(262))/5+-parseInt(re(258))/6+parseInt(re(256))/7+-parseInt(re(263))/8*(parseInt(re(264))/9)==716064)break;te[ee(795)](te.shift())}catch{te[ee(795)](te[ee(189)]())}})();const ut=function(ee){var re=t;const te=it,ne=document[re(414)]||document[te(259)];if(!ne)throw new C(s[re(563)],te(255),!0);return ne[te(265)](ee),ee};(function(){var ee=t;const re=ft,te=ht();for(;;)try{if(parseInt(re(128))/1+parseInt(re(125))/2+-parseInt(re(127))/3+parseInt(re(132))/4+-parseInt(re(131))/5+parseInt(re(133))/6+-parseInt(re(134))/7==688465)break;te.push(te[ee(189)]())}catch{te[ee(795)](te.shift())}})();const It=function(ee,re){const te=ft,ne=document.createElement(te(126));ne[te(129)]=ee,ne[te(130)]=re,ut(ne)};function ft(ee,re){const te=ht();return(ft=function(ne,ie){return te[ne-=125]})(ee,re)}function ht(){var ee=t;const re=["2178600xJfnAD",ee(771),ee(259),ee(225),ee(610),ee(646),ee(691),ee(556),ee(588),"18738601iJYruu"];return(ht=function(){return re})()}function vt(){var ee=t,re=[ee(608),ee(186),ee(570),ee(376),ee(652),ee(301),"10439181hcqJpc",ee(593),ee(434),ee(441),"createTextNode",ee(695),ee(250),ee(604),"ctr",ee(665),ee(785),"9136jiXoxV",ee(238),ee(203),ee(324),ee(723),ee(177),ee(278),"insertRule",ee(540),"nonce",ee(670),"flush",ee(767),"forEach","7294661PRwxon",ee(774),ee(742),ee(159),"ownerNode",ee(795),ee(255),"2555lCYkVH",ee(252),ee(684),ee(481)];return(vt=function(){return re})()}function lt(ee,re){var te=vt();return(lt=function(ne,ie){return te[ne-=379]})(ee,re)}(function(){for(var ee=t,re=lt,te=vt();;)try{if(parseInt(re(413))/1*(-parseInt(re(412))/2)+-parseInt(re(382))/3+-parseInt(re(381))/4*(-parseInt(re(387))/5)+parseInt(re(411))/6+parseInt(re(390))/7*(parseInt(re(408))/8)+parseInt(re(397))/9+-parseInt(re(404))/10*(parseInt(re(380))/11)==960039)break;te.push(te.shift())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){var ee=t,re=lt;function te(ie){var oe=rn,se=lt,ae=this;this[oe(203)]=function(ue){var ce,le=oe,de=lt;ce=ae[de(391)][de(386)]===0?ae[de(402)]?ae[de(402)][de(409)]:ae[de(406)]?ae[de(389)][de(396)]:ae[de(400)]:ae[de(391)][ae[de(391)][de(386)]-1][le(238)],ae[de(389)][de(414)](ue,ce),ae[de(391)][de(385)](ue)},this[se(403)]=ie[se(383)]===void 0||ie[se(383)],this[se(391)]=[],this.ctr=0,this[se(417)]=ie[oe(318)],this[se(398)]=ie[se(398)],this[se(389)]=ie[oe(684)],this[se(406)]=ie[se(406)],this[se(402)]=ie[se(402)],this.before=null}var ne=te[ee(332)];ne[re(407)]=function(ie){var oe=ee;ie[re(379)](this[oe(203)])},ne[ee(258)]=function(ie){var oe,se,ae,ue=ee,ce=re;this[ce(405)]%(this[ce(403)]?65e3:1)==0&&this[ce(410)]((oe=this,se=lt,(ae=document[se(416)](ue(156)))[se(399)](se(420),oe[se(398)]),oe[se(417)]!==void 0&&ae[ue(434)](ue(318),oe[ue(318)]),ae[se(394)](document[se(401)]("")),ae[se(399)](se(388),""),ae));var le=this[ue(608)][this[ce(391)][ce(386)]-1];if(this[ce(403)]){var de=(function(fe){var he=ue,pe=lt;if(fe[pe(392)])return fe.sheet;for(var ge=0;ge<document[pe(395)][pe(386)];ge++)if(document[pe(395)][ge][pe(384)]===fe)return document[he(652)][ge]})(le);try{de[ce(415)](ie,de[ce(418)][ce(386)])}catch{}}else le[ce(394)](document[ue(550)](ie));this.ctr++},ne[re(419)]=function(){var ie=ee,oe=re;this[oe(391)][ie(629)]((function(se){var ae,ue=oe;return(ae=se.parentNode)==null?void 0:ae[ue(393)](se)})),this[oe(391)]=[],this[ie(397)]=0}})();var dt=bt;function bt(ee,re){var te=yt();return(bt=function(ne,ie){return te[ne-=110]})(ee,re)}function yt(){var ee=t,re=[ee(196),"152336OQhHhe",ee(420),ee(492),ee(783),ee(770),ee(349),ee(204),ee(598),ee(178),ee(401),ee(650),"4724nuSFUK",ee(439),ee(736),"@page",ee(613),ee(619),ee(443),"@layer",ee(174)];return(yt=function(){return re})()}(function(){for(var ee=t,re=bt,te=yt();;)try{if(-parseInt(re(119))/1+-parseInt(re(123))/2*(-parseInt(re(124))/3)+-parseInt(re(129))/4*(parseInt(re(122))/5)+-parseInt(re(114))/6+-parseInt(re(115))/7+parseInt(re(112))/8+parseInt(re(117))/9==198272)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),t(648),dt(121),t(700),t(600),dt(113),dt(126),dt(116),dt(118),dt(110),dt(111),dt(120),dt(128),dt(125),dt(127),dt(130);var kt=mt;function mt(ee,re){var te=Ot();return(mt=function(ne,ie){return te[ne-=258]})(ee,re)}function Ot(){var ee=t,re=[ee(347),ee(371),ee(260),ee(288),ee(227),ee(409),ee(255),ee(795),ee(246),"10opKczI","charCodeAt",ee(733),ee(377),ee(428),ee(738),ee(281),ee(296),ee(510),ee(381),ee(464),"3836294AMJKLE"];return(Ot=function(){return re})()}function Et(){var ee=t,re=[ee(327),ee(255),ee(566),ee(334),ee(323),"14ejudnZ",ee(201),"862542dyuBTR",ee(552),"401898SBLqqH",ee(184),ee(705)];return(Et=function(){return re})()}function wt(ee,re){var te=Et();return(wt=function(ne,ie){return te[ne-=123]})(ee,re)}function Dt(ee,re){var te=Tt();return(Dt=function(ne,ie){return te[ne-=435]})(ee,re)}function Tt(){var ee=t,re=["680775fQHTmS",ee(364),ee(493),ee(528),ee(206),ee(669),"3255819aCtDxV",ee(447),ee(187)];return(Tt=function(){return re})()}function gt(){var ee=t,re=[ee(458),"2134996QawHcC","return",ee(693),ee(558),"15490080Hutsfa",ee(496),ee(228),ee(216),ee(346),ee(255),"1837002hgOqZq",ee(531),ee(516),ee(484),"join"];return(gt=function(){return re})()}function Ct(ee,re){var te=gt();return(Ct=function(ne,ie){return te[ne-=147]})(ee,re)}function Nt(ee,re){var te=Ut();return(Nt=function(ne,ie){return te[ne-=398]})(ee,re)}function Ut(){var ee=t,re=[ee(551),"input-$1",ee(273),ee(468),"root",ee(749),ee(287),ee(567),ee(772),ee(549),ee(716),ee(346),"global",ee(229),ee(294),"1314449boGmmT",ee(527),"4549375QrRZcY",ee(265),"type"];return(Ut=function(){return re})()}function At(){var ee=t,re=[ee(271),ee(209),ee(453),ee(734),ee(545),"has","476346BHUYta","478714FKDyOG",ee(760),ee(253)];return(At=function(){return re})()}function xt(ee,re){var te=At();return(xt=function(ne,ie){return te[ne-=484]})(ee,re)}function Rt(ee,re){var te=St();return(Rt=function(ne,ie){return te[ne-=236]})(ee,re)}function St(){var ee=t,re=[ee(584),"953666lBllkt",ee(564),"48PHUuVy",ee(437),ee(214),ee(627),ee(149),ee(272),ee(307),ee(483),ee(800),ee(370)];return(St=function(){return re})()}(function(){for(var ee=t,re=mt,te=Ot();;)try{if(-parseInt(re(259))/1*(parseInt(re(278))/2)+-parseInt(re(276))/3*(-parseInt(re(271))/4)+-parseInt(re(274))/5*(-parseInt(re(264))/6)+-parseInt(re(258))/7+-parseInt(re(263))/8+parseInt(re(261))/9*(-parseInt(re(268))/10)+parseInt(re(260))/11==402046)break;te[ee(795)](te.shift())}catch{te[ee(795)](te[ee(189)]())}})(),Math[kt(275)],String[kt(272)],Object[kt(273)],(function(){for(var ee=t,re=wt,te=Et();;)try{if(-parseInt(re(132))/1*(parseInt(re(123))/2)+-parseInt(re(125))/3+parseInt(re(129))/4+parseInt(re(134))/5*(parseInt(re(127))/6)+parseInt(re(126))/7*(parseInt(re(133))/8)+-parseInt(re(124))/9*(-parseInt(re(130))/10)+-parseInt(re(128))/11==366270)break;te[ee(795)](te.shift())}catch{te.push(te[ee(189)]())}})(),(function(){for(var ee=t,re=Dt,te=Tt();;)try{if(parseInt(re(439))/1+parseInt(re(443))/2*(parseInt(re(442))/3)+parseInt(re(441))/4*(parseInt(re(440))/5)+parseInt(re(438))/6+-parseInt(re(436))/7+parseInt(re(435))/8+-parseInt(re(437))/9==637765)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te.shift())}})(),(function(){for(var ee=t,re=Ct,te=gt();;)try{if(-parseInt(re(158))/1+-parseInt(re(150))/2+parseInt(re(149))/3+-parseInt(re(155))/4*(-parseInt(re(151))/5)+-parseInt(re(152))/6+-parseInt(re(161))/7*(-parseInt(re(157))/8)+parseInt(re(159))/9==746841)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){for(var ee=t,re=Nt,te=Ut();;)try{if(parseInt(re(398))/1+-parseInt(re(409))/2*(-parseInt(re(413))/3)+parseInt(re(405))/4+parseInt(re(400))/5+-parseInt(re(403))/6*(-parseInt(re(408))/7)+-parseInt(re(412))/8*(-parseInt(re(416))/9)+-parseInt(re(417))/10==921092)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te.shift())}})(),(function(){for(var ee=t,re=xt,te=At();;)try{if(parseInt(re(484))/1+-parseInt(re(485))/2*(-parseInt(re(490))/3)+parseInt(re(488))/4+parseInt(re(489))/5+parseInt(re(492))/6+-parseInt(re(486))/7*(parseInt(re(487))/8)+-parseInt(re(491))/9==521840)break;te.push(te[ee(189)]())}catch{te.push(te[ee(189)]())}})(),(function(){for(var ee=t,re=Rt,te=St();;)try{if(parseInt(re(246))/1*(parseInt(re(239))/2)+parseInt(re(248))/3*(-parseInt(re(241))/4)+parseInt(re(244))/5+-parseInt(re(236))/6*(parseInt(re(247))/7)+-parseInt(re(242))/8*(parseInt(re(243))/9)+-parseInt(re(238))/10+parseInt(re(237))/11*(parseInt(re(240))/12)==600322)break;te.push(te[ee(189)]())}catch{te.push(te[ee(189)]())}})();var Pt=Lt;function Lt(ee,re){var te=jt();return(Lt=function(ne,ie){return te[ne-=373]})(ee,re)}function jt(){var ee=t,re=[ee(485),ee(252),ee(684),ee(523),"column",ee(337),ee(515),ee(275),ee(159),ee(366),ee(332),ee(312),ee(197),ee(265),ee(321),ee(601),ee(752),ee(603),"$2-$3",ee(258),ee(534),ee(376),ee(769),ee(254),ee(392),ee(788),ee(216),ee(521),ee(295),ee(267),ee(255),"preferred-size",ee(629),"line",ee(181),ee(797),ee(593),ee(330),ee(288),"compat",ee(595),ee(186),ee(767),ee(384),ee(508),ee(339),"prepend","push",ee(503),ee(496),ee(472),ee(276),'style[data-emotion^="',ee(695),ee(346),ee(213),ee(789),ee(715),"head",ee(567),"448GdQtAv",ee(600),ee(711),ee(262),ee(509),ee(434),"flex-",ee(626),ee(318),ee(389),ee(560),ee(468),ee(463),ee(431),ee(781),"indexOf",ee(618),ee(207),ee(640)];return(jt=function(){return re})()}function zt(){var ee=t,re=[ee(320),ee(388),ee(405),ee(579),"35AIBzSb",ee(534),ee(505),ee(411),"1274024Vuuviq","length",ee(572),ee(478)];return(zt=function(){return re})()}function Ht(ee,re){var te=zt();return(Ht=function(ne,ie){return te[ne-=484]})(ee,re)}function Ft(ee,re){var te=Qt();return(Ft=function(ne,ie){return te[ne-=106]})(ee,re)}function Qt(){var ee=t,re=[ee(526),ee(340),ee(765),ee(703),ee(487),ee(489),ee(146),ee(639),ee(729),ee(664)];return(Qt=function(){return re})()}(function(){for(var ee=t,re=Lt,te=jt();;)try{if(parseInt(re(444))/1+parseInt(re(411))/2*(-parseInt(re(397))/3)+-parseInt(re(442))/4*(-parseInt(re(410))/5)+parseInt(re(416))/6+parseInt(re(394))/7*(-parseInt(re(375))/8)+parseInt(re(409))/9*(parseInt(re(373))/10)+-parseInt(re(377))/11*(parseInt(re(426))/12)==928149)break;te.push(te.shift())}catch{te[ee(795)](te[ee(189)]())}})(),Pt(387),(function(){for(var ee=t,re=Ht,te=zt();;)try{if(-parseInt(re(487))/1+parseInt(re(489))/2+-parseInt(re(495))/3*(parseInt(re(484))/4)+-parseInt(re(492))/5*(parseInt(re(493))/6)+parseInt(re(485))/7*(-parseInt(re(494))/8)+-parseInt(re(488))/9+parseInt(re(491))/10==772143)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){for(var ee=t,re=Ft,te=Qt();;)try{if(-parseInt(re(106))/1*(-parseInt(re(114))/2)+parseInt(re(115))/3*(parseInt(re(107))/4)+parseInt(re(112))/5+parseInt(re(110))/6+parseInt(re(108))/7+parseInt(re(109))/8+parseInt(re(113))/9*(-parseInt(re(111))/10)==797311)break;te[ee(795)](te[ee(189)]())}catch{te.push(te[ee(189)]())}})();var Zt=qt;function Gt(){var ee=t,re=["animationName","2256550Ipcodt",ee(173),"compiler transform.",ee(746),ee(462),ee(288),ee(801),ee(211),ee(500),ee(255),"number",ee(791),"NO_COMPONENT_SELECTOR","1182279EAtwWa",ee(682),ee(321),"1304688UcogLI",ee(247),"string",ee(569),"styles","45ISzOCs",ee(246),ee(777),ee(167),ee(672)];return(Gt=function(){return re})()}(function(){for(var ee=t,re=qt,te=Gt();;)try{if(-parseInt(re(249))/1+-parseInt(re(242))/2+parseInt(re(250))/3+parseInt(re(258))/4+-parseInt(re(248))/5*(parseInt(re(256))/6)+-parseInt(re(255))/7+parseInt(re(261))/8*(parseInt(re(236))/9)==662021)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();function qt(ee,re){var te=Gt();return(qt=function(ne,ie){return te[ne-=236]})(ee,re)}function Jt(ee,re){var te=Yt();return(Jt=function(ne,ie){return te[ne-=142]})(ee,re)}function Yt(){var ee=t,re=[ee(368),ee(305),"registered",ee(262),"styles",ee(255),ee(374),ee(629),ee(633),ee(615),ee(663),ee(753),ee(275),ee(802),"push",ee(593),ee(321),ee(491),ee(258),ee(666)];return(Yt=function(){return re})()}function Vt(){var ee=t,re=[ee(578),ee(321),ee(258),ee(629),ee(255),ee(449),ee(250),ee(333),ee(502),"bind",ee(573),"281145OZnPDr",ee(547),"3uNmnOL",ee(159),ee(186),ee(291),ee(275),ee(476),ee(593),ee(365),ee(173),ee(515),ee(753),"6198910frrjDN",ee(413),ee(300),"animation-",ee(195),ee(599),"object"];return(Vt=function(){return re})()}function Wt(ee,re){var te=Vt();return(Wt=function(ne,ie){return te[ne-=250]})(ee,re)}Object[Rt(245)](null),Zt(246),t(408),Zt(244),(function(){for(var ee=t,re=Jt,te=Yt();;)try{if(-parseInt(re(146))/1+-parseInt(re(155))/2+-parseInt(re(144))/3+-parseInt(re(157))/4+parseInt(re(156))/5*(parseInt(re(149))/6)+parseInt(re(153))/7*(parseInt(re(142))/8)+parseInt(re(145))/9==509549)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){for(var ee=t,re=Wt,te=Vt();;)try{if(parseInt(re(274))/1*(-parseInt(re(253))/2)+-parseInt(re(258))/3*(-parseInt(re(270))/4)+parseInt(re(256))/5*(parseInt(re(273))/6)+parseInt(re(250))/7+-parseInt(re(276))/8*(parseInt(re(261))/9)+parseInt(re(269))/10*(parseInt(re(263))/11)+-parseInt(re(257))/12==769621)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();const Mt=$t;function Xt(){var ee=t;const re=[ee(191),ee(751),"toCamelCase",ee(446),ee(325),ee(210),"toPascalCase",ee(284),ee(154),ee(726),ee(288),ee(617),ee(768),ee(343),ee(394),"4804168lIEQdb",ee(410),ee(539),ee(430),ee(678),ee(353),"_lowerCase",ee(596),ee(733),ee(518),"charAt",ee(687),ee(527),ee(262),"42wLrOPC",ee(285),"toLowerCase",ee(470),ee(514)];return(Xt=function(){return re})()}function Kt(ee,re,te){return re in ee?Object.defineProperty(ee,re,{value:te,enumerable:!0,configurable:!0,writable:!0}):ee[re]=te,ee}(function(){var ee=t;const re=$t,te=Xt();for(;;)try{if(-parseInt(re(224))/1+parseInt(re(230))/2+-parseInt(re(242))/3*(parseInt(re(238))/4)+-parseInt(re(236))/5+-parseInt(re(228))/6*(-parseInt(re(252))/7)+-parseInt(re(240))/8+parseInt(re(227))/9==959733)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te.shift())}})();class _t{static[Mt(241)](re,te=!1){const ne=Mt;return te?this[ne(239)](re)[ne(253)](" ")[ne(241)]():re[ne(241)]()}static[t(429)](re,te=!1){var ne=t;const ie=Mt;return te?this[ie(244)](re)[ie(233)](/ /g," "):re[ne(429)]()}static[t(741)](re){const te=Mt;return this[te(249)](te(241))(re)}static[Mt(234)](re){const te=Mt;return this[te(249)](te(220))(re)}static[Mt(225)](re){var te=t;const ne=Mt;return this[ne(239)](re)[te(527)](((ie,oe)=>oe===0?ie[te(429)]():this[ne(222)](ie[ne(220)]())))[ne(253)]("")}static[Mt(229)](re){var te=t;const ne=Mt;return this._startCase(this[ne(225)](re))[te(288)](/ /g,"")}static[Mt(243)](re){const te=Mt;return this[te(239)](re)[te(253)]("-")}static[t(761)](re){const te=Mt;return this[t(410)](re)[te(253)]("_")}static[Mt(245)](re){return this[Mt(244)](re).replace(/ /g,".")}static[Mt(221)](re){const te=Mt;return this[te(222)](this[te(244)](re))}static toSlugCase(re){const te=Mt;return this[te(244)](re)[te(233)](/ /g,"-")}static[Mt(237)](re){return this[Mt(239)](re)}static[Mt(239)](re){const te=Mt;return re[te(233)](/([a-z])([A-Z])/g,te(231))[te(233)](/[\s_-]+/g," ")[te(220)]()[te(247)](/[a-zà-öø-ÿ0-9]+/gi)||[]}static[t(538)](re){var te=t;const ne=Mt;return this[ne(239)](re)[te(527)]((ie=>ie[ne(220)]()))[ne(253)](" ")}static[Mt(222)](re){const te=Mt;return re[te(248)](0)[te(241)]()+re[te(246)](1)[te(220)]()}static _startCase(re){const te=Mt;return this[t(410)](re)[te(250)]((ne=>this[te(222)](ne)))[te(253)](" ")}}function $t(ee,re){const te=Xt();return($t=function(ne,ie){return te[ne-=220]})(ee,re)}Kt(_t,t(748),((ee,re=!1,{splitChar:te=" ",joinChar:ne=" ",to:ie=Mt(223)}={splitChar:" ",joinChar:" ",to:Mt(223)})=>{const oe=Mt,se=ee!==void 0?ee[oe(226)]():"";return se?re?_t[oe(235)](se):se[oe(251)](te).map((ae=>{var ue=rn;const ce=oe;return ie===ce(232)?ae[ce(248)](0)[ue(571)]()+ae[ce(246)](1)[ue(429)]():ae[ce(248)](0).toUpperCase()+ae[ce(246)](1)[ce(220)]()}))[oe(253)](ne):""})),Kt(_t,Mt(249),(ee=>re=>{var te=t;const ne=Mt;if(!re)return"";const ie=re[ne(246)](0,1),oe=re[ne(246)](1);return ie[ee]!==void 0&&te(672)==typeof ie[ee]?ie[ee]()+oe:re}));const tn=nn;function nn(ee,re){const te=en();return(nn=function(ne,ie){return te[ne-=328]})(ee,re)}function rn(ee,re){var te=e();return(rn=function(ne,ie){return te[ne-=141]})(ee,re)}function en(){var ee=t;const re=[ee(460),ee(638),"pascal",ee(620),ee(152),ee(353),"object",ee(796),ee(719),ee(761),ee(536),ee(222),ee(758),ee(356),ee(747),ee(704),ee(527),ee(194),ee(681),ee(561)];return(en=function(){return re})()}(function(){var ee=t;const re=nn,te=en();for(;;)try{if(parseInt(re(337))/1*(parseInt(re(342))/2)+-parseInt(re(329))/3+parseInt(re(346))/4+parseInt(re(345))/5+-parseInt(re(341))/6+-parseInt(re(333))/7*(-parseInt(re(339))/8)+-parseInt(re(330))/9==892829)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),t(681),tn(332);function an(){var ee=t;const re=[ee(314),ee(249),ee(764),ee(792),"7920680CrCzXO",ee(776),"kebab",ee(532),ee(400),"1889976zPDrSf",ee(681),ee(165),"574270pCgwUB"];return(an=function(){return re})()}function sn(ee,re){const te=an();return(sn=function(ne,ie){return te[ne-=199]})(ee,re)}function on(ee,re){const te=pn();return(on=function(ne,ie){return te[ne-=310]})(ee,re)}function pn(){var ee=t;const re=["strategy","5941134AnJjDR",ee(435),"REQUIRED",ee(403),ee(298),ee(507),ee(277),ee(304),ee(185),ee(217),"168yAApGZ","210166RwrXjV",ee(288),"replacer",ee(660),ee(341),ee(431),ee(422),ee(497),"parameters.search"];return(pn=function(){return re})()}function cn(ee,re){const te=un();return(cn=function(ne,ie){return te[ne-=245]})(ee,re)}function un(){var ee=t;const re=[ee(757),ee(288),"749930AnkLQM",ee(345),ee(475),ee(244),ee(395),ee(316),"77UAdnad",ee(161),ee(245),ee(446),ee(286),ee(725)];return(un=function(){return re})()}function In(){var ee=t;const re=[ee(235),ee(583),ee(580),ee(224),ee(355),ee(787),ee(653),ee(256),ee(612),"90faVQnR",ee(486)];return(In=function(){return re})()}function fn(ee,re){const te=In();return(fn=function(ne,ie){return te[ne-=199]})(ee,re)}function hn(){var ee=t;const re=["location",ee(728),ee(574),"2xpcQKU","push","768628jYCGxS",ee(756),"24FLVsmp",ee(752),ee(293),"978200aOzrna",ee(488),"63KlvtSY",ee(277),ee(553),ee(231),ee(679),ee(336),ee(507),ee(422),ee(527)];return(hn=function(){return re})()}function vn(ee,re){const te=hn();return(vn=function(ne,ie){return te[ne-=482]})(ee,re)}function ln(ee,re){const te=dn();return(ln=function(ne,ie){return te[ne-=252]})(ee,re)}function dn(){var ee=t;const re=[ee(759),ee(605),ee(261),ee(585),ee(790),ee(383),ee(637),"104DOhoZO","preconnect",ee(215),ee(175),"5jiSoDi",ee(658)];return(dn=function(){return re})()}(function(){var ee=t;const re=sn,te=an();for(;;)try{if(parseInt(re(206))/1*(-parseInt(re(208))/2)+-parseInt(re(199))/3*(parseInt(re(210))/4)+parseInt(re(204))/5+-parseInt(re(201))/6+-parseInt(re(200))/7+parseInt(re(209))/8+parseInt(re(205))/9==606311)break;te[ee(795)](te[ee(189)]())}catch{te.push(te[ee(189)]())}})(),(function(){var ee=t;const re=on,te=pn();for(;;)try{if(parseInt(re(317))/1*(-parseInt(re(321))/2)+-parseInt(re(314))/3*(parseInt(re(319))/4)+parseInt(re(325))/5*(-parseInt(re(310))/6)+-parseInt(re(313))/7*(-parseInt(re(320))/8)+-parseInt(re(324))/9+parseInt(re(328))/10+parseInt(re(311))/11==808336)break;te.push(te[ee(189)]())}catch{te.push(te[ee(189)]())}})(),(function(){var ee=t;const re=cn,te=un();for(;;)try{if(-parseInt(re(252))/1+-parseInt(re(249))/2*(-parseInt(re(257))/3)+parseInt(re(254))/4+-parseInt(re(253))/5*(-parseInt(re(258))/6)+parseInt(re(246))/7+-parseInt(re(245))/8*(parseInt(re(250))/9)+-parseInt(re(256))/10*(parseInt(re(248))/11)==300232)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){var ee=t;const re=fn,te=In();for(;;)try{if(-parseInt(re(200))/1*(parseInt(re(203))/2)+parseInt(re(209))/3+parseInt(re(202))/4+-parseInt(re(206))/5*(parseInt(re(201))/6)+-parseInt(re(199))/7*(parseInt(re(208))/8)+parseInt(re(207))/9*(parseInt(re(205))/10)+parseInt(re(204))/11==198596)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){var ee=t;const re=vn,te=hn();for(;;)try{if(parseInt(re(488))/1+-parseInt(re(497))/2*(parseInt(re(496))/3)+-parseInt(re(501))/4*(parseInt(re(487))/5)+-parseInt(re(482))/6+parseInt(re(499))/7+-parseInt(re(495))/8+-parseInt(re(485))/9*(-parseInt(re(483))/10)==155517)break;te[ee(795)](te.shift())}catch{te[ee(795)](te.shift())}})(),(function(){var ee=t;const re=ln,te=dn();for(;;)try{if(parseInt(re(254))/1+parseInt(re(257))/2+parseInt(re(260))/3+-parseInt(re(252))/4*(-parseInt(re(253))/5)+-parseInt(re(258))/6+parseInt(re(256))/7+parseInt(re(262))/8*(-parseInt(re(261))/9)==402722)break;te[ee(795)](te.shift())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){var ee=t;const re=bn,te=yn();for(;;)try{if(parseInt(re(397))/1*(-parseInt(re(389))/2)+-parseInt(re(394))/3*(parseInt(re(383))/4)+parseInt(re(391))/5+-parseInt(re(384))/6*(-parseInt(re(388))/7)+parseInt(re(382))/8*(-parseInt(re(393))/9)+parseInt(re(386))/10+parseInt(re(392))/11==453357)break;te[ee(795)](te.shift())}catch{te[ee(795)](te[ee(189)]())}})();function bn(ee,re){const te=yn();return(bn=function(ne,ie){return te[ne-=382]})(ee,re)}function yn(){var ee=t;const re=[ee(581),ee(589),ee(702),ee(759),"api","9885ktAjwX","515144gJwABd",ee(461),ee(352),ee(455),ee(709),"environment",ee(782),ee(360),ee(790),ee(609)];return(yn=function(){return re})()}function kn(ee,re){const te=mn();return(kn=function(ne,ie){return te[ne-=188]})(ee,re)}function mn(){var ee=t;const re=[ee(513),ee(744),ee(230),ee(151),ee(354),ee(170),ee(638),"42ZfbLkm",ee(529),ee(527),"length",ee(656),ee(793),ee(328),ee(479),ee(737),"84AZtHRP"];return(mn=function(){return re})()}(function(){var ee=t;const re=kn,te=mn();for(;;)try{if(parseInt(re(200))/1*(-parseInt(re(191))/2)+parseInt(re(195))/3*(-parseInt(re(193))/4)+-parseInt(re(196))/5*(parseInt(re(192))/6)+-parseInt(re(188))/7+-parseInt(re(203))/8+-parseInt(re(190))/9*(parseInt(re(189))/10)+parseInt(re(202))/11*(parseInt(re(204))/12)==863321)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();const On=En;function En(ee,re){const te=Tn();return(En=function(ne,ie){return te[ne-=135]})(ee,re)}(function(){var ee=t;const re=En,te=Tn();for(;;)try{if(-parseInt(re(139))/1*(parseInt(re(147))/2)+-parseInt(re(142))/3+-parseInt(re(140))/4+-parseInt(re(143))/5*(-parseInt(re(148))/6)+parseInt(re(137))/7*(parseInt(re(141))/8)+-parseInt(re(138))/9+-parseInt(re(136))/10*(-parseInt(re(145))/11)==902131)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})();const wn={environment:ee=>typeof ee===On(146)&&/^(sandbox|production)$/[t(690)](ee),version:ee=>ee===On(144)||typeof ee===On(146)&&/^v\d{1,2}(\.\d{0,3}){0,3}$/[On(135)](ee)},Dn=ee=>{var re;((te,ne)=>{var ie=t;const oe=kn;if(te&&ne){const se=Object[ie(359)](te)[ie(422)]((ae=>!ne[oe(194)](ae)||ne[ae]===void 0||!te[ae](ne[ae])))[oe(197)]((ae=>new C(s[oe(201)],ae,!0)));if(se[oe(198)]){const[ae]=se;throw ae}}})(wn,ee),(re=ee)&&(Y=Object.assign({},Y,re))};function Tn(){var ee=t;const re=[ee(591),ee(576),ee(611),"4202RbmDMY",ee(445),ee(727),ee(517),ee(690),ee(624),ee(292),ee(717),ee(299),"1611912xHkDlR",ee(452)];return(Tn=function(){return re})()}function gn(){var ee=t;const re=[ee(379),ee(380),ee(686),ee(522),"248VddyCN","1828569LfJoFC","11940faSemP",ee(661),ee(482),"9YYlhsV",ee(457),ee(651),ee(375),ee(255),ee(641),ee(160)];return(gn=function(){return re})()}(function(){var ee=t;const re=Cn,te=gn();for(;;)try{if(-parseInt(re(271))/1*(-parseInt(re(278))/2)+-parseInt(re(275))/3+-parseInt(re(274))/4*(-parseInt(re(266))/5)+-parseInt(re(280))/6*(-parseInt(re(272))/7)+parseInt(re(277))/8*(-parseInt(re(279))/9)+parseInt(re(269))/10*(-parseInt(re(270))/11)+-parseInt(re(276))/12*(-parseInt(re(268))/13)==356241)break;te[ee(795)](te.shift())}catch{te[ee(795)](te.shift())}})();function Cn(ee,re){const te=gn();return(Cn=function(ne,ie){return te[ne-=266]})(ee,re)}function Nn(){var ee=t;const re=[ee(422),ee(530),ee(338),ee(202),"push",ee(183),ee(740),ee(763),"137247nsOmnY",ee(544),ee(554),ee(628),ee(297),ee(555)];return(Nn=function(){return re})()}function Un(ee,re){const te=Nn();return(Un=function(ne,ie){return te[ne-=169]})(ee,re)}function An(ee,re){var te=xn();return(An=function(ne,ie){return te[ne-=337]})(ee,re)}function xn(){var ee=t,re=[ee(466),ee(762),ee(255),ee(548),ee(391),ee(557),ee(277),ee(706),"2051dwZdDh",ee(199),ee(503),ee(342),ee(422),"182295YeOYne",ee(382),ee(575),ee(520),ee(629),"apply","40247440IrIkgT",ee(672),"push","getOwnPropertyDescriptors","indexOf",ee(326),ee(359)];return(xn=function(){return re})()}function Rn(){var ee=t,re=["16oYUCaR",ee(495),ee(643),ee(220),"944418PqxCQU","808467xfwLHr",ee(283),"10QxKTBX",ee(153),ee(459)];return(Rn=function(){return re})()}function Sn(ee,re){var te=Rn();return(Sn=function(ne,ie){return te[ne-=171]})(ee,re)}function Pn(){var ee=["INVALID","UNHANDLED","HTTP","UNAUTHORIZED","13163230kGdpsc","856juyAkB","TIMEOUT","350256uPlzjN","5054ruXNQI","2450577zCNjjI","2339148NeQscF","REQUEST_TIMEOUT","REQUIRED","BAD_REQUEST","60389xcocgx","11tPlygx","NOT_FOUND","301vJXIvb","UNABLE_TO_FIND","NOT_LOADED","6497910YprBBF","40ngIbUX","UNDEFINED"];return(Pn=function(){return ee})()}var Ln,jn,zn,Hn,Fn,Qn,Zn,Gn,Bn,qn,Jn,Yn;function Vn(ee,re){var te=Pn();return(Vn=function(ne,ie){return te[ne-=335]})(ee,re)}function Wn(ee,re){var te=Mn();return(Wn=function(ne,ie){return te[ne-=341]})(ee,re)}function Mn(){var ee=["CopyButton","copy-button","reveal","2917173skLMeQ","1820964OqZzNt","510315wlwfez","441522swQxzn","3761920KVvMuv","8178336dFaxYN","Reveal","5qbCaQQ","4044603UhdGqT"];return(Mn=function(){return ee})()}function Xn(ee,re){var te=Kn();return(Xn=function(ne,ie){return te[ne-=235]})(ee,re)}function Kn(){var ee=["production","33vyRaSe","238515PNqZTX","2664777SEHPlq","200dnfHzp","4RQDQWC","14080653FGOkOA","sandbox","1893258distuZ","SANDBOX","1705123ZWIxjP","171829ajvFNO","7942010cWpsFH","84YuXwGF"];return(Kn=function(){return ee})()}function _n(){var ee=["270103qoQgEd","12itkIzk","14nsIwws","9iCTJgp","74736ETbfqk","44358azBwEp","10oyDFLF","4394507nLBhNm","2eigAEs","2127030LnauBX","11vgTOSS","164277JtqPnT","10312LfzXXQ"];return(_n=function(){return ee})()}function $n(ee,re){var te=_n();return($n=function(ne,ie){return te[ne-=366]})(ee,re)}function tr(ee,re){const te=rr();return(tr=function(ne,ie){return te[ne-=152]})(ee,re)}(function(){var ee=t;const re=Un,te=Nn();for(;;)try{if(-parseInt(re(172))/1*(-parseInt(re(174))/2)+parseInt(re(179))/3+parseInt(re(177))/4*(-parseInt(re(173))/5)+-parseInt(re(182))/6*(-parseInt(re(181))/7)+parseInt(re(169))/8+-parseInt(re(170))/9+parseInt(re(178))/10*(-parseInt(re(180))/11)==757080)break;te[ee(795)](te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){for(var ee=t,re=An,te=xn();;)try{if(parseInt(re(355))/1+parseInt(re(342))/2*(parseInt(re(357))/3)+parseInt(re(338))/4+-parseInt(re(362))/5+parseInt(re(340))/6*(parseInt(re(339))/7)+parseInt(re(358))/8*(parseInt(re(344))/9)+-parseInt(re(350))/10==959569)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){for(var ee=t,re=Sn,te=Rn();;)try{if(-parseInt(re(172))/1+-parseInt(re(175))/2*(-parseInt(re(173))/3)+parseInt(re(174))/4+-parseInt(re(177))/5+-parseInt(re(171))/6*(-parseInt(re(180))/7)+-parseInt(re(178))/8*(parseInt(re(179))/9)+parseInt(re(176))/10==940869)break;te.push(te[ee(189)]())}catch{te[ee(795)](te[ee(189)]())}})(),(function(){for(var ee=Vn,re=Pn();;)try{if(parseInt(ee(336))/1*(-parseInt(ee(350))/2)+-parseInt(ee(351))/3+parseInt(ee(352))/4+parseInt(ee(340))/5*(parseInt(ee(349))/6)+parseInt(ee(356))/7*(-parseInt(ee(347))/8)+parseInt(ee(339))/9+-parseInt(ee(346))/10*(-parseInt(ee(357))/11)===589533)break;re.push(re.shift())}catch{re.push(re.shift())}})(),(jn=Ln||(Ln={}))[(zn=Vn)(354)]="REQUIRED",jn[zn(341)]=zn(341),jn[zn(337)]="UNABLE_TO_FIND",jn.NOT_LOADED=zn(338),jn[zn(342)]=zn(342),jn.HTTP=zn(344),jn[zn(348)]=zn(348),jn[zn(343)]=zn(343),Fn=Hn||(Hn={}),Qn=Vn,Fn[Fn.OK=200]="OK",Fn[Fn[Qn(355)]=400]=Qn(355),Fn[Fn[Qn(335)]=404]=Qn(335),Fn[Fn.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",Fn[Fn[Qn(353)]=408]=Qn(353),Fn[Fn.UNAUTHORIZED=401]=Qn(345),(function(){for(var ee=Wn,re=Mn();;)try{if(parseInt(ee(345))/1+-parseInt(ee(344))/2+-parseInt(ee(351))/3+parseInt(ee(347))/4+-parseInt(ee(350))/5*(-parseInt(ee(346))/6)+parseInt(ee(343))/7+parseInt(ee(348))/8===704730)break;re.push(re.shift())}catch{re.push(re.shift())}})(),(Gn=Zn||(Zn={}))[(Bn=Wn)(349)]=Bn(342),Gn[Bn(352)]=Bn(341),(function(){for(var ee=Xn,re=Kn();;)try{if(-parseInt(ee(236))/1+-parseInt(ee(248))/2+parseInt(ee(243))/3*(parseInt(ee(245))/4)+parseInt(ee(242))/5*(-parseInt(ee(239))/6)+parseInt(ee(237))/7*(-parseInt(ee(244))/8)+parseInt(ee(246))/9+-parseInt(ee(238))/10*(-parseInt(ee(241))/11)===902110)break;re.push(re.shift())}catch{re.push(re.shift())}})(),Jn=qn||(qn={}),Yn=Xn,Jn.PRODUCTION=Yn(240),Jn[Yn(235)]=Yn(247),(function(){for(var ee=$n,re=_n();;)try{if(-parseInt(ee(368))/1*(-parseInt(ee(376))/2)+-parseInt(ee(371))/3*(parseInt(ee(367))/4)+parseInt(ee(374))/5*(parseInt(ee(373))/6)+parseInt(ee(370))/7*(parseInt(ee(372))/8)+-parseInt(ee(366))/9+-parseInt(ee(377))/10*(-parseInt(ee(378))/11)+-parseInt(ee(369))/12*(parseInt(ee(375))/13)===152250)break;re.push(re.shift())}catch{re.push(re.shift())}})(),(function(){const ee=tr,re=rr();for(;;)try{if(-parseInt(ee(166))/1*(parseInt(ee(155))/2)+parseInt(ee(157))/3+parseInt(ee(164))/4+-parseInt(ee(159))/5+parseInt(ee(158))/6*(parseInt(ee(168))/7)+parseInt(ee(165))/8*(-parseInt(ee(152))/9)+parseInt(ee(154))/10===424938)break;re.push(re.shift())}catch{re.push(re.shift())}})();const nr=()=>new Promise(((ee,re)=>{const te=tr;if(((ne=nt[t(172)])=>{const ie=Cn;try{return document.querySelectorAll(ie(273)+ne+ie(281))[ie(267)]>0}catch{return!1}})()&&window[te(153)])ee(window[te(153)]);else if(!window[te(153)]){const ne=(()=>{const ie=tr,oe=document.createElement(ie(161));return oe.src=nt.getFullCdn(ie(156),ie(163)),ut(oe),oe})();return ne.onload=()=>{const ie=te;window[ie(153)]?ee(window.APTokenizer):re(new C(Ln[ie(167)],ie(160),!0))},void(ne[te(162)]=()=>re(new C(Ln[te(169)],"SCRIPT",!0)))}}));function rr(){const ee=["31456JYMHzf","928wCafiN","156wRIJHE","UNDEFINED","2317DECIua","NOT_LOADED","62802oYTinX","APTokenizer","20534150rAmYXS","8482vGJDwh","tokenizer-sdk","793641JyeeYi","2676hrMTeo","2887350YWJLUu","Astropay Web Tokenizer","script","onerror","astropay-tokenizer.min.js"];return(rr=function(){return ee})()}var er=cr;function ar(ee,re,te,ne,ie,oe,se){var ae=cr;try{var ue=ee[oe](se),ce=ue[ae(293)]}catch(le){return void te(le)}ue[ae(304)]?re(ce):Promise.resolve(ce)[ae(303)](ne,ie)}(function(){for(var ee=cr,re=ir();;)try{if(-parseInt(ee(297))/1+-parseInt(ee(301))/2*(parseInt(ee(302))/3)+parseInt(ee(292))/4+parseInt(ee(305))/5+-parseInt(ee(300))/6+parseInt(ee(295))/7*(parseInt(ee(294))/8)+parseInt(ee(306))/9*(parseInt(ee(298))/10)===667472)break;re.push(re.shift())}catch{re.push(re.shift())}})(),Promise[er(308)]()[er(303)]((()=>{var ee=er;typeof window!==ee(299)&&!window[ee(291)]&&((()=>{const re=bn;It(re(385),H[re(395)][re(390)][V()[re(387)]]),It(re(385),H[re(395)][re(396)][V()[re(387)]])})(),(()=>{var re=t;const te=ln;It(te(263),H[te(255)][te(259)][V()[te(264)]]),It(te(263),H[te(255)][re(363)][V()[te(264)]])})())}));const sr=(or=function*(ee){Dn(ee);const re={initRevealer:(te=ee)=>{var ne,ie=cr;return(ne=window[ie(291)])===null||ne===void 0?void 0:ne[ie(307)](te)},initCollector:(te=ee)=>{var ne,ie=cr;return(ne=window[ie(291)])===null||ne===void 0?void 0:ne[ie(289)](te)}};return new Promise(((te,ne)=>{var ie=cr;typeof window!==ie(299)?window[ie(291)]?te(re):nr()[ie(303)]((()=>{te(re)}))[ie(296)]((oe=>{ne(oe)})):ne(ie(290))}))},pr=function(){var ee=this,re=arguments;return new Promise((function(te,ne){var ie=or[cr(309)](ee,re);function oe(ae){ar(ie,te,ne,oe,se,"next",ae)}function se(ae){ar(ie,te,ne,oe,se,"throw",ae)}oe(void 0)}))},function(ee){return pr[cr(309)](this,arguments)});var or,pr;function cr(ee,re){var te=ir();return(cr=function(ne,ie){return te[ne-=289]})(ee,re)}function ir(){var ee=["APTokenizer","4582976tSGCgi","value","373232tEwSlg","63KVvFap","catch","1156122MmdZsQ","142260eHWUOj","undefined","7303908VsgDsd","6URBYWa","276963Gnzkoo","then","done","3355345JCZnlM","684orEnOE","initRevealer","resolve","apply","initCollector","new SDKError(ErrorType.UNDEFINED, 'window', true)"];return(ir=function(){return ee})()}class CardService{}xe(CardService,"getPciToken",async re=>{try{return await HttpClient.POST({url:END_POINTS.pciToken,data:re})}catch(te){return DataDogTracker.trackError(te),Promise.reject(te)}});const formatCardExpiryDate=ee=>{if(!ee)return"";const te=ee.replace(/\s+/g,"").split("/");if(te.length!==2)return"";let[ne,ie]=te;if(ne.length===1&&(ne="0"+ne),ie.length===2){const oe=new Date().getFullYear(),se=Math.floor(oe/100)*100;ie=String(se+Number(ie))}return`${ne}/${ie}`},APTokenizerVersion="v1.1.3";class CardApService{constructor(re,te){xe(this,"collector");xe(this,"form");xe(this,"fields");xe(this,"callback");this.fields=re,this.callback=te}async init(re){try{const te=await sr({environment:this.getCardEnvironment(),version:APTokenizerVersion});this.collector=te.initCollector(),this.form=this.collector.createForm(ne=>{if(this.callback){const ie=Object.entries(ne).reduce((oe,[se,ae])=>(oe[se]={isValid:ae.isValid||!ae.isDirty&&!ae.isTouched,isTouched:ae.isTouched||ae.isDirty},oe),{});this.callback(ie)}}),this.fields.forEach(({field:ne,...ie})=>{this.form.field(ne,ie)}),re==null||re()}catch(te){throw console.error(te),te}}async tokenizeCard(re,te,ne){try{const{accessToken:ie}=await CardService.getPciToken(re);return this.form.accessToken=ie,await new Promise(oe=>{this.form.submit(se=>{var le,de,fe,he,pe,ge;const ae=(le=se.card_number)==null?void 0:le.details,ue=ae==null?void 0:ae.bin;if(!ue){ne(new Error(AstroPayI18n.translate("card_tokenization_error")));return}const ce={cardNumberTkn:((fe=(de=se.card_number)==null?void 0:de.value)==null?void 0:fe.trim())||"",cvvToken:((he=se.card_cvc)==null?void 0:he.value)||"",holderName:(pe=se.card_holder)==null?void 0:pe.value,expirationDate:formatCardExpiryDate((ge=se.card_exp)==null?void 0:ge.value),firstSixDigits:ue?ue.substring(0,6):"",lastFourDigits:(ae==null?void 0:ae.lastFour)||"",brand:(ae==null?void 0:ae.brand)||"unknown"};te(ce),oe()},()=>{ne(new Error(AstroPayI18n.translate("card_tokenization_error")))})})}catch{ne(new Error(AstroPayI18n.translate("generic_error")))}}unmount(){var re;(re=this.form)==null||re.tearDown()}getCardEnvironment(){return AstroPayConfig.getEnvironment()==="production"?"production":"sandbox"}}var ECardPayStatus=(ee=>(ee.PENDING="PENDING",ee.REJECTED="REJECTED",ee))(ECardPayStatus||{});class PaymentMethodsService{}xe(PaymentMethodsService,"getPaymentMethodDetail",async re=>{try{return await HttpClient.GET({url:buildPathWithParams(END_POINTS.paymentMethodDetail,{paymentExternalId:re.paymentExternalId,methodCode:re.methodCode})})}catch(te){return Promise.reject(te)}});const CARD_STYLES=(ee,re)=>({fontSize:"16px",lineHeight:"24px",color:ee,backgroundColor:"inherit",fontFamily:`${re.fontFamily}, sans-serif;`}),getCardPaymentMethodStyles=(ee,{error:re=!1,disabled:te=!1})=>css`
|
|
933
933
|
display: flex;
|
|
934
934
|
flex-direction: column;
|
|
935
|
-
gap:
|
|
935
|
+
gap: 8px;
|
|
936
936
|
|
|
937
937
|
.loading-wrapper {
|
|
938
938
|
display: flex;
|
|
@@ -958,6 +958,14 @@ Minimum version required to store current data is: `+Re+`.
|
|
|
958
958
|
width: 100%;
|
|
959
959
|
}
|
|
960
960
|
|
|
961
|
+
.row-container .input-container {
|
|
962
|
+
height: 100%;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
.row-container .input-container > *:first-child {
|
|
966
|
+
flex: 1;
|
|
967
|
+
}
|
|
968
|
+
|
|
961
969
|
.center-row {
|
|
962
970
|
display: flex;
|
|
963
971
|
justify-content: center;
|
|
@@ -1000,7 +1008,7 @@ Minimum version required to store current data is: `+Re+`.
|
|
|
1000
1008
|
}
|
|
1001
1009
|
`,getCardFieldStyles=()=>css`
|
|
1002
1010
|
width: 100%;
|
|
1003
|
-
`;class CardField extends Component{constructor({id:te,label:ne,initialHelperText:ie,isValid:oe=!0}){super({tag:"div",styles:()=>getCardFieldStyles()});xe(this,"inputContainer");xe(this,"labelTextElement",null);xe(this,"helperTextElement",null);xe(this,"id");this.id=te;const se=inputStyle(!oe);if(this.inputContainer=document.createElement("div"),this.inputContainer.classList.add("input-container"),ne){const ue=document.createElement("label");this.labelTextElement=new Typography({text:ne,size:se.label.size,weight:se.label.weight,color:se.label.color}).element,ue.append(this.labelTextElement),ue.htmlFor=te,this.inputContainer.append(this.labelTextElement)}const ae=document.createElement("div");ae.id=te,ae.classList.add("form-field"),this.inputContainer.append(ae),ie&&(this.helperTextElement=new Typography({text:ie,size:se.helperText.size,weight:se.helperText.weight,color:se.helperText.color}).element,this.inputContainer.append(this.helperTextElement)),this.element.append(this.inputContainer)}setHelperText(te,ne=!0){const ie=inputStyle(!ne);this.helperTextElement||(this.helperTextElement=new Typography({text:te,size:ie.helperText.size,weight:ie.helperText.weight,color:ie.helperText.color}).element,this.inputContainer.append(this.helperTextElement)),this.helperTextElement.textContent=te,this.helperTextElement.style.color=ie.helperText.color}setValid(te){if(this.labelTextElement){const ie=inputStyle(!te);this.labelTextElement.style.color=ie.label.color}const ne=this.element.querySelector(`#${this.id}`);ne&&ne.classList.toggle("card-input-error",!te)}resetValidation(){this.setValid(!0),this.setHelperText("",!0)}}const APCardsFields=(ee,re,te)=>[{field:"#cc-holder",type:"text",name:"card_holder",placeholder:"card_holder_placeholder",autocomplete:"off",validations:["required","/^[a-zA-Z ]{0,200}$/"],styles:CARD_STYLES(ee,te)},{field:"#cc-number",type:"card-number",name:"card_number",placeholder:"4111 1111 1111 1111",autocomplete:"off",validations:["required","validCardNumber"],styles:CARD_STYLES(ee,te)},{field:"#cc-expiration-date",type:"card-expiration-date",name:"card_exp",lengthYear:re==="MM/YY"?2:4,placeholder:re,autocomplete:"off",validations:["required","validCardExpirationDate"],styles:CARD_STYLES(ee,te)},{field:"#cc-cvc",type:"card-security-code",name:"card_cvc",placeholder:"123",autocomplete:"off",validations:["required","/^\\d{3,4}$/"],styles:CARD_STYLES(ee,te)}],EMPTY_FORM_DATA={card_holder:{isValid:!0,isTouched:!1},card_number:{isValid:!0,isTouched:!1},card_exp:{isValid:!0,isTouched:!1},card_cvc:{isValid:!0,isTouched:!1}},formatInstallmentContent=(ee,re)=>{const{installmentNumber:te,installmentAmount:ne,totalAmount:ie}=ee,oe=AstroPayConfig.getCurrencyMode(),se=formatAmountCurrency(ne,re,oe),ae=formatAmountCurrency(ie,re,oe);return`${te}x ${se} (${ae})`},createInstallmentBadge=ee=>{const{hasInterest:re,interestValue:te}=ee;return re?new Typography({text:te,size:"small",weight:500}).element:new Badge({items:[{title:te}],variant:"highlight"}).element},mountInstallmentData=(ee,re)=>{var te;return(te=ee==null?void 0:ee.data)!=null&&te.length?ee.data.map(ne=>({value:ne.installmentNumber,content:formatInstallmentContent(ne,re),rightContent:createInstallmentBadge(ne),meta:ne})):[]},DEFAULT_EXPIRATION_DATE_FORMAT="MM/YY";class CardPaymentMethod extends Component{constructor(te){super({tag:"div",styles:ne=>getCardPaymentMethodStyles(ne,{error:!1,disabled:!1})});xe(this,"componentProps");xe(this,"loadingWrapper");xe(this,"btnPay",null);xe(this,"paymentSummary",null);xe(this,"cardManager",null);xe(this,"cardHolderInput",null);xe(this,"cardNumberInput",null);xe(this,"cardExpInput",null);xe(this,"cardCvvInput",null);xe(this,"requiredFieldsForm",null);xe(this,"formState",EMPTY_FORM_DATA);xe(this,"isFormTemplateValid",!1);xe(this,"selectedInstallment");xe(this,"hasInstallments",!1);xe(this,"pollingService",null);this.componentProps={...te,showPaymentSummary:te.showPaymentSummary??!0,expirationDateFormat:te.expirationDateFormat??DEFAULT_EXPIRATION_DATE_FORMAT},this.loadingWrapper=this.createLoadingWrapper(AstroPayI18n.translate("hold_on")),this.element.append(this.loadingWrapper),sessionStorage.getItem(EStorageKey.SESSION_ID)||sessionStorage.setItem(EStorageKey.SESSION_ID,uuid()),this.fetchPaymentMethodDetail()}async fetchPaymentMethodDetail(){try{const te=await PaymentMethodsService.getPaymentMethodDetail({paymentExternalId:this.componentProps.paymentExternalId,methodCode:this.componentProps.paymentMethod.code});this.renderCardSection(te.fields,te.installments)}catch(te){const ne=te;this.showErrorMessage(ne.description??ne.message)}finally{this.loadingWrapper.remove()}}renderCardSection(te,ne){var ce,le;const{amount:ie,currency:oe,showPaymentSummary:se,expirationDateFormat:ae}=this.componentProps;se&&(this.paymentSummary=new PaymentSummary({amount:ie,currency:oe}),this.element.append((ce=this.paymentSummary)==null?void 0:ce.element)),this.cardHolderInput=new CardField({id:"cc-holder",label:AstroPayI18n.translate("card_holder_label")}),this.cardNumberInput=new CardField({id:"cc-number",label:AstroPayI18n.translate("card_number")});const ue=document.createElement("div");ue.classList.add("row-container"),this.cardExpInput=new CardField({id:"cc-expiration-date",label:AstroPayI18n.translate("card_exp_date")}),this.cardCvvInput=new CardField({id:"cc-cvc",label:"CVV"}),ue.append(this.cardExpInput.element,this.cardCvvInput.element),this.element.append(this.cardHolderInput.element,this.cardNumberInput.element,ue),this.cardManager=new CardApService(APCardsFields(defineInputStyles().textColor,ae??DEFAULT_EXPIRATION_DATE_FORMAT,ThemeManager.getStyles()).map(de=>({...de,placeholder:AstroPayI18n.translate(de.placeholder)})),this.handleFormStateChange.bind(this)),this.cardManager.init(),this.btnPay=new Button({text:AstroPayI18n.translate("pay_amount",{amount:formatAmountCurrency(this.componentProps.amount,this.componentProps.currency,AstroPayConfig.getCurrencyMode())}),onClick:()=>{this.handleSubmit()},isFullWidth:!0,iconLeft:"lock_line",isDisabled:!0}),ne!=null&&ne.data&&((le=ne.data)==null?void 0:le.length)>0&&this.renderInstallments(ne),te&&te.length>0&&this.renderRequiredFields(te),this.element.append(this.btnPay.element)}renderRequiredFields(te){this.requiredFieldsForm=new FormTemplate({title:AstroPayI18n.translate("additional_information"),requiredFields:te}),this.requiredFieldsForm.setValidationChangeHandler(ne=>{this.isFormTemplateValid=ne,this.updateSubmitButton()}),this.element.append(this.requiredFieldsForm.element)}renderInstallments(te){if(!te)return;this.hasInstallments=!0;const ne=new SelectDropdown({label:te.label,options:mountInstallmentData(te,te.currency),onChange:ie=>{var oe;this.updateAmount((oe=ie.meta)==null?void 0:oe.totalAmount),this.selectedInstallment=ie.meta}}).element;this.element.append(ne)}updateAmount(te){var ie,oe;if(te==null)return;const ne=AstroPayI18n.translate("pay_amount",{amount:formatAmountCurrency(te,this.componentProps.currency,AstroPayConfig.getCurrencyMode())});(ie=this.btnPay)==null||ie.setText(ne),(oe=this.paymentSummary)==null||oe.setAmountAndCurrency(te,this.componentProps.currency)}handleFormStateChange(te){this.formState=te,this.updateInputsValidation(),this.updateSubmitButton()}updateInputsValidation(){[{input:this.cardHolderInput,...this.formState.card_holder},{input:this.cardNumberInput,...this.formState.card_number},{input:this.cardExpInput,...this.formState.card_exp},{input:this.cardCvvInput,...this.formState.card_cvc}].forEach(({input:ne,isValid:ie})=>{ne==null||ne.setValid(ie),ne==null||ne.setHelperText(ie?"":AstroPayI18n.translate("invalid_field"),ie)})}updateSubmitButton(){var ie;const ne=Object.values(this.formState).every(oe=>oe.isValid&&oe.isTouched)&&(this.requiredFieldsForm?this.isFormTemplateValid:!0);(ie=this.btnPay)==null||ie.setDisabled(!ne)}async handleSubmit(){var te,ne,ie,oe,se,ae;try{(te=this.btnPay)==null||te.setLoading(!0);const ue=await this.handleTokenizeCard(),ce={paymentMethods:[{methodCode:this.componentProps.paymentMethod.code,currency:this.componentProps.currency,amount:this.componentProps.amount,user:{sessionId:sessionStorage.getItem(EStorageKey.SESSION_ID)||"",...(ne=this.requiredFieldsForm)==null?void 0:ne.getFormData()},...this.hasInstallments&&{installments:((ie=this.selectedInstallment)==null?void 0:ie.installmentNumber)??1},cardData:ue}]};if((oe=this.componentProps.paymentMethod)!=null&&oe.uri){const{status:le,reason:de}=await PaymentService.postGenericPayment(this.componentProps.paymentMethod.uri,this.componentProps.paymentExternalId,ce);if(le===ECardPayStatus.PENDING)await this.checkPaymentStatus(),(se=this.btnPay)==null||se.setLoading(!1),(ae=this.btnPay)==null||ae.setDisabled(!0);else throw new Error(de||AstroPayI18n.translate("generic_error"))}else throw new Error(AstroPayI18n.translate("generic_error"))}catch(ue){const ce=ue;console.error(ce.message),this.showErrorMessage(ce.description??ce.message),this.renderRetryButton()}}async handleTokenizeCard(){return new Promise((te,ne)=>{var ae;if(!this.cardManager)return;const{document_type:ie,document_number:oe}=((ae=this.requiredFieldsForm)==null?void 0:ae.getFormData())??{},se={documentType:ie??"",documentNumber:oe??"",sessionId:sessionStorage.getItem(EStorageKey.SESSION_ID)||""};this.cardManager.tokenizeCard(se,ue=>te(ue),ue=>{ne(ue)})})}showErrorMessage(te){this.element.innerHTML="";const ne=new Typography({text:te,size:ThemeManager.getFontScale().xSmall,color:ThemeManager.getStyles().messages.error.textColor}).element;this.element.append(ne)}async checkPaymentStatus(){try{const te=await PaymentService.getPaymentStatus(this.componentProps.paymentExternalId);te.pollingStatus===EPollingStatus.ACCEPTED?this.initializePollingService(te):te.pollingStatus===EPollingStatus.FINISHED&&this.handlePaymentFinished(te)}catch(te){const ne=te;this.showErrorMessage(ne.description??ne.message),this.stopPolling()}}initializePollingService(te){this.pollingService=new PollingService(te,ne=>this.showWaitingInfo(ne),ne=>this.handlePaymentFinished(ne),ne=>this.handlePollingError(ne)),this.pollingService.startPolling()}stopPolling(){this.pollingService&&(this.pollingService.stopPolling(),this.pollingService=null)}handlePollingError(te){if(typeof te=="object"&&te!==null&&"text"in te){const ie=te;this.showErrorMessage(ie.text)}else{const ie=te;this.showErrorMessage(ie.description??ie.message)}this.stopPolling(),this.renderRetryButton()}showWaitingInfo(te){this.element.innerHTML="";const ne=this.createLoadingWrapper(te);ne.style.minHeight="400px",this.element.append(ne)}handlePaymentFinished(te){te.data.status===EPaymentStatus.COMPLETED?this.handleSuccessSection(te.data.successSection):this.handleErrorSection(te.data.errorSection)}handleSuccessSection(te){if(!te)return;const ne=[],ie=new Status({type:"success",title:te.title,description:te.description}).element;ne.push(ie),this.componentProps.onSuccess?this.componentProps.onSuccess(ne):(this.element.innerHTML="",ne.forEach(oe=>this.element.append(oe)))}handleErrorSection(te){if(!te)return;const ne=[],ie=new Status({type:"error",title:te.title,description:te.description}).element;ne.push(ie),this.componentProps.onError?this.componentProps.onError(ne):(this.element.innerHTML="",ne.forEach(oe=>this.element.append(oe)))}createLoadingWrapper(te){const ne=document.createElement("div");ne.classList.add("loading-wrapper");const ie=new Loading({size:100,variant:"fetching",color:ThemeManager.getStyles().primaryColor}).element,oe=new Typography({text:te,size:"base",lineHeight:30,weight:600,align:"center"}).element;return ne.append(ie,oe),ne}renderRetryButton(){const te=document.createElement("div");te.classList.add("center-row");const ne=new Button({text:AstroPayI18n.translate("try_again"),variant:"text",size:"small",iconRight:"refresh_2_fill",onClick:()=>{this.element.innerHTML="",this.element.append(this.loadingWrapper),this.fetchPaymentMethodDetail()}}).element;te.append(ne),this.element.append(te)}destroy(){this.stopPolling(),this.element.remove()}}const formatTimeInSeconds=ee=>{const re=Math.floor(ee/60),te=ee%60;return`${String(re).padStart(2,"0")}:${String(te).padStart(2,"0")}`},getTimerStyles=ee=>css`
|
|
1011
|
+
`;class CardField extends Component{constructor({id:te,label:ne,initialHelperText:ie,isValid:oe=!0}){super({tag:"div",styles:()=>getCardFieldStyles()});xe(this,"inputContainer");xe(this,"labelTextElement",null);xe(this,"helperTextElement",null);xe(this,"id");this.id=te;const se=inputStyle(!oe);if(this.inputContainer=document.createElement("div"),this.inputContainer.classList.add("input-container"),ne){const ue=document.createElement("label");this.labelTextElement=new Typography({text:ne,size:se.label.size,weight:se.label.weight,color:se.label.color}).element,ue.append(this.labelTextElement),ue.htmlFor=te,this.inputContainer.append(this.labelTextElement)}const ae=document.createElement("div");ae.id=te,ae.classList.add("form-field"),this.inputContainer.append(ae),this.helperTextElement=new Typography({text:ie||NON_BREAKING_SPACE,size:se.helperText.size,lineHeight:se.helperText.size,weight:se.helperText.weight,color:se.helperText.color}).element,this.inputContainer.append(this.helperTextElement),this.element.append(this.inputContainer)}setHelperText(te,ne=!0){const ie=inputStyle(!ne);this.helperTextElement.textContent=te||NON_BREAKING_SPACE,this.helperTextElement.style.color=ie.helperText.color}setValid(te){if(this.labelTextElement){const ie=inputStyle(!te);this.labelTextElement.style.color=ie.label.color}const ne=this.element.querySelector(`#${this.id}`);ne&&ne.classList.toggle("card-input-error",!te)}resetValidation(){this.setValid(!0),this.setHelperText("",!0)}}const APCardsFields=(ee,re,te)=>[{field:"#cc-holder",type:"text",name:"card_holder",placeholder:"card_holder_placeholder",autocomplete:"off",validations:["required","/^[a-zA-Z ]{0,200}$/"],styles:CARD_STYLES(ee,te)},{field:"#cc-number",type:"card-number",name:"card_number",placeholder:"4111 1111 1111 1111",autocomplete:"off",validations:["required","validCardNumber"],styles:CARD_STYLES(ee,te)},{field:"#cc-expiration-date",type:"card-expiration-date",name:"card_exp",lengthYear:re==="MM/YY"?2:4,placeholder:re,autocomplete:"off",validations:["required","validCardExpirationDate"],styles:CARD_STYLES(ee,te)},{field:"#cc-cvc",type:"card-security-code",name:"card_cvc",placeholder:"123",autocomplete:"off",validations:["required","/^\\d{3,4}$/"],styles:CARD_STYLES(ee,te)}],EMPTY_FORM_DATA={card_holder:{isValid:!0,isTouched:!1},card_number:{isValid:!0,isTouched:!1},card_exp:{isValid:!0,isTouched:!1},card_cvc:{isValid:!0,isTouched:!1}},formatInstallmentContent=(ee,re)=>{const{installmentNumber:te,installmentAmount:ne,totalAmount:ie}=ee,oe=AstroPayConfig.getCurrencyMode(),se=formatAmountCurrency(ne,re,oe),ae=formatAmountCurrency(ie,re,oe);return`${te}x ${se} (${ae})`},createInstallmentBadge=ee=>{const{hasInterest:re,interestValue:te}=ee;return re?new Typography({text:te,size:"small",weight:500}).element:new Badge({items:[{title:te}],variant:"highlight"}).element},mountInstallmentData=(ee,re)=>{var te;return(te=ee==null?void 0:ee.data)!=null&&te.length?ee.data.map(ne=>({value:ne.installmentNumber,content:formatInstallmentContent(ne,re),rightContent:createInstallmentBadge(ne),meta:ne})):[]},DEFAULT_EXPIRATION_DATE_FORMAT="MM/YY";class CardPaymentMethod extends Component{constructor(te){super({tag:"div",styles:ne=>getCardPaymentMethodStyles(ne,{error:!1,disabled:!1})});xe(this,"componentProps");xe(this,"loadingWrapper");xe(this,"btnPay",null);xe(this,"paymentSummary",null);xe(this,"cardManager",null);xe(this,"cardHolderInput",null);xe(this,"cardNumberInput",null);xe(this,"cardExpInput",null);xe(this,"cardCvvInput",null);xe(this,"requiredFieldsForm",null);xe(this,"formState",EMPTY_FORM_DATA);xe(this,"isFormTemplateValid",!1);xe(this,"selectedInstallment");xe(this,"hasInstallments",!1);xe(this,"pollingService",null);this.componentProps={...te,showPaymentSummary:te.showPaymentSummary??!0,expirationDateFormat:te.expirationDateFormat??DEFAULT_EXPIRATION_DATE_FORMAT},this.loadingWrapper=this.createLoadingWrapper(AstroPayI18n.translate("hold_on")),this.element.append(this.loadingWrapper),sessionStorage.getItem(EStorageKey.SESSION_ID)||sessionStorage.setItem(EStorageKey.SESSION_ID,uuid()),this.fetchPaymentMethodDetail()}async fetchPaymentMethodDetail(){try{const te=await PaymentMethodsService.getPaymentMethodDetail({paymentExternalId:this.componentProps.paymentExternalId,methodCode:this.componentProps.paymentMethod.code});this.renderCardSection(te.fields,te.installments)}catch(te){const ne=te;this.showErrorMessage(ne.description??ne.message)}finally{this.loadingWrapper.remove()}}renderCardSection(te,ne){var ce,le;const{amount:ie,currency:oe,showPaymentSummary:se,expirationDateFormat:ae}=this.componentProps;se&&(this.paymentSummary=new PaymentSummary({amount:ie,currency:oe}),this.element.append((ce=this.paymentSummary)==null?void 0:ce.element)),this.cardHolderInput=new CardField({id:"cc-holder",label:AstroPayI18n.translate("card_holder_label")}),this.cardNumberInput=new CardField({id:"cc-number",label:AstroPayI18n.translate("card_number")});const ue=document.createElement("div");ue.classList.add("row-container"),this.cardExpInput=new CardField({id:"cc-expiration-date",label:AstroPayI18n.translate("card_exp_date")}),this.cardCvvInput=new CardField({id:"cc-cvc",label:"CVV"}),ue.append(this.cardExpInput.element,this.cardCvvInput.element),this.element.append(this.cardHolderInput.element,this.cardNumberInput.element,ue),this.cardManager=new CardApService(APCardsFields(defineInputStyles().textColor,ae??DEFAULT_EXPIRATION_DATE_FORMAT,ThemeManager.getStyles()).map(de=>({...de,placeholder:AstroPayI18n.translate(de.placeholder)})),this.handleFormStateChange.bind(this)),this.cardManager.init(),this.btnPay=new Button({text:AstroPayI18n.translate("pay_amount",{amount:formatAmountCurrency(this.componentProps.amount,this.componentProps.currency,AstroPayConfig.getCurrencyMode())}),onClick:()=>{this.handleSubmit()},isFullWidth:!0,iconLeft:"lock_line",isDisabled:!0}),ne!=null&&ne.data&&((le=ne.data)==null?void 0:le.length)>0&&this.renderInstallments(ne),te&&te.length>0&&this.renderRequiredFields(te),this.element.append(this.btnPay.element)}renderRequiredFields(te){this.requiredFieldsForm=new FormTemplate({title:AstroPayI18n.translate("additional_information"),requiredFields:te}),this.requiredFieldsForm.setValidationChangeHandler(ne=>{this.isFormTemplateValid=ne,this.updateSubmitButton()}),this.element.append(this.requiredFieldsForm.element)}renderInstallments(te){if(!te)return;this.hasInstallments=!0;const ne=new SelectDropdown({label:te.label,options:mountInstallmentData(te,te.currency),onChange:ie=>{var oe;this.updateAmount((oe=ie.meta)==null?void 0:oe.totalAmount),this.selectedInstallment=ie.meta}}).element;this.element.append(ne)}updateAmount(te){var ie,oe;if(te==null)return;const ne=AstroPayI18n.translate("pay_amount",{amount:formatAmountCurrency(te,this.componentProps.currency,AstroPayConfig.getCurrencyMode())});(ie=this.btnPay)==null||ie.setText(ne),(oe=this.paymentSummary)==null||oe.setAmountAndCurrency(te,this.componentProps.currency)}handleFormStateChange(te){this.formState=te,this.updateInputsValidation(),this.updateSubmitButton()}updateInputsValidation(){[{input:this.cardHolderInput,...this.formState.card_holder},{input:this.cardNumberInput,...this.formState.card_number},{input:this.cardExpInput,...this.formState.card_exp},{input:this.cardCvvInput,...this.formState.card_cvc}].forEach(({input:ne,isValid:ie})=>{ne==null||ne.setValid(ie),ne==null||ne.setHelperText(ie?"":AstroPayI18n.translate("invalid_field"),ie)})}updateSubmitButton(){var ie;const ne=Object.values(this.formState).every(oe=>oe.isValid&&oe.isTouched)&&(this.requiredFieldsForm?this.isFormTemplateValid:!0);(ie=this.btnPay)==null||ie.setDisabled(!ne)}async handleSubmit(){var te,ne,ie,oe,se,ae;try{(te=this.btnPay)==null||te.setLoading(!0);const ue=await this.handleTokenizeCard(),ce={paymentMethods:[{methodCode:this.componentProps.paymentMethod.code,currency:this.componentProps.currency,amount:this.componentProps.amount,user:{sessionId:sessionStorage.getItem(EStorageKey.SESSION_ID)||"",...(ne=this.requiredFieldsForm)==null?void 0:ne.getFormData()},...this.hasInstallments&&{installments:((ie=this.selectedInstallment)==null?void 0:ie.installmentNumber)??1},cardData:ue}]};if((oe=this.componentProps.paymentMethod)!=null&&oe.uri){const{status:le,reason:de}=await PaymentService.postGenericPayment(this.componentProps.paymentMethod.uri,this.componentProps.paymentExternalId,ce);if(le===ECardPayStatus.PENDING)await this.checkPaymentStatus(),(se=this.btnPay)==null||se.setLoading(!1),(ae=this.btnPay)==null||ae.setDisabled(!0);else throw new Error(de||AstroPayI18n.translate("generic_error"))}else throw new Error(AstroPayI18n.translate("generic_error"))}catch(ue){const ce=ue;console.error(ce.message),this.showErrorMessage(ce.description??ce.message),this.renderRetryButton()}}async handleTokenizeCard(){return new Promise((te,ne)=>{var ae;if(!this.cardManager)return;const{document_type:ie,document_number:oe}=((ae=this.requiredFieldsForm)==null?void 0:ae.getFormData())??{},se={documentType:ie??"",documentNumber:oe??"",sessionId:sessionStorage.getItem(EStorageKey.SESSION_ID)||""};this.cardManager.tokenizeCard(se,ue=>te(ue),ue=>{ne(ue)})})}showErrorMessage(te){this.element.innerHTML="";const ne=new Typography({text:te,size:ThemeManager.getFontScale().xSmall,color:ThemeManager.getStyles().messages.error.textColor}).element;this.element.append(ne)}async checkPaymentStatus(){try{const te=await PaymentService.getPaymentStatus(this.componentProps.paymentExternalId);te.pollingStatus===EPollingStatus.ACCEPTED?this.initializePollingService(te):te.pollingStatus===EPollingStatus.FINISHED&&this.handlePaymentFinished(te)}catch(te){const ne=te;this.showErrorMessage(ne.description??ne.message),this.stopPolling()}}initializePollingService(te){this.pollingService=new PollingService(te,ne=>this.showWaitingInfo(ne),ne=>this.handlePaymentFinished(ne),ne=>this.handlePollingError(ne)),this.pollingService.startPolling()}stopPolling(){this.pollingService&&(this.pollingService.stopPolling(),this.pollingService=null)}handlePollingError(te){if(typeof te=="object"&&te!==null&&"text"in te){const ie=te;this.showErrorMessage(ie.text)}else{const ie=te;this.showErrorMessage(ie.description??ie.message)}this.stopPolling(),this.renderRetryButton()}showWaitingInfo(te){this.element.innerHTML="";const ne=this.createLoadingWrapper(te);ne.style.minHeight="400px",this.element.append(ne)}handlePaymentFinished(te){te.data.status===EPaymentStatus.COMPLETED?this.handleSuccessSection(te.data.successSection):this.handleErrorSection(te.data.errorSection)}handleSuccessSection(te){if(!te)return;const ne=[],ie=new Status({type:"success",title:te.title,description:te.description}).element;ne.push(ie),this.componentProps.onSuccess?this.componentProps.onSuccess(ne):(this.element.innerHTML="",ne.forEach(oe=>this.element.append(oe)))}handleErrorSection(te){if(!te)return;const ne=[],ie=new Status({type:"error",title:te.title,description:te.description}).element;ne.push(ie),this.componentProps.onError?this.componentProps.onError(ne):(this.element.innerHTML="",ne.forEach(oe=>this.element.append(oe)))}createLoadingWrapper(te){const ne=document.createElement("div");ne.classList.add("loading-wrapper");const ie=new Loading({size:100,variant:"fetching",color:ThemeManager.getStyles().primaryColor}).element,oe=new Typography({text:te,size:"base",lineHeight:30,weight:600,align:"center"}).element;return ne.append(ie,oe),ne}renderRetryButton(){const te=document.createElement("div");te.classList.add("center-row");const ne=new Button({text:AstroPayI18n.translate("try_again"),variant:"text",size:"small",iconRight:"refresh_2_fill",onClick:()=>{this.element.innerHTML="",this.element.append(this.loadingWrapper),this.fetchPaymentMethodDetail()}}).element;te.append(ne),this.element.append(te)}destroy(){this.stopPolling(),this.element.remove()}}const formatTimeInSeconds=ee=>{const re=Math.floor(ee/60),te=ee%60;return`${String(re).padStart(2,"0")}:${String(te).padStart(2,"0")}`},getTimerStyles=ee=>css`
|
|
1004
1012
|
display: flex;
|
|
1005
1013
|
flex-wrap: nowrap;
|
|
1006
1014
|
align-items: center;
|
|
@@ -1072,7 +1080,7 @@ Minimum version required to store current data is: `+Re+`.
|
|
|
1072
1080
|
gap: 8px;
|
|
1073
1081
|
min-height: 250px;
|
|
1074
1082
|
}
|
|
1075
|
-
`;class AstroPayCardPayment extends Component{constructor(te){super({tag:"div",styles:ie=>getAstroPayCardPaymentStyles(ie)});xe(this,"loadingWrapper");xe(this,"componentProps");xe(this,"methodCode");this.componentProps={...
|
|
1083
|
+
`;class AstroPayCardPayment extends Component{constructor(te){super({tag:"div",styles:ie=>getAstroPayCardPaymentStyles(ie)});xe(this,"loadingWrapper");xe(this,"componentProps");xe(this,"methodCode");if(this.methodCode=ECheckoutPaymentMethod.CARD,te.paymentExternalId)this.componentProps=te;else{const ie=te;this.componentProps={...ie,country:ie.country.trim().toUpperCase(),currency:ie.currency.trim().toUpperCase()}}AstroPayCore.registerComponent(this),AmplitudeAnalytics.astroPayPaymentImpression("AstroPayCardPayment"),this.loadingWrapper=document.createElement("div"),this.loadingWrapper.classList.add("loading-wrapper");const ne=new Loading({size:100,variant:"fetching",color:ThemeManager.getStyles().primaryColor}).element;this.loadingWrapper.append(ne),this.element.appendChild(this.loadingWrapper),DataDogTracker.trackEvent("ap_cl_astropay_card_payment_init"),this.createPayment()}async createPayment(){var te,ne;try{let ie;this.componentProps.paymentExternalId?ie=await PaymentService.getPaymentDetails(this.componentProps.paymentExternalId,"card_payment"):ie=await PaymentService.postCreatePayment({country:this.componentProps.country,currency:this.componentProps.currency,amount:this.componentProps.amount,order:this.componentProps.order,methodCode:this.methodCode},"card_payment"),this.renderAstroPayCardMethod(ie)}catch(ie){const oe=ie;(ne=(te=this.componentProps)==null?void 0:te.onError)==null||ne.call(te),this.showErrorMessage(oe.description??oe.message)}finally{this.loadingWrapper.remove()}}renderAstroPayCardMethod(te){var ye,ve,be,_e,Ie,Te;const{paymentExternalId:ne,user:ie,paymentMethods:oe,countries:se,benefits:ae,metadata:ue,paymentAmount:ce,paymentCountry:le}=te;this.element.innerHTML="";const de=(oe==null?void 0:oe.filter(Se=>Se.enabled&&CARDS_METHOD.includes(Se.code)))??[];if(de.length===0){(ve=(ye=this.componentProps)==null?void 0:ye.onError)==null||ve.call(ye),this.showErrorMessage(AstroPayI18n.translate("generic_error"));return}const fe=(ce==null?void 0:ce.amount)??this.componentProps.amount,he=(ce==null?void 0:ce.currency)??this.componentProps.currency,pe=le??this.componentProps.country;if(fe===void 0||he===void 0||pe===void 0){(_e=(be=this.componentProps)==null?void 0:be.onError)==null||_e.call(be),this.showErrorMessage(AstroPayI18n.translate("generic_error"));return}const ge=mountPaymentMethodItems({paymentMethods:de,paymentExternalId:ne,amount:fe,currency:he,country:pe,user:ie,countries:se,benefits:ae,actionLabel:ue==null?void 0:ue.actionLabel,onSuccess:Se=>this.showResultScreen(Se,{type:"success",onSuccess:this.componentProps.onSuccess}),onError:Se=>this.showResultScreen(Se,{type:"error",onError:this.componentProps.onError}),cardConfig:{showPaymentSummary:(Ie=this.componentProps)==null?void 0:Ie.showPaymentSummary,expirationDateFormat:(Te=this.componentProps)==null?void 0:Te.expirationDateFormat}}),me=new Accordion({items:ge,defaultActiveItem:0});this.element.append(me.element)}showErrorMessage(te){this.element.innerHTML="";const ne=new Typography({text:te,size:ThemeManager.getFontScale().xSmall,color:ThemeManager.getStyles().messages.error.textColor}).element;this.element.append(ne)}showResultScreen(te,ne){this.element.innerHTML="";const ie=new ResultScreen({type:ne.type,contentElements:te,onSuccess:ne==null?void 0:ne.onSuccess,onError:ne==null?void 0:ne.onError});this.element.append(ie.element)}render(te){if(!te)throw new Error("Container element not found");te.appendChild(this.element)}destroy(){this.element.remove(),AstroPayCore.unregisterComponent(this)}}const getAstroPayFullCheckoutStyles=ee=>css`
|
|
1076
1084
|
background-color: ${ee.backgroundColor};
|
|
1077
1085
|
|
|
1078
1086
|
display: flex;
|
|
@@ -1092,7 +1100,7 @@ Minimum version required to store current data is: `+Re+`.
|
|
|
1092
1100
|
gap: 8px;
|
|
1093
1101
|
min-height: 250px;
|
|
1094
1102
|
}
|
|
1095
|
-
`;class AstroPayFullCheckout extends Component{constructor(te){super({tag:"div",elementId:"payment-component",styles:ie=>getAstroPayFullCheckoutStyles(ie)});xe(this,"loadingWrapper");xe(this,"componentProps");xe(this,"accPaymentMethods");this.componentProps={...
|
|
1103
|
+
`;class AstroPayFullCheckout extends Component{constructor(te){super({tag:"div",elementId:"payment-component",styles:ie=>getAstroPayFullCheckoutStyles(ie)});xe(this,"loadingWrapper");xe(this,"componentProps");xe(this,"accPaymentMethods");if(te.paymentExternalId){const ie=te;this.componentProps={...ie,showTitle:ie.showTitle??!0,showDescription:ie.showDescription??!0}}else{const ie=te;this.componentProps={...ie,showTitle:ie.showTitle??!0,showDescription:ie.showDescription??!0,country:ie.country.trim().toUpperCase(),currency:ie.currency.trim().toUpperCase()}}AstroPayCore.registerComponent(this),AmplitudeAnalytics.astroPayPaymentImpression("AstroPayFullCheckout"),this.loadingWrapper=document.createElement("div"),this.loadingWrapper.classList.add("loading-wrapper");const ne=new Loading({size:100,variant:"fetching",color:ThemeManager.getStyles().primaryColor}).element;this.loadingWrapper.append(ne),this.element.appendChild(this.loadingWrapper),DataDogTracker.trackEvent("ap_cl_full_checkout_init"),this.createPayment()}async createPayment(){var te,ne;try{let ie;if(this.componentProps.paymentExternalId)ie=await PaymentService.getPaymentDetails(this.componentProps.paymentExternalId,"full_checkout");else{const{description:oe,paymentLink:se}=this.componentProps;ie=await PaymentService.postCreatePayment({country:this.componentProps.country,currency:this.componentProps.currency,amount:this.componentProps.amount,user:this.componentProps.user,order:this.componentProps.order,description:oe,paymentLink:se},"full_checkout")}this.renderPaymentMethods(ie)}catch(ie){const oe=ie;(ne=(te=this.componentProps)==null?void 0:te.onError)==null||ne.call(te);const se=new Typography({text:oe.description??oe.message,size:ThemeManager.getFontScale().xSmall,color:ThemeManager.getStyles().messages.error.textColor}).element;this.element.appendChild(se)}finally{this.loadingWrapper.remove()}}renderPaymentMethods(te){var ye,ve,be;const{paymentExternalId:ne,user:ie,paymentMethods:oe,countries:se,paymentComponentDescription:ae,benefits:ue,metadata:ce,paymentAmount:le,paymentCountry:de}=te;if(this.element.innerHTML="",this.componentProps.showTitle){const _e=new Typography({text:AstroPayI18n.translate("checkout_method"),variant:"div",size:"large",weight:600}).element;this.element.append(_e)}if(this.componentProps.showDescription&&ae){const _e=new Typography({text:ae,size:"small",color:ThemeManager.getStyles().textSecondaryColor,weight:400}).element;this.element.append(_e)}const fe={code:EPaymentCode.AP,label:((ye=te==null?void 0:te.metadata)==null?void 0:ye.title)||AstroPayI18n.translate("astro_express_checkout"),description:(ve=te==null?void 0:te.metadata)==null?void 0:ve.description,enabled:!0},he=(le==null?void 0:le.amount)??this.componentProps.amount,pe=(le==null?void 0:le.currency)??this.componentProps.currency,ge=de??this.componentProps.country;if(he===void 0||pe===void 0||ge===void 0)throw new Error(AstroPayI18n.translate("generic_error"));const me=mountPaymentMethodItems({paymentMethods:[fe,...oe??[]],paymentExternalId:ne,amount:he,currency:pe,country:ge,user:ie,countries:se,benefits:ue,actionLabel:ce==null?void 0:ce.actionLabel,onSuccess:_e=>this.showResultScreen(_e,{type:"success",onSuccess:this.componentProps.onSuccess}),onError:_e=>this.showResultScreen(_e,{type:"error",onError:this.componentProps.onError}),cardConfig:(be=this.componentProps)==null?void 0:be.cardConfig});me.length>0&&(this.accPaymentMethods=new Accordion({items:me,defaultActiveItem:0}),this.element.append(this.accPaymentMethods.element))}showResultScreen(te,ne){this.element.innerHTML="";const ie=new ResultScreen({type:ne.type,contentElements:te,onSuccess:ne==null?void 0:ne.onSuccess,onError:ne==null?void 0:ne.onError});this.element.append(ie.element)}render(te){if(!te)throw new Error("Container element not found");te.appendChild(this.element)}destroy(){this.element.remove(),AstroPayCore.unregisterComponent(this)}}const getAstroPayPaymentStyles=ee=>css`
|
|
1096
1104
|
background-color: ${ee.backgroundColor};
|
|
1097
1105
|
|
|
1098
1106
|
display: flex;
|
|
@@ -1112,5 +1120,5 @@ Minimum version required to store current data is: `+Re+`.
|
|
|
1112
1120
|
gap: 8px;
|
|
1113
1121
|
min-height: 250px;
|
|
1114
1122
|
}
|
|
1115
|
-
`;class AstroPayPayment extends Component{constructor(te){super({tag:"div",styles:ie=>getAstroPayPaymentStyles(ie)});xe(this,"loadingWrapper");xe(this,"componentProps");xe(this,"methodCode");this.componentProps={...te,country:te.country.trim().toUpperCase(),currency:te.currency.trim().toUpperCase()},this.methodCode=ECheckoutPaymentMethod.ASTRO_PAY,AstroPayCore.registerComponent(this),AmplitudeAnalytics.astroPayPaymentImpression("AstroPayPayment"),this.loadingWrapper=document.createElement("div"),this.loadingWrapper.classList.add("loading-wrapper");const ne=new Loading({size:100,variant:"fetching",color:ThemeManager.getStyles().primaryColor}).element;this.loadingWrapper.append(ne),this.element.appendChild(this.loadingWrapper),DataDogTracker.trackEvent("ap_cl_astropay_payment_init"),this.createPayment()}async createPayment(){var te,ne;try{const{amount:ie,currency:oe,country:se,user:ae,order:ue,paymentExternalId:ce}=this.componentProps;let le;if(ce)le=await PaymentService.getPaymentDetails(ce,"astropay_payment");else{const de={country:se,currency:oe,amount:ie,user:ae,order:ue,methodCode:this.methodCode};le=await PaymentService.postCreatePayment(de,"astropay_payment")}this.renderAstroPayMethod(le)}catch(ie){const oe=ie;(ne=(te=this.componentProps)==null?void 0:te.onError)==null||ne.call(te);const se=new Typography({text:oe.description??oe.message,size:ThemeManager.getFontScale().xSmall,color:ThemeManager.getStyles().messages.error.textColor}).element;this.element.appendChild(se)}finally{this.loadingWrapper.remove()}}renderAstroPayMethod(te){const{paymentExternalId:ne,user:ie,countries:oe,benefits:se,metadata:ae,paymentAmount:ue}=te;this.element.innerHTML="";const ce={amount:(ue==null?void 0:ue.amount)??this.componentProps.amount,currency:(ue==null?void 0:ue.currency)??this.componentProps.currency},le=new AstroPayPaymentMethod({paymentExternalId:ne,user:ie,countries:oe,benefits:se,paymentAmount:ce,actionLabel:ae==null?void 0:ae.actionLabel,onSuccess:de=>this.showResultScreen(de,{type:"success",onSuccess:this.componentProps.onSuccess}),onError:de=>this.showResultScreen(de,{type:"error",onError:this.componentProps.onError})}).element;this.element.append(le)}showResultScreen(te,ne){this.element.innerHTML="";const ie=new ResultScreen({type:ne.type,contentElements:te,onSuccess:ne==null?void 0:ne.onSuccess,onError:ne==null?void 0:ne.onError});this.element.append(ie.element)}render(te){if(!te)throw new Error("Container element not found");te.appendChild(this.element)}destroy(){this.element.remove(),AstroPayCore.unregisterComponent(this)}}loadFonts();const serializedNodeIds=new WeakMap;function hasSerializedNode(ee){return serializedNodeIds.has(ee)}function nodeAndAncestorsHaveSerializedNode(ee){let re=ee;for(;re;){if(!hasSerializedNode(re)&&!isNodeShadowRoot(re))return!1;re=getParentNode(re)}return!0}function getSerializedNodeId(ee){return serializedNodeIds.get(ee)}function setSerializedNodeId(ee,re){serializedNodeIds.set(ee,re)}function getElementInputValue(ee,re){const te=ee.tagName,ne=ee.value;if(shouldMaskNode(ee,re)){const ie=ee.type;return te==="INPUT"&&(ie==="button"||ie==="submit"||ie==="reset")?ne:!ne||te==="OPTION"?void 0:CENSORED_STRING_MARK}if(te==="OPTION"||te==="SELECT")return ee.value;if(!(te!=="INPUT"&&te!=="TEXTAREA"))return ne}const URL_IN_CSS_REF=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,ABSOLUTE_URL=/^[A-Za-z]+:|^\/\//,DATA_URI=/^data:.*,/i;function switchToAbsoluteUrl(ee,re){return ee.replace(URL_IN_CSS_REF,(te,ne,ie,oe,se,ae)=>{const ue=ie||se||ae;if(!re||!ue||ABSOLUTE_URL.test(ue)||DATA_URI.test(ue))return te;const ce=ne||oe||"";return`url(${ce}${makeUrlAbsolute(ue,re)}${ce})`})}function makeUrlAbsolute(ee,re){try{return buildUrl(ee,re).href}catch{return ee}}const TAG_NAME_REGEX=/[^a-z1-6-_]/;function getValidTagName(ee){const re=ee.toLowerCase().trim();return TAG_NAME_REGEX.test(re)?"div":re}function censoredImageForSize(ee,re){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${ee}' height='${re}' style='background-color:silver'%3E%3C/svg%3E`}const RecordType={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9},NodeType={Document:0,DocumentType:1,Element:2,Text:3,CDATA:4,DocumentFragment:11},IncrementalSource={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},MouseInteractionType={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},MediaInteractionType={Play:0,Pause:1};function serializeStyleSheets(ee){if(!(ee===void 0||ee.length===0))return ee.map(re=>{const te=re.cssRules||re.rules;return{cssRules:Array.from(te,oe=>oe.cssText),disabled:re.disabled||void 0,media:re.media.length>0?Array.from(re.media):void 0}})}function serializeAttribute(ee,re,te,ne){if(re===NodePrivacyLevel.HIDDEN)return null;const ie=ee.getAttribute(te);if(re===NodePrivacyLevel.MASK&&te!==PRIVACY_ATTR_NAME&&!STABLE_ATTRIBUTES.includes(te)&&te!==ne.actionNameAttribute){const oe=ee.tagName;switch(te){case"title":case"alt":case"placeholder":return CENSORED_STRING_MARK}if(oe==="IMG"&&(te==="src"||te==="srcset")){const se=ee;if(se.naturalWidth>0)return censoredImageForSize(se.naturalWidth,se.naturalHeight);const{width:ae,height:ue}=ee.getBoundingClientRect();return ae>0||ue>0?censoredImageForSize(ae,ue):CENSORED_IMG_MARK}if(oe==="SOURCE"&&(te==="src"||te==="srcset"))return CENSORED_IMG_MARK;if(oe==="A"&&te==="href"||ie&&te.startsWith("data-")||oe==="IFRAME"&&te==="srcdoc")return CENSORED_STRING_MARK}return!ie||typeof ie!="string"?ie:isLongDataUrl(ie)?sanitizeDataUrl(ie):ie}function serializeAttributes(ee,re,te){if(re===NodePrivacyLevel.HIDDEN)return{};const ne={},ie=getValidTagName(ee.tagName),oe=ee.ownerDocument;for(let le=0;le<ee.attributes.length;le+=1){const fe=ee.attributes.item(le).name,he=serializeAttribute(ee,re,fe,te.configuration);he!==null&&(ne[fe]=he)}if(ee.value&&(ie==="textarea"||ie==="select"||ie==="option"||ie==="input")){const le=getElementInputValue(ee,re);le!==void 0&&(ne.value=le)}if(ie==="option"&&re===NodePrivacyLevel.ALLOW){const le=ee;le.selected&&(ne.selected=le.selected)}if(ie==="link"){const le=Array.from(oe.styleSheets).find(fe=>fe.href===ee.href),de=getCssRulesString(le);de&&le&&(ne._cssText=de)}if(ie==="style"&&ee.sheet){const le=getCssRulesString(ee.sheet);le&&(ne._cssText=le)}const se=ee;if(ie==="input"&&(se.type==="radio"||se.type==="checkbox")&&(re===NodePrivacyLevel.ALLOW?ne.checked=!!se.checked:shouldMaskNode(se,re)&&delete ne.checked),ie==="audio"||ie==="video"){const le=ee;ne.rr_mediaState=le.paused?"paused":"played"}let ae,ue;const ce=te.serializationContext;switch(ce.status){case 0:ae=Math.round(ee.scrollTop),ue=Math.round(ee.scrollLeft),(ae||ue)&&ce.elementsScrollPositions.set(ee,{scrollTop:ae,scrollLeft:ue});break;case 1:ce.elementsScrollPositions.has(ee)&&({scrollTop:ae,scrollLeft:ue}=ce.elementsScrollPositions.get(ee));break}return ue&&(ne.rr_scrollLeft=ue),ae&&(ne.rr_scrollTop=ae),ne}function getCssRulesString(ee){if(!ee)return null;let re;try{re=ee.rules||ee.cssRules}catch{}if(!re)return null;const te=Array.from(re,isSafari()?getCssRuleStringForSafari:getCssRuleString).join("");return switchToAbsoluteUrl(te,ee.href)}function getCssRuleStringForSafari(ee){if(isCSSStyleRule(ee)&&ee.selectorText.includes(":")){const re=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return ee.cssText.replace(re,"$1\\$2")}return getCssRuleString(ee)}function getCssRuleString(ee){return isCSSImportRule(ee)&&getCssRulesString(ee.styleSheet)||ee.cssText}function isCSSImportRule(ee){return"styleSheet"in ee}function isCSSStyleRule(ee){return"selectorText"in ee}function serializeNodeWithId(ee,re){const te=serializeNode(ee,re);if(!te)return null;const ne=getSerializedNodeId(ee)||generateNextId(),ie=te;return ie.id=ne,setSerializedNodeId(ee,ne),re.serializedNodeIds&&re.serializedNodeIds.add(ne),ie}let _nextId=1;function generateNextId(){return _nextId++}function serializeChildNodes(ee,re){const te=[];return forEachChildNodes(ee,ne=>{const ie=serializeNodeWithId(ne,re);ie&&te.push(ie)}),te}function serializeNode(ee,re){switch(ee.nodeType){case ee.DOCUMENT_NODE:return serializeDocumentNode(ee,re);case ee.DOCUMENT_FRAGMENT_NODE:return serializeDocumentFragmentNode(ee,re);case ee.DOCUMENT_TYPE_NODE:return serializeDocumentTypeNode(ee);case ee.ELEMENT_NODE:return serializeElementNode(ee,re);case ee.TEXT_NODE:return serializeTextNode(ee,re);case ee.CDATA_SECTION_NODE:return serializeCDataNode()}}function serializeDocumentNode(ee,re){return{type:NodeType.Document,childNodes:serializeChildNodes(ee,re),adoptedStyleSheets:serializeStyleSheets(ee.adoptedStyleSheets)}}function serializeDocumentFragmentNode(ee,re){const te=isNodeShadowRoot(ee);return te&&re.serializationContext.shadowRootsController.addShadowRoot(ee),{type:NodeType.DocumentFragment,childNodes:serializeChildNodes(ee,re),isShadowRoot:te,adoptedStyleSheets:te?serializeStyleSheets(ee.adoptedStyleSheets):void 0}}function serializeDocumentTypeNode(ee){return{type:NodeType.DocumentType,name:ee.name,publicId:ee.publicId,systemId:ee.systemId}}function serializeElementNode(ee,re){const te=getValidTagName(ee.tagName),ne=isSVGElement(ee)||void 0,ie=reducePrivacyLevel(getNodeSelfPrivacyLevel(ee),re.parentNodePrivacyLevel);if(ie===NodePrivacyLevel.HIDDEN){const{width:ae,height:ue}=ee.getBoundingClientRect();return{type:NodeType.Element,tagName:te,attributes:{rr_width:`${ae}px`,rr_height:`${ue}px`,[PRIVACY_ATTR_NAME]:PRIVACY_ATTR_VALUE_HIDDEN},childNodes:[],isSVG:ne}}if(ie===NodePrivacyLevel.IGNORE)return;const oe=serializeAttributes(ee,ie,re);let se=[];if(hasChildNodes(ee)&&te!=="style"){let ae;re.parentNodePrivacyLevel===ie&&re.ignoreWhiteSpace===(te==="head")?ae=re:ae={...re,parentNodePrivacyLevel:ie,ignoreWhiteSpace:te==="head"},se=serializeChildNodes(ee,ae)}return{type:NodeType.Element,tagName:te,attributes:oe,childNodes:se,isSVG:ne}}function isSVGElement(ee){return ee.tagName==="svg"||ee instanceof SVGElement}function serializeTextNode(ee,re){const te=getTextContent(ee,re.ignoreWhiteSpace||!1,re.parentNodePrivacyLevel);if(te!==void 0)return{type:NodeType.Text,textContent:te}}function serializeCDataNode(){return{type:NodeType.CDATA,textContent:""}}function serializeDocument(ee,re,te){return serializeNodeWithId(ee,{serializationContext:te,parentNodePrivacyLevel:re.defaultPrivacyLevel,configuration:re})}function isTouchEvent(ee){return!!ee.changedTouches}function getEventTarget(ee){return ee.composed===!0&&isNodeShadowHost(ee.target)?ee.composedPath()[0]:ee.target}const TOLERANCE=25;function isVisualViewportFactoredIn(ee){return Math.abs(ee.pageTop-ee.offsetTop-window.scrollY)>TOLERANCE||Math.abs(ee.pageLeft-ee.offsetLeft-window.scrollX)>TOLERANCE}const convertMouseEventToLayoutCoordinates=(ee,re)=>{const te=window.visualViewport,ne={layoutViewportX:ee,layoutViewportY:re,visualViewportX:ee,visualViewportY:re};if(te)isVisualViewportFactoredIn(te)?(ne.layoutViewportX=Math.round(ee+te.offsetLeft),ne.layoutViewportY=Math.round(re+te.offsetTop)):(ne.visualViewportX=Math.round(ee-te.offsetLeft),ne.visualViewportY=Math.round(re-te.offsetTop));else return ne;return ne},getVisualViewport=ee=>({scale:ee.scale,offsetLeft:ee.offsetLeft,offsetTop:ee.offsetTop,pageLeft:ee.pageLeft,pageTop:ee.pageTop,height:ee.height,width:ee.width});function assembleIncrementalSnapshot(ee,re){return{data:{source:ee,...re},type:RecordType.IncrementalSnapshot,timestamp:timeStampNow()}}const MOUSE_MOVE_OBSERVER_THRESHOLD=50;function trackMove(ee,re){const{throttled:te,cancel:ne}=throttle$2(oe=>{const se=getEventTarget(oe);if(hasSerializedNode(se)){const ae=tryToComputeCoordinates(oe);if(!ae)return;const ue={id:getSerializedNodeId(se),timeOffset:0,x:ae.x,y:ae.y};re(assembleIncrementalSnapshot(isTouchEvent(oe)?IncrementalSource.TouchMove:IncrementalSource.MouseMove,{positions:[ue]}))}},MOUSE_MOVE_OBSERVER_THRESHOLD,{trailing:!1}),{stop:ie}=addEventListeners(ee,document,["mousemove","touchmove"],te,{capture:!0,passive:!0});return{stop:()=>{ie(),ne()}}}function tryToComputeCoordinates(ee){let{clientX:re,clientY:te}=isTouchEvent(ee)?ee.changedTouches[0]:ee;if(window.visualViewport){const{visualViewportX:ne,visualViewportY:ie}=convertMouseEventToLayoutCoordinates(re,te);re=ne,te=ie}if(!Number.isFinite(re)||!Number.isFinite(te)){ee.isTrusted&&addTelemetryDebug("mouse/touch event without x/y");return}return{x:re,y:te}}const eventTypeToMouseInteraction={pointerup:MouseInteractionType.MouseUp,mousedown:MouseInteractionType.MouseDown,click:MouseInteractionType.Click,contextmenu:MouseInteractionType.ContextMenu,dblclick:MouseInteractionType.DblClick,focus:MouseInteractionType.Focus,blur:MouseInteractionType.Blur,touchstart:MouseInteractionType.TouchStart,touchend:MouseInteractionType.TouchEnd};function trackMouseInteraction(ee,re,te){const ne=ie=>{const oe=getEventTarget(ie);if(getNodePrivacyLevel(oe,ee.defaultPrivacyLevel)===NodePrivacyLevel.HIDDEN||!hasSerializedNode(oe))return;const se=getSerializedNodeId(oe),ae=eventTypeToMouseInteraction[ie.type];let ue;if(ae!==MouseInteractionType.Blur&&ae!==MouseInteractionType.Focus){const le=tryToComputeCoordinates(ie);if(!le)return;ue={id:se,type:ae,x:le.x,y:le.y}}else ue={id:se,type:ae};const ce={id:te.getIdForEvent(ie),...assembleIncrementalSnapshot(IncrementalSource.MouseInteraction,ue)};re(ce)};return addEventListeners(ee,document,Object.keys(eventTypeToMouseInteraction),ne,{capture:!0,passive:!0})}const SCROLL_OBSERVER_THRESHOLD=100;function trackScroll(ee,re,te,ne=document){const{throttled:ie,cancel:oe}=throttle$2(ae=>{const ue=getEventTarget(ae);if(!ue||getNodePrivacyLevel(ue,ee.defaultPrivacyLevel)===NodePrivacyLevel.HIDDEN||!hasSerializedNode(ue))return;const ce=getSerializedNodeId(ue),le=ue===document?{scrollTop:getScrollY(),scrollLeft:getScrollX()}:{scrollTop:Math.round(ue.scrollTop),scrollLeft:Math.round(ue.scrollLeft)};te.set(ue,le),re(assembleIncrementalSnapshot(IncrementalSource.Scroll,{id:ce,x:le.scrollLeft,y:le.scrollTop}))},SCROLL_OBSERVER_THRESHOLD),{stop:se}=addEventListener$1(ee,ne,"scroll",ie,{capture:!0,passive:!0});return{stop:()=>{se(),oe()}}}const VISUAL_VIEWPORT_OBSERVER_THRESHOLD=200;function trackViewportResize(ee,re){const te=initViewportObservable(ee).subscribe(ne=>{re(assembleIncrementalSnapshot(IncrementalSource.ViewportResize,ne))});return{stop:()=>{te.unsubscribe()}}}function trackVisualViewportResize(ee,re){const te=window.visualViewport;if(!te)return{stop:noop$2};const{throttled:ne,cancel:ie}=throttle$2(()=>{re({data:getVisualViewport(te),type:RecordType.VisualViewport,timestamp:timeStampNow()})},VISUAL_VIEWPORT_OBSERVER_THRESHOLD,{trailing:!1}),{stop:oe}=addEventListeners(ee,te,["resize","scroll"],ne,{capture:!0,passive:!0});return{stop:()=>{oe(),ie()}}}function trackMediaInteraction(ee,re){return addEventListeners(ee,document,["play","pause"],te=>{const ne=getEventTarget(te);!ne||getNodePrivacyLevel(ne,ee.defaultPrivacyLevel)===NodePrivacyLevel.HIDDEN||!hasSerializedNode(ne)||re(assembleIncrementalSnapshot(IncrementalSource.MediaInteraction,{id:getSerializedNodeId(ne),type:te.type==="play"?MediaInteractionType.Play:MediaInteractionType.Pause}))},{capture:!0,passive:!0})}function trackStyleSheet(ee){function re(ie,oe){ie&&hasSerializedNode(ie.ownerNode)&&oe(getSerializedNodeId(ie.ownerNode))}const te=[instrumentMethod(CSSStyleSheet.prototype,"insertRule",({target:ie,parameters:[oe,se]})=>{re(ie,ae=>ee(assembleIncrementalSnapshot(IncrementalSource.StyleSheetRule,{id:ae,adds:[{rule:oe,index:se}]})))}),instrumentMethod(CSSStyleSheet.prototype,"deleteRule",({target:ie,parameters:[oe]})=>{re(ie,se=>ee(assembleIncrementalSnapshot(IncrementalSource.StyleSheetRule,{id:se,removes:[{index:oe}]})))})];typeof CSSGroupingRule<"u"?ne(CSSGroupingRule):(ne(CSSMediaRule),ne(CSSSupportsRule));function ne(ie){te.push(instrumentMethod(ie.prototype,"insertRule",({target:oe,parameters:[se,ae]})=>{re(oe.parentStyleSheet,ue=>{const ce=getPathToNestedCSSRule(oe);ce&&(ce.push(ae||0),ee(assembleIncrementalSnapshot(IncrementalSource.StyleSheetRule,{id:ue,adds:[{rule:se,index:ce}]})))})}),instrumentMethod(ie.prototype,"deleteRule",({target:oe,parameters:[se]})=>{re(oe.parentStyleSheet,ae=>{const ue=getPathToNestedCSSRule(oe);ue&&(ue.push(se),ee(assembleIncrementalSnapshot(IncrementalSource.StyleSheetRule,{id:ae,removes:[{index:ue}]})))})}))}return{stop:()=>{te.forEach(ie=>ie.stop())}}}function getPathToNestedCSSRule(ee){const re=[];let te=ee;for(;te.parentRule;){const se=Array.from(te.parentRule.cssRules).indexOf(te);re.unshift(se),te=te.parentRule}if(!te.parentStyleSheet)return;const ie=Array.from(te.parentStyleSheet.cssRules).indexOf(te);return re.unshift(ie),re}function trackFocus(ee,re){return addEventListeners(ee,window,["focus","blur"],()=>{re({data:{has_focus:document.hasFocus()},type:RecordType.Focus,timestamp:timeStampNow()})})}function trackFrustration(ee,re,te){const ne=ee.subscribe(12,ie=>{var oe,se;ie.rawRumEvent.type==="action"&&ie.rawRumEvent.action.type==="click"&&(!((se=(oe=ie.rawRumEvent.action.frustration)===null||oe===void 0?void 0:oe.type)===null||se===void 0)&&se.length)&&"events"in ie.domainContext&&ie.domainContext.events&&ie.domainContext.events.length&&re({timestamp:ie.rawRumEvent.date,type:RecordType.FrustrationRecord,data:{frustrationTypes:ie.rawRumEvent.action.frustration.type,recordIds:ie.domainContext.events.map(ae=>te.getIdForEvent(ae))}})});return{stop:()=>{ne.unsubscribe()}}}function trackViewEnd(ee,re){const te=ee.subscribe(5,()=>{re({timestamp:timeStampNow(),type:RecordType.ViewEnd})});return{stop:()=>{te.unsubscribe()}}}function trackInput(ee,re,te=document){const ne=ee.defaultPrivacyLevel,ie=new WeakMap,oe=te!==document,{stop:se}=addEventListeners(ee,te,oe?["change"]:["input","change"],le=>{const de=getEventTarget(le);(de instanceof HTMLInputElement||de instanceof HTMLTextAreaElement||de instanceof HTMLSelectElement)&&ue(de)},{capture:!0,passive:!0});let ae;if(oe)ae=noop$2;else{const le=[instrumentSetter(HTMLInputElement.prototype,"value",ue),instrumentSetter(HTMLInputElement.prototype,"checked",ue),instrumentSetter(HTMLSelectElement.prototype,"value",ue),instrumentSetter(HTMLTextAreaElement.prototype,"value",ue),instrumentSetter(HTMLSelectElement.prototype,"selectedIndex",ue)];ae=()=>{le.forEach(de=>de.stop())}}return{stop:()=>{ae(),se()}};function ue(le){const de=getNodePrivacyLevel(le,ne);if(de===NodePrivacyLevel.HIDDEN)return;const fe=le.type;let he;if(fe==="radio"||fe==="checkbox"){if(shouldMaskNode(le,de))return;he={isChecked:le.checked}}else{const ge=getElementInputValue(le,de);if(ge===void 0)return;he={text:ge}}ce(le,he);const pe=le.name;fe==="radio"&&pe&&le.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(pe)}"]`).forEach(ge=>{ge!==le&&ce(ge,{isChecked:!1})})}function ce(le,de){if(!hasSerializedNode(le))return;const fe=ie.get(le);(!fe||fe.text!==de.text||fe.isChecked!==de.isChecked)&&(ie.set(le,de),re(assembleIncrementalSnapshot(IncrementalSource.Input,{id:getSerializedNodeId(le),...de})))}}const MUTATION_PROCESS_MAX_DELAY=100,MUTATION_PROCESS_MIN_DELAY=16;function createMutationBatch(ee){let re=noop$2,te=[];function ne(){re(),ee(te),te=[]}const{throttled:ie,cancel:oe}=throttle$2(ne,MUTATION_PROCESS_MIN_DELAY,{leading:!1});return{addMutations:se=>{te.length===0&&(re=requestIdleCallback(ie,{timeout:MUTATION_PROCESS_MAX_DELAY})),te.push(...se)},flush:ne,stop:()=>{re(),oe()}}}function trackMutation(ee,re,te,ne){const ie=getMutationObserverConstructor();if(!ie)return{stop:noop$2,flush:noop$2};const oe=createMutationBatch(ae=>{processMutations(ae.concat(se.takeRecords()),ee,re,te)}),se=new ie(monitor(oe.addMutations));return se.observe(ne,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{se.disconnect(),oe.stop()},flush:()=>{oe.flush()}}}function processMutations(ee,re,te,ne){const ie=new Map;ee.filter(de=>de.type==="childList").forEach(de=>{de.removedNodes.forEach(fe=>{traverseRemovedShadowDom(fe,ne.removeShadowRoot)})});const oe=ee.filter(de=>de.target.isConnected&&nodeAndAncestorsHaveSerializedNode(de.target)&&getNodePrivacyLevel(de.target,te.defaultPrivacyLevel,ie)!==NodePrivacyLevel.HIDDEN),{adds:se,removes:ae,hasBeenSerialized:ue}=processChildListMutations(oe.filter(de=>de.type==="childList"),te,ne,ie),ce=processCharacterDataMutations(oe.filter(de=>de.type==="characterData"&&!ue(de.target)),te,ie),le=processAttributesMutations(oe.filter(de=>de.type==="attributes"&&!ue(de.target)),te,ie);!ce.length&&!le.length&&!ae.length&&!se.length||re(assembleIncrementalSnapshot(IncrementalSource.Mutation,{adds:se,removes:ae,texts:ce,attributes:le}))}function processChildListMutations(ee,re,te,ne){const ie=new Set,oe=new Map;for(const fe of ee)fe.addedNodes.forEach(he=>{ie.add(he)}),fe.removedNodes.forEach(he=>{ie.has(he)||oe.set(he,fe.target),ie.delete(he)});const se=Array.from(ie);sortAddedAndMovedNodes(se);const ae=new Set,ue=[];for(const fe of se){if(le(fe))continue;const he=getNodePrivacyLevel(fe.parentNode,re.defaultPrivacyLevel,ne);if(he===NodePrivacyLevel.HIDDEN||he===NodePrivacyLevel.IGNORE)continue;const pe=serializeNodeWithId(fe,{serializedNodeIds:ae,parentNodePrivacyLevel:he,serializationContext:{status:2,shadowRootsController:te},configuration:re});if(!pe)continue;const ge=getParentNode(fe);ue.push({nextId:de(fe),parentId:getSerializedNodeId(ge),node:pe})}const ce=[];return oe.forEach((fe,he)=>{hasSerializedNode(he)&&ce.push({parentId:getSerializedNodeId(fe),id:getSerializedNodeId(he)})}),{adds:ue,removes:ce,hasBeenSerialized:le};function le(fe){return hasSerializedNode(fe)&&ae.has(getSerializedNodeId(fe))}function de(fe){let he=fe.nextSibling;for(;he;){if(hasSerializedNode(he))return getSerializedNodeId(he);he=he.nextSibling}return null}}function processCharacterDataMutations(ee,re,te){var ne;const ie=[],oe=new Set,se=ee.filter(ae=>oe.has(ae.target)?!1:(oe.add(ae.target),!0));for(const ae of se){if(ae.target.textContent===ae.oldValue)continue;const ce=getNodePrivacyLevel(getParentNode(ae.target),re.defaultPrivacyLevel,te);ce===NodePrivacyLevel.HIDDEN||ce===NodePrivacyLevel.IGNORE||ie.push({id:getSerializedNodeId(ae.target),value:(ne=getTextContent(ae.target,!1,ce))!==null&&ne!==void 0?ne:null})}return ie}function processAttributesMutations(ee,re,te){const ne=[],ie=new Map,oe=ee.filter(ae=>{const ue=ie.get(ae.target);return ue&&ue.has(ae.attributeName)?!1:(ue?ue.add(ae.attributeName):ie.set(ae.target,new Set([ae.attributeName])),!0)}),se=new Map;for(const ae of oe){if(ae.target.getAttribute(ae.attributeName)===ae.oldValue)continue;const ce=getNodePrivacyLevel(ae.target,re.defaultPrivacyLevel,te),le=serializeAttribute(ae.target,ce,ae.attributeName,re);let de;if(ae.attributeName==="value"){const he=getElementInputValue(ae.target,ce);if(he===void 0)continue;de=he}else typeof le=="string"?de=le:de=null;let fe=se.get(ae.target);fe||(fe={id:getSerializedNodeId(ae.target),attributes:{}},ne.push(fe),se.set(ae.target,fe)),fe.attributes[ae.attributeName]=de}return ne}function sortAddedAndMovedNodes(ee){ee.sort((re,te)=>{const ne=re.compareDocumentPosition(te);return ne&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:ne&Node.DOCUMENT_POSITION_CONTAINS||ne&Node.DOCUMENT_POSITION_FOLLOWING?1:ne&Node.DOCUMENT_POSITION_PRECEDING?-1:0})}function traverseRemovedShadowDom(ee,re){isNodeShadowHost(ee)&&re(ee.shadowRoot),forEachChildNodes(ee,te=>traverseRemovedShadowDom(te,re))}function createElementsScrollPositions(){const ee=new WeakMap;return{set(re,te){re===document&&!document.scrollingElement||ee.set(re===document?document.scrollingElement:re,te)},get(re){return ee.get(re)},has(re){return ee.has(re)}}}const initShadowRootsController=(ee,re,te)=>{const ne=new Map,ie={addShadowRoot:oe=>{if(ne.has(oe))return;const se=trackMutation(re,ee,ie,oe),ae=trackInput(ee,re,oe),ue=trackScroll(ee,re,te,oe);ne.set(oe,{flush:()=>se.flush(),stop:()=>{se.stop(),ae.stop(),ue.stop()}})},removeShadowRoot:oe=>{const se=ne.get(oe);se&&(se.stop(),ne.delete(oe))},stop:()=>{ne.forEach(({stop:oe})=>oe())},flush:()=>{ne.forEach(({flush:oe})=>oe())}};return ie};function startFullSnapshots(ee,re,te,ne,ie,oe){const se=(ue=timeStampNow(),ce={status:0,elementsScrollPositions:ee,shadowRootsController:re})=>{const{width:le,height:de}=getViewportDimension(),fe=[{data:{height:de,href:window.location.href,width:le},type:RecordType.Meta,timestamp:ue},{data:{has_focus:document.hasFocus()},type:RecordType.Focus,timestamp:ue},{data:{node:serializeDocument(document,ne,ce),initialOffset:{left:getScrollX(),top:getScrollY()}},type:RecordType.FullSnapshot,timestamp:ue}];return window.visualViewport&&fe.push({data:getVisualViewport(window.visualViewport),type:RecordType.VisualViewport,timestamp:ue}),fe};oe(se());const{unsubscribe:ae}=te.subscribe(2,ue=>{ie(),oe(se(ue.startClocks.timeStamp,{shadowRootsController:re,status:1,elementsScrollPositions:ee}))});return{stop:ae}}function initRecordIds(){const ee=new WeakMap;let re=1;return{getIdForEvent(te){return ee.has(te)||ee.set(te,re++),ee.get(te)}}}function record(ee){const{emit:re,configuration:te,lifeCycle:ne}=ee;if(!re)throw new Error("emit function is required");const ie=fe=>{re(fe),sendToExtension("record",{record:fe});const he=ee.viewHistory.findView();addRecord(he.id)},oe=createElementsScrollPositions(),se=initShadowRootsController(te,ie,oe),{stop:ae}=startFullSnapshots(oe,se,ne,te,ue,fe=>fe.forEach(he=>ie(he)));function ue(){se.flush(),le.flush()}const ce=initRecordIds(),le=trackMutation(ie,te,se,document),de=[le,trackMove(te,ie),trackMouseInteraction(te,ie,ce),trackScroll(te,ie,oe,document),trackViewportResize(te,ie),trackInput(te,ie),trackMediaInteraction(te,ie),trackStyleSheet(ie),trackFocus(te,ie),trackVisualViewportResize(te,ie),trackFrustration(ne,ie,ce),trackViewEnd(ne,fe=>{ue(),ie(fe)})];return{stop:()=>{se.stop(),de.forEach(fe=>fe.stop()),ae()},flushMutations:ue,shadowRootsController:se}}function buildReplayPayload(ee,re,te){const ne=new FormData;ne.append("segment",new Blob([ee],{type:"application/octet-stream"}),`${re.session.id}-${re.start}`);const ie={raw_segment_size:te,compressed_segment_size:ee.byteLength,...re},oe=JSON.stringify(ie);return ne.append("event",new Blob([oe],{type:"application/json"})),{data:ne,bytesCount:ee.byteLength}}function createSegment({context:ee,creationReason:re,encoder:te}){let ne=0;const ie=ee.view.id,oe={start:1/0,end:-1/0,creation_reason:re,records_count:0,has_full_snapshot:!1,index_in_view:getSegmentsCount(ie),source:"browser",...ee};addSegment(ie);function se(ue,ce){oe.start=Math.min(oe.start,ue.timestamp),oe.end=Math.max(oe.end,ue.timestamp),oe.records_count+=1,oe.has_full_snapshot||(oe.has_full_snapshot=ue.type===RecordType.FullSnapshot);const le=te.isEmpty?'{"records":[':",";te.write(le+JSON.stringify(ue),de=>{ne+=de,ce(ne)})}function ae(ue){if(te.isEmpty)throw new Error("Empty segment flushed");te.write(`],${JSON.stringify(oe).slice(1)}
|
|
1123
|
+
`;class AstroPayPayment extends Component{constructor(te){super({tag:"div",styles:ie=>getAstroPayPaymentStyles(ie)});xe(this,"loadingWrapper");xe(this,"componentProps");xe(this,"methodCode");if(this.methodCode=ECheckoutPaymentMethod.ASTRO_PAY,te.paymentExternalId)this.componentProps=te;else{const ie=te;this.componentProps={...ie,country:ie.country.trim().toUpperCase(),currency:ie.currency.trim().toUpperCase()}}AstroPayCore.registerComponent(this),AmplitudeAnalytics.astroPayPaymentImpression("AstroPayPayment"),this.loadingWrapper=document.createElement("div"),this.loadingWrapper.classList.add("loading-wrapper");const ne=new Loading({size:100,variant:"fetching",color:ThemeManager.getStyles().primaryColor}).element;this.loadingWrapper.append(ne),this.element.appendChild(this.loadingWrapper),DataDogTracker.trackEvent("ap_cl_astropay_payment_init"),this.createPayment()}async createPayment(){var te,ne;try{let ie;this.componentProps.paymentExternalId?ie=await PaymentService.getPaymentDetails(this.componentProps.paymentExternalId,"astropay_payment"):ie=await PaymentService.postCreatePayment({country:this.componentProps.country,currency:this.componentProps.currency,amount:this.componentProps.amount,user:this.componentProps.user,order:this.componentProps.order,methodCode:this.methodCode},"astropay_payment"),this.renderAstroPayMethod(ie)}catch(ie){const oe=ie;(ne=(te=this.componentProps)==null?void 0:te.onError)==null||ne.call(te);const se=new Typography({text:oe.description??oe.message,size:ThemeManager.getFontScale().xSmall,color:ThemeManager.getStyles().messages.error.textColor}).element;this.element.appendChild(se)}finally{this.loadingWrapper.remove()}}renderAstroPayMethod(te){const{paymentExternalId:ne,user:ie,countries:oe,benefits:se,metadata:ae,paymentAmount:ue}=te;this.element.innerHTML="";const ce=(ue==null?void 0:ue.amount)??this.componentProps.amount,le=(ue==null?void 0:ue.currency)??this.componentProps.currency;if(ce===void 0||le===void 0)throw new Error(AstroPayI18n.translate("generic_error"));const de={amount:ce,currency:le},fe=new AstroPayPaymentMethod({paymentExternalId:ne,user:ie,countries:oe,benefits:se,paymentAmount:de,actionLabel:ae==null?void 0:ae.actionLabel,onSuccess:he=>this.showResultScreen(he,{type:"success",onSuccess:this.componentProps.onSuccess}),onError:he=>this.showResultScreen(he,{type:"error",onError:this.componentProps.onError})}).element;this.element.append(fe)}showResultScreen(te,ne){this.element.innerHTML="";const ie=new ResultScreen({type:ne.type,contentElements:te,onSuccess:ne==null?void 0:ne.onSuccess,onError:ne==null?void 0:ne.onError});this.element.append(ie.element)}render(te){if(!te)throw new Error("Container element not found");te.appendChild(this.element)}destroy(){this.element.remove(),AstroPayCore.unregisterComponent(this)}}loadFonts();const serializedNodeIds=new WeakMap;function hasSerializedNode(ee){return serializedNodeIds.has(ee)}function nodeAndAncestorsHaveSerializedNode(ee){let re=ee;for(;re;){if(!hasSerializedNode(re)&&!isNodeShadowRoot(re))return!1;re=getParentNode(re)}return!0}function getSerializedNodeId(ee){return serializedNodeIds.get(ee)}function setSerializedNodeId(ee,re){serializedNodeIds.set(ee,re)}function getElementInputValue(ee,re){const te=ee.tagName,ne=ee.value;if(shouldMaskNode(ee,re)){const ie=ee.type;return te==="INPUT"&&(ie==="button"||ie==="submit"||ie==="reset")?ne:!ne||te==="OPTION"?void 0:CENSORED_STRING_MARK}if(te==="OPTION"||te==="SELECT")return ee.value;if(!(te!=="INPUT"&&te!=="TEXTAREA"))return ne}const URL_IN_CSS_REF=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,ABSOLUTE_URL=/^[A-Za-z]+:|^\/\//,DATA_URI=/^data:.*,/i;function switchToAbsoluteUrl(ee,re){return ee.replace(URL_IN_CSS_REF,(te,ne,ie,oe,se,ae)=>{const ue=ie||se||ae;if(!re||!ue||ABSOLUTE_URL.test(ue)||DATA_URI.test(ue))return te;const ce=ne||oe||"";return`url(${ce}${makeUrlAbsolute(ue,re)}${ce})`})}function makeUrlAbsolute(ee,re){try{return buildUrl(ee,re).href}catch{return ee}}const TAG_NAME_REGEX=/[^a-z1-6-_]/;function getValidTagName(ee){const re=ee.toLowerCase().trim();return TAG_NAME_REGEX.test(re)?"div":re}function censoredImageForSize(ee,re){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${ee}' height='${re}' style='background-color:silver'%3E%3C/svg%3E`}const RecordType={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9},NodeType={Document:0,DocumentType:1,Element:2,Text:3,CDATA:4,DocumentFragment:11},IncrementalSource={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},MouseInteractionType={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},MediaInteractionType={Play:0,Pause:1};function serializeStyleSheets(ee){if(!(ee===void 0||ee.length===0))return ee.map(re=>{const te=re.cssRules||re.rules;return{cssRules:Array.from(te,oe=>oe.cssText),disabled:re.disabled||void 0,media:re.media.length>0?Array.from(re.media):void 0}})}function serializeAttribute(ee,re,te,ne){if(re===NodePrivacyLevel.HIDDEN)return null;const ie=ee.getAttribute(te);if(re===NodePrivacyLevel.MASK&&te!==PRIVACY_ATTR_NAME&&!STABLE_ATTRIBUTES.includes(te)&&te!==ne.actionNameAttribute){const oe=ee.tagName;switch(te){case"title":case"alt":case"placeholder":return CENSORED_STRING_MARK}if(oe==="IMG"&&(te==="src"||te==="srcset")){const se=ee;if(se.naturalWidth>0)return censoredImageForSize(se.naturalWidth,se.naturalHeight);const{width:ae,height:ue}=ee.getBoundingClientRect();return ae>0||ue>0?censoredImageForSize(ae,ue):CENSORED_IMG_MARK}if(oe==="SOURCE"&&(te==="src"||te==="srcset"))return CENSORED_IMG_MARK;if(oe==="A"&&te==="href"||ie&&te.startsWith("data-")||oe==="IFRAME"&&te==="srcdoc")return CENSORED_STRING_MARK}return!ie||typeof ie!="string"?ie:isLongDataUrl(ie)?sanitizeDataUrl(ie):ie}function serializeAttributes(ee,re,te){if(re===NodePrivacyLevel.HIDDEN)return{};const ne={},ie=getValidTagName(ee.tagName),oe=ee.ownerDocument;for(let le=0;le<ee.attributes.length;le+=1){const fe=ee.attributes.item(le).name,he=serializeAttribute(ee,re,fe,te.configuration);he!==null&&(ne[fe]=he)}if(ee.value&&(ie==="textarea"||ie==="select"||ie==="option"||ie==="input")){const le=getElementInputValue(ee,re);le!==void 0&&(ne.value=le)}if(ie==="option"&&re===NodePrivacyLevel.ALLOW){const le=ee;le.selected&&(ne.selected=le.selected)}if(ie==="link"){const le=Array.from(oe.styleSheets).find(fe=>fe.href===ee.href),de=getCssRulesString(le);de&&le&&(ne._cssText=de)}if(ie==="style"&&ee.sheet){const le=getCssRulesString(ee.sheet);le&&(ne._cssText=le)}const se=ee;if(ie==="input"&&(se.type==="radio"||se.type==="checkbox")&&(re===NodePrivacyLevel.ALLOW?ne.checked=!!se.checked:shouldMaskNode(se,re)&&delete ne.checked),ie==="audio"||ie==="video"){const le=ee;ne.rr_mediaState=le.paused?"paused":"played"}let ae,ue;const ce=te.serializationContext;switch(ce.status){case 0:ae=Math.round(ee.scrollTop),ue=Math.round(ee.scrollLeft),(ae||ue)&&ce.elementsScrollPositions.set(ee,{scrollTop:ae,scrollLeft:ue});break;case 1:ce.elementsScrollPositions.has(ee)&&({scrollTop:ae,scrollLeft:ue}=ce.elementsScrollPositions.get(ee));break}return ue&&(ne.rr_scrollLeft=ue),ae&&(ne.rr_scrollTop=ae),ne}function getCssRulesString(ee){if(!ee)return null;let re;try{re=ee.rules||ee.cssRules}catch{}if(!re)return null;const te=Array.from(re,isSafari()?getCssRuleStringForSafari:getCssRuleString).join("");return switchToAbsoluteUrl(te,ee.href)}function getCssRuleStringForSafari(ee){if(isCSSStyleRule(ee)&&ee.selectorText.includes(":")){const re=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return ee.cssText.replace(re,"$1\\$2")}return getCssRuleString(ee)}function getCssRuleString(ee){return isCSSImportRule(ee)&&getCssRulesString(ee.styleSheet)||ee.cssText}function isCSSImportRule(ee){return"styleSheet"in ee}function isCSSStyleRule(ee){return"selectorText"in ee}function serializeNodeWithId(ee,re){const te=serializeNode(ee,re);if(!te)return null;const ne=getSerializedNodeId(ee)||generateNextId(),ie=te;return ie.id=ne,setSerializedNodeId(ee,ne),re.serializedNodeIds&&re.serializedNodeIds.add(ne),ie}let _nextId=1;function generateNextId(){return _nextId++}function serializeChildNodes(ee,re){const te=[];return forEachChildNodes(ee,ne=>{const ie=serializeNodeWithId(ne,re);ie&&te.push(ie)}),te}function serializeNode(ee,re){switch(ee.nodeType){case ee.DOCUMENT_NODE:return serializeDocumentNode(ee,re);case ee.DOCUMENT_FRAGMENT_NODE:return serializeDocumentFragmentNode(ee,re);case ee.DOCUMENT_TYPE_NODE:return serializeDocumentTypeNode(ee);case ee.ELEMENT_NODE:return serializeElementNode(ee,re);case ee.TEXT_NODE:return serializeTextNode(ee,re);case ee.CDATA_SECTION_NODE:return serializeCDataNode()}}function serializeDocumentNode(ee,re){return{type:NodeType.Document,childNodes:serializeChildNodes(ee,re),adoptedStyleSheets:serializeStyleSheets(ee.adoptedStyleSheets)}}function serializeDocumentFragmentNode(ee,re){const te=isNodeShadowRoot(ee);return te&&re.serializationContext.shadowRootsController.addShadowRoot(ee),{type:NodeType.DocumentFragment,childNodes:serializeChildNodes(ee,re),isShadowRoot:te,adoptedStyleSheets:te?serializeStyleSheets(ee.adoptedStyleSheets):void 0}}function serializeDocumentTypeNode(ee){return{type:NodeType.DocumentType,name:ee.name,publicId:ee.publicId,systemId:ee.systemId}}function serializeElementNode(ee,re){const te=getValidTagName(ee.tagName),ne=isSVGElement(ee)||void 0,ie=reducePrivacyLevel(getNodeSelfPrivacyLevel(ee),re.parentNodePrivacyLevel);if(ie===NodePrivacyLevel.HIDDEN){const{width:ae,height:ue}=ee.getBoundingClientRect();return{type:NodeType.Element,tagName:te,attributes:{rr_width:`${ae}px`,rr_height:`${ue}px`,[PRIVACY_ATTR_NAME]:PRIVACY_ATTR_VALUE_HIDDEN},childNodes:[],isSVG:ne}}if(ie===NodePrivacyLevel.IGNORE)return;const oe=serializeAttributes(ee,ie,re);let se=[];if(hasChildNodes(ee)&&te!=="style"){let ae;re.parentNodePrivacyLevel===ie&&re.ignoreWhiteSpace===(te==="head")?ae=re:ae={...re,parentNodePrivacyLevel:ie,ignoreWhiteSpace:te==="head"},se=serializeChildNodes(ee,ae)}return{type:NodeType.Element,tagName:te,attributes:oe,childNodes:se,isSVG:ne}}function isSVGElement(ee){return ee.tagName==="svg"||ee instanceof SVGElement}function serializeTextNode(ee,re){const te=getTextContent(ee,re.ignoreWhiteSpace||!1,re.parentNodePrivacyLevel);if(te!==void 0)return{type:NodeType.Text,textContent:te}}function serializeCDataNode(){return{type:NodeType.CDATA,textContent:""}}function serializeDocument(ee,re,te){return serializeNodeWithId(ee,{serializationContext:te,parentNodePrivacyLevel:re.defaultPrivacyLevel,configuration:re})}function isTouchEvent(ee){return!!ee.changedTouches}function getEventTarget(ee){return ee.composed===!0&&isNodeShadowHost(ee.target)?ee.composedPath()[0]:ee.target}const TOLERANCE=25;function isVisualViewportFactoredIn(ee){return Math.abs(ee.pageTop-ee.offsetTop-window.scrollY)>TOLERANCE||Math.abs(ee.pageLeft-ee.offsetLeft-window.scrollX)>TOLERANCE}const convertMouseEventToLayoutCoordinates=(ee,re)=>{const te=window.visualViewport,ne={layoutViewportX:ee,layoutViewportY:re,visualViewportX:ee,visualViewportY:re};if(te)isVisualViewportFactoredIn(te)?(ne.layoutViewportX=Math.round(ee+te.offsetLeft),ne.layoutViewportY=Math.round(re+te.offsetTop)):(ne.visualViewportX=Math.round(ee-te.offsetLeft),ne.visualViewportY=Math.round(re-te.offsetTop));else return ne;return ne},getVisualViewport=ee=>({scale:ee.scale,offsetLeft:ee.offsetLeft,offsetTop:ee.offsetTop,pageLeft:ee.pageLeft,pageTop:ee.pageTop,height:ee.height,width:ee.width});function assembleIncrementalSnapshot(ee,re){return{data:{source:ee,...re},type:RecordType.IncrementalSnapshot,timestamp:timeStampNow()}}const MOUSE_MOVE_OBSERVER_THRESHOLD=50;function trackMove(ee,re){const{throttled:te,cancel:ne}=throttle$2(oe=>{const se=getEventTarget(oe);if(hasSerializedNode(se)){const ae=tryToComputeCoordinates(oe);if(!ae)return;const ue={id:getSerializedNodeId(se),timeOffset:0,x:ae.x,y:ae.y};re(assembleIncrementalSnapshot(isTouchEvent(oe)?IncrementalSource.TouchMove:IncrementalSource.MouseMove,{positions:[ue]}))}},MOUSE_MOVE_OBSERVER_THRESHOLD,{trailing:!1}),{stop:ie}=addEventListeners(ee,document,["mousemove","touchmove"],te,{capture:!0,passive:!0});return{stop:()=>{ie(),ne()}}}function tryToComputeCoordinates(ee){let{clientX:re,clientY:te}=isTouchEvent(ee)?ee.changedTouches[0]:ee;if(window.visualViewport){const{visualViewportX:ne,visualViewportY:ie}=convertMouseEventToLayoutCoordinates(re,te);re=ne,te=ie}if(!Number.isFinite(re)||!Number.isFinite(te)){ee.isTrusted&&addTelemetryDebug("mouse/touch event without x/y");return}return{x:re,y:te}}const eventTypeToMouseInteraction={pointerup:MouseInteractionType.MouseUp,mousedown:MouseInteractionType.MouseDown,click:MouseInteractionType.Click,contextmenu:MouseInteractionType.ContextMenu,dblclick:MouseInteractionType.DblClick,focus:MouseInteractionType.Focus,blur:MouseInteractionType.Blur,touchstart:MouseInteractionType.TouchStart,touchend:MouseInteractionType.TouchEnd};function trackMouseInteraction(ee,re,te){const ne=ie=>{const oe=getEventTarget(ie);if(getNodePrivacyLevel(oe,ee.defaultPrivacyLevel)===NodePrivacyLevel.HIDDEN||!hasSerializedNode(oe))return;const se=getSerializedNodeId(oe),ae=eventTypeToMouseInteraction[ie.type];let ue;if(ae!==MouseInteractionType.Blur&&ae!==MouseInteractionType.Focus){const le=tryToComputeCoordinates(ie);if(!le)return;ue={id:se,type:ae,x:le.x,y:le.y}}else ue={id:se,type:ae};const ce={id:te.getIdForEvent(ie),...assembleIncrementalSnapshot(IncrementalSource.MouseInteraction,ue)};re(ce)};return addEventListeners(ee,document,Object.keys(eventTypeToMouseInteraction),ne,{capture:!0,passive:!0})}const SCROLL_OBSERVER_THRESHOLD=100;function trackScroll(ee,re,te,ne=document){const{throttled:ie,cancel:oe}=throttle$2(ae=>{const ue=getEventTarget(ae);if(!ue||getNodePrivacyLevel(ue,ee.defaultPrivacyLevel)===NodePrivacyLevel.HIDDEN||!hasSerializedNode(ue))return;const ce=getSerializedNodeId(ue),le=ue===document?{scrollTop:getScrollY(),scrollLeft:getScrollX()}:{scrollTop:Math.round(ue.scrollTop),scrollLeft:Math.round(ue.scrollLeft)};te.set(ue,le),re(assembleIncrementalSnapshot(IncrementalSource.Scroll,{id:ce,x:le.scrollLeft,y:le.scrollTop}))},SCROLL_OBSERVER_THRESHOLD),{stop:se}=addEventListener$1(ee,ne,"scroll",ie,{capture:!0,passive:!0});return{stop:()=>{se(),oe()}}}const VISUAL_VIEWPORT_OBSERVER_THRESHOLD=200;function trackViewportResize(ee,re){const te=initViewportObservable(ee).subscribe(ne=>{re(assembleIncrementalSnapshot(IncrementalSource.ViewportResize,ne))});return{stop:()=>{te.unsubscribe()}}}function trackVisualViewportResize(ee,re){const te=window.visualViewport;if(!te)return{stop:noop$2};const{throttled:ne,cancel:ie}=throttle$2(()=>{re({data:getVisualViewport(te),type:RecordType.VisualViewport,timestamp:timeStampNow()})},VISUAL_VIEWPORT_OBSERVER_THRESHOLD,{trailing:!1}),{stop:oe}=addEventListeners(ee,te,["resize","scroll"],ne,{capture:!0,passive:!0});return{stop:()=>{oe(),ie()}}}function trackMediaInteraction(ee,re){return addEventListeners(ee,document,["play","pause"],te=>{const ne=getEventTarget(te);!ne||getNodePrivacyLevel(ne,ee.defaultPrivacyLevel)===NodePrivacyLevel.HIDDEN||!hasSerializedNode(ne)||re(assembleIncrementalSnapshot(IncrementalSource.MediaInteraction,{id:getSerializedNodeId(ne),type:te.type==="play"?MediaInteractionType.Play:MediaInteractionType.Pause}))},{capture:!0,passive:!0})}function trackStyleSheet(ee){function re(ie,oe){ie&&hasSerializedNode(ie.ownerNode)&&oe(getSerializedNodeId(ie.ownerNode))}const te=[instrumentMethod(CSSStyleSheet.prototype,"insertRule",({target:ie,parameters:[oe,se]})=>{re(ie,ae=>ee(assembleIncrementalSnapshot(IncrementalSource.StyleSheetRule,{id:ae,adds:[{rule:oe,index:se}]})))}),instrumentMethod(CSSStyleSheet.prototype,"deleteRule",({target:ie,parameters:[oe]})=>{re(ie,se=>ee(assembleIncrementalSnapshot(IncrementalSource.StyleSheetRule,{id:se,removes:[{index:oe}]})))})];typeof CSSGroupingRule<"u"?ne(CSSGroupingRule):(ne(CSSMediaRule),ne(CSSSupportsRule));function ne(ie){te.push(instrumentMethod(ie.prototype,"insertRule",({target:oe,parameters:[se,ae]})=>{re(oe.parentStyleSheet,ue=>{const ce=getPathToNestedCSSRule(oe);ce&&(ce.push(ae||0),ee(assembleIncrementalSnapshot(IncrementalSource.StyleSheetRule,{id:ue,adds:[{rule:se,index:ce}]})))})}),instrumentMethod(ie.prototype,"deleteRule",({target:oe,parameters:[se]})=>{re(oe.parentStyleSheet,ae=>{const ue=getPathToNestedCSSRule(oe);ue&&(ue.push(se),ee(assembleIncrementalSnapshot(IncrementalSource.StyleSheetRule,{id:ae,removes:[{index:ue}]})))})}))}return{stop:()=>{te.forEach(ie=>ie.stop())}}}function getPathToNestedCSSRule(ee){const re=[];let te=ee;for(;te.parentRule;){const se=Array.from(te.parentRule.cssRules).indexOf(te);re.unshift(se),te=te.parentRule}if(!te.parentStyleSheet)return;const ie=Array.from(te.parentStyleSheet.cssRules).indexOf(te);return re.unshift(ie),re}function trackFocus(ee,re){return addEventListeners(ee,window,["focus","blur"],()=>{re({data:{has_focus:document.hasFocus()},type:RecordType.Focus,timestamp:timeStampNow()})})}function trackFrustration(ee,re,te){const ne=ee.subscribe(12,ie=>{var oe,se;ie.rawRumEvent.type==="action"&&ie.rawRumEvent.action.type==="click"&&(!((se=(oe=ie.rawRumEvent.action.frustration)===null||oe===void 0?void 0:oe.type)===null||se===void 0)&&se.length)&&"events"in ie.domainContext&&ie.domainContext.events&&ie.domainContext.events.length&&re({timestamp:ie.rawRumEvent.date,type:RecordType.FrustrationRecord,data:{frustrationTypes:ie.rawRumEvent.action.frustration.type,recordIds:ie.domainContext.events.map(ae=>te.getIdForEvent(ae))}})});return{stop:()=>{ne.unsubscribe()}}}function trackViewEnd(ee,re){const te=ee.subscribe(5,()=>{re({timestamp:timeStampNow(),type:RecordType.ViewEnd})});return{stop:()=>{te.unsubscribe()}}}function trackInput(ee,re,te=document){const ne=ee.defaultPrivacyLevel,ie=new WeakMap,oe=te!==document,{stop:se}=addEventListeners(ee,te,oe?["change"]:["input","change"],le=>{const de=getEventTarget(le);(de instanceof HTMLInputElement||de instanceof HTMLTextAreaElement||de instanceof HTMLSelectElement)&&ue(de)},{capture:!0,passive:!0});let ae;if(oe)ae=noop$2;else{const le=[instrumentSetter(HTMLInputElement.prototype,"value",ue),instrumentSetter(HTMLInputElement.prototype,"checked",ue),instrumentSetter(HTMLSelectElement.prototype,"value",ue),instrumentSetter(HTMLTextAreaElement.prototype,"value",ue),instrumentSetter(HTMLSelectElement.prototype,"selectedIndex",ue)];ae=()=>{le.forEach(de=>de.stop())}}return{stop:()=>{ae(),se()}};function ue(le){const de=getNodePrivacyLevel(le,ne);if(de===NodePrivacyLevel.HIDDEN)return;const fe=le.type;let he;if(fe==="radio"||fe==="checkbox"){if(shouldMaskNode(le,de))return;he={isChecked:le.checked}}else{const ge=getElementInputValue(le,de);if(ge===void 0)return;he={text:ge}}ce(le,he);const pe=le.name;fe==="radio"&&pe&&le.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(pe)}"]`).forEach(ge=>{ge!==le&&ce(ge,{isChecked:!1})})}function ce(le,de){if(!hasSerializedNode(le))return;const fe=ie.get(le);(!fe||fe.text!==de.text||fe.isChecked!==de.isChecked)&&(ie.set(le,de),re(assembleIncrementalSnapshot(IncrementalSource.Input,{id:getSerializedNodeId(le),...de})))}}const MUTATION_PROCESS_MAX_DELAY=100,MUTATION_PROCESS_MIN_DELAY=16;function createMutationBatch(ee){let re=noop$2,te=[];function ne(){re(),ee(te),te=[]}const{throttled:ie,cancel:oe}=throttle$2(ne,MUTATION_PROCESS_MIN_DELAY,{leading:!1});return{addMutations:se=>{te.length===0&&(re=requestIdleCallback(ie,{timeout:MUTATION_PROCESS_MAX_DELAY})),te.push(...se)},flush:ne,stop:()=>{re(),oe()}}}function trackMutation(ee,re,te,ne){const ie=getMutationObserverConstructor();if(!ie)return{stop:noop$2,flush:noop$2};const oe=createMutationBatch(ae=>{processMutations(ae.concat(se.takeRecords()),ee,re,te)}),se=new ie(monitor(oe.addMutations));return se.observe(ne,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{se.disconnect(),oe.stop()},flush:()=>{oe.flush()}}}function processMutations(ee,re,te,ne){const ie=new Map;ee.filter(de=>de.type==="childList").forEach(de=>{de.removedNodes.forEach(fe=>{traverseRemovedShadowDom(fe,ne.removeShadowRoot)})});const oe=ee.filter(de=>de.target.isConnected&&nodeAndAncestorsHaveSerializedNode(de.target)&&getNodePrivacyLevel(de.target,te.defaultPrivacyLevel,ie)!==NodePrivacyLevel.HIDDEN),{adds:se,removes:ae,hasBeenSerialized:ue}=processChildListMutations(oe.filter(de=>de.type==="childList"),te,ne,ie),ce=processCharacterDataMutations(oe.filter(de=>de.type==="characterData"&&!ue(de.target)),te,ie),le=processAttributesMutations(oe.filter(de=>de.type==="attributes"&&!ue(de.target)),te,ie);!ce.length&&!le.length&&!ae.length&&!se.length||re(assembleIncrementalSnapshot(IncrementalSource.Mutation,{adds:se,removes:ae,texts:ce,attributes:le}))}function processChildListMutations(ee,re,te,ne){const ie=new Set,oe=new Map;for(const fe of ee)fe.addedNodes.forEach(he=>{ie.add(he)}),fe.removedNodes.forEach(he=>{ie.has(he)||oe.set(he,fe.target),ie.delete(he)});const se=Array.from(ie);sortAddedAndMovedNodes(se);const ae=new Set,ue=[];for(const fe of se){if(le(fe))continue;const he=getNodePrivacyLevel(fe.parentNode,re.defaultPrivacyLevel,ne);if(he===NodePrivacyLevel.HIDDEN||he===NodePrivacyLevel.IGNORE)continue;const pe=serializeNodeWithId(fe,{serializedNodeIds:ae,parentNodePrivacyLevel:he,serializationContext:{status:2,shadowRootsController:te},configuration:re});if(!pe)continue;const ge=getParentNode(fe);ue.push({nextId:de(fe),parentId:getSerializedNodeId(ge),node:pe})}const ce=[];return oe.forEach((fe,he)=>{hasSerializedNode(he)&&ce.push({parentId:getSerializedNodeId(fe),id:getSerializedNodeId(he)})}),{adds:ue,removes:ce,hasBeenSerialized:le};function le(fe){return hasSerializedNode(fe)&&ae.has(getSerializedNodeId(fe))}function de(fe){let he=fe.nextSibling;for(;he;){if(hasSerializedNode(he))return getSerializedNodeId(he);he=he.nextSibling}return null}}function processCharacterDataMutations(ee,re,te){var ne;const ie=[],oe=new Set,se=ee.filter(ae=>oe.has(ae.target)?!1:(oe.add(ae.target),!0));for(const ae of se){if(ae.target.textContent===ae.oldValue)continue;const ce=getNodePrivacyLevel(getParentNode(ae.target),re.defaultPrivacyLevel,te);ce===NodePrivacyLevel.HIDDEN||ce===NodePrivacyLevel.IGNORE||ie.push({id:getSerializedNodeId(ae.target),value:(ne=getTextContent(ae.target,!1,ce))!==null&&ne!==void 0?ne:null})}return ie}function processAttributesMutations(ee,re,te){const ne=[],ie=new Map,oe=ee.filter(ae=>{const ue=ie.get(ae.target);return ue&&ue.has(ae.attributeName)?!1:(ue?ue.add(ae.attributeName):ie.set(ae.target,new Set([ae.attributeName])),!0)}),se=new Map;for(const ae of oe){if(ae.target.getAttribute(ae.attributeName)===ae.oldValue)continue;const ce=getNodePrivacyLevel(ae.target,re.defaultPrivacyLevel,te),le=serializeAttribute(ae.target,ce,ae.attributeName,re);let de;if(ae.attributeName==="value"){const he=getElementInputValue(ae.target,ce);if(he===void 0)continue;de=he}else typeof le=="string"?de=le:de=null;let fe=se.get(ae.target);fe||(fe={id:getSerializedNodeId(ae.target),attributes:{}},ne.push(fe),se.set(ae.target,fe)),fe.attributes[ae.attributeName]=de}return ne}function sortAddedAndMovedNodes(ee){ee.sort((re,te)=>{const ne=re.compareDocumentPosition(te);return ne&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:ne&Node.DOCUMENT_POSITION_CONTAINS||ne&Node.DOCUMENT_POSITION_FOLLOWING?1:ne&Node.DOCUMENT_POSITION_PRECEDING?-1:0})}function traverseRemovedShadowDom(ee,re){isNodeShadowHost(ee)&&re(ee.shadowRoot),forEachChildNodes(ee,te=>traverseRemovedShadowDom(te,re))}function createElementsScrollPositions(){const ee=new WeakMap;return{set(re,te){re===document&&!document.scrollingElement||ee.set(re===document?document.scrollingElement:re,te)},get(re){return ee.get(re)},has(re){return ee.has(re)}}}const initShadowRootsController=(ee,re,te)=>{const ne=new Map,ie={addShadowRoot:oe=>{if(ne.has(oe))return;const se=trackMutation(re,ee,ie,oe),ae=trackInput(ee,re,oe),ue=trackScroll(ee,re,te,oe);ne.set(oe,{flush:()=>se.flush(),stop:()=>{se.stop(),ae.stop(),ue.stop()}})},removeShadowRoot:oe=>{const se=ne.get(oe);se&&(se.stop(),ne.delete(oe))},stop:()=>{ne.forEach(({stop:oe})=>oe())},flush:()=>{ne.forEach(({flush:oe})=>oe())}};return ie};function startFullSnapshots(ee,re,te,ne,ie,oe){const se=(ue=timeStampNow(),ce={status:0,elementsScrollPositions:ee,shadowRootsController:re})=>{const{width:le,height:de}=getViewportDimension(),fe=[{data:{height:de,href:window.location.href,width:le},type:RecordType.Meta,timestamp:ue},{data:{has_focus:document.hasFocus()},type:RecordType.Focus,timestamp:ue},{data:{node:serializeDocument(document,ne,ce),initialOffset:{left:getScrollX(),top:getScrollY()}},type:RecordType.FullSnapshot,timestamp:ue}];return window.visualViewport&&fe.push({data:getVisualViewport(window.visualViewport),type:RecordType.VisualViewport,timestamp:ue}),fe};oe(se());const{unsubscribe:ae}=te.subscribe(2,ue=>{ie(),oe(se(ue.startClocks.timeStamp,{shadowRootsController:re,status:1,elementsScrollPositions:ee}))});return{stop:ae}}function initRecordIds(){const ee=new WeakMap;let re=1;return{getIdForEvent(te){return ee.has(te)||ee.set(te,re++),ee.get(te)}}}function record(ee){const{emit:re,configuration:te,lifeCycle:ne}=ee;if(!re)throw new Error("emit function is required");const ie=fe=>{re(fe),sendToExtension("record",{record:fe});const he=ee.viewHistory.findView();addRecord(he.id)},oe=createElementsScrollPositions(),se=initShadowRootsController(te,ie,oe),{stop:ae}=startFullSnapshots(oe,se,ne,te,ue,fe=>fe.forEach(he=>ie(he)));function ue(){se.flush(),le.flush()}const ce=initRecordIds(),le=trackMutation(ie,te,se,document),de=[le,trackMove(te,ie),trackMouseInteraction(te,ie,ce),trackScroll(te,ie,oe,document),trackViewportResize(te,ie),trackInput(te,ie),trackMediaInteraction(te,ie),trackStyleSheet(ie),trackFocus(te,ie),trackVisualViewportResize(te,ie),trackFrustration(ne,ie,ce),trackViewEnd(ne,fe=>{ue(),ie(fe)})];return{stop:()=>{se.stop(),de.forEach(fe=>fe.stop()),ae()},flushMutations:ue,shadowRootsController:se}}function buildReplayPayload(ee,re,te){const ne=new FormData;ne.append("segment",new Blob([ee],{type:"application/octet-stream"}),`${re.session.id}-${re.start}`);const ie={raw_segment_size:te,compressed_segment_size:ee.byteLength,...re},oe=JSON.stringify(ie);return ne.append("event",new Blob([oe],{type:"application/json"})),{data:ne,bytesCount:ee.byteLength}}function createSegment({context:ee,creationReason:re,encoder:te}){let ne=0;const ie=ee.view.id,oe={start:1/0,end:-1/0,creation_reason:re,records_count:0,has_full_snapshot:!1,index_in_view:getSegmentsCount(ie),source:"browser",...ee};addSegment(ie);function se(ue,ce){oe.start=Math.min(oe.start,ue.timestamp),oe.end=Math.max(oe.end,ue.timestamp),oe.records_count+=1,oe.has_full_snapshot||(oe.has_full_snapshot=ue.type===RecordType.FullSnapshot);const le=te.isEmpty?'{"records":[':",";te.write(le+JSON.stringify(ue),de=>{ne+=de,ce(ne)})}function ae(ue){if(te.isEmpty)throw new Error("Empty segment flushed");te.write(`],${JSON.stringify(oe).slice(1)}
|
|
1116
1124
|
`),te.finish(ce=>{addWroteData(oe.view.id,ce.rawBytesCount),ue(oe,ce)})}return{addRecord:se,flush:ae}}const SEGMENT_DURATION_LIMIT=5*ONE_SECOND;let SEGMENT_BYTES_LIMIT=6e4;function startSegmentCollection(ee,re,te,ne,ie,oe){return doStartSegmentCollection(ee,()=>computeSegmentContext(re.applicationId,te,ne),ie,oe)}function doStartSegmentCollection(ee,re,te,ne){let ie={status:0,nextSegmentCreationReason:"init"};const{unsubscribe:oe}=ee.subscribe(2,()=>{ae("view_change")}),{unsubscribe:se}=ee.subscribe(11,ue=>{ae(ue.reason)});function ae(ue){ie.status===1&&(ie.segment.flush((ce,le)=>{const de=buildReplayPayload(le.output,ce,le.rawBytesCount);isPageExitReason(ue)?te.sendOnExit(de):te.send(de)}),clearTimeout$1(ie.expirationTimeoutId)),ue!=="stop"?ie={status:0,nextSegmentCreationReason:ue}:ie={status:2}}return{addRecord:ue=>{if(ie.status!==2){if(ie.status===0){const ce=re();if(!ce)return;ie={status:1,segment:createSegment({encoder:ne,context:ce,creationReason:ie.nextSegmentCreationReason}),expirationTimeoutId:setTimeout$1(()=>{ae("segment_duration_limit")},SEGMENT_DURATION_LIMIT)}}ie.segment.addRecord(ue,ce=>{ce>SEGMENT_BYTES_LIMIT&&ae("segment_bytes_limit")})}},stop:()=>{ae("stop"),oe(),se()}}}function computeSegmentContext(ee,re,te){const ne=re.findTrackedSession(),ie=te.findView();if(!(!ne||!ie))return{application:{id:ee},session:{id:ne.id},view:{id:ie.id}}}function startRecordBridge(ee){const re=getEventBridge();return{addRecord:te=>{const ne=ee.findView();re.send("record",te,ne.id)}}}function startRecording(ee,re,te,ne,ie,oe){const se=[],ae=de=>{ee.notify(14,{error:de}),addTelemetryDebug("Error reported to customer",{"error.message":de.message})},ue=oe||createHttpRequest(re.sessionReplayEndpointBuilder,SEGMENT_BYTES_LIMIT,ae);let ce;if(canUseEventBridge())({addRecord:ce}=startRecordBridge(ne));else{const de=startSegmentCollection(ee,re,te,ne,ue,ie);ce=de.addRecord,se.push(de.stop)}const{stop:le}=record({emit:ce,configuration:re,lifeCycle:ee,viewHistory:ne});return se.push(le),{stop:()=>{se.forEach(de=>de())}}}const startRecording$1=Object.freeze(Object.defineProperty({__proto__:null,startRecording},Symbol.toStringTag,{value:"Module"}));function getNumberOfSamples(ee){let re=0;for(const te of ee)te.stackId!==void 0&&re++;return re}const registry=new Map;let enabledTime=!1;function enableLongTaskRegistry(){enabledTime=performance.now()}function disableLongTaskRegistry(){enabledTime=!1,registry.clear()}function setLongTaskId(ee,re){registry.set(re,ee)}function getLongTaskId(ee){if(!(enabledTime===!1||ee.startTime<enabledTime))return registry.get(ee.startTime)}function deleteLongTaskIdsBefore(ee){if(!(enabledTime===!1||ee<enabledTime))for(const re of registry.keys())re<ee&®istry.delete(re)}function mayStoreLongTaskIdForProfilerCorrelation({rawRumEvent:ee,startTime:re}){if(ee.type!=="long_task")return;const te=ee.long_task.id;setLongTaskId(te,re)}const sendProfile=(ee,re,te,ne)=>{const ie=buildProfileEvent(ee,re,te,ne),oe=buildProfilingPayload(ee,ie),se=re.build("fetch",oe);return addTelemetryDebug("Sending profile to public profiling intake",{profilingIntakeURL:se,applicationId:te,sessionId:ne}),fetch(se,{body:oe.data,method:"POST"})};function buildProfileEvent(ee,re,te,ne){const ie=re.tags,oe=buildProfileEventAttributes(ee,te,ne),se=buildProfileEventTags(ie),ae=new Date(ee.timeOrigin+ee.startTime),ue=new Date(ee.timeOrigin+ee.endTime);return{...oe,attachments:["wall-time.json"],start:ae.toISOString(),end:ue.toISOString(),family:"chrome",runtime:"chrome",format:"json",version:4,tags_profiler:se.join(",")}}function buildProfileEventTags(ee){return ee.concat(["language:javascript","runtime:chrome","family:chrome","host:browser"])}function buildProfilingPayload(ee,re){const te=new Blob([JSON.stringify(ee)],{type:"application/json"}),ne=new FormData;return ne.append("event",new Blob([JSON.stringify(re)],{type:"application/json"}),"event.json"),ne.append("wall-time.json",te,"wall-time.json"),{data:ne,bytesCount:0}}function buildProfileEventAttributes(ee,re,te){const ne={application:{id:re}};te&&(ne.session={id:te});const ie=Array.from(new Set(ee.views.map(se=>se.viewId)));ie.length&&(ne.view={id:ie});const oe=ee.longTasks.map(se=>getLongTaskId(se)).filter(se=>se!==void 0);return oe.length&&(ne.long_task={id:oe}),ne}const transport={sendProfile},DEFAULT_RUM_PROFILER_CONFIGURATION={sampleIntervalMs:10,collectIntervalMs:6e4,minProfileDurationMs:5e3,minNumberOfSamples:50};function createRumProfiler(ee,re,te,ne=DEFAULT_RUM_PROFILER_CONFIGURATION){const ie=supportPerformanceTimingEvent(RumPerformanceEntryType.LONG_ANIMATION_FRAME);let oe;const se=[];let ae={state:"stopped"};function ue(Ce){ae.state!=="running"&&(oe=Ce?{startTime:Ce.startClocks.relative,viewId:Ce.id,viewName:Ce.name}:void 0,se.push(addEventListener$1(ee,window,"visibilitychange",be).stop,addEventListener$1(ee,window,"beforeunload",_e).stop),de())}async function ce(){await he("stopped"),disableLongTaskRegistry(),se.forEach(Ce=>Ce())}function le(Ce){if(Ce.state==="running")return{cleanupTasks:Ce.cleanupTasks,observer:Ce.observer};const we=[];let Re;if(ee.trackLongTasks){Re=new PerformanceObserver(ye),Re.observe({entryTypes:[Ie()]});const Ue=re.subscribe(12,Fe=>{mayStoreLongTaskIdForProfilerCorrelation(Fe)});enableLongTaskRegistry(),we.push(()=>Re==null?void 0:Re.disconnect()),we.push(Ue.unsubscribe)}const Ne=re.subscribe(2,Ue=>{pe({viewId:Ue.id,viewName:Ue.name,startTime:Ue.startClocks.relative})});return we.push(Ne.unsubscribe),{cleanupTasks:we,observer:Re}}function de(){const Ce=getGlobalObject().Profiler;if(!Ce)throw new Error("RUM Profiler is not supported in this browser.");fe(ae).catch(monitorError);const{cleanupTasks:we,observer:Re}=le(ae);let Ne;try{Ne=new Ce({sampleInterval:ne.sampleIntervalMs,maxBufferSize:Math.round(ne.collectIntervalMs*1.5/ne.sampleIntervalMs)})}catch(Ue){display.warn("[DD_RUM] Profiler startup failed. Ensure your server includes the `Document-Policy: js-profiling` response header when serving HTML pages.",Ue);return}ae={state:"running",startTime:performance.now(),profiler:Ne,timeoutId:setTimeout$1(de,ne.collectIntervalMs),longTasks:[],views:[],cleanupTasks:we,observer:Re},pe(oe),Ne.addEventListener("samplebufferfull",me)}async function fe(Ce){var we,Re;if(Ce.state!=="running")return;ve((Re=(we=Ce.observer)===null||we===void 0?void 0:we.takeRecords())!==null&&Re!==void 0?Re:[]),clearTimeout$1(Ce.timeoutId),Ce.profiler.removeEventListener("samplebufferfull",me);const{startTime:Ne,longTasks:Ue,views:Fe}=Ce,Ve=performance.now();await Ce.profiler.stop().then(He=>{const ur=performance.now(),Ge=Ue.length>0,hr=ur-Ne<ne.minProfileDurationMs,fr=getNumberOfSamples(He.samples)<ne.minNumberOfSamples;!Ge&&(hr||fr)||(ge(Object.assign(He,{startTime:Ne,endTime:ur,timeOrigin:performance.timeOrigin,longTasks:Ue,views:Fe,sampleInterval:ne.sampleIntervalMs})),deleteLongTaskIdsBefore(Ve))}).catch(monitorError)}async function he(Ce){ae.state==="running"&&(ae.cleanupTasks.forEach(we=>we()),await fe(ae),ae={state:Ce})}function pe(Ce){ae.state!=="running"||!Ce||ae.views.push(Ce)}function ge(Ce){var we;const Re=(we=te.findTrackedSession())===null||we===void 0?void 0:we.id;transport.sendProfile(Ce,ee.profilingEndpointBuilder,ee.applicationId,Re).catch(monitorError)}function me(){de()}function ye(Ce){ve(Ce.getEntries())}function ve(Ce){if(ae.state==="running")for(const we of Ce)we.duration<ne.sampleIntervalMs||ae.longTasks.push({id:getLongTaskId(we),duration:we.duration,entryType:we.entryType,startTime:we.startTime})}function be(){document.visibilityState==="hidden"&&ae.state==="running"?he("paused").catch(monitorError):document.visibilityState==="visible"&&ae.state==="paused"&&de()}function _e(){de()}function Ie(){return ie?"long-animation-frame":"longtask"}function Te(){return ae.state==="stopped"}function Se(){return ae.state==="running"}function Oe(){return ae.state==="paused"}return{start:ue,stop:ce,isStopped:Te,isRunning:Se,isPaused:Oe}}const profiler=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_RUM_PROFILER_CONFIGURATION,createRumProfiler},Symbol.toStringTag,{value:"Module"}));exports.AstroPayCardPayment=AstroPayCardPayment,exports.AstroPayCore=AstroPayCore,exports.AstroPayFullCheckout=AstroPayFullCheckout,exports.AstroPayPayment=AstroPayPayment,exports.Core=AstroPayCore,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
|