1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./axios-DfVQph-v-30fea673.js","./defineProperty-DHEv_LSj-30fea673.js","./sweetalert.min-_xbKaVtq-30fea673.js"])))=>i.map(i=>d[i]); 2(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`30fea673`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`57385946-b9f7-46ac-9201-0f08cebeb1e2`,e._sentryDebugIdIdentifier=`sentry-dbid-57385946-b9f7-46ac-9201-0f08cebeb1e2`)}catch{}})();import{a as e,n as t,t as n}from"./defineProperty-DHEv_LSj-30fea673.js";import{a as r,i,n as a,t as o}from"./preload-helper-8j8A-ttv-30fea673.js";import{n as s,t as c}from"./misc-utils-DUF-d8VH-30fea673.js";var l=String.prototype.replace,u=/%20/g,d={RFC1738:`RFC1738`,RFC3986:`RFC3986`},f={RFC1738:function(e){return l.call(e,u,`+`)},RFC3986:function(e){return String(e)}},p=d.RFC1738;d.RFC3986;var m=d.RFC3986,h=Object.prototype.hasOwnProperty,g=Array.isArray,_=new WeakMap,v=function(e,t){return _.set(e,t),e};function y(e){return _.has(e)}var b=function(e){return _.get(e)},x=function(e,t){_.set(e,t)},S=(function(){let e=[];for(let t=0;t<256;++t)e.push(`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase());return e})(),C=function(e){for(;e.length>1;){let t=e.pop(),n=t.obj[t.prop];if(g(n)){let e=[];for(let t=0;t<n.length;++t)n[t]!==void 0&&e.push(n[t]);t.obj[t.prop]=e}}},w=function(e,t){let n=t&&t.plainObjects?Object.create(null):{};for(let t=0;t<e.length;++t)e[t]!==void 0&&(n[t]=e[t]);return n},T=function e(t,n,r){if(!n)return t;if(typeof n!=`object`){if(g(t))t.push(n);else if(t&&typeof t==`object`){if(y(t)){var i=b(t)+1;t[i]=n,x(t,i)}else(r&&(r.plainObjects||r.allowPrototypes)||!h.call(Object.prototype,n))&&(t[n]=!0)}else return[t,n];return t}if(!t||typeof t!=`object`){if(y(n)){for(var a=Object.keys(n),o=r&&r.plainObjects?{__proto__:null,0:t}:{0:t},s=0;s<a.length;s++){var c=parseInt(a[s],10);o[c+1]=n[a[s]]}return v(o,b(n)+1)}return[t].concat(n)}let l=t;return g(t)&&!g(n)&&(l=w(t,r)),g(t)&&g(n)?(n.forEach(function(n,i){if(h.call(t,i)){let a=t[i];a&&typeof a==`object`&&n&&typeof n==`object`?t[i]=e(a,n,r):t.push(n)}else t[i]=n}),t):Object.keys(n).reduce(function(t,i){let a=n[i];return t[i]=h.call(t,i)?e(t[i],a,r):a,t},l)},E=function(e,t,n){let r=e.replace(/\+/g,` `);if(n===`iso-8859-1`)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},D=1024,ee=function(e,t,n,r,i){if(e.length===0)return e;let a=e;if(typeof e==`symbol`?a=Symbol.prototype.toString.call(e):typeof e!=`string`&&(a=String(e)),n===`iso-8859-1`)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return`%26%23`+parseInt(e.slice(2),16)+`%3B`});let o=``;for(let e=0;e<a.length;e+=D){let t=a.length>=D?a.slice(e,e+D):a,n=[];for(let e=0;e<t.length;++e){let r=t.charCodeAt(e);if(r===45||r===46||r===95||r===126||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||i===p&&(r===40||r===41)){n[n.length]=t.charAt(e);continue}if(r<128){n[n.length]=S[r];continue}if(r<2048){n[n.length]=S[192|r>>6]+S[128|r&63];continue}if(r<55296||r>=57344){n[n.length]=S[224|r>>12]+S[128|r>>6&63]+S[128|r&63];continue}e+=1,r=65536+((r&1023)<<10|t.charCodeAt(e)&1023),n[n.length]=S[240|r>>18]+S[128|r>>12&63]+S[128|r>>6&63]+S[128|r&63]}o+=n.join(``)}return o},O=function(e){let t=[{obj:{o:e},prop:`o`}],n=[];for(let e=0;e<t.length;++e){let r=t[e],i=r.obj[r.prop],a=Object.keys(i);for(let e=0;e<a.length;++e){let r=a[e],o=i[r];typeof o==`object`&&o&&n.indexOf(o)===-1&&(t.push({obj:i,prop:r}),n.push(o))}}return C(t),e},k=function(e){return Object.prototype.toString.call(e)===`[object RegExp]`},te=function(e){return!e||typeof e!=`object`?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},A=function(e,t,n,r){if(y(e)){var i=b(e)+1;return e[i]=t,x(e,i),e}var a=[].concat(e,t);return a.length>n?v(w(a,{plainObjects:r}),a.length-1):a},j=function(e,t){if(g(e)){let n=[];for(let r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},ne=Object.prototype.hasOwnProperty,M={brackets:function(e){return e+`[]`},comma:`comma`,indices:function(e,t){return e+`[`+t+`]`},repeat:function(e){return e}},N=Array.isArray,P=Array.prototype.push,re=function(e,t){P.apply(e,N(t)?t:[t])},F=Date.prototype.toISOString,ie=m,I={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:`indices`,charset
2:`utf-8`,charsetSentinel:!1,delimiter:`&`,encode:!0,encodeDotInKeys:!1,encoder:ee,encodeValuesOnly:!1,format:ie,formatter:f[ie],indices:!1,serializeDate:function(e){return F.call(e)},skipNulls:!1,strictNullHandling:!1},L=function(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`bigint`},R={},ae=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=e,y=_,b=0,x=!1;for(;(y=y.get(R))!==void 0&&!x;){let t=y.get(e);if(b+=1,t!==void 0){if(t===b)throw RangeError(`Cyclic object value`);x=!0}y.get(R)===void 0&&(b=0)}if(typeof l==`function`?v=l(t,v):v instanceof Date?v=f(v):n===`comma`&&N(v)&&(v=j(v,function(e){return e instanceof Date?f(e):e})),v===null){if(a)return c&&!h?c(t,I.encoder,g,`key`,p):t;v=``}if(L(v)||te(v))return c?[m(h?t:c(t,I.encoder,g,`key`,p))+`=`+m(c(v,I.encoder,g,`value`,p))]:[m(t)+`=`+m(String(v))];let S=[];if(v===void 0)return S;let C;if(n===`comma`&&N(v))h&&c&&(v=j(v,c)),C=[{value:v.length>0?v.join(`,`)||null:void 0}];else if(N(l))C=l;else{let e=Object.keys(v);C=u?e.sort(u):e}let w=s?t.replace(/\./g,`%2E`):t,T=r&&N(v)&&v.length===1?w+`[]`:w;if(i&&N(v)&&v.length===0)return T+`[]`;for(let t=0;t<C.length;++t){let y=C[t],x=typeof y==`object`&&y.value!==void 0?y.value:v[y];if(o&&x===null)continue;let w=d&&s?y.replace(/\./g,`%2E`):y,E=N(v)?typeof n==`function`?n(T,w):T:T+(d?`.`+w:`[`+w+`]`);_.set(e,b);let D=new WeakMap;D.set(R,_),re(S,ae(x,E,n,r,i,a,o,s,n===`comma`&&h&&N(v)?null:c,l,u,d,f,p,m,h,g,D))}return S},oe=function(e){if(!e)return I;if(e.allowEmptyArrays!==void 0&&typeof e.allowEmptyArrays!=`boolean`)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(e.encodeDotInKeys!==void 0&&typeof e.encodeDotInKeys!=`boolean`)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&e.encoder!==void 0&&typeof e.encoder!=`function`)throw TypeError(`Encoder has to be a function.`);let t=e.charset||I.charset;if(e.charset!==void 0&&e.charset!==`utf-8`&&e.charset!==`iso-8859-1`)throw TypeError(`The charset option must be either utf-8, iso-8859-1, or undefined`);let n=m;if(e.format!==void 0){if(!ne.call(f,e.format))throw TypeError(`Unknown format option provided.`);n=e.format}let r=f[n],i=I.filter;(typeof e.filter==`function`||N(e.filter))&&(i=e.filter);let a;if(a=e.arrayFormat in M?e.arrayFormat:`indices`in e?e.indices?`indices`:`repeat`:I.arrayFormat,`commaRoundTrip`in e&&typeof e.commaRoundTrip!=`boolean`)throw TypeError("`commaRoundTrip` must be a boolean, or absent");let o=e.allowDots===void 0?e.encodeDotInKeys===!0||I.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix==`boolean`?e.addQueryPrefix:I.addQueryPrefix,allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays==`boolean`?!!e.allowEmptyArrays:I.allowEmptyArrays,arrayFormat:a,charset:t,charsetSentinel:typeof e.charsetSentinel==`boolean`?e.charsetSentinel:I.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:e.delimiter===void 0?I.delimiter:e.delimiter,encode:typeof e.encode==`boolean`?e.encode:I.encode,encodeDotInKeys:typeof e.encodeDotInKeys==`boolean`?e.encodeDotInKeys:I.encodeDotInKeys,encoder:typeof e.encoder==`function`?e.encoder:I.encoder,encodeValuesOnly:typeof e.encodeValuesOnly==`boolean`?e.encodeValuesOnly:I.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:typeof e.serializeDate==`function`?e.serializeDate:I.serializeDate,skipNulls:typeof e.skipNulls==`boolean`?e.skipNulls:I.skipNulls,sort:typeof e.sort==`function`?e.sort:null,strictNullHandling:typeof e.strictNullHandling==`boolean`?e.strictNullHandling:I.strictNullHandling}};function z(e,t){let n=e,r=oe(t),i,a;typeof r.filter==`function`?(a=r.filter,n=a(``,n)):N(r.filter)&&(a=r.filter,i=a);let o=[];if(typeof n!=`object`||!n)return``;let s=M[r.arrayFormat],c=s===`comma`&&r.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);let l=new WeakMap;for(let e=0;e<i.length;++e){let t=i[e];r.skipNulls&&n[t]===null||re(o,ae(n[t],t,s,c,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,l))}let u=o.join(r.delimiter),d=r.addQueryPrefix===!0?`?`:``;return r.charsetSentinel&&(r.charset===`iso-8859-1`?d+=`utf8=%26%2310003%3B&`:d+=`utf8=%E2%9C%93&`),u.length>0?d+u:``}var se=Object.prototype.hasOwnProperty,ce=Array.isArray,B={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:`utf-8`,charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:E,delimiter:`&`,depth:5,duplicates:`combine`,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},le=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},ue=function(e,t){return e&&typeof e==`string`&&t.comma&&e.indexOf(`,`)>-1?e.split(`,`):e},de=`utf8=%26%2310003%3B`,fe=`utf8=%E2%9C%93`,pe=function(e,t){let n={__proto__:null},r=t.ignoreQueryPrefix?e.replace(/^\?/,``):e,i=t.parameterLimit===1/0?void 0:t.parameterLimit,a=r.
2split(t.delimiter,i),o=-1,s,c=t.charset;if(t.charsetSentinel)for(s=0;s<a.length;++s)a[s].indexOf(`utf8=`)===0&&(a[s]===fe?c=`utf-8`:a[s]===de&&(c=`iso-8859-1`),o=s,s=a.length);for(s=0;s<a.length;++s){if(s===o)continue;let e=a[s],r=e.indexOf(`]=`),i=r===-1?e.indexOf(`=`):r+1,l,u;i===-1?(l=t.decoder(e,B.decoder,c,`key`),u=t.strictNullHandling?null:``):(l=t.decoder(e.slice(0,i),B.decoder,c,`key`),u=j(ue(e.slice(i+1),t),function(e){return t.decoder(e,B.decoder,c,`value`)})),u&&t.interpretNumericEntities&&c===`iso-8859-1`&&(u=le(u)),e.indexOf(`[]=`)>-1&&(u=ce(u)?[u]:u);let d=se.call(n,l);d&&t.duplicates===`combine`?n[l]=A(n[l],u,t.arrayLimit,t.plainObjects):(!d||t.duplicates===`last`)&&(n[l]=u)}return n},me=function(e,t,n,r){let i=r?t:ue(t,n);for(let t=e.length-1;t>=0;--t){let r,a=e[t];if(a===`[]`&&n.parseArrays)r=y(i)?i:n.allowEmptyArrays&&(i===``||n.strictNullHandling&&i===null)?[]:A([],i,n.arrayLimit,n.plainObjects);else{r=n.plainObjects?Object.create(null):{};let e=a.charAt(0)===`[`&&a.charAt(a.length-1)===`]`?a.slice(1,-1):a,t=n.decodeDotInKeys?e.replace(/%2E/g,`.`):e,o=parseInt(t,10);!n.parseArrays&&t===``?r={0:i}:!isNaN(o)&&a!==t&&String(o)===t&&o>=0&&n.parseArrays&&o<=n.arrayLimit?(r=[],r[o]=i):t!==`__proto__`&&(r[t]=i)}i=r}return i},he=function(e,t,n,r){if(!e)return;let i=n.allowDots?e.replace(/\.([^.[]+)/g,`[$1]`):e,a=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,s=n.depth>0&&a.exec(i),c=s?i.slice(0,s.index):i,l=[];if(c){if(!n.plainObjects&&se.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}let u=0;for(;n.depth>0&&(s=o.exec(i))!==null&&u<n.depth;){if(u+=1,!n.plainObjects&&se.call(Object.prototype,s[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(s[1])}return s&&l.push(`[`+i.slice(s.index)+`]`),me(l,t,n,r)},ge=function(e){if(!e)return B;if(e.allowEmptyArrays!==void 0&&typeof e.allowEmptyArrays!=`boolean`)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(e.decodeDotInKeys!==void 0&&typeof e.decodeDotInKeys!=`boolean`)throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!=`function`)throw TypeError(`Decoder has to be a function.`);if(e.charset!==void 0&&e.charset!==`utf-8`&&e.charset!==`iso-8859-1`)throw TypeError(`The charset option must be either utf-8, iso-8859-1, or undefined`);let t=e.charset===void 0?B.charset:e.charset,n=e.duplicates===void 0?B.duplicates:e.duplicates;if(n!==`combine`&&n!==`first`&&n!==`last`)throw TypeError(`The duplicates option must be either combine, first, or last`);return{allowDots:e.allowDots===void 0?e.decodeDotInKeys===!0||B.allowDots:!!e.allowDots,allowEmptyArrays:typeof e.allowEmptyArrays==`boolean`?!!e.allowEmptyArrays:B.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes==`boolean`?e.allowPrototypes:B.allowPrototypes,allowSparse:typeof e.allowSparse==`boolean`?e.allowSparse:B.allowSparse,arrayLimit:typeof e.arrayLimit==`number`?e.arrayLimit:B.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel==`boolean`?e.charsetSentinel:B.charsetSentinel,comma:typeof e.comma==`boolean`?e.comma:B.comma,decodeDotInKeys:typeof e.decodeDotInKeys==`boolean`?e.decodeDotInKeys:B.decodeDotInKeys,decoder:typeof e.decoder==`function`?e.decoder:B.decoder,delimiter:typeof e.delimiter==`string`||k(e.delimiter)?e.delimiter:B.delimiter,depth:typeof e.depth==`number`||e.depth===!1?+e.depth:B.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities==`boolean`?e.interpretNumericEntities:B.interpretNumericEntities,parameterLimit:typeof e.parameterLimit==`number`?e.parameterLimit:B.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects==`boolean`?e.plainObjects:B.plainObjects,strictNullHandling:typeof e.strictNullHandling==`boolean`?e.strictNullHandling:B.strictNullHandling}};function _e(e,t){let n=ge(t);if(e===``||e==null)return n.plainObjects?Object.create(null):{};let r=typeof e==`string`?pe(e,n):e,i=n.plainObjects?Object.create(null):{},a=Object.keys(r);for(let t=0;t<a.length;++t){let o=a[t],s=he(o,r[o],n,typeof e==`string`);i=T(i,s,n)}return n.allowSparse===!0?i:O(i)}function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V.apply(null,arguments)}var ve=class{constructor(e,t,n){this.name=e,this.definition=t,this.bindings=t.bindings??{},this.wheres=t.wheres??{},this.config=n}get template(){let e=`${this.origin}/${this.definition.uri}`.replace(/\/+$/,``);return e===``?`/`:e}get origin(){return this.config.absolute?this.definition.domain?`${this.config.url.match(/^\w+:\/\//)[0]}${this.definition.domain}${this.config.port?`:${this.config.port}`:``}`:this.config.url:``}get parameterSegments(){return this.template.match(/{[^}?]+\??}/g)?.map(e=>({name:e.replace(/{|\??}/g,``),required:!/\?}$/.test(e)}))??[]}matchesUrl(e){if(!this.definition.methods.includes(`GET`))return!1;let t=this.template.replace(/[.*+$()[\]]/g,`\\$&`).replace(/(\/?){([^}?]*)(\??)}/g,(e,t,n,r)=>{let i=`(?<${n}>${this.wheres[n]?.replace(/(^\^)|(\$$)/g,``)||`[^/?]+`})`;return r?`(${t}${i})?`:`${t}${i}`}).replace(/^\w+:\/\//,``),[n,r]=e.replace(/^\w+:\/\//,``).split(`?`),i=RegExp(`^${t}/?$`).exec(n)??RegExp(`^${t}/?$`).exec(decodeURI(n));if(i){for(let e in i.groups)i.groups[e]=typeof i.groups[e]==`string`?decodeURIComponent(i.groups[e]):i.groups[e];return{params:i.groups,query:_e(r)}}return!1}compile(e){return this.parameterSegments.length?this.template.replace(/{([^}?]+)(\??)}/g,(t,n,r)=>{if(!r&&[null,void 0].includes(e[n]))throw Error(`Ziggy error: '${n}' parameter is required for route '${this.name}'.`);if(this.wheres[n]&&!RegExp(`^${r?`(${this.wheres[n]})?`:this.wheres[n]}$`).test(e[n]??``))throw Error(`Ziggy error: '${n}' parameter '${e[n]}' does not match required format '${this.wheres[n]}' for route '${this.name}'.`);return encodeURI(e[n]??``).replace(/%7C/g,`|`).replace(/%25/g,`%`).replace(/\$/g,`%24`)}).replace(this.config.absolute?/(\.[^/]+?)(\/\/)/:/(^)(\/\/)/,`$1/`).replace(/\/+$/,``):this.template}},ye=class extends String{constructor(e,t,n=!0,r){if(super(),this.t=r??(typeof Ziggy<`u`?Ziggy:globalThis==null?void 0:globalThis.Ziggy),!this.t&&typeof document<`u`&&document.getElementById(`ziggy-routes-json`)&&(globalThis.Ziggy=JSON.parse(document.getElementById(`ziggy-routes-json`).textContent),this.t=globalThis.Ziggy),this.t=V({},this.t,{absolute:n}),e){if(!this.t.routes[e])throw Error(`Ziggy error: route '${e}' is not in the route list.`);this.i=new ve(e,this.t.routes[e],this.t),this.o=this.u(t)}}toString(){let e=Object.keys(this.o).filter(e=>!this.i.parameterSegments.some(({name:t})=>t===e)).filter(e=>e!==`_query`).reduce((e,t)=>
2V({},e,{[t]:this.o[t]}),{});return this.i.compile(this.o)+z(V({},e,this.o._query),{addQueryPrefix:!0,arrayFormat:`indices`,encodeValuesOnly:!0,skipNulls:!0,encoder:(e,t)=>typeof e==`boolean`?Number(e):t(e)})}h(e){e?this.t.absolute&&e.startsWith(`/`)&&(e=this.l().host+e):e=this.m();let t={},[n,r]=Object.entries(this.t.routes).find(([n,r])=>t=new ve(n,r,this.t).matchesUrl(e))||[void 0,void 0];return V({name:n},t,{route:r})}m(){let{host:e,pathname:t,search:n}=this.l();return(this.t.absolute?e+t:t.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,``),``).replace(/^\/+/,`/`))+n}current(e,t){let{name:n,params:r,query:i,route:a}=this.h();if(!e)return n;let o=RegExp(`^${e.replace(/\./g,`\\.`).replace(/\*/g,`.*`)}$`).test(n);if([null,void 0].includes(t)||!o)return o;let s=new ve(n,a,this.t);t=this.u(t,s);let c=V({},r,i);if(Object.values(t).every(e=>!e)&&!Object.values(c).some(e=>e!==void 0))return!0;let l=(e,t)=>Object.entries(e).every(([e,n])=>Array.isArray(n)&&Array.isArray(t[e])?n.every(n=>t[e].includes(n)||t[e].includes(decodeURIComponent(n))):typeof n==`object`&&typeof t[e]==`object`&&n!==null&&t[e]!==null?l(n,t[e]):t[e]==n||t[e]==decodeURIComponent(n));return l(t,c)}l(){let{host:e=``,pathname:t=``,search:n=``}=typeof window<`u`?window.location:{};return{host:this.t.location?.host??e,pathname:this.t.location?.pathname??t,search:this.t.location?.search??n}}get params(){let{params:e,query:t}=this.h();return V({},e,t)}get routeParams(){return this.h().params}get queryParams(){return this.h().query}has(e){return this.t.routes.hasOwnProperty(e)}u(e={},t=this.i){e??(e={}),e=[`string`,`number`].includes(typeof e)?[e]:e;let n=t.parameterSegments.filter(({name:e})=>!this.t.defaults[e]);return Array.isArray(e)?e=e.reduce((e,t,r)=>V({},e,n[r]?{[n[r].name]:t}:typeof t==`object`?t:{[t]:``}),{}):n.length!==1||e.hasOwnProperty(n[0].name)||!e.hasOwnProperty(Object.values(t.bindings)[0])&&!e.hasOwnProperty(`id`)||(e={[n[0].name]:e}),V({},this.p(t),this.$(e,t))}p(e){return e.parameterSegments.filter(({name:e})=>this.t.defaults[e]).reduce((e,{name:t},n)=>V({},e,{[t]:this.t.defaults[t]}),{})}$(e,{bindings:t,parameterSegments:n}){return Object.entries(e).reduce((e,[r,i])=>{if(!i||typeof i!=`object`||Array.isArray(i)||!n.some(({name:e})=>e===r))return V({},e,{[r]:i});let a=i.hasOwnProperty(t[r])?t[r]:i.hasOwnProperty(`id`)?`id`:void 0;if(a===void 0)throw Error(`Ziggy error: object passed as '${r}' parameter is missing route model binding key '${t[r]}'.`);return V({},e,{[r]:i[a]})},{})}valueOf(){return this.toString()}};function be(e,t,n,r){let i=new ye(e,t,n,r);return e?i.toString():i}var xe=function(e){return window.asset_url===null?(console.error(`Missing asset_url for: `+e),e):window.asset_url+e.replace(/^\//,``)},H=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Log=e.LogLevel=void 0;var t=` DEBUG `,n=` INFO `,r=` WARN `,i=` ERROR `;function a(e){return e.unshift(`[Statsig]`),e}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};var o=class o{static info(...t){o.level>=e.LogLevel.Info&&console.info(n,...a(t))}static debug(...n){o.level>=e.LogLevel.Debug&&console.debug(t,...a(n))}static warn(...t){o.level>=e.LogLevel.Warn&&console.warn(r,...a(t))}static error(...t){o.level>=e.LogLevel.Error&&console.error(i,...a(t))}};e.Log=o,o.level=e.LogLevel.Warn})),U=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._getInstance=e._getStatsigGlobalFlag=e._getStatsigGlobal=void 0;var t=H();e._getStatsigGlobal=()=>{try{return typeof __STATSIG__<`u`?__STATSIG__:o}catch{return o}},e._getStatsigGlobalFlag=t=>(0,e._getStatsigGlobal)()[t],e._getInstance=n=>{let r=(0,e._getStatsigGlobal)();return n?r.instances&&r.instances[n]:(r.instances&&Object.keys(r.instances).length>1&&t.Log.warn(`Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key.`),r.firstInstance)};var n=`__STATSIG__`,r=typeof window<`u`?window:{},i=typeof global<`u`?global:{},a=typeof globalThis<`u`?globalThis:{},o=r[n]??i[n]??a[n]??{instance:e._getInstance};r[n]=o,i[n]=o,a[n]=o})),W=t((e=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.Diagnostics=void 0;var t=new Map,n=`start`,r=`end`,i=`statsig::diagnostics`;e.Diagnostics={_getMarkers:e=>t.get(e),_markInitOverallStart:e=>{s(e,a({},n,`overall`))},_markInitOverallEnd:(e,t,n)=>{s(e,a({success:t,error:t?void 0:{name:`InitializeError`,message:`Failed to initialize`},evaluationDetails:n},r,`overall`))},_markInitNetworkReqStart:(e,t)=>{s(e,a(t,n,`initialize`,`network_request`))},_markInitNetworkReqEnd:(e,t)=>{s(e,a(t,r,`initialize`,`network_request`))},_markInitProcessStart:e=>{s(e,a({},n,`initialize`,`process`))},_markInitProcessEnd:(e,t)=>{s(e,a(t,r,`initialize`,`process`))},_clearMarkers:e=>{t.delete(e)},_formatError(e){if(e&&typeof e==`object`)return{code:c(e,`code`),name:c(e,`name`),message:c(e,`message`)}},_getDiagnosticsData(t,n,r,i){return{success:t?.ok===!0,statusCode:t?.status,sdkRegion:(t?.headers)?.get(`x-statsig-region`),isDelta:r.includes(`"is_delta":true`)===!0||void 0,attempt:n,error:e.Diagnostics._formatError(i)}},_enqueueDiagnosticsEvent(t,n,r,i){let a=e.Diagnostics._getMarkers(r);if(a==null||a.length<=0)return-1;let s=a[a.length-1].timestamp-a[0].timestamp;e.Diagnostics._clearMarkers(r);let c=o(t,{context:`initialize`,markers:a.slice(),statsigOptions:i});return n.enqueue(c),s}};function a(e,t,n,r){return Object.assign({key:n,action:t,step:r,timestamp:Date.now()},e)}function o(e,t){return{eventName:i,user:e,value:null,metadata:t,time:Date.now()}}function s(e,n){let r=t.get(e)??[];r.push(n),t.set(e,r)}function c(e,t){if(t in e)return e[t]}})),Se=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventBatch=void 0,e.EventBatch=class{constructor(e){this.attempts=0,this.createdAt=Date.now(),this.events=e}incrementAttempts(){this.attempts++}}})),G=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventRetryConstants=void 0,e.EventRetryConstants={MAX_RETRY_ATTEMPTS:8,DEFAULT_BATCH_SIZE:100,MAX_PENDING_BATCHES:40,TICK_INTERVAL_MS:1e3,QUICK_FLUSH_WINDOW_MS:200,MAX_LOCAL_STORAGE:500,get MAX_QUEUED_EVENTS(){return this.DEFAULT_BATCH_SIZE*this.MAX_PENDING_BATCHES}}})),K=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BatchQueue=void 0;var t=Se(),n=G();e.BatchQueue=class{constructor(e=n.EventRetryConstants.DEFAULT_BATCH_SIZE){this._batches=[],this._batchSize=e}batchSize(){return this._batchSize}requeueBatch(e){return this._enqueueBatch(e)}hasFullBatch(){return this._batches.some(e=>e.events.length>=this._batchSize)}takeNextBatch(){return this._batches.shift()}takeAllBatches(){let e=this._batches;return this._batches=[],e}createBatches(e){let n=0,r=0;for(;n<e.length;){let i=e.slice(n,n+this._batchSize);r+=this._enqueueBatch(new t.EventBatch(i)),n+=this._batchSize}return r}_enqueueBatch(e){this._batches.push(e);let t=0;for(;this._batches.length>n.EventRetryConstants.MAX_PENDING_BATCHES;){let e=this._batches.shift();e&&(t+=e.events.length)}return t}}})),Ce=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._isTypeMatch=e._typeOf=void 0;function t(e){return Array.isArray(e)?`array`:typeof e}e._typeOf=t;function n(e,t){let n=e=>Array.isArray(e)?`array`:e===null?`null`:typeof e;return n(e)===n(t)}e._isTypeMatch=n})),q=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._getSortedObject=e._DJB2Object=e._DJB2=void 0;var t=Ce();e._DJB2=e=>{let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t&=t}return String(t>>>0)},e._DJB2Object=(t,n)=>(0,e._DJB2)(JSON.stringify((0,e._getSortedObject)(t,n))),e._getSortedObject=(n,r)=>{if(n==null)return null;let i=Object.keys(n).sort(),a={};return i.forEach(i=>{let o=n[i];if(r===0||(0,t._typeOf)(o)!==`object`){a[i]=o;return}a[i]=(0,e._getSortedObject)(o,r==null?r:r-1)}),a}})),we=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._getStorageKey=e._getUserStorageKey=void 0;var t=q();function n(e,n,r){if(r)return r(e,n);let i=n&&n.customIDs?n.customIDs:{},a=[`uid:${n?.userID??``}`,`cids:${Object.keys(i).sort((e,t)=>e.localeCompare(t)).map(e=>`${e}-${i[e]}`).join(`,`)}`,`k:${e}`];return(0,t._DJB2)(a.join(`|`))}e._getUserStorageKey=n;function r(e,r,i){return r?n(e,r,i):(0,t._DJB2)(`k:${e}`)}e._getStorageKey=r})),J=t((e=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkParam=e.NetworkDefault=e.Endpoint=void 0,e.Endpoint={_initialize:`initialize`,_rgstr:`rgstr`,_download_config_specs:`download_config_specs`},e.NetworkDefault={[e.Endpoint._rgstr]:`https://prodregistryv2.org/v1`,[e.Endpoint._initialize]:`https://featureassets.org/v1`,[e.Endpoint._download_config_specs]:`https://api.statsigcdn.com/v1`},e.NetworkParam={EventCount:`ec`,SdkKey:`k`,SdkType:`st`,SdkVersion:`sv`,Time:`t`,SessionID:`sid`,StatsigEncoded:`se`,IsGzipped:`gz`}})),Te=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SDKType=void 0;var t={},n;e.SDKType={_get:e=>(t[e]??`js-mono`)+(n??``),_setClientType(e,n){t[e]=n},_setBindingType(e){(!n||n===`-react`)&&(n=`-`+e)}}})),Y=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION=`3.33.4`;var t={sdkVersion:e.SDK_VERSION,sdkType:`js-mono`};e.StatsigMetadataProvider={get:()=>t,add:e=>{t=Object.assign(Object.assign({},t),e)}}})),X=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._cloneObject=e._getUnloadEvent=e._getCurrentPageUrlSafe=e._addDocumentEventListenerSafe=e._addWindowEventListenerSafe=e._isServerEnv=e._getDocumentSafe=e._getWindowSafe=void 0;var t=H();e._getWindowSafe=()=>typeof window<`u`?window:null,e._getDocumentSafe=()=>(0,e._getWindowSafe)()?.document??null,e._isServerEnv=()=>{if((0,e._getDocumentSafe)()!==null)return!1;let t=typeof process<`u`&&process.versions!=null&&process.versions.node!=null;return typeof EdgeRuntime==`string`||t},e._addWindowEventListenerSafe=(t,n)=>{let r=(0,e._getWindowSafe)();typeof r?.addEventListener==`function`&&r.addEventListener(t,n)},e._addDocumentEventListenerSafe=(t,n)=>{let r=(0,e._getDocumentSafe)();typeof r?.addEventListener==`function`&&r.addEventListener(t,n)},e._getCurrentPageUrlSafe=()=>{try{return(0,e._getWindowSafe)()?.location.href.split(/[?#]/)[0]}catch{return}},e._getUnloadEvent=()=>{let t=(0,e._getWindowSafe)();return t&&`onpagehide`in t?`pagehide`:`beforeunload`},e._cloneObject=(e,n)=>{try{return JSON.parse(JSON.stringify(n))}catch{return t.Log.error(`Failed to clone object ${e}`),null}}})),Ee=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._notifyVisibilityChanged=e._subscribeToVisiblityChanged=e._isUnloading=e._isCurrentlyVisible=void 0;var t=X(),n=`foreground`,r=`background`,i=[],a=n,o=!1;e._isCurrentlyVisible=()=>a===n,e._isUnloading=()=>o,e._subscribeToVisiblityChanged=e=>{i.unshift(e)},e._notifyVisibilityChanged=e=>{e!==a&&(a=e,i.forEach(t=>t(e)))},(0,t._addWindowEventListenerSafe)(`focus`,()=>{o=!1,(0,e._notifyVisibilityChanged)(n)}),(0,t._addWindowEventListenerSafe)(`blur`,()=>(0,e._notifyVisibilityChanged)(r)),(0,t._addDocumentEventListenerSafe)(`visibilitychange`,()=>{(0,e._notifyVisibilityChanged)(document.visibilityState===`visible`?n:r)}),(0,t._addWindowEventListenerSafe)((0,t._getUnloadEvent)(),()=>{o=!0,(0,e._notifyVisibilityChanged)(r)})})),De=t((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.EventSender=void 0;var n=H(),r=J(),i=Te(),a=Y(),o=Ee();e.EventSender=class{constructor(e,t,n,r,i){this._sdkKey=e,this._network=t,this._emitter=n,this._options=i,this._logEventUrlConfig=r}setLogEventCompressionMode(e){this._network.setLogEventCompressionMode(e)}sendBatch(e){return t(this,void 0,void 0,function*(){let t=`event_sender_unexpected_exception`,r={};try{let n=(0,o._isUnloading)()&&this._network.isBeaconSupported()&&this._options?.networkConfig?.networkOverrideFunc==null;t=`event_sender_pre_logs_flushed_emitter_exception`,this._emitter({name:`pre_logs_flushed`,events:e.events}),t=n?`event_sender_unexpected_exception`:`event_sender_post_exception`;let i=n?this._sendEventsViaBeacon(e,r):yield this._sendEventsViaPost(e,r);return i.success?(t=`event_sender_logs_flushed_emitter_exception`,this._emitter({name:`logs_flushed`,events:e.events}),i):Object.assign(Object.assign(Object.assign({success:!1,statusCode:i.statusCode,failurePath:i.failurePath},i.failureErrorMessage?{failureErrorMessage:i.failureErrorMessage}:{}),i.failureDiagnosticBucket?{failureDiagnosticBucket:i.failureDiagnosticBucket}:{}),i.failureDiagnosticMetadata?{failureDiagnosticMetadata:i.failureDiagnosticMetadata}:{})}catch(e){return n.Log.warn(`Failed to send batch:`,e),Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:r.path??t},r.errorMessage?{failureErrorMessage:r.errorMessage}:{}),r.diagnosticBucket?{failureDiagnosticBucket:r.diagnosticBucket}:{}),r.diagnosticMetadata?{failureDiagnosticMetadata:r.diagnosticMetadata}:{})}})}_sendEventsViaPost(e,n){return t(this,void 0,void 0,function*(){let t=yield this._network.post(this._getRequestData(e),n),r=t?.code??-1;return r===-1?Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:n.path??(t===void 0?`event_sender_post_returned_undefined`:`event_sender_post_returned_null`)},n.errorMessage?{failureErrorMessage:n.errorMessage}:{}),n.diagnosticBucket?{failureDiagnosticBucket:n.diagnosticBucket}:{}),n.diagnosticMetadata?{failureDiagnosticMetadata:n.diagnosticMetadata}:{}):{success:r>=200&&r<300,statusCode:r}})}_sendEventsViaBeacon(e,t){let n=this._network.beacon(this._getRequestData(e),t);return Object.assign(Object.assign(Object.assign({success:n,statusCode:n?200:-1,failurePath:n?void 0:t.path??`beacon_send_false`},!n&&t.errorMessage?{failureErrorMessage:t.errorMessage}:{}),!n&&t.diagnosticBucket?{failureDiagnosticBucket:t.diagnosticBucket}:{}),!n&&t.diagnosticMetadata?{failureDiagnosticMetadata:t.diagnosticMetadata}:{})}_getRequestData(e){return{sdkKey:this._sdkKey,data:{events:e.events},urlConfig:this._logEventUrlConfig,retries:3,preserveFailedStatusCode:!0,isCompressable:!0,params:{[r.NetworkParam.EventC
2ount]:String(e.events.length)},headers:{"statsig-event-count":String(e.events.length),"statsig-retry-count":String(e.attempts),"statsig-sdk-type":i.SDKType._get(this._sdkKey),"statsig-sdk-version":a.SDK_VERSION},credentials:`same-origin`}}}})),Oe=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FlushInterval=void 0;var t=1e3,n=6e4;e.FlushInterval=class{constructor(){this._currentIntervalMs=t,this._lastFlushAttemptTime=Date.now()}getCurrentIntervalMs(){return this._currentIntervalMs}markFlushAttempt(){this._lastFlushAttemptTime=Date.now()}getTimeSinceLastAttempt(){return Date.now()-this._lastFlushAttemptTime}hasReachedMaxInterval(){return this.getTimeSinceLastAttempt()>=n}getTimeTillMaxInterval(){return n-this.getTimeSinceLastAttempt()}hasCompletelyRecoveredFromBackoff(){return this._currentIntervalMs<=t}adjustForSuccess(){let e=this._currentIntervalMs;e!==t&&(this._currentIntervalMs=Math.max(t,Math.floor(e/2)))}adjustForFailure(){let e=this._currentIntervalMs;this._currentIntervalMs=Math.min(n,e*2)}getTimeUntilNextFlush(){return this.getCurrentIntervalMs()-this.getTimeSinceLastAttempt()}}})),ke=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FlushTypeValues=void 0,e.FlushTypeValues={ScheduledMaxTime:`scheduled:max_time`,ScheduledFullBatch:`scheduled:full_batch`,Limit:`limit`,Manual:`manual`,Shutdown:`shutdown`}})),Ae=t((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e._fetchTxtRecords=void 0;var n=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),r=`https://cloudflare-dns.com/dns-query`,i=[`i`,`e`,`d`],a=200;function o(e){return t(this,void 0,void 0,function*(){let t=yield e(r,{method:`POST`,headers:{"Content-Type":`application/dns-message`,Accept:`application/dns-message`},body:n});if(!t.ok){let e=Error(`Failed to fetch TXT records from DNS`);throw e.name=`DnsTxtFetchError`,e}let i=yield t.arrayBuffer();return s(new Uint8Array(i))})}e._fetchTxtRecords=o;function s(e){let t=e.findIndex((t,n)=>n<a&&String.fromCharCode(t)===`=`&&i.includes(String.fromCharCode(e[n-1])));if(t===-1){let e=Error(`Failed to parse TXT records from DNS`);throw e.name=`DnsTxtParseError`,e}let n=``;for(let r=t-1;r<e.length;r++)n+=String.fromCharCode(e[r]);return n.split(`,`)}})),Z=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._setObjectInStorage=e._getObjectFromStorage=e.Storage=void 0;var t=H(),n=X(),r={},i={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>`InMemory`,getItem:e=>r[e]?r[e]:null,setItem:(e,t)=>{r[e]=t},removeItem:e=>{delete r[e]},getAllKeys:()=>Object.keys(r)},a=null;try{let e=(0,n._getWindowSafe)();e&&e.localStorage&&typeof e.localStorage.getItem==`function`&&(a={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>`LocalStorage`,getItem:t=>e.localStorage.getItem(t),setItem:(t,n)=>e.localStorage.setItem(t,n),removeItem:t=>e.localStorage.removeItem(t),getAllKeys:()=>Object.keys(e.localStorage)})}catch{t.Log.warn(`Failed to setup localStorageProvider.`)}var o=a??i,s=o;function c(t){try{return t()}catch(t){if(t instanceof Error&&t.name===`SecurityError`)return e.Storage._setProvider(i),null;throw t}}e.Storage={isReady:()=>s.isReady(),isReadyResolver:()=>s.isReadyResolver(),getProviderName:()=>s.getProviderName(),getItem:e=>c(()=>s.getItem(e)),setItem:(e,t)=>c(()=>s.setItem(e,t)),removeItem:e=>s.removeItem(e),getAllKeys:()=>s.getAllKeys(),_setProvider:e=>{o=e,s=e},_setDisabled:e=>{s=e?i:o}};function l(n){let r=e.Storage.getItem(n);try{return JSON.parse(r??`null`)}catch{return t.Log.error(`Failed to parse value for key "${n}"`),null}}e._getObjectFromStorage=l;function u(t,n){e.Storage.setItem(t,JSON.stringify(n))}e._setObjectInStorage=u})),je=t((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}
2return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e._isDomainFailure=e.NetworkFallbackResolver=void 0;var n=Ae(),r=q(),i=H(),a=Z(),o=6048e5,s=144e5;e.NetworkFallbackResolver=class{constructor(e){this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=e.networkConfig?.networkOverrideFunc}setErrorBoundary(e){this._errorBoundary=e}tryBumpExpiryTime(e,t){let n=this._fallbackInfo?.[t.endpoint];n&&(n.expiryTime=Date.now()+o,u(e,Object.assign(Object.assign({},this._fallbackInfo),{[t.endpoint]:n})))}getActiveFallbackUrl(e,t){if(t.customUrl!=null&&t.fallbackUrls!=null)return null;let n=this._fallbackInfo;n??(n=d(e)??{},this._fallbackInfo=n);let r=n[t.endpoint];return!r||Date.now()>(r.expiryTime??0)||t.getChecksum()!==r.urlConfigChecksum?(delete n[t.endpoint],this._fallbackInfo=n,u(e,this._fallbackInfo),null):r.url?r.url:null}tryFetchUpdatedFallbackInfo(e,n,r,i){return t(this,void 0,void 0,function*(){var t;try{if(!c(r,i))return!1;let t=n.customUrl==null&&n.fallbackUrls==null?yield this._tryFetchFallbackUrlsFromNetwork(n):n.fallbackUrls,a=this._pickNewFallbackUrl(this._fallbackInfo?.[n.endpoint],t);return a?(this._updateFallbackInfoWithNewUrl(e,n,a),!0):!1}catch(e){return(t=this._errorBoundary)==null||t.logError(`tryFetchUpdatedFallbackInfo`,e),!1}})}_updateFallbackInfoWithNewUrl(e,t,n){let r={urlConfigChecksum:t.getChecksum(),url:n,expiryTime:Date.now()+o,previous:[]},i=t.endpoint,a=this._fallbackInfo?.[i];a&&r.previous.push(...a.previous),r.previous.length>10&&(r.previous=[]);let s=this._fallbackInfo?.[i]?.url;s!=null&&r.previous.push(s),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[i]:r}),u(e,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(e){return t(this,void 0,void 0,function*(){let t=this._dnsQueryCooldowns[e.endpoint];if(t&&Date.now()<t)return null;this._dnsQueryCooldowns[e.endpoint]=Date.now()+s;let r=[],i=yield(0,n._fetchTxtRecords)(this._networkOverrideFunc??fetch),a=f(e.defaultUrl);for(let t of i){if(!t.startsWith(e.endpointDnsKey+`=`))continue;let n=t.split(`=`);
2if(n.length>1){let e=n[1];e.endsWith(`/`)&&(e=e.slice(0,-1)),r.push(`https://${e}${a}`)}}return r})}_pickNewFallbackUrl(e,t){if(t==null)return null;let n=new Set(e?.previous??[]),r=e?.url,i=null;for(let e of t){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(!n.has(e)&&t!==r){i=t;break}}return i}};function c(e,t){let n=e?.toLowerCase()??``;return t||n.includes(`uncaught exception`)||n.includes(`failed to fetch`)||n.includes(`networkerror when attempting to fetch resource`)}e._isDomainFailure=c;function l(e){return`statsig.network_fallback.${(0,r._DJB2)(e)}`}function u(e,t){let n=l(e);if(!t||Object.keys(t).length===0){a.Storage.removeItem(n);return}a.Storage.setItem(n,JSON.stringify(t))}function d(e){let t=l(e),n=a.Storage.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return i.Log.error(`Failed to parse FallbackInfo`),null}}function f(e){try{return new URL(e).pathname}catch{return null}}})),Me=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SDKFlags=void 0;var t={};e.SDKFlags={setFlags:(e,n)=>{t[e]=n},get:(e,n)=>t[e]?.[n]??!1}})),Ne=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getUUID=void 0;function t(){if(typeof crypto<`u`&&typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Date().getTime(),t=typeof performance<`u`&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${`89ab`[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,n=>{let r=Math.random()*16;return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),(n===`x`?r:r&7|8).toString(16)})}e.getUUID=t})),Pe=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigSession=e.SessionID=void 0;var t=we(),n=H(),r=Z(),i=Ne(),a=Ee(),o=18e5,s=144e5,c=15e3,l={};(0,a._subscribeToVisiblityChanged)(e=>{e===`background`&&Object.values(l).forEach(e=>h(e))}),e.SessionID={get:t=>e.StatsigSession.get(t).data.sessionID},e.StatsigSession={get:(e,t=!0)=>{l[e]??(l[e]=v(e));let n=l[e];return u(n,t)},overrideInitialSessionID:(e,t)=>{let n=Date.now(),r={data:{sessionID:e,startTime:n,lastUpdate:n},sdkKey:t,lastPersistedAt:Date.now(),storageKey:m(t)};h(r),l[t]=r},checkForIdleSession:e=>{let t=l[e];t&&d(t)&&h(t)}};function u(e,t){let n=Date.now();return d(e)?h(e):t&&(e.data.lastUpdate=n,g(e)),e}function d(e){var t;let n=e.data,r=f(n)||p(n);return r&&(e.data=y(),(t=__STATSIG__==null?void 0:__STATSIG__.instance(e.sdkKey))==null||t.$emt({name:`session_expired`})),r}function f({lastUpdate:e}){return Date.now()-e>o}function p({startTime:e}){return Date.now()-e>s}function m(e){return`statsig.session_id.${(0,t._getStorageKey)(e)}`}function h(e){try{(0,r._setObjectInStorage)(e.storageKey,e.data),e.lastPersistedAt=Date.now()}catch{n.Log.warn(`Failed to save SessionID`)}}function g(e){Date.now()-e.lastPersistedAt>c&&h(e)}function _(e){return(0,r._getObjectFromStorage)(e)}function v(e){let t=m(e),n=_(t);return n&&n.sessionID&&n.startTime&&n.lastUpdate?{data:n,sdkKey:e,lastPersistedAt:0,storageKey:t}:{data:y(),sdkKey:e,lastPersistedAt:0,storageKey:t}}function y(){return{sessionID:(0,i.getUUID)(),startTime:Date.now(),lastUpdate:Date.now()}}})),Fe=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getCookieName=e.StableID=void 0;var t=we(),n=H(),r=X(),i=Z(),a=Ne(),o={},s={},c={};e.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:e=>{if(c[e])return null;if(o[e]!=null)return o[e];let t=null;return t=f(e),t==null?(t=d(e),t??(t=(0,a.getUUID)()),u(t,e),p(t,e),o[e]=t,t):(o[e]=t,u(t,e),t)},setOverride:(e,t)=>{o[t]=e,u(e,t),p(e,t)},_setCookiesEnabled:(e,t)=>{s[e]=t},_setDisabled:(e,t)=>{c[e]=t}};function l(e){return`statsig.stable_id.${(0,t._getStorageKey)(e)}`}function u(e,t){let r=l(t);try{(0,i._setObjectInStorage)(r,e)}catch{n.Log.warn(`Failed to save StableID to storage`)}}function d(e){let t=l(e);return(0,i._getObjectFromStorage)(t)}function f(e){if(!s[e]||(0,r._getDocumentSafe)()==null)return null;let t=document.cookie.split(`;`);for(let n of t){let[t,r]=n.trim().split(`=`);
2if(t===m(e))return decodeURIComponent(r)}return null}function p(e,t){if(!s[t]||(0,r._getDocumentSafe)()==null)return;let n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${m(t)}=${encodeURIComponent(e)}; expires=${n.toUTCString()}; path=/`}function m(e){return`statsig.stable_id.${(0,t._getStorageKey)(e)}`}e.getCookieName=m})),Ie=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorTag=void 0,e.ErrorTag={NetworkError:`NetworkError`}})),Le=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LoggingEnabledOption=e.LogEventCompressionMode=void 0,e.LogEventCompressionMode={Disabled:`d`,Enabled:`e`,Forced:`f`},e.LoggingEnabledOption={disabled:`disabled`,browserOnly:`browser-only`,always:`always`}})),Re=t((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkCore=e.RETRYABLE_CODES=void 0,U();var n=U(),r=W(),i=H(),a=J(),o=je(),s=Me(),c=Te(),l=X(),u=Pe(),d=Fe(),f=Ie(),p=Y(),m=Le(),h=Ee(),g=1e4,_=500,v=3e4,y=1e3,b=50,x=b/y;e.RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]),e.NetworkCore=class{constructor(e,t){this._emitter=t,this._errorBoundary=null,this._timeout=g,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,e&&(this._options=e),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new o.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(e))}setLogEventCompressionMode(e){this._options.logEventCompressionMode=e}setErrorBoundary(e){this._errorBoundary=e,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(e)}isBeaconSupported(){return typeof navigator<`u`&&typeof navigator.sendBeacon==`function`}getLastUsedInitUrlAndReset(){let e=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,e}beacon(e,t){if(!S(e))return t&&(t.path=`beacon_invalid_sdk_key`),!1;let n=this._getInternalRequestArgs(`POST`,e),r=this._getPopulatedURL(n),i=navigator;try{let e=i.sendBeacon.bind(i)(r,n.body);return e||t&&(t.path=`beacon_send_false`),e}catch(e){throw t&&(t.path=`beacon_send_exception`),e}}post(e,n){return t(this,void 0,void 0,function*(){let t=this._getInternalRequestArgs(`POST`,e);return this._tryEncodeBody(t),yield this._tryToCompressBody(t),this._sendRequest(t,n)})}get(e){let t=this._getInternalRequestArgs(`GET`,e);return this._sendRequest(t)}_sendRequest(n,r){return t(this,void 0,void 0,function*(){var t,a;if(!S(n))return r&&(r.path=`network_invalid_sdk_key`),null;if(this._netConfig.preventAllNetworkTraffic)return r&&(r.path=`network_prevent_all_network_traffic`),null;let{method:o,body:s,retries:c,attempt:l}=n,u=n.urlConfig.endpoint;if(this._isRateLimited(u))return i.Log.warn(`Request to ${u} was blocked because you are making requests too frequently.`),r&&(r.path=`network_rate_limited`),null;let d=l??1,p=!1,m=this._getPopulatedURL(n),g=Date.now(),_=null,v=(0,h._isUnloading)();try{let e={method:o,body:s,headers:Object.assign({},n.headers),priority:n.priority,keepalive:v};te(n,d);let t=this._leakyBucket[u];t&&(t.lastRequestTime=Date.now(),this._leakyBucket[u]=t);let r=this._netConfig.networkOverrideFunc??fetch,i;if(_=yield Promise.race([r(m,e).finally(()=>clearTimeout(i)),new Promise((e,t)=>{i=setTimeout(()=>{p=!0,t(Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!_.ok){let e=yield _.text().catch(()=>`No Text`),t=Error(`NetworkError: ${m} ${e}`);throw t.name=`NetworkError`,t}let a=yield _.text();return A(n,_,d,a),this._fallbackResolver.tryBumpExpiryTime(n.sdkKey,n.urlConfig),{body:a,code:_.status}}catch(s){let l=T(s),u=E(l??``,p);if(A(n,_,d,``,s),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(n.sdkKey,n.urlConfig,l,u))&&(n.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(n.sdkKey,n.urlConfig)),!c||d>c||!e.RETRYABLE_CODES.has(_?.status??500)){(t=this._emitter)==null||t.call(this,{name:`error`,error:s,tag:f.ErrorTag.NetworkError,requestArgs:n});let e=`A networking error occurred during ${o} request to ${m}.`;if(i.Log.error(e,l,s),(a=this._errorBoundary)==null||a.attachErrorIfNoneExists(e),n.preserveFailedStatusCode&&_!=null)return{body:null,code:_.status};if(_==null&&r){r.path=u?`network_request_timed_out_no_response`:`network_request_exception_no_response`,l&&(r.errorMessage=l);try{let e=D(n,m,u,Date.now()-g);r.diagnosticBucket=e.bucket,r.diagnosticMetadata=e.metadata}catch{}}return null}return yield j(d),this._sendRequest(Object.assign(Object.assign({},n),{retries:c,attempt:d+1}),r)}})}_getLogEventCompressionMode(e){let t=e?.logEventCompressionMode;return!t&&e?.disableCompression===!0&&(t=m.LogEventCompressionMode.Disabled),t||(t=m.LogEventCompressionMode.Enabled),t}_isRateLimited(e){let t=Date.now(),n=this._leakyBucket[e]??{count:0,lastRequestTime:t},r=t-n.lastRequestTime,i=Math.floor(r*x);return n.count=Math.max(0,n.count-i),n.count>=b||(n.count+=1,n.lastRequestTime=t,this._leakyBucket[e]=n,!1)}_getPopulatedURL(e){let t=e.fallbackUrl??e.urlConfig.getUrl();(e.urlConfig.endpoint===a.Endpoint._initialize||e.urlConfig.endpoint===a.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=t);let n=Object.assign({[a.NetworkParam.SdkKey]:e.sdkKey,[a.NetworkParam.SdkType]:c.SDKType._get(e.sdkKey),[a.NetworkParam.SdkVersion]:p.SDK_VERSION,[a.NetworkParam.Time]:String(Date.now()),[a.NetworkParam.SessionID]:u.SessionID.get(e.sdkKey)},e.params),r=Object.keys(n).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`).join(`&`);return`${t}${r?`?${r}`:``}`}_tryEncodeBody(e){let t=(0,l._getWindowSafe)(),r=e.body;if(!(!e.isStatsigEncodable||this._options.disableStatsigEncoding||typeof r!=`string`||(0,n._getStatsigGlobalFlag)(`no-encode`)!=null||!t?.btoa))try{e.body=t.btoa(r).split(``).reverse().join(``),e.params=Object.assign(Object.assign({},e.params??{}),{[a.NetworkParam.StatsigEncoded]:`1`})}catch(t){i.Log.warn(`Request encoding failed for ${e.urlConfig.getUrl()}`,t)}}_tryToCompressBody(e){return t(this,void 0,void 0,function*(){let t=e.body;if(!(typeof t!=`string`||!w(e,this._options)))try{let n=new TextEncoder().encode(t),r=new CompressionStream(`gzip`),o=r.writable.getWriter();o.write(n).catch(i.Log.error),o.close().catch(i.Log.error);let s=r.readable.getReader(),c=[],l;for(;!(l=yield s.read()).done;)c.push(l.value);let u=c.reduce((e,t)=>
2e+t.length,0),d=new Uint8Array(u),f=0;for(let e of c)d.set(e,f),f+=e.length;e.body=d,e.params=Object.assign(Object.assign({},e.params??{}),{[a.NetworkParam.IsGzipped]:`1`})}catch(t){i.Log.warn(`Request compression failed for ${e.urlConfig.getUrl()}`,t)}})}_getInternalRequestArgs(e,t){let n=this._fallbackResolver.getActiveFallbackUrl(t.sdkKey,t.urlConfig),r=Object.assign(Object.assign({},t),{method:e,fallbackUrl:n});return`data`in t&&C(r,t.data),r}};var S=e=>e.sdkKey?!0:(i.Log.warn(`Unable to make request without an SDK key`),!1),C=(e,t)=>{let{sdkKey:n,fallbackUrl:r}=e,i=d.StableID.get(n),a=u.SessionID.get(n),o=c.SDKType._get(n);e.body=JSON.stringify(Object.assign(Object.assign({},t),{statsigMetadata:Object.assign(Object.assign({},p.StatsigMetadataProvider.get()),{stableID:i,sessionID:a,sdkType:o,fallbackUrl:r})}))};function w(e,t){if(!e.isCompressable||(0,n._getStatsigGlobalFlag)(`no-compress`)!=null||typeof CompressionStream>`u`||typeof TextEncoder>`u`)return!1;let r=e.urlConfig.customUrl!=null||e.urlConfig.fallbackUrls!=null,i=s.SDKFlags.get(e.sdkKey,`enable_log_event_compression`)===!0;switch(t.logEventCompressionMode){case m.LogEventCompressionMode.Disabled:return!1;case m.LogEventCompressionMode.Enabled:return!(r&&!i);case m.LogEventCompressionMode.Forced:return!0;default:return!1}}function T(e){return typeof e==`string`?e:e instanceof Error?`${e.name}: ${e.message}`:`Unknown Error`}function E(e,t){return e.includes(`Timeout`)||t}function D(e,t,n,r){let i=(0,l._getWindowSafe)(),a=i?.document,o=typeof navigator<`u`?navigator:null,s=(0,h._isUnloading)(),c=o&&typeof o.onLine==`boolean`?String(o.onLine):`unknown`,u=a?.visibilityState??`unknown`,d=Object.keys(e.headers??{}).length>0,f=ee(t,i?.location?.origin),p=e.urlConfig.customUrl!=null,m=e.fallbackUrl!=null,g=k(r,[250,1e3,5e3,1e4]),_=k(O(e.body),[16384,65536,262144,1048576]),v=`unknown_no_response`;return n?v=`timeout`:c===`false`?v=`browser_offline`:s?v=`page_unloading`:u===`hidden`?v=`page_hidden`:f&&d?v=`cross_origin_custom_headers_preflight_risk`:p||m?v=`custom_url_no_response`:r<250&&(v=`immediate_network_rejection`),{bucket:v,metadata:{elapsedMsBucket:g,bodySizeBucket:_,online:c,visibilityState:u,isUnloading:String(s),crossOrigin:String(f),hasCustomUrl:String(p)}}}function ee(e,t){return!t||!e.startsWith(`${t}/`)&&!e.startsWith(`${t}?`)&&e!==t}function O(e){return e==null?0:typeof e==`string`?e.length:e instanceof Uint8Array?e.byteLength:typeof Blob<`u`&&e instanceof Blob?e.size:-1}function k(e,t){if(e<0)return`unknown`;for(let n of t)if(e<n)return`<${n}`;return`>=${t[t.length-1]}`}function te(e,t){e.urlConfig.endpoint===a.Endpoint._initialize&&r.Diagnostics._markInitNetworkReqStart(e.sdkKey,{attempt:t})}function A(e,t,n,i,o){e.urlConfig.endpoint===a.Endpoint._initialize&&r.Diagnostics._markInitNetworkReqEnd(e.sdkKey,r.Diagnostics._getDiagnosticsData(t,n,i,o))}function j(e){return t(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(e*e*_,v)))})}})),ze=t((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.FlushCoordinator=void 0;var n=G(),r=De(),i=Oe(),a=ke(),o=q(),s=H(),c=Re(),l=X(),u=Pe(),d=Le(),f=Z(),p=new Set([`network_request_timed_out_no_response`,`network_request_exception_no_response`,`event_sender_post_returned_null`,`event_sender_post_returned_undefined`,`event_sender_post_exception`]);e.FlushCoordinator=class{constructor(e,t,n,a,o,s,c,l,u,d){this._cooldownTimer=null,this._maxIntervalTimer=null,this._hasRunQuickFlush=!1,this._currentFlushPromise=null,this._creationTime=Date.now(),this._isShuttingDown=!1,this._storageKey=null,this._flushInterval=new i.FlushInterval,this._batchQueue=e,this._pendingEvents=t,this._onPrepareFlush=n,this._errorBoundary=d,this._sdkKey=a,this._loggingEnabled=u,this._eventSender=new r.EventSender(a,o,s,c,l)}setLoggingEnabled(e){this._loggingEnabled=e}setLogEventCompressionMode(e){this._eventSender.setLogEventCompressionMode(e)}startScheduledFlushCycle(){this._scheduleNextFlush()}stopScheduledFlushCycle(){this._clearAllTimers()}addEvent(e){this._pendingEvents.addToPendingEventsQueue(e),!this._currentFlushPromise&&this._pendingEvents.hasEventsForFullBatch()&&this.processLimitFlush()}processManualFlush(){return t(this,void 0,void 0,function*(){return this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(a.FlushTypeValues.Manual).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()}),this._currentFlushPromise})}processShutdown(){return t(this,void 0,void 0,function*(){return this._isShuttingDown=!0,this._clearAllTimers(),this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(a.FlushTypeValues.Shutdown).catch(e=>{s.Log.error(`Error during shutdown flush: ${e}`)}).finally(()=>{this._currentFlushPromise=null}),this._currentFlushPromise})}_executeFlush(e){return t(this,void 0,void 0,function*(){this._clearAllTimers();try{this._prepareQueueForFlush(e);let t=this._batchQueue.takeAllBatches();if(t.length===0)return;yield Promise.all(t.map(t=>this._processOneBatch(t,e)))}finally{this._isShuttingDown||this._scheduleNextFlush()}})}checkQuickFlush(){this._hasRunQuickFlush||Date.now()-this._creationTime>n.EventRetryConstants.QUICK_FLUSH_WINDOW_MS||(this._hasRunQuickFlush=!0,setTimeout(()=>{this.processManualFlush().catch(e=>{s.Log.warn(`Quick flush failed:`,e)})},n.EventRetryConstants.QUICK_FLUSH_WINDOW_MS))}_attemptScheduledFlush(){if(this._currentFlushPromise){this._scheduleNextFlush();return}let e=this.containsAtLeastOneFullBatch(),t=this._flushInterval.hasReachedMaxInterval();if(!e&&!t){this._scheduleNoopPollTick();return}this._flushInterval.markFlushAttempt();let n;n=e?a.FlushTypeValues.ScheduledFullBatch:a.FlushTypeValues.ScheduledMaxTime,this._currentFlushPromise=this._processNextBatch(n).then(()=>{}).catch(e=>{s.Log.error(`Error during scheduled flush:`,e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})}processLimitFlush(){this._flushInterval.hasCompletelyRecoveredFromBackoff()&&(this._currentFlushPromise||(this._currentFlushPromise=this._processLimitFlush
2Internal().catch(e=>{s.Log.error(`Error during limit flush`,e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})))}_processLimitFlushInternal(){return t(this,void 0,void 0,function*(){if(yield this._processNextBatch(a.FlushTypeValues.Limit))for(;this._flushInterval.hasCompletelyRecoveredFromBackoff()&&this.containsAtLeastOneFullBatch()&&(yield this._processNextBatch(a.FlushTypeValues.Limit)););})}_scheduleNextFlush(){if(this._clearAllTimers(),this._isShuttingDown)return;let e=Math.max(0,this._flushInterval.getTimeUntilNextFlush());this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,u.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},e);let t=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,u.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},t)}_clearAllTimers(){this._cooldownTimer!==null&&(clearTimeout(this._cooldownTimer),this._cooldownTimer=null),this._maxIntervalTimer!==null&&(clearTimeout(this._maxIntervalTimer),this._maxIntervalTimer=null)}_scheduleNoopPollTick(){if(this._clearAllTimers(),this._isShuttingDown)return;this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,u.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},n.EventRetryConstants.TICK_INTERVAL_MS);let e=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,u.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},e)}_processNextBatch(e){return t(this,void 0,void 0,function*(){this._prepareQueueForFlush(e);let t=this._batchQueue.takeNextBatch();return t?this._processOneBatch(t,e):!1})}_processOneBatch(e,n){return t(this,void 0,void 0,function*(){if(this._loggingEnabled!==d.LoggingEnabledOption.always&&(0,l._isServerEnv)())return this._flushInterval.adjustForSuccess(),!0;let t=yield this._eventSender.sendBatch(e);return t.success?(this._flushInterval.adjustForSuccess(),!0):(this._flushInterval.adjustForFailure(),this._handleFailure(e,n,t.statusCode,t.failurePath,t.failureErrorMessage,t.failureDiagnosticBucket,t.failureDiagnosticMetadata),!1)})}_prepareQueueForFlush(e){this._onPrepareFlush();let t=this.convertPendingEventsToBatches();t>0&&(s.Log.warn(`Dropped ${t} events`),this._errorBoundary.logDroppedEvents(t,`Batch queue limit reached during batching`,{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:n.EventRetryConstants.MAX_PENDING_BATCHES,flushType:e,retries:`dropped before batching`}))}containsAtLeastOneFullBatch(){return this._pendingEvents.hasEventsForFullBatch()||this._batchQueue.hasFullBatch()}convertPendingEventsToBatches(){if(this._pendingEvents.isEmpty())return 0;let e=this._pendingEvents.takeAll();return this._batchQueue.createBatches(e)}_isRetryableBatch(e,t){return!!(c.RETRYABLE_CODES.has(e)||e===-1&&t&&p.has(t))}_handleFailure(e,t,r,i,o,c,l){if(t===a.FlushTypeValues.Shutdown){s.Log.warn(`${t} flush failed during shutdown. ${e.events.length} event(s) will be saved to storage for retry in next session.`),this._saveShutdownFailedEventsToStorage(e.events);return}if(!this._isRetryableBatch(r,i)){s.Log.warn(`${t} flush failed after ${e.attempts} attempt(s). ${e.events.length} event(s) will be dropped. Non-retryable error: ${r}`),this._errorBoundary.logEventRequestFailure(e.events.length,`non-retryable error`,t,r,e.attempts,i,o,c,l);return}if(e.attempts>=n.EventRetryConstants.MAX_RETRY_ATTEMPTS){s.Log.warn(`${t} flush failed after ${e.attempts} attempt(s). ${e.events.length} event(s) will be dropped.`),this._errorBoundary.logEventRequestFailure(e.events.length,`max retry attempts exceeded`,t,r,e.attempts,i,o,c,l);return}e.incrementAttempts();let u=this._batchQueue.requeueBatch(e);u>0&&(s.Log.warn(`Failed to requeue batch : dropped ${u} events due to full queue`),this._errorBoundary.logDroppedEvents(u,`Batch queue limit reached during requeue`,{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:n.EventRetryConstants.MAX_PENDING_BATCHES,flushType:t,retries:e.attempts}))}loadAndRetryShutdownFailedEvents(){return t(this,void 0,void 0,function*(){let e=this._getStorageKey();try{f.Storage.isReady()||(yield f.Storage.isReadyResolver());let t=this._getShutdownFailedEventsFromStorage(e);if(t.length===0)return;s.Log.debug(`Loading ${t.length} failed shutdown event(s) from storage for retry`),f.Storage.removeItem(e),t.forEach(e
2=>{this.addEvent(e)}),yield this.processManualFlush()}catch(e){s.Log.warn(`Failed to load and retry failed shutdown events:`,e)}})}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.failed_shutdown_events.${(0,o._DJB2)(this._sdkKey)}`),this._storageKey}_saveShutdownFailedEventsToStorage(e){let t=this._getStorageKey();try{let r=[...this._getShutdownFailedEventsFromStorage(t),...e];r.length>n.EventRetryConstants.MAX_LOCAL_STORAGE&&(r=r.slice(-n.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,f._setObjectInStorage)(t,r),s.Log.debug(`Saved ${e.length} failed shutdown event(s) to storage (total stored: ${r.length})`)}catch(e){s.Log.warn(`Unable to save failed shutdown events to storage:`,e)}}_getShutdownFailedEventsFromStorage(e){try{let t=(0,f._getObjectFromStorage)(e);return Array.isArray(t)?t:[]}catch{return[]}}}})),Be=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PendingEvents=void 0;var t=H();e.PendingEvents=class{constructor(e){this._pendingEvents=[],this._batchSize=e}addToPendingEventsQueue(e){this._pendingEvents.push(e),t.Log.debug(`Enqueued Event:`,e)}hasEventsForFullBatch(){return this._pendingEvents.length>=this._batchSize}takeAll(){let e=this._pendingEvents;return this._pendingEvents=[],e}isEmpty(){return this._pendingEvents.length===0}}})),Ve=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._createLayerParameterExposure=e._createConfigExposure=e._mapExposures=e._createGateExposure=e._isExposureEvent=void 0;var t=`statsig::config_exposure`,n=`statsig::gate_exposure`,r=`statsig::layer_exposure`,i=(e,t,n,r,i)=>(n.bootstrapMetadata&&(r.bootstrapMetadata=n.bootstrapMetadata),{eventName:e,user:t,value:null,metadata:o(n,r),secondaryExposures:i,time:Date.now()});e._isExposureEvent=({eventName:e})=>e===n||e===t||e===r,e._createGateExposure=(e,t,r)=>{let o={gate:t.name,gateValue:String(t.value),ruleID:t.ruleID};return t.__evaluation?.version!=null&&(o.configVersion=t.__evaluation.version),i(n,e,t.details,o,a(t.__evaluation?.secondary_exposures??[],r))};function a(e,t){return e.map(e=>typeof e==`string`?(t??{})[e]:e).filter(e=>e!=null)}e._mapExposures=a,e._createConfigExposure=(e,n,r)=>{let o={config:n.name,ruleID:n.ruleID};return n.__evaluation?.version!=null&&(o.configVersion=n.__evaluation.version),n.__evaluation?.passed!=null&&(o.rulePassed=String(n.__evaluation.passed)),i(t,e,n.details,o,a(n.__evaluation?.secondary_exposures??[],r))},e._createLayerParameterExposure=(e,t,n,o)=>{let s=t.__evaluation,c=(s?.explicit_parameters)?.includes(n)===!0,l=``,u=s?.undelegated_secondary_exposures??[];c&&(l=s.allocated_experiment_name??``,u=s.secondary_exposures??[]);let d=t.__evaluation?.parameter_rule_ids,f={config:t.name,parameterName:n,ruleID:d?.[n]??t.ruleID,allocatedExperiment:l,isExplicitParameter:String(c)};return t.__evaluation?.version!=null&&(f.configVersion=t.__evaluation.version),i(r,e,t.details,f,a(u,o))};var o=(e,t)=>(t.reason=e.reason,e.lcut&&(t.lcut=String(e.lcut)),e.receivedAt&&(t.receivedAt=String(e.receivedAt)),t)})),He=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UrlConfiguration=void 0;var t=q(),n=J(),r={[n.Endpoint._initialize]:`i`,[n.Endpoint._rgstr]:`e`,[n.Endpoint._download_config_specs]:`d`};e.UrlConfiguration=class{constructor(e,t,i,a){this.customUrl=null,this.fallbackUrls=null,this.endpoint=e,this.endpointDnsKey=r[e],t&&(this.customUrl=t),!t&&i&&(this.customUrl=i.endsWith(`/`)?`${i}${e}`:`${i}/${e}`),a&&(this.fallbackUrls=a);let o=n.NetworkDefault[e];this.defaultUrl=`${o}/${e}`}getUrl(){return this.customUrl??this.defaultUrl}getChecksum(){let e=(this.fallbackUrls??[]).sort().join(`,`);return(0,t._DJB2)(this.customUrl+e)}}})),Ue=t((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.EventLogger=void 0;var n=K(),r=we(),i=G(),a=ze(),o=q(),s=H(),c=J(),l=Be(),u=X(),d=Ve(),f=Le(),p=Z(),m=He(),h=Ee(),g=1e3,_=6e5,v={};e.EventLogger=class e{static _safeFlushAndForget(e){var t;(t=v[e])==null||t.flush().catch(()=>{})}constructor(e,t,n,r,i){this._sdkKey=e,this._emitter=t,this._network=n,this._options=r,this._errorBoundary=i,this._pendingEvents=null,this._batchQueue=null,this._flushCoordinator=null,this._lastExposureTimeMap={},this._nonExposedChecks={},this._isShuttingDown=!1,this._storageKey=null,this._pendingCompressionMode=null,this._loggingEnabled=r?.loggingEnabled??(r?.disableLogging===!0?f.LoggingEnabledOption.disabled:f.LoggingEnabledOption.browserOnly),r?.loggingEnabled&&r.disableLogging!==void 0&&s.Log.warn(`Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging.`);let a=r?.networkConfig;this._logEventUrlConfig=new m.UrlConfiguration(c.Endpoint._rgstr,a?.logEventUrl,a?.api,a?.logEventFallbackUrls)}setLogEventCompressionMode(e){this._flushCoordinator?this._flushCoordinator.setLogEventCompressionMode(e):this._pe
2ndingCompressionMode=e}setLoggingEnabled(e){let t=this._loggingEnabled===`disabled`,n=e!==`disabled`;if(this._loggingEnabled=e,this._flushCoordinator&&this._flushCoordinator.setLoggingEnabled(e),t&&n){let e=this._loadStoredEvents();s.Log.debug(`Loaded ${e.length} stored event(s) from storage`),e.length>0&&(e.forEach(e=>{this._initFlushCoordinator().addEvent(e)}),this.flush().catch(e=>{s.Log.warn(`Failed to flush events after enabling logging:`,e)}))}}enqueue(e){var t;if(!this._shouldLogEvent(e))return;let n=this._normalizeEvent(e);if(this._loggingEnabled===`disabled`){this._storeEventToStorage(n);return}this._initFlushCoordinator().addEvent(n),(t=this._flushCoordinator)==null||t.checkQuickFlush()}incrementNonExposureCount(e){let t=this._nonExposedChecks[e]??0;this._nonExposedChecks[e]=t+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){let t=(0,u._isServerEnv)();if(t&&this._options?.loggingEnabled!==`always`)return;let n=this._initFlushCoordinator();v[this._sdkKey]=this,t||(0,h._subscribeToVisiblityChanged)(t=>{t===`background`?e._safeFlushAndForget(this._sdkKey):t===`foreground`&&n.startScheduledFlushCycle()}),n.loadAndRetryShutdownFailedEvents().catch(e=>{s.Log.warn(`Failed to load failed shutdown events:`,e)}),n.startScheduledFlushCycle()}stop(){return t(this,void 0,void 0,function*(){this._isShuttingDown=!0,this._flushCoordinator&&(yield this._flushCoordinator.processShutdown()),delete v[this._sdkKey],this._flushCoordinator=null,this._pendingEvents=null,this._batchQueue=null})}flush(){return t(this,void 0,void 0,function*(){if(this._flushCoordinator)return this._flushCoordinator.processManualFlush()})}appendAndResetNonExposedChecks(){if(Object.keys(this._nonExposedChecks).length===0)return;let e=Object.assign({},this._nonExposedChecks);this._nonExposedChecks={};let t=this._normalizeEvent({eventName:`statsig::non_exposed_checks`,user:null,time:Date.now(),metadata:{checks:e}});this._flushCoordinator&&this._flushCoordinator.addEvent(t)}_shouldLogEvent(e){if(this._options?.loggingEnabled!==`always`&&(0,u._isServerEnv)())return!1;if(!(0,d._isExposureEvent)(e))return!0;let t=e.user?e.user:{statsigEnvironment:void 0},n=(0,r._getUserStorageKey)(this._sdkKey,t),i=e.metadata?e.metadata:{},a=[e.eventName,n,i.gate,i.config,i.ruleID,i.allocatedExperiment,i.parameterName,String(i.isExplicitParameter),i.reason].join(`|`),o=this._lastExposureTimeMap[a],s=Date.now();return o&&s-o<_?!1:(Object.keys(this._lastExposureTimeMap).length>g&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[a]=s,!0)}_getCurrentPageUrl(){if(this._options?.includeCurrentPageUrlWithEvents!==!1)return(0,u._getCurrentPageUrlSafe)()}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.pending_events.${(0,o._DJB2)(this._sdkKey)}`),this._storageKey}_initFlushCoordinator(){if(this._flushCoordinator)return this._flushCoordinator;let e=this._options?.loggingBufferMaxSize??i.EventRetryConstants.DEFAULT_BATCH_SIZE;return this._pendingEvents=new l.PendingEvents(e),this._batchQueue=new n.BatchQueue(e),this._flushCoordinator=new a.FlushCoordinator(this._batchQueue,this._pendingEvents,()=>this.appendAndResetNonExposedChecks(),this._sdkKey,this._network,this._emitter,this._logEventUrlConfig,this._options,this._loggingEnabled,this._errorBoundary),this._pendingCompressionMode&&(this._flushCoordinator.setLogEventCompressionMode(this._pendingCompressionMode),this._pendingCompressionMode=null),this._flushCoordinator}_storeEventToStorage(e){let t=this._getStorageKey();try{let n=this._getEventsFromStorage(t);n.push(e),n.length>i.EventRetryConstants.MAX_LOCAL_STORAGE&&(n=n.slice(-i.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,p._setObjectInStorage)(t,n)}catch{s.Log.warn(`Unable to save events to storage`)}}_getEventsFromStorage(e){try{let t=(0,p._getObjectFromStorage)(e);return Array.isArray(t)?t:[]}catch{return[]}}_loadStoredEvents(){let e=this._getStorageKey(),t=this._getEventsFromStorage(e);return t.length>0&&p.Storage.removeItem(e),t}_normalizeEvent(e){e.user&&(e.user=Object.assign({},e.user),delete e.user.privateAttributes);let t={},n=this._getCurrentPageUrl();return n&&(t.statsigMetadata={currentPage:n}),Object.assign(Object.assign({},e),t)}}})),We=t((e=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.PrecomputedEvaluationsContextHandle=void 0;var t=H(),n=X(),r=Pe(),i=Fe();e.PrecomputedEvaluationsContextHandle=class{constructor(e,t,n,r,i,a){this._sdkKey=e,this._getOptions=t,this._getErrorBoundary=n,this._getValues=r,this._getUser=i,this._getSdkInstanceID=a}get sdkKey(){return this._sdkKey}get options(){return this._getOptions()}get errorBoundary(){return this._getErrorBoundary()}get values(){return this._getValues()}get user(){let e=(0,n._cloneObject)(`StatsigUser`,this._getUser());return e??(t.Log.error(`Failed to clone user`),e={}),e}getSession(e=!0){return r.StatsigSession.get(this._sdkKey,e)}get stableID(){return i.StableID.get(this._sdkKey)}get sdkInstanceID(){return this._getSdkInstanceID()}toContext(e=!0){return{sdkKey:this.sdkKey,options:this.options,values:this.values,user:this.user,errorBoundary:this.errorBoundary,session:this.getSession(e),stableID:this.stableID,sdkInstanceID:this.sdkInstanceID}}}})),Ge=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._getUnitIDFromUser=e._getFullUserHash=e._normalizeUser=void 0;var t=q(),n=H(),r=X();function i(e,t,i){let a=(0,r._cloneObject)(`StatsigUser`,e);return a==null?(n.Log.error(`Failed to clone user`),{statsigEnvironment:void 0}):(t!=null&&t.environment!=null?a.statsigEnvironment=t.environment:i!=null&&(a.statsigEnvironment={tier:i}),a)}e._normalizeUser=i;function a(e){return e?(0,t._DJB2Object)(e):null}e._getFullUserHash=a;function o(e,t){if(typeof t!=`string`)return e.userID;let n=t.toLowerCase();return n===`userid`?e.userID:e.customIDs?.[t]??e.customIDs?.[n]}e._getUnitIDFromUser=o})),Ke=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._typedJsonParse=void 0;var t=H();function n(e,n,r){try{let t=JSON.parse(e);if(t&&typeof t==`object`&&n in t)return t}catch{}return t.Log.error(`Failed to parse ${r}`),null}e._typedJsonParse=n})),qe=t((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e._makeDataAdapterResult=e.DataAdapterCore=void 0;var n=H(),r=Fe(),i=Ge(),a=Z(),o=Ke(),s=10,c=8;e.DataAdapterCore=class{constructor(e,t){this._adapterName=e,this._cacheSuffix=t,this._options=null,this._sdkKey=null,this._cacheLimit=s,this._lastModifiedStoreKey=`statsig.last_modified_time.${t}`,this._inMemoryCache=new u}attach(e,t,n){this._sdkKey=e,this._options=t}getDataSync(e){let t=e&&(0,i._normalizeUser)(e,this._options),n=this._getCacheKey(t),r=this._inMemoryCache.get(n,t);if(r&&this._getIsCacheValueValid(r))return r;let a=this._loadFromCache(n);return a&&this._getIsCacheValueValid(a)?(this._inMemoryCache.add(n,a,this._cacheLimit),this._inMemoryCache.get(n,t)):null}setData(e,t){let n=t&&(0,i._normalizeUser)(t,this._options),r=this._getCacheKey(n);this._inMemoryCache.add(r,l(`Bootstrap`,e,null,n),this._cacheLimit)}_getIsCacheValueValid(e){return e.stableID==null||e.stableID===r.StableID.get(this._getSdkKey())}_getDataAsyncImpl(e,r,i){return t(this,void 0,void 0,function*(){a.Storage.isReady()||(yield a.Storage.isReadyResolver());let t=e??this.getDataSync(r),o=[this._fetchAndPrepFromNetwork(t,r,i)];return i?.timeoutMs&&o.push(new Promise(e=>setTimeout(e,i.timeoutMs)).then(()=>(n.Log.debug(`Fetching latest value timed out`),null))),yield Promise.race(o)})}_prefetchDataImpl(e,n){return t(this,void 0,void 0,function*(){let t=e&&(0,i._normalizeUser)(e,this._options),r=this._getCacheKey(t),a=yield this._getDataAsyncImpl(null,t,n);a&&this._inMemoryCache.add(r,Object.assign(Object.assign({},a),{source:`Prefetch`}),this._cacheLimit)})}_fetchAndPrepFromNetwork(e,i,a){return t(this,void 0,void 0,function*(){let t=e?.data??null,s=e!=null&&this._isCachedResultValidFor204(e,i),c=yield this._fetchFromNetwork(t,i,a,s);if(!c)return n.Log.debug(`No response returned for latest value`),null;let u=(0,o._typedJsonParse)(c,`has_updates`,`Response`),d=this._getSdkKey(),f=r.StableID.get(d),p=null;if(u?.has_updates===!0)p=l(`Network`,c,f,i);else if(t&&u?.has_updates===!1)p=l(`NetworkNotModified`,t,f,i);else return null;let m=this._getCacheKey(i);return this._inMemoryCache.add(m,p,this._cacheLimit),this._writeToCache(m,p),p})}_getSdkKey(){return this._sdkKey==null?(n.Log.error(`${this._adapterName} is not attached to a Client`),``):this._sdkKey}_loadFromCache(e){let t=a.Storage.getItem?.call(a.Storage,e);if(t==null)return null;let n=(0,o._typedJsonParse)(t,`source`,`Cached Result`);return n?Object.assign(Object.assign({},n),{source:`Cache`}):null}_writeToCache(e,t){let n=JSON.stringify(t);for(let t=0;t<c;t++)try{a.Storage.setItem(e,n);break}catch(t){if(!(t instanceof Error)||!(t.toString().includes(`QuotaExceededError`)||t.toString().includes(`QUOTA_EXCEEDED_ERR`))||this._cacheLimit<=1)throw t;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(e,this._cacheLimit-1)}this._runLocalStorageCacheEviction(e)}_runLocalStorageCacheEviction(e,t=this._cacheLimit){let n=(0,a._getObjectFromStorage)(this._lastModifiedStoreKey)??{};n[e]=Date.now();let r=d(n,t);for(let e of r)delete n[e],a.Storage.removeItem(e);(0,a._setObjectInStorage)(this._lastModifiedStoreKey,n)}};function l(e,t,n,r){return{source:e,data:t,receivedAt:Date.now(),stableID:n,fullUserHash:(0,i._getFullUserHash)(r)}}e._makeDataAdapterResult=l;var u=class{constructor(){this._data={}}get(e,t){let r=this._data[e],i=r?.stableID,a=t?.customIDs?.stableID;return a&&i&&a!==i?(n.Log.warn(`'StatsigUser.customIDs.stableID' mismatch`),null):r}add(e,t,n){let r=d(this._data,n-1);for(let e of r)delete this._data[e];this._data[e]=t}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}};function d(e,t){let n=Object.keys(e);return n.length<=t?[]:t===0?n:n.sort((t,n)=>{let r=e[t],i=e[n];return typeof r==`object`&&typeof i==`object`?r.receivedAt-i.receivedAt:r-i}).slice(0,n.length-t)}}
2)),Je=t((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Ye=t((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorBoundary=e.EXCEPTION_ENDPOINT=void 0;var n=H(),r=Te(),i=Y();e.EXCEPTION_ENDPOINT=`https://statsigapi.net/v1/sdk_exception`;var a=`[Statsig] UnknownError`;e.ErrorBoundary=class{constructor(e,t,n,r){this._sdkKey=e,this._options=t,this._emitter=n,this._lastSeenError=r,this._seen=new Set}wrap(e,t){try{let n=e;c(n).forEach(r=>{let i=n[r];`$EB`in i||(n[r]=(...n)=>this._capture(t?`${t}:${r}`:r,()=>i.apply(e,n)),n[r].$EB=!0)})}catch(e){this._onError(`eb:wrap`,e)}}logError(e,t){this._onError(e,t)}logDroppedEvents(e,t,n){let r={eventCount:String(e),reason:t};n&&Object.keys(n).forEach(e=>{r[e]=String(n[e])}),this._onError(`statsig::log_event_dropped_event_count`,Error(t),!0,r)}logEventRequestFailure(e,t,n,r,i,a,o,s,c){let l={eventCount:String(e),flushType:n,statusCode:String(r),reason:t,retries:String(i)};a&&(l.failurePath=a),typeof o==`string`&&o.length>0&&(l.failureErrorMessage=o),typeof s==`string`&&s.length>0&&(l.failureDiagnosticBucket=s),c&&Object.keys(c).forEach(e=>{let t=c[e];t.length>0&&(l[`failureDiagnostic_${e}`]=t)}),this._onError(`statsig::log_event_failed`,Error(t),!0,l)}getLastSeenErrorAndReset(){let e=this._lastSeenError;return this._lastSeenError=void 0,e??null}attachErrorIfNoneExists(e){this._lastSeenError||(this._lastSeenError=o(e))}_capture(e,t){try{let n=t();return n&&n instanceof Promise?n.catch(t=>this._onError(e,t)):n}catch(t){return this._onError(e,t),null}}_onError(c,u,d=!1,f){try{n.Log.warn(`Caught error in ${c}`,{error:u}),t(this,void 0,void 0,function*(){var t,n;let p=u||Error(a),m=p instanceof Error,h=m?p.name:`No Name`,g=o(p);if(this._lastSeenError=g,!d&&this._seen.has(h))return;if(this._seen.add(h),this._options?.networkConfig?.preventAllNetworkTraffic){(t=this._emitter)==null||t.call(this,{name:`error`,error:u,tag:c});return}let _=r.SDKType._get(this._sdkKey),v=i.StatsigMetadataProvider.get(),y=m?p.stack:s(p),b=Object.assign(Object.assign({tag:c,exception:h,info:y,statsigOptions:l(this._options)},Object.assign(Object.assign({},v),{sdkType:_})),f??{}),x=this._options?.networkConfig;yield(x?.networkOverrideFunc??fetch)(x?.sdkExceptionUrl??e.EXCEPTION_ENDPOINT,{method:`POST`,headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(_),"STATSIG-SDK-VERSION":String(v.sdkVersion),"Content-Type":`application/json`},body:JSON.stringify(b)}),(n=this._emitter)==null||n.call(this,{name:`error`,error:u,tag:c})}).then(()=>{}).catch(()=>{})}catch{}}};function o(e){return e instanceof Error?e:Error(typeof e==`string`?e:`An unknown error occurred.`)}function s(e){try{return JSON.stringify(e)}catch{return a}}function c(e){let t=new Set,n=Object.getPrototypeOf(e);for(;n&&n!==Object.prototype;)Object.getOwnPropertyNames(n).filter(e=>typeof n?.[e]==`function`).forEach(e=>t.add(e)),n=Object.getPrototypeOf(n);return Array.from(t)}function l(e){if(!e)return{};let t={};return Object.keys(e).forEach(n=>{let r=n,i=e[r];switch(typeof i){case`number`:case`bigint`:case`boolean`:t[String(r)]=i;break;case`string`:i.length<50?t[String(r)]=i:t[String(r)]=`set`;break;case`object`:r===`environment`?t.environment=i:r===`networkConfig`?t.networkConfig=i:t[String(r)]=i==null?`unset`:`set`}}),t}})),Xe=t((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Ze=t((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Qe=t((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),$e=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createMemoKey=e.MemoPrefix=void 0,e.MemoPrefix={_gate:`g`,_dynamicConfig:`c`,_experiment:`e`,_configList:`cl`,_layer:`l`,_paramStore:`p`};var t=new Set([]),n=new Set([`userPersistedValues`]);function r(e,r,i){let a=`${e}|${r}`;if(!i)return a;for(let e of Object.keys(i)){if(n.has(e))return;t.has(e)?a+=`|${e}=true`:a+=`|${e}=${i[e]}`}return a}e.createMemoKey=r})),et=t((e=>
2{Object.defineProperty(e,"__esModule",{value:!0})})),tt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),nt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._fastApproxSizeOf=void 0,e._fastApproxSizeOf=(e,t)=>{let n=[e],r=[Object.keys(e)],i=[0],a=[0],o=0,s=0;for(;;){if(i[o]<r[o].length){let e=r[o][i[o]++],s=n[o][e];if(a[o]+=e.length,s&&typeof s==`object`){n[++o]=s,r[o]=Object.keys(s),i[o]=a[o]=0;continue}if(a[o]+=(s+``).length+1,a[o]<t)continue}for(s=a[o--];o>=0&&(a[o]+=s+2)>=t;s=a[o--]);if(o<0)return s}}})),rt=t((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigClientBase=void 0,U();var n=U(),r=Ye(),i=Ue(),a=H(),o=$e(),s=X(),c=Pe(),l=Fe(),u=Le(),d=Z(),f=3e3;e.StatsigClientBase=class{constructor(e,t,n,o){var s,u;this.loadingStatus=`Uninitialized`,this._initializePromise=null,this._listeners={};let f=this.$emt.bind(this);o?.logLevel!=null&&(a.Log.level=o.logLevel),o!=null&&o.disableStorage&&d.Storage._setDisabled(!0),o!=null&&o.initialSessionID&&c.StatsigSession.overrideInitialSessionID(o.initialSessionID,e),o!=null&&o.storageProvider&&d.Storage._setProvider(o.storageProvider),o!=null&&o.enableCookies&&l.StableID._setCookiesEnabled(e,o.enableCookies),o!=null&&o.disableStableID&&l.StableID._setDisabled(e,!0),this._sdkKey=e,this._options=o??{},this._memoCache={},this.overrideAdapter=o?.overrideAdapter??null,this._errorBoundary=new r.ErrorBoundary(e,o,f),this._logger=new i.EventLogger(e,f,n,o,this._errorBoundary),this._errorBoundary.wrap(this),this._errorBoundary.wrap(t),this._errorBoundary.wrap(this._logger),n.setErrorBoundary(this._errorBoundary),this.dataAdapter=t,this.dataAdapter.attach(e,o,n),this.storageProvider=d.Storage,(u=((s=this.overrideAdapter)?.loadFromStorage)?.call(s))==null||u.catch(e=>this._errorBoundary.logError(`OA::loadFromStorage`,e)),this._primeReadyRipcord(),p(e,this)}updateRuntimeOptions(e){e.loggingEnabled?(this._options.loggingEnabled=e.loggingEnabled,this._logger.setLoggingEnabled(e.loggingEnabled)):e.disableLogging!=null&&(this._options.disableLogging=e.disableLogging,this._logger.setLoggingEnabled(e.disableLogging?`disabled`:`browser-only`)),e.disableStorage!=null&&(this._options.disableStorage=e.disableStorage,d.Storage._setDisabled(e.disableStorage)),e.enableCookies!=null&&(this._options.enableCookies=e.enableCookies,l.StableID._setCookiesEnabled(this._sdkKey,e.enableCookies)),e.logEventCompressionMode?this._logger.setLogEventCompressionMode(e.logEventCompressionMode):e.disableCompression&&this._logger.setLogEventCompressionMode(u.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return t(this,void 0,void 0,function*(){this.$emt({name:`pre_shutdown`}),this._setStatus(`Uninitialized`,null),this._initializePromise=null,yield this._logger.stop()})}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){if(this._listeners[e]){let n=this._listeners[e].indexOf(t);n!==-1&&this._listeners[e].splice(n,1)}}$on(e,t){t.__isInternal=!0,this.on(e,t)}$emt(e){var t;let n=t=>{try{t(e)}catch(n){if(t.__isInternal===!0){this._errorBoundary.logError(`__emit:${e.name}`,n);return}a.Log.error(`An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.`,e)}};this._listeners[e.name]&&this._listeners[e.name].forEach(e=>n(e)),(t=this._listeners[`*`])==null||t.forEach(n)}_setStatus(e,t){this.loadingStatus=e,this._memoCache={},this.$emt({name:`values_updated`,status:e,values:t})}_enqueueExposure(e,t,n){if(n?.disableExposureLog===!0){this._logger.incrementNonExposureCount(e);return}this._logger.enqueue(t)}_memoize(e,t){return(n,r)=>{if(this._options.disableEvaluationMemoization)return t(n,r);let i=(0,o.createMemoKey)(e,n,r);return i?(i in this._memoCache||(Object.keys(this._memoCache).length>=f&&(this._memoCache={}),this._memoCache[i]=t(n,r)),this._memoCache[i]):t(n,r)}}};function p(e,t){if((0,s._isServerEnv)())return;let r=(0,n._getStatsigGlobal)(),i=r.instances??{},o=t;i[e]!=null&&a.Log.warn(`Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys.`),i[e]=o,r.firstInstance||(r.firstInstance=o),r.instances=i,__STATSIG__=r}}
2)),it=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix=`statsig.cached`})),at=t((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),ot=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._makeTypedGet=e._mergeOverride=e._makeLayer=e._makeExperiment=e._makeDynamicConfig=e._makeFeatureGate=void 0;var t=H(),n=Ce();function r(e,t,n,r){return{name:e,details:t,ruleID:n?.rule_id??``,__evaluation:n,value:r}}function i(e,t,n){return Object.assign(Object.assign({},r(e,t,n,n?.value===!0)),{idType:n?.id_type??null})}e._makeFeatureGate=i;function a(e,t,n){let i=n?.value??{};return Object.assign(Object.assign({},r(e,t,n,i)),{idType:n?.id_type??null,get:l(e,n?.value)})}e._makeDynamicConfig=a;function o(e,t,n){let r=a(e,t,n);return Object.assign(Object.assign({},r),{groupName:n?.group_name??null})}e._makeExperiment=o;function s(e,t,n,i){return Object.assign(Object.assign({},r(e,t,n,void 0)),{get:l(e,n?.value,i),groupName:n?.group_name??null,__value:n?.value??{}})}e._makeLayer=s;function c(e,t,n,r){return Object.assign(Object.assign(Object.assign({},e),t),{get:l(e.name,n,r)})}e._mergeOverride=c;function l(e,r,i){return(a,o)=>{let s=r?.[a]??null;return s==null?o??null:o!=null&&!(0,n._isTypeMatch)(s,o)?(t.Log.warn(`Parameter type mismatch. '${e}.${a}' was found to be type '${typeof s}' but fallback/return type is '${typeof o}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),o??null):(i?.(a),s)}}e._makeTypedGet=l})),st=t((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),ct=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UPDATE_DETAIL_ERROR_MESSAGES=e.createUpdateDetails=void 0,e.createUpdateDetails=(e,t,n,r,i,a)=>({duration:n,source:t,success:e,error:r,sourceUrl:i,warnings:a}),e.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:`No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error.`}})),Q=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.Storage=e.Log=e.EventLogger=e.Diagnostics=void 0,U();var r=U(),i=W();Object.defineProperty(e,"Diagnostics",{enumerable:!0,get:function(){return i.Diagnostics}});var a=Ue();Object.defineProperty(e,"EventLogger",{enumerable:!0,get:function(){return a.EventLogger}});var o=H();Object.defineProperty(e,"Log",{enumerable:!0,get:function(){return o.Log}});var s=Y(),c=Z();Object.defineProperty(e,"Storage",{enumerable:!0,get:function(){return c.Storage}}),n(U(),e),n(we(),e),n(We(),e),n(qe(),e),n(W(),e),n(Je(),e),n(Ye(),e),n(Xe(),e),n(Ze(),e),n(q(),e),n(Qe(),e),n(H(),e),n($e(),e),n(J(),e),n(Re(),e),n(et(),e),n(tt(),e),n(X(),e),n(Te(),e),n(Pe(),e),n(nt(),e),n(Fe(),e),n(rt(),e),n(Ie(),e),n(it(),e),n(Ve(),e),n(Y(),e),n(Le(),e),n(at(),e),n(ot(),e),n(st(),e),n(Ge(),e),n(Z(),e),n(Ke(),e),n(Ce(),e),n(He(),e),n(Ne(),e),n(Ee(),e),n(ct(),e),n(Me(),e),Object.assign((0,r._getStatsigGlobal)(),{Log:o.Log,SDK_VERSION:s.SDK_VERSION})})),lt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.V1InitializeContainer=void 0;var t=Q();e.V1InitializeContainer=class{constructor(e){this._values=e}getGate(e){return this._getResultFromLookup(this._values.feature_gates,e)}getConfig(e){return this._getResultFromLookup(this._values.dynamic_configs,e)}getLayer(e){return this._getResultFromLookup(this._values.layer_configs,e)}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,n){return e?e[n]??e[(0,t._DJB2)(n)]??null:null}}})),ut=t((e=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.V2InitializeContainer=void 0;var t=Q();e.V2InitializeContainer=class{constructor(e){this._values=e}getGate(e){let t=this._getResultFromLookup(this._values.feature_gates,e);return t?{name:e,value:t.v===!0,rule_id:t.r??`default`,secondary_exposures:t.s??[],id_type:t.i??``}:null}getConfig(e){let t=this._getResultFromLookup(this._values.dynamic_configs,e);return t?{name:e,value:this._values.values[t.v]??{},rule_id:t.r,secondary_exposures:t.s??[],id_type:t.i??``,is_user_in_experiment:t.ue===!0,passed:t.p===!0,group_name:t.gn??void 0,is_experiment_active:t.ea===!0,group:t.r,is_device_based:t.i===`stableID`}:null}getLayer(e){let t=this._getResultFromLookup(this._values.layer_configs,e);return t?{name:e,value:this._values.values[t.v]??{},rule_id:t.r,secondary_exposures:t.s??[],is_user_in_experiment:t.ue===!0,group_name:t.gn??void 0,is_experiment_active:t.ea===!0,group:t.r,is_device_based:t.i===`stableID`,allocated_experiment_name:t.ae??``,explicit_parameters:t.ep??[],undelegated_secondary_exposures:t.us??[],parameter_rule_ids:t.pr}:null}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,n){return e?e[n]??e[(0,t._DJB2)(n)]??null:null}}})),dt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Q(),n=lt(),r=ut();e.default=class{constructor(e,t){this._sdkKey=e,this._options=t,this._valuesForExternalUse=null,this._values=null,this._source=`Uninitialized`,this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._valuesForExternalUse=null,this._source=`Loading`,this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source=`NoValues`)}getValues(){return this._valuesForExternalUse}setValues(e,i){if(!e)return!1;let a=(0,t._typedJsonParse)(e.data,`has_updates`,`EvaluationResponse`);return a!=null&&(this._source=e.source,a?.has_updates!==!0||(a.time??0)<this._lcut||(this._valuesForExternalUse=(0,t._typedJsonParse)(e.data,`has_updates`,`EvaluationResponse`),this._lcut=a.time,this._receivedAt=e.receivedAt,this._values=a.response_format===`init-v2`?new r.V2InitializeContainer(a):new n.V1InitializeContainer(a),this._bootstrapMetadata=this._extractBootstrapMetadata(e.source,a),e.source&&a.user&&this._setWarningState(i,a),t.SDKFlags.setFlags(this._sdkKey,a.sdk_flags??{}),!0))}getWarnings(){if(this._warnings.size!==0)return Array.from(this._warnings)}getGate(e){let t=this._values?this._values.getGate(e):null;return this._getDetailedStoreResult(t)}getConfig(e){let t=this._values?this._values.getConfig(e):null;return this._getDetailedStoreResult(t)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(e){let t=this._values?this._values.getLayer(e):null;return this._getDetailedStoreResult(t)}getParamStore(e){let t=this._values?this._values.getParamStore(e):null;return this._getDetailedStoreResult(t)}getSource(){return this._source}getExposureMapping(){return this._values?.getExposureMapping()}_extractBootstrapMetadata(e,t){if(e!==`Bootstrap`)return null;let n={};return t.user&&(n.user=t.user),t.sdkInfo&&(n.generatorSDKInfo=t.sdkInfo),n.lcut=t.time,n}_getDetailedStoreResult(e){return{result:e,details:this._getDetails(e==null)}}_setWarningState(e,n){let r=t.StableID.get(this._sdkKey);if(e.customIDs?.stableID!==r&&(e.customIDs?.stableID||r)){this._warnings.add(`StableIDMismatch`);return}if(`user`in n){let r=n.user,i=Object.assign(Object.assign({},e),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});this._options?.disableStableID&&(i=Object.assign(Object.assign({},i),{customIDs:Object.assign(Object.assign({},i.customIDs),{stableID:void 0})}),r=Object.assign(Object.assign({},r),{customIDs:Object.assign(Object.assign({},r.customIDs),{stableID:void 0})})),(0,t._getFullUserHash)(i)!==(0,t._getFullUserHash)(r)&&this._warnings.add(`PartialUserMatch`)}}getCurrentSourceDetails(){if(this._source===`Uninitialized`||this._source===`NoValues`)return{reason:this._source};let e={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>
20&&(e.warnings=Array.from(this._warnings)),e}_getDetails(e){let t=this.getCurrentSourceDetails(),n=t.reason,r=t.warnings??[];this._source===`Bootstrap`&&r.length>0&&(n+=r[0]),n!==`Uninitialized`&&n!==`NoValues`&&(n=`${n}:${e?`Unrecognized`:`Recognized`}`);let i=this._source===`Bootstrap`?this._bootstrapMetadata??void 0:void 0;return i&&(t.bootstrapMetadata=i),Object.assign(Object.assign({},t),{reason:n})}}})),ft=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._resolveDeltasResponse=void 0;var t=Q(),n=2;function r(e,r){let o=(0,t._typedJsonParse)(r,`checksum`,`DeltasEvaluationResponse`);if(!o)return{hadBadDeltaChecksum:!0};let s=a(i(e,o)),c=(0,t._DJB2Object)({feature_gates:s.feature_gates,dynamic_configs:s.dynamic_configs,layer_configs:s.layer_configs},n);return c===o.checksumV2?JSON.stringify(s):{hadBadDeltaChecksum:!0,badChecksum:c,badMergedConfigs:s,badFullResponse:o.deltas_full_response}}e._resolveDeltasResponse=r;function i(e,t){return Object.assign(Object.assign(Object.assign({},e),t),{feature_gates:Object.assign(Object.assign({},e.feature_gates),t.feature_gates),layer_configs:Object.assign(Object.assign({},e.layer_configs),t.layer_configs),dynamic_configs:Object.assign(Object.assign({},e.dynamic_configs),t.dynamic_configs)})}function a(e){let t=e;return o(e.deleted_gates,t.feature_gates),delete t.deleted_gates,o(e.deleted_configs,t.dynamic_configs),delete t.deleted_configs,o(e.deleted_layers,t.layer_configs),delete t.deleted_layers,t}function o(e,t){e?.forEach(e=>{delete t[e]})}})),pt=t((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});var n=Q(),r=ft();e.default=class extends n.NetworkCore{constructor(e,t){super(e,t);let r=e?.networkConfig;this._option=e,this._initializeUrlConfig=new n.UrlConfiguration(n.Endpoint._initialize,r?.initializeUrl,r?.api,r?.initializeFallbackUrls)}fetchEvaluations(e,r,i,a,o){return t(this,void 0,void 0,function*(){let t=r?(0,n._typedJsonParse)(r,`has_updates`,`InitializeResponse`):null,s={user:a,hash:this._option?.networkConfig?.initializeHashAlgorithm??`djb2`,deltasResponseRequested:!1,full_checksum:null};if(t?.has_updates){let e=t?.hash_used!==(this._option?.networkConfig?.initializeHashAlgorithm??`djb2`);s=Object.assign(Object.assign({},s),{sinceTime:o&&!e?t.time:0,previousDerivedFields:`derived_fields`in t&&o?t.derived_fields:{},deltasResponseRequested:!0,full_checksum:t.full_checksum,partialUserMatchSinceTime:e?0:t.time})}return this._fetchEvaluations(e,t,s,i)})}_fetchEvaluations(e,n,i,a){return t(this,void 0,void 0,function*(){let t=yield this.post({sdkKey:e,urlConfig:this._initializeUrlConfig,data:i,retries:2,isStatsigEncodable:!0,priority:a});if(t?.code===204)return`{"has_updates": false}`;if(t?.code!==200)return t?.body??null;if(n?.has_updates!==!0||t.body?.includes(`"is_delta":true`)!==!0||i.deltasResponseRequested!==!0)return t.body;let o=(0,r._resolveDeltasResponse)(n,t.body);return typeof o==`string`?o:this._fetchEvaluations(e,n,Object.assign(Object.assign(Object.assign({},i),o),{deltasResponseRequested:!1}),a)})}}})),mt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._makeParamStoreGetter=void 0;var t=Q(),n={disableExposureLog:!0};function r(e){return e==null||e.disableExposureLog===!1}function i(e,n){return n!=null&&!(0,t._isTypeMatch)(e,n)}function a(e,t){return e.value}function o(e,t,i){return e.getFeatureGate(t.gate_name,r(i)?void 0:n).value?t.pass_value:t.fail_value}function s(e,t,a,o){let s=e.getDynamicConfig(t.config_name,r(o)?void 0:n).get(t.param_name);return i(s,a)?a:s}function c(e,t,a,o){let s=e.getExperiment(t.experiment_name,r(o)?void 0:n).get(t.param_name);return i(s,a)?a:s}function l(e,t,a,o){let s=e.getLayer(t.layer_name,r(o)?void 0:n).get(t.param_name);return i(s,a)?a:s}function u(e,n,r){return(i,u)=>{if(n==null)return u;let d=n[i];if(d==null||u!=null&&(0,t._typeOf)(u)!==d.param_type)return u;switch(d.ref_type){case`static`:return a(d,r);case`gate`:return o(e,d,r);case`dynamic_config`:return s(e,d,u,r);case`experiment`:return c(e,d,u,r);case`layer`:return l(e,d,u,r);default:return u}}}e._makeParamStoreGetter=u})),ht=t((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}
2return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigEvaluationsDataAdapter=void 0;var n=Q(),r=pt();e.StatsigEvaluationsDataAdapter=class extends n.DataAdapterCore{constructor(){super(`EvaluationsDataAdapter`,`evaluations`),this._network=null,this._options=null}attach(e,t,n){super.attach(e,t,n),this._network=n!==null&&n instanceof r.default?n:new r.default(t??{})}getDataAsync(e,t,r){return this._getDataAsyncImpl(e,(0,n._normalizeUser)(t,this._options),r)}prefetchData(e,t){return this._prefetchDataImpl(e,t)}setData(e){let t=(0,n._typedJsonParse)(e,`has_updates`,`data`);t&&`user`in t?super.setData(e,t.user):n.Log.error(`StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.`)}setDataLegacy(e,t){super.setData(e,t)}_fetchFromNetwork(e,n,r,i){return t(this,void 0,void 0,function*(){return(yield this._network?.fetchEvaluations(this._getSdkKey(),e,r?.priority,n,i))??null})}_getCacheKey(e){let t=(0,n._getStorageKey)(this._getSdkKey(),e,this._options?.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this._cacheSuffix}.${t}`}_isCachedResultValidFor204(e,t){return e.fullUserHash!=null&&e.fullUserHash===(0,n._getFullUserHash)(t)}}})),gt=t((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});var n=Q(),r=dt(),i=pt(),a=mt(),o=ht();e.default=class e extends n.StatsigClientBase{static instance(t){let r=(0,n._getStatsigGlobal)().instance(t);return r instanceof e?r:(n.Log.warn((0,n._isServerEnv)()?`StatsigClient.instance is not supported in server environments`:`Unable to find StatsigClient instance`),new e(t??``,{}))}constructor(e,t,a=null){n.SDKType._setClientType(e,`javascript-client`);let s=new i.default(a,e=>{this.$emt(e)});super(e,a?.dataAdapter??new o.StatsigEvaluationsDataAdapter,s,a),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(n.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(n.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(n.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(n.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(n.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(n.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new r.default(e,a??null),this._network=s,this._user=this._configureUser(t,a),this._sdkInstanceID=(0,n.getUUID)(),this._contextHandle=new n.PrecomputedEvaluationsContextHandle(e,()=>this._options,()=>this._errorBoundary,()=>this._store.getValues(),()=>this._user,()=>this._sdkInstanceID);let c=a?.plugins??[];for(let e of c)e.bind(this)}initializeSync(e){return this.loadingStatus===`Uninitialized`?(this._logger.start(),this.updateUserSync(this._user,e)):(0,n.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,[`MultipleInitializations`,...this._store.getWarnings()??[]])}initializeAsync(e){return t(this,void 0,void 0,function*(){return this._initializePromise||(this._initializePromise=this._initializeAsyncImpl(e)),this._initializePromise})}updateUserSync(e,t){let n=performance.now();try{return this._updateUserSyncImpl(e,t,n)}catch(e){let t=e instanceof Error?e:Error(String(e));return this._createErrorUpdateDetails(t,n)}}_updateUserSyncImpl(e,t,r){let i=[...this._store.getWarnings()??[]];this._resetForUser(e);let a=this.dataAdapter.getDataSync(this._user);a??i.push(`NoCachedValues`),this._store.setValues(a,this._user),this._finalizeUpdate(a);
2let o=t?.disableBackgroundCacheRefresh;return o===!0||o==null&&a?.source===`Bootstrap`||this._runPostUpdate(a??null,this._user),(0,n.createUpdateDetails)(!0,this._store.getSource(),performance.now()-r,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),i)}updateUserAsync(e,n){return t(this,void 0,void 0,function*(){let t=performance.now();try{return yield this._updateUserAsyncImpl(e,n)}catch(e){let n=e instanceof Error?e:Error(String(e));return this._createErrorUpdateDetails(n,t)}})}_updateUserAsyncImpl(e,r){return t(this,void 0,void 0,function*(){this._resetForUser(e);let t=this._user;n.Diagnostics._markInitOverallStart(this._sdkKey);let i=this.dataAdapter.getDataSync(t);if(this._store.setValues(i,this._user),this._setStatus(`Loading`,i),i=yield this.dataAdapter.getDataAsync(i,t,r),t!==this._user)return(0,n.createUpdateDetails)(!1,this._store.getSource(),-1,Error(`User changed during update`),this._network.getLastUsedInitUrlAndReset());let a=!1;i!=null&&(n.Diagnostics._markInitProcessStart(this._sdkKey),a=this._store.setValues(i,this._user),n.Diagnostics._markInitProcessEnd(this._sdkKey,{success:a})),this._finalizeUpdate(i),a||(this._errorBoundary.attachErrorIfNoneExists(n.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:`initialization_failure`})),n.Diagnostics._markInitOverallEnd(this._sdkKey,a,this._store.getCurrentSourceDetails());let o=n.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,n.createUpdateDetails)(a,this._store.getSource(),o,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){let e=(0,n._cloneObject)(`StatsigUser`,this._user);return e??(n.Log.error(`Failed to clone user`),e={}),{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:e,errorBoundary:this._errorBoundary,session:n.StatsigSession.get(this._sdkKey),stableID:n.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}getContextHandle(){return this._contextHandle}checkGate(e,t){return this.getFeatureGate(e,t).value}logEvent(e,t,n){let r=typeof e==`string`?{eventName:e,value:t,metadata:n}:e;this.$emt({name:`log_event_called`,event:r}),this._logger.enqueue(Object.assign(Object.assign({},r),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(e){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:e}),this._options)}_primeReadyRipcord(){this.$on(`error`,()=>{this.loadingStatus===`Loading`&&this._finalizeUpdate(null)})}_initializeAsyncImpl(e){return t(this,void 0,void 0,function*(){return n.Storage.isReady()||(yield n.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,e)})}_createErrorUpdateDetails(e,t){return(0,n.createUpdateDetails)(!1,this._store.getSource(),performance.now()-t,e,null,[...this._store.getWarnings()??[]])}_finalizeUpdate(e){this._store.finalize(),this._setStatus(`Ready`,e)}_runPostUpdate(e,t){this.dataAdapter.getDataAsync(e,t,{priority:`low`}).catch(e=>{n.Log.error(`An error occurred after update.`,e)})}_resetForUser(e){this._logger.reset(),this._store.reset(),this._user=this._configureUser(e,this._options)}_configureUser(e,t){var r;let i=(0,n._normalizeUser)(e,t),a=i.customIDs?.stableID;if(a){let e=(r=this.storageProvider).isReadyResolver?.call(r);e?e.then(()=>n.StableID.setOverride(a,this._sdkKey),()=>n.StableID.setOverride(a,this._sdkKey)):n.StableID.setOverride(a,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(i.analyticsOnlyMetadata=Object.assign(Object.assign({},i.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),i}_getFeatureGateImpl(e,t){var r;let{result:i,details:a}=this._store.getGate(e);this._checkUserHasIdForEvaluation(i?.id_type,e,`Gate`),this._checkInitializationStatus(a.reason);let o=(0,n._makeFeatureGate)(e,a,i),s=((r=this.overrideAdapter)?.getGateOverride)?.call(r,o,this._user,t)??o;return this._enqueueExposure(e,(0,n._createGateExposure)(this._user,s,this._store.getExposureMapping()),t),this.$emt({name:`gate_evaluation`,gate:s}),s}_getDynamicConfigImpl(e,t){var r;let{result:i,details:a}=this._store.getConfig(e);this._checkUserHasIdForEvaluation(i?.id_type,e,`Dynamic config`),this._checkInitializationStatus(a.reason);let o=(0,n._makeDynamicConfig)(e,a,i),s=((r=this.overrideAdapter)?.getDynamicConfigOverride)?.call(r,o,this._user,t)??o;return this._enqueueExposure(e,(0,n._createConfigExposure)(this._user,s,this._store.getExposureMapping()),t),this.$emt({name:`dynamic_config_evaluation`,dynamicConfig:s}),s}_getExperimentImpl(e,t){var r;let{result:i,details:a}=this._store.getConfig(e);this._checkUserHasIdForEvaluation(i?.id_type,e,`Experiment`),this._checkInitializationStatus(a.reason);let o=(0,n._makeExperiment)(e,a,i);o.__evaluation!=null&&(o.__evaluation.secondary_exposures=(0,n._mapExposures)(o.__evaluation?.secondary_exposures??[],this._store.getExposureMapping()));let s=((r=this.overrideAdapter)?.getExperimentOverride)?.call(r,o,this._user,t)??o;return this._enqueueExposure(e,(0,n._createConfigExposure)(this._user,s,this._store.getExposureMapping()),t),this.$emt({name:`experiment_evaluation`,experiment:s}),s}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(e,t){var r;let{result:i,details:a}=this._store.getLayer(e),o=(0,n._makeLayer)(e,a,i),s=((r=this.overrideAdapter)?.getLayerOverride)?.call(r,o,this._user,t);t?.disableExposureLog&&this._logger.incrementNonExposureCount(e);let c=(0,n._mergeOverride)(o,s,s?.__value??o.__value,r=>{t?.disableExposureLog||this._enqueueExposure(e,(0,n._createLayerParameterExposure)(this._user,c,r,this._store.getExposureMapping()),t)}
2);return this.$emt({name:`layer_evaluation`,layer:c}),c}_getParameterStoreImpl(e,t){var n;let{result:r,details:i}=this._store.getParamStore(e);this._logger.incrementNonExposureCount(e);let o={name:e,details:i,__configuration:r,get:(0,a._makeParamStoreGetter)(this,r,t)},s=((n=this.overrideAdapter)?.getParamStoreOverride)?.call(n,o,t);return s!=null&&(o.__configuration=s.config,o.details=s.details,o.get=(0,a._makeParamStoreGetter)(this,s.config,t)),o}_checkUserHasIdForEvaluation(e,t,r){e&&((0,n._getUnitIDFromUser)(this._user,e)||n.Log.warn(`The user does not have the required id_type "${e}" for ${r} "${t}"`))}_checkInitializationStatus(e){(e===`Uninitialized`||e.startsWith(`Loading`))&&n.Log.warn(`SDK initialization has not completed. Reason: ${e}`)}}})),_t=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigClient=void 0;var r=Q(),i=gt();e.StatsigClient=i.default,n(Q(),e),e.default=Object.assign((0,r._getStatsigGlobal)(),{StatsigClient:i.default})}))();function vt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)r!==`__proto__`&&(e[r]=n[r])}return e}var yt={read:function(e){return e[0]===`"`&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function bt(e,t){function n(n,r,i){if(!(typeof document>`u`)){i=vt({},t,i),typeof i.expires==`number`&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a=``;for(var o in i)i[o]&&(a+=`; `+o,i[o]!==!0&&(a+=`=`+i[o].split(`;`)[0]));return document.cookie=n+`=`+e.write(r,n)+a}}function r(t){if(!(typeof document>`u`||arguments.length&&!t)){for(var n=document.cookie?document.cookie.split(`; `):[],r={},i=0;i<n.length;i++){var a=n[i].split(`=`),o=a.slice(1).join(`=`);try{var s=decodeURIComponent(a[0]);if(s in r||(r[s]=e.read(o,s)),t===s)break}catch{}}return t?r[t]:r}}return Object.create({set:n,get:r,remove:function(e,t){n(e,``,vt({},t,{expires:-1}))},withAttributes:function(e){return bt(this.converter,vt({},this.attributes,e))},withConverter:function(e){return bt(vt({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var xt=bt(yt,{path:`/`}),St,Ct=new Promise(e=>{St=e});function wt(){let e=window.statsigInitValues?.dynamic_configs;return e?Object.entries(e).filter(([,e])=>e.is_user_in_experiment===!0).map(([,e])=>e.group_name):[]}var Tt=new class e{constructor(){if(n(this,`statsig`,null),n(this,`user`,null),n(this,`delayedGates`,{}),n(this,`delayedExperiments`,{}),n(this,`delayedLayers`,{}),n(this,`featureGateSubs`,{}),n(this,`experimentSubs`,{}),n(this,`layerSubs`,{}),n(this,`loggedExposures`,{gate:new Set(e.getLoggedExposuresFromLocalStorage(`gate`)),experiment:new Set(e.getLoggedExposuresFromLocalStorage(`experiment`)),layer:new Set(e.getLoggedExposuresFromLocalStorage(`layer`))}),n(this,`flushPromise`,void 0),n(this,`flushResolve`,void 0),n(this,`flushDebounceTimeout`,void 0),n(this,`shutdownPromise`,void 0),n(this,`setUserCustom`,c(async e=>{let t=xt.get(`statsigCustom`)??`{}`,n={};try{n=JSON.parse(t)}catch(e){window.report_err(e,`Failed to parse statsigCustom cookie`)}for(let t of e)n={...n,...t};if(xt.set(`statsigCustom`,JSON.stringify(n)),this.statsig){let e={...window.statsigInitValues.user};e.custom=n,await this.statsig.updateUserAsync(e)}},500)),n(this,`onValuesUpdated`,e=>{if(e.status===`Ready`){this.updateSubscriptions(),window.statsigUserCustom!==void 0&&(this.setUserCustom(window.statsigUserCustom),window.statsigUserCustom=void 0);for(let e of window.statsigEvents??[])this.logEvent(e.eventOrName,void 0,e.metadata);window.statsigEvents=void 0,window.statsigWrapper=this,St?.()}}),window.statsigInitValues===void 0||window.statsigInitValues===null){window.env===`production`&&window.report_err(null,`Missing statsig init values`),St?.();return}let t;t=window.env===`production`||window.env===`staging`?window.env:`development`,this.user=window.statsigInitValues.user,this.statsig=new _t.StatsigClient(`client-SmFQ3twFOL4i3gJ2l30xRbVfwLhGhMqnBK2ujFqrw5O`,this.user,{environment:{tier:t}}),this.statsig.on(`values_updated`,this.onValuesUpdated),this.statsig.dataAdapter.setData(JSON.stringify(window.statsigInitValues)),this.statsig.initializeSync(),this.logUsageFromMetaTag()}async logEvent(e,t,n){let r={...window.gtm_vars,...n};return this.statsig?.logEvent(e,t,r),this.flushPromise===void 0&&(this.flushPromise=new Promise(e=>{this.flushResolve=e})),this.flushDebounceTimeout!==void 0&&clearTimeout(this.flushDebounceTimeout),this.flushDebounceTimeout=setTimeout(async()=>{let e=this.flushResolve;this.flushDebounceTimeout=void 0,this.flushPromise=void 0,this.flushResolve=void 0,await this.statsig?.flush(),e?.()},300),this.flushPromise}shutdown(){return this.shutdownPromise??(this.shutdownPromise=Promise.resolve(this.statsig?.shutdown())),this.shutdownPromise}checkGate(e,t){return this.logExposureToConsole(`gate`,e,t),this.statsig?.checkGate(e,t)}getExperiment(e,t){return this.logExposureToConsole(`experiment`,e,t),this.statsig?.getExperiment(e,t)}getLayer(e,t){return this.logExposureToConsole(`layer`,e,t),this.statsig?.getLayer(e,t)}subFeatureGate(e,t,n){var r;this.statsig?.loadingStatus===`Ready`&&t(this.checkGate(e,n)),(r=this.featureGateSubs)[e]??(r[e]=[]),this.featureGateSubs[e].push({cb:t,options:n})}unsubFeatureGate(e,t){this.featureGateSubs[e]=this.featureGateSubs[e]?.filter(e=>e.cb!==t)}subExperiment(e,t,n){var r;this.statsig?.loadingStatus===`Ready`&&t(this.getExperiment(e,n)),(r=this.experimentSubs)[e]??(r[e]=[]),this.experimentSubs[e].push({cb:t,options:n})}unsubExperiment(e,t){this.experimentSubs[e]=this.experimentSubs[e]?.filter(e=>e.cb!==t)}subLayer(e,t,n){var r;this.statsig?.loadingStatus===`Ready`&&t(this.getLayer(e,n)),(r=this.layerSubs)[e]??(r[e]=[]),this.layerSubs[e].push({cb:t,options:n})}unsubLayer(e,t){this.layerSubs[e]=this.layerSubs[e]?.filter(e=>e.cb!==t)}getLoggedExposures(){return{gates:Array.from(this.loggedExposures.gate),experiments:Array.from(this.loggedExposures.experiment),layers:Array.from(this.loggedExposures.layer)}}logUsageFromAxiosResponse(e){let t=e.headers[`x-statsig-usage`];typeof t==`string`&&this.logUsageFromServer(t)}logDelayedExposure(e){for(let t of this.delayedGates[e]??[])this.checkGate(t);for(let t of this.delayedExperiments[e]??[])this.getExperiment(t);for(let t of this.delayedLayers[e]??[])this.getLayer(t);delete this.delayedGates[e],delete this.delayedExperiments[e],delete this.delayedLayers[e]}static getLoggedExposuresFromLocalStorage(e){let t=localStorage.getItem(`statsigExposures:${e}`)?.split(`,`)??[];return new Set(t)}logUsageFromMetaTag(){let e=document.querySelector(`meta[name="statsig-usage"]`)?.getAttribute(`content`);typeof e==`string`&&this.logUsageFromServer(e)}logUsageFromServer(e){let t=JSON.parse(e);for(let e of t.exposure.gates)this.logExposureToConsole(`gate`,e);for(let e of t.exposure.experiments)this.logExposureToConsole(`experiment`,e);for(let e of t.exposure.layers)this.logExposureToConsole(`layer`,e);let n=(e,t)=>{for(let[n,r]of Object.entries(t??{}
2))e[n]=[...e[n]??[],...r]};n(this.delayedGates,t.exposure.delayedGates),n(this.delayedExperiments,t.exposure.delayedExperiments),n(this.delayedLayers,t.exposure.delayedLayers)}updateSubscriptions(){if(this.statsig!==null){for(let[e,t]of Object.entries(this.featureGateSubs))for(let{cb:n,options:r}of t)n(this.checkGate(e,r));for(let[e,t]of Object.entries(this.experimentSubs))for(let{cb:n,options:r}of t)n(this.getExperiment(e,r));for(let[e,t]of Object.entries(this.layerSubs))for(let{cb:n,options:r}of t)n(this.getLayer(e,r))}}logExposureToConsole(e,t,n){let r=this.loggedExposures[e];r.has(t)||n?.disableExposureLog===!0||(console.log(`[statsig] Exposure logged for ${e} "${t}"`),r.add(t),localStorage.setItem(`statsigExposures:${e}`,Array.from(r.values()).join(`,`)))}};async function Et(e){window.onbeforeunload=null;try{await Tt.shutdown()}catch(e){window.report_err(e,`Unable to flush statsig before redirect`)}window.location.href=e}function Dt(e){try{Tt.logUsageFromAxiosResponse(e)}catch(e){window.report_err(e instanceof Error?e:Error(),`Failed to log usage from Axios response`)}return kt(e)?(jt(e),Promise.reject({response:e})):(window.axios_interceptor_order_details_page!==void 0&&window.axios_interceptor_order_details_page(e),e)}function Ot(e){if(e===void 0||e.request===void 0||e.response===void 0||e.response.status===void 0)return console.log(`axiosResponseError: Ajax Request Seems To Have Been Aborted`),Promise.reject(e);let t=e.config?.url;return t!==void 0&&t.indexOf(`core.spreedly.com`)!==-1||jt(e.response,e),Promise.reject(e)}var kt=e=>{if(e.status>=400||At(e))return!0;if(typeof e.data==`object`){let t=e.data;if(t.hasOwnProperty(`success`)&&t.success!==!0||t.hasOwnProperty(`error`)&&t.error!==!1)return!0}return!1},At=e=>e.status!==200||e.data!==``?!1:(e.request?.responseURL??``).match(/s3\.amazonaws\.com/)===null;function jt(e,t=void 0){if(e===void 0)return;let n=Mt(e),r=n.shift()??``,i=n.join(` 3`);if(t===void 0||a(t)?console.warn(i):window.report_err(t??Error(`Axios Error`),r,n),e?.config?.disableGlobalErrorHandler===!0)return;let o=e?.data??{};window.alert_error({message:r+` 4`+i,markdown:o.markdown,buttonLabel:window.lang(`Close`),debug:e.headers[`x-laravel-exception-msg`]?`[LOCAL ONLY MSG] Exception: `+e.headers[`x-laravel-exception-msg`]+` - `+e.headers[`x-laravel-exception-line`]:null})}var Mt=e=>{let t=[],n=e=>{e.length>0&&t.indexOf(e)===-1&&t.push(e)},r=e!==void 0&&e.hasOwnProperty(`data`)?e.data:{};if((r===``||r===void 0||typeof r!=`object`)&&(r={message:`No data returned from server`}),e?.status>500&&(r=e.config?.method?.toUpperCase()===`GET`?{message:`Request to the server has timed out. You may want to refresh the page. Code: `+e.status}:{message:`Request to the server has timed out. It may still be executing, so if you just submitted a payment, please wait a few minutes before re-trying. Code: `+e.status}),e.status===403&&e.headers?.server===`awselb/2.0`&&(r={message:`Our firewall has blocked your request. Please report this to customer service! Code: {`+(e.headers[`firewall-rule`]??`header-not-found`)+`}`}),r.hasOwnProperty(`message`)&&n(r.message),r.hasOwnProperty(`err_msg`)&&n(r.err_msg),r.hasOwnProperty(`error_msg`)&&n(r.error_msg),r.hasOwnProperty(`errors`)&&typeof r.errors==`object`&&r.errors!==null){let e=Object.values(r.errors);e.length>0&&(t=[]);for(let t of e)Array.isArray(t)&&t.forEach(e=>n(e))}return r.hasOwnProperty(`exception`)&&r.hasOwnProperty(`file`)&&r.hasOwnProperty(`line`)&&n(`[LOCAL ONLY MSG] Exception: `+r.file+`:`+r.line),r.hasOwnProperty(`errorId`)&&n(`Error ID: `+r.errorId),t};function Nt(e){let t=new URL(window.location.href),n=t.searchParams.get(`group`);if(n===null||n===``)return e;let r=e.url??``;return`${e.baseURL??``}${r}`.includes(t.hostname)===!1?e:e.params instanceof URLSearchParams?(e.params.set(`group`,n),e):typeof e.params==`object`?(e.params={...e.params,group:n},e):((e.params===void 0||e.params===null)&&(e.params={group:n}),e)}var $={initialize:async e=>{e.defaults.headers.common[`X-Requested-With`]=`XMLHttpRequest`,e.interceptors.request.clear(),e.interceptors.request.use(Nt),e.interceptors.response.clear(),e.interceptors.response.use(Dt,Ot);let t=document.head.querySelector(`meta[name="csrf-token"]`);if(t&&(e.defaults.headers.common[`X-CSRF-TOKEN`]=t.content),window.siteUiConfig?.nativeAppiFrame){let t=window.siteUiConfig.nativeAppInfo;e.defaults.headers.common[`X-ivisa-app`]=[`ivisa-native-app`,t.device_platform,t.mobile_app_type,t.mobile_app_version].join(`---`)}return e},request:e=>o(()=>import(`./axios-DfVQph-v-30fea673.js`).then(async t=>(await $.initialize(t.default)).request(e)),__vite__mapDeps([0,1]),import.meta.url),isAxiosError:e=>
4typeof e==`object`&&!!e&&`isAxiosError`in e&&e.isAxiosError===!0,get:(e,t)=>{let n=t??{};return n.method=`GET`,n.url=e,$.request(n)},post:(e,t,n)=>{let r=n??{};return r.method=`POST`,r.url=e,r.data=t,$.request(r)},put:(e,t,n)=>{let r=n??{};return r.method=`PUT`,r.url=e,r.data=t,$.request(r)},patch:(e,t,n)=>{let r=n??{};return r.method=`PATCH`,r.url=e,r.data=t,$.request(r)},delete:(e,t)=>{let n=t??{};return n.method=`DELETE`,n.url=e,$.request(n)}};window.axios=$,window.alert_success=function(e){swal({title:window.lang(`Success`),text:e,icon:`success`,button:`OK`})},window.alert_error=function(e){window.iVisaAlertModal({title:e.title??window.lang(`Error`),type:`error`,markdown:e.markdown??null,text:e.message,buttonLabel:e.buttonLabel??window.lang(`OK`),debug:e?.debug??null})};var Pt=365.2425,Ft=6048e5,It=864e5,Lt=6e4,Rt=36e5,zt=1e3,Bt=86400;Bt*7,Bt*Pt/12*3;var Vt=Symbol.for(`constructDateFrom`);function Ht(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&Vt in e?e[Vt](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ut(e,t){return Ht(t||e,e)}function Wt(e,...t){let n=Ht.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function Gt(e,t){let n=Ut(e)-+Ut(t);return n<0?-1:n>0?1:n}function Kt(e,t,n){let[r,i]=Wt(n?.in,e,t);return r.getFullYear()-i.getFullYear()}function qt(e,t,n){let[r,i]=Wt(n?.in,e,t),a=Gt(r,i),o=Math.abs(Kt(r,i));r.setFullYear(1584),i.setFullYear(1584);let s=a*(o-+(Gt(r,i)===-a));return s===0?0:s}var Jt=()=>{let e=`test`;try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch{return!1}},Yt=e=>{if(e=qt(new Date,e),isNaN(e)||e<0)return null;let t;if(e>=80)t=`80+`;else if(e===19)t=`19-24`;else{let n=Math.floor(e/5)*5,r=n+4;t=(n===20?19:n)+`-`+(r===19?18:r)}return t},Xt=e=>{let t=window.Cookies.get(e);if(t==null||t===``)return null;if(t.substring(0,1)===`{`||t.substring(0,1)===`[`)try{return JSON.parse(t)}catch{}return t},Zt=(e,t)=>{if(t==null||t===``){console.error(`Attempted to set null cookie value for `,e);return}typeof t==`object`&&(t=JSON.stringify(t)),window.Cookies.set(e,t,{sameSite:`lax`})},Qt=e=>{try{window.Cookies.remove(e)}catch{}},$t=e=>e===!0||e===1||e===`1`||e===`true`?`Yes`:e===!1||e===0||e===`0`||e===`false`?`No`:e,en=(e,t)=>{let n={};e={...e};for(let r in e)n[r]=e[r],n[r].value=t[r]??n[r].default_answer??null,n[r].field_type===`boolean`&&(n[r].value=$t(n[r].value));return n},tn=e=>{Zt(`countryApplicationCode`,e)},nn=e=>{Zt(`nationalityFromPassport`,e),window.ivisalog.set(`nationality`,e)},rn=(e,t,n)=>{if(n===``)return!0;let r=!1;return t.forEach(t=>{e[t]&&(typeof e[t]==`object`?e[t].filter(e=>e.toLowerCase().includes(n)).length&&(r=!0):e[t].toLowerCase().includes(n)&&(r=!0))}),r},an=(e,t,n)=>{let r=[];return n=n.replace(/[^a-zA-Z1-9]/g,``),e.filter(e=>rn(e,t,n)).forEach(e=>{let t=e.name.replace(/[^1-9]/g,``);isNaN(n)&&(t=e.name.replace(/[^a-zA-Z]/g,``)),t.toLowerCase().substring(0,n.length)===n&&r.push(e),e.aliases&&e.aliases.forEach(t=>{t.toLowerCase().substring(0,n.length)===n&&r.indexOf(e)===-1&&r.push(e)})}),r.sort((e,t)=>isNaN(n)||n===``?e.name.replace(/[^a-zA-Z]/g,``)>t.name.replace(/[^a-zA-Z]/g,``)?1:-1:e.name.replace(/[^1-9]/g,``)-t.name.replace(/[^1-9]/g,``))},on=(e,t,n)=>{if(n.trim()===``)return e.every(e=>!isNaN(e.name))?e.sort():e.sort((e,t)=>e.name.localeCompare(t.name));n=n.toLowerCase();let r={exact:1,startsWith:2,partial:3},i=[];return e.forEach(e=>{let t=sn(e,n);t&&i.push({option:e,matchType:t})}),i.sort((e,t)=>r[e.matchType]-r[t.matchType]||e.option.name.localeCompare(t.option.name)),i.map(({option:e})=>e)},sn=(e,t)=>{if(e.value.toLowerCase()===t)return`exact`;if(e.value.toLowerCase().startsWith(t))return`startsWith`;if(e.value.toLowerCase().includes(t))return`partial`;if(e.name.toLowerCase()===t)return`exact`;if(e.name.toLowerCase().startsWith(t))return`startsWith`;if(e.name.toLowerCase().includes(t))return`partial`;if(e.aliases){if(e.aliases.some(e=>e.toLowerCase()===t))return`exact`;if(e.aliases.some(e=>e.toLowerCase().startsWith(t)))return`startsWith`;if(e.aliases.some(e=>e.toLowerCase().includes(t)))return`partial`}return null},cn=()=>Xt(`qa_splitversion`)??window.getUrlParam(`splitversion`),ln=()=>typeof window.fluxFlowVariant==`string`,un=()=>window.fluxFlowVariant!==`embassy_reg`,dn=()=>{let e=new URLSearchParams(window.location.search).get(`nationality`);return e===null||e?.length!==2?null:(e=e.toUpperCase(),nn(e),e)};function fn(e){let t=BigInt(0);for(let n=0;n<e.length;n++){let r=e[n].toLowerCase(),i=`0123456789abcdefghijklmnopqrstuvwxyz`.indexOf(r);if(i===-1)throw Error(`Invalid base36 character: ${r}`);t=t*BigInt(36)+BigInt(i)}let n=``;for(;t>0;)n=String.fromCharCode(Number(t%BigInt(256)))+n,t/=BigInt(256);return n}window.nationalityAndCurrency=(e=null)=>{let t=new URL(window.location.href).searchParams.get(`nationality`)?.trim()??null;(t?.length!==2||e!==null&&!e.includes(t))&&(t=null);let n=Xt(`nationalityFromPassport`);t===null&&(t=n,t===null&&(t=document.querySelector(`meta[name='customer-country-code']`)?.getAttribute(`content`)??`US`)),t!==null&&t!==n&&nn(t);let r=Xt(`default_currency`);(r===null||(window.currency_list[r]??null)===null)&&(r=window.default_currencies[t]??`USD`,window.update_currency(r));let i=document.getElementById(`selectedCurrency`);return i!==null&&(i.innerText=window.currency_list[r].symbol+` `+r),{nationality:t,currency:r}},window.update_currency=e=>{Zt(`default_currency`,e),window.dispatchEvent(new CustomEvent(`currency-changed`,{detail:{currency:e}}))},window.update_currency_selector=()=>{let e=window.nationalityAndCurrency().currency,t=document.getElementById(`currencyHeader`)??null,n=document.getElementById(`selectedCurrency`)??null;[`currencyMicrosite`,`currencyFooter`].forEach(function(t){let n=document.getElementById(t);n!==null&&(n.innerHTML=window.currency_list[e].symbol+` `+e)}),t!==null&&(t.innerHTML=e),n!==null&&(n.textContent=(window.currency_list[e]?.symbol??e)+` `+e)};var pn=4e3;
4async function mn(e,t,n){let r=e.dataset.visaTypeId,i=e.querySelector(`[data-cheapest-price]`);if(!(!r||i===null))try{let{data:e}=await window.axios.post(window.route(`public.product.visa_processing_time`),{primary_product_classification:`visa`,currency:n,traveler_list:[{nationality_country:t}],quoted_total:0,global_fields:{visa_type_id:Number(r),common_nationality_country:t,visa_processing_speed:0}}),a=e.find(e=>e.code===`standard`)??e[0];a?.price_with_fee_included!==void 0&&(i.textContent=window.formatCurrency(n,a.price_with_fee_included))}catch(e){window.report_err(e instanceof Error?e:null,`Failed to refresh destination card price`)}}async function hn(e){let{nationality:t,currency:n}=window.nationalityAndCurrency(),r=Array.from(e.querySelectorAll(`[data-visa-type-id]`));await Promise.all(r.map(e=>mn(e,t,n))),window.update_currency_selector?.()}function gn(){let e=document.getElementById(`visa-cards-container`);if(e===null||e.querySelector(`[data-visa-type-id]`)===null)return;window.addEventListener(`currency-changed`,()=>void hn(e));let t=!1,n=()=>{t||(t=!0,hn(e))};window.addEventListener(`scroll`,n,{once:!0,passive:!0}),requestAnimationFrame(()=>{window.scrollY>0?n():window.setTimeout(n,pn)})}document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,gn):gn();var _n=e(t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).LazyLoad=r()})(e,(function(){let e=typeof window<`u`,t=e&&!(`onscroll`in window)||typeof navigator<`u`&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),n=e&&window.devicePixelRatio>1,r={elements_selector:`.lazy`,container:t||e?document:null,threshold:300,thresholds:null,data_src:`src`,data_srcset:`srcset`,data_sizes:`sizes`,data_bg:`bg`,data_bg_hidpi:`bg-hidpi`,data_bg_multi:`bg-multi`,data_bg_multi_hidpi:`bg-multi-hidpi`,data_bg_set:`bg-set`,data_poster:`poster`,class_applied:`applied`,class_loading:`loading`,class_loaded:`loaded`,class_error:`error`,class_entered:`entered`,class_exited:`exited`,unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},i=e=>Object.assign({},r,e),a=function(e,t){let n,r=`LazyLoad::Initialized`,i=new e(t);try{n=new CustomEvent(r,{detail:{instance:i}})}catch{n=document.createEvent(`CustomEvent`),n.initCustomEvent(r,!1,!1,{instance:i})}window.dispatchEvent(n)},o=`srcset`,s=`sizes`,c=`poster`,l=`llOriginalAttrs`,u=`data`,d=`loading`,f=`loaded`,p=`applied`,m=`error`,h=`native`,g=`data-`,_=`ll-status`,v=(e,t)=>e.getAttribute(g+t),y=e=>v(e,_),b=(e,t)=>((e,t,n)=>{let r=g+t;n===null?e.removeAttribute(r):e.setAttribute(r,n)})(e,_,t),x=e=>b(e,null),S=e=>y(e)===null,C=e=>y(e)===h,w=[d,f,p,m],T=(e,t,n,r)=>{e&&typeof e==`function`&&(r===void 0?n===void 0?e(t):e(t,n):e(t,n,r))},E=(t,n)=>{e&&n!==``&&t.classList.add(n)},D=(t,n)=>{e&&n!==``&&t.classList.remove(n)},ee=e=>e.llTempImage,O=(e,t)=>{if(!t)return;let n=t._observer;n&&n.unobserve(e)},k=(e,t)=>{e&&(e.loadingCount+=t)},te=(e,t)=>{e&&(e.toLoadCount=t)},A=e=>{let t=[];for(let n,r=0;n=e.children[r];r+=1)n.tagName===`SOURCE`&&t.push(n);return t},j=(e,t)=>{let n=e.parentNode;n&&n.tagName===`PICTURE`&&A(n).forEach(t)},ne=(e,t)=>{A(e).forEach(t)},M=[`src`],N=[`src`,c],P=[`src`,o,s],re=[u],F=e=>!!e[l],ie=e=>e[l],I=e=>delete e[l],L=(e,t)=>{if(F(e))return;let n={};t.forEach((t=>{n[t]=e.getAttribute(t)})),e[l]=n},R=(e,t)=>{if(!F(e))return;let n=ie(e);t.forEach((t=>{((e,t,n)=>{n?e.setAttribute(t,n):e.removeAttribute(t)})(e,t,n[t])}))},ae=(e,t,n)=>{E(e,t.class_applied),b(e,p),n&&(t.unobserve_completed&&O(e,t),T(t.callback_applied,e,n))},oe=(e,t,n)=>{E(e,t.class_loading),b(e,d),n&&(k(n,1),T(t.callback_loading,e,n))},z=(e,t,n)=>{n&&e.setAttribute(t,n)},se=(e,t)=>{z(e,s,v(e,t.data_sizes)),z(e,o,v(e,t.data_srcset)),z(e,`src`,v(e,t.data_src))},ce={IMG:(e,t)=>{j(e,(e=>{L(e,P),se(e,t)})),L(e,P),se(e,t)},IFRAME:(e,t)=>{L(e,M),z(e,`src`,v(e,t.data_src))},VIDEO:(e,t)=>
4{ne(e,(e=>{L(e,M),z(e,`src`,v(e,t.data_src))})),L(e,N),z(e,c,v(e,t.data_poster)),z(e,`src`,v(e,t.data_src)),e.load()},OBJECT:(e,t)=>{L(e,re),z(e,u,v(e,t.data_src))}},B=[`IMG`,`IFRAME`,`VIDEO`,`OBJECT`],le=(e,t)=>{!t||(e=>e.loadingCount>0)(t)||(e=>e.toLoadCount>0)(t)||T(e.callback_finish,t)},ue=(e,t,n)=>{e.addEventListener(t,n),e.llEvLisnrs[t]=n},de=(e,t,n)=>{e.removeEventListener(t,n)},fe=e=>!!e.llEvLisnrs,pe=e=>{if(!fe(e))return;let t=e.llEvLisnrs;for(let n in t){let r=t[n];de(e,n,r)}delete e.llEvLisnrs},me=(e,t,n)=>{(e=>{delete e.llTempImage})(e),k(n,-1),(e=>{e&&--e.toLoadCount})(n),D(e,t.class_loading),t.unobserve_completed&&O(e,n)},he=(e,t,n)=>{let r=ee(e)||e;fe(r)||((e,t,n)=>{fe(e)||(e.llEvLisnrs={});let r=e.tagName===`VIDEO`?`loadeddata`:`load`;ue(e,r,t),ue(e,`error`,n)})(r,(i=>{((e,t,n,r)=>{let i=C(t);me(t,n,r),E(t,n.class_loaded),b(t,f),T(n.callback_loaded,t,r),i||le(n,r)})(0,e,t,n),pe(r)}),(i=>{((e,t,n,r)=>{let i=C(t);me(t,n,r),E(t,n.class_error),b(t,m),T(n.callback_error,t,r),n.restore_on_error&&R(t,P),i||le(n,r)})(0,e,t,n),pe(r)}))},ge=(e,t,r)=>{(e=>B.indexOf(e.tagName)>-1)(e)?((e,t,n)=>{he(e,t,n),((e,t,n)=>{let r=ce[e.tagName];r&&(r(e,t),oe(e,t,n))})(e,t,n)})(e,t,r):((e,t,r)=>{(e=>{e.llTempImage=document.createElement(`IMG`)})(e),he(e,t,r),(e=>{F(e)||(e[l]={backgroundImage:e.style.backgroundImage})})(e),((e,t,r)=>{let i=v(e,t.data_bg),a=v(e,t.data_bg_hidpi),o=n&&a?a:i;o&&(e.style.backgroundImage=`url("${o}")`,ee(e).setAttribute(`src`,o),oe(e,t,r))})(e,t,r),((e,t,r)=>{let i=v(e,t.data_bg_multi),a=v(e,t.data_bg_multi_hidpi),o=n&&a?a:i;o&&(e.style.backgroundImage=o,ae(e,t,r))})(e,t,r),((e,t,n)=>{let r=v(e,t.data_bg_set);if(!r)return;let i=r.split(`|`).map((e=>`image-set(${e})`));e.style.backgroundImage=i.join(),ae(e,t,n)})(e,t,r)})(e,t,r)},_e=e=>{e.removeAttribute(`src`),e.removeAttribute(o),e.removeAttribute(s)},V=e=>{j(e,(e=>{R(e,P)})),R(e,P)},ve={IMG:V,IFRAME:e=>{R(e,M)},VIDEO:e=>{ne(e,(e=>{R(e,M)})),R(e,N),e.load()},OBJECT:e=>{R(e,re)}},ye=(e,t)=>{(e=>{let t=ve[e.tagName];t?t(e):(e=>{if(!F(e))return;let t=ie(e);e.style.backgroundImage=t.backgroundImage})(e)})(e),((e,t)=>{S(e)||C(e)||(D(e,t.class_entered),D(e,t.class_exited),D(e,t.class_applied),D(e,t.class_loading),D(e,t.class_loaded),D(e,t.class_error))})(e,t),x(e),I(e)},be=[`IMG`,`IFRAME`,`VIDEO`],xe=e=>e.use_native&&`loading`in HTMLImageElement.prototype,H=(e,t,n)=>{e.forEach((e=>(e=>e.isIntersecting||e.intersectionRatio>0)(e)?((e,t,n,r)=>{let i=(e=>w.indexOf(y(e))>=0)(e);b(e,`entered`),E(e,n.class_entered),D(e,n.class_exited),((e,t,n)=>{t.unobserve_entered&&O(e,n)})(e,n,r),T(n.callback_enter,e,t,r),i||ge(e,n,r)})(e.target,e,t,n):((e,t,n,r)=>{S(e)||(E(e,n.class_exited),((e,t,n,r)=>{n.cancel_on_exit&&(e=>y(e)===d)(e)&&e.tagName===`IMG`&&(pe(e),(e=>{j(e,(e=>{_e(e)})),_e(e)})(e),V(e),D(e,n.class_loading),k(r,-1),x(e),T(n.callback_cancel,e,t,r))})(e,t,n,r),T(n.callback_exit,e,t,r))})(e.target,e,t,n)))},U=e=>Array.prototype.slice.call(e),W=e=>e.container.querySelectorAll(e.elements_selector),Se=e=>(e=>y(e)===m)(e),G=(e,t)=>(e=>U(e).filter(S))(e||W(t)),K=function(t,n){let r=i(t);this._settings=r,this.loadingCount=0,((e,t)=>{xe(e)||(t._observer=new IntersectionObserver((n=>{H(n,e,t)}),(e=>({root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+`px`}))(e)))})(r,this),((t,n)=>{e&&(n._onlineHandler=()=>{((e,t)=>
4{var n;(n=W(e),U(n).filter(Se)).forEach((t=>{D(t,e.class_error),x(t)})),t.update()})(t,n)},window.addEventListener(`online`,n._onlineHandler))})(r,this),this.update(n)};return K.prototype={update:function(e){let n=this._settings,r=G(e,n);var i,a;te(this,r.length),t?this.loadAll(r):xe(n)?((e,t,n)=>{e.forEach((e=>{be.indexOf(e.tagName)!==-1&&((e,t,n)=>{e.setAttribute(`loading`,`lazy`),he(e,t,n),((e,t)=>{let n=ce[e.tagName];n&&n(e,t)})(e,t),b(e,h)})(e,t,n)})),te(n,0)})(r,n,this):(a=r,(e=>{e.disconnect()})(i=this._observer),((e,t)=>{t.forEach((t=>{e.observe(t)}))})(i,a))},destroy:function(){this._observer&&this._observer.disconnect(),e&&window.removeEventListener(`online`,this._onlineHandler),W(this._settings).forEach((e=>{I(e)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){let t=this._settings;G(e,t).forEach((e=>{O(e,this),ge(e,t,this)}))},restoreAll:function(){let e=this._settings;W(e).forEach((t=>{ye(t,e)}))}},K.load=(e,t)=>{let n=i(t);ge(e,n)},K.resetStatus=e=>{x(e)},e&&((e,t)=>{if(t){if(t.length)for(let n,r=0;n=t[r];r+=1)a(e,n);else a(e,t)}})(K,window.lazyLoadOptions),K}))}))(),1),vn=()=>{loadjs.ready(`app`,()=>{let e={},t=!1,n=getUrlParam(`gclid`).length>0||getUrlParam(`ivclid`).length>0,r=getUrlParam(`source`)||getUrlParam(`utm_source`);r.length>0&&(t=!0,e.utm_source=r),getUrlParam(`mbsy`).length>0&&(t=!0,e.mbsy_short_code=getUrlParam(`mbsy`),getUrlParam(`campaignid`).length>0&&(e.mbsy_campaign_id=getUrlParam(`campaignid`))),[`utm_campaign`,`utm_term`,`utm_content`,`utm_medium`,`utm_campaign_id`,`promotion`,`project`,`data1`,`data2`,`data3`].forEach(n=>{getUrlParam(n).length>0&&(t=!0,e[n]=getUrlParam(n))});let i=document.referrer,a=i.length>0&&i.indexOf(location.protocol+`//`+location.host)!==0;if(a&&(t=!0,e.ref=i),(document.cookie.indexOf(`init_session=`)===-1||a||n)&&(t=!0,e.entry_url=window.location.href),window.location.pathname===`/widgets/visa-checker`&&(t=!1),t){let t=`?`+new URLSearchParams(e).toString();axios.get(route(`public.layout-config`)+t).then(()=>{setTimeout(()=>{loadjs.done(`welcome`)},100)})}else loadjs.done(`welcome`)})},yn=()=>{loadjs.ready(`welcome`,()=>{bn()})};function bn(){window.self===window.top&&window.Cookies.get(`discountBannerHidden`)===void 0&&window.Cookies.get(`promo_code`)!==void 0&&axios.post(route(`public.promo-code-banner`)).then(e=>{if(e.data.show_banner===!1)return;let t=document.getElementById(`v2-discount-banner-container`);if(t!==null){t.style.display=`flex`,document.querySelector(`#promo-banner-text`).innerHTML=e.data.discount_text_translated;let n=document.querySelector(`#promo-banner-logo`);n!==null&&(n.style.display=`block`,n.src=e.data.affiliate_logo_url)}})}var xn=()=>{Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(t!==null&&t.nodeType===1);return null})};function Sn(e,t){return e==null||e.length<2?``:e.substring(0,8)===`https://`?(e=e.replace(/[&\s]+$/,``),e.indexOf(`?`)===-1&&e.slice(-4)===`.com`&&(e+=`/`),e+=(e.indexOf(`?`)===-1?`?`:`&`)+t,e):alert(`URL must start with https://`)}function Cn(e){let t;document.selection?(t=document.body.createTextRange(),t.moveToElementText(document.getElementById(e)),t.select()):window.getSelection&&(t=document.createRange(),t.selectNode(document.getElementById(e)),window.getSelection().empty(),window.getSelection().addRange(t)),document.execCommand(`copy`)}async function wn(){if(Xt(`egtt`)===null)return null;let e=Tn();return e===`none`?null:e===null?await En():e}function Tn(){if(Jt()===!1)return`none`;let e=localStorage.getItem(`affiliateLogoTimeout`);return e===null?null:e<=Date.now()?`none`:localStorage.getItem(`affiliateLogoUrl`)}async function En(){let e=await(await axios.get(route(`public.affiliate.get_logo`))).data.header_logo;localStorage.setItem(`affiliateLogoUrl`,e??`none`);let t=Date.now()+36e5;return localStorage.setItem(`affiliateLogoTimeout`,t.toString()),e}function Dn(e){let t=document.querySelector(`.feature-logo`);if(e.endsWith(`exoticca.png`)){t.parentElement.classList.remove(`v2-hidden`),t.innerHTML=`<img alt='Feature Logo' width='90' height='28' src=${e}>`,document.querySelector(`#loginBtn`)?.classList.add(`v2-hidden`);return}t.innerHTML=`<img alt='Feature Logo' width='125' height='28' src=${e}>`}var On=async()=>{let e=await wn();e!==null&&Dn(e)};function kn(){try{let e=[`ivisa:prepay:`,`statsigExposures:`,`feedbackModalSeen:`],t=[];for(let n=0;n<localStorage.length;n++){let r=localStorage.key(n);r!==null&&e.some(e=>r.startsWith(e))&&t.push(r)}
4t.forEach(e=>localStorage.removeItem(e)),localStorage.removeItem(`affiliateLogoUrl`),localStorage.removeItem(`affiliateLogoTimeout`)}catch{}}window.getUrlParam=function(e){var t=RegExp(`[?&]`+e+`=([^&#]*)`,`i`).exec(window.location.href);return t===null?``:t[1]},window.isAdminDomain!==!0&&(vn(),yn(),xn()),window.iVisaAlertModal=e=>{let t=document.getElementById(`alert-modal-v2`);if(t!==null){t.classList.remove(`v2-hidden`);let n=document.getElementById(`alert-modal-title-v2`),r=document.getElementById(`alert-modal-text-v2`),i=document.getElementById(`alert-modal-markdown-v2`),a=document.getElementById(`alert-button-label-v2`),o=document.getElementById(`local-error-debug`),s=document.getElementById(`local-error-debug-content`);n!==null&&(n.innerText=e.title),a!==null&&(a.innerText=e.buttonLabel),s!==null&&(o?.classList.remove(`v2-hidden`),s.innerText=e.debug),i!==null&&(e.markdown?(i.classList.remove(`v2-hidden`),i.innerHTML=e.markdown):r!==null&&(r.innerText=e.text))}},window.swal=(...t)=>o(()=>import(`./sweetalert.min-_xbKaVtq-30fea673.js`).then(t=>e(t.default,1)).then(e=>{let n=e.default;return n(...t)}),__vite__mapDeps([2,1]),import.meta.url),window.route=be,window.lang=r,window.getText=i,window.imgSrc=xe,window.formatCurrency=s,window.build_affiliate_link=Sn,window.copy_text=Cn,window.set_affiliate_logo=On,window.clearAllOnDeviceUserData=kn,window.formatCurrencyElements=function(){document.querySelectorAll(`[data-format-currency]`).forEach(e=>{let{currency:t,amount:n}=e.dataset;t&&n!=null&&n!==``&&(e.textContent=s(t,n))})};var An=`vite-preload-error-reload`;if(window.addEventListener(`vite-hard-reload-required`,()=>{let e=!1;try{e=sessionStorage.getItem(An)===`1`}catch{return}if(e)return;try{sessionStorage.setItem(An,`1`)}catch{return}let t=new URL(window.location.href);t.searchParams.set(`nocache`,`1`),t.searchParams.set(`vitepreload`,`1`),window.location.assign(t.toString())}),window.addEventListener(`load`,()=>{try{sessionStorage.removeItem(An)}catch{}}),window.lazyloadInstance=new _n.default({elements_selector:`[data-src]`}),window.Sentry!==void 0){let e=console.error;console.error=function(...t){let n=t.shift()||`Empty console.error`,r=t.find(e=>e instanceof Error)??null;if(typeof n!=`string`){console.warn(`Object was passed to console.error`,n);return}n.startsWith(`[Vue Error]`)||(window.report_err(r,n,t),e(...t))}}export{xe as A,Lt as C,Et as D,wt as E,Ct as O,Rt as S,Ft as T,qt as _,dn as a,Ht as b,Jt as c,Qt as d,on as f,nn as g,tn as h,Xt as i,be as j,Tt as k,un as l,Zt as m,fn as n,cn as o,an as p,Yt as r,ln as s,Sn as t,en as u,Wt as v,zt as w,It as x,Ut as y};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.