var aliaCustomerApp=function(exports){"use strict";var cc=Object.defineProperty;var fc=(e,t,r)=>t in e?cc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Xe=(e,t,r)=>fc(e,typeof t!="symbol"?t+"":t,r);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var auto={},isArguments,hasRequiredIsArguments;function requireIsArguments(){if(hasRequiredIsArguments)return isArguments;hasRequiredIsArguments=1;var e=Object.prototype.toString;return isArguments=function(r){var n=e.call(r),i=n==="[object Arguments]";return i||(i=n!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&e.call(r.callee)==="[object Function]"),i},isArguments}var implementation$3,hasRequiredImplementation$3;function requireImplementation$3(){if(hasRequiredImplementation$3)return implementation$3;hasRequiredImplementation$3=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=requireIsArguments(),i=Object.prototype.propertyIsEnumerable,s=!i.call({toString:null},"toString"),l=i.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(w){var _=w.constructor;return _&&_.prototype===w},m={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},b=function(){if(typeof window>"u")return!1;for(var w in window)try{if(!m["$"+w]&&t.call(window,w)&&window[w]!==null&&typeof window[w]=="object")try{h(window[w])}catch{return!0}}catch{return!0}return!1}(),S=function(w){if(typeof window>"u"||!b)return h(w);try{return h(w)}catch{return!1}};e=function(_){var I=_!==null&&typeof _=="object",N=r.call(_)==="[object Function]",P=n(_),F=I&&r.call(_)==="[object String]",j=[];if(!I&&!N&&!P)throw new TypeError("Object.keys called on a non-object");var q=l&&N;if(F&&_.length>0&&!t.call(_,0))for(var f=0;f<_.length;++f)j.push(String(f));if(P&&_.length>0)for(var v=0;v<_.length;++v)j.push(String(v));else for(var g in _)!(q&&g==="prototype")&&t.call(_,g)&&j.push(String(g));if(s)for(var C=S(_),$=0;$3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var h=arguments.length>3?arguments[3]:null,m=arguments.length>4?arguments[4]:null,b=arguments.length>5?arguments[5]:null,S=arguments.length>6?arguments[6]:!1,w=!!n&&n(s,l);if(e)e(s,l,{configurable:b===null&&w?w.configurable:!b,enumerable:h===null&&w?w.enumerable:!h,value:c,writable:m===null&&w?w.writable:!m});else if(S||!h&&!m&&!b)s[l]=c;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},defineDataProperty}var hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors;function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var e=requireEsDefineProperty(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},hasPropertyDescriptors_1=t,hasPropertyDescriptors_1}var defineProperties_1,hasRequiredDefineProperties;function requireDefineProperties(){if(hasRequiredDefineProperties)return defineProperties_1;hasRequiredDefineProperties=1;var e=requireObjectKeys(),t=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",r=Object.prototype.toString,n=Array.prototype.concat,i=requireDefineDataProperty(),s=function(m){return typeof m=="function"&&r.call(m)==="[object Function]"},l=requireHasPropertyDescriptors()(),c=function(m,b,S,w){if(b in m){if(w===!0){if(m[b]===S)return}else if(!s(w)||!w())return}l?i(m,b,S,!0):i(m,b,S)},h=function(m,b){var S=arguments.length>2?arguments[2]:{},w=e(b);t&&(w=n.call(w,Object.getOwnPropertySymbols(b)));for(var _=0;_-1e3&&k<1e3||g.call(/e/,L))return L;var pe=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof k=="number"){var ye=k<0?-A(-k):A(k);if(ye!==k){var Te=String(ye),be=j.call(L,Te.length+1);return q.call(Te,pe,"$&_")+"."+q.call(q.call(be,/([0-9]{3})/g,"$&_"),/_$/,"")}}return q.call(L,pe,"$&_")}var oe=require$$0,ae=oe.custom,D=Be(ae)?ae:null,ne={__proto__:null,double:'"',single:"'"},xe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};objectInspect=function k(L,pe,ye,Te){var be=pe||{};if(U(be,"quoteStyle")&&!U(ne,be.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(U(be,"maxStringLength")&&(typeof be.maxStringLength=="number"?be.maxStringLength<0&&be.maxStringLength!==1/0:be.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Fe=U(be,"customInspect")?be.customInspect:!0;if(typeof Fe!="boolean"&&Fe!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(U(be,"indent")&&be.indent!==null&&be.indent!==" "&&!(parseInt(be.indent,10)===be.indent&&be.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(U(be,"numericSeparator")&&typeof be.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Le=be.numericSeparator;if(typeof L>"u")return"undefined";if(L===null)return"null";if(typeof L=="boolean")return L?"true":"false";if(typeof L=="string")return it(L,be);if(typeof L=="number"){if(L===0)return 1/0/L>0?"0":"-0";var ze=String(L);return Le?W(L,ze):ze}if(typeof L=="bigint"){var Ke=String(L)+"n";return Le?W(L,Ke):Ke}var kt=typeof be.depth>"u"?5:be.depth;if(typeof ye>"u"&&(ye=0),ye>=kt&&kt>0&&typeof L=="object")return we(L)?"[Array]":"[Object]";var Vt=E(be,ye);if(typeof Te>"u")Te=[];else if(ue(Te,L)>=0)return"[Circular]";function _t(yr,Fr,uo){if(Fr&&(Te=R.call(Te),Te.push(Fr)),uo){var Pn={depth:be.depth};return U(be,"quoteStyle")&&(Pn.quoteStyle=be.quoteStyle),k(yr,Pn,ye+1,Te)}return k(yr,be,ye+1,Te)}if(typeof L=="function"&&!ve(L)){var Qr=G(L),Cn=se(L,_t);return"[Function"+(Qr?": "+Qr:" (anonymous)")+"]"+(Cn.length>0?" { "+$.call(Cn,", ")+" }":"")}if(Be(L)){var hr=J?q.call(String(L),/^(Symbol\(.*\))_[^)]*$/,"$1"):K.call(L);return typeof L=="object"&&!J?ft(hr):hr}if(et(L)){for(var nr="<"+v.call(String(L.nodeName)),or=L.attributes||[],Yr=0;Yr",nr}if(we(L)){if(L.length===0)return"[]";var ar=se(L,_t);return Vt&&!Dt(ar)?"["+Z(ar,Vt)+"]":"[ "+$.call(ar,", ")+" ]"}if(Ie(L)){var mr=se(L,_t);return!("cause"in Error.prototype)&&"cause"in L&&!T.call(L,"cause")?"{ ["+String(L)+"] "+$.call(C.call("[cause]: "+_t(L.cause),mr),", ")+" }":mr.length===0?"["+String(L)+"]":"{ ["+String(L)+"] "+$.call(mr,", ")+" }"}if(typeof L=="object"&&Fe){if(D&&typeof L[D]=="function"&&oe)return oe(L,{depth:kt-ye});if(Fe!=="symbol"&&typeof L.inspect=="function")return L.inspect()}if(le(L)){var jr=[];return n&&n.call(L,function(yr,Fr){jr.push(_t(Fr,L,!0)+" => "+_t(yr,L))}),ot("Map",r.call(L),jr,Vt)}if(Ne(L)){var Xr=[];return c&&c.call(L,function(yr){Xr.push(_t(yr,L))}),ot("Set",l.call(L),Xr,Vt)}if(ie(L))return Bt("WeakMap");if(je(L))return Bt("WeakSet");if(me(L))return Bt("WeakRef");if(qe(L))return ft(_t(Number(L)));if(mt(L))return ft(_t(M.call(L)));if(Je(L))return ft(I.call(L));if(De(L))return ft(_t(String(L)));if(typeof window<"u"&&L===window)return"{ [object Window] }";if(typeof globalThis<"u"&&L===globalThis||typeof commonjsGlobal<"u"&&L===commonjsGlobal)return"{ [object globalThis] }";if(!ge(L)&&!ve(L)){var _n=se(L,_t),io=Y?Y(L)===Object.prototype:L instanceof Object||L.constructor===Object,$n=L instanceof Object?"":"null prototype",Yt=!io&&ee&&Object(L)===L&&ee in L?j.call(V(L),8,-1):$n?"Object":"",so=io||typeof L.constructor!="function"?"":L.constructor.name?L.constructor.name+" ":"",Jr=so+(Yt||$n?"["+$.call(C.call([],Yt||[],$n||[]),": ")+"] ":"");return _n.length===0?Jr+"{}":Vt?Jr+"{"+Z(_n,Vt)+"}":Jr+"{ "+$.call(_n,", ")+" }"}return String(L)};function $e(k,L,pe){var ye=pe.quoteStyle||L,Te=ne[ye];return Te+k+Te}function Ee(k){return q.call(String(k),/"/g,""")}function we(k){return V(k)==="[object Array]"&&(!ee||!(typeof k=="object"&&ee in k))}function ge(k){return V(k)==="[object Date]"&&(!ee||!(typeof k=="object"&&ee in k))}function ve(k){return V(k)==="[object RegExp]"&&(!ee||!(typeof k=="object"&&ee in k))}function Ie(k){return V(k)==="[object Error]"&&(!ee||!(typeof k=="object"&&ee in k))}function De(k){return V(k)==="[object String]"&&(!ee||!(typeof k=="object"&&ee in k))}function qe(k){return V(k)==="[object Number]"&&(!ee||!(typeof k=="object"&&ee in k))}function Je(k){return V(k)==="[object Boolean]"&&(!ee||!(typeof k=="object"&&ee in k))}function Be(k){if(J)return k&&typeof k=="object"&&k instanceof Symbol;if(typeof k=="symbol")return!0;if(!k||typeof k!="object"||!K)return!1;try{return K.call(k),!0}catch{}return!1}function mt(k){if(!k||typeof k!="object"||!M)return!1;try{return M.call(k),!0}catch{}return!1}var wt=Object.prototype.hasOwnProperty||function(k){return k in this};function U(k,L){return wt.call(k,L)}function V(k){return N.call(k)}function G(k){if(k.name)return k.name;var L=F.call(P.call(k),/^function\s*([\w$]+)/);return L?L[1]:null}function ue(k,L){if(k.indexOf)return k.indexOf(L);for(var pe=0,ye=k.length;peL.maxStringLength){var pe=k.length-L.maxStringLength,ye="... "+pe+" more character"+(pe>1?"s":"");return it(j.call(k,0,L.maxStringLength),L)+ye}var Te=xe[L.quoteStyle||"single"];Te.lastIndex=0;var be=q.call(q.call(k,Te,"\\$1"),/[\x00-\x1f]/g,St);return $e(be,"single",L)}function St(k){var L=k.charCodeAt(0),pe={8:"b",9:"t",10:"n",12:"f",13:"r"}[L];return pe?"\\"+pe:"\\x"+(L<16?"0":"")+f.call(L.toString(16))}function ft(k){return"Object("+k+")"}function Bt(k){return k+" { ? }"}function ot(k,L,pe,ye){var Te=ye?Z(pe,ye):$.call(pe,", ");return k+" ("+L+") {"+Te+"}"}function Dt(k){for(var L=0;L=0)return!1;return!0}function E(k,L){var pe;if(k.indent===" ")pe=" ";else if(typeof k.indent=="number"&&k.indent>0)pe=$.call(Array(k.indent+1)," ");else return null;return{base:pe,prev:$.call(Array(L+1),pe)}}function Z(k,L){if(k.length===0)return"";var pe=` `+L.prev+L.base;return pe+$.call(k,","+pe)+` `+L.prev}function se(k,L){var pe=we(k),ye=[];if(pe){ye.length=k.length;for(var Te=0;Te"u")return"Undefined";if(typeof t=="function"||typeof t=="object")return"Object";if(typeof t=="number")return"Number";if(typeof t=="boolean")return"Boolean";if(typeof t=="string")return"String"}),Type$2}var Type$1,hasRequiredType;function requireType(){if(hasRequiredType)return Type$1;hasRequiredType=1;var e=requireType$1();return Type$1=function(r){return typeof r=="symbol"?"Symbol":typeof r=="bigint"?"BigInt":e(r)},Type$1}var Get,hasRequiredGet$1;function requireGet$1(){if(hasRequiredGet$1)return Get;hasRequiredGet$1=1;var e=requireType$2(),t=requireObjectInspect(),r=requireIsPropertyKey(),n=requireType();return Get=function(s,l){if(n(s)!=="Object")throw new e("Assertion failed: Type(O) is not Object");if(!r(l))throw new e("Assertion failed: IsPropertyKey(P) is not true, got "+t(l));return s[l]},Get}var maxSafeInteger,hasRequiredMaxSafeInteger;function requireMaxSafeInteger(){return hasRequiredMaxSafeInteger||(hasRequiredMaxSafeInteger=1,maxSafeInteger=Number.MAX_SAFE_INTEGER||9007199254740991),maxSafeInteger}var esObjectAtoms,hasRequiredEsObjectAtoms;function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms||(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object),esObjectAtoms}var esErrors,hasRequiredEsErrors;function requireEsErrors(){return hasRequiredEsErrors||(hasRequiredEsErrors=1,esErrors=Error),esErrors}var _eval,hasRequired_eval;function require_eval(){return hasRequired_eval||(hasRequired_eval=1,_eval=EvalError),_eval}var range,hasRequiredRange;function requireRange(){return hasRequiredRange||(hasRequiredRange=1,range=RangeError),range}var ref,hasRequiredRef;function requireRef(){return hasRequiredRef||(hasRequiredRef=1,ref=ReferenceError),ref}var uri,hasRequiredUri;function requireUri(){return hasRequiredUri||(hasRequiredUri=1,uri=URIError),uri}var abs,hasRequiredAbs;function requireAbs(){return hasRequiredAbs||(hasRequiredAbs=1,abs=Math.abs),abs}var floor$1,hasRequiredFloor$1;function requireFloor$1(){return hasRequiredFloor$1||(hasRequiredFloor$1=1,floor$1=Math.floor),floor$1}var max,hasRequiredMax;function requireMax(){return hasRequiredMax||(hasRequiredMax=1,max=Math.max),max}var min,hasRequiredMin;function requireMin(){return hasRequiredMin||(hasRequiredMin=1,min=Math.min),min}var pow,hasRequiredPow;function requirePow(){return hasRequiredPow||(hasRequiredPow=1,pow=Math.pow),pow}var shams$1,hasRequiredShams$1;function requireShams$1(){return hasRequiredShams$1||(hasRequiredShams$1=1,shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(t,r);if(c.value!==i||c.enumerable!==!0)return!1}return!0}),shams$1}var hasSymbols,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var e=typeof Symbol<"u"&&Symbol,t=requireShams$1();return hasSymbols=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},hasSymbols}var functionCall,hasRequiredFunctionCall;function requireFunctionCall(){return hasRequiredFunctionCall||(hasRequiredFunctionCall=1,functionCall=Function.prototype.call),functionCall}var functionApply,hasRequiredFunctionApply;function requireFunctionApply(){return hasRequiredFunctionApply||(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply),functionApply}var reflectApply,hasRequiredReflectApply;function requireReflectApply(){return hasRequiredReflectApply||(hasRequiredReflectApply=1,reflectApply=typeof Reflect<"u"&&Reflect&&Reflect.apply),reflectApply}var actualApply,hasRequiredActualApply;function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireFunctionCall(),n=requireReflectApply();return actualApply=n||e.call(r,t),actualApply}var callBindApplyHelpers,hasRequiredCallBindApplyHelpers;function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var e=requireFunctionBind(),t=requireType$2(),r=requireFunctionCall(),n=requireActualApply();return callBindApplyHelpers=function(s){if(s.length<1||typeof s[0]!="function")throw new t("a function is required");return n(e,r,s)},callBindApplyHelpers}var get$1,hasRequiredGet;function requireGet(){if(hasRequiredGet)return get$1;hasRequiredGet=1;var e=requireCallBindApplyHelpers(),t=requireGopd(),r=[].__proto__===Array.prototype,n=r&&t&&t(Object.prototype,"__proto__"),i=Object,s=i.getPrototypeOf;return get$1=n&&typeof n.get=="function"?e([n.get]):typeof s=="function"?function(c){return s(c==null?c:i(c))}:!1,get$1}var getIntrinsic,hasRequiredGetIntrinsic;function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;hasRequiredGetIntrinsic=1;var e,t=requireEsObjectAtoms(),r=requireEsErrors(),n=require_eval(),i=requireRange(),s=requireRef(),l=requireSyntax(),c=requireType$2(),h=requireUri(),m=requireAbs(),b=requireFloor$1(),S=requireMax(),w=requireMin(),_=requirePow(),I=Function,N=function(we){try{return I('"use strict"; return ('+we+").constructor;")()}catch{}},P=requireGopd(),F=requireEsDefineProperty(),j=function(){throw new c},q=P?function(){try{return arguments.callee,j}catch{try{return P(arguments,"callee").get}catch{return j}}}():j,f=requireHasSymbols()(),v=requireGet(),g=typeof Reflect=="function"&&Reflect.getPrototypeOf||t.getPrototypeOf||v,C=requireFunctionApply(),$=requireFunctionCall(),R={},A=typeof Uint8Array>"u"||!g?e:g(Uint8Array),M={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":f&&g?g([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":I,"%GeneratorFunction%":R,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&g?g(g([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!f||!g?e:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":P,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":s,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!f||!g?e:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&g?g(""[Symbol.iterator]()):e,"%Symbol%":f?Symbol:e,"%SyntaxError%":l,"%ThrowTypeError%":q,"%TypedArray%":A,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":h,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":$,"%Function.prototype.apply%":C,"%Object.defineProperty%":F,"%Math.abs%":m,"%Math.floor%":b,"%Math.max%":S,"%Math.min%":w,"%Math.pow%":_};if(g)try{null.error}catch(we){var re=g(g(we));M["%Error.prototype%"]=re}var K=function we(ge){var ve;if(ge==="%AsyncFunction%")ve=N("async function () {}");else if(ge==="%GeneratorFunction%")ve=N("function* () {}");else if(ge==="%AsyncGeneratorFunction%")ve=N("async function* () {}");else if(ge==="%AsyncGenerator%"){var Ie=we("%AsyncGeneratorFunction%");Ie&&(ve=Ie.prototype)}else if(ge==="%AsyncIteratorPrototype%"){var De=we("%AsyncGenerator%");De&&g&&(ve=g(De.prototype))}return M[ge]=ve,ve},J={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ee=requireFunctionBind(),T=requireHasown(),Y=ee.call($,Array.prototype.concat),W=ee.call(C,Array.prototype.splice),oe=ee.call($,String.prototype.replace),ae=ee.call($,String.prototype.slice),D=ee.call($,RegExp.prototype.exec),ne=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,xe=/\\(\\)?/g,$e=function(ge){var ve=ae(ge,0,1),Ie=ae(ge,-1);if(ve==="%"&&Ie!=="%")throw new l("invalid intrinsic syntax, expected closing `%`");if(Ie==="%"&&ve!=="%")throw new l("invalid intrinsic syntax, expected opening `%`");var De=[];return oe(ge,ne,function(qe,Je,Be,mt){De[De.length]=Be?oe(mt,xe,"$1"):Je||qe}),De},Ee=function(ge,ve){var Ie=ge,De;if(T(J,Ie)&&(De=J[Ie],Ie="%"+De[0]+"%"),T(M,Ie)){var qe=M[Ie];if(qe===R&&(qe=K(Ie)),typeof qe>"u"&&!ve)throw new c("intrinsic "+ge+" exists, but is not available. Please file an issue!");return{alias:De,name:Ie,value:qe}}throw new l("intrinsic "+ge+" does not exist!")};return getIntrinsic=function(ge,ve){if(typeof ge!="string"||ge.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ve!="boolean")throw new c('"allowMissing" argument must be a boolean');if(D(/^%?[^%]*%?$/,ge)===null)throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Ie=$e(ge),De=Ie.length>0?Ie[0]:"",qe=Ee("%"+De+"%",ve),Je=qe.name,Be=qe.value,mt=!1,wt=qe.alias;wt&&(De=wt[0],W(Ie,Y([0,1],wt)));for(var U=1,V=!0;U=Ie.length){var ie=P(Be,G);V=!!ie,V&&"get"in ie&&!("originalValue"in ie.get)?Be=ie.get:Be=Be[G]}else V=T(Be,G),Be=Be[G];V&&!mt&&(M[Je]=Be)}}return Be},getIntrinsic}var isPrimitive$2,hasRequiredIsPrimitive$1;function requireIsPrimitive$1(){return hasRequiredIsPrimitive$1||(hasRequiredIsPrimitive$1=1,isPrimitive$2=function(t){return t===null||typeof t!="function"&&typeof t!="object"}),isPrimitive$2}var isPrimitive$1,hasRequiredIsPrimitive;function requireIsPrimitive(){return hasRequiredIsPrimitive||(hasRequiredIsPrimitive=1,isPrimitive$1=function(t){return t===null||typeof t!="function"&&typeof t!="object"}),isPrimitive$1}var isCallable,hasRequiredIsCallable;function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(j){j!==n&&(t=null)}else t=null;var i=/^\s*class\b/,s=function(q){try{var f=e.call(q);return i.test(f)}catch{return!1}},l=function(q){try{return s(q)?!1:(e.call(q),!0)}catch{return!1}},c=Object.prototype.toString,h="[object Object]",m="[object Function]",b="[object GeneratorFunction]",S="[object HTMLAllCollection]",w="[object HTML document.all class]",_="[object HTMLCollection]",I=typeof Symbol=="function"&&!!Symbol.toStringTag,N=!(0 in[,]),P=function(){return!1};if(typeof document=="object"){var F=document.all;c.call(F)===c.call(document.all)&&(P=function(q){if((N||!q)&&(typeof q>"u"||typeof q=="object"))try{var f=c.call(q);return(f===S||f===w||f===_||f===h)&&q("")==null}catch{}return!1})}return isCallable=t?function(q){if(P(q))return!0;if(!q||typeof q!="function"&&typeof q!="object")return!1;try{t(q,null,r)}catch(f){if(f!==n)return!1}return!s(q)&&l(q)}:function(q){if(P(q))return!0;if(!q||typeof q!="function"&&typeof q!="object")return!1;if(I)return l(q);if(s(q))return!1;var f=c.call(q);return f!==m&&f!==b&&!/^\[object HTML/.test(f)?!1:l(q)},isCallable}var shams,hasRequiredShams;function requireShams(){if(hasRequiredShams)return shams;hasRequiredShams=1;var e=requireShams$1();return shams=function(){return e()&&!!Symbol.toStringTag},shams}var isDateObject$1,hasRequiredIsDateObject;function requireIsDateObject(){if(hasRequiredIsDateObject)return isDateObject$1;hasRequiredIsDateObject=1;var e=Date.prototype.getDay,t=function(l){try{return e.call(l),!0}catch{return!1}},r=Object.prototype.toString,n="[object Date]",i=requireShams()();return isDateObject$1=function(l){return typeof l!="object"||l===null?!1:i?t(l):r.call(l)===n},isDateObject$1}var isSymbol={exports:{}},hasRequiredIsSymbol;function requireIsSymbol(){if(hasRequiredIsSymbol)return isSymbol.exports;hasRequiredIsSymbol=1;var e=Object.prototype.toString,t=requireHasSymbols()();if(t){var r=Symbol.prototype.toString,n=/^Symbol\(.*\)$/,i=function(l){return typeof l.valueOf()!="symbol"?!1:n.test(r.call(l))};isSymbol.exports=function(l){if(typeof l=="symbol")return!0;if(e.call(l)!=="[object Symbol]")return!1;try{return i(l)}catch{return!1}}}else isSymbol.exports=function(l){return!1};return isSymbol.exports}var es2015,hasRequiredEs2015;function requireEs2015(){if(hasRequiredEs2015)return es2015;hasRequiredEs2015=1;var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",t=requireIsPrimitive(),r=requireIsCallable(),n=requireIsDateObject(),i=requireIsSymbol(),s=function(h,m){if(typeof h>"u"||h===null)throw new TypeError("Cannot call method on "+h);if(typeof m!="string"||m!=="number"&&m!=="string")throw new TypeError('hint must be "string" or "number"');var b=m==="string"?["toString","valueOf"]:["valueOf","toString"],S,w,_;for(_=0;_1&&(arguments[1]===String?m="string":arguments[1]===Number&&(m="number"));var b;if(e&&(Symbol.toPrimitive?b=l(h,Symbol.toPrimitive):i(h)&&(b=Symbol.prototype.valueOf)),typeof b<"u"){var S=b.call(h,m);if(t(S))return S;throw new TypeError("unable to convert exotic object to primitive")}return m==="default"&&(n(h)||i(h))&&(m="string"),s(h,m==="default"?"number":m)},es2015}var ToPrimitive,hasRequiredToPrimitive;function requireToPrimitive(){if(hasRequiredToPrimitive)return ToPrimitive;hasRequiredToPrimitive=1;var e=requireEs2015();return ToPrimitive=function(r){return arguments.length>1?e(r,arguments[1]):e(r)},ToPrimitive}var callBind={exports:{}},setFunctionLength,hasRequiredSetFunctionLength;function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var e=requireGetIntrinsic(),t=requireDefineDataProperty(),r=requireHasPropertyDescriptors()(),n=requireGopd(),i=requireType$2(),s=e("%Math.floor%");return setFunctionLength=function(c,h){if(typeof c!="function")throw new i("`fn` is not a function");if(typeof h!="number"||h<0||h>4294967295||s(h)!==h)throw new i("`length` must be a positive 32-bit integer");var m=arguments.length>2&&!!arguments[2],b=!0,S=!0;if("length"in c&&n){var w=n(c,"length");w&&!w.configurable&&(b=!1),w&&!w.writable&&(S=!1)}return(b||S||!m)&&(r?t(c,"length",h,!0,!0):t(c,"length",h)),c},setFunctionLength}var applyBind,hasRequiredApplyBind;function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireActualApply();return applyBind=function(){return r(e,t,arguments)},applyBind}var hasRequiredCallBind;function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,function(e){var t=requireSetFunctionLength(),r=requireEsDefineProperty(),n=requireCallBindApplyHelpers(),i=requireApplyBind();e.exports=function(l){var c=n(arguments),h=l.length-(arguments.length-1);return t(c,1+(h>0?h:0),!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i}(callBind)),callBind.exports}var callBound,hasRequiredCallBound;function requireCallBound(){if(hasRequiredCallBound)return callBound;hasRequiredCallBound=1;var e=requireGetIntrinsic(),t=requireCallBind(),r=t(e("String.prototype.indexOf"));return callBound=function(i,s){var l=e(i,!!s);return typeof l=="function"&&r(i,".prototype.")>-1?t(l):l},callBound}var isRegex$1,hasRequiredIsRegex;function requireIsRegex(){if(hasRequiredIsRegex)return isRegex$1;hasRequiredIsRegex=1;var e=requireCallBound(),t=requireShams()(),r,n,i,s;if(t){r=e("Object.prototype.hasOwnProperty"),n=e("RegExp.prototype.exec"),i={};var l=function(){throw i};s={toString:l,valueOf:l},typeof Symbol.toPrimitive=="symbol"&&(s[Symbol.toPrimitive]=l)}var c=e("Object.prototype.toString"),h=Object.getOwnPropertyDescriptor,m="[object RegExp]";return isRegex$1=t?function(S){if(!S||typeof S!="object")return!1;var w=h(S,"lastIndex"),_=w&&r(w,"value");if(!_)return!1;try{n(S,s)}catch(I){return I===i}}:function(S){return!S||typeof S!="object"&&typeof S!="function"?!1:c(S)===m},isRegex$1}var safeRegexTest,hasRequiredSafeRegexTest;function requireSafeRegexTest(){if(hasRequiredSafeRegexTest)return safeRegexTest;hasRequiredSafeRegexTest=1;var e=requireCallBound(),t=requireIsRegex(),r=e("RegExp.prototype.exec"),n=requireType$2();return safeRegexTest=function(s){if(!t(s))throw new n("`regex` must be a RegExp");return function(c){return r(s,c)!==null}},safeRegexTest}var RequireObjectCoercible,hasRequiredRequireObjectCoercible;function requireRequireObjectCoercible(){if(hasRequiredRequireObjectCoercible)return RequireObjectCoercible;hasRequiredRequireObjectCoercible=1;var e=requireType$2();return RequireObjectCoercible=function(r){if(r==null)throw new e(arguments.length>0&&arguments[1]||"Cannot call method on "+r);return r},RequireObjectCoercible}var ToString,hasRequiredToString;function requireToString(){if(hasRequiredToString)return ToString;hasRequiredToString=1;var e=requireGetIntrinsic(),t=e("%String%"),r=requireType$2();return ToString=function(i){if(typeof i=="symbol")throw new r("Cannot convert a Symbol value to a string");return t(i)},ToString}var implementation$1,hasRequiredImplementation$1;function requireImplementation$1(){if(hasRequiredImplementation$1)return implementation$1;hasRequiredImplementation$1=1;var e=requireRequireObjectCoercible(),t=requireToString(),r=requireCallBound(),n=r("String.prototype.replace"),i=/^\s$/.test("᠎"),s=i?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,l=i?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;return implementation$1=function(){var h=t(e(this));return n(n(h,s,""),l,"")},implementation$1}var polyfill$1,hasRequiredPolyfill$1;function requirePolyfill$1(){if(hasRequiredPolyfill$1)return polyfill$1;hasRequiredPolyfill$1=1;var e=requireImplementation$1(),t="​",r="᠎";return polyfill$1=function(){return String.prototype.trim&&t.trim()===t&&r.trim()===r&&("_"+r).trim()==="_"+r&&(r+"_").trim()===r+"_"?String.prototype.trim:e},polyfill$1}var shim$2,hasRequiredShim$2;function requireShim$2(){if(hasRequiredShim$2)return shim$2;hasRequiredShim$2=1;var e=requireDefineProperties(),t=requirePolyfill$1();return shim$2=function(){var n=t();return e(String.prototype,{trim:n},{trim:function(){return String.prototype.trim!==n}}),n},shim$2}var string_prototype_trim,hasRequiredString_prototype_trim;function requireString_prototype_trim(){if(hasRequiredString_prototype_trim)return string_prototype_trim;hasRequiredString_prototype_trim=1;var e=requireCallBind(),t=requireDefineProperties(),r=requireRequireObjectCoercible(),n=requireImplementation$1(),i=requirePolyfill$1(),s=requireShim$2(),l=e(i()),c=function(m){return r(m),l(m)};return t(c,{getPolyfill:i,implementation:n,shim:s}),string_prototype_trim=c,string_prototype_trim}var StringToNumber,hasRequiredStringToNumber;function requireStringToNumber(){if(hasRequiredStringToNumber)return StringToNumber;hasRequiredStringToNumber=1;var e=requireGetIntrinsic(),t=e("%Number%"),r=e("%RegExp%"),n=requireType$2(),i=e("%parseInt%"),s=requireCallBound(),l=requireSafeRegexTest(),c=s("String.prototype.slice"),h=l(/^0b[01]+$/i),m=l(/^0o[0-7]+$/i),b=l(/^[-+]0x[0-9a-f]+$/i),S=["…","​","￾"].join(""),w=new r("["+S+"]","g"),_=l(w),I=requireString_prototype_trim();return StringToNumber=function N(P){if(typeof P!="string")throw new n("Assertion failed: `argument` is not a String");if(h(P))return t(i(c(P,2),2));if(m(P))return t(i(c(P,2),8));if(_(P)||b(P))return NaN;var F=I(P);return F!==P?N(F):t(P)},StringToNumber}var ToNumber,hasRequiredToNumber;function requireToNumber(){if(hasRequiredToNumber)return ToNumber;hasRequiredToNumber=1;var e=requireGetIntrinsic(),t=requireType$2(),r=e("%Number%"),n=requireIsPrimitive$1(),i=requireToPrimitive(),s=requireStringToNumber();return ToNumber=function(c){var h=n(c)?c:i(c,r);if(typeof h=="symbol")throw new t("Cannot convert a Symbol value to a number");if(typeof h=="bigint")throw new t("Conversion from 'BigInt' to 'number' is not allowed.");return typeof h=="string"?s(h):r(h)},ToNumber}var floor,hasRequiredFloor;function requireFloor(){if(hasRequiredFloor)return floor;hasRequiredFloor=1;var e=Math.floor;return floor=function(r){return typeof r=="bigint"?r:e(r)},floor}var truncate,hasRequiredTruncate;function requireTruncate(){if(hasRequiredTruncate)return truncate;hasRequiredTruncate=1;var e=requireFloor(),t=requireType$2();return truncate=function(n){if(typeof n!="number"&&typeof n!="bigint")throw new t("argument must be a Number or a BigInt");var i=n<0?-e(-n):e(n);return i===0?0:i},truncate}var _isNaN,hasRequired_isNaN;function require_isNaN(){return hasRequired_isNaN||(hasRequired_isNaN=1,_isNaN=Number.isNaN||function(t){return t!==t}),_isNaN}var _isFinite,hasRequired_isFinite;function require_isFinite(){if(hasRequired_isFinite)return _isFinite;hasRequired_isFinite=1;var e=require_isNaN();return _isFinite=function(t){return(typeof t=="number"||typeof t=="bigint")&&!e(t)&&t!==1/0&&t!==-1/0},_isFinite}var ToIntegerOrInfinity,hasRequiredToIntegerOrInfinity;function requireToIntegerOrInfinity(){if(hasRequiredToIntegerOrInfinity)return ToIntegerOrInfinity;hasRequiredToIntegerOrInfinity=1;var e=requireToNumber(),t=requireTruncate(),r=require_isNaN(),n=require_isFinite();return ToIntegerOrInfinity=function(s){var l=e(s);return r(l)||l===0?0:n(l)?t(l):l},ToIntegerOrInfinity}var ToLength,hasRequiredToLength;function requireToLength(){if(hasRequiredToLength)return ToLength;hasRequiredToLength=1;var e=requireMaxSafeInteger(),t=requireToIntegerOrInfinity();return ToLength=function(n){var i=t(n);return i<=0?0:i>e?e:i},ToLength}var LengthOfArrayLike,hasRequiredLengthOfArrayLike;function requireLengthOfArrayLike(){if(hasRequiredLengthOfArrayLike)return LengthOfArrayLike;hasRequiredLengthOfArrayLike=1;var e=requireType$2(),t=requireGet$1(),r=requireToLength(),n=requireType();return LengthOfArrayLike=function(s){if(n(s)!=="Object")throw new e("Assertion failed: `obj` must be an Object");return r(t(s,"length"))},LengthOfArrayLike}var ToObject,hasRequiredToObject;function requireToObject(){if(hasRequiredToObject)return ToObject;hasRequiredToObject=1;var e=requireEsObjectAtoms(),t=requireRequireObjectCoercible();return ToObject=function(n){return t(n),e(n)},ToObject}var implementation,hasRequiredImplementation;function requireImplementation(){if(hasRequiredImplementation)return implementation;hasRequiredImplementation=1;var e=requireGet$1(),t=requireLengthOfArrayLike(),r=requireToIntegerOrInfinity(),n=requireToObject(),i=requireToString();return implementation=function(l){var c=n(this),h=t(c),m=r(l),b=m>=0?m:h+m;if(!(b<0||b>=h))return e(c,i(b))},implementation}var polyfill,hasRequiredPolyfill;function requirePolyfill(){if(hasRequiredPolyfill)return polyfill;hasRequiredPolyfill=1;var e=requireImplementation();return polyfill=function(){return Array.prototype.at||e},polyfill}var shim$1,hasRequiredShim$1;function requireShim$1(){if(hasRequiredShim$1)return shim$1;hasRequiredShim$1=1;var e=requireDefineProperties(),t=requireEsShimUnscopables(),r=requirePolyfill();return shim$1=function(){var i=r();return e(Array.prototype,{at:i},{at:function(){return Array.prototype.at!==i}}),t("at"),i},shim$1}var hasRequiredAuto;function requireAuto(){return hasRequiredAuto||(hasRequiredAuto=1,requireShim$1()()),auto}requireAuto();var client={},reactDom={exports:{}},reactDom_production_min={},react={exports:{}},react_production_min={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredReact_production_min;function requireReact_production_min(){if(hasRequiredReact_production_min)return react_production_min;hasRequiredReact_production_min=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),S=Symbol.iterator;function w(D){return D===null||typeof D!="object"?null:(D=S&&D[S]||D["@@iterator"],typeof D=="function"?D:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I=Object.assign,N={};function P(D,ne,xe){this.props=D,this.context=ne,this.refs=N,this.updater=xe||_}P.prototype.isReactComponent={},P.prototype.setState=function(D,ne){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,ne,"setState")},P.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function F(){}F.prototype=P.prototype;function j(D,ne,xe){this.props=D,this.context=ne,this.refs=N,this.updater=xe||_}var q=j.prototype=new F;q.constructor=j,I(q,P.prototype),q.isPureReactComponent=!0;var f=Array.isArray,v=Object.prototype.hasOwnProperty,g={current:null},C={key:!0,ref:!0,__self:!0,__source:!0};function $(D,ne,xe){var $e,Ee={},we=null,ge=null;if(ne!=null)for($e in ne.ref!==void 0&&(ge=ne.ref),ne.key!==void 0&&(we=""+ne.key),ne)v.call(ne,$e)&&!C.hasOwnProperty($e)&&(Ee[$e]=ne[$e]);var ve=arguments.length-2;if(ve===1)Ee.children=xe;else if(1>>1,ne=W[D];if(0>>1;Di(Ee,ae))wei(ge,Ee)?(W[D]=ge,W[we]=ae,D=we):(W[D]=Ee,W[$e]=ae,D=$e);else if(wei(ge,ae))W[D]=ge,W[we]=ae,D=we;else break e}}return oe}function i(W,oe){var ae=W.sortIndex-oe.sortIndex;return ae!==0?ae:W.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var h=[],m=[],b=1,S=null,w=3,_=!1,I=!1,N=!1,P=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function q(W){for(var oe=r(m);oe!==null;){if(oe.callback===null)n(m);else if(oe.startTime<=W)n(m),oe.sortIndex=oe.expirationTime,t(h,oe);else break;oe=r(m)}}function f(W){if(N=!1,q(W),!I)if(r(h)!==null)I=!0,T(v);else{var oe=r(m);oe!==null&&Y(f,oe.startTime-W)}}function v(W,oe){I=!1,N&&(N=!1,F($),$=-1),_=!0;var ae=w;try{for(q(oe),S=r(h);S!==null&&(!(S.expirationTime>oe)||W&&!M());){var D=S.callback;if(typeof D=="function"){S.callback=null,w=S.priorityLevel;var ne=D(S.expirationTime<=oe);oe=e.unstable_now(),typeof ne=="function"?S.callback=ne:S===r(h)&&n(h),q(oe)}else n(h);S=r(h)}if(S!==null)var xe=!0;else{var $e=r(m);$e!==null&&Y(f,$e.startTime-oe),xe=!1}return xe}finally{S=null,w=ae,_=!1}}var g=!1,C=null,$=-1,R=5,A=-1;function M(){return!(e.unstable_now()-AW||125D?(W.sortIndex=ae,t(m,W),r(h)===null&&W===r(m)&&(N?(F($),$=-1):N=!0,Y(f,ae-D))):(W.sortIndex=ne,t(h,W),I||_||(I=!0,T(v))),W},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(W){var oe=w;return function(){var ae=w;w=oe;try{return W.apply(this,arguments)}finally{w=ae}}}}(scheduler_production_min)),scheduler_production_min}var hasRequiredScheduler;function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,scheduler.exports=requireScheduler_production_min()),scheduler.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredReactDom_production_min;function requireReactDom_production_min(){if(hasRequiredReactDom_production_min)return reactDom_production_min;hasRequiredReactDom_production_min=1;var e=requireReact(),t=requireScheduler();function r(o){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+o,u=1;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,m=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,b={},S={};function w(o){return h.call(S,o)?!0:h.call(b,o)?!1:m.test(o)?S[o]=!0:(b[o]=!0,!1)}function _(o,a,u,d){if(u!==null&&u.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return d?!1:u!==null?!u.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function I(o,a,u,d){if(a===null||typeof a>"u"||_(o,a,u,d))return!0;if(d)return!1;if(u!==null)switch(u.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function N(o,a,u,d,p,y,x){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=d,this.attributeNamespace=p,this.mustUseProperty=u,this.propertyName=o,this.type=a,this.sanitizeURL=y,this.removeEmptyString=x}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){P[o]=new N(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var a=o[0];P[a]=new N(a,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){P[o]=new N(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){P[o]=new N(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){P[o]=new N(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){P[o]=new N(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){P[o]=new N(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){P[o]=new N(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){P[o]=new N(o,5,!1,o.toLowerCase(),null,!1,!1)});var F=/[\-:]([a-z])/g;function j(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var a=o.replace(F,j);P[a]=new N(a,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var a=o.replace(F,j);P[a]=new N(a,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var a=o.replace(F,j);P[a]=new N(a,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){P[o]=new N(o,1,!1,o.toLowerCase(),null,!1,!1)}),P.xlinkHref=new N("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){P[o]=new N(o,1,!1,o.toLowerCase(),null,!0,!0)});function q(o,a,u,d){var p=P.hasOwnProperty(a)?P[a]:null;(p!==null?p.type!==0:d||!(2O||p[x]!==y[O]){var B=` `+p[x].replace(" at new "," at ");return o.displayName&&B.includes("")&&(B=B.replace("",o.displayName)),B}while(1<=x&&0<=O);break}}}finally{xe=!1,Error.prepareStackTrace=u}return(o=o?o.displayName||o.name:"")?ne(o):""}function Ee(o){switch(o.tag){case 5:return ne(o.type);case 16:return ne("Lazy");case 13:return ne("Suspense");case 19:return ne("SuspenseList");case 0:case 2:case 15:return o=$e(o.type,!1),o;case 11:return o=$e(o.type.render,!1),o;case 1:return o=$e(o.type,!0),o;default:return""}}function we(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case C:return"Fragment";case g:return"Portal";case R:return"Profiler";case $:return"StrictMode";case K:return"Suspense";case J:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case M:return(o.displayName||"Context")+".Consumer";case A:return(o._context.displayName||"Context")+".Provider";case re:var a=o.render;return o=o.displayName,o||(o=a.displayName||a.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case ee:return a=o.displayName||null,a!==null?a:we(o.type)||"Memo";case T:a=o._payload,o=o._init;try{return we(o(a))}catch{}}return null}function ge(o){var a=o.type;switch(o.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=a.render,o=o.displayName||o.name||"",a.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return we(a);case 8:return a===$?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function ve(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ie(o){var a=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function De(o){var a=Ie(o)?"checked":"value",u=Object.getOwnPropertyDescriptor(o.constructor.prototype,a),d=""+o[a];if(!o.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,y=u.set;return Object.defineProperty(o,a,{configurable:!0,get:function(){return p.call(this)},set:function(x){d=""+x,y.call(this,x)}}),Object.defineProperty(o,a,{enumerable:u.enumerable}),{getValue:function(){return d},setValue:function(x){d=""+x},stopTracking:function(){o._valueTracker=null,delete o[a]}}}}function qe(o){o._valueTracker||(o._valueTracker=De(o))}function Je(o){if(!o)return!1;var a=o._valueTracker;if(!a)return!0;var u=a.getValue(),d="";return o&&(d=Ie(o)?o.checked?"true":"false":o.value),o=d,o!==u?(a.setValue(o),!0):!1}function Be(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function mt(o,a){var u=a.checked;return ae({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??o._wrapperState.initialChecked})}function wt(o,a){var u=a.defaultValue==null?"":a.defaultValue,d=a.checked!=null?a.checked:a.defaultChecked;u=ve(a.value!=null?a.value:u),o._wrapperState={initialChecked:d,initialValue:u,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function U(o,a){a=a.checked,a!=null&&q(o,"checked",a,!1)}function V(o,a){U(o,a);var u=ve(a.value),d=a.type;if(u!=null)d==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+u):o.value!==""+u&&(o.value=""+u);else if(d==="submit"||d==="reset"){o.removeAttribute("value");return}a.hasOwnProperty("value")?ue(o,a.type,u):a.hasOwnProperty("defaultValue")&&ue(o,a.type,ve(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(o.defaultChecked=!!a.defaultChecked)}function G(o,a,u){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var d=a.type;if(!(d!=="submit"&&d!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+o._wrapperState.initialValue,u||a===o.value||(o.value=a),o.defaultValue=a}u=o.name,u!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,u!==""&&(o.name=u)}function ue(o,a,u){(a!=="number"||Be(o.ownerDocument)!==o)&&(u==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+u&&(o.defaultValue=""+u))}var le=Array.isArray;function ie(o,a,u,d){if(o=o.options,a){a={};for(var p=0;p"+a.valueOf().toString()+"",a=ft.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;a.firstChild;)o.appendChild(a.firstChild)}});function ot(o,a){if(a){var u=o.firstChild;if(u&&u===o.lastChild&&u.nodeType===3){u.nodeValue=a;return}}o.textContent=a}var Dt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},E=["Webkit","ms","Moz","O"];Object.keys(Dt).forEach(function(o){E.forEach(function(a){a=a+o.charAt(0).toUpperCase()+o.substring(1),Dt[a]=Dt[o]})});function Z(o,a,u){return a==null||typeof a=="boolean"||a===""?"":u||typeof a!="number"||a===0||Dt.hasOwnProperty(o)&&Dt[o]?(""+a).trim():a+"px"}function se(o,a){o=o.style;for(var u in a)if(a.hasOwnProperty(u)){var d=u.indexOf("--")===0,p=Z(u,a[u],d);u==="float"&&(u="cssFloat"),d?o.setProperty(u,p):o[u]=p}}var k=ae({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function L(o,a){if(a){if(k[o]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(r(137,o));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(r(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(r(61))}if(a.style!=null&&typeof a.style!="object")throw Error(r(62))}}function pe(o,a){if(o.indexOf("-")===-1)return typeof a.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ye=null;function Te(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var be=null,Fe=null,Le=null;function ze(o){if(o=Zn(o)){if(typeof be!="function")throw Error(r(280));var a=o.stateNode;a&&(a=ko(a),be(o.stateNode,o.type,a))}}function Ke(o){Fe?Le?Le.push(o):Le=[o]:Fe=o}function kt(){if(Fe){var o=Fe,a=Le;if(Le=Fe=null,ze(o),a)for(o=0;o>>=0,o===0?32:31-(El(o)/Il|0)|0}var fo=64,po=4194304;function En(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function ho(o,a){var u=o.pendingLanes;if(u===0)return 0;var d=0,p=o.suspendedLanes,y=o.pingedLanes,x=u&268435455;if(x!==0){var O=x&~p;O!==0?d=En(O):(y&=x,y!==0&&(d=En(y)))}else x=u&~p,x!==0?d=En(x):y!==0&&(d=En(y));if(d===0)return 0;if(a!==0&&a!==d&&(a&p)===0&&(p=d&-d,y=a&-a,p>=y||p===16&&(y&4194240)!==0))return a;if((d&4)!==0&&(d|=u&16),a=o.entangledLanes,a!==0)for(o=o.entanglements,a&=d;0u;u++)a.push(o);return a}function In(o,a,u){o.pendingLanes|=a,a!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,a=31-qt(a),o[a]=u}function Al(o,a){var u=o.pendingLanes&~a;o.pendingLanes=a,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=a,o.mutableReadLanes&=a,o.entangledLanes&=a,a=o.entanglements;var d=o.eventTimes;for(o=o.expirationTimes;0=jn),hs=" ",ms=!1;function ys(o,a){switch(o){case"keyup":return id.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gs(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var rn=!1;function ud(o,a){switch(o){case"compositionend":return gs(a);case"keypress":return a.which!==32?null:(ms=!0,hs);case"textInput":return o=a.data,o===hs&&ms?null:o;default:return null}}function ld(o,a){if(rn)return o==="compositionend"||!Ta&&ys(o,a)?(o=us(),bo=Ca=Sr=null,rn=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:u,offset:a-o};o=d}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=_s(u)}}function Ps(o,a){return o&&a?o===a?!0:o&&o.nodeType===3?!1:a&&a.nodeType===3?Ps(o,a.parentNode):"contains"in o?o.contains(a):o.compareDocumentPosition?!!(o.compareDocumentPosition(a)&16):!1:!1}function Es(){for(var o=window,a=Be();a instanceof o.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)o=a.contentWindow;else break;a=Be(o.document)}return a}function Aa(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a&&(a==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||a==="textarea"||o.contentEditable==="true")}function vd(o){var a=Es(),u=o.focusedElem,d=o.selectionRange;if(a!==u&&u&&u.ownerDocument&&Ps(u.ownerDocument.documentElement,u)){if(d!==null&&Aa(u)){if(a=d.start,o=d.end,o===void 0&&(o=a),"selectionStart"in u)u.selectionStart=a,u.selectionEnd=Math.min(o,u.value.length);else if(o=(a=u.ownerDocument||document)&&a.defaultView||window,o.getSelection){o=o.getSelection();var p=u.textContent.length,y=Math.min(d.start,p);d=d.end===void 0?y:Math.min(d.end,p),!o.extend&&y>d&&(p=d,d=y,y=p),p=$s(u,y);var x=$s(u,d);p&&x&&(o.rangeCount!==1||o.anchorNode!==p.node||o.anchorOffset!==p.offset||o.focusNode!==x.node||o.focusOffset!==x.offset)&&(a=a.createRange(),a.setStart(p.node,p.offset),o.removeAllRanges(),y>d?(o.addRange(a),o.extend(x.node,x.offset)):(a.setEnd(x.node,x.offset),o.addRange(a)))}}for(a=[],o=u;o=o.parentNode;)o.nodeType===1&&a.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u=document.documentMode,nn=null,Ra=null,zn=null,Oa=!1;function Is(o,a,u){var d=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Oa||nn==null||nn!==Be(d)||(d=nn,"selectionStart"in d&&Aa(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),zn&&Mn(zn,d)||(zn=d,d=Eo(Ra,"onSelect"),0ln||(o.current=Ha[ln],Ha[ln]=null,ln--)}function Ze(o,a){ln++,Ha[ln]=o.current,o.current=a}var $r={},yt=_r($r),$t=_r(!1),Mr=$r;function dn(o,a){var u=o.type.contextTypes;if(!u)return $r;var d=o.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===a)return d.__reactInternalMemoizedMaskedChildContext;var p={},y;for(y in u)p[y]=a[y];return d&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=a,o.__reactInternalMemoizedMaskedChildContext=p),p}function Pt(o){return o=o.childContextTypes,o!=null}function No(){Ge($t),Ge(yt)}function Vs(o,a,u){if(yt.current!==$r)throw Error(r(168));Ze(yt,a),Ze($t,u)}function qs(o,a,u){var d=o.stateNode;if(a=a.childContextTypes,typeof d.getChildContext!="function")return u;d=d.getChildContext();for(var p in d)if(!(p in a))throw Error(r(108,ge(o)||"Unknown",p));return ae({},u,d)}function Ao(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||$r,Mr=yt.current,Ze(yt,o),Ze($t,$t.current),!0}function Zs(o,a,u){var d=o.stateNode;if(!d)throw Error(r(169));u?(o=qs(o,a,Mr),d.__reactInternalMemoizedMergedChildContext=o,Ge($t),Ge(yt),Ze(yt,o)):Ge($t),Ze($t,u)}var sr=null,Ro=!1,Ga=!1;function Hs(o){sr===null?sr=[o]:sr.push(o)}function kd(o){Ro=!0,Hs(o)}function Pr(){if(!Ga&&sr!==null){Ga=!0;var o=0,a=Ve;try{var u=sr;for(Ve=1;o>=x,p-=x,ur=1<<32-qt(a)+p|u<Oe?(ct=Re,Re=null):ct=Re.sibling;var Ue=de(Q,Re,X[Oe],he);if(Ue===null){Re===null&&(Re=ct);break}o&&Re&&Ue.alternate===null&&a(Q,Re),H=y(Ue,H,Oe),Ae===null?ke=Ue:Ae.sibling=Ue,Ae=Ue,Re=ct}if(Oe===X.length)return u(Q,Re),We&&Ur(Q,Oe),ke;if(Re===null){for(;OeOe?(ct=Re,Re=null):ct=Re.sibling;var Dr=de(Q,Re,Ue.value,he);if(Dr===null){Re===null&&(Re=ct);break}o&&Re&&Dr.alternate===null&&a(Q,Re),H=y(Dr,H,Oe),Ae===null?ke=Dr:Ae.sibling=Dr,Ae=Dr,Re=ct}if(Ue.done)return u(Q,Re),We&&Ur(Q,Oe),ke;if(Re===null){for(;!Ue.done;Oe++,Ue=X.next())Ue=fe(Q,Ue.value,he),Ue!==null&&(H=y(Ue,H,Oe),Ae===null?ke=Ue:Ae.sibling=Ue,Ae=Ue);return We&&Ur(Q,Oe),ke}for(Re=d(Q,Re);!Ue.done;Oe++,Ue=X.next())Ue=Se(Re,Q,Oe,Ue.value,he),Ue!==null&&(o&&Ue.alternate!==null&&Re.delete(Ue.key===null?Oe:Ue.key),H=y(Ue,H,Oe),Ae===null?ke=Ue:Ae.sibling=Ue,Ae=Ue);return o&&Re.forEach(function(dc){return a(Q,dc)}),We&&Ur(Q,Oe),ke}function nt(Q,H,X,he){if(typeof X=="object"&&X!==null&&X.type===C&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case v:e:{for(var ke=X.key,Ae=H;Ae!==null;){if(Ae.key===ke){if(ke=X.type,ke===C){if(Ae.tag===7){u(Q,Ae.sibling),H=p(Ae,X.props.children),H.return=Q,Q=H;break e}}else if(Ae.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===T&&iu(ke)===Ae.type){u(Q,Ae.sibling),H=p(Ae,X.props),H.ref=Hn(Q,Ae,X),H.return=Q,Q=H;break e}u(Q,Ae);break}else a(Q,Ae);Ae=Ae.sibling}X.type===C?(H=Kr(X.props.children,Q.mode,he,X.key),H.return=Q,Q=H):(he=sa(X.type,X.key,X.props,null,Q.mode,he),he.ref=Hn(Q,H,X),he.return=Q,Q=he)}return x(Q);case g:e:{for(Ae=X.key;H!==null;){if(H.key===Ae)if(H.tag===4&&H.stateNode.containerInfo===X.containerInfo&&H.stateNode.implementation===X.implementation){u(Q,H.sibling),H=p(H,X.children||[]),H.return=Q,Q=H;break e}else{u(Q,H);break}else a(Q,H);H=H.sibling}H=qi(X,Q.mode,he),H.return=Q,Q=H}return x(Q);case T:return Ae=X._init,nt(Q,H,Ae(X._payload),he)}if(le(X))return _e(Q,H,X,he);if(oe(X))return Pe(Q,H,X,he);Bo(Q,X)}return typeof X=="string"&&X!==""||typeof X=="number"?(X=""+X,H!==null&&H.tag===6?(u(Q,H.sibling),H=p(H,X),H.return=Q,Q=H):(u(Q,H),H=Vi(X,Q.mode,he),H.return=Q,Q=H),x(Q)):u(Q,H)}return nt}var yn=su(!0),uu=su(!1),Gn={},er=_r(Gn),Wn=_r(Gn),Kn=_r(Gn);function Vr(o){if(o===Gn)throw Error(r(174));return o}function si(o,a){switch(Ze(Kn,a),Ze(Wn,o),Ze(er,Gn),o=a.nodeType,o){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:St(null,"");break;default:o=o===8?a.parentNode:a,a=o.namespaceURI||null,o=o.tagName,a=St(a,o)}Ge(er),Ze(er,a)}function gn(){Ge(er),Ge(Wn),Ge(Kn)}function lu(o){Vr(Kn.current);var a=Vr(er.current),u=St(a,o.type);a!==u&&(Ze(Wn,o),Ze(er,u))}function ui(o){Wn.current===o&&(Ge(er),Ge(Wn))}var Qe=_r(0);function Vo(o){for(var a=o;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var li=[];function di(){for(var o=0;ou?u:4,o(!0);var d=ci.transition;ci.transition={};try{o(!1),a()}finally{Ve=u,ci.transition=d}}function Eu(){return Mt().memoizedState}function Od(o,a,u){var d=Ar(o);if(u={lane:d,action:u,hasEagerState:!1,eagerState:null,next:null},Iu(o))Tu(a,u);else if(u=Xs(o,a,u,d),u!==null){var p=Ct();Qt(u,o,d,p),ku(u,a,d)}}function Dd(o,a,u){var d=Ar(o),p={lane:d,action:u,hasEagerState:!1,eagerState:null,next:null};if(Iu(o))Tu(a,p);else{var y=o.alternate;if(o.lanes===0&&(y===null||y.lanes===0)&&(y=a.lastRenderedReducer,y!==null))try{var x=a.lastRenderedState,O=y(x,u);if(p.hasEagerState=!0,p.eagerState=O,Zt(O,x)){var B=a.interleaved;B===null?(p.next=p,ni(a)):(p.next=B.next,B.next=p),a.interleaved=p;return}}catch{}finally{}u=Xs(o,a,p,d),u!==null&&(p=Ct(),Qt(u,o,d,p),ku(u,a,d))}}function Iu(o){var a=o.alternate;return o===Ye||a!==null&&a===Ye}function Tu(o,a){Qn=Zo=!0;var u=o.pending;u===null?a.next=a:(a.next=u.next,u.next=a),o.pending=a}function ku(o,a,u){if((u&4194240)!==0){var d=a.lanes;d&=o.pendingLanes,u|=d,a.lanes=u,va(o,u)}}var Wo={readContext:Lt,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useInsertionEffect:gt,useLayoutEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useMutableSource:gt,useSyncExternalStore:gt,useId:gt,unstable_isNewReconciler:!1},jd={readContext:Lt,useCallback:function(o,a){return tr().memoizedState=[o,a===void 0?null:a],o},useContext:Lt,useEffect:bu,useImperativeHandle:function(o,a,u){return u=u!=null?u.concat([o]):null,Ho(4194308,4,xu.bind(null,a,o),u)},useLayoutEffect:function(o,a){return Ho(4194308,4,o,a)},useInsertionEffect:function(o,a){return Ho(4,2,o,a)},useMemo:function(o,a){var u=tr();return a=a===void 0?null:a,o=o(),u.memoizedState=[o,a],o},useReducer:function(o,a,u){var d=tr();return a=u!==void 0?u(a):a,d.memoizedState=d.baseState=a,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:a},d.queue=o,o=o.dispatch=Od.bind(null,Ye,o),[d.memoizedState,o]},useRef:function(o){var a=tr();return o={current:o},a.memoizedState=o},useState:gu,useDebugValue:vi,useDeferredValue:function(o){return tr().memoizedState=o},useTransition:function(){var o=gu(!1),a=o[0];return o=Rd.bind(null,o[1]),tr().memoizedState=o,[a,o]},useMutableSource:function(){},useSyncExternalStore:function(o,a,u){var d=Ye,p=tr();if(We){if(u===void 0)throw Error(r(407));u=u()}else{if(u=a(),dt===null)throw Error(r(349));(qr&30)!==0||fu(d,a,u)}p.memoizedState=u;var y={value:u,getSnapshot:a};return p.queue=y,bu(hu.bind(null,d,y,o),[o]),d.flags|=2048,Jn(9,pu.bind(null,d,y,u,a),void 0,null),u},useId:function(){var o=tr(),a=dt.identifierPrefix;if(We){var u=lr,d=ur;u=(d&~(1<<32-qt(d)-1)).toString(32)+u,a=":"+a+"R"+u,u=Yn++,0<\/script>",o=o.removeChild(o.firstChild)):typeof d.is=="string"?o=x.createElement(u,{is:d.is}):(o=x.createElement(u),u==="select"&&(x=o,d.multiple?x.multiple=!0:d.size&&(x.size=d.size))):o=x.createElementNS(o,u),o[Jt]=a,o[qn]=d,Gu(o,a,!1,!1),a.stateNode=o;e:{switch(x=pe(u,d),u){case"dialog":He("cancel",o),He("close",o),p=d;break;case"iframe":case"object":case"embed":He("load",o),p=d;break;case"video":case"audio":for(p=0;pSn&&(a.flags|=128,d=!0,eo(y,!1),a.lanes=4194304)}else{if(!d)if(o=Vo(x),o!==null){if(a.flags|=128,d=!0,u=o.updateQueue,u!==null&&(a.updateQueue=u,a.flags|=4),eo(y,!0),y.tail===null&&y.tailMode==="hidden"&&!x.alternate&&!We)return vt(a),null}else 2*rt()-y.renderingStartTime>Sn&&u!==1073741824&&(a.flags|=128,d=!0,eo(y,!1),a.lanes=4194304);y.isBackwards?(x.sibling=a.child,a.child=x):(u=y.last,u!==null?u.sibling=x:a.child=x,y.last=x)}return y.tail!==null?(a=y.tail,y.rendering=a,y.tail=a.sibling,y.renderingStartTime=rt(),a.sibling=null,u=Qe.current,Ze(Qe,d?u&1|2:u&1),a):(vt(a),null);case 22:case 23:return zi(),d=a.memoizedState!==null,o!==null&&o.memoizedState!==null!==d&&(a.flags|=8192),d&&(a.mode&1)!==0?(Ot&1073741824)!==0&&(vt(a),a.subtreeFlags&6&&(a.flags|=8192)):vt(a),null;case 24:return null;case 25:return null}throw Error(r(156,a.tag))}function qd(o,a){switch(Ka(a),a.tag){case 1:return Pt(a.type)&&No(),o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 3:return gn(),Ge($t),Ge(yt),di(),o=a.flags,(o&65536)!==0&&(o&128)===0?(a.flags=o&-65537|128,a):null;case 5:return ui(a),null;case 13:if(Ge(Qe),o=a.memoizedState,o!==null&&o.dehydrated!==null){if(a.alternate===null)throw Error(r(340));pn()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 19:return Ge(Qe),null;case 4:return gn(),null;case 10:return ti(a.type._context),null;case 22:case 23:return zi(),null;case 24:return null;default:return null}}var Yo=!1,bt=!1,Zd=typeof WeakSet=="function"?WeakSet:Set,Ce=null;function bn(o,a){var u=o.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(d){tt(o,a,d)}else u.current=null}function Ii(o,a,u){try{u()}catch(d){tt(o,a,d)}}var Qu=!1;function Hd(o,a){if(za=go,o=Es(),Aa(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{u=(u=o.ownerDocument)&&u.defaultView||window;var d=u.getSelection&&u.getSelection();if(d&&d.rangeCount!==0){u=d.anchorNode;var p=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var x=0,O=-1,B=-1,te=0,ce=0,fe=o,de=null;t:for(;;){for(var Se;fe!==u||p!==0&&fe.nodeType!==3||(O=x+p),fe!==y||d!==0&&fe.nodeType!==3||(B=x+d),fe.nodeType===3&&(x+=fe.nodeValue.length),(Se=fe.firstChild)!==null;)de=fe,fe=Se;for(;;){if(fe===o)break t;if(de===u&&++te===p&&(O=x),de===y&&++ce===d&&(B=x),(Se=fe.nextSibling)!==null)break;fe=de,de=fe.parentNode}fe=Se}u=O===-1||B===-1?null:{start:O,end:B}}else u=null}u=u||{start:0,end:0}}else u=null;for(Ua={focusedElem:o,selectionRange:u},go=!1,Ce=a;Ce!==null;)if(a=Ce,o=a.child,(a.subtreeFlags&1028)!==0&&o!==null)o.return=a,Ce=o;else for(;Ce!==null;){a=Ce;try{var _e=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(_e!==null){var Pe=_e.memoizedProps,nt=_e.memoizedState,Q=a.stateNode,H=Q.getSnapshotBeforeUpdate(a.elementType===a.type?Pe:Gt(a.type,Pe),nt);Q.__reactInternalSnapshotBeforeUpdate=H}break;case 3:var X=a.stateNode.containerInfo;X.nodeType===1?X.textContent="":X.nodeType===9&&X.documentElement&&X.removeChild(X.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(he){tt(a,a.return,he)}if(o=a.sibling,o!==null){o.return=a.return,Ce=o;break}Ce=a.return}return _e=Qu,Qu=!1,_e}function to(o,a,u){var d=a.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var p=d=d.next;do{if((p.tag&o)===o){var y=p.destroy;p.destroy=void 0,y!==void 0&&Ii(a,u,y)}p=p.next}while(p!==d)}}function Xo(o,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var u=a=a.next;do{if((u.tag&o)===o){var d=u.create;u.destroy=d()}u=u.next}while(u!==a)}}function Ti(o){var a=o.ref;if(a!==null){var u=o.stateNode;switch(o.tag){case 5:o=u;break;default:o=u}typeof a=="function"?a(o):a.current=o}}function Yu(o){var a=o.alternate;a!==null&&(o.alternate=null,Yu(a)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(a=o.stateNode,a!==null&&(delete a[Jt],delete a[qn],delete a[Za],delete a[Id],delete a[Td])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Xu(o){return o.tag===5||o.tag===3||o.tag===4}function Ju(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Xu(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function ki(o,a,u){var d=o.tag;if(d===5||d===6)o=o.stateNode,a?u.nodeType===8?u.parentNode.insertBefore(o,a):u.insertBefore(o,a):(u.nodeType===8?(a=u.parentNode,a.insertBefore(o,u)):(a=u,a.appendChild(o)),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=To));else if(d!==4&&(o=o.child,o!==null))for(ki(o,a,u),o=o.sibling;o!==null;)ki(o,a,u),o=o.sibling}function Ni(o,a,u){var d=o.tag;if(d===5||d===6)o=o.stateNode,a?u.insertBefore(o,a):u.appendChild(o);else if(d!==4&&(o=o.child,o!==null))for(Ni(o,a,u),o=o.sibling;o!==null;)Ni(o,a,u),o=o.sibling}var pt=null,Wt=!1;function Tr(o,a,u){for(u=u.child;u!==null;)el(o,a,u),u=u.sibling}function el(o,a,u){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(co,u)}catch{}switch(u.tag){case 5:bt||bn(u,a);case 6:var d=pt,p=Wt;pt=null,Tr(o,a,u),pt=d,Wt=p,pt!==null&&(Wt?(o=pt,u=u.stateNode,o.nodeType===8?o.parentNode.removeChild(u):o.removeChild(u)):pt.removeChild(u.stateNode));break;case 18:pt!==null&&(Wt?(o=pt,u=u.stateNode,o.nodeType===8?qa(o.parentNode,u):o.nodeType===1&&qa(o,u),Rn(o)):qa(pt,u.stateNode));break;case 4:d=pt,p=Wt,pt=u.stateNode.containerInfo,Wt=!0,Tr(o,a,u),pt=d,Wt=p;break;case 0:case 11:case 14:case 15:if(!bt&&(d=u.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){p=d=d.next;do{var y=p,x=y.destroy;y=y.tag,x!==void 0&&((y&2)!==0||(y&4)!==0)&&Ii(u,a,x),p=p.next}while(p!==d)}Tr(o,a,u);break;case 1:if(!bt&&(bn(u,a),d=u.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=u.memoizedProps,d.state=u.memoizedState,d.componentWillUnmount()}catch(O){tt(u,a,O)}Tr(o,a,u);break;case 21:Tr(o,a,u);break;case 22:u.mode&1?(bt=(d=bt)||u.memoizedState!==null,Tr(o,a,u),bt=d):Tr(o,a,u);break;default:Tr(o,a,u)}}function tl(o){var a=o.updateQueue;if(a!==null){o.updateQueue=null;var u=o.stateNode;u===null&&(u=o.stateNode=new Zd),a.forEach(function(d){var p=tc.bind(null,o,d);u.has(d)||(u.add(d),d.then(p,p))})}}function Kt(o,a){var u=a.deletions;if(u!==null)for(var d=0;dp&&(p=x),d&=~y}if(d=p,d=rt()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*Wd(d/1960))-d,10o?16:o,Nr===null)var d=!1;else{if(o=Nr,Nr=null,na=0,(Me&6)!==0)throw Error(r(331));var p=Me;for(Me|=4,Ce=o.current;Ce!==null;){var y=Ce,x=y.child;if((Ce.flags&16)!==0){var O=y.deletions;if(O!==null){for(var B=0;Brt()-Oi?Gr(o,0):Ri|=u),Tt(o,a)}function hl(o,a){a===0&&((o.mode&1)===0?a=1:(a=po,po<<=1,(po&130023424)===0&&(po=4194304)));var u=Ct();o=dr(o,a),o!==null&&(In(o,a,u),Tt(o,u))}function ec(o){var a=o.memoizedState,u=0;a!==null&&(u=a.retryLane),hl(o,u)}function tc(o,a){var u=0;switch(o.tag){case 13:var d=o.stateNode,p=o.memoizedState;p!==null&&(u=p.retryLane);break;case 19:d=o.stateNode;break;default:throw Error(r(314))}d!==null&&d.delete(a),hl(o,u)}var ml;ml=function(o,a,u){if(o!==null)if(o.memoizedProps!==a.pendingProps||$t.current)Et=!0;else{if((o.lanes&u)===0&&(a.flags&128)===0)return Et=!1,Bd(o,a,u);Et=(o.flags&131072)!==0}else Et=!1,We&&(a.flags&1048576)!==0&&Gs(a,Do,a.index);switch(a.lanes=0,a.tag){case 2:var d=a.type;Qo(o,a),o=a.pendingProps;var p=dn(a,yt.current);mn(a,u),p=pi(null,a,d,o,p,u);var y=hi();return a.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,Pt(d)?(y=!0,Ao(a)):y=!1,a.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,oi(a),p.updater=Uo,a.stateNode=p,p._reactInternals=a,ii(a,d,o,u),a=xi(null,a,d,!0,y,u)):(a.tag=0,We&&y&&Wa(a),xt(null,a,p,u),a=a.child),a;case 16:d=a.elementType;e:{switch(Qo(o,a),o=a.pendingProps,p=d._init,d=p(d._payload),a.type=d,p=a.tag=nc(d),o=Gt(d,o),p){case 0:a=Si(null,a,d,o,u);break e;case 1:a=Uu(null,a,d,o,u);break e;case 11:a=ju(null,a,d,o,u);break e;case 14:a=Fu(null,a,d,Gt(d.type,o),u);break e}throw Error(r(306,d,""))}return a;case 0:return d=a.type,p=a.pendingProps,p=a.elementType===d?p:Gt(d,p),Si(o,a,d,p,u);case 1:return d=a.type,p=a.pendingProps,p=a.elementType===d?p:Gt(d,p),Uu(o,a,d,p,u);case 3:e:{if(Bu(a),o===null)throw Error(r(387));d=a.pendingProps,y=a.memoizedState,p=y.element,Js(o,a),zo(a,d,null,u);var x=a.memoizedState;if(d=x.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:x.cache,pendingSuspenseBoundaries:x.pendingSuspenseBoundaries,transitions:x.transitions},a.updateQueue.baseState=y,a.memoizedState=y,a.flags&256){p=vn(Error(r(423)),a),a=Vu(o,a,d,u,p);break e}else if(d!==p){p=vn(Error(r(424)),a),a=Vu(o,a,d,u,p);break e}else for(Rt=Cr(a.stateNode.containerInfo.firstChild),At=a,We=!0,Ht=null,u=uu(a,null,d,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(pn(),d===p){a=fr(o,a,u);break e}xt(o,a,d,u)}a=a.child}return a;case 5:return lu(a),o===null&&Ya(a),d=a.type,p=a.pendingProps,y=o!==null?o.memoizedProps:null,x=p.children,Ba(d,p)?x=null:y!==null&&Ba(d,y)&&(a.flags|=32),zu(o,a),xt(o,a,x,u),a.child;case 6:return o===null&&Ya(a),null;case 13:return qu(o,a,u);case 4:return si(a,a.stateNode.containerInfo),d=a.pendingProps,o===null?a.child=yn(a,null,d,u):xt(o,a,d,u),a.child;case 11:return d=a.type,p=a.pendingProps,p=a.elementType===d?p:Gt(d,p),ju(o,a,d,p,u);case 7:return xt(o,a,a.pendingProps,u),a.child;case 8:return xt(o,a,a.pendingProps.children,u),a.child;case 12:return xt(o,a,a.pendingProps.children,u),a.child;case 10:e:{if(d=a.type._context,p=a.pendingProps,y=a.memoizedProps,x=p.value,Ze(Fo,d._currentValue),d._currentValue=x,y!==null)if(Zt(y.value,x)){if(y.children===p.children&&!$t.current){a=fr(o,a,u);break e}}else for(y=a.child,y!==null&&(y.return=a);y!==null;){var O=y.dependencies;if(O!==null){x=y.child;for(var B=O.firstContext;B!==null;){if(B.context===d){if(y.tag===1){B=cr(-1,u&-u),B.tag=2;var te=y.updateQueue;if(te!==null){te=te.shared;var ce=te.pending;ce===null?B.next=B:(B.next=ce.next,ce.next=B),te.pending=B}}y.lanes|=u,B=y.alternate,B!==null&&(B.lanes|=u),ri(y.return,u,a),O.lanes|=u;break}B=B.next}}else if(y.tag===10)x=y.type===a.type?null:y.child;else if(y.tag===18){if(x=y.return,x===null)throw Error(r(341));x.lanes|=u,O=x.alternate,O!==null&&(O.lanes|=u),ri(x,u,a),x=y.sibling}else x=y.child;if(x!==null)x.return=y;else for(x=y;x!==null;){if(x===a){x=null;break}if(y=x.sibling,y!==null){y.return=x.return,x=y;break}x=x.return}y=x}xt(o,a,p.children,u),a=a.child}return a;case 9:return p=a.type,d=a.pendingProps.children,mn(a,u),p=Lt(p),d=d(p),a.flags|=1,xt(o,a,d,u),a.child;case 14:return d=a.type,p=Gt(d,a.pendingProps),p=Gt(d.type,p),Fu(o,a,d,p,u);case 15:return Lu(o,a,a.type,a.pendingProps,u);case 17:return d=a.type,p=a.pendingProps,p=a.elementType===d?p:Gt(d,p),Qo(o,a),a.tag=1,Pt(d)?(o=!0,Ao(a)):o=!1,mn(a,u),ou(a,d,p),ii(a,d,p,u),xi(null,a,d,!0,o,u);case 19:return Hu(o,a,u);case 22:return Mu(o,a,u)}throw Error(r(156,a.tag))};function yl(o,a){return Pn(o,a)}function rc(o,a,u,d){this.tag=o,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ut(o,a,u,d){return new rc(o,a,u,d)}function Bi(o){return o=o.prototype,!(!o||!o.isReactComponent)}function nc(o){if(typeof o=="function")return Bi(o)?1:0;if(o!=null){if(o=o.$$typeof,o===re)return 11;if(o===ee)return 14}return 2}function Or(o,a){var u=o.alternate;return u===null?(u=Ut(o.tag,a,o.key,o.mode),u.elementType=o.elementType,u.type=o.type,u.stateNode=o.stateNode,u.alternate=o,o.alternate=u):(u.pendingProps=a,u.type=o.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=o.flags&14680064,u.childLanes=o.childLanes,u.lanes=o.lanes,u.child=o.child,u.memoizedProps=o.memoizedProps,u.memoizedState=o.memoizedState,u.updateQueue=o.updateQueue,a=o.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=o.sibling,u.index=o.index,u.ref=o.ref,u}function sa(o,a,u,d,p,y){var x=2;if(d=o,typeof o=="function")Bi(o)&&(x=1);else if(typeof o=="string")x=5;else e:switch(o){case C:return Kr(u.children,p,y,a);case $:x=8,p|=8;break;case R:return o=Ut(12,u,a,p|2),o.elementType=R,o.lanes=y,o;case K:return o=Ut(13,u,a,p),o.elementType=K,o.lanes=y,o;case J:return o=Ut(19,u,a,p),o.elementType=J,o.lanes=y,o;case Y:return ua(u,p,y,a);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case A:x=10;break e;case M:x=9;break e;case re:x=11;break e;case ee:x=14;break e;case T:x=16,d=null;break e}throw Error(r(130,o==null?o:typeof o,""))}return a=Ut(x,u,a,p),a.elementType=o,a.type=d,a.lanes=y,a}function Kr(o,a,u,d){return o=Ut(7,o,d,a),o.lanes=u,o}function ua(o,a,u,d){return o=Ut(22,o,d,a),o.elementType=Y,o.lanes=u,o.stateNode={isHidden:!1},o}function Vi(o,a,u){return o=Ut(6,o,null,a),o.lanes=u,o}function qi(o,a,u){return a=Ut(4,o.children!==null?o.children:[],o.key,a),a.lanes=u,a.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},a}function oc(o,a,u,d,p){this.tag=a,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ga(0),this.expirationTimes=ga(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ga(0),this.identifierPrefix=d,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Zi(o,a,u,d,p,y,x,O,B){return o=new oc(o,a,u,O,B),a===1?(a=1,y===!0&&(a|=8)):a=0,y=Ut(3,null,null,a),o.current=y,y.stateNode=o,y.memoizedState={element:d,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},oi(y),o}function ac(o,a,u){var d=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),reactDom.exports=requireReactDom_production_min(),reactDom.exports}var hasRequiredClient;function requireClient(){if(hasRequiredClient)return client;hasRequiredClient=1;var e=requireReactDom();return client.createRoot=e.createRoot,client.hydrateRoot=e.hydrateRoot,client}var clientExports=requireClient();const ReactDOM=getDefaultExportFromCjs(clientExports);class Subscribable{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){const r={listener:t};return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const isServer=typeof window>"u"||"Deno"in window;function noop$2(){}function functionalUpdate(e,t){return typeof e=="function"?e(t):e}function isValidTimeout(e){return typeof e=="number"&&e>=0&&e!==1/0}function timeUntilStale(e,t){return Math.max(e+(t||0)-Date.now(),0)}function parseQueryArgs(e,t,r){return isQueryKey(e)?typeof t=="function"?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function parseMutationArgs(e,t,r){return isQueryKey(e)?{...t,mutationKey:e}:typeof e=="function"?{...t,mutationFn:e}:{...e}}function parseFilterArgs(e,t,r){return isQueryKey(e)?[{...t,queryKey:e},r]:[e||{},t]}function matchQuery(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:l,stale:c}=e;if(isQueryKey(l)){if(n){if(t.queryHash!==hashQueryKeyByOptions(l,t.options))return!1}else if(!partialMatchKey(t.queryKey,l))return!1}if(r!=="all"){const h=t.isActive();if(r==="active"&&!h||r==="inactive"&&h)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||typeof i<"u"&&i!==t.state.fetchStatus||s&&!s(t))}function matchMutation(e,t){const{exact:r,fetching:n,predicate:i,mutationKey:s}=e;if(isQueryKey(s)){if(!t.options.mutationKey)return!1;if(r){if(hashQueryKey(t.options.mutationKey)!==hashQueryKey(s))return!1}else if(!partialMatchKey(t.options.mutationKey,s))return!1}return!(typeof n=="boolean"&&t.state.status==="loading"!==n||i&&!i(t))}function hashQueryKeyByOptions(e,t){return((t==null?void 0:t.queryKeyHashFn)||hashQueryKey)(e)}function hashQueryKey(e){return JSON.stringify(e,(t,r)=>isPlainObject$1(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function partialMatchKey(e,t){return partialDeepEqual(e,t)}function partialDeepEqual(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!partialDeepEqual(e[r],t[r])):!1}function replaceEqualDeep(e,t){if(e===t)return e;const r=isPlainArray(e)&&isPlainArray(t);if(r||isPlainObject$1(e)&&isPlainObject$1(t)){const n=r?e.length:Object.keys(e).length,i=r?t:Object.keys(t),s=i.length,l=r?[]:{};let c=0;for(let h=0;h"u")return!0;const r=t.prototype;return!(!hasObjectPrototype(r)||!r.hasOwnProperty("isPrototypeOf"))}function hasObjectPrototype(e){return Object.prototype.toString.call(e)==="[object Object]"}function isQueryKey(e){return Array.isArray(e)}function sleep(e){return new Promise(t=>{setTimeout(t,e)})}function scheduleMicrotask(e){sleep(0).then(e)}function getAbortController(){if(typeof AbortController=="function")return new AbortController}function replaceData(e,t,r){return r.isDataEqual!=null&&r.isDataEqual(e,t)?e:typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?replaceEqualDeep(e,t):t}class FocusManager extends Subscribable{constructor(){super(),this.setup=t=>{if(!isServer&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const focusManager=new FocusManager,onlineEvents=["online","offline"];class OnlineManager extends Subscribable{constructor(){super(),this.setup=t=>{if(!isServer&&window.addEventListener){const r=()=>t();return onlineEvents.forEach(n=>{window.addEventListener(n,r,!1)}),()=>{onlineEvents.forEach(n=>{window.removeEventListener(n,r)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(n=>{typeof n=="boolean"?this.setOnline(n):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const onlineManager=new OnlineManager;function defaultRetryDelay(e){return Math.min(1e3*2**e,3e4)}function canFetch(e){return(e??"online")==="online"?onlineManager.isOnline():!0}class CancelledError{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function isCancelledError(e){return e instanceof CancelledError}function createRetryer(e){let t=!1,r=0,n=!1,i,s,l;const c=new Promise((P,F)=>{s=P,l=F}),h=P=>{n||(_(new CancelledError(P)),e.abort==null||e.abort())},m=()=>{t=!0},b=()=>{t=!1},S=()=>!focusManager.isFocused()||e.networkMode!=="always"&&!onlineManager.isOnline(),w=P=>{n||(n=!0,e.onSuccess==null||e.onSuccess(P),i==null||i(),s(P))},_=P=>{n||(n=!0,e.onError==null||e.onError(P),i==null||i(),l(P))},I=()=>new Promise(P=>{i=F=>{const j=n||!S();return j&&P(F),j},e.onPause==null||e.onPause()}).then(()=>{i=void 0,n||e.onContinue==null||e.onContinue()}),N=()=>{if(n)return;let P;try{P=e.fn()}catch(F){P=Promise.reject(F)}Promise.resolve(P).then(w).catch(F=>{var j,q;if(n)return;const f=(j=e.retry)!=null?j:3,v=(q=e.retryDelay)!=null?q:defaultRetryDelay,g=typeof v=="function"?v(r,F):v,C=f===!0||typeof f=="number"&&r{if(S())return I()}).then(()=>{t?_(F):N()})})};return canFetch(e.networkMode)?N():I().then(N),{promise:c,cancel:h,continue:()=>(i==null?void 0:i())?c:Promise.resolve(),cancelRetry:m,continueRetry:b}}const defaultLogger=console;function createNotifyManager(){let e=[],t=0,r=b=>{b()},n=b=>{b()};const i=b=>{let S;t++;try{S=b()}finally{t--,t||c()}return S},s=b=>{t?e.push(b):scheduleMicrotask(()=>{r(b)})},l=b=>(...S)=>{s(()=>{b(...S)})},c=()=>{const b=e;e=[],b.length&&scheduleMicrotask(()=>{n(()=>{b.forEach(S=>{r(S)})})})};return{batch:i,batchCalls:l,schedule:s,setNotifyFunction:b=>{r=b},setBatchNotifyFunction:b=>{n=b}}}const notifyManager=createNotifyManager();class Removable{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(isServer?1/0:3e5))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class Query extends Removable{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||defaultLogger,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||getDefaultState$1(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,r){const n=replaceData(this.state.data,t,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){this.dispatch({type:"setState",state:t,setStateOptions:r})}cancel(t){var r;const n=this.promise;return(r=this.retryer)==null||r.cancel(t),n?n.then(noop$2).catch(noop$2):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!timeUntilStale(this.state.dataUpdatedAt,t)}onFocus(){var t;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r&&r.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,r){var n,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var s;return(s=this.retryer)==null||s.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const _=this.observers.find(I=>I.options.queryFn);_&&this.setOptions(_.options)}Array.isArray(this.options.queryKey);const l=getAbortController(),c={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},h=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>{if(l)return this.abortSignalConsumed=!0,l.signal}})};h(c);const m=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(c)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),b={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:m};if(h(b),(n=this.options.behavior)==null||n.onFetch(b),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=b.fetchOptions)==null?void 0:i.meta)){var S;this.dispatch({type:"fetch",meta:(S=b.fetchOptions)==null?void 0:S.meta})}const w=_=>{if(isCancelledError(_)&&_.silent||this.dispatch({type:"error",error:_}),!isCancelledError(_)){var I,N,P,F;(I=(N=this.cache.config).onError)==null||I.call(N,_,this),(P=(F=this.cache.config).onSettled)==null||P.call(F,this.state.data,_,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=createRetryer({fn:b.fetchFn,abort:l==null?void 0:l.abort.bind(l),onSuccess:_=>{var I,N,P,F;if(typeof _>"u"){w(new Error(this.queryHash+" data is undefined"));return}this.setData(_),(I=(N=this.cache.config).onSuccess)==null||I.call(N,_,this),(P=(F=this.cache.config).onSettled)==null||P.call(F,_,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:w,onFail:(_,I)=>{this.dispatch({type:"failed",failureCount:_,error:I})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:b.options.retry,retryDelay:b.options.retryDelay,networkMode:b.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const r=n=>{var i,s;switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:canFetch(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:(s=t.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const l=t.error;return isCancelledError(l)&&l.revert&&this.revertState?{...this.revertState}:{...n,error:l,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),notifyManager.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function getDefaultState$1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof t<"u",n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class QueryCache extends Subscribable{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,r,n){var i;const s=r.queryKey,l=(i=r.queryHash)!=null?i:hashQueryKeyByOptions(s,r);let c=this.get(l);return c||(c=new Query({cache:this,logger:t.getLogger(),queryKey:s,queryHash:l,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(c)),c}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const r=this.queriesMap[t.queryHash];r&&(t.destroy(),this.queries=this.queries.filter(n=>n!==t),r===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){notifyManager.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,r){const[n]=parseFilterArgs(t,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(i=>matchQuery(n,i))}findAll(t,r){const[n]=parseFilterArgs(t,r);return Object.keys(n).length>0?this.queries.filter(i=>matchQuery(n,i)):this.queries}notify(t){notifyManager.batch(()=>{this.listeners.forEach(({listener:r})=>{r(t)})})}onFocus(){notifyManager.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class Mutation extends Removable{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||defaultLogger,this.observers=[],this.state=t.state||getDefaultState(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(r=>r!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,r;return(t=(r=this.retryer)==null?void 0:r.continue())!=null?t:this.execute()}async execute(){const t=()=>{var C;return this.retryer=createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:($,R)=>{this.dispatch({type:"failed",failureCount:$,error:R})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(C=this.options.retry)!=null?C:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,i,s,l,c,h,m,b;if(!r){var S,w,_,I;this.dispatch({type:"loading",variables:this.options.variables}),await((S=(w=this.mutationCache.config).onMutate)==null?void 0:S.call(w,this.state.variables,this));const $=await((_=(I=this.options).onMutate)==null?void 0:_.call(I,this.state.variables));$!==this.state.context&&this.dispatch({type:"loading",context:$,variables:this.state.variables})}const C=await t();return await((n=(i=this.mutationCache.config).onSuccess)==null?void 0:n.call(i,C,this.state.variables,this.state.context,this)),await((s=(l=this.options).onSuccess)==null?void 0:s.call(l,C,this.state.variables,this.state.context)),await((c=(h=this.mutationCache.config).onSettled)==null?void 0:c.call(h,C,null,this.state.variables,this.state.context,this)),await((m=(b=this.options).onSettled)==null?void 0:m.call(b,C,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:C}),C}catch(C){try{var N,P,F,j,q,f,v,g;throw await((N=(P=this.mutationCache.config).onError)==null?void 0:N.call(P,C,this.state.variables,this.state.context,this)),await((F=(j=this.options).onError)==null?void 0:F.call(j,C,this.state.variables,this.state.context)),await((q=(f=this.mutationCache.config).onSettled)==null?void 0:q.call(f,void 0,C,this.state.variables,this.state.context,this)),await((v=(g=this.options).onSettled)==null?void 0:v.call(g,void 0,C,this.state.variables,this.state.context)),C}finally{this.dispatch({type:"error",error:C})}}}dispatch(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"loading":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!canFetch(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...n,...t.state}}};this.state=r(this.state),notifyManager.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class MutationCache extends Subscribable{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,r,n){const i=new Mutation({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(r),state:n,defaultOptions:r.mutationKey?t.getMutationDefaults(r.mutationKey):void 0});return this.add(i),i}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(r=>r!==t),this.notify({type:"removed",mutation:t})}clear(){notifyManager.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(r=>matchMutation(t,r))}findAll(t){return this.mutations.filter(r=>matchMutation(t,r))}notify(t){notifyManager.batch(()=>{this.listeners.forEach(({listener:r})=>{r(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const r=this.mutations.filter(n=>n.state.isPaused);return notifyManager.batch(()=>r.reduce((n,i)=>n.then(()=>i.continue().catch(noop$2)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function infiniteQueryBehavior(){return{onFetch:e=>{e.fetchFn=()=>{var t,r,n,i,s,l;const c=(t=e.fetchOptions)==null||(r=t.meta)==null?void 0:r.refetchPage,h=(n=e.fetchOptions)==null||(i=n.meta)==null?void 0:i.fetchMore,m=h==null?void 0:h.pageParam,b=(h==null?void 0:h.direction)==="forward",S=(h==null?void 0:h.direction)==="backward",w=((s=e.state.data)==null?void 0:s.pages)||[],_=((l=e.state.data)==null?void 0:l.pageParams)||[];let I=_,N=!1;const P=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>{var C;if((C=e.signal)!=null&&C.aborted)N=!0;else{var $;($=e.signal)==null||$.addEventListener("abort",()=>{N=!0})}return e.signal}})},F=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),j=(g,C,$,R)=>(I=R?[C,...I]:[...I,C],R?[$,...g]:[...g,$]),q=(g,C,$,R)=>{if(N)return Promise.reject("Cancelled");if(typeof $>"u"&&!C&&g.length)return Promise.resolve(g);const A={queryKey:e.queryKey,pageParam:$,meta:e.options.meta};P(A);const M=F(A);return Promise.resolve(M).then(K=>j(g,$,K,R))};let f;if(!w.length)f=q([]);else if(b){const g=typeof m<"u",C=g?m:getNextPageParam(e.options,w);f=q(w,g,C)}else if(S){const g=typeof m<"u",C=g?m:getPreviousPageParam(e.options,w);f=q(w,g,C,!0)}else{I=[];const g=typeof e.options.getNextPageParam>"u";f=(c&&w[0]?c(w[0],0,w):!0)?q([],g,_[0]):Promise.resolve(j([],_[0],w[0]));for(let $=1;${if(c&&w[$]?c(w[$],$,w):!0){const M=g?_[$]:getNextPageParam(e.options,R);return q(R,g,M)}return Promise.resolve(j(R,_[$],w[$]))})}return f.then(g=>({pages:g,pageParams:I}))}}}}function getNextPageParam(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function getPreviousPageParam(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class QueryClient{constructor(t={}){this.queryCache=t.queryCache||new QueryCache,this.mutationCache=t.mutationCache||new MutationCache,this.logger=t.logger||defaultLogger,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=focusManager.subscribe(()=>{focusManager.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=onlineManager.subscribe(()=>{onlineManager.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,r;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(t,r){const[n]=parseFilterArgs(t,r);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,r){var n;return(n=this.queryCache.find(t,r))==null?void 0:n.state.data}ensureQueryData(t,r,n){const i=parseQueryArgs(t,r,n),s=this.getQueryData(i.queryKey);return s?Promise.resolve(s):this.fetchQuery(i)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:r,state:n})=>{const i=n.data;return[r,i]})}setQueryData(t,r,n){const i=this.queryCache.find(t),s=i==null?void 0:i.state.data,l=functionalUpdate(r,s);if(typeof l>"u")return;const c=parseQueryArgs(t),h=this.defaultQueryOptions(c);return this.queryCache.build(this,h).setData(l,{...n,manual:!0})}setQueriesData(t,r,n){return notifyManager.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,r,n)]))}getQueryState(t,r){var n;return(n=this.queryCache.find(t,r))==null?void 0:n.state}removeQueries(t,r){const[n]=parseFilterArgs(t,r),i=this.queryCache;notifyManager.batch(()=>{i.findAll(n).forEach(s=>{i.remove(s)})})}resetQueries(t,r,n){const[i,s]=parseFilterArgs(t,r,n),l=this.queryCache,c={type:"active",...i};return notifyManager.batch(()=>(l.findAll(i).forEach(h=>{h.reset()}),this.refetchQueries(c,s)))}cancelQueries(t,r,n){const[i,s={}]=parseFilterArgs(t,r,n);typeof s.revert>"u"&&(s.revert=!0);const l=notifyManager.batch(()=>this.queryCache.findAll(i).map(c=>c.cancel(s)));return Promise.all(l).then(noop$2).catch(noop$2)}invalidateQueries(t,r,n){const[i,s]=parseFilterArgs(t,r,n);return notifyManager.batch(()=>{var l,c;if(this.queryCache.findAll(i).forEach(m=>{m.invalidate()}),i.refetchType==="none")return Promise.resolve();const h={...i,type:(l=(c=i.refetchType)!=null?c:i.type)!=null?l:"active"};return this.refetchQueries(h,s)})}refetchQueries(t,r,n){const[i,s]=parseFilterArgs(t,r,n),l=notifyManager.batch(()=>this.queryCache.findAll(i).filter(h=>!h.isDisabled()).map(h=>{var m;return h.fetch(void 0,{...s,cancelRefetch:(m=s==null?void 0:s.cancelRefetch)!=null?m:!0,meta:{refetchPage:i.refetchPage}})}));let c=Promise.all(l).then(noop$2);return s!=null&&s.throwOnError||(c=c.catch(noop$2)),c}fetchQuery(t,r,n){const i=parseQueryArgs(t,r,n),s=this.defaultQueryOptions(i);typeof s.retry>"u"&&(s.retry=!1);const l=this.queryCache.build(this,s);return l.isStaleByTime(s.staleTime)?l.fetch(s):Promise.resolve(l.state.data)}prefetchQuery(t,r,n){return this.fetchQuery(t,r,n).then(noop$2).catch(noop$2)}fetchInfiniteQuery(t,r,n){const i=parseQueryArgs(t,r,n);return i.behavior=infiniteQueryBehavior(),this.fetchQuery(i)}prefetchInfiniteQuery(t,r,n){return this.fetchInfiniteQuery(t,r,n).then(noop$2).catch(noop$2)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,r){const n=this.queryDefaults.find(i=>hashQueryKey(t)===hashQueryKey(i.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:t,defaultOptions:r})}getQueryDefaults(t){if(!t)return;const r=this.queryDefaults.find(n=>partialMatchKey(t,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(t,r){const n=this.mutationDefaults.find(i=>hashQueryKey(t)===hashQueryKey(i.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:t,defaultOptions:r})}getMutationDefaults(t){if(!t)return;const r=this.mutationDefaults.find(n=>partialMatchKey(t,n.mutationKey));return r==null?void 0:r.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const r={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=hashQueryKeyByOptions(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class QueryObserver extends Subscribable{constructor(t,r){super(),this.client=t,this.options=r,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(r)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),shouldFetchOnMount(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,r){const n=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),shallowEqualObjects(n,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),this.updateQuery();const s=this.hasListeners();s&&shouldFetchOptionally(this.currentQuery,i,this.options,n)&&this.executeFetch(),this.updateResult(r),s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&this.updateStaleTimeout();const l=this.computeRefetchInterval();s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||l!==this.currentRefetchInterval)&&this.updateRefetchInterval(l)}getOptimisticResult(t){const r=this.client.getQueryCache().build(this.client,t),n=this.createResult(r,t);return shouldAssignObserverCurrentProperties(this,n,t)&&(this.currentResult=n,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),n}getCurrentResult(){return this.currentResult}trackResult(t){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(n),t[n])})}),r}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...r}={}){return this.fetch({...r,meta:{refetchPage:t}})}fetchOptimistic(t){const r=this.client.defaultQueryOptions(t),n=this.client.getQueryCache().build(this.client,r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(t){var r;return this.executeFetch({...t,cancelRefetch:(r=t.cancelRefetch)!=null?r:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let r=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(noop$2)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),isServer||this.currentResult.isStale||!isValidTimeout(this.options.staleTime))return;const r=timeUntilStale(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},r)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(isServer||this.options.enabled===!1||!isValidTimeout(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,r){const n=this.currentQuery,i=this.options,s=this.currentResult,l=this.currentResultState,c=this.currentResultOptions,h=t!==n,m=h?t.state:this.currentQueryInitialState,b=h?this.currentResult:this.previousQueryResult,{state:S}=t;let{dataUpdatedAt:w,error:_,errorUpdatedAt:I,fetchStatus:N,status:P}=S,F=!1,j=!1,q;if(r._optimisticResults){const $=this.hasListeners(),R=!$&&shouldFetchOnMount(t,r),A=$&&shouldFetchOptionally(t,n,r,i);(R||A)&&(N=canFetch(t.options.networkMode)?"fetching":"paused",w||(P="loading")),r._optimisticResults==="isRestoring"&&(N="idle")}if(r.keepPreviousData&&!S.dataUpdatedAt&&b!=null&&b.isSuccess&&P!=="error")q=b.data,w=b.dataUpdatedAt,P=b.status,F=!0;else if(r.select&&typeof S.data<"u")if(s&&S.data===(l==null?void 0:l.data)&&r.select===this.selectFn)q=this.selectResult;else try{this.selectFn=r.select,q=r.select(S.data),q=replaceData(s==null?void 0:s.data,q,r),this.selectResult=q,this.selectError=null}catch($){this.selectError=$}else q=S.data;if(typeof r.placeholderData<"u"&&typeof q>"u"&&P==="loading"){let $;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(c==null?void 0:c.placeholderData))$=s.data;else if($=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof $<"u")try{$=r.select($),this.selectError=null}catch(R){this.selectError=R}typeof $<"u"&&(P="success",q=replaceData(s==null?void 0:s.data,$,r),j=!0)}this.selectError&&(_=this.selectError,q=this.selectResult,I=Date.now(),P="error");const f=N==="fetching",v=P==="loading",g=P==="error";return{status:P,fetchStatus:N,isLoading:v,isSuccess:P==="success",isError:g,isInitialLoading:v&&f,data:q,dataUpdatedAt:w,error:_,errorUpdatedAt:I,failureCount:S.fetchFailureCount,failureReason:S.fetchFailureReason,errorUpdateCount:S.errorUpdateCount,isFetched:S.dataUpdateCount>0||S.errorUpdateCount>0,isFetchedAfterMount:S.dataUpdateCount>m.dataUpdateCount||S.errorUpdateCount>m.errorUpdateCount,isFetching:f,isRefetching:f&&!v,isLoadingError:g&&S.dataUpdatedAt===0,isPaused:N==="paused",isPlaceholderData:j,isPreviousData:F,isRefetchError:g&&S.dataUpdatedAt!==0,isStale:isStale(t,r),refetch:this.refetch,remove:this.remove}}updateResult(t){const r=this.currentResult,n=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,shallowEqualObjects(n,r))return;this.currentResult=n;const i={cache:!0},s=()=>{if(!r)return!0;const{notifyOnChangeProps:l}=this.options,c=typeof l=="function"?l():l;if(c==="all"||!c&&!this.trackedProps.size)return!0;const h=new Set(c??this.trackedProps);return this.options.useErrorBoundary&&h.add("error"),Object.keys(this.currentResult).some(m=>{const b=m;return this.currentResult[b]!==r[b]&&h.has(b)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),this.notify({...i,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const r=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const r={};t.type==="success"?r.onSuccess=!t.manual:t.type==="error"&&!isCancelledError(t.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(t){notifyManager.batch(()=>{if(t.onSuccess){var r,n,i,s;(r=(n=this.options).onSuccess)==null||r.call(n,this.currentResult.data),(i=(s=this.options).onSettled)==null||i.call(s,this.currentResult.data,null)}else if(t.onError){var l,c,h,m;(l=(c=this.options).onError)==null||l.call(c,this.currentResult.error),(h=(m=this.options).onSettled)==null||h.call(m,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(({listener:b})=>{b(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function shouldLoadOnMount(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function shouldFetchOnMount(e,t){return shouldLoadOnMount(e,t)||e.state.dataUpdatedAt>0&&shouldFetchOn(e,t,t.refetchOnMount)}function shouldFetchOn(e,t,r){if(t.enabled!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&isStale(e,t)}return!1}function shouldFetchOptionally(e,t,r,n){return r.enabled!==!1&&(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&isStale(e,r)}function isStale(e,t){return e.isStaleByTime(t.staleTime)}function shouldAssignObserverCurrentProperties(e,t,r){return r.keepPreviousData?!1:r.placeholderData!==void 0?t.isPlaceholderData:e.getCurrentResult()!==t}class MutationObserver extends Subscribable{constructor(t,r){super(),this.client=t,this.setOptions(r),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=this.client.defaultMutationOptions(t),shallowEqualObjects(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(r=this.currentMutation)==null||r.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.currentMutation)==null||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();const r={listeners:!0};t.type==="success"?r.onSuccess=!0:t.type==="error"&&(r.onError=!0),this.notify(r)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,r){return this.mutateOptions=r,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof t<"u"?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const t=this.currentMutation?this.currentMutation.state:getDefaultState(),r={...t,isLoading:t.status==="loading",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=r}notify(t){notifyManager.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(t.onSuccess){var r,n,i,s;(r=(n=this.mutateOptions).onSuccess)==null||r.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(s=this.mutateOptions).onSettled)==null||i.call(s,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(t.onError){var l,c,h,m;(l=(c=this.mutateOptions).onError)==null||l.call(c,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(h=(m=this.mutateOptions).onSettled)==null||h.call(m,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}t.listeners&&this.listeners.forEach(({listener:b})=>{b(this.currentResult)})})}}var reactDomExports=requireReactDom(),reactExports=requireReact();const React=getDefaultExportFromCjs(reactExports);var shim={exports:{}},useSyncExternalStoreShim_production_min={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredUseSyncExternalStoreShim_production_min;function requireUseSyncExternalStoreShim_production_min(){if(hasRequiredUseSyncExternalStoreShim_production_min)return useSyncExternalStoreShim_production_min;hasRequiredUseSyncExternalStoreShim_production_min=1;var e=requireReact();function t(S,w){return S===w&&(S!==0||1/S===1/w)||S!==S&&w!==w}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function c(S,w){var _=w(),I=n({inst:{value:_,getSnapshot:w}}),N=I[0].inst,P=I[1];return s(function(){N.value=_,N.getSnapshot=w,h(N)&&P({inst:N})},[S,_,w]),i(function(){return h(N)&&P({inst:N}),S(function(){h(N)&&P({inst:N})})},[S]),l(_),_}function h(S){var w=S.getSnapshot;S=S.value;try{var _=w();return!r(S,_)}catch{return!0}}function m(S,w){return w()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:c;return useSyncExternalStoreShim_production_min.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b,useSyncExternalStoreShim_production_min}var hasRequiredShim;function requireShim(){return hasRequiredShim||(hasRequiredShim=1,shim.exports=requireUseSyncExternalStoreShim_production_min()),shim.exports}var shimExports=requireShim();const useSyncExternalStore=shimExports.useSyncExternalStore,defaultContext=reactExports.createContext(void 0),QueryClientSharingContext=reactExports.createContext(!1);function getQueryClientContext(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=defaultContext),window.ReactQueryClientContext):defaultContext)}const useQueryClient=({context:e}={})=>{const t=reactExports.useContext(getQueryClientContext(e,reactExports.useContext(QueryClientSharingContext)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},QueryClientProvider=({client:e,children:t,context:r,contextSharing:n=!1})=>{reactExports.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=getQueryClientContext(r,n);return reactExports.createElement(QueryClientSharingContext.Provider,{value:!r&&n},reactExports.createElement(i.Provider,{value:e},t))},IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(e,t){return typeof e=="function"?e(...t):!!e}const ensurePreventErrorBoundaryRetry=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},useClearResetErrorBoundary=e=>{reactExports.useEffect(()=>{e.clearReset()},[e])},getHasError=({result:e,errorResetBoundary:t,useErrorBoundary:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&shouldThrowError(r,[e.error,n]),ensureStaleTime=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},willFetch=(e,t)=>e.isLoading&&e.isFetching&&!t,shouldSuspend=(e,t,r)=>(e==null?void 0:e.suspense)&&willFetch(t,r),fetchOptimistic=(e,t,r)=>t.fetchOptimistic(e).then(({data:n})=>{e.onSuccess==null||e.onSuccess(n),e.onSettled==null||e.onSettled(n,null)}).catch(n=>{r.clearReset(),e.onError==null||e.onError(n),e.onSettled==null||e.onSettled(void 0,n)});function useBaseQuery(e,t){const r=useQueryClient({context:e.context}),n=useIsRestoring(),i=useQueryErrorResetBoundary(),s=r.defaultQueryOptions(e);s._optimisticResults=n?"isRestoring":"optimistic",s.onError&&(s.onError=notifyManager.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=notifyManager.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=notifyManager.batchCalls(s.onSettled)),ensureStaleTime(s),ensurePreventErrorBoundaryRetry(s,i),useClearResetErrorBoundary(i);const[l]=reactExports.useState(()=>new t(r,s)),c=l.getOptimisticResult(s);if(useSyncExternalStore(reactExports.useCallback(h=>{const m=n?()=>{}:l.subscribe(notifyManager.batchCalls(h));return l.updateResult(),m},[l,n]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),reactExports.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),shouldSuspend(s,c,n))throw fetchOptimistic(s,l,i);if(getHasError({result:c,errorResetBoundary:i,useErrorBoundary:s.useErrorBoundary,query:l.getCurrentQuery()}))throw c.error;return s.notifyOnChangeProps?c:l.trackResult(c)}function useQuery(e,t,r){const n=parseQueryArgs(e,t,r);return useBaseQuery(n,QueryObserver)}function useMutation(e,t,r){const n=parseMutationArgs(e,t),i=useQueryClient({context:n.context}),[s]=reactExports.useState(()=>new MutationObserver(i,n));reactExports.useEffect(()=>{s.setOptions(n)},[s,n]);const l=useSyncExternalStore(reactExports.useCallback(h=>s.subscribe(notifyManager.batchCalls(h)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),c=reactExports.useCallback((h,m)=>{s.mutate(h,m).catch(noop$1)},[s]);if(l.error&&shouldThrowError(s.options.useErrorBoundary,[l.error]))throw l.error;return{...l,mutate:c,mutateAsync:l.mutate}}function noop$1(){}function assertNever(e,t){throw new Error(`Unhandled discriminated union member: ${JSON.stringify(e)}`)}function hexToRGB(e){if(!e)return;const[t,r,n]=e.match(/[a-fA-F\d]{2}/g).map(i=>parseInt(i,16));return`${t} ${r} ${n}`}const JWT_HEADER="x-alia-jwt",FLOW_ID_HEADER="x-alia-flow-id",ALL_EU_COUNTRIES=["AT","BE","BG","HR","CH","CY","CZ","DK","EE","FI","FR","DE","GB","GR","HU","IE","IS","IT","LI","LV","LT","LU","MT","NO","NL","PL","PT","RO","SK","SI","ES","SE"],ALL_EU_COUNTRIES_LABEL="_allEUCountries";var util;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{const s={};for(const l of i)s[l]=l;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),l={};for(const c of s)l[c]=i[c];return e.objectValues(l)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const l in i)Object.prototype.hasOwnProperty.call(i,l)&&s.push(l);return s},e.find=(i,s)=>{for(const l of i)if(s(l))return l},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(l=>typeof l=="string"?`'${l}'`:l).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(util||(util={}));var objectUtil;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=e=>{switch(typeof e){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(e)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(e)?ZodParsedType.array:e===null?ZodParsedType.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&e instanceof Map?ZodParsedType.map:typeof Set<"u"&&e instanceof Set?ZodParsedType.set:typeof Date<"u"&&e instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(s){return s.message},n={_errors:[]},i=s=>{for(const l of s.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)n._errors.push(r(l));else{let c=n,h=0;for(;hr.message){const r={},n=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const errorMap=(e,t)=>{let r;switch(e.code){case ZodIssueCode.invalid_type:e.received===ZodParsedType.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${util.joinValues(e.keys,", ")}`;break;case ZodIssueCode.invalid_union:r="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${util.joinValues(e.options)}`;break;case ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${util.joinValues(e.options)}, received '${e.received}'`;break;case ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case ZodIssueCode.invalid_date:r="Invalid date";break;case ZodIssueCode.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:util.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ZodIssueCode.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ZodIssueCode.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ZodIssueCode.custom:r="Invalid input";break;case ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,util.assertNever(e)}return{message:r}};let overrideErrorMap=errorMap;function setErrorMap(e){overrideErrorMap=e}function getErrorMap(){return overrideErrorMap}const makeIssue=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],l={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let c="";const h=n.filter(m=>!!m).slice().reverse();for(const m of h)c=m(l,{data:t,defaultError:c}).message;return{...i,path:s,message:c}},EMPTY_PATH=[];function addIssueToContext(e,t){const r=getErrorMap(),n=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===errorMap?void 0:errorMap].filter(i=>!!i)});e.common.issues.push(n)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const i of r){if(i.status==="aborted")return INVALID;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const i of r){const s=await i.key,l=await i.value;n.push({key:s,value:l})}return ParseStatus.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:s,value:l}=i;if(s.status==="aborted"||l.status==="aborted")return INVALID;s.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(n[s.value]=l.value)}return{status:t.value,value:n}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=e=>({status:"dirty",value:e}),OK=e=>({status:"valid",value:e}),isAborted=e=>e.status==="aborted",isDirty=e=>e.status==="dirty",isValid=e=>e.status==="valid",isAsync=e=>typeof Promise<"u"&&e instanceof Promise;function __classPrivateFieldGet(e,t,r,n){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function __classPrivateFieldSet(e,t,r,n,i){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(e,t)=>{if(isValid(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new ZodError(e.common.issues);return this._error=r,this._error}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(l,c)=>{var h,m;const{message:b}=e;return l.code==="invalid_enum_value"?{message:b??c.defaultError}:typeof c.data>"u"?{message:(h=b??n)!==null&&h!==void 0?h:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(m=b??r)!==null&&m!==void 0?m:c.defaultError}},description:i}}class ZodType{get description(){return this._def.description}_getType(t){return getParsedType(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:getParsedType(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ParseStatus,ctx:{common:t.parent.common,data:t.data,parsedType:getParsedType(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(isAsync(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:getParsedType(t)},s=this._parseSync({data:t,path:i.path,parent:i});return handleResult(i,s)}"~validate"(t){var r,n;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:getParsedType(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:i});return isValid(s)?{value:s.value}:{issues:i.common.issues}}catch(s){!((n=(r=s==null?void 0:s.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:i}).then(s=>isValid(s)?{value:s.value}:{issues:i.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:getParsedType(t)},i=this._parse({data:t,path:n.path,parent:n}),s=await(isAsync(i)?i:Promise.resolve(i));return handleResult(n,s)}refine(t,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{const l=t(i),c=()=>s.addIssue({code:ZodIssueCode.custom,...n(i)});return typeof Promise<"u"&&l instanceof Promise?l.then(h=>h?!0:(c(),!1)):l?!0:(c(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(t){return ZodUnion.create([this,t],this._def)}and(t){return ZodIntersection.create(this,t,this._def)}transform(t){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:r,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:r,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ZodPipeline.create(this,t)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function timeRegex(e){return new RegExp(`^${timeRegexSource(e)}$`)}function datetimeRegex(e){let t=`${dateRegexSource}T${timeRegexSource(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function isValidIP(e,t){return!!((t==="v4"||!t)&&ipv4Regex.test(e)||(t==="v6"||!t)&&ipv6Regex.test(e))}function isValidJWT(e,t){if(!jwtRegex.test(e))return!1;try{const[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||!i.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function isValidCidr(e,t){return!!((t==="v4"||!t)&&ipv4CidrRegex.test(e)||(t==="v6"||!t)&&ipv6CidrRegex.test(e))}class ZodString extends ZodType{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ZodParsedType.string){const s=this._getOrReturnCtx(t);return addIssueToContext(s,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:s.parsedType}),INVALID}const n=new ParseStatus;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.lengths.value&&(i=this._getOrReturnCtx(t,i),addIssueToContext(i,{code:ZodIssueCode.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const l=t.data.length>s.value,c=t.data.lengtht.test(i),{validation:r,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(n)})}_addCheck(t){return new ZodString({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...errorUtil.errToObj(t)})}url(t){return this._addCheck({kind:"url",...errorUtil.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...errorUtil.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...errorUtil.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...errorUtil.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...errorUtil.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...errorUtil.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...errorUtil.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...errorUtil.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...errorUtil.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...errorUtil.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...errorUtil.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...errorUtil.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...errorUtil.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...errorUtil.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...errorUtil.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...errorUtil.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...errorUtil.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...errorUtil.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...errorUtil.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...errorUtil.errToObj(r)})}nonempty(t){return this.min(1,errorUtil.errToObj(t))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...processCreateParams(e)})};function floatSafeRemainder(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(e.toFixed(i).replace(".","")),l=parseInt(t.toFixed(i).replace(".",""));return s%l/Math.pow(10,i)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ZodParsedType.number){const s=this._getOrReturnCtx(t);return addIssueToContext(s,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:s.parsedType}),INVALID}let n;const i=new ParseStatus;for(const s of this._def.checks)s.kind==="int"?util.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?floatSafeRemainder(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.not_finite,message:s.message}),i.dirty()):util.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,errorUtil.toString(r))}gt(t,r){return this.setLimit("min",t,!1,errorUtil.toString(r))}lte(t,r){return this.setLimit("max",t,!0,errorUtil.toString(r))}lt(t,r){return this.setLimit("max",t,!1,errorUtil.toString(r))}setLimit(t,r,n,i){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:errorUtil.toString(i)}]})}_addCheck(t){return new ZodNumber({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:errorUtil.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:errorUtil.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:errorUtil.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&util.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ZodParsedType.bigint)return this._getInvalidInput(t);let n;const i=new ParseStatus;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):util.assertNever(s);return{status:i.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:r.parsedType}),INVALID}gte(t,r){return this.setLimit("min",t,!0,errorUtil.toString(r))}gt(t,r){return this.setLimit("min",t,!1,errorUtil.toString(r))}lte(t,r){return this.setLimit("max",t,!0,errorUtil.toString(r))}lt(t,r){return this.setLimit("max",t,!1,errorUtil.toString(r))}setLimit(t,r,n,i){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:errorUtil.toString(i)}]})}_addCheck(t){return new ZodBigInt({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:errorUtil.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...processCreateParams(e)})};class ZodBoolean extends ZodType{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ZodParsedType.boolean){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:n.parsedType}),INVALID}return OK(t.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodDate extends ZodType{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ZodParsedType.date){const s=this._getOrReturnCtx(t);return addIssueToContext(s,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:s.parsedType}),INVALID}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return addIssueToContext(s,{code:ZodIssueCode.invalid_date}),INVALID}const n=new ParseStatus;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()s.value&&(i=this._getOrReturnCtx(t,i),addIssueToContext(i,{code:ZodIssueCode.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):util.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ZodDate({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:errorUtil.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:errorUtil.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew ZodDate({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.symbol){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:n.parsedType}),INVALID}return OK(t.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.undefined){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:n.parsedType}),INVALID}return OK(t.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.null){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:n.parsedType}),INVALID}return OK(t.data)}}ZodNull.create=e=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(t){return OK(t.data)}}ZodAny.create=e=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(t){return OK(t.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(t){const r=this._getOrReturnCtx(t);return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:r.parsedType}),INVALID}}ZodNever.create=e=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.undefined){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:n.parsedType}),INVALID}return OK(t.data)}}ZodVoid.create=e=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==ZodParsedType.array)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:r.parsedType}),INVALID;if(i.exactLength!==null){const l=r.data.length>i.exactLength.value,c=r.data.lengthi.maxLength.value&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((l,c)=>i.type._parseAsync(new ParseInputLazyPath(r,l,r.path,c)))).then(l=>ParseStatus.mergeArray(n,l));const s=[...r.data].map((l,c)=>i.type._parseSync(new ParseInputLazyPath(r,l,r.path,c)));return ParseStatus.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new ZodArray({...this._def,minLength:{value:t,message:errorUtil.toString(r)}})}max(t,r){return new ZodArray({...this._def,maxLength:{value:t,message:errorUtil.toString(r)}})}length(t,r){return new ZodArray({...this._def,exactLength:{value:t,message:errorUtil.toString(r)}})}nonempty(t){return this.min(1,t)}}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(t)});function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=ZodOptional.create(deepPartialify(n))}return new ZodObject({...e._def,shape:()=>t})}else return e instanceof ZodArray?new ZodArray({...e._def,type:deepPartialify(e.element)}):e instanceof ZodOptional?ZodOptional.create(deepPartialify(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(deepPartialify(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map(t=>deepPartialify(t))):e}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=util.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==ZodParsedType.object){const m=this._getOrReturnCtx(t);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:m.parsedType}),INVALID}const{status:n,ctx:i}=this._processInputParams(t),{shape:s,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const m in i.data)l.includes(m)||c.push(m);const h=[];for(const m of l){const b=s[m],S=i.data[m];h.push({key:{status:"valid",value:m},value:b._parse(new ParseInputLazyPath(i,S,i.path,m)),alwaysSet:m in i.data})}if(this._def.catchall instanceof ZodNever){const m=this._def.unknownKeys;if(m==="passthrough")for(const b of c)h.push({key:{status:"valid",value:b},value:{status:"valid",value:i.data[b]}});else if(m==="strict")c.length>0&&(addIssueToContext(i,{code:ZodIssueCode.unrecognized_keys,keys:c}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const b of c){const S=i.data[b];h.push({key:{status:"valid",value:b},value:m._parse(new ParseInputLazyPath(i,S,i.path,b)),alwaysSet:b in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const m=[];for(const b of h){const S=await b.key,w=await b.value;m.push({key:S,value:w,alwaysSet:b.alwaysSet})}return m}).then(m=>ParseStatus.mergeObjectSync(n,m)):ParseStatus.mergeObjectSync(n,h)}get shape(){return this._def.shape()}strict(t){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,s,l,c;const h=(l=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&l!==void 0?l:n.defaultError;return r.code==="unrecognized_keys"?{message:(c=errorUtil.errToObj(t).message)!==null&&c!==void 0?c:h}:{message:h}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(t){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ZodObject({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new ZodObject({...this._def,catchall:t})}pick(t){const r={};return util.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new ZodObject({...this._def,shape:()=>r})}omit(t){const r={};return util.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new ZodObject({...this._def,shape:()=>r})}deepPartial(){return deepPartialify(this)}partial(t){const r={};return util.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}),new ZodObject({...this._def,shape:()=>r})}required(t){const r={};return util.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof ZodOptional;)s=s._def.innerType;r[n]=s}}),new ZodObject({...this._def,shape:()=>r})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});class ZodUnion extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function i(s){for(const c of s)if(c.result.status==="valid")return c.result;for(const c of s)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;const l=s.map(c=>new ZodError(c.ctx.common.issues));return addIssueToContext(r,{code:ZodIssueCode.invalid_union,unionErrors:l}),INVALID}if(r.common.async)return Promise.all(n.map(async s=>{const l={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(i);{let s;const l=[];for(const h of n){const m={...r,common:{...r.common,issues:[]},parent:null},b=h._parseSync({data:r.data,path:r.path,parent:m});if(b.status==="valid")return b;b.status==="dirty"&&!s&&(s={result:b,ctx:m}),m.common.issues.length&&l.push(m.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const c=l.map(h=>new ZodError(h));return addIssueToContext(r,{code:ZodIssueCode.invalid_union,unionErrors:c}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?util.objectValues(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:e instanceof ZodOptional?[void 0,...getDiscriminator(e.unwrap())]:e instanceof ZodNullable?[null,...getDiscriminator(e.unwrap())]:e instanceof ZodBranded||e instanceof ZodReadonly?getDiscriminator(e.unwrap()):e instanceof ZodCatch?getDiscriminator(e._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.object)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:r.parsedType}),INVALID;const n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(addIssueToContext(r,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const i=new Map;for(const s of r){const l=getDiscriminator(s.shape[t]);if(!l.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of l){if(i.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);i.set(c,s)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...processCreateParams(n)})}}function mergeValues(e,t){const r=getParsedType(e),n=getParsedType(t);if(e===t)return{valid:!0,data:e};if(r===ZodParsedType.object&&n===ZodParsedType.object){const i=util.objectKeys(t),s=util.objectKeys(e).filter(c=>i.indexOf(c)!==-1),l={...e,...t};for(const c of s){const h=mergeValues(e[c],t[c]);if(!h.valid)return{valid:!1};l[c]=h.data}return{valid:!0,data:l}}else if(r===ZodParsedType.array&&n===ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s{if(isAborted(s)||isAborted(l))return INVALID;const c=mergeValues(s.value,l.value);return c.valid?((isDirty(s)||isDirty(l))&&r.dirty(),{status:r.value,value:c.data}):(addIssueToContext(n,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,l])=>i(s,l)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ZodIntersection.create=(e,t,r)=>new ZodIntersection({left:e,right:t,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(r)});class ZodTuple extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.array)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:n.parsedType}),INVALID;if(n.data.lengththis._def.items.length&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((l,c)=>{const h=this._def.items[c]||this._def.rest;return h?h._parse(new ParseInputLazyPath(n,l,n.path,c)):null}).filter(l=>!!l);return n.common.async?Promise.all(s).then(l=>ParseStatus.mergeArray(r,l)):ParseStatus.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new ZodTuple({...this._def,rest:t})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.object)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:n.parsedType}),INVALID;const i=[],s=this._def.keyType,l=this._def.valueType;for(const c in n.data)i.push({key:s._parse(new ParseInputLazyPath(n,c,n.path,c)),value:l._parse(new ParseInputLazyPath(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?ParseStatus.mergeObjectAsync(r,i):ParseStatus.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof ZodType?new ZodRecord({keyType:t,valueType:r,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(n)}):new ZodRecord({keyType:ZodString.create(),valueType:t,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(r)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.map)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:n.parsedType}),INVALID;const i=this._def.keyType,s=this._def.valueType,l=[...n.data.entries()].map(([c,h],m)=>({key:i._parse(new ParseInputLazyPath(n,c,n.path,[m,"key"])),value:s._parse(new ParseInputLazyPath(n,h,n.path,[m,"value"]))}));if(n.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const h of l){const m=await h.key,b=await h.value;if(m.status==="aborted"||b.status==="aborted")return INVALID;(m.status==="dirty"||b.status==="dirty")&&r.dirty(),c.set(m.value,b.value)}return{status:r.value,value:c}})}else{const c=new Map;for(const h of l){const m=h.key,b=h.value;if(m.status==="aborted"||b.status==="aborted")return INVALID;(m.status==="dirty"||b.status==="dirty")&&r.dirty(),c.set(m.value,b.value)}return{status:r.value,value:c}}}}ZodMap.create=(e,t,r)=>new ZodMap({valueType:t,keyType:e,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(r)});class ZodSet extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.set)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:n.parsedType}),INVALID;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const s=this._def.valueType;function l(h){const m=new Set;for(const b of h){if(b.status==="aborted")return INVALID;b.status==="dirty"&&r.dirty(),m.add(b.value)}return{status:r.value,value:m}}const c=[...n.data.values()].map((h,m)=>s._parse(new ParseInputLazyPath(n,h,n.path,m)));return n.common.async?Promise.all(c).then(h=>l(h)):l(c)}min(t,r){return new ZodSet({...this._def,minSize:{value:t,message:errorUtil.toString(r)}})}max(t,r){return new ZodSet({...this._def,maxSize:{value:t,message:errorUtil.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.function)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:r.parsedType}),INVALID;function n(c,h){return makeIssue({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,getErrorMap(),errorMap].filter(m=>!!m),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:h}})}function i(c,h){return makeIssue({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,getErrorMap(),errorMap].filter(m=>!!m),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:h}})}const s={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof ZodPromise){const c=this;return OK(async function(...h){const m=new ZodError([]),b=await c._def.args.parseAsync(h,s).catch(_=>{throw m.addIssue(n(h,_)),m}),S=await Reflect.apply(l,this,b);return await c._def.returns._def.type.parseAsync(S,s).catch(_=>{throw m.addIssue(i(S,_)),m})})}else{const c=this;return OK(function(...h){const m=c._def.args.safeParse(h,s);if(!m.success)throw new ZodError([n(h,m.error)]);const b=Reflect.apply(l,this,m.data),S=c._def.returns.safeParse(b,s);if(!S.success)throw new ZodError([i(b,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ZodFunction({...this._def,args:ZodTuple.create(t).rest(ZodUnknown.create())})}returns(t){return new ZodFunction({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new ZodFunction({args:t||ZodTuple.create([]).rest(ZodUnknown.create()),returns:r||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(n)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(t)});class ZodLiteral extends ZodType{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return addIssueToContext(r,{received:r.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:t.data}}get value(){return this._def.value}}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(t)});function createZodEnum(e,t){return new ZodEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(t)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return addIssueToContext(r,{expected:util.joinValues(n),received:r.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodEnum_cache)||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values)),!__classPrivateFieldGet(this,_ZodEnum_cache).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return addIssueToContext(r,{received:r.data,code:ZodIssueCode.invalid_enum_value,options:n}),INVALID}return OK(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ZodEnum.create(t,{...this._def,...r})}exclude(t,r=this._def){return ZodEnum.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}_ZodEnum_cache=new WeakMap,ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(t){const r=util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ZodParsedType.string&&n.parsedType!==ZodParsedType.number){const i=util.objectValues(r);return addIssueToContext(n,{expected:util.joinValues(i),received:n.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache)||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values))),!__classPrivateFieldGet(this,_ZodNativeEnum_cache).has(t.data)){const i=util.objectValues(r);return addIssueToContext(n,{received:n.data,code:ZodIssueCode.invalid_enum_value,options:i}),INVALID}return OK(t.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap,ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.promise&&r.common.async===!1)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:r.parsedType}),INVALID;const n=r.parsedType===ZodParsedType.promise?r.data:Promise.resolve(r.data);return OK(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:l=>{addIssueToContext(n,l),l.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const l=i.transform(n.data,s);if(n.common.async)return Promise.resolve(l).then(async c=>{if(r.value==="aborted")return INVALID;const h=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return h.status==="aborted"?INVALID:h.status==="dirty"||r.value==="dirty"?DIRTY(h.value):h});{if(r.value==="aborted")return INVALID;const c=this._def.schema._parseSync({data:l,path:n.path,parent:n});return c.status==="aborted"?INVALID:c.status==="dirty"||r.value==="dirty"?DIRTY(c.value):c}}if(i.type==="refinement"){const l=c=>{const h=i.refinement(c,s);if(n.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){const c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?INVALID:(c.status==="dirty"&&r.dirty(),l(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?INVALID:(c.status==="dirty"&&r.dirty(),l(c.value).then(()=>({status:r.value,value:c.value}))))}if(i.type==="transform")if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!isValid(l))return l;const c=i.transform(l.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>isValid(l)?Promise.resolve(i.transform(l.value,s)).then(c=>({status:r.value,value:c})):l);util.assertNever(i)}}ZodEffects.create=(e,t,r)=>new ZodEffects({schema:e,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:t,...processCreateParams(r)}),ZodEffects.createWithPreprocess=(e,t,r)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(r)});class ZodOptional extends ZodType{_parse(t){return this._getType(t)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(t)});class ZodNullable extends ZodType{_parse(t){return this._getType(t)===ZodParsedType.null?OK(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(t)});class ZodDefault extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...processCreateParams(t)});class ZodCatch extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return isAsync(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...processCreateParams(t)});class ZodNaN extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.nan){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:n.parsedType}),INVALID}return{status:"valid",value:t.data}}}ZodNaN.create=e=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(e)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?INVALID:s.status==="dirty"?(r.dirty(),DIRTY(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?INVALID:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new ZodPipeline({in:t,out:r,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(t){const r=this._def.innerType._parse(t),n=i=>(isValid(i)&&(i.value=Object.freeze(i.value)),i);return isAsync(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(t)});function cleanParams(e,t){const r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function custom(e,t={},r){return e?ZodAny.create().superRefine((n,i)=>{var s,l;const c=e(n);if(c instanceof Promise)return c.then(h=>{var m,b;if(!h){const S=cleanParams(t,n),w=(b=(m=S.fatal)!==null&&m!==void 0?m:r)!==null&&b!==void 0?b:!0;i.addIssue({code:"custom",...S,fatal:w})}});if(!c){const h=cleanParams(t,n),m=(l=(s=h.fatal)!==null&&s!==void 0?s:r)!==null&&l!==void 0?l:!0;i.addIssue({code:"custom",...h,fatal:m})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(e,t={message:`Input not instance of ${e.name}`})=>custom(r=>r instanceof e,t),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:e=>ZodString.create({...e,coerce:!0}),number:e=>ZodNumber.create({...e,coerce:!0}),boolean:e=>ZodBoolean.create({...e,coerce:!0}),bigint:e=>ZodBigInt.create({...e,coerce:!0}),date:e=>ZodDate.create({...e,coerce:!0})},NEVER=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid,isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError});const allEuCountriesSchema=z.literal(ALL_EU_COUNTRIES_LABEL),countryCodeSchema=z.string().or(allEuCountriesSchema).brand();function isAllEUCountries(e){return e===ALL_EU_COUNTRIES_LABEL}function getAllCountryCodes(e){return e.flatMap(t=>isAllEUCountries(t)?ALL_EU_COUNTRIES:[t])}function dumpCSSVariable(e){return`var(${e})`}function glob(e,t){return new RegExp("^"+e.replace(/([.?+^$[\]\\(){}|/-])/g,"\\$1").replace(/\*/g,".*")+"$").test(t)}function anyGlob(e,t){return e.some(r=>glob(r,t))}const ICONS=["checkmark","arrowRight","arrowLeft","user","favorite","chevronUp","chevronDown","chevronRight","chevronLeft","home","fire","lock","trophy","close","help","helpOutline","shop","copy","radioOn","radioOff","unchecked","checked","discount","info","redeem","clock","external","warning","leave","error"];function unrotate(e){return e.slice(-3).concat(e.slice(0,-3))}const KEY="cory_is_a_good_boy";function xorDecode(e){const t=Uint8Array.from(atob(e),i=>i.charCodeAt(0)),r=new TextEncoder().encode(KEY),n=new Uint8Array(t.length);for(let i=0;i[s,i[l]]))}class RateLimiter{constructor(t){Xe(this,"reqTimestamps",[]);Xe(this,"window");Xe(this,"numRequests");this.window=t.window,this.numRequests=t.numRequests}check(t=!1){const r=this.reqTimestamps.findIndex(n=>n>=Date.now()-this.window);return r===-1?this.reqTimestamps.length=0:this.reqTimestamps.splice(0,r),this.reqTimestamps.length>=this.numRequests&&!t?!1:(this.reqTimestamps.push(Date.now()),!0)}}const getStorage=e=>e==="local"?localStorage:sessionStorage;function getFromStorage(e,t){try{const n=getStorage(e).getItem(t);return n?JSON.parse(n):null}catch(r){return console.error(`Error getting ${t} from ${e}Storage:`,r),null}}function setInStorage(e,t,r){try{getStorage(e).setItem(t,JSON.stringify(r))}catch(n){console.error(`Error setting ${t} in ${e}Storage:`,n)}}function joinWithAnd(e,t="and"){return e.length===1?e[0]:e.slice(0,-1).join(", ")+` ${t} `+e.slice(-1)[0]}function lowerFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}function getTimeRemainingStr(e){const t=Math.floor(e/86400),r=Math.floor(e%(3600*24)/3600),n=Math.floor(e%3600/60),i=Math.floor(e%60);return t>0?`${t}d ${r}h`:r>0?`${r}:${n<10?"0":""}${n}:${i<10?"0":""}${i}`:`${n}:${i<10?"0":""}${i}`}function unknownErrToStr(e){return typeof e=="string"?e:e instanceof Error?e.message:typeof e=="object"&&e!==null&&"error"in e&&typeof e.error=="string"?e.error:"An unknown error occurred"}async function wait(e){return new Promise(t=>setTimeout(t,e))}async function timeout(e,t){return Promise.race([wait(e),t()])}function buildServicePath(e,t,r,n){if(!e)throw new Error("Shop is not set");const i=new URL("https://backend.alia-cloudflare.com");for(const[s,l]of Object.entries(r))t=t.replace(`:${s}`,String(l));i.pathname=`/user${t}`,i.searchParams.set("shop",e);for(const[s,l]of Object.entries(n))l!=null&&i.searchParams.set(s,String(l));return i.toString()}let hasLoggedRateLimitExceeded=!1;const rateLimiter=new RateLimiter({window:5e3,numRequests:30});async function serviceFetch({shop:e,method:t,path:r,args:n,ignoreRateLimit:i,headers:s,keepAlive:l}){const c=t!=="GET"&&"body"in n;if(!rateLimiter.check(i))throw hasLoggedRateLimitExceeded||(hasLoggedRateLimitExceeded=!0,await serviceFetch({shop:e,method:"POST",path:"/errors",headers:s,args:{body:{message:"Customer app rate limit exceeded",data:{method:t,path:r,args:n}}},ignoreRateLimit:!0})),new Error("Please try again");const h=await fetch(buildServicePath(e,r,"params"in n&&n.params,"query"in n&&n.query),{method:t,keepalive:l,headers:{...c?{"Content-Type":"application/json"}:{},...s},...c?{body:JSON.stringify("body"in n?n.body:void 0)}:{}});if(h.status===204)return;const m=await h.json();if(h.ok)return m;throw typeof m!="object"||m==null?new Error("An unknown error occurred"):"error"in m&&typeof m.error=="string"?new Error(m.error):new Error("An unknown error occurred")}function useSuspenseQuery(e){return useQuery(e)}function useServiceFetch(){var i;const{shop:e,jwt:t,initialData:r}=useCustomerAppContext(),n=(i=r.userFlow)==null?void 0:i.flowID;return reactExports.useCallback((s,l,c,h)=>serviceFetch({shop:e,method:s,path:l,args:c,headers:{[JWT_HEADER]:t,...n?{[FLOW_ID_HEADER]:String(n)}:{}},...h}),[e,t,n])}function useLogError(){const e=useServiceFetch();return useMutation({mutationKey:["errors","logError"],mutationFn:t=>e("POST","/errors",{body:t})})}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredReactJsxRuntime_production_min;function requireReactJsxRuntime_production_min(){if(hasRequiredReactJsxRuntime_production_min)return reactJsxRuntime_production_min;hasRequiredReactJsxRuntime_production_min=1;var e=requireReact(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(c,h,m){var b,S={},w=null,_=null;m!==void 0&&(w=""+m),h.key!==void 0&&(w=""+h.key),h.ref!==void 0&&(_=h.ref);for(b in h)n.call(h,b)&&!s.hasOwnProperty(b)&&(S[b]=h[b]);if(c&&c.defaultProps)for(b in h=c.defaultProps,h)S[b]===void 0&&(S[b]=h[b]);return{$$typeof:t,type:c,key:w,ref:_,props:S,_owner:i.current}}return reactJsxRuntime_production_min.Fragment=r,reactJsxRuntime_production_min.jsx=l,reactJsxRuntime_production_min.jsxs=l,reactJsxRuntime_production_min}var hasRequiredJsxRuntime;function requireJsxRuntime(){return hasRequiredJsxRuntime||(hasRequiredJsxRuntime=1,jsxRuntime.exports=requireReactJsxRuntime_production_min()),jsxRuntime.exports}var jsxRuntimeExports=requireJsxRuntime();const jsx=jsxRuntimeExports.jsx,jsxs=jsxRuntimeExports.jsxs,Fragment=jsxRuntimeExports.Fragment;class CommonErrorBoundaryImpl extends React.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){var n,i;(i=(n=this.props).onError)==null||i.call(n,t)}render(){return this.state.hasError?this.props.fallback??null:this.props.children}}const CommonErrorBoundary=({children:e,onError:t,fallback:r})=>{const n=reactExports.useRef(!1),i=useLogError();return jsx(CommonErrorBoundaryImpl,{onError:s=>{t==null||t(s),!n.current&&(n.current=!0,i.mutate({message:s.message,data:{stack:s.stack}}))},fallback:r,children:e})};function queryManager(e){return()=>{const t=useQueryClient();return reactExports.useMemo(()=>({getQueryKey:e,invalidateQuery:r=>{t.invalidateQueries(e(r))},updateQuery:(r,n)=>{t.cancelQueries(e(r)),t.setQueryData(e(r),n)},getData:r=>t.getQueryData(e(r))}),[t])}}function mergeOneIntoMany(e,t){if(!e)return[t];const r=e.findIndex(i=>i.id===t.id);if(r===-1)return[...e,t];const n=[...e];return n[r]=t,n}const useGetUserFlowQuery=queryManager(()=>["userFlows","getUserFlow"]);function useGetUserFlow(){const{initialData:e}=useCustomerAppContext(),{getQueryKey:t}=useGetUserFlowQuery(),r=useServiceFetch();return useSuspenseQuery({queryKey:t(),queryFn:()=>r("GET","/user-flows",{}),initialData:e.userFlow})}function useUpdateUserFlow(){const e=useServiceFetch(),{updateQuery:t}=useGetUserFlowQuery();return useMutation({mutationKey:["userFlows","update"],mutationFn:r=>e("PUT","/user-flows",{body:r}),onSuccess:r=>t(void 0,()=>r)})}var define_process_env_default={};const ENCRYPTION_KEY=define_process_env_default.ENCRYPTION_KEY;function encrypt(e,t=ENCRYPTION_KEY){if(!t)throw new Error("ENCRYPTION_KEY environment variable not set");const r="aes-256-cbc",n=crypto.randomBytes(16),i=crypto.createCipheriv(r,Buffer.from(t,"hex"),n);let s=i.update(e,"utf8","hex");return s+=i.final("hex"),n.toString("hex")+":"+s}const encryptableSchema=z.object({__encrypted:z.boolean(),value:z.string(),updated:z.boolean().optional()}).transform(e=>e.__encrypted?e:{__encrypted:!0,value:encrypt(e.value),updated:e.updated});function encrypted(e){return encryptableSchema.parse({__encrypted:!1,value:e})}const backCompatEncryptableSchema=encryptableSchema.or(z.string().transform(e=>encrypted(e))),MAX_INACTIVE_SUBSCRIBE_THRESHOLD=10*60*1e3,attentiveUserConfigSchema=z.object({signUpSourceId:z.string().optional(),singleOptIn:z.boolean().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),attentiveConfigSchema=z.object({type:z.literal("ATTENTIVE"),accessToken:backCompatEncryptableSchema,userDefaults:attentiveUserConfigSchema}),attentiveEventSchema=z.object({type:z.enum(["Alia Poll Answered","Alia Reward Claimed"]),properties:z.record(z.string(),z.string().optional())}),attentiveUserDataSchema=z.object({type:z.literal("ATTENTIVE"),created:z.boolean(),events:z.array(attentiveEventSchema),attributes:z.record(z.string(),z.string().optional()),configOverrides:attentiveUserConfigSchema.deepPartial().optional()}),attentiveSubscriptionResultSchema=z.enum(["smsAlreadySubscribed","emailAlreadySubscribed"]),bayEngageUserConfigSchema=z.object({listID:z.string().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),bayEngageConfigSchema=z.object({type:z.literal("BAY_ENGAGE"),publicId:z.string(),privateKey:encryptableSchema,publicKey:z.string(),userDefaults:bayEngageUserConfigSchema}),bayEngagePropertyValueSchema=z.union([z.string(),z.number(),z.undefined()]),bayEngageUserDataSchema=z.object({type:z.literal("BAY_ENGAGE"),hasSubscribed:z.boolean(),properties:z.record(z.string(),bayEngagePropertyValueSchema.optional()),configOverrides:bayEngageUserConfigSchema.deepPartial().optional()}),contloUserConfigSchema=z.object({inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),contloConfigSchema=z.object({type:z.literal("CONTLO"),apiKey:backCompatEncryptableSchema,userDefaults:contloUserConfigSchema}),contloUserDataSchema=z.object({type:z.literal("CONTLO"),properties:z.record(z.string(),z.string().optional()),configOverrides:contloUserConfigSchema.deepPartial().optional(),created:z.boolean()}),emotiveUserConfigSchema=z.object({subscribeIdentifier:z.string().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),emotiveConfigSchema=z.object({type:z.literal("EMOTIVE"),apiKey:backCompatEncryptableSchema,userDefaults:emotiveUserConfigSchema}),emotiveUserDataSchema=z.object({type:z.literal("EMOTIVE"),properties:z.record(z.string(),z.union([z.string(),z.number(),z.boolean()])),configOverrides:emotiveUserConfigSchema.deepPartial().optional(),created:z.boolean()}),klaviyoOAuthUserConfigSchema=z.object({emailListID:z.string().optional(),smsListID:z.string().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),klaviyoOAuthConfigSchema=z.object({type:z.literal("KLAVIYO_OAUTH"),accessToken:backCompatEncryptableSchema,refreshToken:backCompatEncryptableSchema,scope:z.array(z.string()),userDefaults:klaviyoOAuthUserConfigSchema}),klaviyoOAuthPropertyValueSchema=z.union([z.string(),z.number(),z.boolean(),z.array(z.string()),z.undefined()]),klaviyoOAuthEventSchema=z.object({name:z.enum(["Alia Poll Answered","Alia Reward Claimed"]),uniqueID:z.number().optional(),properties:z.record(z.string(),klaviyoOAuthPropertyValueSchema.optional())}),klaviyoOAuthUserDataSchema=z.object({type:z.literal("KLAVIYO_OAUTH"),profileID:z.string().optional(),subscribedLists:z.array(z.string()).optional(),events:z.array(klaviyoOAuthEventSchema),properties:z.record(z.string(),klaviyoOAuthPropertyValueSchema.optional()),configOverrides:klaviyoOAuthUserConfigSchema.deepPartial().optional()}),klaviyoOAuthSubscriptionResultSchema=z.enum(["smsAlreadySubscribed","emailAlreadySubscribed"]),klaviyoUserConfigSchema=z.object({emailListID:z.string().optional(),smsListID:z.string().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),klaviyoConfigSchema=z.object({type:z.literal("KLAVIYO"),key:backCompatEncryptableSchema,userDefaults:klaviyoUserConfigSchema}),klaviyoPropertyValueSchema=z.union([z.string(),z.number(),z.boolean(),z.array(z.string()),z.undefined()]),klaviyoEventSchema=z.object({name:z.enum(["Alia Poll Answered","Alia Reward Claimed"]),uniqueID:z.number().optional(),properties:z.record(z.string(),klaviyoPropertyValueSchema.optional())}),klaviyoUserDataSchema=z.object({type:z.literal("KLAVIYO"),profileID:z.string().optional(),subscribedLists:z.array(z.string()).optional(),events:z.array(klaviyoEventSchema),properties:z.record(z.string(),klaviyoPropertyValueSchema.optional()),configOverrides:klaviyoUserConfigSchema.deepPartial().optional()}),klaviyoSubscriptionResultSchema=z.enum(["smsAlreadySubscribed","emailAlreadySubscribed"]),listrakEmailUserConfigSchema=z.object({listId:z.number().optional(),segmentationFieldGroupId:z.number().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD),doubleOptIn:z.boolean().optional(),eventIds:z.string().optional()}),listrakEmailConfigSchema=z.object({type:z.literal("LISTRAK_EMAIL"),clientId:z.string(),clientSecret:backCompatEncryptableSchema,token:backCompatEncryptableSchema,userDefaults:listrakEmailUserConfigSchema}),listrakEmailUserDataSchema=z.object({type:z.literal("LISTRAK_EMAIL"),contactId:z.number().optional(),properties:z.record(z.string(),z.string().optional()),configOverrides:listrakEmailUserConfigSchema.deepPartial().optional()}),omnisendUserConfigSchema=z.object({sendWelcomeEmail:z.boolean(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),omnisendConfigSchema=z.object({type:z.literal("OMNISEND"),key:backCompatEncryptableSchema,userDefaults:omnisendUserConfigSchema}),omnisendEventSchema=z.object({name:z.string(),systemName:z.enum(["alia_reward_claimed","alia_poll_answer"]),fields:z.record(z.string(),z.string().optional())}),omnisendUserDataSchema=z.object({type:z.literal("OMNISEND"),created:z.boolean(),events:z.array(omnisendEventSchema),configOverrides:omnisendUserConfigSchema.deepPartial().optional(),properties:z.record(z.string(),z.string().optional()).optional()}),onetextUserConfigSchema=z.object({inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),onetextConfigSchema=z.object({type:z.literal("ONETEXT"),apiKey:z.string(),userDefaults:onetextUserConfigSchema}),onetextUserDataSchema=z.object({type:z.literal("ONETEXT"),configOverrides:onetextUserConfigSchema.deepPartial().optional()}),postscriptUserConfigSchema=z.object({keywordID:z.string(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),postscriptConfigSchema=z.object({type:z.literal("POSTSCRIPT"),key:backCompatEncryptableSchema,userDefaults:postscriptUserConfigSchema,webhookToken:backCompatEncryptableSchema.optional()}),postscriptEventSchema=z.object({type:z.enum(["poll_answered","reward_claimed"]),properties:z.record(z.string(),z.string().optional())}),postscriptPropertyValueSchema=z.union([z.string(),z.number(),z.array(z.string())]),postscriptUserDataSchema=z.object({type:z.literal("POSTSCRIPT"),profileID:z.string().optional(),created:z.boolean(),events:z.array(postscriptEventSchema),properties:z.record(z.string(),postscriptPropertyValueSchema).optional(),configOverrides:postscriptUserConfigSchema.deepPartial().optional()}),postscriptSubscriptionResultSchema=z.enum(["smsAlreadySubscribed"]),recartUserConfigSchema=z.object({inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),recartConfigSchema=z.object({type:z.literal("RECART"),apiKey:encryptableSchema,userDefaults:recartUserConfigSchema}),recartUserDataSchema=z.object({type:z.literal("RECART"),configOverrides:recartUserConfigSchema.deepPartial().optional()}),sendlaneUserConfigSchema=z.object({listID:z.string().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),sendlaneConfigSchema=z.object({type:z.literal("SENDLANE"),key:backCompatEncryptableSchema,personalizations:z.object({discount_code_id:z.number().optional(),discount_text_id:z.number().optional(),discount_expiration_id:z.number().optional()}).optional(),userDefaults:sendlaneUserConfigSchema}),sendlanePropertySchema=z.object({personalizationID:z.number().optional(),value:z.string().nullish()}),sendlaneUserDataSchema=z.object({type:z.literal("SENDLANE"),contactID:z.number().optional(),properties:z.array(sendlanePropertySchema),configOverrides:sendlaneUserConfigSchema.deepPartial().optional()}),shopifyUserConfigSchema=z.object({inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD),tagsDisabled:z.boolean().optional()}),shopifyIntegrationConfigSchema=z.object({type:z.literal("SHOPIFY"),userDefaults:shopifyUserConfigSchema}),shopifyUserDataSchema=z.object({type:z.literal("SHOPIFY"),tags:z.array(z.string()).optional(),configOverrides:shopifyUserConfigSchema.deepPartial().optional()}),shopifySubscriptionResultSchema=z.enum(["alreadySignedUp","hasMadeOrder"]);z.object({type:z.literal("TCPA")});const tcpaUserDataSchema=z.object({type:z.literal("TCPA")}),profileCreatedSourceSchema=z.union([z.object({type:z.literal("widget")}),z.object({type:z.literal("popup")})]),yotpoUserConfigSchema=z.object({emailListID:z.number().optional(),smsListID:z.number().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),yotpoConfigSchema=z.object({type:z.literal("YOTPO"),appKey:z.string(),token:backCompatEncryptableSchema,userDefaults:yotpoUserConfigSchema}),yotpoEventSchema=z.object({type:z.enum(["alia_poll_answered","alia_reward_claimed"]),properties:z.record(z.string(),z.string().optional())}),yotpoUserDataSchema=z.object({type:z.literal("YOTPO"),created:z.boolean(),source:profileCreatedSourceSchema.optional(),events:z.array(yotpoEventSchema),configOverrides:yotpoUserConfigSchema.deepPartial().optional()}),zerobounceConfigSchema=z.object({type:z.literal("ZEROBOUNCE"),apiKey:backCompatEncryptableSchema}),zerobounceUserDataSchema=z.object({type:z.literal("ZEROBOUNCE")});z.discriminatedUnion("type",[attentiveConfigSchema,bayEngageConfigSchema,contloConfigSchema,emotiveConfigSchema,klaviyoConfigSchema,omnisendConfigSchema,onetextConfigSchema,postscriptConfigSchema,sendlaneConfigSchema,shopifyIntegrationConfigSchema,yotpoConfigSchema,klaviyoOAuthConfigSchema,listrakEmailConfigSchema,zerobounceConfigSchema,recartConfigSchema]);const integrationOverridesSchema=z.object({attentive:attentiveUserConfigSchema,bayEngage:bayEngageUserConfigSchema,contlo:contloUserConfigSchema,emotive:emotiveUserConfigSchema,klaviyo:klaviyoUserConfigSchema,omnisend:omnisendUserConfigSchema,onetext:onetextUserConfigSchema,postscript:postscriptUserConfigSchema,sendlane:sendlaneUserConfigSchema,shopify:shopifyUserConfigSchema,yotpo:yotpoUserConfigSchema,klaviyoOAuth:klaviyoOAuthUserConfigSchema,listrakEmail:listrakEmailUserConfigSchema,recart:recartUserConfigSchema}).deepPartial();z.discriminatedUnion("type",[attentiveUserDataSchema,bayEngageUserDataSchema,contloUserDataSchema,emotiveUserDataSchema,klaviyoUserDataSchema,omnisendUserDataSchema,onetextUserDataSchema,postscriptUserDataSchema,sendlaneUserDataSchema,shopifyUserDataSchema,yotpoUserDataSchema,klaviyoOAuthUserDataSchema,listrakEmailUserDataSchema,zerobounceUserDataSchema,tcpaUserDataSchema,recartUserDataSchema]);const subscriptionResultSchema=z.discriminatedUnion("type",[z.object({type:z.literal("shopify"),result:shopifySubscriptionResultSchema}),z.object({type:z.literal("postscript"),result:postscriptSubscriptionResultSchema}),z.object({type:z.literal("attentive"),result:attentiveSubscriptionResultSchema}),z.object({type:z.literal("klaviyo"),result:klaviyoSubscriptionResultSchema}),z.object({type:z.literal("klaviyo-oauth"),result:klaviyoOAuthSubscriptionResultSchema})]),typeValues=subscriptionResultSchema.options.map(e=>e.shape.type.value);z.enum([typeValues[0],...typeValues.slice(1)]);const merchantSettingsSchema=z.object({onSignupHook:z.string(),deleteOldDiscounts:z.boolean(),customCodeFilter:z.string(),primaryDomain:z.string(),otherDomains:z.array(z.string()),useShadowDOM:z.boolean(),internal:z.object({analytics:z.object({showVisitors:z.boolean(),showSiteConversionRate:z.boolean(),showOptIns:z.boolean(),showBounceRate:z.boolean()}),checkTargeting:z.boolean()})}),deepPartialMerchantSettingsSchema=merchantSettingsSchema.deepPartial();var LogBucket=(e=>(e.SYSTEM_ERROR="system_error",e.MERCHANT_ERROR="merchant_error",e.USER_OR_OTHER_ERROR="user_error",e.DEBUG="debug",e.MONITORING="monitoring",e))(LogBucket||{});function ok(e){return{ok:!0,data:e}}const customError=({error:e,message:t="An error occurred",httpStatus:r=500,bucket:n=LogBucket.SYSTEM_ERROR,data:i})=>({ok:!1,error:e,data:i,message:t,httpStatus:r,bucket:n}),internalZodParseError=(e="Zod parse error",t,r)=>customError({error:"zodParseError",message:e,data:{raw:t,error:r},httpStatus:500,bucket:LogBucket.SYSTEM_ERROR}),INITIAL_SCHEMA_VERSION=1,invalidSchemaVersionError=(e,t)=>customError({error:"invalidSchemaVersion",message:e,data:t,httpStatus:500,bucket:LogBucket.SYSTEM_ERROR});class SchemaVersion{constructor(t){Xe(this,"number");Xe(this,"schema");Xe(this,"prevVersion");Xe(this,"migrate");this.schema=t.schema,"number"in t?(this.number=t.number,this.migrate=t.migrate,this.prevVersion=t.prevVersion):this.number=t.initialVersionOverride??INITIAL_SCHEMA_VERSION}next({schema:t,migrate:r}){return new SchemaVersion({schema:t,number:this.number+1,migrate:r,prevVersion:this})}parseDocumentVersion(t){if(t._version===this.number){const r=this.schema.safeParse(t);return r.success?ok(r.data):internalZodParseError("Failed to parse document against schema",t,r)}if(t._version{const n=e.parseDocumentVersion(t);return n.ok?{_version:e.number,...n.data}:(n.error==="zodParseError"?n.data.error.error.issues.forEach(r.addIssue):n.error==="invalidSchemaVersion"?r.addIssue({code:"custom",message:n.message}):assertNever(n),z.NEVER)})}const classSchema=z.enum(["shiny","pulse","focus-within:ring-2","animate-fade-in","animate-fade-in-left","animate-fade-in-right","animate-fade-in-up","animate-fade-in-down","animate-slide-up","animate-slide-down","animate-slide-left","animate-slide-right","placeholder-primary-400","placeholder-accent-foreground-400","placeholder-accent-400","placeholder-background-400"]),cssSchema=z.record(z.string().optional()),stylesByStateSchema=z.object({default:cssSchema.optional(),hover:cssSchema.optional(),focusWithin:cssSchema.optional(),disabled:cssSchema.optional(),error:cssSchema.optional(),placeholder:cssSchema.optional()}),ERROR_CLASSNAME="alia-error",stylesByBreakpointSchema=z.object({classes:z.array(classSchema).optional(),default:stylesByStateSchema.optional(),1024:stylesByStateSchema.optional()}),DEFAULT_STYLES={classes:[],default:{default:{}}};function buildDefaultStyles(e,t=[]){return{classes:t,default:{default:e}}}const sharedStyleHandleSchema=z.string().brand("SharedStyleHandle"),sharedStyleSchema=z.object({handle:sharedStyleHandleSchema,title:z.string(),styles:stylesByBreakpointSchema});function SHARED_STYLE_CLASSNAME(e){return e?`alia-style-${e}`:void 0}function buildSharedStyle(e,t,r=DEFAULT_STYLES){return{handle:t,title:e,styles:r}}const ADDITIONAL_PREFIX$1="--additional-color-";function dumpColorVariable(e){return typeof e=="number"?`${ADDITIONAL_PREFIX$1}${e}`:e}const fontsSchema=z.object({body:z.string(),display:z.string(),additional:z.array(z.string())}),ADDITIONAL_PREFIX="--additional-font-";function dumpFontVariable(e){return typeof e=="number"?`${ADDITIONAL_PREFIX}${e}`:e}const stylesSchema=z.object({text:z.array(sharedStyleSchema),button:z.array(sharedStyleSchema),input:z.array(sharedStyleSchema)}),stylesOverrideSchema=z.object({text:z.array(sharedStyleSchema).optional(),button:z.array(sharedStyleSchema).optional(),input:z.array(sharedStyleSchema).optional()}),HEADING_1_HANDLE="heading-1",HEADING_2_HANDLE="heading-2",HEADING_DEFAULT_HANDLE="heading-default",BODY_1_HANDLE="body-1",BODY_2_HANDLE="body-2",BODY_DEFAULT_HANDLE="body-default",COMPLIANCE_HANDLE="compliance",LINK_HANDLE="link",PRIMARY_BUTTON_HANDLE="button-primary",SECONDARY_BUTTON_HANDLE="button-secondary",PLAIN_BUTTON_HANDLE="button-plain",ICON_BUTTON_HANDLE="button-icon",DEFAULT_INPUT_HANDLE="input",hexSchema=z.string().regex(/^#([0-9a-fA-F]{6})$/),colorsSchema=z.object({primary:hexSchema,accent:hexSchema,background:hexSchema,accentForeground:hexSchema,additional:z.array(hexSchema)}),borderRadiusSchema=z.number().min(0),schema=z.object({fonts:fontsSchema,colors:colorsSchema,borderRadius:borderRadiusSchema,styles:stylesSchema}),v1$4=new SchemaVersion({schema}),overrideSchema=z.object({fonts:fontsSchema.optional(),colors:colorsSchema.optional(),borderRadius:borderRadiusSchema.optional(),styles:stylesOverrideSchema.optional()}),overrideV1=new SchemaVersion({schema:overrideSchema}),BORDER_RADIUS_VARIABLE="--border-radius-lg";function dumpThemeVariable(e){if(e.type==="font")return dumpFontVariable(e.font);if(e.type==="color")return dumpColorVariable(e.color);if(e.type==="borderRadius")return BORDER_RADIUS_VARIABLE;assertNever(e)}function overrideThemeConfig(e,t){var r,n,i,s,l,c;return{_version:e._version,colors:(t==null?void 0:t.colors)??e.colors,fonts:(t==null?void 0:t.fonts)??e.fonts,borderRadius:(t==null?void 0:t.borderRadius)??e.borderRadius,styles:{text:((r=t==null?void 0:t.styles)==null?void 0:r.text)??((n=e.styles)==null?void 0:n.text),button:((i=t==null?void 0:t.styles)==null?void 0:i.button)??((s=e.styles)==null?void 0:s.button),input:((l=t==null?void 0:t.styles)==null?void 0:l.input)??((c=e.styles)==null?void 0:c.input)}}}createVersionedSchema(v1$4);const themeOverrideConfigSchema=createVersionedSchema(overrideV1);overrideV1.literal({}),v1$4.literal({fonts:{body:"DM Sans",display:"DM Serif Display",additional:[]},colors:{primary:"#000000",accent:"#3D5A80",background:"#FAFAFA",accentForeground:"#FFFFFF",additional:[]},borderRadius:8,styles:{text:[buildSharedStyle("Heading 1",HEADING_1_HANDLE,buildDefaultStyles({fontFamily:dumpCSSVariable(dumpFontVariable("--display-font")),fontSize:"64px",fontWeight:"700",letterSpacing:"-2px"})),buildSharedStyle("Heading 2",HEADING_2_HANDLE,buildDefaultStyles({fontFamily:dumpCSSVariable(dumpFontVariable("--display-font")),fontSize:"48px",fontWeight:"600",letterSpacing:"-1px"})),buildSharedStyle("Heading (education)",HEADING_DEFAULT_HANDLE,buildDefaultStyles({fontFamily:dumpCSSVariable(dumpFontVariable("--display-font")),fontSize:"32px",fontWeight:"600"})),buildSharedStyle("Body 1",BODY_1_HANDLE,buildDefaultStyles({fontSize:"24px",fontWeight:"500"})),buildSharedStyle("Body 2",BODY_2_HANDLE,buildDefaultStyles({fontSize:"20px",fontWeight:"500"})),buildSharedStyle("Body (default)",BODY_DEFAULT_HANDLE,buildDefaultStyles({fontSize:"16px",color:`rgb(${dumpCSSVariable(dumpColorVariable("--primary-color"))})`,fontFamily:dumpCSSVariable(dumpFontVariable("--body-font")),lineHeight:"1.2"})),buildSharedStyle("Compliance",COMPLIANCE_HANDLE,buildDefaultStyles({fontSize:"10px",color:`rgb(${dumpCSSVariable(dumpColorVariable("--primary-color"))} / 0.5)`,lineHeight:"1.1"}))],button:[buildSharedStyle("Primary button",PRIMARY_BUTTON_HANDLE,{classes:["shiny"],default:{default:{borderWidth:"2px",borderColor:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))})`,borderRadius:dumpCSSVariable(dumpThemeVariable({type:"borderRadius"})),color:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-foreground"))})`,backgroundColor:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))})`,padding:"1rem",fontSize:"18px"},disabled:{opacity:"0.5"}}}),buildSharedStyle("Secondary button",SECONDARY_BUTTON_HANDLE,{default:{default:{borderWidth:"2px",borderColor:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))})`,borderRadius:dumpCSSVariable(dumpThemeVariable({type:"borderRadius"})),color:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))})`,padding:"0.625rem",fontSize:"18px"},disabled:{opacity:"0.5"}}}),buildSharedStyle("Plain button",PLAIN_BUTTON_HANDLE,{default:{default:{color:`rgb(${dumpCSSVariable(dumpColorVariable("--primary-color"))} / 0.7)`,borderColor:`rgb(${dumpCSSVariable(dumpColorVariable("--primary-color"))} / 0.8)`,textDecoration:"underline",fontSize:"16px"},disabled:{opacity:"0.5"}}}),buildSharedStyle("Icon button",ICON_BUTTON_HANDLE,{default:{default:{borderRadius:dumpCSSVariable(dumpThemeVariable({type:"borderRadius"})),fontFamily:dumpCSSVariable(dumpFontVariable("--display-font")),fontSize:"18px",color:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-foreground"))})`,fontWeight:"600",backgroundColor:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))})`,padding:"0.75rem"},disabled:{opacity:"0.5"}}})],input:[buildSharedStyle("Input",DEFAULT_INPUT_HANDLE,{classes:["focus-within:ring-2"],default:{default:{padding:"1rem",borderWidth:"1px",borderRadius:dumpCSSVariable(dumpThemeVariable({type:"borderRadius"})),fontSize:"18px",color:"rgb(0 0 0 / 1)",backgroundColor:"rgb(255 255 255 / 1)",borderColor:`rgb(${dumpCSSVariable(dumpColorVariable("--primary-color"))} / 0.4)`},focusWithin:{borderColor:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))})`,"--tw-ring-color":`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))} / 0.5)`},error:{"--tw-ring-color":"#fca5a5"}}})]}});const pathGlob=z.string().transform(e=>removePrecedingSlash(e)).brand("pathGlob"),pathGlobsSchema=z.array(pathGlob);function removePrecedingSlash(e){return e.startsWith("/")?e.slice(1):e}function anyPathGlob(e,t){return anyGlob(e,removePrecedingSlash(t))}const redirectOnApplySchema=z.object({path:z.string(),exceptIfOnPaths:pathGlobsSchema}),DEFAULT_EXCEPT_IF_ON_PATHS=["/products/*","/collections/*"],commonRewardSchema=z.object({redirectOnApply:redirectOnApplySchema.optional(),integrationOverrides:integrationOverridesSchema.optional(),hideDiscountCode:z.enum(["email","sms"]).optional(),disableAutoApply:z.boolean().optional()}),urlParamSchema=z.object({name:z.string(),value:z.string()}),appendParamsSchema=z.array(urlParamSchema);function appendParamsToRedirectOnApply(e){const t=new URLSearchParams;return e.forEach(({name:r,value:n})=>{t.append(r,n)}),{path:`/#?${t.toString()}`,exceptIfOnPaths:[]}}const closePopupAction=createVersionedSchema(new SchemaVersion({schema:z.object({type:z.literal("closePopup"),appendParams:appendParamsSchema.optional()})}).next({schema:z.object({type:z.literal("closePopup"),redirect:redirectOnApplySchema.optional()}),migrate:e=>({...e,redirect:e.appendParams?appendParamsToRedirectOnApply(e.appendParams):void 0})})),DEFAULT_CLOSE_POPUP_ACTION={_version:2,type:"closePopup"},stepAction=z.object({type:z.literal("step"),step:z.discriminatedUnion("type",[z.object({type:z.literal("next")}),z.object({type:z.literal("mostRecent"),otherwise:z.string()}),z.object({type:z.literal("step"),stepID:z.string()})])}),floatingButtonAction=z.object({type:z.literal("floatingButton"),stepID:z.string()}),rewardAction=z.object({type:z.literal("reward"),rewardID:z.number(),applyImmediately:z.boolean().optional()}),pollAnswerAction=z.object({type:z.literal("pollAnswer"),questionUUID:z.string(),questionText:z.string(),answerUUID:z.string(),answer:z.string()}),addToCartAction=z.object({type:z.literal("addToCart"),variantIDs:z.array(z.string())}),openURLAction=z.object({type:z.literal("tapToText"),url:z.string(),newTab:z.boolean().optional(),tapToText:z.boolean().optional()}),customCodeAction=z.object({type:z.literal("customCode"),code:z.string()}),popupActionSchema=z.union([closePopupAction,stepAction,floatingButtonAction,rewardAction,pollAnswerAction,addToCartAction,openURLAction,customCodeAction]),countdownFixedTimeSchema=z.object({type:z.literal("fixedTime"),secs:z.number().optional(),mins:z.number().optional(),hours:z.number().optional()}),countdownToDateSchema=z.object({type:z.literal("toDate"),date:z.string().datetime({offset:!0})}),countdownToEndOfSchema=z.object({type:z.literal("toEndOf"),unit:z.enum(["minute","hour","day","week","month","year"])}),countdownSchema=z.object({type:z.literal("countdown"),target:z.discriminatedUnion("type",[countdownFixedTimeSchema,countdownToDateSchema,countdownToEndOfSchema]),styles:stylesByBreakpointSchema.optional(),sharedStyle:sharedStyleHandleSchema.optional()}),nodeIdSchema=z.string().brand("NodeId"),spinToWinSchema=z.object({type:z.literal("spinToWin"),slices:z.array(z.object({uuid:z.string(),text:z.string(),probability:z.number(),actions:z.array(popupActionSchema).optional()})),spinDuration:z.number(),waitDuration:z.number(),styles:stylesByBreakpointSchema.optional()}),iconNameSchema=z.enum(ICONS),iconNodeSchema=z.object({type:z.literal("icon"),icon:iconNameSchema,actions:z.array(popupActionSchema),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),textNodeSchema=z.object({type:z.literal("text"),markdown:z.string().optional(),variant:z.string().optional(),inline:z.boolean().optional(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),breakNodeSchema=z.object({type:z.literal("break")}),imgNodeSchema=z.object({type:z.literal("image"),alt:z.string(),source:z.string(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),rootOptionsSchema=z.object({modal:z.object({hideOverflow:z.boolean()}).optional()}),DEFAULT_ROOT_OPTIONS={modal:{hideOverflow:!0}},divNodeSchema=z.object({type:z.literal("div"),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional(),onClickActions:z.array(popupActionSchema).optional(),rootOptions:rootOptionsSchema.optional()}),copyNodeSchema=z.object({type:z.literal("copy"),text:z.string(),rewardID:z.number().optional(),applyImmediately:z.boolean().optional(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),buttonNodeSchema=z.object({type:z.literal("button"),icon:iconNameSchema.optional(),iconActions:z.array(popupActionSchema).optional(),rightIcon:iconNameSchema.optional(),rightIconActions:z.array(popupActionSchema).optional(),text:z.string().optional(),variant:z.enum(["primary","secondary","plain","icon","none"]),submit:z.boolean().optional(),actions:z.array(popupActionSchema),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),validationMessageSchema=z.object({required:z.string().optional(),invalid:z.string().optional()}),questionSchema=z.object({type:z.literal("question"),uuid:z.string(),questionText:z.string()}),questionAnswerSchema=z.object({type:z.literal("questionAnswer"),uuid:z.string(),answerText:z.string(),button:buttonNodeSchema}),questionAnswerCheckboxSchema=z.object({type:z.literal("questionAnswerCheckbox"),uuid:z.string(),answerText:z.string(),styles:stylesByBreakpointSchema.optional()}),questionAnswerDropdownSchema=z.object({type:z.literal("questionAnswerDropdown"),answers:z.array(z.object({uuid:z.string(),text:z.string(),value:z.string().optional()})),placeholder:z.string().optional(),styles:stylesByBreakpointSchema.optional(),validationMessages:validationMessageSchema.optional()}),DEFAULT_NAME_INPUT={required:!0},nameInputNodeSchema=z.object({type:z.literal("nameInput"),required:z.boolean().default(DEFAULT_NAME_INPUT.required),validationMessages:validationMessageSchema.optional(),placeholder:z.string().optional(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),DEFAULT_EMAIL_INPUT={required:!0},emailInputNodeSchema=z.object({type:z.literal("emailInput"),required:z.boolean().default(DEFAULT_EMAIL_INPUT.required),validationMessages:validationMessageSchema.optional(),placeholder:z.string().optional(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),DEFAULT_PHONE_INPUT={required:!0},phoneInputNodeSchema=z.object({type:z.literal("phoneInput"),required:z.boolean().default(DEFAULT_PHONE_INPUT.required),validationMessages:validationMessageSchema.optional(),defaultCountryCode:countryCodeSchema.optional(),placeholder:z.string().optional(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),freeTextFormatSchema=z.enum(["DD-MM","MM-DD","DD-MM-YYYY","MM-DD-YYYY","YYYY-MM-DD","DD/MM","MM/DD","DD/MM/YYYY","MM/DD/YYYY","YYYY/MM/DD","ZIP-5"]),freeTextNodeSchema=z.object({type:z.literal("freeText"),name:z.string(),label:z.string(),validationMessages:validationMessageSchema.extend({minAge:z.object({age:z.number(),message:z.string()}).optional()}).optional(),placeholder:z.string().optional(),format:freeTextFormatSchema.optional(),multiline:z.boolean().optional(),optional:z.boolean().optional(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),yesNoCheckboxSchema=z.object({type:z.literal("yesNoCheckbox"),name:z.string().optional(),required:z.object({message:z.string()}).optional(),styles:stylesByBreakpointSchema.optional(),sharedStyle:sharedStyleHandleSchema.optional()}),afterSubmitBranchSchema=z.object({if:subscriptionResultSchema,then:z.array(popupActionSchema)}),formSubmitPropertySchema=z.object({key:z.string(),value:z.string()}),formSchema=z.object({type:z.literal("form"),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional(),integrationOverrides:integrationOverridesSchema.optional(),subscribeImmediately:z.boolean().default(!0),afterSubmitBranches:z.array(afterSubmitBranchSchema).optional(),afterSubmit:z.array(popupActionSchema),submitProperties:z.array(formSubmitPropertySchema).optional(),errorMessage:z.string().optional()}),customCodeNodeSchema=z.object({type:z.literal("customCode"),code:z.string()}),CUSTOM_CODE_ARGS_KEYS=["document","mainDocument","hooks.nextStep","$alia"],educationSignUpSettingsSchema=z.object({name:z.enum(["disabled","required","optional"]),email:z.enum(["disabled","required","optional"]),phone:z.enum(["disabled","required","optional"]),defaultCountryCode:countryCodeSchema.optional(),splitSignUp:z.boolean(),namePlaceholder:z.string().optional(),nameValidationMessages:validationMessageSchema.optional(),emailConsentText:z.string().optional(),emailPlaceholder:z.string().optional(),emailValidationMessages:validationMessageSchema.optional(),smsConsentText:z.string().optional(),smsPlaceholder:z.string().optional(),smsValidationMessages:validationMessageSchema.optional()}),DEFAULT_SIGN_UP_SETTINGS={name:"disabled",email:"required",phone:"required",splitSignUp:!1,defaultCountryCode:"US",namePlaceholder:"Your name",emailConsentText:void 0,emailPlaceholder:"Your email address",smsConsentText:void 0,smsPlaceholder:"Your phone number"},lessonsNodeSchema=z.object({type:z.literal("lessons"),config:z.object({tiers:z.array(z.object({lessonID:z.number(),rewardID:z.number()})),skipHomeScreen:z.boolean().optional(),showPollResults:z.boolean().optional()}),signUp:educationSignUpSettingsSchema.default(DEFAULT_SIGN_UP_SETTINGS),preview:z.object({lessonID:z.number(),slideIndex:z.number()}).optional()}),tracksNodeSchema=z.object({type:z.literal("tracks"),config:z.object({tracksID:z.number(),startingTrack:z.string().optional(),showPollResults:z.boolean().optional()}).optional(),signUp:educationSignUpSettingsSchema.default(DEFAULT_SIGN_UP_SETTINGS),preview:z.object({trackUUID:z.string().uuid(),slideUUID:z.string().uuid()}).optional()}),layoutIDSchema=z.string().brand("LayoutID"),outletNodeSchema=z.object({type:z.literal("outlet"),id:z.literal("_default")}),baseNodeSchema=z.object({id:nodeIdSchema,title:z.string().optional(),node:z.discriminatedUnion("type",[buttonNodeSchema,iconNodeSchema,textNodeSchema,breakNodeSchema,imgNodeSchema,divNodeSchema,copyNodeSchema,nameInputNodeSchema,emailInputNodeSchema,phoneInputNodeSchema,freeTextNodeSchema,yesNoCheckboxSchema,formSchema,questionSchema,questionAnswerSchema,questionAnswerCheckboxSchema,questionAnswerDropdownSchema,customCodeNodeSchema,outletNodeSchema,lessonsNodeSchema,tracksNodeSchema,spinToWinSchema,countdownSchema])}),templateV6NodeSchema=baseNodeSchema.extend({children:z.array(z.lazy(()=>templateV6NodeSchema)).optional()});function getSteps(e){return(e==null?void 0:e.steps.filter(t=>!t.isFloatingButton))??[]}function getFloatingButtons(e){return(e==null?void 0:e.steps.filter(t=>t.isFloatingButton))??[]}function getAllNodesInNode(e,t=[]){var r;return t.push(e),(r=e.children)==null||r.forEach(n=>getAllNodesInNode(n,t)),t}function getTemplateString(e){return`{{${e}}}`}function getCountdownTemplateString(e={secs:30}){return`countdown(${JSON.stringify(e)})`}function getSMSConsentText({termsURL:e,privacyURL:t,legalName:r}){return`By clicking this button, you agree to receive recurring automated marketing text messages (e.g. AI content, cart reminders) from ${r} at the number you provide. Consent not a condition of purchase. We may share info with service providers. Reply HELP for help & STOP to cancel. Msg frequency varies. Msg & data rates may apply. By clicking this button, you also agree to our [Terms](${e}) & [Privacy Policy](${t}).`}const layout=z.object({id:layoutIDSchema,title:z.string(),template:z.string().optional(),children:templateV6NodeSchema}),stepLayoutsSchema=z.object({default:layoutIDSchema,1024:layoutIDSchema}),step=z.object({id:z.string(),title:z.string(),builderLabel:z.string().optional(),layouts:stepLayoutsSchema,isFloatingButton:z.boolean().optional(),children:z.array(templateV6NodeSchema)}),v6Schema=z.object({steps:z.array(step),sharedStyles:z.array(sharedStyleSchema).default([]),layouts:z.array(layout).default([]),themeOverride:themeOverrideConfigSchema.optional()}),v6=new SchemaVersion({initialVersionOverride:6,schema:v6Schema}),popupTemplateSchema=createVersionedSchema(v6);v6.literal.bind(v6);const targetingRuleIDSchema=z.string().brand("TargetingRuleUUID"),targetingRuleResourceSchema=z.discriminatedUnion("type",[z.object({type:z.literal("targetingRule"),id:targetingRuleIDSchema}),z.object({type:z.literal("segment"),id:z.number().int()})]),targetingRuleCond=z.object({type:z.enum(["inTargetingRule","notInTargetingRule"]),resource:targetingRuleResourceSchema}),customCodeCond=z.object({type:z.literal("customCode"),code:z.string()}),ALL_COOKIES=["klaviyo","smsbump","unveild","upstack"],cookieSchema=z.enum(ALL_COOKIES),cookieIdentificationCond=z.object({type:z.enum(["cookie.identified","cookie.notIdentified"]),exclude:z.array(cookieSchema)}),klaviyoIdentifiedCond=z.object({type:z.enum(["klaviyo.identified","klaviyo.notIdentified"])}),klaviyoListCond=z.object({type:z.enum(["klaviyo.inList","klaviyo.notInList"]),listID:z.string().optional()}),klaviyoSegmentCond=z.object({type:z.enum(["klaviyo.inSegment","klaviyo.notInSegment"]),segmentID:z.string().optional()}),numFilterSchema=z.object({operator:z.enum(["eq","neq","gt","gte","lt","lte"]),value:z.number()}),relativeDateSchema=z.object({unit:z.enum(["seconds","minutes","hours","days","weeks","months","years"]),value:z.number()}),relativeDateFilterSchema=relativeDateSchema.extend({operator:z.enum(["gt","lt"])}),pagesCond=z.object({type:z.enum(["isOnPage","isNotOnPage","hasVisitedPage","hasNotVisitedPage"]),pageType:z.enum(["url","path"]),matchType:z.enum(["exact","contains"]),values:z.array(z.string())}),numPagesViewedCond=z.object({type:z.literal("pages.numPagesViewed"),scope:z.enum(["session"]),value:numFilterSchema}),numSessionsCond=z.object({type:z.literal("pages.numSessions"),scope:z.enum(["session"]),value:numFilterSchema}),shopifyNumOrdersCond=z.object({type:z.literal("shopify.numOrders"),value:numFilterSchema}),shopifyMarketsCond=z.object({type:z.enum(["shopify.inMarkets","shopify.notInMarkets"]),markets:z.array(z.string())}),shopifyCountriesCond=z.object({type:z.enum(["shopify.inCountries","shopify.notInCountries"]),countries:z.array(z.string())}),shopifyLocalesCond=z.object({type:z.enum(["shopify.inLocales","shopify.notInLocales"]),locales:z.array(z.string())}),shopifyCustomerPrivacyCond=z.object({type:z.literal("shopify.customerPrivacyAllowed"),consentTypes:z.array(z.enum(["marketing","saleOfData","analyticsProcessing","preferencesProcessing"]))}),utmSourceCond=z.object({type:z.enum(["traffic.utmSourceIsIn","traffic.utmSourceIsNotIn"]),values:z.array(z.string().nullable())}),utmMediumCond=z.object({type:z.enum(["traffic.utmMediumIsIn","traffic.utmMediumIsNotIn"]),values:z.array(z.string().nullable())}),userCreatedAtCond=z.object({type:z.literal("user.createdAt"),value:relativeDateFilterSchema}),userDeviceCond=z.object({type:z.literal("user.device"),device:z.enum(["mobile","desktop"])}),userCountriesCond=z.object({type:z.enum(["user.inCountries","user.notInCountries"]),countries:z.array(countryCodeSchema)}),userRegionsCond=z.object({type:z.enum(["user.inRegions","user.notInRegions"]),regions:z.array(z.string())}),userActionDateFilterSchema=z.object({type:z.literal("userAction.date"),value:relativeDateFilterSchema}),userActionSegmentsFilterSchema=z.object({type:z.enum(["userAction.inSegments","userAction.notInSegments"]),segmentIDs:z.array(z.number().int())}),userActionFilterSchema=z.discriminatedUnion("type",[userActionDateFilterSchema,userActionSegmentsFilterSchema]),actionSchema=z.object({type:z.enum(["popupStep","popupClose","emailSignUp","smsSignUp","emailOptIn","smsOptIn","pollAnswer","claimedReward","attributedOrder"])}),userActionCond=z.object({type:z.enum(["user.hasDoneAction","user.hasNotDoneAction"]),action:actionSchema,filters:z.array(userActionFilterSchema).optional()}),targetingCondSchema=z.discriminatedUnion("type",[pagesCond,numPagesViewedCond,numSessionsCond,userActionCond,userCountriesCond,userRegionsCond,userDeviceCond,userCreatedAtCond,shopifyNumOrdersCond,shopifyMarketsCond,shopifyLocalesCond,shopifyCountriesCond,shopifyCustomerPrivacyCond,klaviyoIdentifiedCond,klaviyoListCond,klaviyoSegmentCond,targetingRuleCond,customCodeCond,utmSourceCond,utmMediumCond,cookieIdentificationCond]),andRuleSchema=z.object({type:z.literal("and"),conds:z.array(targetingCondSchema)}),orRuleSchema=z.object({type:z.literal("or"),conds:z.array(targetingCondSchema)}),targetingRuleSchema=z.discriminatedUnion("type",[andRuleSchema,orRuleSchema]),targetingRuleItemSchema=z.object({id:targetingRuleIDSchema,title:z.string(),description:z.string().optional(),config:targetingRuleSchema});function findCycles(e){var r;for(const n of e){const i=t(n);if(i)return`${(r=i.at(0))==null?void 0:r.title} references ${i.slice(1).map(s=>s.title).join(", which references ")}`}return!1;function t(n,i=[]){if(i.some(s=>s.id===n.id))return[...i,n];for(const s of n.config.conds)if(s.type==="inTargetingRule"||s.type==="notInTargetingRule"){const l=e.find(h=>h.id===s.resource.id);if(!l)continue;const c=t(l,[...i,n]);if(c)return c}return!1}}const targetingRulesConfigSchema=z.object({rules:z.array(targetingRuleItemSchema)});targetingRulesConfigSchema.superRefine((e,t)=>{const r=findCycles(e.rules);return r&&t.addIssue({code:z.ZodIssueCode.custom,message:`Circular targeting rule logic: ${r}`}),e});const timeOnPageCondSchema=z.object({type:z.literal("timeOnPage"),delay:z.number().optional()}),mouseLeaveCondSchema=z.object({type:z.literal("mouseLeave")}),idleCondSchema=z.object({type:z.literal("idle"),seconds:z.number().int()}),quickScrollUpCondSchema=z.object({type:z.literal("quickScrollUp")}),scrollDepthCondSchema=z.object({type:z.literal("scrollDepth"),depth:z.number().int()}),addToCartCondSchema=z.object({type:z.literal("addToCart"),onlyVariantIds:z.array(z.string()).optional()}),cartValueCondSchema=z.object({type:z.literal("cartValue"),value:z.number()}),triggeringCondSchema=z.discriminatedUnion("type",[timeOnPageCondSchema,mouseLeaveCondSchema,idleCondSchema,quickScrollUpCondSchema,scrollDepthCondSchema,addToCartCondSchema,cartValueCondSchema]),triggerIDSchema=z.string().brand("triggerID");z.object({key:z.string(),coefficient:z.number()});const smartTriggerSchema=z.object({type:z.literal("smart"),id:triggerIDSchema,parameters:z.array(z.any()).optional(),delayFromLastTrigger:z.number(),step:z.string().optional()}),basicTriggerSchema=z.object({type:z.literal("basic"),id:triggerIDSchema,conds:z.array(triggeringCondSchema),requireAllConds:z.boolean().optional(),step:z.string().optional(),device:z.enum(["mobile","desktop"]).optional()}),triggerSchema$1=z.discriminatedUnion("type",[basicTriggerSchema,smartTriggerSchema]),bailOfferSchema$1=z.object({rewardID:z.number().int().optional()}),exitIntentSchema=z.object({popupID:z.number().int()}),lessonsSchema$1=z.array(z.object({lessonID:z.number().int(),rewardID:z.number().int()})),lessonsContentSchema$1=z.object({type:z.literal("lessons"),skipHomeScreen:z.boolean().optional(),data:lessonsSchema$1,bailOffer:bailOfferSchema$1.optional()}),tracksSchema$1=z.object({tracksID:z.number().int(),startingTrack:z.string().uuid()}),tracksContentSchema$1=z.object({type:z.literal("tracks"),data:tracksSchema$1,bailOffer:bailOfferSchema$1.optional()}),contentSchema$1=z.union([lessonsContentSchema$1,tracksContentSchema$1]),v1$3=new SchemaVersion({schema:z.object({popupID:z.number().int().optional(),exitIntent:exitIntentSchema.optional(),content:contentSchema$1.optional(),settings:deepPartialMerchantSettingsSchema.optional()})}),immediateTriggerSchema=z.object({type:z.literal("immediate"),delay:z.number().optional()}),exitIntentTriggerSchema=z.object({type:z.literal("exitIntent")}),idleTriggerSchema=z.object({type:z.literal("idle"),seconds:z.number().int()}),addToCartTriggerSchema=z.object({type:z.literal("addToCart"),onlyVariantIds:z.array(z.string()).optional()}),triggerSchema=z.union([immediateTriggerSchema,exitIntentTriggerSchema,idleTriggerSchema,addToCartTriggerSchema]),DEFAULT_HIDE_AFTER_FUNNEL_STEP="signedUp",hideAfterFunnelStepSchema=z.enum(["signedUp","claimedReward","never"]).default(DEFAULT_HIDE_AFTER_FUNNEL_STEP),popupSchema$1=z.object({id:z.number().int(),triggers:z.array(triggerSchema).optional(),desktopTriggers:z.array(triggerSchema).optional(),hideAfterFunnelStep:hideAfterFunnelStepSchema}),bailOfferSchema=z.object({rewardID:z.number().int().optional()}),lessonsSchema=z.array(z.object({lessonID:z.number().int(),rewardID:z.number().int()})),lessonsContentSchema=z.object({type:z.literal("lessons"),skipHomeScreen:z.boolean().optional(),data:lessonsSchema,bailOffer:bailOfferSchema.optional()}),tracksSchema=z.object({tracksID:z.number().int(),startingTrack:z.string().uuid()}),tracksContentSchema=z.object({type:z.literal("tracks"),data:tracksSchema,bailOffer:bailOfferSchema.optional()}),contentSchema=z.union([lessonsContentSchema,tracksContentSchema]),v2$3=v1$3.next({schema:z.object({popups:z.array(popupSchema$1),content:contentSchema.optional(),settings:deepPartialMerchantSettingsSchema.optional()}),migrate:e=>{const t=[];return e.popupID&&t.push({id:e.popupID,hideAfterFunnelStep:DEFAULT_HIDE_AFTER_FUNNEL_STEP}),e.exitIntent&&t.push({id:e.exitIntent.popupID,triggers:[{type:"exitIntent"},{type:"idle",seconds:30}],hideAfterFunnelStep:DEFAULT_HIDE_AFTER_FUNNEL_STEP}),{content:e.content,settings:e.settings,popups:t}}}),popupSchema=z.object({config:popupTemplateSchema}),popupTriggerSchema=z.object({triggers:z.array(triggerSchema$1),triggerAgainAfter:relativeDateSchema.optional(),notIfAnyPopupShownInLast:relativeDateSchema.optional(),preloadImages:z.boolean().optional()});function getNewPopupID(e){return e*2}v2$3.next({schema:z.object({popup:popupSchema.optional(),settings:deepPartialMerchantSettingsSchema.optional(),integrationOverrides:integrationOverridesSchema.optional(),triggers:popupTriggerSchema.optional()}),migrate:()=>{throw new Error("No older versions remaining")}});const getDocument=()=>document;function getWindowProperty(e){return window[e]}function setWindowProperty(e,t){window[e]=t}const BLACKCROW="blackcrow";function sendBlackCrowEvent(e){setWindowProperty(BLACKCROW,getWindowProperty(BLACKCROW)||[]),getWindowProperty(BLACKCROW).push(e)}const blackCrowIntegration={onView:e=>{sendBlackCrowEvent({app_name:"predictive_offer",trigger:"impression",data:{form_id:e.toString()}})},onSignup:(e,t)=>{t.email&&sendBlackCrowEvent({app_name:"predictive_offer",trigger:"submit",data:{form_id:e.toString(),type:"email",email:t.email}}),t.phone&&sendBlackCrowEvent({app_name:"predictive_offer",trigger:"submit",data:{form_id:e.toString(),type:"sms",phone_number:t.phone}})},onClose:e=>{sendBlackCrowEvent({app_name:"predictive_offer",trigger:"close",data:{form_id:e.toString()}})}},EVENT_PREFIX="alia:";function fireDOMEvent(e){const t=EVENT_PREFIX+e.type,r=new CustomEvent(t,{detail:e});getDocument().dispatchEvent(r)}function useOnPopupView(){const e=useCommonArgs();return reactExports.useCallback(()=>{blackCrowIntegration.onView(e.popupID),fireDOMEvent({type:"popupView",...e})},[e])}function useOnPopupClose(){const e=useCommonArgs();return reactExports.useCallback(()=>{blackCrowIntegration.onClose(e.popupID),fireDOMEvent({type:"popupClose",...e})},[e])}function useOnPollAnswered(){const e=useCommonArgs();return reactExports.useCallback(t=>{fireDOMEvent({...e,type:"pollAnswered",...t})},[e])}function useOnSignup(){const e=useCommonArgs();return reactExports.useCallback(t=>{blackCrowIntegration.onSignup(e.popupID,t),fireDOMEvent({...e,type:"signup",email:t.email??void 0,phone:t.phone??void 0})},[e])}function useOnRewardClaimed(){const e=useCommonArgs();return reactExports.useCallback(t=>{fireDOMEvent({...e,type:"rewardClaimed",...t})},[e])}function useCommonArgs(){const{initialData:e}=useCustomerAppContext();return reactExports.useMemo(()=>{var t,r,n,i;return{popupID:getNewPopupID(((t=e.userFlow)==null?void 0:t.flowID)??0),popupTitle:(r=e.userFlow)==null?void 0:r.flowTitle,campaignID:(n=e.userFlow)==null?void 0:n.segmentID,campaignTitle:(i=e.userFlow)==null?void 0:i.segmentTitle}},[e])}function useClientIntegrations(){return{onPopupView:useOnPopupView(),onPopupClose:useOnPopupClose(),onPollAnswered:useOnPollAnswered(),onSignup:useOnSignup(),onRewardClaimed:useOnRewardClaimed()}}function useCreateUserAction(){const{mediator:e,initialData:t}=useCustomerAppContext();return reactExports.useCallback(async r=>{var n;t.userFlow&&await((n=e==null?void 0:e.userActionsStore)==null?void 0:n.createAction({userID:t.user.id,merchantID:t.user.merchantID,flowID:t.userFlow.flowID,segmentID:t.userFlow.segmentID,userFlowID:t.userFlow.id,data:r}))},[e,t])}function createContextWithoutDefault(e){const t=reactExports.createContext(void 0);return{useContext:()=>{const r=reactExports.useContext(t);if(r===void 0)throw new Error(`Context "${e}" must be used inside a Provider`);return r},useOptionalContext:()=>reactExports.useContext(t),Provider:t.Provider}}function createContextWithDefault(e){const t=reactExports.createContext(e);return{useContext:()=>reactExports.useContext(t),Provider:t.Provider}}class Logger{constructor(){Xe(this,"debugExtensionEnabled",!1);Xe(this,"appName","app");window.postMessage({type:"alia:loaded"},"*"),window.addEventListener("message",t=>{t.data&&t.data.type==="alia:debug_extension_enabled"&&(this.debugExtensionEnabled=!0)})}log(...t){console.log(`[Alia ${this.appName}]`,...t)}debug(...t){this.debugExtensionEnabled&&console.log(`%c[Alia ${this.appName} debug]`,"color: cyan",...t)}error(...t){console.error(`[Alia ${this.appName}]`,...t)}}const logger=new Logger;class ShopifyUtils{constructor(){Xe(this,"shopify");this.shopify=getWindowProperty("Shopify")}redirect(t){this.shopify&&(t.startsWith("/")&&(t=t.substring(1)),window.location.href=this.shopify.routes.root+t)}applyCode(t){fetch(`/discount/${t}`)}async addToCart(t){if(this.shopify)try{const r={items:t.map(n=>({id:n,quantity:1}))};await fetch(this.shopify.routes.root+"cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}catch(r){logger.error("Failed to add to cart",r)}}}const v1$2=new SchemaVersion({schema:z.object({title:z.string(),subtitle:z.string(),expirationMins:z.number().min(0).optional(),shopifyCode:z.string().optional(),redirectPathOnApply:z.string().optional(),cta:z.object({text:z.string(),url:z.string()}).optional()})}),v2$2=v1$2.next({schema:z.object({title:z.string(),subtitle:z.string(),expirationMins:z.number().min(0).optional(),shopifyCode:z.string().optional(),cta:z.object({text:z.string(),url:z.string()}).optional(),isUniqueToAlia:z.boolean().default(!0)}).extend(commonRewardSchema.shape),migrate:e=>({...e,redirectOnApply:e.redirectPathOnApply?{path:e.redirectPathOnApply,exceptIfOnPaths:DEFAULT_EXCEPT_IF_ON_PATHS}:void 0})}),customRewardConfigSchema=createVersionedSchema(v2$2),customDiscountDescriptorSchema=z.object({descriptor:z.string(),url:z.string().optional()}),collectionsSchema=z.object({type:z.enum(["collections"]),customDescriptor:customDiscountDescriptorSchema.optional(),collections:z.array(z.object({id:z.string(),title:z.string()}))}),productsSchema=z.object({type:z.enum(["products"]),customDescriptor:customDiscountDescriptorSchema.optional(),products:z.array(z.object({id:z.string(),title:z.string(),variants:z.array(z.object({id:z.string(),title:z.string()})).optional()}))}),itemsSchema=z.union([z.object({type:z.enum(["all"])}),collectionsSchema,productsSchema]),v1$1=new SchemaVersion({schema:z.object({value:z.union([z.object({type:z.enum(["percent"]),percent:z.number().min(0).max(100)}),z.object({type:z.enum(["amount"]),amount:z.number().min(0)})]),expirationMins:z.number().min(0).optional(),minimumRequirement:z.number().min(0).optional(),items:itemsSchema,appliesOnSubscription:z.boolean().optional(),stackable:z.boolean().optional(),customQualifierText:z.string().optional(),redirectPathOnApply:z.string().optional()})}),v2$1=v1$1.next({schema:z.object({value:z.union([z.object({type:z.enum(["percent"]),percent:z.number().min(0).max(100)}),z.object({type:z.enum(["amount"]),amount:z.number().min(0)})]),expirationMins:z.number().min(0).optional(),minimumRequirement:z.number().min(0).optional(),items:itemsSchema,appliesOnSubscription:z.boolean().optional(),stackable:z.boolean().optional(),customQualifierText:z.string().optional(),redirectOnApply:redirectOnApplySchema.optional()}),migrate:e=>({...e,redirectOnApply:e.redirectPathOnApply?{path:e.redirectPathOnApply,exceptIfOnPaths:DEFAULT_EXCEPT_IF_ON_PATHS}:void 0})}),v3=v2$1.next({schema:z.object({value:z.union([z.object({type:z.enum(["percent"]),percent:z.number().min(0).max(100)}),z.object({type:z.enum(["amount"]),amount:z.number().min(0)})]),limitToCustomer:z.boolean().optional(),expirationMins:z.number().min(0).optional(),minimumRequirement:z.number().min(0).optional(),items:itemsSchema,appliesOnSubscription:z.boolean().optional(),combinesWith:z.object({orderDiscounts:z.boolean().optional(),productDiscounts:z.boolean().optional(),shippingDiscounts:z.boolean().optional()}),customQualifierText:z.string().optional()}).extend(commonRewardSchema.shape),migrate:e=>({...e,combinesWith:{orderDiscounts:e.stackable,productDiscounts:e.stackable,shippingDiscounts:e.stackable}})}),discountConfigSchema=createVersionedSchema(v3),v1=new SchemaVersion({schema:z.object({appliesOnSubscription:z.boolean().optional(),stackable:z.boolean().optional(),expirationMins:z.number().min(0).optional(),maximumShippingPrice:z.number().min(0).optional(),minimumRequirement:z.number().min(0).optional(),redirectPathOnApply:z.string().optional()})}),v2=v1.next({schema:z.object({appliesOnSubscription:z.boolean().optional(),stackable:z.boolean().optional(),expirationMins:z.number().min(0).optional(),maximumShippingPrice:z.number().min(0).optional(),minimumRequirement:z.number().min(0).optional(),limitToCustomer:z.boolean().optional(),countries:z.array(z.string()).min(1,"At least one country is required").optional()}).extend(commonRewardSchema.shape),migrate:e=>({...e,redirectOnApply:e.redirectPathOnApply?{path:e.redirectPathOnApply,exceptIfOnPaths:DEFAULT_EXCEPT_IF_ON_PATHS}:void 0})}),freeShippingConfigSchema=createVersionedSchema(v2);z.union([z.object({type:z.literal("discount"),discount:discountConfigSchema}),z.object({type:z.literal("freeShipping"),freeShipping:freeShippingConfigSchema}),z.object({type:z.literal("custom"),custom:customRewardConfigSchema})]);function getRewardConfigProperty(e,t){if(e.type==="discount")return e.discount[t];if(e.type==="freeShipping")return e.freeShipping[t];if(e.type==="custom")return e.custom[t];assertNever(e)}var classnames={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */var hasRequiredClassnames;function requireClassnames(){return hasRequiredClassnames||(hasRequiredClassnames=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var s="",l=0;l["merchants","getMerchant"]);function useGetMerchant(){const{initialData:e}=useCustomerAppContext(),{getQueryKey:t}=useGetMerchantQuery(),r=useServiceFetch();return useSuspenseQuery({queryKey:t(),queryFn:()=>r("GET","/merchants",{}),initialData:e.merchant,staleTime:1/0})}const useGetSettingsQuery=queryManager(()=>["merchants","getSettings"]);function useGetSettings(){const{initialData:e}=useCustomerAppContext(),{getQueryKey:t}=useGetSettingsQuery(),r=useServiceFetch();return useSuspenseQuery({queryKey:t(),queryFn:()=>r("GET","/merchants/settings",{}),initialData:e.settings,staleTime:1/0})}const useGetProductUrlQuery=queryManager(e=>["merchants","getProductUrl",e]);function useGetProductUrl(e){const{getQueryKey:t}=useGetProductUrlQuery(),r=useServiceFetch();return useSuspenseQuery({queryKey:t(e),queryFn:()=>r("GET","/merchants/product-url",{query:e})})}const{Provider:WindowSizeProvider,useContext:useWindowSizeContext}=createContextWithoutDefault("windowSize"),getWidth=()=>Math.min(window.innerWidth,window.outerWidth),getHeight=()=>window.innerHeight,DefaultWindowSizeProvider=({children:e})=>{const[t,r]=reactExports.useState(getWidth()),[n,i]=reactExports.useState(getHeight());return reactExports.useEffect(()=>{const s=()=>{r(getWidth()),i(getHeight())};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),jsx(WindowSizeProvider,{value:{width:t,height:n},children:e})};function useBreakpoint(){const{width:e}=useWindowSizeContext();return e>=1024?"1024":"default"}function useStepLayout(e){const{width:t}=useWindowSizeContext();if(e)return t>=1024?e.layouts[1024]:e.layouts.default}const PREVIEW_POPUP_PORTAL_ID="preview-popup-portal",{Provider:PopupPreviewContextProvider,useOptionalContext:useOptionalContext$3}=createContextWithoutDefault("popup-preview"),usePopupPreviewContext=()=>useOptionalContext$3()??{},PopupPreview=()=>{var b;const e=useWindowSizeContext(),{preview:t}=useCustomerAppContext();if(!t)throw new Error("Preview context not found");const{toParentEvents:r,template:n}=t;reactExports.useEffect(()=>{r==null||r.emit("onLoad")},[r]);const[i]=useMittState("updateTemplate",n),[s,l]=useMittState("onNodeHover",null),[c]=useMittState("onNodeSelect"),[h]=useMittState("setWindowSize",e),m=reactExports.useCallback(S=>r==null?void 0:r.emit("onNodeSelect",S),[r]);return jsx(WindowSizeProvider,{value:h,children:jsx(PopupPreviewContextProvider,{value:{isPreview:!0,highlightedNode:s,setHighlightedNode:l,selectedNode:c,onNodeSelect:m,sizeOverride:h},children:jsx(CommonErrorBoundary,{fallback:jsx(Fragment,{children:"An error occurred"}),children:jsx(Popup,{stepID:(b=i.steps.at(0))==null?void 0:b.id,setStepID:()=>{},history:[],onClosePopup:()=>{},template:i,children:jsx(PreviewPortal,{})})})})})},PreviewPortal=()=>{const e=usePopupThemeConfig();return jsx("div",{style:{[dumpColorVariable("--accent-color")]:hexToRGB(e.colors.accent),[dumpColorVariable("--accent-foreground")]:hexToRGB(e.colors.accentForeground)},className:"relative",id:PREVIEW_POPUP_PORTAL_ID})};function useMittState(e,t=null){const{preview:r}=useCustomerAppContext();if(!r)throw new Error("Preview context not found");const{toChildEvents:n}=r,[i,s]=reactExports.useState((n==null?void 0:n.latest(e))??t);return reactExports.useEffect(()=>(n==null||n.on(e,s),()=>{n==null||n.off(e,s)}),[n,e]),[i,s]}const{useOptionalContext:useOptionalContext$2,Provider:Provider$a}=createContextWithoutDefault("outlet-node"),useOutletNodeContext=useOptionalContext$2,OutletNode=({parentId:e})=>{var r;const t=(r=useLayoutContext())==null?void 0:r.children;return!t||!e?null:jsx(Provider$a,{value:{rootId:e},children:t})},ClickableDiv=reactExports.forwardRef(({onClick:e,disabled:t=!1,className:r,...n},i)=>{const s=()=>{t||e==null||e()},{styles:l,onClick:c,onMouseEnter:h,onMouseLeave:m}=usePreviewNodeContext();return jsx("div",{ref:i,onClick:c??s,tabIndex:0,role:"button",onKeyDown:b=>{b.key==="Enter"&&s()},onMouseEnter:h,onMouseLeave:m,"aria-disabled":t,...n,className:classNames(r),style:l})});ClickableDiv.displayName="ClickableDiv";var DefaultContext={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},IconContext=React.createContext&&React.createContext(DefaultContext),_excluded$9=["attr","size","title"];function _objectWithoutProperties$9(e,t){if(e==null)return{};var r=_objectWithoutPropertiesLoose$9(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$9(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _extends$5(){return _extends$5=Object.assign?Object.assign.bind():function(e){for(var t=1;tReact.createElement(t.tag,_objectSpread$8({key:r},t.attr),Tree2Element(t.child)))}function GenIcon(e){return t=>React.createElement(IconBase,_extends$5({attr:_objectSpread$8({},e.attr)},t),Tree2Element(e.child))}function IconBase(e){var t=r=>{var{attr:n,size:i,title:s}=e,l=_objectWithoutProperties$9(e,_excluded$9),c=i||r.size||"1em",h;return r.className&&(h=r.className),e.className&&(h=(h?h+" ":"")+e.className),React.createElement("svg",_extends$5({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,l,{className:h,style:_objectSpread$8(_objectSpread$8({color:e.color||r.color},r.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),s&&React.createElement("title",null,s),e.children)};return IconContext!==void 0?React.createElement(IconContext.Consumer,null,r=>t(r)):t(DefaultContext)}function MdAccountCircle(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm0 14c-2.03 0-4.43-.82-6.14-2.88a9.947 9.947 0 0 1 12.28 0C16.43 19.18 14.03 20 12 20z"},child:[]}]})(e)}function MdFavorite(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"},child:[]}]})(e)}function MdHelpOutline(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"},child:[]}]})(e)}function MdHelp(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"},child:[]}]})(e)}function MdHome(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"},child:[]}]})(e)}function MdInfo(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"},child:[]}]})(e)}function MdLock(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"},child:[]}]})(e)}function MdLogout(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"},child:[]}]})(e)}function MdOpenInNew(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"},child:[]}]})(e)}function MdRedeem(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 6h-2.18c.11-.31.18-.65.18-1a2.996 2.996 0 0 0-5.5-1.65l-.5.67-.5-.68C10.96 2.54 10.05 2 9 2 7.34 2 6 3.34 6 5c0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM9 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm11 15H4v-2h16v2zm0-5H4V8h5.08L7 10.83 8.62 12 11 8.76l1-1.36 1 1.36L15.38 12 17 10.83 14.92 8H20v6z"},child:[]}]})(e)}function MdShoppingCart(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49A1.003 1.003 0 0 0 20 4H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"},child:[]}]})(e)}function MdVisibility(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"},child:[]}]})(e)}function MdError(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"},child:[]}]})(e)}function MdContentCopy(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"},child:[]}]})(e)}function MdAccessTime(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]},{tag:"path",attr:{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},child:[]}]})(e)}function MdDiscount(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12.79 21 3 11.21v2c0 .53.21 1.04.59 1.41l7.79 7.79c.78.78 2.05.78 2.83 0l6.21-6.21c.78-.78.78-2.05 0-2.83L12.79 21z"},child:[]},{tag:"path",attr:{d:"M11.38 17.41c.78.78 2.05.78 2.83 0l6.21-6.21c.78-.78.78-2.05 0-2.83L12.63.58A2.04 2.04 0 0 0 11.21 0H5C3.9 0 3 .9 3 2v6.21c0 .53.21 1.04.59 1.41l7.79 7.79zM7.25 3a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5z"},child:[]}]})(e)}function MdKeyboardArrowDown(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},child:[]}]})(e)}function MdKeyboardArrowLeft(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"},child:[]}]})(e)}function MdKeyboardArrowRight(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"},child:[]}]})(e)}function MdKeyboardArrowUp(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"},child:[]}]})(e)}function MdClose(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},child:[]}]})(e)}function MdEast(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m15 5-1.41 1.41L18.17 11H2v2h16.17l-4.59 4.59L15 19l7-7-7-7z"},child:[]}]})(e)}function MdWest(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m9 19 1.41-1.41L5.83 13H22v-2H5.83l4.59-4.59L9 5l-7 7 7 7z"},child:[]}]})(e)}function MdEmojiEvents(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94A5.01 5.01 0 0 0 11 15.9V19H7v2h10v-2h-4v-3.1a5.01 5.01 0 0 0 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2zM5 8V7h2v3.82C5.84 10.4 5 9.3 5 8zm14 0c0 1.3-.84 2.4-2 2.82V7h2v1z"},child:[]}]})(e)}function MdWhatshot(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.8 4.8z"},child:[]}]})(e)}function MdCheckBoxOutlineBlank(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"},child:[]}]})(e)}function MdCheckBox(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"},child:[]}]})(e)}function MdRadioButtonChecked(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function MdRadioButtonUnchecked(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function MdOutlineCheck(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"},child:[]}]})(e)}const icons={checkmark:MdOutlineCheck,arrowRight:MdEast,arrowLeft:MdWest,user:MdAccountCircle,favorite:MdFavorite,chevronUp:MdKeyboardArrowUp,chevronDown:MdKeyboardArrowDown,chevronRight:MdKeyboardArrowRight,chevronLeft:MdKeyboardArrowLeft,home:MdHome,fire:MdWhatshot,lock:MdLock,trophy:MdEmojiEvents,close:MdClose,help:MdHelp,helpOutline:MdHelpOutline,shop:MdShoppingCart,copy:MdContentCopy,radioOn:MdRadioButtonChecked,radioOff:MdRadioButtonUnchecked,unchecked:MdCheckBoxOutlineBlank,checked:MdCheckBox,discount:MdDiscount,info:MdInfo,redeem:MdRedeem,clock:MdAccessTime,external:MdOpenInNew,warning:MdVisibility,leave:MdLogout,error:MdError},Icon=({icon:e,className:t,onClick:r,style:n,inline:i=!1,inButton:s=!1})=>{const l=icons[e];return s?jsx("span",{className:classNames(t,i?"inline-flex items-center":"flex flex-col justify-center"),style:{...n},onClick:r,children:jsx(l,{fontSize:"inherit"})}):r?jsx("button",{className:classNames(t,i?"inline-flex items-center":"flex flex-col justify-center"),onClick:r,style:{...n},children:jsx(l,{fontSize:"inherit"})}):jsx("div",{className:classNames(t,i?"inline-flex items-center":"flex flex-col justify-center"),style:{...n},children:jsx(l,{fontSize:"inherit"})})},useGetLessonStatusesQuery=queryManager(()=>["lessonStatuses","getLessonStatuses"]);function useGetLessonStatuses(){const e=useServiceFetch(),{getQueryKey:t}=useGetLessonStatusesQuery();return useSuspenseQuery({queryKey:t(),queryFn:()=>e("GET","/lesson-status",{})})}const useGetLessonStatusQuery=queryManager(e=>["lessonStatuses","getLessonStatus",e]);function useGetLessonStatus(e){const t=useServiceFetch(),{getQueryKey:r}=useGetLessonStatusQuery(),{getData:n}=useGetLessonStatusesQuery();return useSuspenseQuery({queryKey:r(e),queryFn:()=>t("GET","/lesson-status/:lessonID",e),initialData:n().find(i=>i.lessonID===e.params.lessonID)})}function useAnswerQuestion(){const e=useServiceFetch(),{updateQuery:t}=useGetLessonStatusQuery(),{updateQuery:r}=useGetLessonStatusesQuery(),{invalidateQuery:n}=useGetUserFlowQuery();return useMutation({mutationKey:["answerQuestion"],mutationFn:i=>e("POST","/lesson-status/answer",{body:i}),onSuccess:i=>{t({params:{lessonID:i.lessonID}},()=>i),r(void 0,s=>mergeOneIntoMany(s,i)),n()}})}const Toast=()=>{const{message:e}=useToastContext();return jsx("div",{className:"fixed top-4 w-80 max-h-16 overflow-hidden p-4 bg-accent-900 text-accent-foreground rounded-lg transition-all duration-200 ease-in shadow-lg pointer-events-none",style:{zIndex:2147483647,left:"50%",transform:`translateX(-50%) translateY(${e?"0":"-8rem"})`,opacity:e?1:0},children:e})},{useContext:useToastContext,Provider:Provider$9}=createContextWithoutDefault("toast"),useToast=()=>{const{setMessage:e}=useToastContext();return reactExports.useCallback(t=>{e(t),setTimeout(()=>{e(null)},4e3)},[e])},ToastProvider=({children:e})=>{const[t,r]=reactExports.useState(null);return jsx(Provider$9,{value:{message:t,setMessage:r},children:e})};function safeEval(code){try{return eval(code)}catch(e){return logger.error("Error evaluating code",{code,error:unknownErrToStr(e)}),null}}const GROUND_LOCALSTORAGE_KEY="alia-popup-ground";function getGroundIntegrationData(e){var s;const t=[...e.steps].reverse().findIndex(({step:l})=>l==="popup");if(t===-1)return{};const r=e.steps.length-t-1,n=e.steps[r].timestamp;return{lastCloseTime:(s=e.steps[r+1])==null?void 0:s.timestamp,lastTriggerTime:n}}function useGroundIntegration(){const{state:e}=useFlowStateContext();reactExports.useEffect(()=>{const t=getGroundIntegrationData(e);try{localStorage.setItem(GROUND_LOCALSTORAGE_KEY,JSON.stringify(t))}catch{}},[e])}function getGroundProfileProperties(){try{const t=safeEval("window.ALIA_PROFILE_PROPERTIES");return t&&typeof t=="object"&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).filter(([,r])=>r!=null).map(([r,n])=>[r,String(n)])):void 0}catch{return}}function onSignUp({profile,hook,properties,initialData}){var e,t;const{name,email,phone,smsOptIn}=profile;if(hook&&typeof hook=="string")try{eval(hook)}catch(r){logger.error("Error in Alia onSignup hook",r)}try{getWindowProperty("klaviyo")&&getWindowProperty("klaviyo").identify({email,first_name:name,phone_number:phone}),getWindowProperty("attentive")&&getWindowProperty("attentive").analytics.identify({phone,email}),getWindowProperty("postscript")&&getWindowProperty("postscript").identify({phone}),getWindowProperty("_aimTrack")&&getWindowProperty("_aimTrack").push(["aim_user_data",{email,phone}]),getWindowProperty("omnisend")&&getWindowProperty("omnisend").identifyContact({email,phone});const r=getWindowProperty("Shopify");r&&r.analytics&&r.analytics.publish("yotpo_identify_customer",{phone,email}),getWindowProperty("onetext")&&phone&&smsOptIn!==!1&&getWindowProperty("onetext").optin.submit({email,phone,customerProperties:{...properties,alia_campaign:(e=initialData.userFlow)==null?void 0:e.segmentTitle,alia_popup:(t=initialData.userFlow)==null?void 0:t.flowTitle}}),getWindowProperty("smsbump")&&getWindowProperty("smsbump").identify({phone,email}).then(),getWindowProperty("pushowl")&&getWindowProperty("pushowl").identify({email,properties})}catch(r){logger.error("Error in Alia onSignup integrations",r)}}function useGetAllPollAnswersNoSuspense(){const e=useServiceFetch();return useQuery({queryKey:["pollAnswers","getAll"],queryFn:()=>e("GET","/poll-answers",{}),suspense:!1})}function useGetPollAnswersForQuestionNoSuspense(e){const t=useServiceFetch();return useQuery({queryKey:["pollAnswers","getPollAnswersForQuestion"],queryFn:()=>t("GET",`/poll-answers/${e.questionUUID}`,{params:e}),suspense:!1})}function useAnswerTracksPoll(){const e=useServiceFetch(),{mediator:t}=useCustomerAppContext();return useMutation({mutationKey:["pollAnswers","answerTracksPoll"],mutationFn:r=>e("POST","/poll-answers/tracks",{body:r}),onSuccess:r=>{var n;r&&((n=t==null?void 0:t.userActionsStore)==null||n.addActions(r.userAction))}})}function useCreatePollAnswer(){const{onPollAnswered:e}=useClientIntegrations(),t=useServiceFetch(),r=useUpdateUserQuery(),{mediator:n}=useCustomerAppContext(),{mutateAsync:i}=useMutation({mutationKey:["pollAnswers","create"],mutationFn:s=>t("POST","/poll-answers",{body:s}),onSuccess:s=>{var l;r(s.user),(l=n==null?void 0:n.userActionsStore)==null||l.addActions(s.userAction)}});return reactExports.useCallback(async s=>{await i(s),e({answers:[{questionID:s.questionUUID,questionText:s.questionText,answerID:s.answerUUID,answerText:s.answer}]})},[i,e])}function useCreateManyPollAnswers(){const{onPollAnswered:e}=useClientIntegrations(),t=useUpdateUserQuery(),r=useServiceFetch(),{mediator:n}=useCustomerAppContext(),{mutateAsync:i}=useMutation({mutationKey:["pollAnswers","createMany"],mutationFn:s=>r("POST","/poll-answers/many-v2",{body:s}),onSuccess:s=>{var l;t(s.user),(l=n==null?void 0:n.userActionsStore)==null||l.addActions(...s.userActions)}});return reactExports.useCallback(async s=>{await i(s),e({answers:s.answers.map(l=>({questionID:l.questionUUID,questionText:l.questionText,answerID:l.answerUUID,answerText:l.answer}))})},[i,e])}const getUserQuery=queryManager(()=>["users","getUser"]);function useGetUser(e=!1){const{initialData:t}=useCustomerAppContext(),{getQueryKey:r}=getUserQuery(),n=useServiceFetch();return useSuspenseQuery({queryKey:r(),queryFn:()=>n("GET","/users",{}),refetchInterval:e?5e3:void 0,initialData:t.user})}function useUpdateUserQuery(){const{updateQuery:e}=getUserQuery(),{mediator:t}=useCustomerAppContext();return reactExports.useCallback(r=>{e(void 0,()=>r),t==null||t.update(()=>({user:r}))},[e,t])}function useSetProfile(){const{data:e}=useGetSettings(),{data:t}=useGetAllPollAnswersNoSuspense(),{onSignup:r}=useClientIntegrations(),n=useServiceFetch(),i=useUpdateUserQuery(),s=useToast(),{mediator:l,initialData:c}=useCustomerAppContext();return useMutation({mutationKey:["setProfile"],mutationFn:async h=>{const m=getGroundProfileProperties();return await n("POST","/users/profile",{body:{...h,properties:{...m,...h.properties}}})},onSuccess:(h,{properties:m})=>{var b;i(h),(b=l==null?void 0:l.userActionsStore)==null||b.addActions(...h.userActions),onSignUp({profile:h,properties:t?Object.values(t).reduce((S,w)=>w.questionText?{...S,[w.questionText]:w.answer}:S,m??{}):m??{},hook:e.onSignupHook,initialData:c}),r(h)},onError:h=>{s(unknownErrToStr(h))}})}function useGetIsOptedIn(e){const[t,r]=reactExports.useState(2),n=useServiceFetch();return useQuery({enabled:!!e,queryKey:["getIsOptedIn",e],queryFn:async()=>(r(i=>i+=4),await n("GET","/users/opted-in",{query:{type:e??"email"}})),refetchOnMount:!0,refetchOnWindowFocus:!0,refetchInterval:t*1e3,staleTime:4e3})}const Layout$1=({left:e,right:t,children:r,reverse:n=!1})=>jsxs(Fragment,{children:[jsxs("div",{className:classNames("w-full flex justify-between items-center gap-2 -my-1",{"flex-row-reverse":n}),children:[e,t]}),r]}),LayoutBack=({text:e="Back",onClick:t})=>jsxs(ClickableDiv,{className:"flex space-x-1 cursor-pointer",onClick:t,children:[jsx(Icon,{icon:"arrowLeft",className:"text-lg"}),jsx("p",{className:"font-medium",children:e})]});function formatShopifyCurrency(e,t){function r(n){const{separator:i=",",decimalSeparator:s=".",includeDecimals:l=!0}=n||{},c=l&&e%1!==0,[h,m]=e.toFixed(2).split(".");return h.split("").reverse().map((w,_)=>_>0&&_%3===0?w+i:w).reverse().join("")+(c?s+m:"")}return t.replace(/{{\s*amount\s*}}/g,r()).replace(/{{\s*amount_no_decimals\s*}}/g,r({includeDecimals:!1})).replace(/{{\s*amount_with_comma_separator\s*}}/g,r({separator:".",decimalSeparator:","})).replace(/{{\s*amount_no_decimals_with_comma_separator\s*}}/g,r({separator:".",decimalSeparator:",",includeDecimals:!1})).replace(/{{\s*amount_with_apostrophe_separator\s*}}/g,r({separator:"'"}))}function getProductsDescriptor(e,t=!1){return!t&&e.customDescriptor?e.customDescriptor.descriptor:joinWithAnd(e.products.map(r=>r.title))}function getCollectionsDescriptor(e,t=!1){return!t&&e.customDescriptor?e.customDescriptor.descriptor:joinWithAnd(e.collections.map(r=>r.title))}function getItemsDescriptor(e,t=!1){if(e.items.type==="all")return"all products";if(e.items.type==="products")return getProductsDescriptor(e.items,t);if(e.items.type==="collections")return getCollectionsDescriptor(e.items,t);assertNever(e.items)}function getDiscountValueText(e,t){return e.value.type==="percent"?`${e.value.percent}%`:`${formatShopifyCurrency(e.value.amount,t.currencyFormats.moneyFormat)}`}function getDiscountPriceQualifiers(e,t){return e.minimumRequirement!==void 0?`On orders over ${formatShopifyCurrency(e.minimumRequirement,t.currencyFormats.moneyFormat)}`:""}function getDiscountStackingQualifiers(e){const t=(()=>{if(!Object.values(e.combinesWith).some(l=>l))return"combined with other discounts";const s=[];if(e.combinesWith.orderDiscounts===!1&&s.push("order"),e.combinesWith.productDiscounts===!1&&s.push("product"),e.combinesWith.shippingDiscounts===!1&&s.push("shipping"),s.length!==0)return`combined with ${joinWithAnd(s,"or")} discounts`})(),r=e.appliesOnSubscription?void 0:"used on subscription purchases",n=[];return r&&n.push(r),t&&n.push(t),n.length>0?`Cannot be ${joinWithAnd(n,"or")}`:void 0}function getFreeShippingQualifiers(e,t){return e.maximumShippingPrice!==void 0&&e.minimumRequirement!==void 0?`On orders over ${formatShopifyCurrency(e.minimumRequirement,t.currencyFormats.moneyFormat)} (up to ${formatShopifyCurrency(e.maximumShippingPrice,t.currencyFormats.moneyFormat)} value)`:e.maximumShippingPrice!==void 0?`Up to ${formatShopifyCurrency(e.maximumShippingPrice,t.currencyFormats.moneyFormat)} value`:e.minimumRequirement!==void 0?`On orders over ${formatShopifyCurrency(e.minimumRequirement,t.currencyFormats.moneyFormat)}`:""}function getRewardText(e,t){if(e.type==="discount")return getDiscountValueText(e.discount,t)+" off";if(e.type==="freeShipping")return"Free shipping";if(e.type==="custom")return e.custom.title;assertNever(e)}function getFullRewardText(e,t,r=!0){if(e.type==="discount"){const n=getDiscountPriceQualifiers(e.discount,t);return`${getDiscountValueText(e.discount,t)} off ${getItemsDescriptor(e.discount)}${n&&r?` (${n.toLowerCase()})`:""}`}else{if(e.type==="freeShipping")return`Free shipping ${lowerFirst(getFreeShippingQualifiers(e.freeShipping,t))}`;if(e.type==="custom")return e.custom.title}}const Label=({children:e})=>jsx("div",{className:"w-max bg-accent h-5 text-accent-foreground px-2 py-px rounded uppercase font-semibold text-sm",children:e}),useGetLessonsQuery=queryManager(()=>["lessons","getLessons"]);function useGetAllLessons(){const e=useServiceFetch(),{getQueryKey:t}=useGetLessonsQuery();return useSuspenseQuery({queryKey:t(),queryFn:()=>e("GET","/lessons",{}),staleTime:1/0})}const useGetAllRewardsQuery=queryManager(()=>["rewards","getRewards"]);function useGetAllRewards(){const e=useServiceFetch(),{getQueryKey:t}=useGetAllRewardsQuery();return useSuspenseQuery({queryKey:t(),queryFn:()=>e("GET","/rewards",{}),staleTime:1/0})}function useLessons(){const{data:e}=useGetAllLessons(),{config:t}=useLessonsContext();return t.tiers.map(r=>e.find(n=>n.id===r.lessonID)).filter(Boolean)}function useRewards(){const{data:e}=useGetAllRewards(),{config:t}=useLessonsContext();return t.tiers.map(r=>e.find(n=>n.id===r.rewardID)).filter(Boolean)}const{Provider:LessonContextProvider,useContext:useLessonContext}=createContextWithoutDefault("lessonContext");function useSlideIndex(){const{slideIndex:e,setSlideIndex:t,maxSlideIndex:r,setMaxSlideIndex:n}=useLessonContext();return[e,i=>{const s=i(e);t(s),n(Math.max(s,r))}]}function useMaxSlideIndex(){const{maxSlideIndex:e}=useLessonContext();return e}function useLesson(e){return useLessons().find(r=>r.id===e)}function useLoadSlideIndex(e,t){const{setSlideIndex:r,setMaxSlideIndex:n,lastLoadedLesson:i,setLastLoadedLesson:s}=useLessonContext();reactExports.useEffect(()=>{if(i!==e.id){s(e.id);const l=getInitialSlideIndex(e.publicData,t.data);r(l),n(l)}},[n,e,t,i,s,r])}function getInitialSlideIndex(e,t){var r;for(let n=e.slides.length-1;n>=0;n--){const i=e.slides[n];if(i.type==="question"&&((r=t[i.uuid])!=null&&r.complete))return Math.min(n+1,e.slides.length-1)}return 0}function useRewardsInTier(e){const t=useRewards(),{config:r}=useLessonsContext();return reactExports.useMemo(()=>{var n;if(e){const i=(n=r.tiers[e-1])==null?void 0:n.rewardID;return i?t.filter(s=>s.id===i):[]}return[]},[t,e,r])}function useUserTier(){const{config:e}=useLessonsContext(),{data:t}=useGetLessonStatuses();return reactExports.useMemo(()=>{const r=e.tiers.map(i=>i.lessonID),n=r.filter(i=>t.some(s=>s.lessonID===i&&s.completed)).length;return{tier:n,lastRewardTier:n>0?n:void 0,nextRewardTier:n{const{data:r}=useGetLessonStatuses(),{tier:n,nextRewardTier:i}=useUserTier(),s=useRewardsInTier(i)[0],l=i?i-n:0,c=e.publicData,{data:h}=useGetMerchant(),{setState:m}=useLessonsContext(),b=reactExports.useMemo(()=>r.find(N=>N.lessonID===e.id),[r,e]),S=reactExports.useMemo(()=>b?getInitialSlideIndex(c,b.data):0,[b,c]),w=c.slides.length-S,_=Math.ceil(w/3),I=()=>{t&&(b!=null&&b.completed||m({type:"lesson",lessonID:e.id}))};return jsxs(ClickableDiv,{className:classNames("box theme flex flex-col space-y-2 border-accent group",t?"clickable hover:scale-[1.01]":"disabled"),onClick:I,children:[!!e.imageURL&&t&&jsx("img",{className:"rounded-lg max-h-40 object-cover mb-1",src:e.imageURL,alt:e.name}),jsxs("div",{className:classNames("flex gap-2 border-accent justify-between items-center"),children:[jsxs("div",{className:"flex-1 flex flex-col space-y-2",children:[t&&l===1&&jsxs(Label,{children:["Get ",getRewardText(s.config,h.shopInfo)]}),jsx("div",{className:"flex flex-col gap-2",children:jsxs("div",{className:"flex flex-col gap-1 flex-wrap",children:[jsx("div",{className:classNames("font-medium",t?"text-display-sm leading-6":"text-display-xs leading-5"),children:e.name}),jsxs("div",{className:"flex items-center space-x-1 text-sm font-semibold text-primary-500",children:[jsx(Icon,{icon:"clock",inline:!0}),jsxs("div",{children:[_," min",S>0?" left":""]})]})]})})]}),b!=null&&b.completed?jsx(Icon,{icon:"checkmark",className:"text-2xl text-accent"}):t?jsx(Icon,{icon:"arrowRight",className:classNames("text-accent group-hover:translate-x-1 duration-300 text-display-lg")}):jsx(Icon,{icon:"lock",className:classNames("text-accent duration-300 text-display")})]})]})},LessonCardSkeleton=()=>jsxs("div",{className:"box flex flex-col space-y-2",children:[jsx("div",{className:"skeleton text-lg leading-7 font-medium w-max",children:"Lorem Ipsum Dolor Sit Amet"}),jsx("span",{className:"skeleton font-medium text-sm w-max",children:"Sit amet"})]});function useIncompleteLessons(){const e=useLessons(),{data:t}=useGetLessonStatuses();return reactExports.useMemo(()=>e.filter(r=>{const n=t.find(i=>i.lessonID===r.id);return!(n!=null&&n.completed)}),[e,t])}const MAX_NUM_INCOMPLETE_LESSONS_TO_SHOW=3,EarnPoints=()=>{const e=useIncompleteLessons(),{remainingTiers:t}=useUserTier(),r=Math.min(MAX_NUM_INCOMPLETE_LESSONS_TO_SHOW,t);return jsx(reactExports.Suspense,{fallback:jsx(EarnPointsSkeleton,{}),children:jsxs("div",{className:"flex-1 flex flex-col gap-1 min-h-0 -mt-1",children:[jsx("div",{children:jsx("p",{className:"text-display-xl leading-5",children:"Learn and Earn"})}),e.length===0?jsxs("div",{className:"flex-1 flex flex-col gap-0.5 pt-2",children:[jsx("p",{children:"You've completed every lesson. Nice work!"}),jsx("p",{className:"text-primary-500 leading-5 text-sm",children:"Claim rewards by clicking the button below, or check back later for more opportunities to earn rewards."})]}):jsx("div",{className:"flex flex-col gap-4 overflow-scroll scrollbar-hide pb-8 px-5 pt-2 -mx-5",children:jsxs(CommonErrorBoundary,{children:[jsx(LessonCard,{lesson:e[0],suggested:!0}),e.length>1&&r>1&&jsxs("div",{className:"flex flex-col space-y-2",children:[jsxs("div",{className:"font-medium flex items-center text-sm gap-2",children:[jsx("div",{className:"h-px w-3 bg-accent-100"}),jsx("span",{children:"More lessons"}),jsx("div",{className:"h-px flex-1 bg-accent-100"})]}),jsx("div",{className:"flex flex-col space-y-3",children:e.slice(1,r).map((n,i)=>jsx(LessonCard,{lesson:n,suggested:!1},i))})]})]})})]})})},EarnPointsSkeleton=()=>jsxs("div",{className:"flex-1 space-y-3",children:[jsx("div",{className:"skeleton text-3xl leading-7 w-max",children:"Learn and Earn"}),jsx("div",{className:"skeleton leading-5",children:"Lorem ipsum dolor sit amet"}),jsxs("div",{className:"space-y-3",children:[jsx(LessonCardSkeleton,{}),jsx(LessonCardSkeleton,{})]})]}),HowItWorks=()=>{const{setState:e,goBack:t}=useLessonsContext(),{data:r}=useGetMerchant(),n=reactExports.useMemo(()=>[jsxs("span",{children:[jsxs("strong",{children:["Learn about ",r.title]})," through quick, engaging lessons"]},1),jsxs("span",{children:[jsx("strong",{children:"Claim your discount code"})," once you've finished a lesson"]},2),jsx("span",{children:jsxs("span",{children:[jsx("strong",{children:"The more lessons you complete,"})," the more you'll save!"]})},3)],[r]);return jsxs(Layout$1,{left:jsx(LayoutBack,{onClick:t}),children:[jsxs("div",{className:"flex-1 flex flex-col space-y-6",children:[jsx("p",{className:"text-display-xl",children:"How it works"}),jsx("div",{className:"flex flex-col space-y-6",children:n.map((i,s)=>jsxs("div",{className:"flex space-x-4",children:[jsx("div",{className:"bg-accent-100 text-accent text-display-xs w-10 h-10 flex-shrink-0 rounded-full flex justify-center items-center",children:s+1}),jsx("div",{className:"text-lg",children:i})]},s))})]}),jsx(Button,{variant:"primary",onClick:()=>e({type:"home"}),children:"Got it!"})]})};var isCheckBoxInput=e=>e.type==="checkbox",isDateObject=e=>e instanceof Date,isNullOrUndefined=e=>e==null;const isObjectType=e=>typeof e=="object";var isObject$1=e=>!isNullOrUndefined(e)&&!Array.isArray(e)&&isObjectType(e)&&!isDateObject(e),getEventValue=e=>isObject$1(e)&&e.target?isCheckBoxInput(e.target)?e.target.checked:e.target.value:e,getNodeParentName=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,isNameInFieldArray=(e,t)=>e.has(getNodeParentName(t)),isPlainObject=e=>{const t=e.constructor&&e.constructor.prototype;return isObject$1(t)&&t.hasOwnProperty("isPrototypeOf")},isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(isWeb&&(e instanceof Blob||e instanceof FileList))&&(r||isObject$1(e)))if(t=r?[]:{},!r&&!isPlainObject(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=cloneObject(e[n]));else return e;return t}var compact=e=>Array.isArray(e)?e.filter(Boolean):[],isUndefined=e=>e===void 0,get=(e,t,r)=>{if(!t||!isObject$1(e))return r;const n=compact(t.split(/[,[\].]+?/)).reduce((i,s)=>isNullOrUndefined(i)?i:i[s],e);return isUndefined(n)||n===e?isUndefined(e[t])?r:e[t]:n};const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormContext=React.createContext(null),useFormContext=()=>React.useContext(HookFormContext),FormProvider=e=>{const{children:t,...r}=e;return React.createElement(HookFormContext.Provider,{value:r},t)};var getProxyFormState=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(i,s,{get:()=>{const l=s;return t._proxyFormState[l]!==VALIDATION_MODE.all&&(t._proxyFormState[l]=!n||VALIDATION_MODE.all),r&&(r[l]=!0),e[l]}});return i},isEmptyObject=e=>isObject$1(e)&&!Object.keys(e).length,shouldRenderFormState=(e,t,r,n)=>{r(e);const{name:i,...s}=e;return isEmptyObject(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(l=>t[l]===(!n||VALIDATION_MODE.all))},convertToArrayPayload=e=>Array.isArray(e)?e:[e],shouldSubscribeByName=(e,t,r)=>r&&t?e===t:!e||!t||e===t||convertToArrayPayload(e).some(n=>n&&(n.startsWith(t)||t.startsWith(n)));function useSubscribe(e){const t=React.useRef(e);t.current=e,React.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function useFormState(e){const t=useFormContext(),{control:r=t.control,disabled:n,name:i,exact:s}=e||{},[l,c]=React.useState(r._formState),h=React.useRef(!0),m=React.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),b=React.useRef(i);return b.current=i,useSubscribe({disabled:n,next:S=>h.current&&shouldSubscribeByName(b.current,S.name,s)&&shouldRenderFormState(S,m.current,r._updateFormState)&&c({...r._formState,...S}),subject:r._subjects.state}),React.useEffect(()=>(h.current=!0,m.current.isValid&&r._updateValid(!0),()=>{h.current=!1}),[r]),getProxyFormState(l,r,m.current,!1)}var isString=e=>typeof e=="string",generateWatchOutput=(e,t,r,n,i)=>isString(e)?(n&&t.watch.add(e),get(r,e,i)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),get(r,s))):(n&&(t.watchAll=!0),r);function useWatch(e){const t=useFormContext(),{control:r=t.control,name:n,defaultValue:i,disabled:s,exact:l}=e||{},c=React.useRef(n);c.current=n,useSubscribe({disabled:s,subject:r._subjects.values,next:b=>{shouldSubscribeByName(c.current,b.name,l)&&m(cloneObject(generateWatchOutput(c.current,r._names,b.values||r._formValues,!1,i)))}});const[h,m]=React.useState(r._getWatch(n,i));return React.useEffect(()=>r._removeUnmounted()),h}var isKey=e=>/^\w*$/.test(e),stringToPath=e=>compact(e.replace(/["|']|\]/g,"").split(/\.|\[/));function set(e,t,r){let n=-1;const i=isKey(t)?[t]:stringToPath(t),s=i.length,l=s-1;for(;++n{const m=n._options.shouldUnregister||i,b=(S,w)=>{const _=get(n._fields,S);_&&(_._f.mount=w)};if(b(r,!0),m){const S=cloneObject(get(n._options.defaultValues,r));set(n._defaultValues,r,S),isUndefined(get(n._formValues,r))&&set(n._formValues,r,S)}return()=>{(s?m&&!n._state.action:m)?n.unregister(r):b(r,!1)}},[r,n,s,i]),{field:{name:r,value:l,onChange:React.useCallback(m=>h.current.onChange({target:{value:getEventValue(m),name:r},type:EVENTS.CHANGE}),[r]),onBlur:React.useCallback(()=>h.current.onBlur({target:{value:get(n._formValues,r),name:r},type:EVENTS.BLUR}),[r,n]),ref:m=>{const b=get(n._fields,r);b&&m&&(b._f.ref={focus:()=>m.focus(),select:()=>m.select(),setCustomValidity:S=>m.setCustomValidity(S),reportValidity:()=>m.reportValidity()})}},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!get(c.errors,r)},isDirty:{enumerable:!0,get:()=>!!get(c.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!get(c.touchedFields,r)},error:{enumerable:!0,get:()=>get(c.errors,r)}})}}const Controller=e=>e.render(useController(e));var appendErrors=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{};const focusFieldBy=(e,t,r)=>{for(const n of r||Object.keys(e)){const i=get(e,n);if(i){const{_f:s,...l}=i;if(s&&t(s.name)){if(s.ref.focus){s.ref.focus();break}else if(s.refs&&s.refs[0].focus){s.refs[0].focus();break}}else isObject$1(l)&&focusFieldBy(l,t)}}};var getValidationModes=e=>({isOnSubmit:!e||e===VALIDATION_MODE.onSubmit,isOnBlur:e===VALIDATION_MODE.onBlur,isOnChange:e===VALIDATION_MODE.onChange,isOnAll:e===VALIDATION_MODE.all,isOnTouch:e===VALIDATION_MODE.onTouched}),isWatched=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length)))),updateFieldArrayRootError=(e,t,r)=>{const n=compact(get(e,r));return set(n,"root",t[r]),set(e,r,n),e},isBoolean=e=>typeof e=="boolean",isFileInput=e=>e.type==="file",isFunction=e=>typeof e=="function",isHTMLElement=e=>{if(!isWeb)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},isMessage=e=>isString(e),isRadioInput=e=>e.type==="radio",isRegex=e=>e instanceof RegExp;const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!isUndefined(e[0].attributes.value)?isUndefined(e[0].value)||e[0].value===""?validResult:{value:e[0].value,isValid:!0}:validResult:defaultResult}return defaultResult};const defaultReturn={isValid:!1,value:null};var getRadioValue=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,defaultReturn):defaultReturn;function getValidateError(e,t,r="validate"){if(isMessage(e)||Array.isArray(e)&&e.every(isMessage)||isBoolean(e)&&!e)return{type:r,message:isMessage(e)?e:"",ref:t}}var getValueAndMessage=e=>isObject$1(e)&&!isRegex(e)?e:{value:e,message:""},validateField=async(e,t,r,n,i)=>{const{ref:s,refs:l,required:c,maxLength:h,minLength:m,min:b,max:S,pattern:w,validate:_,name:I,valueAsNumber:N,mount:P,disabled:F}=e._f,j=get(t,I);if(!P||F)return{};const q=l?l[0]:s,f=re=>{n&&q.reportValidity&&(q.setCustomValidity(isBoolean(re)?"":re||""),q.reportValidity())},v={},g=isRadioInput(s),C=isCheckBoxInput(s),$=g||C,R=(N||isFileInput(s))&&isUndefined(s.value)&&isUndefined(j)||isHTMLElement(s)&&s.value===""||j===""||Array.isArray(j)&&!j.length,A=appendErrors.bind(null,I,r,v),M=(re,K,J,ee=INPUT_VALIDATION_RULES.maxLength,T=INPUT_VALIDATION_RULES.minLength)=>{const Y=re?K:J;v[I]={type:re?ee:T,message:Y,ref:s,...A(re?ee:T,Y)}};if(i?!Array.isArray(j)||!j.length:c&&(!$&&(R||isNullOrUndefined(j))||isBoolean(j)&&!j||C&&!getCheckboxValue(l).isValid||g&&!getRadioValue(l).isValid)){const{value:re,message:K}=isMessage(c)?{value:!!c,message:c}:getValueAndMessage(c);if(re&&(v[I]={type:INPUT_VALIDATION_RULES.required,message:K,ref:q,...A(INPUT_VALIDATION_RULES.required,K)},!r))return f(K),v}if(!R&&(!isNullOrUndefined(b)||!isNullOrUndefined(S))){let re,K;const J=getValueAndMessage(S),ee=getValueAndMessage(b);if(!isNullOrUndefined(j)&&!isNaN(j)){const T=s.valueAsNumber||j&&+j;isNullOrUndefined(J.value)||(re=T>J.value),isNullOrUndefined(ee.value)||(K=Tnew Date(new Date().toDateString()+" "+ae),W=s.type=="time",oe=s.type=="week";isString(J.value)&&j&&(re=W?Y(j)>Y(J.value):oe?j>J.value:T>new Date(J.value)),isString(ee.value)&&j&&(K=W?Y(j)+re.value,ee=!isNullOrUndefined(K.value)&&j.length<+K.value;if((J||ee)&&(M(J,re.message,K.message),!r))return f(v[I].message),v}if(w&&!R&&isString(j)){const{value:re,message:K}=getValueAndMessage(w);if(isRegex(re)&&!j.match(re)&&(v[I]={type:INPUT_VALIDATION_RULES.pattern,message:K,ref:s,...A(INPUT_VALIDATION_RULES.pattern,K)},!r))return f(K),v}if(_){if(isFunction(_)){const re=await _(j,t),K=getValidateError(re,q);if(K&&(v[I]={...K,...A(INPUT_VALIDATION_RULES.validate,K.message)},!r))return f(K.message),v}else if(isObject$1(_)){let re={};for(const K in _){if(!isEmptyObject(re)&&!r)break;const J=getValidateError(await _[K](j,t),q,K);J&&(re={...J,...A(K,J.message)},f(J.message),r&&(v[I]=re))}if(!isEmptyObject(re)&&(v[I]={ref:q,...re},!r))return v}}return f(!0),v};function baseGet(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const s of e)s.next&&s.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(s=>s!==i)}}),unsubscribe:()=>{e=[]}}}var isPrimitive=e=>isNullOrUndefined(e)||!isObjectType(e);function deepEqual(e,t){if(isPrimitive(e)||isPrimitive(t))return e===t;if(isDateObject(e)&&isDateObject(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r){const s=e[i];if(!n.includes(i))return!1;if(i!=="ref"){const l=t[i];if(isDateObject(s)&&isDateObject(l)||isObject$1(s)&&isObject$1(l)||Array.isArray(s)&&Array.isArray(l)?!deepEqual(s,l):s!==l)return!1}}return!0}var isMultipleSelect=e=>e.type==="select-multiple",isRadioOrCheckbox=e=>isRadioInput(e)||isCheckBoxInput(e),live=e=>isHTMLElement(e)&&e.isConnected,objectHasFunction=e=>{for(const t in e)if(isFunction(e[t]))return!0;return!1};function markFieldsDirty(e,t={}){const r=Array.isArray(e);if(isObject$1(e)||r)for(const n in e)Array.isArray(e[n])||isObject$1(e[n])&&!objectHasFunction(e[n])?(t[n]=Array.isArray(e[n])?[]:{},markFieldsDirty(e[n],t[n])):isNullOrUndefined(e[n])||(t[n]=!0);return t}function getDirtyFieldsFromDefaultValues(e,t,r){const n=Array.isArray(e);if(isObject$1(e)||n)for(const i in e)Array.isArray(e[i])||isObject$1(e[i])&&!objectHasFunction(e[i])?isUndefined(t)||isPrimitive(r[i])?r[i]=Array.isArray(e[i])?markFieldsDirty(e[i],[]):{...markFieldsDirty(e[i])}:getDirtyFieldsFromDefaultValues(e[i],isNullOrUndefined(t)?{}:t[i],r[i]):r[i]=!deepEqual(e[i],t[i]);return r}var getDirtyFields=(e,t)=>getDirtyFieldsFromDefaultValues(e,t,markFieldsDirty(t)),getFieldValueAs=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>isUndefined(e)?e:t?e===""?NaN:e&&+e:r&&isString(e)?new Date(e):n?n(e):e;function getFieldValue(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return isFileInput(t)?t.files:isRadioInput(t)?getRadioValue(e.refs).value:isMultipleSelect(t)?[...t.selectedOptions].map(({value:r})=>r):isCheckBoxInput(t)?getCheckboxValue(e.refs).value:getFieldValueAs(isUndefined(t.value)?e.ref.value:t.value,e)}var getResolverOptions=(e,t,r,n)=>{const i={};for(const s of e){const l=get(t,s);l&&set(i,s,l._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},getRuleValue=e=>isUndefined(e)?e:isRegex(e)?e.source:isObject$1(e)?isRegex(e.value)?e.value.source:e.value:e,hasValidation=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function schemaErrorLookup(e,t,r){const n=get(e,r);if(n||isKey(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const s=i.join("."),l=get(t,s),c=get(e,s);if(l&&!Array.isArray(l)&&r!==s)return{name:r};if(c&&c.type)return{name:s,error:c};i.pop()}return{name:r}}var skipValidation=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,unsetEmptyArray=(e,t)=>!compact(get(e,t)).length&&unset(e,t);const defaultOptions={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(e={},t){let r={...defaultOptions,...e},n={submitCount:0,isDirty:!1,isLoading:isFunction(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},i={},s=isObject$1(r.defaultValues)||isObject$1(r.values)?cloneObject(r.defaultValues||r.values)||{}:{},l=r.shouldUnregister?{}:cloneObject(s),c={action:!1,mount:!1,watch:!1},h={mount:new Set,unMount:new Set,array:new Set,watch:new Set},m,b=0;const S={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},w={values:createSubject(),array:createSubject(),state:createSubject()},_=e.resetOptions&&e.resetOptions.keepDirtyValues,I=getValidationModes(r.mode),N=getValidationModes(r.reValidateMode),P=r.criteriaMode===VALIDATION_MODE.all,F=U=>V=>{clearTimeout(b),b=setTimeout(U,V)},j=async U=>{if(S.isValid||U){const V=r.resolver?isEmptyObject((await R()).errors):await M(i,!0);V!==n.isValid&&w.state.next({isValid:V})}},q=U=>S.isValidating&&w.state.next({isValidating:U}),f=(U,V=[],G,ue,le=!0,ie=!0)=>{if(ue&&G){if(c.action=!0,ie&&Array.isArray(get(i,U))){const me=G(get(i,U),ue.argA,ue.argB);le&&set(i,U,me)}if(ie&&Array.isArray(get(n.errors,U))){const me=G(get(n.errors,U),ue.argA,ue.argB);le&&set(n.errors,U,me),unsetEmptyArray(n.errors,U)}if(S.touchedFields&&ie&&Array.isArray(get(n.touchedFields,U))){const me=G(get(n.touchedFields,U),ue.argA,ue.argB);le&&set(n.touchedFields,U,me)}S.dirtyFields&&(n.dirtyFields=getDirtyFields(s,l)),w.state.next({name:U,isDirty:K(U,V),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else set(l,U,V)},v=(U,V)=>{set(n.errors,U,V),w.state.next({errors:n.errors})},g=(U,V,G,ue)=>{const le=get(i,U);if(le){const ie=get(l,U,isUndefined(G)?get(s,U):G);isUndefined(ie)||ue&&ue.defaultChecked||V?set(l,U,V?ie:getFieldValue(le._f)):T(U,ie),c.mount&&j()}},C=(U,V,G,ue,le)=>{let ie=!1,me=!1;const Ne={name:U};if(!G||ue){S.isDirty&&(me=n.isDirty,n.isDirty=Ne.isDirty=K(),ie=me!==Ne.isDirty);const je=deepEqual(get(s,U),V);me=get(n.dirtyFields,U),je?unset(n.dirtyFields,U):set(n.dirtyFields,U,!0),Ne.dirtyFields=n.dirtyFields,ie=ie||S.dirtyFields&&me!==!je}if(G){const je=get(n.touchedFields,U);je||(set(n.touchedFields,U,G),Ne.touchedFields=n.touchedFields,ie=ie||S.touchedFields&&je!==G)}return ie&&le&&w.state.next(Ne),ie?Ne:{}},$=(U,V,G,ue)=>{const le=get(n.errors,U),ie=S.isValid&&isBoolean(V)&&n.isValid!==V;if(e.delayError&&G?(m=F(()=>v(U,G)),m(e.delayError)):(clearTimeout(b),m=null,G?set(n.errors,U,G):unset(n.errors,U)),(G?!deepEqual(le,G):le)||!isEmptyObject(ue)||ie){const me={...ue,...ie&&isBoolean(V)?{isValid:V}:{},errors:n.errors,name:U};n={...n,...me},w.state.next(me)}q(!1)},R=async U=>r.resolver(l,r.context,getResolverOptions(U||h.mount,i,r.criteriaMode,r.shouldUseNativeValidation)),A=async U=>{const{errors:V}=await R();if(U)for(const G of U){const ue=get(V,G);ue?set(n.errors,G,ue):unset(n.errors,G)}else n.errors=V;return V},M=async(U,V,G={valid:!0})=>{for(const ue in U){const le=U[ue];if(le){const{_f:ie,...me}=le;if(ie){const Ne=h.array.has(ie.name),je=await validateField(le,l,P,r.shouldUseNativeValidation&&!V,Ne);if(je[ie.name]&&(G.valid=!1,V))break;!V&&(get(je,ie.name)?Ne?updateFieldArrayRootError(n.errors,je,ie.name):set(n.errors,ie.name,je[ie.name]):unset(n.errors,ie.name))}me&&await M(me,V,G)}}return G.valid},re=()=>{for(const U of h.unMount){const V=get(i,U);V&&(V._f.refs?V._f.refs.every(G=>!live(G)):!live(V._f.ref))&&we(U)}h.unMount=new Set},K=(U,V)=>(U&&V&&set(l,U,V),!deepEqual(D(),s)),J=(U,V,G)=>generateWatchOutput(U,h,{...c.mount?l:isUndefined(V)?s:isString(U)?{[U]:V}:V},G,V),ee=U=>compact(get(c.mount?l:s,U,e.shouldUnregister?get(s,U,[]):[])),T=(U,V,G={})=>{const ue=get(i,U);let le=V;if(ue){const ie=ue._f;ie&&(!ie.disabled&&set(l,U,getFieldValueAs(V,ie)),le=isHTMLElement(ie.ref)&&isNullOrUndefined(V)?"":V,isMultipleSelect(ie.ref)?[...ie.ref.options].forEach(me=>me.selected=le.includes(me.value)):ie.refs?isCheckBoxInput(ie.ref)?ie.refs.length>1?ie.refs.forEach(me=>(!me.defaultChecked||!me.disabled)&&(me.checked=Array.isArray(le)?!!le.find(Ne=>Ne===me.value):le===me.value)):ie.refs[0]&&(ie.refs[0].checked=!!le):ie.refs.forEach(me=>me.checked=me.value===le):isFileInput(ie.ref)?ie.ref.value="":(ie.ref.value=le,ie.ref.type||w.values.next({name:U,values:{...l}})))}(G.shouldDirty||G.shouldTouch)&&C(U,le,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&ae(U)},Y=(U,V,G)=>{for(const ue in V){const le=V[ue],ie=`${U}.${ue}`,me=get(i,ie);(h.array.has(U)||!isPrimitive(le)||me&&!me._f)&&!isDateObject(le)?Y(ie,le,G):T(ie,le,G)}},W=(U,V,G={})=>{const ue=get(i,U),le=h.array.has(U),ie=cloneObject(V);set(l,U,ie),le?(w.array.next({name:U,values:{...l}}),(S.isDirty||S.dirtyFields)&&G.shouldDirty&&w.state.next({name:U,dirtyFields:getDirtyFields(s,l),isDirty:K(U,ie)})):ue&&!ue._f&&!isNullOrUndefined(ie)?Y(U,ie,G):T(U,ie,G),isWatched(U,h)&&w.state.next({...n}),w.values.next({name:U,values:{...l}}),!c.mount&&t()},oe=async U=>{const V=U.target;let G=V.name,ue=!0;const le=get(i,G),ie=()=>V.type?getFieldValue(le._f):getEventValue(U);if(le){let me,Ne;const je=ie(),et=U.type===EVENTS.BLUR||U.type===EVENTS.FOCUS_OUT,it=!hasValidation(le._f)&&!r.resolver&&!get(n.errors,G)&&!le._f.deps||skipValidation(et,get(n.touchedFields,G),n.isSubmitted,N,I),St=isWatched(G,h,et);set(l,G,je),et?(le._f.onBlur&&le._f.onBlur(U),m&&m(0)):le._f.onChange&&le._f.onChange(U);const ft=C(G,je,et,!1),Bt=!isEmptyObject(ft)||St;if(!et&&w.values.next({name:G,type:U.type,values:{...l}}),it)return S.isValid&&j(),Bt&&w.state.next({name:G,...St?{}:ft});if(!et&&St&&w.state.next({...n}),q(!0),r.resolver){const{errors:ot}=await R([G]),Dt=schemaErrorLookup(n.errors,i,G),E=schemaErrorLookup(ot,i,Dt.name||G);me=E.error,G=E.name,Ne=isEmptyObject(ot)}else me=(await validateField(le,l,P,r.shouldUseNativeValidation))[G],ue=isNaN(je)||je===get(l,G,je),ue&&(me?Ne=!1:S.isValid&&(Ne=await M(i,!0)));ue&&(le._f.deps&&ae(le._f.deps),$(G,Ne,me,ft))}},ae=async(U,V={})=>{let G,ue;const le=convertToArrayPayload(U);if(q(!0),r.resolver){const ie=await A(isUndefined(U)?U:le);G=isEmptyObject(ie),ue=U?!le.some(me=>get(ie,me)):G}else U?(ue=(await Promise.all(le.map(async ie=>{const me=get(i,ie);return await M(me&&me._f?{[ie]:me}:me)}))).every(Boolean),!(!ue&&!n.isValid)&&j()):ue=G=await M(i);return w.state.next({...!isString(U)||S.isValid&&G!==n.isValid?{}:{name:U},...r.resolver||!U?{isValid:G}:{},errors:n.errors,isValidating:!1}),V.shouldFocus&&!ue&&focusFieldBy(i,ie=>ie&&get(n.errors,ie),U?le:h.mount),ue},D=U=>{const V={...s,...c.mount?l:{}};return isUndefined(U)?V:isString(U)?get(V,U):U.map(G=>get(V,G))},ne=(U,V)=>({invalid:!!get((V||n).errors,U),isDirty:!!get((V||n).dirtyFields,U),isTouched:!!get((V||n).touchedFields,U),error:get((V||n).errors,U)}),xe=U=>{U&&convertToArrayPayload(U).forEach(V=>unset(n.errors,V)),w.state.next({errors:U?n.errors:{}})},$e=(U,V,G)=>{const ue=(get(i,U,{_f:{}})._f||{}).ref;set(n.errors,U,{...V,ref:ue}),w.state.next({name:U,errors:n.errors,isValid:!1}),G&&G.shouldFocus&&ue&&ue.focus&&ue.focus()},Ee=(U,V)=>isFunction(U)?w.values.subscribe({next:G=>U(J(void 0,V),G)}):J(U,V,!0),we=(U,V={})=>{for(const G of U?convertToArrayPayload(U):h.mount)h.mount.delete(G),h.array.delete(G),V.keepValue||(unset(i,G),unset(l,G)),!V.keepError&&unset(n.errors,G),!V.keepDirty&&unset(n.dirtyFields,G),!V.keepTouched&&unset(n.touchedFields,G),!r.shouldUnregister&&!V.keepDefaultValue&&unset(s,G);w.values.next({values:{...l}}),w.state.next({...n,...V.keepDirty?{isDirty:K()}:{}}),!V.keepIsValid&&j()},ge=(U,V={})=>{let G=get(i,U);const ue=isBoolean(V.disabled);return set(i,U,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:U}},name:U,mount:!0,...V}}),h.mount.add(U),isUndefined(V.value)||set(l,U,V.value),G?ue&&set(l,U,V.disabled?void 0:get(l,U,getFieldValue(G._f))):g(U,!0,V.value),{...ue?{disabled:V.disabled}:{},...r.progressive?{required:!!V.required,min:getRuleValue(V.min),max:getRuleValue(V.max),minLength:getRuleValue(V.minLength),maxLength:getRuleValue(V.maxLength),pattern:getRuleValue(V.pattern)}:{},name:U,onChange:oe,onBlur:oe,ref:le=>{if(le){ge(U,V),G=get(i,U);const ie=isUndefined(le.value)&&le.querySelectorAll&&le.querySelectorAll("input,select,textarea")[0]||le,me=isRadioOrCheckbox(ie),Ne=G._f.refs||[];if(me?Ne.find(je=>je===ie):ie===G._f.ref)return;set(i,U,{_f:{...G._f,...me?{refs:[...Ne.filter(live),ie,...Array.isArray(get(s,U))?[{}]:[]],ref:{type:ie.type,name:U}}:{ref:ie}}}),g(U,!1,void 0,ie)}else G=get(i,U,{}),G._f&&(G._f.mount=!1),(r.shouldUnregister||V.shouldUnregister)&&!(isNameInFieldArray(h.array,U)&&c.action)&&h.unMount.add(U)}}},ve=()=>r.shouldFocusError&&focusFieldBy(i,U=>U&&get(n.errors,U),h.mount),Ie=(U,V)=>async G=>{G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let ue=cloneObject(l);if(w.state.next({isSubmitting:!0}),r.resolver){const{errors:le,values:ie}=await R();n.errors=le,ue=ie}else await M(i);unset(n.errors,"root"),isEmptyObject(n.errors)?(w.state.next({errors:{}}),await U(ue,G)):(V&&await V({...n.errors},G),ve(),setTimeout(ve)),w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(n.errors),submitCount:n.submitCount+1,errors:n.errors})},De=(U,V={})=>{get(i,U)&&(isUndefined(V.defaultValue)?W(U,get(s,U)):(W(U,V.defaultValue),set(s,U,V.defaultValue)),V.keepTouched||unset(n.touchedFields,U),V.keepDirty||(unset(n.dirtyFields,U),n.isDirty=V.defaultValue?K(U,get(s,U)):K()),V.keepError||(unset(n.errors,U),S.isValid&&j()),w.state.next({...n}))},qe=(U,V={})=>{const G=U||s,ue=cloneObject(G),le=U&&!isEmptyObject(U)?ue:s;if(V.keepDefaultValues||(s=G),!V.keepValues){if(V.keepDirtyValues||_)for(const ie of h.mount)get(n.dirtyFields,ie)?set(le,ie,get(l,ie)):W(ie,get(le,ie));else{if(isWeb&&isUndefined(U))for(const ie of h.mount){const me=get(i,ie);if(me&&me._f){const Ne=Array.isArray(me._f.refs)?me._f.refs[0]:me._f.ref;if(isHTMLElement(Ne)){const je=Ne.closest("form");if(je){je.reset();break}}}}i={}}l=e.shouldUnregister?V.keepDefaultValues?cloneObject(s):{}:cloneObject(le),w.array.next({values:{...le}}),w.values.next({values:{...le}})}h={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!c.mount&&t(),c.mount=!S.isValid||!!V.keepIsValid,c.watch=!!e.shouldUnregister,w.state.next({submitCount:V.keepSubmitCount?n.submitCount:0,isDirty:V.keepDirty?n.isDirty:!!(V.keepDefaultValues&&!deepEqual(U,s)),isSubmitted:V.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:V.keepDirtyValues?n.dirtyFields:V.keepDefaultValues&&U?getDirtyFields(s,U):{},touchedFields:V.keepTouched?n.touchedFields:{},errors:V.keepErrors?n.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},Je=(U,V)=>qe(isFunction(U)?U(l):U,V);return{control:{register:ge,unregister:we,getFieldState:ne,handleSubmit:Ie,setError:$e,_executeSchema:R,_getWatch:J,_getDirty:K,_updateValid:j,_removeUnmounted:re,_updateFieldArray:f,_getFieldArray:ee,_reset:qe,_resetDefaultValues:()=>isFunction(r.defaultValues)&&r.defaultValues().then(U=>{Je(U,r.resetOptions),w.state.next({isLoading:!1})}),_updateFormState:U=>{n={...n,...U}},_subjects:w,_proxyFormState:S,get _fields(){return i},get _formValues(){return l},get _state(){return c},set _state(U){c=U},get _defaultValues(){return s},get _names(){return h},set _names(U){h=U},get _formState(){return n},set _formState(U){n=U},get _options(){return r},set _options(U){r={...r,...U}}},trigger:ae,register:ge,handleSubmit:Ie,watch:Ee,setValue:W,getValues:D,reset:Je,resetField:De,clearErrors:xe,unregister:we,setError:$e,setFocus:(U,V={})=>{const G=get(i,U),ue=G&&G._f;if(ue){const le=ue.refs?ue.refs[0]:ue.ref;le.focus&&(le.focus(),V.shouldSelect&&le.select())}},getFieldState:ne}}function useForm(e={}){const t=React.useRef(),r=React.useRef(),[n,i]=React.useState({isDirty:!1,isValidating:!1,isLoading:isFunction(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:isFunction(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...createFormControl(e,()=>i(l=>({...l}))),formState:n});const s=t.current.control;return s._options=e,useSubscribe({subject:s._subjects.state,next:l=>{shouldRenderFormState(l,s._proxyFormState,s._updateFormState,!0)&&i({...s._formState})}}),React.useEffect(()=>{e.values&&!deepEqual(e.values,r.current)?(s._reset(e.values,s._options.resetOptions),r.current=e.values):s._resetDefaultValues()},[e.values,s]),React.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=getProxyFormState(n,s),t.current}const{Provider:EducationSignUpSettingsProvider,useContext:useEducationSignUpSettings,useOptionalContext:useOptionalEducationSignUpSettings}=createContextWithoutDefault("education-sign-up-settings");var __spreadArray=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ReactNativeInfo:typeof navigator<"u"?parseUserAgent(navigator.userAgent):getNodeVersion()}function matchUserAgent(e){return e!==""&&userAgentRules.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var s=i.exec(e);return!!s&&[n,s]},!1)}function parseUserAgent(e){var t=matchUserAgent(e);if(!t)return null;var r=t[0],n=t[1];if(r==="searchbot")return new BotInfo;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length254)return!1;var r=e.test(t);if(!r)return!1;var n=t.split("@");if(n[0].length>64)return!1;var i=n[1].split(".");return!i.some(function(s){return s.length>63})},emailValidator}var emailValidatorExports=requireEmailValidator();const metadata$1={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\d|2[0-8]))\\d|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90)))\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|3\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|[24-689])\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|33|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|91"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|31)"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-35])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","(?:[2-489]\\d|55)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}",[6,7,8,9,10,11]],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[259]\\d{6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[0135-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[245]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-467]|5[0-3]|8[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","38\\d{6}|[78]\\d{9,13}|(?:20|9\\d)\\d{8}",[8,10,11,12,13,14],[["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["3"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[16]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-5]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[468]))\\d{4}|(?:2742|305[3-9]|472[247-9]|505[2-57-9]|983[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["305209\\d{4}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[6,7,8,9,10,11,12,13],[["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};var propTypes={exports:{}},ReactPropTypesSecret_1,hasRequiredReactPropTypesSecret;function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ReactPropTypesSecret_1=e,ReactPropTypesSecret_1}var factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var e=requireReactPropTypesSecret();function t(){}function r(){}return r.resetWarningCache=t,factoryWithThrowingShims=function(){function n(l,c,h,m,b,S){if(S!==e){var w=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw w.name="Invariant Violation",w}}n.isRequired=n;function i(){return n}var s={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:t};return s.PropTypes=s,s},factoryWithThrowingShims}var hasRequiredPropTypes;function requirePropTypes(){return hasRequiredPropTypes||(hasRequiredPropTypes=1,propTypes.exports=requireFactoryWithThrowingShims()()),propTypes.exports}var propTypesExports=requirePropTypes();const PropTypes=getDefaultExportFromCjs(propTypesExports);function edit(e,t,r){switch(r){case"Backspace":t>0&&(e=e.slice(0,t-1)+e.slice(t),t--);break;case"Delete":e=e.slice(0,t)+e.slice(t+1);break}return{value:e,caret:t}}function parse$1(e,t,r){for(var n={},i="",s=0,l=0;ll&&(s=i.length))),l++}t===void 0&&(s=i.length);var h={value:i,caret:s};return h}function _createForOfIteratorHelperLoose$c(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray$f(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$f(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$f(e,t)}}function _arrayLikeToArray$f(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:"x",n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:" ",i=e.length,s=count_occurences("(",e),l=count_occurences(")",e),c=s-l;c>0&&i=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$e(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$e(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$e(e,t)}}function _arrayLikeToArray$e(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:"x",r=arguments.length>2?arguments[2]:void 0;if(!e)return function(i){return{text:i}};var n=count_occurences(t,e);return function(i){if(!i)return{text:"",template:e};for(var s=0,l="",c=_createForOfIteratorHelperLoose$b(e.split("")),h;!(h=c()).done;){var m=h.value;if(m!==t){l+=m;continue}if(l+=i[s],s++,s===i.length&&i.length=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$8(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function Input$1(e,t){var r=e.value,n=e.parse,i=e.format,s=e.inputComponent,l=e.onChange,c=e.onKeyDown,h=_objectWithoutProperties$8(e,_excluded$8),m=reactExports.useRef(),b=reactExports.useCallback(function(_){m.current=_,t&&(typeof t=="function"?t(_):t.current=_)},[t]),S=reactExports.useCallback(function(_){return onChange(_,m.current,n,i,l)},[m,n,i,l]),w=reactExports.useCallback(function(_){if(c&&c(_),!_.defaultPrevented)return onKeyDown(_,m.current,n,i,l)},[m,n,i,l,c]);return jsx(s,{...h,ref:b,value:i(isEmptyValue(r)?"":r).text,onKeyDown:w,onChange:S})}Input$1=React.forwardRef(Input$1),Input$1.propTypes={parse:PropTypes.func.isRequired,format:PropTypes.func.isRequired,inputComponent:PropTypes.elementType.isRequired,type:PropTypes.string.isRequired,value:PropTypes.string,onChange:PropTypes.func.isRequired,onKeyDown:PropTypes.func,onCut:PropTypes.func,onPaste:PropTypes.func},Input$1.defaultProps={inputComponent:"input",type:"text"};function isEmptyValue(e){return e==null}function _typeof$3(e){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$3(e)}function _createClass$9(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function _classCallCheck$9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits$1(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$1(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct$1();return function(){var n=_getPrototypeOf$1(e),i;if(t){var s=_getPrototypeOf$1(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return _possibleConstructorReturn$1(this,i)}}function _possibleConstructorReturn$1(e,t){if(t&&(_typeof$3(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(e)}function _assertThisInitialized$1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _wrapNativeSuper(e){var t=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper=function(n){if(n===null||!_isNativeFunction(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return _construct(n,arguments,_getPrototypeOf$1(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf$1(i,n)},_wrapNativeSuper(e)}function _construct(e,t,r){return _isNativeReflectConstruct$1()?_construct=Reflect.construct:_construct=function(i,s,l){var c=[null];c.push.apply(c,s);var h=Function.bind.apply(i,c),m=new h;return l&&_setPrototypeOf$1(m,l.prototype),m},_construct.apply(null,arguments)}function _isNativeReflectConstruct$1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf$1(e,t){return _setPrototypeOf$1=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},_setPrototypeOf$1(e,t)}function _getPrototypeOf$1(e){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},_getPrototypeOf$1(e)}var ParseError=function(e){_inherits$1(r,e);var t=_createSuper(r);function r(n){var i;return _classCallCheck$9(this,r),i=t.call(this,n),Object.setPrototypeOf(_assertThisInitialized$1(i),r.prototype),i.name=i.constructor.name,i}return _createClass$9(r)}(_wrapNativeSuper(Error)),MIN_LENGTH_FOR_NSN=2,MAX_LENGTH_FOR_NSN=17,MAX_LENGTH_COUNTRY_CODE=3,VALID_DIGITS="0-90-9٠-٩۰-۹",DASHES="-‐-―−ー-",SLASHES="//",DOTS="..",WHITESPACE="  ­​⁠ ",BRACKETS="()()[]\\[\\]",TILDES="~⁓∼~",VALID_PUNCTUATION="".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES),PLUS_CHARS="++";function compare(e,t){e=e.split("-"),t=t.split("-");for(var r=e[0].split("."),n=t[0].split("."),i=0;i<3;i++){var s=Number(r[i]),l=Number(n[i]);if(s>l)return 1;if(l>s)return-1;if(!isNaN(s)&&isNaN(l))return 1;if(isNaN(s)&&!isNaN(l))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]=MIN_LENGTH_FOR_NSN&&VALID_PHONE_NUMBER_PATTERN.test(e)}function isViablePhoneNumberStart(e){return VALID_PHONE_NUMBER_START_REG_EXP.test(e)}var EXTN_PATTERN=new RegExp("(?:"+createExtensionPattern()+")$","i");function extractExtension(e){var t=e.search(EXTN_PATTERN);if(t<0)return{};for(var r=e.slice(0,t),n=e.match(EXTN_PATTERN),i=1;i=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$d(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$d(e,t)}}function _arrayLikeToArray$d(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$c(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$c(e,t)}}function _arrayLikeToArray$c(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rs?"TOO_SHORT":i[i.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}function isPossiblePhoneNumber(e,t,r){if(t===void 0&&(t={}),r=new Metadata(r),t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.country(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}}if(r.possibleLengths())return isPossibleNumber(e.phone||e.nationalNumber,r);if(e.countryCallingCode&&r.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function isPossibleNumber(e,t){switch(checkNumberLength(e,t)){case"IS_POSSIBLE":return!0;default:return!1}}function matchesEntirely(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function _createForOfIteratorHelperLoose$8(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray$b(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$b(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$b(e,t)}}function _arrayLikeToArray$b(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0}function applyInternationalSeparatorStyle(e){return e.replace(new RegExp("[".concat(VALID_PUNCTUATION,"]+"),"g")," ").trim()}var FIRST_GROUP_PATTERN=/(\$\d)/;function formatNationalNumberUsingFormat(e,t,r){var n=r.useInternationalFormat,i=r.withNationalPrefix;r.carrierCode,r.metadata;var s=e.replace(new RegExp(t.pattern()),n?t.internationalFormat():i&&t.nationalPrefixFormattingRule()?t.format().replace(FIRST_GROUP_PATTERN,t.nationalPrefixFormattingRule()):t.format());return n?applyInternationalSeparatorStyle(s):s}var SINGLE_IDD_PREFIX_REG_EXP=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function getIddPrefix(e,t,r){var n=new Metadata(r);if(n.selectNumberingPlan(e,t),n.defaultIDDPrefix())return n.defaultIDDPrefix();if(SINGLE_IDD_PREFIX_REG_EXP.test(n.IDDPrefix()))return n.IDDPrefix()}function formatRFC3966(e){var t=e.number,r=e.ext;if(!t)return"";if(t[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(r?";ext="+r:"")}function _createForOfIteratorHelperLoose$7(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray$a(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$a(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$a(e,t)}}function _arrayLikeToArray$a(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0){var s=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(t.search(s)!==0)continue}if(matchesEntirely(t,i.pattern()))return i}}function addExtension(e,t,r,n){return t?n(e,t,r):e}function formatIDD(e,t,r,n,i){var s=getCountryCallingCode(n,i.metadata);if(s===r){var l=formatNationalNumber$1(e,t,"NATIONAL",i);return r==="1"?r+" "+l:l}var c=getIddPrefix(n,void 0,i.metadata);if(c)return"".concat(c," ").concat(r," ").concat(formatNationalNumber$1(e,null,"INTERNATIONAL",i))}function ownKeys$6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _objectSpread$6(e){for(var t=1;t0&&l[1]==="0"))return e}}}function extractNationalNumberFromPossiblyIncompleteNumber(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var r=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(e);if(n){var i,s,l=n.length-1,c=l>0&&n[l];if(t.nationalPrefixTransformRule()&&c)i=e.replace(r,t.nationalPrefixTransformRule()),l>1&&(s=n[1]);else{var h=n[0];i=e.slice(h.length),c&&(s=n[1])}var m;if(c){var b=e.indexOf(n[1]),S=e.slice(0,b);S===t.numberingPlan.nationalPrefix()&&(m=t.numberingPlan.nationalPrefix())}else m=n[0];return{nationalNumber:i,nationalPrefix:m,carrierCode:s}}}return{nationalNumber:e}}function extractNationalNumber(e,t){var r=extractNationalNumberFromPossiblyIncompleteNumber(e,t),n=r.carrierCode,i=r.nationalNumber;if(i!==e){if(!shouldHaveExtractedNationalPrefix(e,i,t))return{nationalNumber:e};if(t.possibleLengths()&&!isPossibleIncompleteNationalNumber(i,t))return{nationalNumber:e}}return{nationalNumber:i,carrierCode:n}}function shouldHaveExtractedNationalPrefix(e,t,r){return!(matchesEntirely(e,r.nationalNumberPattern())&&!matchesEntirely(t,r.nationalNumberPattern()))}function isPossibleIncompleteNationalNumber(e,t){switch(checkNumberLength(e,t)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(e,t,r,n){var i=t?getCountryCallingCode(t,n):r;if(e.indexOf(i)===0){n=new Metadata(n),n.selectNumberingPlan(t,r);var s=e.slice(i.length),l=extractNationalNumber(s,n),c=l.nationalNumber,h=extractNationalNumber(e,n),m=h.nationalNumber;if(!matchesEntirely(m,n.nationalNumberPattern())&&matchesEntirely(c,n.nationalNumberPattern())||checkNumberLength(m,n)==="TOO_LONG")return{countryCallingCode:i,number:s}}return{number:e}}function extractCountryCallingCode(e,t,r,n){if(!e)return{};var i;if(e[0]!=="+"){var s=stripIddPrefix(e,t,r,n);if(s&&s!==e)i=!0,e="+"+s;else{if(t||r){var l=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(e,t,r,n),c=l.countryCallingCode,h=l.number;if(c)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:c,number:h}}return{number:e}}}if(e[1]==="0")return{};n=new Metadata(n);for(var m=2;m-1<=MAX_LENGTH_COUNTRY_CODE&&m<=e.length;){var b=e.slice(1,m);if(n.hasCallingCode(b))return n.selectNumberingPlan(b),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:b,number:e.slice(m)};m++}return{}}function _createForOfIteratorHelperLoose$6(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray$9(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$9(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$9(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$9(e,t)}}function _arrayLikeToArray$9(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length)return"";var n=e.indexOf(";",r);return n>=0?e.substring(r,n):e.substring(r)}function isPhoneContextValid(e){return e===null?!0:e.length===0?!1:RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_.test(e)||RFC3966_DOMAINNAME_PATTERN_.test(e)}function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(e,t){var r=t.extractFormattedPhoneNumber,n=extractPhoneContext(e);if(!isPhoneContextValid(n))throw new ParseError("NOT_A_NUMBER");var i;if(n===null)i=r(e)||"";else{i="",n.charAt(0)===PLUS_SIGN&&(i+=n);var s=e.indexOf(RFC3966_PREFIX_),l;s>=0?l=s+RFC3966_PREFIX_.length:l=0;var c=e.indexOf(RFC3966_PHONE_CONTEXT_);i+=e.substring(l,c)}var h=i.indexOf(RFC3966_ISDN_SUBADDRESS_);if(h>0&&(i=i.substring(0,h)),i!=="")return i}var MAX_INPUT_STRING_LENGTH=250,PHONE_NUMBER_START_PATTERN=new RegExp("["+PLUS_CHARS+VALID_DIGITS+"]"),AFTER_PHONE_NUMBER_END_PATTERN=new RegExp("[^"+VALID_DIGITS+"#]+$");function parse(e,t,r){if(t=t||{},r=new Metadata(r),t.defaultCountry&&!r.hasCountry(t.defaultCountry))throw t.v2?new ParseError("INVALID_COUNTRY"):new Error("Unknown country: ".concat(t.defaultCountry));var n=parseInput(e,t.v2,t.extract),i=n.number,s=n.ext,l=n.error;if(!i){if(t.v2)throw l==="TOO_SHORT"?new ParseError("TOO_SHORT"):new ParseError("NOT_A_NUMBER");return{}}var c=parsePhoneNumber$3(i,t.defaultCountry,t.defaultCallingCode,r),h=c.country,m=c.nationalNumber,b=c.countryCallingCode,S=c.countryCallingCodeSource,w=c.carrierCode;if(!r.hasSelectedNumberingPlan()){if(t.v2)throw new ParseError("INVALID_COUNTRY");return{}}if(!m||m.lengthMAX_LENGTH_FOR_NSN){if(t.v2)throw new ParseError("TOO_LONG");return{}}if(t.v2){var _=new PhoneNumber(b,m,r.metadata);return h&&(_.country=h),w&&(_.carrierCode=w),s&&(_.ext=s),_.__countryCallingCodeSource=S,_}var I=(t.extended?r.hasSelectedNumberingPlan():h)?matchesEntirely(m,r.nationalNumberPattern()):!1;return t.extended?{country:h,countryCallingCode:b,carrierCode:w,valid:I,possible:I?!0:!!(t.extended===!0&&r.possibleLengths()&&isPossibleNumber(m,r)),phone:m,ext:s}:I?result(h,m,s):{}}function _extractFormattedPhoneNumber(e,t,r){if(e){if(e.length>MAX_INPUT_STRING_LENGTH){if(r)throw new ParseError("TOO_LONG");return}if(t===!1)return e;var n=e.search(PHONE_NUMBER_START_PATTERN);if(!(n<0))return e.slice(n).replace(AFTER_PHONE_NUMBER_END_PATTERN,"")}}function parseInput(e,t,r){var n=extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(e,{extractFormattedPhoneNumber:function(l){return _extractFormattedPhoneNumber(l,r,t)}});if(!n)return{};if(!isViablePhoneNumber(n))return isViablePhoneNumberStart(n)?{error:"TOO_SHORT"}:{};var i=extractExtension(n);return i.ext?i:{number:n}}function result(e,t,r){var n={country:e,phone:t};return r&&(n.ext=r),n}function parsePhoneNumber$3(e,t,r,n){var i=extractCountryCallingCode(parseIncompletePhoneNumber(e),t,r,n.metadata),s=i.countryCallingCodeSource,l=i.countryCallingCode,c=i.number,h;if(l)n.selectNumberingPlan(l);else if(c&&(t||r))n.selectNumberingPlan(t,r),t&&(h=t),l=r||getCountryCallingCode(t,n.metadata);else return{};if(!c)return{countryCallingCodeSource:s,countryCallingCode:l};var m=extractNationalNumber(parseIncompletePhoneNumber(c),n),b=m.nationalNumber,S=m.carrierCode,w=getCountryByCallingCode(l,{nationalNumber:b,defaultCountry:t,metadata:n});return w&&(h=w,w==="001"||n.country(h)),{country:h,countryCallingCode:l,countryCallingCodeSource:s,nationalNumber:b,carrierCode:S}}function ownKeys$5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _objectSpread$5(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$7(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$7(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$7(e,t)}}function _arrayLikeToArray$7(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function cutAndStripNonPairedParens(e,t){return e[t]===")"&&t++,stripNonPairedParens(e.slice(0,t))}function stripNonPairedParens(e){for(var t=[],r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$6(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$6(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$6(e,t)}}function _arrayLikeToArray$6(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:{},i=n.allowOverflow;if(!r)throw new Error("String is required");var s=_match(r.split(""),this.matchTree,!0);if(s&&s.match&&delete s.matchedChars,!(s&&s.overflow&&!i))return s}}]),e}();function _match(e,t,r){if(typeof t=="string"){var n=e.join("");return t.indexOf(n)===0?e.length===t.length?{match:!0,matchedChars:e}:{partialMatch:!0}:n.indexOf(t)===0?r&&e.length>t.length?{overflow:!0}:{match:!0,matchedChars:e.slice(0,t.length)}:void 0}if(Array.isArray(t)){for(var i=e.slice(),s=0;s=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$5(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$5(e,t)}}function _arrayLikeToArray$5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)){var i=this.getTemplateForFormat(r,n);if(i)return this.setNationalNumberTemplate(i,n),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(r){return this.isNANP||r&&r.nationalPrefixFormattingRule()&&NATIONAL_PREFIX_SEPARATORS_PATTERN.test(r.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(r,n){var i=r.IDDPrefix,s=r.missingPlus;return i?n&&n.spacing===!1?i:i+" ":s?"":"+"}},{key:"getTemplate",value:function(r){if(this.template){for(var n=-1,i=0,s=r.international?this.getInternationalPrefixBeforeCountryCallingCode(r,{spacing:!1}):"";im.length)){var b=new RegExp("^"+h+"$"),S=i.replace(/\d/g,DUMMY_DIGIT);b.test(S)&&(m=S);var w=this.getFormatFormat(r,s),_;if(this.shouldTryNationalPrefixFormattingRule(r,{international:s,nationalPrefix:l})){var I=w.replace(FIRST_GROUP_PATTERN,r.nationalPrefixFormattingRule());if(parseDigits(r.nationalPrefixFormattingRule())===(l||"")+parseDigits("$1")&&(w=I,_=!0,l))for(var N=l.length;N>0;)w=w.replace(/\d/,DIGIT_PLACEHOLDER),N--}var P=m.replace(new RegExp(h),w).replace(new RegExp(DUMMY_DIGIT,"g"),DIGIT_PLACEHOLDER);return _||(c?P=repeat$1(DIGIT_PLACEHOLDER,c.length)+" "+P:l&&(P=repeat$1(DIGIT_PLACEHOLDER,l.length)+this.getSeparatorAfterNationalPrefix(r)+P)),s&&(P=applyInternationalSeparatorStyle(P)),P}}},{key:"formatNextNationalNumberDigits",value:function(r){var n=populateTemplateWithDigits(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,r);if(!n){this.resetFormat();return}return this.populatedNationalNumberTemplate=n[0],this.populatedNationalNumberTemplatePosition=n[1],cutAndStripNonPairedParens(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(r,n){var i=n.international,s=n.nationalPrefix;if(r.nationalPrefixFormattingRule()){var l=r.usesNationalPrefix();if(l&&s||!l&&!i)return!0}}}]),e}();function _slicedToArray$1(e,t){return _arrayWithHoles$1(e)||_iterableToArrayLimit$1(e,t)||_unsupportedIterableToArray$4(e,t)||_nonIterableRest$1()}function _nonIterableRest$1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$4(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$4(e,t)}}function _arrayLikeToArray$4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=3;if(n.appendDigits(r),s&&this.extractIddPrefix(n),this.isWaitingForCountryCallingCode(n)){if(!this.extractCountryCallingCode(n))return}else n.appendNationalSignificantNumberDigits(r);n.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(n.getNationalDigits(),function(l){return n.update(l)})}},{key:"isWaitingForCountryCallingCode",value:function(r){var n=r.international,i=r.callingCode;return n&&!i}},{key:"extractCountryCallingCode",value:function(r){var n=extractCountryCallingCode("+"+r.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode,s=n.number;if(i)return r.setCallingCode(i),r.update({nationalSignificantNumber:s}),!0}},{key:"reset",value:function(r){if(r){this.hasSelectedNumberingPlan=!0;var n=r._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=n&&COMPLEX_NATIONAL_PREFIX.test(n)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(r,n){if(this.hasSelectedNumberingPlan){var i=extractNationalNumberFromPossiblyIncompleteNumber(r,this.metadata),s=i.nationalPrefix,l=i.nationalNumber,c=i.carrierCode;if(l!==r)return this.onExtractedNationalNumber(s,c,l,r,n),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(r,n,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(r,i);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var s=extractNationalNumberFromPossiblyIncompleteNumber(r,this.metadata),l=s.nationalPrefix,c=s.nationalNumber,h=s.carrierCode;if(c!==n)return this.onExtractedNationalNumber(l,h,c,r,i),!0}}},{key:"onExtractedNationalNumber",value:function(r,n,i,s,l){var c,h,m=s.lastIndexOf(i);if(m>=0&&m===s.length-i.length){h=!0;var b=s.slice(0,m);b!==r&&(c=b)}l({nationalPrefix:r,carrierCode:n,nationalSignificantNumber:i,nationalSignificantNumberMatchesInput:h,complexPrefixBeforeNationalSignificantNumber:c}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(r){if(this.extractAnotherNationalSignificantNumber(r.getNationalDigits(),r.nationalSignificantNumber,function(n){return r.update(n)}))return!0;if(this.extractIddPrefix(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0;if(this.fixMissingPlus(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0}},{key:"extractIddPrefix",value:function(r){var n=r.international,i=r.IDDPrefix,s=r.digits;if(r.nationalSignificantNumber,!(n||i)){var l=stripIddPrefix(s,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(l!==void 0&&l!==s)return r.update({IDDPrefix:s.slice(0,s.length-l.length)}),this.startInternationalNumber(r,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(r){if(!r.international){var n=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(r.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode;if(n.number,i)return r.update({missingPlus:!0}),this.startInternationalNumber(r,{country:r.country,callingCode:i}),!0}}},{key:"startInternationalNumber",value:function(r,n){var i=n.country,s=n.callingCode;r.startInternationalNumber(i,s),r.nationalSignificantNumber&&(r.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(r){this.extractCountryCallingCode(r)&&this.extractNationalSignificantNumber(r.getNationalDigits(),function(n){return r.update(n)})}}]),e}();function extractFormattedPhoneNumber(e){var t=e.search(VALID_FORMATTED_PHONE_NUMBER_PART);if(!(t<0)){e=e.slice(t);var r;return e[0]==="+"&&(r=!0,e=e.slice(1)),e=e.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN,""),r&&(e="+"+e),e}}function _extractFormattedDigitsAndPlus(e){var t=extractFormattedPhoneNumber(e)||"";return t[0]==="+"?[t.slice(1),!0]:[t]}function extractFormattedDigitsAndPlus(e){var t=_extractFormattedDigitsAndPlus(e),r=_slicedToArray$1(t,2),n=r[0],i=r[1];return VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(n)||(n=""),[n,i]}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray$3(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$3(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$3(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$3(e,t)}}function _arrayLikeToArray$3(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1}},{key:"determineTheCountry",value:function(){this.state.setCountry(getCountryByCallingCode(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var r=this.state,n=r.digits,i=r.callingCode,s=r.country,l=r.nationalSignificantNumber;if(n){if(this.isInternational())return i?"+"+i+l:"+"+n;if(s||i){var c=s?this.metadata.countryCallingCode():i;return"+"+c+l}}}},{key:"getNumber",value:function(){var r=this.state,n=r.nationalSignificantNumber,i=r.carrierCode,s=r.callingCode,l=this._getCountry();if(n&&!(!l&&!s)){if(l&&l===this.defaultCountry){var c=new Metadata(this.metadata.metadata);c.selectNumberingPlan(l);var h=c.numberingPlan.callingCode(),m=this.metadata.getCountryCodesForCallingCode(h);if(m.length>1){var b=getCountryByNationalNumber(n,{countries:m,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});b&&(l=b)}}var S=new PhoneNumber(l||s,n,this.metadata.metadata);return i&&(S.carrierCode=i),S}}},{key:"isPossible",value:function(){var r=this.getNumber();return r?r.isPossible():!1}},{key:"isValid",value:function(){var r=this.getNumber();return r?r.isValid():!1}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}]),e}();function getCountries(e){return new Metadata(e).getCountries()}function formatIncompletePhoneNumber(e,t,r){return r||(r=t,t=void 0),new AsYouType(t,r).input(e)}function getInputValuePrefix(e){var t=e.country,r=e.international,n=e.withCountryCallingCode,i=e.metadata;return t&&r&&!n?"+".concat(getCountryCallingCode(t,i)):""}function removeInputValuePrefix(e,t){return t&&(e=e.slice(t.length),e[0]===" "&&(e=e.slice(1))),e}function parsePhoneNumberCharacter_(e,t,r){if(!(r&&r.ignoreRest)){var n=function(s){if(r)switch(s){case"end":r.ignoreRest=!0;break}};return parsePhoneNumberCharacter(e,t,n)}}function useInputKeyDownHandler(e){var t=e.onKeyDown,r=e.international;return reactExports.useCallback(function(n){if(n.keyCode===BACKSPACE_KEY_CODE&&r&&n.target instanceof HTMLInputElement&&getCaretPosition$1(n.target)===AFTER_LEADING_PLUS_CARET_POSITION){n.preventDefault();return}t&&t(n)},[t,r])}var BACKSPACE_KEY_CODE=8;function getCaretPosition$1(e){return e.selectionStart}var AFTER_LEADING_PLUS_CARET_POSITION=1,_excluded$7=["onKeyDown","country","international","withCountryCallingCode","metadata"];function _objectWithoutProperties$7(e,t){if(e==null)return{};var r=_objectWithoutPropertiesLoose$7(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$7(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function createInput$1(e){function t(r,n){var i=r.onKeyDown,s=r.country,l=r.international,c=r.withCountryCallingCode,h=r.metadata,m=h===void 0?e:h,b=_objectWithoutProperties$7(r,_excluded$7),S=reactExports.useCallback(function(_){var I=new AsYouType(s,m),N=getInputValuePrefix({country:s,international:l,withCountryCallingCode:c,metadata:m}),P=I.input(N+_),F=I.getTemplate();return N&&(P=removeInputValuePrefix(P,N),F&&(F=removeInputValuePrefix(F,N))),{text:P,template:F}},[s,m]),w=useInputKeyDownHandler({onKeyDown:i,international:l});return jsx(Input$1,{...b,ref:n,parse:parsePhoneNumberCharacter_,format:S,onKeyDown:w})}return t=React.forwardRef(t),t.propTypes={value:PropTypes.string.isRequired,onChange:PropTypes.func.isRequired,onKeyDown:PropTypes.func,country:PropTypes.string,international:PropTypes.bool,withCountryCallingCode:PropTypes.bool,metadata:PropTypes.object},t}const InputSmart=createInput$1();var _excluded$6=["value","onChange","onKeyDown","country","international","withCountryCallingCode","metadata","inputComponent"];function _objectWithoutProperties$6(e,t){if(e==null)return{};var r=_objectWithoutPropertiesLoose$6(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$6(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function createInput(e){function t(r,n){var i=r.value,s=r.onChange,l=r.onKeyDown,c=r.country,h=r.international,m=r.withCountryCallingCode,b=r.metadata,S=b===void 0?e:b,w=r.inputComponent,_=w===void 0?"input":w,I=_objectWithoutProperties$6(r,_excluded$6),N=getInputValuePrefix({country:c,international:h,withCountryCallingCode:m,metadata:S}),P=reactExports.useCallback(function(j){var q=parseIncompletePhoneNumber(j.target.value);if(q===i){var f=format(N,q,c,S);f.indexOf(j.target.value)===0&&(q=q.slice(0,-1))}s(q)},[N,i,s,c,S]),F=useInputKeyDownHandler({onKeyDown:l,international:h});return jsx(_,{...I,ref:n,value:format(N,i,c,S),onChange:P,onKeyDown:F})}return t=React.forwardRef(t),t.propTypes={value:PropTypes.string.isRequired,onChange:PropTypes.func.isRequired,onKeyDown:PropTypes.func,country:PropTypes.string,international:PropTypes.bool,withCountryCallingCode:PropTypes.bool,metadata:PropTypes.object,inputComponent:PropTypes.elementType},t}const InputBasic=createInput();function format(e,t,r,n){return removeInputValuePrefix(formatIncompletePhoneNumber(e+t,r,n),e)}function getCountryFlag(e){return getRegionalIndicatorSymbol(e[0])+getRegionalIndicatorSymbol(e[1])}function getRegionalIndicatorSymbol(e){return String.fromCodePoint(127397+e.toUpperCase().charCodeAt(0))}var _excluded$5=["value","onChange","options","disabled","readOnly"],_excluded2$1=["value","options","className","iconComponent","getIconAspectRatio","arrowComponent","unicodeFlags"];function _createForOfIteratorHelperLoose$2(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray$2(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$2(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$2(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$2(e,t)}}function _arrayLikeToArray$2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$5(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function CountrySelect(e){var t=e.value,r=e.onChange,n=e.options,i=e.disabled,s=e.readOnly,l=_objectWithoutProperties$5(e,_excluded$5),c=reactExports.useCallback(function(h){var m=h.target.value;r(m==="ZZ"?void 0:m)},[r]);return reactExports.useMemo(function(){return getSelectedOption(n,t)},[n,t]),jsx("select",{...l,disabled:i||s,readOnly:s,value:t||"ZZ",onChange:c,children:n.map(function(h){var m=h.value,b=h.label,S=h.divider;return jsx("option",{value:S?"|":m||"ZZ",disabled:!!S,style:S?DIVIDER_STYLE:void 0,children:b},S?"|":m||"ZZ")})})}CountrySelect.propTypes={value:PropTypes.string,onChange:PropTypes.func.isRequired,options:PropTypes.arrayOf(PropTypes.shape({value:PropTypes.string,label:PropTypes.string,divider:PropTypes.bool})).isRequired,disabled:PropTypes.bool,readOnly:PropTypes.bool};var DIVIDER_STYLE={fontSize:"1px",backgroundColor:"currentColor",color:"inherit"};function CountrySelectWithIcon(e){var t=e.value,r=e.options,n=e.className,i=e.iconComponent;e.getIconAspectRatio;var s=e.arrowComponent,l=s===void 0?DefaultArrowComponent:s,c=e.unicodeFlags,h=_objectWithoutProperties$5(e,_excluded2$1),m=reactExports.useMemo(function(){return getSelectedOption(r,t)},[r,t]);return jsxs("div",{className:"PhoneInputCountry",children:[jsx(CountrySelect,{...h,value:t,options:r,className:classNames("PhoneInputCountrySelect",n)}),c&&t&&jsx("div",{className:"PhoneInputCountryIconUnicode",children:getCountryFlag(t)}),!(c&&t)&&jsx(i,{"aria-hidden":!0,country:t,label:m&&m.label,aspectRatio:c?1:void 0}),jsx(l,{})]})}CountrySelectWithIcon.propTypes={iconComponent:PropTypes.elementType,arrowComponent:PropTypes.elementType,unicodeFlags:PropTypes.bool};function DefaultArrowComponent(){return jsx("div",{className:"PhoneInputCountrySelectArrow"})}function getSelectedOption(e,t){for(var r=_createForOfIteratorHelperLoose$2(e),n;!(n=r()).done;){var i=n.value;if(!i.divider&&i.value===t)return i}}var _excluded$4=["country","countryName","flags","flagUrl"];function _extends$4(){return _extends$4=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$4(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function FlagComponent(e){var t=e.country,r=e.countryName,n=e.flags,i=e.flagUrl,s=_objectWithoutProperties$4(e,_excluded$4);return n&&n[t]?n[t]({title:r}):React.createElement("img",_extends$4({},s,{alt:r,role:r?void 0:"presentation",src:i.replace("{XX}",t).replace("{xx}",t.toLowerCase())}))}FlagComponent.propTypes={country:PropTypes.string.isRequired,countryName:PropTypes.string.isRequired,flags:PropTypes.objectOf(PropTypes.elementType),flagUrl:PropTypes.string.isRequired};var _excluded$3=["aspectRatio"],_excluded2=["title"],_excluded3=["title"];function _extends$3(){return _extends$3=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$3(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function InternationalIcon(e){var t=e.aspectRatio,r=_objectWithoutProperties$3(e,_excluded$3);return t===1?React.createElement(InternationalIcon1x1,r):React.createElement(InternationalIcon3x2,r)}InternationalIcon.propTypes={title:PropTypes.string.isRequired,aspectRatio:PropTypes.number};function InternationalIcon3x2(e){var t=e.title,r=_objectWithoutProperties$3(e,_excluded2);return React.createElement("svg",_extends$3({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 75 50"}),React.createElement("title",null,t),React.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeMiterlimit:"10"},React.createElement("path",{strokeLinecap:"round",d:"M47.2,36.1C48.1,36,49,36,50,36c7.4,0,14,1.7,18.5,4.3"}),React.createElement("path",{d:"M68.6,9.6C64.2,12.3,57.5,14,50,14c-7.4,0-14-1.7-18.5-4.3"}),React.createElement("line",{x1:"26",y1:"25",x2:"74",y2:"25"}),React.createElement("line",{x1:"50",y1:"1",x2:"50",y2:"49"}),React.createElement("path",{strokeLinecap:"round",d:"M46.3,48.7c1.2,0.2,2.5,0.3,3.7,0.3c13.3,0,24-10.7,24-24S63.3,1,50,1S26,11.7,26,25c0,2,0.3,3.9,0.7,5.8"}),React.createElement("path",{strokeLinecap:"round",d:"M46.8,48.2c1,0.6,2.1,0.8,3.2,0.8c6.6,0,12-10.7,12-24S56.6,1,50,1S38,11.7,38,25c0,1.4,0.1,2.7,0.2,4c0,0.1,0,0.2,0,0.2"})),React.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"none",fill:"currentColor",d:"M12.4,17.9c2.9-2.9,5.4-4.8,0.3-11.2S4.1,5.2,1.3,8.1C-2,11.4,1.1,23.5,13.1,35.6s24.3,15.2,27.5,11.9c2.8-2.8,7.8-6.3,1.4-11.5s-8.3-2.6-11.2,0.3c-2,2-7.2-2.2-11.7-6.7S10.4,19.9,12.4,17.9z"}))}InternationalIcon3x2.propTypes={title:PropTypes.string.isRequired};function InternationalIcon1x1(e){var t=e.title,r=_objectWithoutProperties$3(e,_excluded3);return React.createElement("svg",_extends$3({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"}),React.createElement("title",null,t),React.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeLinecap:"round"},React.createElement("path",{d:"M8.45,13A21.44,21.44,0,1,1,37.08,41.56"}),React.createElement("path",{d:"M19.36,35.47a36.9,36.9,0,0,1-2.28-13.24C17.08,10.39,21.88.85,27.8.85s10.72,9.54,10.72,21.38c0,6.48-1.44,12.28-3.71,16.21"}),React.createElement("path",{d:"M17.41,33.4A39,39,0,0,1,27.8,32.06c6.62,0,12.55,1.5,16.48,3.86"}),React.createElement("path",{d:"M44.29,8.53c-3.93,2.37-9.86,3.88-16.49,3.88S15.25,10.9,11.31,8.54"}),React.createElement("line",{x1:"27.8",y1:"0.85",x2:"27.8",y2:"34.61"}),React.createElement("line",{x1:"15.2",y1:"22.23",x2:"49.15",y2:"22.23"})),React.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"transparent",fill:"currentColor",d:"M9.42,26.64c2.22-2.22,4.15-3.59.22-8.49S3.08,17,.93,19.17c-2.49,2.48-.13,11.74,9,20.89s18.41,11.5,20.89,9c2.15-2.15,5.91-4.77,1-8.71s-6.27-2-8.49.22c-1.55,1.55-5.48-1.69-8.86-5.08S7.87,28.19,9.42,26.64Z"}))}InternationalIcon1x1.propTypes={title:PropTypes.string.isRequired};function _createForOfIteratorHelperLoose$1(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray$1(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$1(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$1(e,t)}}function _arrayLikeToArray$1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0))return e}function isCountrySupportedWithError(e,t){return isSupportedCountry$1(e,t)?!0:(console.error("Country not found: ".concat(e)),!1)}function getSupportedCountries(e,t){return e&&(e=e.filter(function(r){return isCountrySupportedWithError(r,t)}),e.length===0&&(e=void 0)),e}var _excluded$2=["country","label","aspectRatio"];function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$2(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function createCountryIconComponent(e){var t=e.flags,r=e.flagUrl,n=e.flagComponent,i=e.internationalIcon;function s(l){var c=l.country,h=l.label,m=l.aspectRatio,b=_objectWithoutProperties$2(l,_excluded$2),S=i===InternationalIcon?m:void 0;return React.createElement("div",_extends$2({},b,{className:classNames("PhoneInputCountryIcon",{"PhoneInputCountryIcon--square":S===1,"PhoneInputCountryIcon--border":c})}),c?React.createElement(n,{country:c,countryName:h,flags:t,flagUrl:r,className:"PhoneInputCountryIconImg"}):React.createElement(i,{title:h,aspectRatio:S,className:"PhoneInputCountryIconImg"}))}return s.propTypes={country:PropTypes.string,label:PropTypes.string.isRequired,aspectRatio:PropTypes.number},s}createCountryIconComponent({flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",flagComponent:FlagComponent,internationalIcon:InternationalIcon});function _createForOfIteratorHelperLoose(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(e,t)}}function _arrayLikeToArray(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(h=i()),h}function getCountrySelectOptions(e){var t=e.countries,r=e.countryNames,n=e.addInternationalOption,i=e.compareStringsLocales,s=e.compareStrings;s||(s=compareStrings);var l=t.map(function(c){return{value:c,label:r[c]||c}});return l.sort(function(c,h){return s(c.label,h.label,i)}),n&&l.unshift({label:r.ZZ}),l}function parsePhoneNumber(e,t){return parsePhoneNumber$1(e||"",t)}function generateNationalNumberDigits(e){return e.formatNational().replace(/\D/g,"")}function getPhoneDigitsForNewCountry(e,t){var r=t.prevCountry,n=t.newCountry,i=t.metadata,s=t.useNationalFormat;if(r===n)return e;if(!e)return s?"":n?getInternationalPhoneNumberPrefix(n,i):"";if(n){if(e[0]==="+"){if(s)return e.indexOf("+"+getCountryCallingCode(n,i))===0?stripCountryCallingCode(e,n,i):"";if(r){var l=getInternationalPhoneNumberPrefix(n,i);return e.indexOf(l)===0?e:l}else{var c=getInternationalPhoneNumberPrefix(n,i);return e.indexOf(c)===0?e:c}}}else if(e[0]!=="+")return e164(e,r,i)||"";return e}function e164(e,t,r){if(e){if(e[0]==="+"){if(e==="+")return;var n=new AsYouType(t,r);return n.input(e),n.getNumberValue()}if(t){var i=getNationalSignificantNumberDigits(e,t,r);return"+".concat(getCountryCallingCode(t,r)).concat(i||"")}}}function trimNumber(e,t,r){var n=getNationalSignificantNumberDigits(e,t,r);if(n){var i=n.length-getMaxNumberLength(t,r);if(i>0)return e.slice(0,e.length-i)}return e}function getMaxNumberLength(e,t){return t=new Metadata(t),t.selectNumberingPlan(e),t.numberingPlan.possibleLengths()[t.numberingPlan.possibleLengths().length-1]}function getCountryForPartialE164Number(e,t){var r=t.country,n=t.countries,i=t.defaultCountry,s=t.latestCountrySelectedByUser,l=t.required,c=t.metadata;if(e==="+")return r;var h=getCountryFromPossiblyIncompleteInternationalPhoneNumber(e,c);if(h)return!n||n.indexOf(h)>=0?h:void 0;if(r){if(couldNumberBelongToCountry(e,r,c)){if(s&&couldNumberBelongToCountry(e,s,c))return s;if(i&&couldNumberBelongToCountry(e,i,c))return i;if(!l)return}else if(!l)return}return r}function onPhoneDigitsChange(e,t){var r=t.prevPhoneDigits,n=t.country,i=t.defaultCountry,s=t.latestCountrySelectedByUser,l=t.countryRequired,c=t.getAnyCountry,h=t.countries,m=t.international,b=t.limitMaxLength,S=t.countryCallingCodeEditable,w=t.metadata;if(m&&S===!1&&n){var _=getInternationalPhoneNumberPrefix(n,w);if(e.indexOf(_)!==0){var I,N=e&&e[0]!=="+";return N?(e=_+e,I=e164(e,n,w)):e=_,{phoneDigits:e,value:I,country:n}}}m===!1&&n&&e&&e[0]==="+"&&(e=convertInternationalPhoneDigitsToNational(e,n,w)),e&&n&&b&&(e=trimNumber(e,n,w)),e&&e[0]!=="+"&&(!n||m)&&(e="+"+e),!e&&r&&r[0]==="+"&&(m?n=void 0:n=i),e==="+"&&r&&r[0]==="+"&&r.length>1&&(n=void 0);var P;return e&&(e[0]==="+"&&(e==="+"||n&&getInternationalPhoneNumberPrefix(n,w).indexOf(e)===0)?P=void 0:P=e164(e,n,w)),P&&(n=getCountryForPartialE164Number(P,{country:n,countries:h,defaultCountry:i,latestCountrySelectedByUser:s,required:!1,metadata:w}),m===!1&&n&&e&&e[0]==="+"&&(e=convertInternationalPhoneDigitsToNational(e,n,w),P=e164(e,n,w))),!n&&l&&(n=i||c()),{phoneDigits:e,country:n,value:P}}function convertInternationalPhoneDigitsToNational(e,t,r){if(e.indexOf(getInternationalPhoneNumberPrefix(t,r))===0){var n=new AsYouType(t,r);n.input(e);var i=n.getNumber();return i?i.formatNational().replace(/\D/g,""):""}else return e.replace(/\D/g,"")}function getCountryFromPossiblyIncompleteInternationalPhoneNumber(e,t){var r=new AsYouType(null,t);return r.input(e),r.getCountry()}function compareStrings(e,t,r){return String.prototype.localeCompare?e.localeCompare(t,r):et?1:0}function stripCountryCallingCode(e,t,r){if(t){var n="+"+getCountryCallingCode(t,r);if(e.length=0)&&(g=v.country):(g=getCountryForPartialE164Number(l,{country:void 0,countries:C,metadata:n}),g||s&&l.indexOf(getInternationalPhoneNumberPrefix(s,n))===0&&(g=s))}var $;if(l){if(P){var R=g?P===g:couldNumberBelongToCountry(l,P,n);R?g||(g=P):$={latestCountrySelectedByUser:void 0}}}else $={latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0};return _objectSpread$1(_objectSpread$1({},$),{},{phoneDigits:F({phoneNumber:v,value:l,defaultCountry:s}),value:l,country:l?g:s})}}function valuesAreEqual(e,t){return e===null&&(e=void 0),t===null&&(t=void 0),e===t}var _excluded$1=["name","disabled","readOnly","autoComplete","style","className","inputRef","inputComponent","numberInputProps","smartCaret","countrySelectComponent","countrySelectProps","containerComponent","containerComponentProps","defaultCountry","countries","countryOptionsOrder","labels","flags","flagComponent","flagUrl","addInternationalOption","internationalIcon","displayInitialValueAsLocalNumber","initialValueFormat","onCountryChange","limitMaxLength","countryCallingCodeEditable","focusInputOnCountrySelection","reset","metadata","international","locales"];function _typeof(e){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(e)}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$1(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function createPhoneInput(e){var t=React.forwardRef(function(r,n){var i=r.metadata,s=i===void 0?e:i,l=r.labels,c=l===void 0?defaultLabels:l,h=_objectWithoutProperties(r,_excluded);return React.createElement(PhoneNumberInput,_extends({},h,{ref:n,metadata:s,labels:c}))});return t.propTypes={metadata,labels},t}createPhoneInput();function call(e,t){var r=Array.prototype.slice.call(t);return r.push(metadata$1),e.apply(this,r)}const NativePhoneInput=createPhoneInput(metadata$1);function isValidPhoneNumber(){return call(isValidPhoneNumber$1,arguments)}function isSupportedCountry(){return call(isSupportedCountry$1,arguments)}const MISSPELL_EMAILS=["gmail.cim","gmail.cpm","gmail.clm","gmail.con","gmai.lcom","gmailc.om","gmail.xom","gmail.vom","gmail.dom","gmail.fom","gmail,com"];function validateEmail(e){return MISSPELL_EMAILS.some(t=>e.includes(t))||!emailValidatorExports.validate(e)?"Invalid email":!0}function validatePhone(e){return!e||!isValidPhoneNumber(e)?"Invalid phone":!0}const shouldDisableValidation=()=>{var e;return((e=detect())==null?void 0:e.name)==="safari"},isInstagram=()=>{var e;return((e=detect())==null?void 0:e.name)==="instagram"},FormItem=reactExports.forwardRef(({label:e,error:t,validationMessages:r,children:n},i)=>{const s=reactExports.useMemo(()=>t?t.type==="required"?(r==null?void 0:r.required)||`${e} is required`:r!=null&&r.invalid?r.invalid:t.type==="minLength"?`${e} is too short`:typeof t.message=="string"?t.message:`${e} is invalid`:"",[t,e,r]);return jsxs("label",{ref:i,className:"text-primary-500 focus-within:text-accent transition duration-150 flex flex-col gap-0.5 items-stretch",children:[n,t&&jsx("p",{className:"text-red-700 text-xs",children:s})]})});FormItem.displayName="FormItem";function __rest(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=c?i=i+repeat("0",l-c):i=(i.substring(0,l)||"0")+"."+i.substring(l),r+i}function setCaretPosition(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var findChangeRange=memoizeOnce(function(e,t){for(var r=0,n=0,i=e.length,s=t.length;e[r]===t[r]&&rr&&i-n>r;)n++;return{from:{start:r,end:i-n},to:{start:r,end:s-n}}}),findChangedRangeFromCaretPositions=function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}};function clamp(e,t,r){return Math.min(Math.max(e,t),r)}function geInputCaretPosition(e){return Math.max(e.selectionStart,e.selectionEnd)}function addInputMode(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function getDefaultChangeMeta(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function getMaskAtIndex(e,t){return e===void 0&&(e=" "),typeof e=="string"?e:e[t]||" "}function defaultIsCharacterSame(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,i=e.formattedValueIndex;return t[n]===r[i]}function getCaretPosition(e,t,r,n,i,s,l){l===void 0&&(l=defaultIsCharacterSame);var c=i.findIndex(function(f){return f}),h=e.slice(0,c);!t&&!r.startsWith(h)&&(t=h,r=h+r,n=n+h.length);for(var m=r.length,b=e.length,S={},w=new Array(m),_=0;_0&&w[F]===-1;)F--;var q=F===-1||w[F]===-1?0:w[F]+1;return q>j?j:n-q=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=i&&!r[t];)t++;t>i&&(t=r.lastIndexOf(!0))}return t===-1&&(t=i),t}function caretUnknownFormatBoundary(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r0&&t[f-1]!==i;)f--;v="left"}else{for(var g=t.length;fl.handle===(r??DEFAULT_INPUT_HANDLE)),s=classNames(SHARED_STYLE_CLASSNAME(i==null?void 0:i.handle),i==null?void 0:i.styles.classes);return classNames("transition duration-150",s,e&&ERROR_CLASSNAME,t)}const Input=reactExports.forwardRef(({error:e=!1,className:t,sharedStyle:r,required:n,...i},s)=>{const l=useInputClassName({error:e,className:t,sharedStyle:r}),{styles:c,onClick:h,onMouseEnter:m,onMouseLeave:b}=usePreviewNodeContext();return jsx("input",{ref:s,className:classNames(l,"outline-none !normal-case"),style:c,...i,onClick:h,onMouseEnter:m,onMouseLeave:b,"aria-required":n})});Input.displayName="Input";const TextArea=reactExports.forwardRef(({error:e=!1,className:t,sharedStyle:r,required:n,...i},s)=>{const l=useInputClassName({error:e,className:t,sharedStyle:r}),{styles:c,onClick:h,onMouseEnter:m,onMouseLeave:b}=usePreviewNodeContext();return jsx("textarea",{ref:s,className:classNames(l,"outline-none !normal-case"),style:c,...i,onClick:h,onMouseEnter:m,onMouseLeave:b,"aria-required":n})});TextArea.displayName="TextArea";const FormattedInput=reactExports.forwardRef(({error:e=!1,className:t,format:r,sharedStyle:n,...i},s)=>{const l=useInputClassName({error:e,className:t,sharedStyle:n}),{styles:c,onClick:h,onMouseEnter:m,onMouseLeave:b}=usePreviewNodeContext();return jsx(PatternFormat,{getInputRef:s,format:r,type:"text",className:classNames(l,"outline-none !normal-case"),style:c,...i,onClick:h,onMouseEnter:m,onMouseLeave:b})});FormattedInput.displayName="FormattedInput";const EmailInput=reactExports.forwardRef(({id:e,required:t,placeholder:r,validationMessages:n,className:i,sharedStyle:s},l)=>{const{register:c,formState:{errors:h}}=useProfileFormContext();return jsx(FormItem,{label:"Email",required:t,validationMessages:n,error:h.email,ref:l,children:jsx(Input,{id:e,placeholder:r??"Your email",autoComplete:"email",...c("email",{required:t,...!shouldDisableValidation()&&{validate:m=>!t&&!m?!0:validateEmail(m??"")}}),error:!!h.email,required:t,className:i,sharedStyle:s})})});EmailInput.displayName="EmailInput";const FirstNameInput=reactExports.forwardRef(({id:e,required:t,placeholder:r,validationMessages:n,className:i,sharedStyle:s},l)=>{const{register:c,formState:{errors:h}}=useProfileFormContext();return jsx(FormItem,{label:"First name",required:t,error:h.name,validationMessages:n,ref:l,children:jsx(Input,{id:e,placeholder:r??"Your first name",autoComplete:"given-name",...c("name",{required:t,minLength:2}),error:!!h.name,required:t,className:i,sharedStyle:s})})});FirstNameInput.displayName="FirstNameInput";const rawCSS=':host,#alia-root{--PhoneInput-color--focus: #03b2cb;--PhoneInputInternationalIconPhone-opacity: .8;--PhoneInputInternationalIconGlobe-opacity: .65;--PhoneInputCountrySelect-marginRight: .35em;--PhoneInputCountrySelectArrow-width: .3em;--PhoneInputCountrySelectArrow-marginLeft: var(--PhoneInputCountrySelect-marginRight);--PhoneInputCountrySelectArrow-borderWidth: 1px;--PhoneInputCountrySelectArrow-opacity: .45;--PhoneInputCountrySelectArrow-color: currentColor;--PhoneInputCountrySelectArrow-color--focus: var(--PhoneInput-color--focus);--PhoneInputCountrySelectArrow-transform: rotate(45deg);--PhoneInputCountryFlag-aspectRatio: 1.5;--PhoneInputCountryFlag-height: 1em;--PhoneInputCountryFlag-borderWidth: 1px;--PhoneInputCountryFlag-borderColor: rgba(0,0,0,.5);--PhoneInputCountryFlag-borderColor--focus: var(--PhoneInput-color--focus);--PhoneInputCountryFlag-backgroundColor--loading: rgba(0,0,0,.1)}:host .PhoneInput,#alia-root .PhoneInput{display:flex;align-items:center}:host .PhoneInputInput,#alia-root .PhoneInputInput{flex:1;min-width:0}:host .PhoneInputCountryIcon,#alia-root .PhoneInputCountryIcon{width:calc(var(--PhoneInputCountryFlag-height) * var(--PhoneInputCountryFlag-aspectRatio));height:var(--PhoneInputCountryFlag-height)}:host .PhoneInputCountryIcon--square,#alia-root .PhoneInputCountryIcon--square{width:var(--PhoneInputCountryFlag-height)}:host .PhoneInputCountryIcon--border,#alia-root .PhoneInputCountryIcon--border{background-color:var(--PhoneInputCountryFlag-backgroundColor--loading);box-shadow:0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor),inset 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor)}:host .PhoneInputCountryIconImg,#alia-root .PhoneInputCountryIconImg{display:block;width:100%;height:100%}:host .PhoneInputInternationalIconPhone,#alia-root .PhoneInputInternationalIconPhone{opacity:var(--PhoneInputInternationalIconPhone-opacity)}:host .PhoneInputInternationalIconGlobe,#alia-root .PhoneInputInternationalIconGlobe{opacity:var(--PhoneInputInternationalIconGlobe-opacity)}:host .PhoneInputCountry,#alia-root .PhoneInputCountry{position:relative;align-self:stretch;display:flex;align-items:center;margin-right:var(--PhoneInputCountrySelect-marginRight)}:host .PhoneInputCountrySelect,#alia-root .PhoneInputCountrySelect{position:absolute;top:0;left:0;height:100%;width:100%;z-index:1;border:0;opacity:0;cursor:pointer}:host .PhoneInputCountrySelect[disabled],#alia-root .PhoneInputCountrySelect[disabled],:host .PhoneInputCountrySelect[readonly],#alia-root .PhoneInputCountrySelect[readonly]{cursor:default}:host .PhoneInputCountrySelectArrow,#alia-root .PhoneInputCountrySelectArrow{display:block;content:"";width:var(--PhoneInputCountrySelectArrow-width);height:var(--PhoneInputCountrySelectArrow-width);margin-left:var(--PhoneInputCountrySelectArrow-marginLeft);border-style:solid;border-color:var(--PhoneInputCountrySelectArrow-color);border-top-width:0;border-bottom-width:var(--PhoneInputCountrySelectArrow-borderWidth);border-left-width:0;border-right-width:var(--PhoneInputCountrySelectArrow-borderWidth);transform:var(--PhoneInputCountrySelectArrow-transform);opacity:var(--PhoneInputCountrySelectArrow-opacity)}:host .PhoneInputCountrySelect:focus+.PhoneInputCountryIcon+.PhoneInputCountrySelectArrow,#alia-root .PhoneInputCountrySelect:focus+.PhoneInputCountryIcon+.PhoneInputCountrySelectArrow{opacity:1;color:var(--PhoneInputCountrySelectArrow-color--focus)}:host .PhoneInputCountrySelect:focus+.PhoneInputCountryIcon--border,#alia-root .PhoneInputCountrySelect:focus+.PhoneInputCountryIcon--border{box-shadow:0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor--focus),inset 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor--focus)}:host .PhoneInputCountrySelect:focus+.PhoneInputCountryIcon .PhoneInputInternationalIconGlobe,#alia-root .PhoneInputCountrySelect:focus+.PhoneInputCountryIcon .PhoneInputInternationalIconGlobe{opacity:1;color:var(--PhoneInputCountrySelectArrow-color--focus)}';function useStylesheet(e){const{root:t}=useCustomerAppContext(),{sizeOverride:r}=usePopupPreviewContext(),n=useBreakpoint(),{rootSelector:i}=useCustomerAppContext(),[s,l]=reactExports.useState(!1);return reactExports.useEffect(()=>{const c=new StylesheetBuilder(n,r,i);e(c);const h=getDocument().createElement("style");return h.innerHTML=c.print(),t.appendChild(h),l(!0),()=>{t.removeChild(h)}},[e,r,t,n,i]),s}function useCSS(e){const t=reactExports.useRef(e),{rootSelector:r}=useCustomerAppContext();return reactExports.useMemo(()=>t.current.replaceAll("#alia-root",r),[r])}class StylesheetBuilder{constructor(t,r={},n){Xe(this,"default");Xe(this,"_1024");Xe(this,"hover");Xe(this,"viewportOverride");Xe(this,"breakpoint");this.breakpoint=t,this.viewportOverride=r,this.default=new CSSBuilder(r,n),this._1024=new CSSBuilder(r,n),this.hover=new CSSBuilder(r,n)}print(){let t=this.default.print();return this.breakpoint==="1024"&&(t+=` `+this._1024.print()),t+=` @media (hover: hover) { ${this.hover.print()} }`,t}appendNode({node:t,id:r,children:n}){this.appendNodeContent({node:t,id:r}),t.type==="questionAnswer"&&this.appendNode({id:r,node:t.button}),n&&n.forEach(i=>this.appendNode(i))}appendNodeContent({node:t,id:r}){const n="styles"in t?t.styles:void 0;this.appendBreakpoint(`#${r}`,n)}appendClass(t,r){this.appendBreakpoint(`.${t}`,r)}appendBreakpoint(t,r){r&&(r.default&&this.appendStates(t,r.default,this.default),r[1024]&&this.appendStates(t,r[1024],this._1024))}appendStates(t,{default:r,hover:n,focusWithin:i,disabled:s,error:l,placeholder:c},h){h.appendStyles(t,r),h.appendStyles(`${t}:focus-within`,i),h.appendStyles(`${t}:disabled`,s),h.appendStyles(`${t}.${ERROR_CLASSNAME}`,l),h.appendStyles(`${t}::placeholder`,c),h.appendStyles(`${t} input::placeholder`,c),this.hover.appendStyles(`${t}:hover`,n)}}class CSSBuilder{constructor(t={},r){Xe(this,"blocks",{});this.viewportOverride=t,this.selectorScope=r}appendStyles(t,r){r&&(this.blocks[t]?this.blocks[t]={...this.blocks[t],...r}:this.blocks[t]=r)}print(){return Object.keys(this.blocks).map(t=>this.buildRuleSet(t,this.blocks[t])).filter(Boolean).join(` `)}buildRuleSet(t,r){if(Object.keys(r).length!==0)return this.selectorScope&&!t.includes(this.selectorScope)&&(t=addScopeToSelector(t,this.selectorScope)),t+` { `+this.buildDeclaration(r)+` }`}buildDeclaration(t){return Object.keys(t).map(r=>`${this.hyphenate(r)}: ${transformCSSValue(t[r]??"",this.viewportOverride)};`).join(` `)}hyphenate(t){return t.replace(/[A-Z]/g,function(r){return"-"+r.toLowerCase()})}}function transformCSSValue(e,t){return!e||e.startsWith("url(")||((t!=null&&t.width||t!=null&&t.height)&&(e=replaceViewportVariables(e,t)),e=replaceRem(e)),e}function replaceViewportVariables(e,t){return t?e.replace(/([0-9]+)(vw|svw|lvw|dvw|vh|svh|lvh|dvh)/g,(r,n,i)=>{const s=+n/100,l=i.endsWith("h")?t.height:t.width;return l?`${l*s}px`:e}):e}function replaceRem(e){return e.replace(/(\d*\.?\d+\s?)(rem)/gi,(t,r)=>isNaN(+r)?e:`${+r*16}px`)}function addScopeToSelector(e,t){return t?e.split(",").map(r=>t+" "+r.trim()).join(","):e}const PhoneInput=reactExports.forwardRef(({id:e,onEnter:t,required:r,defaultCountryCode:n,placeholder:i,validationMessages:s,className:l,sharedStyle:c},h)=>{var f;const m=(f=useOptionalEducationSignUpSettings())==null?void 0:f.defaultCountryCode,b=n??m??"US",S=isSupportedCountry(b)?b:"US",{formState:{errors:w},control:_}=useProfileFormContext(),I=useInputClassName({error:!!w.phone,className:l,sharedStyle:c}),{styles:N,onClick:P,onMouseEnter:F,onMouseLeave:j}=usePreviewNodeContext(),q=useCSS(rawCSS);return jsx(FormItem,{label:"Phone",required:r,error:w.phone,validationMessages:s,ref:h,children:jsx(Controller,{control:_,name:"phone",rules:{required:r,...!shouldDisableValidation()&&{validate:v=>!r&&!v?!0:validatePhone(v)}},render:({field:v})=>jsxs("div",{onKeyDown:g=>{g.key==="Enter"&&(t==null||t())},onClick:P,onMouseEnter:F,onMouseLeave:j,children:[jsx("style",{id:"customer-app-phone-input-css",children:q}),jsx(NativePhoneInput,{id:e,className:classNames(I,"overflow-hidden flex items-center gap-1"),style:N,placeholder:i??"Your phone number",defaultCountry:S,...v})]})})})});PhoneInput.displayName="PhoneInput";var showdown$2={exports:{}},showdown$1=showdown$2.exports,hasRequiredShowdown;function requireShowdown(){return hasRequiredShowdown||(hasRequiredShowdown=1,function(e){(function(){function t(f){var v={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:`Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as
(GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex:
foo
",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(f===!1)return JSON.parse(JSON.stringify(v));var g={};for(var C in v)v.hasOwnProperty(C)&&(g[C]=v[C].defaultValue);return g}function r(){var f=t(!0),v={};for(var g in f)f.hasOwnProperty(g)&&(v[g]=!0);return v}var n={},i={},s={},l=t(!0),c="vanilla",h={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:t(!0),allOn:r()};n.helper={},n.extensions={},n.setOption=function(f,v){return l[f]=v,this},n.getOption=function(f){return l[f]},n.getOptions=function(){return l},n.resetOptions=function(){l=t(!0)},n.setFlavor=function(f){if(!h.hasOwnProperty(f))throw Error(f+" flavor was not found");n.resetOptions();var v=h[f];c=f;for(var g in v)v.hasOwnProperty(g)&&(l[g]=v[g])},n.getFlavor=function(){return c},n.getFlavorOptions=function(f){if(h.hasOwnProperty(f))return h[f]},n.getDefaultOptions=function(f){return t(f)},n.subParser=function(f,v){if(n.helper.isString(f))if(typeof v<"u")i[f]=v;else{if(i.hasOwnProperty(f))return i[f];throw Error("SubParser named "+f+" not registered!")}},n.extension=function(f,v){if(!n.helper.isString(f))throw Error("Extension 'name' must be a string");if(f=n.helper.stdExtName(f),n.helper.isUndefined(v)){if(!s.hasOwnProperty(f))throw Error("Extension named "+f+" is not registered!");return s[f]}else{typeof v=="function"&&(v=v()),n.helper.isArray(v)||(v=[v]);var g=m(v,f);if(g.valid)s[f]=v;else throw Error(g.error)}},n.getAllExtensions=function(){return s},n.removeExtension=function(f){delete s[f]},n.resetExtensions=function(){s={}};function m(f,v){var g=v?"Error in "+v+" extension->":"Error in unnamed extension",C={valid:!0,error:""};n.helper.isArray(f)||(f=[f]);for(var $=0;$"u"},n.helper.forEach=function(f,v){if(n.helper.isUndefined(f))throw new Error("obj param is required");if(n.helper.isUndefined(v))throw new Error("callback param is required");if(!n.helper.isFunction(v))throw new Error("callback param must be a function/closure");if(typeof f.forEach=="function")f.forEach(v);else if(n.helper.isArray(f))for(var g=0;g").replace(/&/g,"&")};var S=function(f,v,g,C){var $=C||"",R=$.indexOf("g")>-1,A=new RegExp(v+"|"+g,"g"+$.replace(/g/g,"")),M=new RegExp(v,$.replace(/g/g,"")),re=[],K,J,ee,T,Y;do for(K=0;ee=A.exec(f);)if(M.test(ee[0]))K++||(J=A.lastIndex,T=J-ee[0].length);else if(K&&!--K){Y=ee.index+ee[0].length;var W={left:{start:T,end:J},match:{start:J,end:ee.index},right:{start:ee.index,end:Y},wholeMatch:{start:T,end:Y}};if(re.push(W),!R)return re}while(K&&(A.lastIndex=J));return re};n.helper.matchRecursiveRegExp=function(f,v,g,C){for(var $=S(f,v,g,C),R=[],A=0;A<$.length;++A)R.push([f.slice($[A].wholeMatch.start,$[A].wholeMatch.end),f.slice($[A].match.start,$[A].match.end),f.slice($[A].left.start,$[A].left.end),f.slice($[A].right.start,$[A].right.end)]);return R},n.helper.replaceRecursiveRegExp=function(f,v,g,C,$){if(!n.helper.isFunction(v)){var R=v;v=function(){return R}}var A=S(f,g,C,$),M=f,re=A.length;if(re>0){var K=[];A[0].wholeMatch.start!==0&&K.push(f.slice(0,A[0].wholeMatch.start));for(var J=0;J=0?C+(g||0):C},n.helper.splitAtIndex=function(f,v){if(!n.helper.isString(f))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[f.substring(0,v),f.substring(v)]},n.helper.encodeEmailAddress=function(f){var v=[function(g){return"&#"+g.charCodeAt(0)+";"},function(g){return"&#x"+g.charCodeAt(0).toString(16)+";"},function(g){return g}];return f=f.replace(/./g,function(g){if(g==="@")g=v[Math.floor(Math.random()*2)](g);else{var C=Math.random();g=C>.9?v[2](g):C>.45?v[1](g):v[0](g)}return g}),f},n.helper.padEnd=function(v,g,C){return g=g>>0,C=String(C||" "),v.length>g?String(v):(g=g-v.length,g>C.length&&(C+=C.repeat(g/C.length)),String(v)+C.slice(0,g))},typeof console>"u"&&(console={warn:function(f){alert(f)},log:function(f){alert(f)},error:function(f){throw f}}),n.helper.regexes={asteriskDashAndColon:/([*_:~])/g},n.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:`S`},n.Converter=function(f){var v={},g=[],C=[],$={},R=c,A={parsed:{},raw:"",format:""};M();function M(){f=f||{};for(var T in l)l.hasOwnProperty(T)&&(v[T]=l[T]);if(typeof f=="object")for(var Y in f)f.hasOwnProperty(Y)&&(v[Y]=f[Y]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof f+" was passed instead.");v.extensions&&n.helper.forEach(v.extensions,re)}function re(T,Y){if(Y=Y||null,n.helper.isString(T))if(T=n.helper.stdExtName(T),Y=T,n.extensions[T]){console.warn("DEPRECATION WARNING: "+T+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),K(n.extensions[T],T);return}else if(!n.helper.isUndefined(s[T]))T=s[T];else throw Error('Extension "'+T+'" could not be loaded. It was either not found or is not a valid extension.');typeof T=="function"&&(T=T()),n.helper.isArray(T)||(T=[T]);var W=m(T,Y);if(!W.valid)throw Error(W.error);for(var oe=0;oe[ \t]+¨NBSP;<"),!Y)if(window&&window.document)Y=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var W=Y.createElement("div");W.innerHTML=T;var oe={preList:$e(W)};xe(W);for(var ae=W.childNodes,D="",ne=0;ne'}else ge.push(we[ve].innerHTML),we[ve].innerHTML="",we[ve].setAttribute("prenum",ve.toString());return ge}return D},this.setOption=function(T,Y){v[T]=Y},this.getOption=function(T){return v[T]},this.getOptions=function(){return v},this.addExtension=function(T,Y){Y=Y||null,re(T,Y)},this.useExtension=function(T){re(T)},this.setFlavor=function(T){if(!h.hasOwnProperty(T))throw Error(T+" flavor was not found");var Y=h[T];R=T;for(var W in Y)Y.hasOwnProperty(W)&&(v[W]=Y[W])},this.getFlavor=function(){return R},this.removeExtension=function(T){n.helper.isArray(T)||(T=[T]);for(var Y=0;Y? ?(['"].*['"])?\)$/m)>-1)M="";else if(!M)if(A||(A=R.toLowerCase().replace(/ ?\n/g," ")),M="#"+A,!n.helper.isUndefined(g.gUrls[A]))M=g.gUrls[A],n.helper.isUndefined(g.gTitles[A])||(J=g.gTitles[A]);else return $;M=M.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback);var ee='",ee};return f=f.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,C),f=f.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,C),f=f.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,C),f=f.replace(/\[([^\[\]]+)]()()()()()/g,C),v.ghMentions&&(f=f.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function($,R,A,M,re){if(A==="\\")return R+M;if(!n.helper.isString(v.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var K=v.ghMentionsLink.replace(/\{u}/g,re),J="";return v.openLinksInNewWindow&&(J=' rel="noopener noreferrer" target="¨E95Eblank"'),R+'"+M+""})),f=g.converter._dispatch("anchors.after",f,v,g),f});var w=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,_=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,I=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,N=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,P=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,F=function(f){return function(v,g,C,$,R,A,M){C=C.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback);var re=C,K="",J="",ee=g||"",T=M||"";return/^www\./i.test(C)&&(C=C.replace(/^www\./i,"http://www.")),f.excludeTrailingPunctuationFromURLs&&A&&(K=A),f.openLinksInNewWindow&&(J=' rel="noopener noreferrer" target="¨E95Eblank"'),ee+'"+re+""+K+T}},j=function(f,v){return function(g,C,$){var R="mailto:";return C=C||"",$=n.subParser("unescapeSpecialChars")($,f,v),f.encodeEmails?(R=n.helper.encodeEmailAddress(R+$),$=n.helper.encodeEmailAddress($)):R=R+$,C+''+$+""}};n.subParser("autoLinks",function(f,v,g){return f=g.converter._dispatch("autoLinks.before",f,v,g),f=f.replace(I,F(v)),f=f.replace(P,j(v,g)),f=g.converter._dispatch("autoLinks.after",f,v,g),f}),n.subParser("simplifiedAutoLinks",function(f,v,g){return v.simplifiedAutoLink&&(f=g.converter._dispatch("simplifiedAutoLinks.before",f,v,g),v.excludeTrailingPunctuationFromURLs?f=f.replace(_,F(v)):f=f.replace(w,F(v)),f=f.replace(N,j(v,g)),f=g.converter._dispatch("simplifiedAutoLinks.after",f,v,g)),f}),n.subParser("blockGamut",function(f,v,g){return f=g.converter._dispatch("blockGamut.before",f,v,g),f=n.subParser("blockQuotes")(f,v,g),f=n.subParser("headers")(f,v,g),f=n.subParser("horizontalRule")(f,v,g),f=n.subParser("lists")(f,v,g),f=n.subParser("codeBlocks")(f,v,g),f=n.subParser("tables")(f,v,g),f=n.subParser("hashHTMLBlocks")(f,v,g),f=n.subParser("paragraphs")(f,v,g),f=g.converter._dispatch("blockGamut.after",f,v,g),f}),n.subParser("blockQuotes",function(f,v,g){f=g.converter._dispatch("blockQuotes.before",f,v,g),f=f+` `;var C=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return v.splitAdjacentBlockquotes&&(C=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),f=f.replace(C,function($){return $=$.replace(/^[ \t]*>[ \t]?/gm,""),$=$.replace(/¨0/g,""),$=$.replace(/^[ \t]+$/gm,""),$=n.subParser("githubCodeBlocks")($,v,g),$=n.subParser("blockGamut")($,v,g),$=$.replace(/(^|\n)/g,"$1 "),$=$.replace(/(\s*
[^\r]+?<\/pre>)/gm,function(R,A){var M=A;return M=M.replace(/^  /mg,"¨0"),M=M.replace(/¨0/g,""),M}),n.subParser("hashBlock")(`
`+$+`
`,v,g)}),f=g.converter._dispatch("blockQuotes.after",f,v,g),f}),n.subParser("codeBlocks",function(f,v,g){f=g.converter._dispatch("codeBlocks.before",f,v,g),f+="¨0";var C=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return f=f.replace(C,function($,R,A){var M=R,re=A,K=` `;return M=n.subParser("outdent")(M,v,g),M=n.subParser("encodeCode")(M,v,g),M=n.subParser("detab")(M,v,g),M=M.replace(/^\n+/g,""),M=M.replace(/\n+$/g,""),v.omitExtraWLInCodeBlocks&&(K=""),M="
"+M+K+"
",n.subParser("hashBlock")(M,v,g)+re}),f=f.replace(/¨0/,""),f=g.converter._dispatch("codeBlocks.after",f,v,g),f}),n.subParser("codeSpans",function(f,v,g){return f=g.converter._dispatch("codeSpans.before",f,v,g),typeof f>"u"&&(f=""),f=f.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(C,$,R,A){var M=A;return M=M.replace(/^([ \t]*)/g,""),M=M.replace(/[ \t]*$/g,""),M=n.subParser("encodeCode")(M,v,g),M=$+""+M+"",M=n.subParser("hashHTMLSpans")(M,v,g),M}),f=g.converter._dispatch("codeSpans.after",f,v,g),f}),n.subParser("completeHTMLDocument",function(f,v,g){if(!v.completeHTMLDocument)return f;f=g.converter._dispatch("completeHTMLDocument.before",f,v,g);var C="html",$=` `,R="",A=` `,M="",re="";typeof g.metadata.parsed.doctype<"u"&&($=" `,C=g.metadata.parsed.doctype.toString().toLowerCase(),(C==="html"||C==="html5")&&(A=''));for(var K in g.metadata.parsed)if(g.metadata.parsed.hasOwnProperty(K))switch(K.toLowerCase()){case"doctype":break;case"title":R=""+g.metadata.parsed.title+` `;break;case"charset":C==="html"||C==="html5"?A=' `:A=' `;break;case"language":case"lang":M=' lang="'+g.metadata.parsed[K]+'"',re+=' `;break;default:re+=' `}return f=$+" `+R+A+re+` `+f.trim()+` `,f=g.converter._dispatch("completeHTMLDocument.after",f,v,g),f}),n.subParser("detab",function(f,v,g){return f=g.converter._dispatch("detab.before",f,v,g),f=f.replace(/\t(?=\t)/g," "),f=f.replace(/\t/g,"¨A¨B"),f=f.replace(/¨B(.+?)¨A/g,function(C,$){for(var R=$,A=4-R.length%4,M=0;M/g,">"),f=g.converter._dispatch("encodeAmpsAndAngles.after",f,v,g),f}),n.subParser("encodeBackslashEscapes",function(f,v,g){return f=g.converter._dispatch("encodeBackslashEscapes.before",f,v,g),f=f.replace(/\\(\\)/g,n.helper.escapeCharactersCallback),f=f.replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g,n.helper.escapeCharactersCallback),f=g.converter._dispatch("encodeBackslashEscapes.after",f,v,g),f}),n.subParser("encodeCode",function(f,v,g){return f=g.converter._dispatch("encodeCode.before",f,v,g),f=f.replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,n.helper.escapeCharactersCallback),f=g.converter._dispatch("encodeCode.after",f,v,g),f}),n.subParser("escapeSpecialCharsWithinTagAttributes",function(f,v,g){f=g.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",f,v,g);var C=/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,$=/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return f=f.replace(C,function(R){return R.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)}),f=f.replace($,function(R){return R.replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)}),f=g.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",f,v,g),f}),n.subParser("githubCodeBlocks",function(f,v,g){return v.ghCodeBlocks?(f=g.converter._dispatch("githubCodeBlocks.before",f,v,g),f+="¨0",f=f.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(C,$,R,A){var M=v.omitExtraWLInCodeBlocks?"":` `;return A=n.subParser("encodeCode")(A,v,g),A=n.subParser("detab")(A,v,g),A=A.replace(/^\n+/g,""),A=A.replace(/\n+$/g,""),A="
"+A+M+"
",A=n.subParser("hashBlock")(A,v,g),` ¨G`+(g.ghCodeBlocks.push({text:C,codeblock:A})-1)+`G `}),f=f.replace(/¨0/,""),g.converter._dispatch("githubCodeBlocks.after",f,v,g)):f}),n.subParser("hashBlock",function(f,v,g){return f=g.converter._dispatch("hashBlock.before",f,v,g),f=f.replace(/(^\n+|\n+$)/g,""),f=` ¨K`+(g.gHtmlBlocks.push(f)-1)+`K `,f=g.converter._dispatch("hashBlock.after",f,v,g),f}),n.subParser("hashCodeTags",function(f,v,g){f=g.converter._dispatch("hashCodeTags.before",f,v,g);var C=function($,R,A,M){var re=A+n.subParser("encodeCode")(R,v,g)+M;return"¨C"+(g.gHtmlSpans.push(re)-1)+"C"};return f=n.helper.replaceRecursiveRegExp(f,C,"]*>","","gim"),f=g.converter._dispatch("hashCodeTags.after",f,v,g),f}),n.subParser("hashElement",function(f,v,g){return function(C,$){var R=$;return R=R.replace(/\n\n/g,` `),R=R.replace(/^\n/,""),R=R.replace(/\n+$/g,""),R=` ¨K`+(g.gHtmlBlocks.push(R)-1)+`K `,R}}),n.subParser("hashHTMLBlocks",function(f,v,g){f=g.converter._dispatch("hashHTMLBlocks.before",f,v,g);var C=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],$=function(T,Y,W,oe){var ae=T;return W.search(/\bmarkdown\b/)!==-1&&(ae=W+g.converter.makeHtml(Y)+oe),` ¨K`+(g.gHtmlBlocks.push(ae)-1)+`K `};v.backslashEscapesHTMLTags&&(f=f.replace(/\\<(\/?[^>]+?)>/g,function(T,Y){return"<"+Y+">"}));for(var R=0;R]*>)","im"),re="<"+C[R]+"\\b[^>]*>",K="";(A=n.helper.regexIndexOf(f,M))!==-1;){var J=n.helper.splitAtIndex(f,A),ee=n.helper.replaceRecursiveRegExp(J[1],$,re,K,"im");if(ee===J[1])break;f=J[0].concat(ee)}return f=f.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(f,v,g)),f=n.helper.replaceRecursiveRegExp(f,function(T){return` ¨K`+(g.gHtmlBlocks.push(T)-1)+`K `},"^ {0,3}","gm"),f=f.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(f,v,g)),f=g.converter._dispatch("hashHTMLBlocks.after",f,v,g),f}),n.subParser("hashHTMLSpans",function(f,v,g){f=g.converter._dispatch("hashHTMLSpans.before",f,v,g);function C($){return"¨C"+(g.gHtmlSpans.push($)-1)+"C"}return f=f.replace(/<[^>]+?\/>/gi,function($){return C($)}),f=f.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function($){return C($)}),f=f.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function($){return C($)}),f=f.replace(/<[^>]+?>/gi,function($){return C($)}),f=g.converter._dispatch("hashHTMLSpans.after",f,v,g),f}),n.subParser("unhashHTMLSpans",function(f,v,g){f=g.converter._dispatch("unhashHTMLSpans.before",f,v,g);for(var C=0;C]*>\\s*]*>","^ {0,3}\\s*
","gim"),f=g.converter._dispatch("hashPreCodeTags.after",f,v,g),f}),n.subParser("headers",function(f,v,g){f=g.converter._dispatch("headers.before",f,v,g);var C=isNaN(parseInt(v.headerLevelStart))?1:parseInt(v.headerLevelStart),$=v.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,R=v.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;f=f.replace($,function(re,K){var J=n.subParser("spanGamut")(K,v,g),ee=v.noHeaderId?"":' id="'+M(K)+'"',T=C,Y=""+J+"";return n.subParser("hashBlock")(Y,v,g)}),f=f.replace(R,function(re,K){var J=n.subParser("spanGamut")(K,v,g),ee=v.noHeaderId?"":' id="'+M(K)+'"',T=C+1,Y=""+J+"";return n.subParser("hashBlock")(Y,v,g)});var A=v.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;f=f.replace(A,function(re,K,J){var ee=J;v.customizedHeaderId&&(ee=J.replace(/\s?\{([^{]+?)}\s*$/,""));var T=n.subParser("spanGamut")(ee,v,g),Y=v.noHeaderId?"":' id="'+M(J)+'"',W=C-1+K.length,oe=""+T+"";return n.subParser("hashBlock")(oe,v,g)});function M(re){var K,J;if(v.customizedHeaderId){var ee=re.match(/\{([^{]+?)}\s*$/);ee&&ee[1]&&(re=ee[1])}return K=re,n.helper.isString(v.prefixHeaderId)?J=v.prefixHeaderId:v.prefixHeaderId===!0?J="section-":J="",v.rawPrefixHeaderId||(K=J+K),v.ghCompatibleHeaderId?K=K.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():v.rawHeaderId?K=K.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():K=K.replace(/[^\w]/g,"").toLowerCase(),v.rawPrefixHeaderId&&(K=J+K),g.hashLinkCounts[K]?K=K+"-"+g.hashLinkCounts[K]++:g.hashLinkCounts[K]=1,K}return f=g.converter._dispatch("headers.after",f,v,g),f}),n.subParser("horizontalRule",function(f,v,g){f=g.converter._dispatch("horizontalRule.before",f,v,g);var C=n.subParser("hashBlock")("
",v,g);return f=f.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,C),f=f.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,C),f=f.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,C),f=g.converter._dispatch("horizontalRule.after",f,v,g),f}),n.subParser("images",function(f,v,g){f=g.converter._dispatch("images.before",f,v,g);var C=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,$=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,R=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,A=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,M=/!\[([^\[\]]+)]()()()()()/g;function re(J,ee,T,Y,W,oe,ae,D){return Y=Y.replace(/\s/g,""),K(J,ee,T,Y,W,oe,ae,D)}function K(J,ee,T,Y,W,oe,ae,D){var ne=g.gUrls,xe=g.gTitles,$e=g.gDimensions;if(T=T.toLowerCase(),D||(D=""),J.search(/\(? ?(['"].*['"])?\)$/m)>-1)Y="";else if(Y===""||Y===null)if((T===""||T===null)&&(T=ee.toLowerCase().replace(/ ?\n/g," ")),Y="#"+T,!n.helper.isUndefined(ne[T]))Y=ne[T],n.helper.isUndefined(xe[T])||(D=xe[T]),n.helper.isUndefined($e[T])||(W=$e[T].width,oe=$e[T].height);else return J;ee=ee.replace(/"/g,""").replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback),Y=Y.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback);var Ee=''+ee+'","
")}),f=f.replace(/\b__(\S[\s\S]*?)__\b/g,function($,R){return C(R,"","")}),f=f.replace(/\b_(\S[\s\S]*?)_\b/g,function($,R){return C(R,"","")})):(f=f.replace(/___(\S[\s\S]*?)___/g,function($,R){return/\S$/.test(R)?C(R,"",""):$}),f=f.replace(/__(\S[\s\S]*?)__/g,function($,R){return/\S$/.test(R)?C(R,"",""):$}),f=f.replace(/_([^\s_][\s\S]*?)_/g,function($,R){return/\S$/.test(R)?C(R,"",""):$})),v.literalMidWordAsterisks?(f=f.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function($,R,A){return C(A,R+"","")}),f=f.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function($,R,A){return C(A,R+"","")}),f=f.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function($,R,A){return C(A,R+"","")})):(f=f.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function($,R){return/\S$/.test(R)?C(R,"",""):$}),f=f.replace(/\*\*(\S[\s\S]*?)\*\*/g,function($,R){return/\S$/.test(R)?C(R,"",""):$}),f=f.replace(/\*([^\s*][\s\S]*?)\*/g,function($,R){return/\S$/.test(R)?C(R,"",""):$})),f=g.converter._dispatch("italicsAndBold.after",f,v,g),f}),n.subParser("lists",function(f,v,g){function C(A,M){g.gListLevel++,A=A.replace(/\n{2,}$/,` `),A+="¨0";var re=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,K=/\n[ \t]*\n(?!¨0)/.test(A);return v.disableForced4SpacesIndentedSublists&&(re=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),A=A.replace(re,function(J,ee,T,Y,W,oe,ae){ae=ae&&ae.trim()!=="";var D=n.subParser("outdent")(W,v,g),ne="";return oe&&v.tasklists&&(ne=' class="task-list-item" style="list-style-type: none;"',D=D.replace(/^[ \t]*\[(x|X| )?]/m,function(){var xe='-1?(D=n.subParser("githubCodeBlocks")(D,v,g),D=n.subParser("blockGamut")(D,v,g)):(D=n.subParser("lists")(D,v,g),D=D.replace(/\n$/,""),D=n.subParser("hashHTMLBlocks")(D,v,g),D=D.replace(/\n\n+/g,` `),K?D=n.subParser("paragraphs")(D,v,g):D=n.subParser("spanGamut")(D,v,g)),D=D.replace("¨A",""),D=""+D+` `,D}),A=A.replace(/¨0/g,""),g.gListLevel--,M&&(A=A.replace(/\s+$/,"")),A}function $(A,M){if(M==="ol"){var re=A.match(/^ *(\d+)\./);if(re&&re[1]!=="1")return' start="'+re[1]+'"'}return""}function R(A,M,re){var K=v.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,J=v.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,ee=M==="ul"?K:J,T="";if(A.search(ee)!==-1)(function W(oe){var ae=oe.search(ee),D=$(A,M);ae!==-1?(T+=` <`+M+D+`> `+C(oe.slice(0,ae),!!re)+" `,M=M==="ul"?"ol":"ul",ee=M==="ul"?K:J,W(oe.slice(ae))):T+=` <`+M+D+`> `+C(oe,!!re)+" `})(A);else{var Y=$(A,M);T=` <`+M+Y+`> `+C(A,!!re)+" `}return T}return f=g.converter._dispatch("lists.before",f,v,g),f+="¨0",g.gListLevel?f=f.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(A,M,re){var K=re.search(/[*+-]/g)>-1?"ul":"ol";return R(M,K,!0)}):f=f.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(A,M,re,K){var J=K.search(/[*+-]/g)>-1?"ul":"ol";return R(re,J,!1)}),f=f.replace(/¨0/,""),f=g.converter._dispatch("lists.after",f,v,g),f}),n.subParser("metadata",function(f,v,g){if(!v.metadata)return f;f=g.converter._dispatch("metadata.before",f,v,g);function C($){g.metadata.raw=$,$=$.replace(/&/g,"&").replace(/"/g,"""),$=$.replace(/\n {4}/g," "),$.replace(/^([\S ]+): +([\s\S]+?)$/gm,function(R,A,M){return g.metadata.parsed[A]=M,""})}return f=f.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function($,R,A){return C(A),"¨M"}),f=f.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function($,R,A){return R&&(g.metadata.format=R),C(A),"¨M"}),f=f.replace(/¨M/g,""),f=g.converter._dispatch("metadata.after",f,v,g),f}),n.subParser("outdent",function(f,v,g){return f=g.converter._dispatch("outdent.before",f,v,g),f=f.replace(/^(\t|[ ]{1,4})/gm,"¨0"),f=f.replace(/¨0/g,""),f=g.converter._dispatch("outdent.after",f,v,g),f}),n.subParser("paragraphs",function(f,v,g){f=g.converter._dispatch("paragraphs.before",f,v,g),f=f.replace(/^\n+/g,""),f=f.replace(/\n+$/g,"");for(var C=f.split(/\n{2,}/g),$=[],R=C.length,A=0;A=0?$.push(M):M.search(/\S/)>=0&&(M=n.subParser("spanGamut")(M,v,g),M=M.replace(/^([ \t]*)/g,"

"),M+="

",$.push(M))}for(R=$.length,A=0;A]*>\s*]*>/.test(K)&&(J=!0)}$[A]=K}return f=$.join(` `),f=f.replace(/^\n+/g,""),f=f.replace(/\n+$/g,""),g.converter._dispatch("paragraphs.after",f,v,g)}),n.subParser("runExtension",function(f,v,g,C){if(f.filter)v=f.filter(v,C.converter,g);else if(f.regex){var $=f.regex;$ instanceof RegExp||($=new RegExp($,"g")),v=v.replace($,f.replace)}return v}),n.subParser("spanGamut",function(f,v,g){return f=g.converter._dispatch("spanGamut.before",f,v,g),f=n.subParser("codeSpans")(f,v,g),f=n.subParser("escapeSpecialCharsWithinTagAttributes")(f,v,g),f=n.subParser("encodeBackslashEscapes")(f,v,g),f=n.subParser("images")(f,v,g),f=n.subParser("anchors")(f,v,g),f=n.subParser("autoLinks")(f,v,g),f=n.subParser("simplifiedAutoLinks")(f,v,g),f=n.subParser("emoji")(f,v,g),f=n.subParser("underline")(f,v,g),f=n.subParser("italicsAndBold")(f,v,g),f=n.subParser("strikethrough")(f,v,g),f=n.subParser("ellipsis")(f,v,g),f=n.subParser("hashHTMLSpans")(f,v,g),f=n.subParser("encodeAmpsAndAngles")(f,v,g),v.simpleLineBreaks?/\n\n¨K/.test(f)||(f=f.replace(/\n+/g,`
`)):f=f.replace(/ +\n/g,`
`),f=g.converter._dispatch("spanGamut.after",f,v,g),f}),n.subParser("strikethrough",function(f,v,g){function C($){return v.simplifiedAutoLink&&($=n.subParser("simplifiedAutoLinks")($,v,g)),""+$+""}return v.strikethrough&&(f=g.converter._dispatch("strikethrough.before",f,v,g),f=f.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function($,R){return C(R)}),f=g.converter._dispatch("strikethrough.after",f,v,g)),f}),n.subParser("stripLinkDefinitions",function(f,v,g){var C=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,$=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;f+="¨0";var R=function(A,M,re,K,J,ee,T){return M=M.toLowerCase(),f.toLowerCase().split(M).length-1<2?A:(re.match(/^data:.+?\/.+?;base64,/)?g.gUrls[M]=re.replace(/\s/g,""):g.gUrls[M]=n.subParser("encodeAmpsAndAngles")(re,v,g),ee?ee+T:(T&&(g.gTitles[M]=T.replace(/"|'/g,""")),v.parseImgDimensions&&K&&J&&(g.gDimensions[M]={width:K,height:J}),""))};return f=f.replace($,R),f=f.replace(C,R),f=f.replace(/¨0/,""),f}),n.subParser("tables",function(f,v,g){if(!v.tables)return f;var C=/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,$=/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;function R(J){return/^:[ \t]*--*$/.test(J)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(J)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(J)?' style="text-align:center;"':""}function A(J,ee){var T="";return J=J.trim(),(v.tablesHeaderId||v.tableHeaderId)&&(T=' id="'+J.replace(/ /g,"_").toLowerCase()+'"'),J=n.subParser("spanGamut")(J,v,g),""+J+` `}function M(J,ee){var T=n.subParser("spanGamut")(J,v,g);return""+T+` `}function re(J,ee){for(var T=` `,Y=J.length,W=0;W `,W=0;W `;for(var oe=0;oe `}return T+=`
`,T}function K(J){var ee,T=J.split(` `);for(ee=0;ee"+$+""}),f=f.replace(/\b__(\S[\s\S]*?)__\b/g,function(C,$){return""+$+""})):(f=f.replace(/___(\S[\s\S]*?)___/g,function(C,$){return/\S$/.test($)?""+$+"":C}),f=f.replace(/__(\S[\s\S]*?)__/g,function(C,$){return/\S$/.test($)?""+$+"":C})),f=f.replace(/(_)/g,n.helper.escapeCharactersCallback),f=g.converter._dispatch("underline.after",f,v,g)),f}),n.subParser("unescapeSpecialChars",function(f,v,g){return f=g.converter._dispatch("unescapeSpecialChars.before",f,v,g),f=f.replace(/¨E(\d+)E/g,function(C,$){var R=parseInt($);return String.fromCharCode(R)}),f=g.converter._dispatch("unescapeSpecialChars.after",f,v,g),f}),n.subParser("makeMarkdown.blockquote",function(f,v){var g="";if(f.hasChildNodes())for(var C=f.childNodes,$=C.length,R=0;R<$;++R){var A=n.subParser("makeMarkdown.node")(C[R],v);A!==""&&(g+=A)}return g=g.trim(),g="> "+g.split(` `).join(` > `),g}),n.subParser("makeMarkdown.codeBlock",function(f,v){var g=f.getAttribute("language"),C=f.getAttribute("precodenum");return"```"+g+` `+v.preList[C]+"\n```"}),n.subParser("makeMarkdown.codeSpan",function(f){return"`"+f.innerHTML+"`"}),n.subParser("makeMarkdown.emphasis",function(f,v){var g="";if(f.hasChildNodes()){g+="*";for(var C=f.childNodes,$=C.length,R=0;R<$;++R)g+=n.subParser("makeMarkdown.node")(C[R],v);g+="*"}return g}),n.subParser("makeMarkdown.header",function(f,v,g){var C=new Array(g+1).join("#"),$="";if(f.hasChildNodes()){$=C+" ";for(var R=f.childNodes,A=R.length,M=0;M",f.hasAttribute("width")&&f.hasAttribute("height")&&(v+=" ="+f.getAttribute("width")+"x"+f.getAttribute("height")),f.hasAttribute("title")&&(v+=' "'+f.getAttribute("title")+'"'),v+=")"),v}),n.subParser("makeMarkdown.links",function(f,v){var g="";if(f.hasChildNodes()&&f.hasAttribute("href")){var C=f.childNodes,$=C.length;g="[";for(var R=0;R<$;++R)g+=n.subParser("makeMarkdown.node")(C[R],v);g+="](",g+="<"+f.getAttribute("href")+">",f.hasAttribute("title")&&(g+=' "'+f.getAttribute("title")+'"'),g+=")"}return g}),n.subParser("makeMarkdown.list",function(f,v,g){var C="";if(!f.hasChildNodes())return"";for(var $=f.childNodes,R=$.length,A=f.getAttribute("start")||1,M=0;M"u"||$[M].tagName.toLowerCase()!=="li")){var re="";g==="ol"?re=A.toString()+". ":re="- ",C+=re+n.subParser("makeMarkdown.listItem")($[M],v),++A}return C+=` `,C.trim()}),n.subParser("makeMarkdown.listItem",function(f,v){for(var g="",C=f.childNodes,$=C.length,R=0;R<$;++R)g+=n.subParser("makeMarkdown.node")(C[R],v);return/\n$/.test(g)?g=g.split(` `).join(` `).replace(/^ {4}$/gm,"").replace(/\n\n+/g,` `):g+=` `,g}),n.subParser("makeMarkdown.node",function(f,v,g){g=g||!1;var C="";if(f.nodeType===3)return n.subParser("makeMarkdown.txt")(f,v);if(f.nodeType===8)return" `;if(f.nodeType!==1)return"";var $=f.tagName.toLowerCase();switch($){case"h1":g||(C=n.subParser("makeMarkdown.header")(f,v,1)+` `);break;case"h2":g||(C=n.subParser("makeMarkdown.header")(f,v,2)+` `);break;case"h3":g||(C=n.subParser("makeMarkdown.header")(f,v,3)+` `);break;case"h4":g||(C=n.subParser("makeMarkdown.header")(f,v,4)+` `);break;case"h5":g||(C=n.subParser("makeMarkdown.header")(f,v,5)+` `);break;case"h6":g||(C=n.subParser("makeMarkdown.header")(f,v,6)+` `);break;case"p":g||(C=n.subParser("makeMarkdown.paragraph")(f,v)+` `);break;case"blockquote":g||(C=n.subParser("makeMarkdown.blockquote")(f,v)+` `);break;case"hr":g||(C=n.subParser("makeMarkdown.hr")(f,v)+` `);break;case"ol":g||(C=n.subParser("makeMarkdown.list")(f,v,"ol")+` `);break;case"ul":g||(C=n.subParser("makeMarkdown.list")(f,v,"ul")+` `);break;case"precode":g||(C=n.subParser("makeMarkdown.codeBlock")(f,v)+` `);break;case"pre":g||(C=n.subParser("makeMarkdown.pre")(f,v)+` `);break;case"table":g||(C=n.subParser("makeMarkdown.table")(f,v)+` `);break;case"code":C=n.subParser("makeMarkdown.codeSpan")(f,v);break;case"em":case"i":C=n.subParser("makeMarkdown.emphasis")(f,v);break;case"strong":case"b":C=n.subParser("makeMarkdown.strong")(f,v);break;case"del":C=n.subParser("makeMarkdown.strikethrough")(f,v);break;case"a":C=n.subParser("makeMarkdown.links")(f,v);break;case"img":C=n.subParser("makeMarkdown.image")(f,v);break;default:C=f.outerHTML+` `}return C}),n.subParser("makeMarkdown.paragraph",function(f,v){var g="";if(f.hasChildNodes())for(var C=f.childNodes,$=C.length,R=0;R<$;++R)g+=n.subParser("makeMarkdown.node")(C[R],v);return g=g.trim(),g}),n.subParser("makeMarkdown.pre",function(f,v){var g=f.getAttribute("prenum");return"
"+v.preList[g]+"
"}),n.subParser("makeMarkdown.strikethrough",function(f,v){var g="";if(f.hasChildNodes()){g+="~~";for(var C=f.childNodes,$=C.length,R=0;R<$;++R)g+=n.subParser("makeMarkdown.node")(C[R],v);g+="~~"}return g}),n.subParser("makeMarkdown.strong",function(f,v){var g="";if(f.hasChildNodes()){g+="**";for(var C=f.childNodes,$=C.length,R=0;R<$;++R)g+=n.subParser("makeMarkdown.node")(C[R],v);g+="**"}return g}),n.subParser("makeMarkdown.table",function(f,v){var g="",C=[[],[]],$=f.querySelectorAll("thead>tr>th"),R=f.querySelectorAll("tbody>tr"),A,M;for(A=0;A<$.length;++A){var re=n.subParser("makeMarkdown.tableCell")($[A],v),K="---";if($[A].hasAttribute("style")){var J=$[A].getAttribute("style").toLowerCase().replace(/\s/g,"");switch(J){case"text-align:left;":K=":---";break;case"text-align:right;":K="---:";break;case"text-align:center;":K=":---:";break}}C[0][A]=re.trim(),C[1][A]=K}for(A=0;AW&&(W=oe)}for(A=0;A/g,"\\$1>"),v=v.replace(/^#/gm,"\\#"),v=v.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),v=v.replace(/^( {0,3}\d+)\./gm,"$1\\."),v=v.replace(/^( {0,3})([+-])/gm,"$1\\$2"),v=v.replace(/]([\s]*)\(/g,"\\]$1\\("),v=v.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),v});var q=this;e.exports?e.exports=n:q.showdown=n}).call(showdown$1)}(showdown$2)),showdown$2.exports}var showdownExports=requireShowdown();const showdown=getDefaultExportFromCjs(showdownExports);function useHTMLFromMarkdown(e,t){const r=usePopupThemeConfig(),n=r==null?void 0:r.styles.text.find(s=>s.handle===LINK_HANDLE);if(!e)return"";let i=markdownToHTML(e);return t&&(i=removeParagraphTags(i)),transformAnchorTags(i,{target:"_blank",rel:"noopener noreferrer",className:classNames(SHARED_STYLE_CLASSNAME(n==null?void 0:n.handle),n==null?void 0:n.styles.classes,"underline")})}const PROSE_CLASSNAME=` prose prose-img:rounded-lg prose-img:my-3 prose-p:mt-2 prose-p:mb-3 prose-p:text-lg prose-p:leading-6 prose-h1:mt-3.5 prose-h1:mb-3 prose-h1:text-display-xl prose-h2:mt-2.5 prose-h2:mb-2 prose-h2:text-display-lg prose-h3:mt-2 prose-h3:mb-1.5 prose-h3:text-display prose-h4:my-1.5 prose-h4:text-display-sm prose-h5:my-1.5 prose-h5:text-display-xs prose-h6:my-1.5 prose-h6:text-display-xs prose-ul:my-2 prose-ul:ml-6 prose-ul:text-lg prose-ul:list-disc prose-ol:my-2 prose-ol:text-lg prose-ol:ml-6 prose-ol:list-decimal prose-li:my-1 prose-li:leading-6 prose-a:underline `,Markdown=({markdown:e,prose:t=!1})=>{const r=useHTMLFromMarkdown(e);return jsx("div",{className:t?PROSE_CLASSNAME:"",dangerouslySetInnerHTML:{__html:r}})};function transformAnchorTags(e,t={}){return e.replace(/]*)>/g,(r,n)=>{const i=Object.entries(t).map(([s,l])=>s==="className"?`class="${l}"`:`${s}="${l}"`).join(" ");return``})}function removeParagraphTags(e){return e.replace(/

/g,"").replace(/<\/p>/g,"")}function markdownToHTML(e){const t=new showdown.Converter({noHeaderId:!0});return t.setFlavor("github"),t.makeHtml(e)}const ConsentText=({text:e})=>jsx("div",{className:"space-y-2",children:jsx("div",{className:"text-xs text-primary-500",children:e?jsx(Markdown,{markdown:e}):jsx(DefaultConsentText,{})})}),DefaultConsentText=()=>{const{data:e}=useGetMerchant(),t=(e==null?void 0:e.privacyURL)??"https://www.alialearn.com/privacy",r=useEducationSignUpSettings(),n=reactExports.useMemo(()=>{if(!(r.email==="disabled"&&r.phone==="disabled"))return r.email!=="disabled"&&r.phone!=="disabled"?"By submitting this information, you consent to receiving emails and SMS messages. Message and data rates may apply. You can unsubscribe at any time.":r.email!=="disabled"?"By submitting this information, you consent to receiving marketing emails. You can unsubscribe at any time.":"By submitting this information, you consent to receiving SMS messages. Message and data rates may apply. You can unsubscribe at any time."},[r.email,r.phone]);return jsxs(Fragment,{children:[n?n+" ":"",n?"Learn more about our ":"By submitting this information, you agree to our ",jsx("a",{className:"underline",target:"_blank",href:t,rel:"noreferrer",children:"Privacy Policy"}),"."]})},useProfileForm=()=>useForm({mode:"onSubmit"}),useProfileFormContext=useFormContext,FullForm=()=>{const{onComplete:e,source:t}=useSetProfileContext(),r=useProfileForm(),{name:n,email:i,phone:s,emailPlaceholder:l,smsPlaceholder:c,namePlaceholder:h,emailValidationMessages:m,nameValidationMessages:b,smsValidationMessages:S}=useEducationSignUpSettings(),{handleSubmit:w,formState:{isSubmitting:_}}=r,I=useSetProfile(),N=async P=>{try{const F=await I.mutateAsync({...P,source:t,shouldSubscribe:!0});await e(F)}catch{}};return jsxs(Fragment,{children:[jsx("div",{className:"flex flex-col gap-1",children:jsx("p",{className:"text-display-lg",children:"Unlock your discount"})}),jsx(FormProvider,{...r,children:jsxs("form",{onSubmit:w(N),className:"flex flex-col gap-3",children:[n!=="disabled"&&jsx(FirstNameInput,{required:n==="required",placeholder:h,validationMessages:b}),i!=="disabled"&&jsx(EmailInput,{required:i==="required",placeholder:l,validationMessages:m}),s!=="disabled"&&jsx(PhoneInput,{onEnter:w(N),required:s==="required",placeholder:c,validationMessages:S}),jsxs(Button,{variant:"primary",type:"submit",disabled:_,children:["Continue",jsx(Icon,{icon:"arrowRight",className:"ml-2"})]}),jsx(ConsentText,{})]})})]})},EmailForm=()=>{const{source:e}=useSetProfileContext(),{name:t,email:r,emailConsentText:n,emailPlaceholder:i,namePlaceholder:s,emailValidationMessages:l,nameValidationMessages:c}=useEducationSignUpSettings(),h=useSetProfile(),m=useProfileForm(),{handleSubmit:b,formState:{isSubmitting:S}}=m;return jsxs(Fragment,{children:[jsx("div",{className:"flex flex-col gap-1",children:jsx("p",{className:"text-display-lg",children:"Unlock your discount"})}),jsx(FormProvider,{...m,children:jsxs("form",{onSubmit:b(async w=>{await h.mutateAsync({...w,source:e,shouldSubscribe:!0})}),className:"flex flex-col gap-3",children:[t!=="disabled"&&jsx(FirstNameInput,{required:t==="required",placeholder:s,validationMessages:c}),r!=="disabled"&&jsx(EmailInput,{required:r==="required",placeholder:i,validationMessages:l}),jsxs(Button,{variant:"primary",type:"submit",disabled:S,children:["Next",jsx(Icon,{icon:"arrowRight",className:"ml-2"})]}),jsx(ConsentText,{text:n})]})})]})},PhoneForm=()=>{const{source:e,onComplete:t}=useSetProfileContext(),{phone:r,smsConsentText:n,smsPlaceholder:i,smsValidationMessages:s}=useEducationSignUpSettings(),l=useSetProfile(),c=useProfileForm(),{handleSubmit:h,formState:{isSubmitting:m}}=c,b=async S=>{const w=await l.mutateAsync({...S,source:e,shouldSubscribe:!0});await t(w)};return jsxs(Fragment,{children:[jsxs("div",{className:"flex flex-col gap-1",children:[jsx("p",{className:"text-display-lg",children:"One last step"}),jsx("p",{className:"text-primary-500 text-sm",children:r==="optional"?"If you'd like to receive special discounts and promotions by text, enter your phone number below.":"Enter your phone number to receive special discounts and promotions by text."})]}),jsx(FormProvider,{...c,children:jsxs("form",{onSubmit:h(b),className:"flex flex-col gap-3",children:[jsx(PhoneInput,{onEnter:h(b),required:r==="required",placeholder:i,validationMessages:s}),jsxs(Button,{variant:"primary",type:"submit",disabled:m,children:["Reveal discount code",jsx(Icon,{icon:"arrowRight",className:"ml-2"})]}),jsx(ConsentText,{text:n})]})})]})},SplitForm=()=>{const{data:e}=useGetUser(),{email:t,phone:r}=useEducationSignUpSettings(),n=e.hasEmail?"phone":"email";if(t==="disabled"||r==="disabled")return jsx(FullForm,{});if(n==="email")return jsx(EmailForm,{});if(n==="phone")return jsx(PhoneForm,{});assertNever(n)},{useContext:useSetProfileContext,Provider:SetProfileContextProvider}=createContextWithoutDefault("set-profile"),SetProfileForm=({split:e,...t})=>jsx(SetProfileContextProvider,{value:t,children:e?jsx(SplitForm,{}):jsx(FullForm,{})}),useGetClaimedRewardsQuery=queryManager(()=>["claimedRewards","getClaimedRewards"]);function useGetClaimedRewards(){const{initialData:e}=useCustomerAppContext(),t=useServiceFetch(),{getQueryKey:r}=useGetClaimedRewardsQuery();return useSuspenseQuery({queryKey:r(),queryFn:()=>t("GET","/claimed-rewards",{}),initialData:e.claimedRewards})}function useClaimedReward(){const{data:e}=useGetClaimedRewards();return e.length>0?e[0]:void 0}function useClaimReward(){const{onRewardClaimed:e}=useClientIntegrations(),{data:t}=useGetMerchant(),r=useServiceFetch(),{updateQuery:n}=useGetClaimedRewardsQuery(),i=useToast(),{mediator:s}=useCustomerAppContext(),{mutateAsync:l,isLoading:c}=useMutation({mutationKey:["claimReward"],mutationFn:m=>r("POST","/claimed-rewards/v2",{body:m}),onSuccess:(m,{updateCache:b=!0})=>{var S;b&&(n(void 0,w=>mergeOneIntoMany(w,m.claimedReward)),(S=s==null?void 0:s.userActionsStore)==null||S.addActions(m.userAction))},onError:m=>{i(unknownErrToStr(m))}}),h=reactExports.useCallback(async m=>{const{claimedReward:b}=await l(m);return e({rewardID:b.rewardID??void 0,rewardText:getRewardText(b.config,t.shopInfo),discountCode:b.shopifyCode??void 0}),b},[l,e,t.shopInfo]);return{mutateAsync:h,mutate:h,isLoading:c}}function useIsSignedUp(){const{name:e,email:t,phone:r}=useEducationSignUpSettings(),{data:n}=useGetUser();return!(e!=="disabled"&&!n.name||t!=="disabled"&&!n.hasEmail||r!=="disabled"&&!n.hasPhone)}function useRedeemReward(e){const r=useRewards().find(i=>i.id===e),n=useClaimReward();return reactExports.useCallback(async()=>{!e||!r||await n.mutateAsync({type:"lessons",rewardID:r.id})},[e,r,n])}function useRedeemRewardIfSignedUp(e){const{setState:t}=useLessonsContext(),n=useRewards().find(l=>l.id===e),i=useRedeemReward(e),s=useIsSignedUp();return reactExports.useCallback(async()=>{n&&(s?await i():t({type:"setProfile",rewardID:n.id}))},[n,s,t,i])}const LessonsSetProfile=({rewardID:e})=>{const t=useRedeemReward(e),{splitSignUp:r}=useEducationSignUpSettings(),{goBack:n}=useLessonsContext();return jsx(Layout$1,{left:jsx(LayoutBack,{onClick:n}),children:jsx(CommonErrorBoundary,{children:jsx("div",{className:"flex-1 flex flex-col space-y-3",children:jsx(SetProfileForm,{onComplete:t,source:{type:"widget"},split:r})})})})};function useGoToNextLesson(){const t=useIncompleteLessons()[0],{setState:r}=useLessonsContext();return reactExports.useCallback(()=>{r(t?{type:"lesson",lessonID:t.id}:{type:"home"})},[t,r])}const ErrorMsg=({errorMessage:e})=>{const[t,r]=reactExports.useMemo(()=>{const n="If this issue persists, please contact help@alialearn.com";return e?[e,n]:["An unknown error occurred",n]},[e]);return jsxs("div",{className:"absolute top-0 right-0 bottom-0 left-0 m-auto flex flex-col justify-center items-center text-accent",children:[jsx("div",{className:"text-black text-lg font-bold",children:t}),jsx("div",{className:"text-primary-500 text-md text-center leading-5",children:r})]})};function useRegisterEvent(){const{data:{isMerchantPreview:e}}=useGetUser(),t=useServiceFetch();return useMutation({mutationKey:["events","registerEvent"],mutationFn:async r=>{if(!e)return await t("POST","/events",{query:r},{keepAlive:!0})}})}function useRegisterEventOnMount(e,t=!0){const r=useRegisterEvent(),n=reactExports.useRef(!1);reactExports.useEffect(()=>{n.current||!t||(n.current=!0,r.mutate({metric:e,once:!0}))},[e,r,t])}const LessonProgress=()=>{const[e]=useSlideIndex(),t=useMaxSlideIndex(),{lesson:r}=useLessonContext(),n=r.publicData.slides[e],i=reactExports.useRef(null);return reactExports.useEffect(()=>{if(i.current&&e===t&&(n==null?void 0:n.type)==="content"){const s=i.current.children[e],l=s.children[0];if(!l)return;const c=n.minDurationSec*1e3;return l.style.transitionDuration=`${c}ms`,l.style.width=`${s.clientWidth}px`,()=>{l.style.width="0px",l.style.transitionDuration="0ms"}}},[e,t,n]),jsx("div",{ref:i,className:"flex items-center space-x-2 h-2",children:r.publicData.slides.map((s,l)=>s.type==="content"?jsx("div",{className:classNames("flex-1 h-2 rounded-lg relative overflow-hidden",{"bg-accent":l===e&&l!==t,"bg-accent-600":l=t}),children:e===t&&jsx("div",{className:"absolute left-0 top-0 bottom-0 bg-accent transition-all ease-in",style:{width:0}})},l):jsx("div",{className:classNames("h-2 w-2 rounded-lg",{"bg-accent":l===e,"bg-accent-600":l<=t&&l!==e,"bg-accent-100":l>t&&l!==e})},l))})},SlideController=({primaryAction:e,primaryText:t="Continue",primaryDisabled:r=!1,delayPrimarySec:n=0})=>{const[i,s]=useSlideIndex(),l=useMaxSlideIndex(),[c,h]=reactExports.useState(!1),m=n*1e3;return reactExports.useEffect(()=>{if(i===l){h(!0);const b=setTimeout(()=>{h(!1)},m);return()=>{h(!1),clearTimeout(b)}}else h(!1)},[m,i,l]),jsx("div",{className:"-mx-1 px-1",children:jsxs(Button,{disabled:r||c,variant:"primary",onClick:()=>{e?e():s(b=>b+1)},children:[jsx("div",{className:"z-10",children:t}),jsx(Icon,{className:"z-10",icon:"arrowRight"})]})})},Content=({slideIndex:e,contentData:t,elementsToAnimateRef:r,isPreview:n})=>{const i=reactExports.useRef(null),s=()=>{if(!i.current)return[];const l=i.current.querySelector(".prose"),c=[];return l&&c.push(...Array.from(l.children)),c.push(...Array.from(i.current.children).slice(1)),c};return reactExports.useLayoutEffect(()=>{if(r===void 0)return;const l=s();return r.current.push(...l),()=>{r.current=r.current.filter(c=>!l.includes(c))}}),reactExports.useLayoutEffect(()=>{var l;(l=i.current)==null||l.scrollTo(0,0)},[e]),jsx(CommonErrorBoundary,{children:jsxs("div",{className:"flex-1 min-h-0 flex flex-col justify-between space-y-4",children:[jsxs("div",{ref:i,className:"flex-1 overflow-scroll scrollbar-hide flex flex-col space-y-4",children:[jsx(Markdown,{markdown:t.text,prose:!0}),t.videoUrl&&jsx("iframe",{title:"video",className:"min-h-[200px]",src:t.videoUrl,allow:"autoplay"})]}),!n&&jsx(SlideController,{delayPrimarySec:t.minDurationSec})]})})},RewardBubble=({reward:e,isFilled:t=!0,opacity:r=1,onClick:n})=>{const{data:i}=useGetMerchant();return jsx(ClickableDiv,{className:classNames("h-[4.5rem] w-[4.5rem] flex-shrink-0 rounded-full text-display-sm flex flex-col justify-center items-center border-[2px] transition-all duration-300 border-accent text-accent cursor-default",{"bg-accent text-accent-foreground":t,"cursor-pointer":!!n}),style:{opacity:r},onClick:n,children:e.type==="discount"?jsxs(Fragment,{children:[jsx("div",{className:"text-xl font-semibold",children:getDiscountValueText(e.discount,i.shopInfo)}),jsx("div",{className:"text-sm uppercase",children:"off"})]}):e.type==="freeShipping"?jsxs(Fragment,{children:[jsx("div",{className:"leading-5",children:"FREE"}),jsx("div",{className:"text-sm",children:"SHIPPING"})]}):e.type==="custom"?jsx(Fragment,{children:jsx("div",{className:"text-lg w-16 leading-5 text-center",children:e.custom.title})}):assertNever(e)})},NUM_TIERS=4,RewardsPath=()=>{const{tier:e,lastRewardTier:t,nextRewardTier:r,maxTier:n}=useUserTier(),i=useLessons(),s=reactExports.useMemo(()=>i?r===void 0?t??e:e+NUM_TIERS-1>r?Math.min(i.length,e+NUM_TIERS-1,n):Math.min(r,n):0,[i,t,r,e,n]),l=reactExports.useMemo(()=>{const c=t??1,h=s;return Array.from({length:h-c+1}).map((m,b)=>b+c)},[t,s]);return jsx(reactExports.Suspense,{fallback:jsx(RewardsPathSkeleton,{}),children:jsx("div",{className:"flex justify-center overflow-scroll scrollbar-hide items-center gap-2",children:l.map((c,h)=>{const m=c===t,b=t&&c=r?.5:1;return jsxs(React.Fragment,{children:[c===e+1&&e!==t&&jsx("div",{className:"w-2 h-2 bg-accent rounded-full"}),(h>0||e===0)&&jsxs("div",{className:"flex transition-opacity duration-1000",style:{opacity:b},children:[jsx(Icon,{icon:"chevronRight",className:classNames("text-display text-accent -mx-2")}),jsx(Icon,{icon:"chevronRight",className:classNames("text-display text-accent -mx-2")})]}),jsx(RewardBubbleWrapper,{tier:c,isFilled:m,opacity:b})]},c)})})})},RewardBubbleWrapper=({tier:e,isFilled:t,opacity:r})=>{const{lastRewardTier:n}=useUserTier(),i=useIncompleteLessons(),{setState:s}=useLessonsContext(),l=useRewardsInTier(e)[0],c=()=>{e===n?s({type:"rewards"}):i.length>0&&s({type:"lesson",lessonID:i[0].id})};return l?jsx(RewardBubble,{reward:l.config,opacity:r,isFilled:t,onClick:c}):null},RewardBubbleSkeleton=()=>jsx("div",{className:"w-20 h-20 rounded-full bg-gray-200"}),RewardsPathSkeleton=()=>jsxs("div",{className:"flex justify-center items-center gap-2",children:[jsx(RewardBubbleSkeleton,{}),jsx(Icon,{icon:"chevronRight",className:classNames("text-2xl text-primary-300 -mx-2")}),jsx(Icon,{icon:"chevronRight",className:classNames("text-2xl text-primary-300 -mx-2")}),jsx(RewardBubbleSkeleton,{}),jsx(Icon,{icon:"chevronRight",className:classNames("text-2xl text-primary-300 -mx-2")}),jsx(Icon,{icon:"chevronRight",className:classNames("text-2xl text-primary-300 -mx-2")}),jsx(RewardBubbleSkeleton,{})]}),LessonComplete=()=>{var F,j,q;const{tier:e,lastRewardTier:t,nextRewardTier:r,maxTier:n}=useUserTier(),i=useRewardsInTier(r),{data:s}=useGetMerchant(),[,l]=useSlideIndex(),[c,h]=reactExports.useState(!1);useRegisterEventOnMount("LEARNING_COMPLETE",!r);const{setState:m}=useLessonsContext(),b=useGoToNextLesson(),S=f=>{l(()=>0),m(f)},w=useRewardsInTier(t),_=useRedeemRewardIfSignedUp((F=w[0])==null?void 0:F.id),I=async()=>{w.length===1?(h(!0),await _(),h(!1)):S({type:"rewards"})},N=(j=w[0])==null?void 0:j.config,P=r?r-e:0;return jsxs("div",{className:"flex-1 flex flex-col",children:[jsxs("div",{className:"flex-1 flex flex-col space-y-4 justify-center items-center",children:[jsx(RewardsPath,{}),jsxs("div",{className:"flex flex-col gap-3 items-center",children:[jsx("p",{className:"text-display-xl",children:"Congrats!"}),jsxs("p",{className:"text-center",children:[!!w.length&&jsxs("span",{children:["You just earned"," ",(q=getFullRewardText(w[0].config,s.shopInfo))==null?void 0:q.trim(),"."," "]}),!!r&&jsxs("span",{children:["Complete ",P," ",e===0?"":"more"," ","lesson",P!==1?"s":""," to get"," ",jsx("span",{className:"font-bold",children:getRewardText(i[0].config,s.shopInfo)}),!!t&&", or claim your reward now","."]})]})]})]}),jsxs("div",{className:"flex flex-col space-y-2",children:[!!N&&jsx(Button,{onClick:I,variant:r?"secondary":"primary",disabled:c,children:c?"Claiming...":`Claim ${getRewardText(N,s.shopInfo)} now`}),!!r&&jsxs(Button,{onClick:()=>e===n-1?b():S({type:"home"}),variant:"primary",disabled:c,children:["Keep going"," ",i.length>0&&t!==void 0?`for ${getRewardText(i[0].config,s.shopInfo)}`:""]})]})]})},Checkbox$1=({value:e=!1,text:t,onChange:r,disabled:n=!1,size:i="md"})=>{const s=i==="md"?"w-[18px] h-[18px]":"w-5 h-5";return jsxs("label",{className:classNames(i==="md"?"gap-1.5":"gap-2","flex items-start relative"),children:[jsx("input",{type:"checkbox",className:classNames(s,"appearance-none rounded border-2 border-accent-200 checked:border-accent-400 cursor-pointer disabled:cursor-default disabled:opacity-50","peer text-accent outline-none checked:bg-accent-800 transition-all duration-150 focus:ring-2 ring-accent-300"),disabled:n,checked:e,onChange:l=>{r(l.target.checked)}}),jsx(Icon,{icon:"checkmark",className:classNames(s,i==="lg"?"text-lg":"text-base","hidden peer-checked:flex absolute justify-center items-center text-white cursor-pointer")}),t]})},ProgressBar=({progress:e,total:t,showPercentage:r,small:n})=>{const i=reactExports.useRef(null),s=reactExports.useRef(null);reactExports.useEffect(()=>{if(i.current&&s.current){const c=e/Math.max(t,1)*100;s.current.style.width=`${c}%`}},[e,t]);const l=r?`${Math.round(e/Math.max(t,1)*100)}%`:`${e} / ${t}`;return jsx("div",{className:classNames("w-full bg-background rounded-lg shadow overflow-hidden",{"h-1.5":n,"h-6":!n}),children:jsxs("div",{ref:i,className:classNames("w-full bg-accent-200 flex justify-center items-center relative",{"h-1.5":n,"h-6":!n}),children:[jsx("div",{ref:s,className:"absolute left-0 top-0 bottom-0 bg-accent rounded-lg z-10 transition-all duration-300"}),!n&&jsx("span",{className:"text-accent-foreground font-semibold z-20",children:l})]})})},RadioButton=({value:e=!1,text:t,onChange:r,disabled:n=!1,align:i="start"})=>jsxs("label",{className:classNames("flex gap-2 relative",i==="start"?"items-start":"items-center"),children:[jsx("input",{type:"radio",className:classNames("appearance-none w-5 h-5 rounded-full border-2 border-accent-200 checked:border-accent-800 cursor-pointer disabled:cursor-default disabled:opacity-50","peer text-accent outline-none transition-all duration-150 focus:ring-2 ring-accent-300"),disabled:n,checked:e,onChange:s=>{r(s.target.checked)}}),jsx("div",{className:"invisible peer-checked:visible flex justify-center items-center absolute w-5 h-5 cursor-pointer peer-disabled:cursor-default",children:jsx("div",{className:"w-2.5 h-2.5 bg-accent-800 rounded-full"})}),t]}),QuestionBody=({questionData:e,questionStatus:t,answersContainerRef:r,pollAnswerData:n,onSelectedAnswersChange:i})=>{const[s,l]=reactExports.useState([]);reactExports.useEffect(()=>{l([])},[e.uuid]);const c=reactExports.useCallback(h=>{const m=e.multi?s.includes(h)?s.filter(b=>b!==h):[...s,h]:[h];l(m),i==null||i(m)},[i,e,s]);return jsxs(Fragment,{children:[jsxs("div",{className:"flex flex-col space-y-1",children:[jsx("p",{className:"leading-6 text-lg",children:e.text}),e.multi&&jsx("p",{className:"text-primary-500 text-sm",children:"Select all that apply"})]}),jsx("div",{ref:r,className:"flex flex-col gap-3 pl-0.5",children:e.multi?e.answers.map((h,m)=>jsx(Checkbox$1,{size:"lg",text:jsx(AnswerChoiceWithPollAnswer,{text:h.text,questionStatus:t,pollAnswerData:n}),value:s.includes(m)||(t==null?void 0:t.attemptedAnswers.includes(m)),onChange:()=>c(m)},m)):e.answers.map((h,m)=>jsx(RadioButton,{text:jsx(AnswerChoiceWithPollAnswer,{text:h.text,questionStatus:t,pollAnswerData:n}),value:s.includes(m)||(t==null?void 0:t.attemptedAnswers.includes(m)),disabled:t==null?void 0:t.complete,onChange:()=>c(m)},m))})]})},AnswerChoiceWithPollAnswer=({text:e,questionStatus:t,pollAnswerData:r})=>{const n=Object.values(r??{}).reduce((i,s)=>i+s,0);return jsxs("div",{className:"flex-1",children:[jsx("div",{className:"text-lg",children:e}),!!r&&(t==null?void 0:t.complete)&&jsx(ProgressBar,{progress:r[e]??0,total:n,showPercentage:!0})]})},Question=({questionData:e,questionStatus:t,elementsToAnimateRef:r,pollAnswerData:n})=>{const{lesson:i}=useLessonContext(),[s,l]=useSlideIndex(),[c,h]=reactExports.useState([]),m=useAnswerQuestion(),b=reactExports.useRef(null),S=reactExports.useRef(null),{nextRewardTier:w}=useUserTier(),_=useRewardsInTier(w),{data:I}=useGetMerchant(),N=()=>{var f;const j=Array.from(((f=b.current)==null?void 0:f.children)??[]),q=[...j.slice(0,j.length-1),...S.current?[S.current]:[]];return Array.from(new Set(q))};reactExports.useLayoutEffect(()=>{if(r===void 0)return;const j=N();return r.current.push(...j),()=>{r.current=r.current.filter(q=>!j.includes(q))}});const P=async()=>{const j=await m.mutateAsync({questionUUID:e.uuid,answers:c,lessonID:i.id});h([]);const q=j.data[e.uuid];q!=null&&q.complete&&!n&&l(f=>f+1)},F=reactExports.useMemo(()=>{const j=i.publicData.slides.slice(s+1).filter(q=>q.type==="question").length;return j===0||!_.length?"":`${j} question${j>1?"s":""} left to get ${getRewardText(_[0].config,I.shopInfo)}.`},[i,_,s,I]);return jsxs(Fragment,{children:[jsx("div",{ref:b,className:"flex-1 overflow-scroll scrollbar-hide flex flex-col space-y-3",children:jsx(QuestionBody,{questionData:e,questionStatus:t,onSelectedAnswersChange:h,answersContainerRef:S,pollAnswerData:n})}),jsx("div",{className:"flex flex-col space-y-2 pt-2",children:t.complete?jsxs(Fragment,{children:[jsxs("p",{className:"text-center text-sm text-primary-600 leading-5",children:["Thanks for answering! ",F]}),jsx(SlideController,{})]}):jsx(SlideController,{primaryAction:P,primaryDisabled:m.isLoading||c.length===0,primaryText:"Submit"})})]})},defaultQuestionStatus={attemptedAnswers:[],correctAnswers:[],complete:!1},QuestionWrapper=({questionData:e,elementsToAnimateRef:t})=>{const[r]=useSlideIndex(),{lesson:n,lessonStatus:i}=useLessonContext(),{config:s}=useLessonsContext(),l=n.publicData.slides[r],c=i.data[l.uuid]??defaultQuestionStatus,{data:h}=useGetPollAnswersForQuestionNoSuspense({questionUUID:e.uuid}),m=s.showPollResults,b=reactExports.useMemo(()=>{if(!h||!m)return;const S=c.attemptedAnswers[0],w=e.answers.at(S);if(!w)return h;const _=h[w.text]??0;return{...h,[w.text]:_+1}},[h,m,e,c]);return jsx(CommonErrorBoundary,{children:jsx(Question,{questionData:e,questionStatus:c,elementsToAnimateRef:t,pollAnswerData:b})})},ENTRANCE_INTERVAL=600,ENTRANCE_DURATION=300,Slide=()=>{const{preview:e}=useLessonsContext(),[t]=useSlideIndex(),r=(e==null?void 0:e.slideIndex)??t,n=useMaxSlideIndex(),{data:i}=useLessonContext(),s=reactExports.useRef(null),l=reactExports.useRef([]);if(reactExports.useLayoutEffect(()=>{if(!s.current)return;const h=s.current;r===n&&(h.classList.add("opacity-0"),l.current.forEach((m,b)=>{m.classList.add("animatable"),m.classList.add("pending-entrance"),setTimeout(()=>{m.classList.remove("pending-entrance")},ENTRANCE_DURATION+b*ENTRANCE_INTERVAL)}),setTimeout(()=>{h.classList.remove("opacity-0")},ENTRANCE_DURATION))},[r,n]),r>i.slides.length-1)return jsx(LessonComplete,{});const c=i.slides[r];return jsx("div",{id:"test-id",ref:s,className:classNames("flex flex-col flex-1 min-h-0"),children:c.type==="content"?jsx(Content,{slideIndex:r,contentData:c,elementsToAnimateRef:l}):jsx(QuestionWrapper,{questionData:c,elementsToAnimateRef:l})})},Lesson=()=>{useRegisterEventOnMount("LEARNING_STARTED");const{lesson:e,lessonStatus:t}=useLessonContext(),[r,n]=useSlideIndex();useLoadSlideIndex(e,t);const{tier:i,nextRewardTier:s}=useUserTier(),l=useRewardsInTier(s),{data:c}=useGetMerchant(),{setState:h}=useLessonsContext(),m=()=>{r>0?n(b=>b-1):h({type:"home"})};return jsxs("div",{className:"flex flex-col flex-1 min-h-0 gap-1",children:[jsxs("div",{className:"flex flex-col space-y-2 pb-2",children:[jsxs("div",{className:"flex space-x-2 justify-between items-center",children:[jsx(LayoutBack,{text:e.name,onClick:m}),r{const t=useLesson(e),{data:r}=useGetLessonStatus({params:{lessonID:e}}),[n,i]=reactExports.useState(void 0),[s,l]=reactExports.useState(0),[c,h]=reactExports.useState(0);return t?jsx(LessonContextProvider,{value:{lesson:t,data:t.publicData,lessonStatus:r,lastLoadedLesson:n,setLastLoadedLesson:i,slideIndex:s,setSlideIndex:l,maxSlideIndex:c,setMaxSlideIndex:h},children:jsx(CommonErrorBoundary,{children:jsx(Lesson,{})})}):jsx(ErrorMsg,{errorMessage:"Lesson not found"})},LessonV2Skeleton=()=>jsxs(Layout$1,{reverse:!0,right:jsx("p",{className:"skeleton leading-5",children:"Welcome"}),left:jsx("div",{className:"skeleton leading-5",children:"Icons"}),children:[jsx("div",{className:"skeleton w-full rounded-lg h-3"}),jsx("div",{className:"skeleton text-3xl leading-7 w-max",children:"Learn and Earn"}),jsxs("div",{className:"space-y-0.5",children:[jsx("div",{className:"skeleton leading-5",children:"Lorem ipsum dolor sit amet"}),jsx("div",{className:"skeleton leading-5",children:"Lorem ipsum dolor sit amet"})]})]}),Loading=()=>jsx("div",{className:"text-accent w-full h-full flex justify-center items-center bg-background"}),RewardItem=({reward:e})=>{const t=useRedeemRewardIfSignedUp(e.id),{lastRewardTier:r}=useUserTier(),i=useRewardsInTier(r).some(b=>b.id===e.id),[s,l]=reactExports.useState(!1),{data:c}=useGetMerchant(),h=reactExports.useMemo(()=>s?"Unlocking...":i?"Click to unlock":"Complete more lessons to unlock",[i,s]);return jsxs(ClickableDiv,{onClick:async()=>{i&&(l(!0),await t(),l(!1))},disabled:!i,className:classNames("box flex space-x-3 items-center",{clickable:i,"opacity-60 cursor-default":!i}),children:[jsx(Icon,{className:"text-2xl",icon:"discount"}),jsxs("div",{className:"flex-1 flex flex-col space-y-1",children:[jsx("p",{className:"leading-4 text-display-xs",children:getRewardText(e.config,c.shopInfo)}),jsx("div",{className:"leading-4 text-sm text-primary-400 font-medium",children:h})]})]})},AllRewards=()=>{const{lastRewardTier:e}=useUserTier(),t=useRewardsInTier(e);return jsxs(CommonErrorBoundary,{children:[t.map(r=>jsx(RewardItem,{reward:r},r.id)),t.length===0&&jsx("p",{className:"text-primary-600 text-sm leading-5 text-center",children:"There's currently no rewards available, check back later!"})]})},RewardsPage=()=>{const{goBack:e}=useLessonsContext();return jsx(Layout$1,{left:jsx(LayoutBack,{onClick:e}),children:jsx(reactExports.Suspense,{fallback:jsx(Loading,{}),children:jsx(CommonErrorBoundary,{children:jsxs("div",{className:"flex-1 flex flex-col gap-2",children:[jsx("div",{className:"text-display-lg",children:"Rewards for you"}),jsx("div",{className:"flex-1 flex flex-col gap-2 pt-1 overflow-scroll scrollbar-hide -mx-5 px-5",children:jsx(AllRewards,{})})]})})})})},{useContext:useContext$7,Provider:Provider$8}=createContextWithoutDefault("lessons"),useLessonsContext=useContext$7,Lessons=({config:e,preview:t})=>{useGetLessonStatuses();const[r,n]=reactExports.useState([{type:"home"}]),i=t?{type:"lesson",lessonID:t.lessonID}:r[r.length-1];return jsx(Provider$8,{value:{config:e,preview:t,setState:s=>n([...r,s]),goBack:()=>n(r.slice(0,-1))},children:i.type==="lesson"?jsx(reactExports.Suspense,{fallback:jsx(LessonV2Skeleton,{}),children:jsx(LessonV2Page,{lessonID:i.lessonID})}):i.type==="rewards"?jsx(RewardsPage,{}):i.type==="howItWorks"?jsx(HowItWorks,{}):i.type==="setProfile"?jsx(LessonsSetProfile,{rewardID:i.rewardID}):jsx(LessonsHome,{})})},LessonsHome=()=>{const{data:e}=useGetUser(),{data:t}=useGetMerchant(),{setState:r,config:n}=useLessonsContext(),i=useGoToNextLesson();return reactExports.useEffect(()=>{n.skipHomeScreen&&i()},[n.skipHomeScreen,i]),jsx(Layout$1,{reverse:!0,right:jsx("p",{className:"font-medium text-accent leading-5",children:e.name?`Welcome, ${e.name}`:`Welcome to ${t.title}`}),left:jsx("div",{className:"flex space-x-1 text-accent",children:jsx(Icon,{icon:"helpOutline",className:"text-display cursor-pointer",onClick:()=>r({type:"howItWorks"})})}),children:jsxs(CommonErrorBoundary,{children:[jsx(EarnPoints,{}),jsx("div",{className:"flex flex-col space-y-4",children:jsx(reactExports.Suspense,{fallback:jsx(RewardsPathSkeleton,{}),children:jsx(RewardsPath,{})})})]})})},useGetTracksByIDQuery=queryManager(e=>["tracks","getTracksByID",e]);function useGetTracksByID(e){var i;const t=useServiceFetch(),{getQueryKey:r}=useGetTracksByIDQuery(),{initialData:n}=useCustomerAppContext();return useSuspenseQuery({queryKey:r(e??0),queryFn:()=>t("GET","/tracks/:id",{params:{id:e??0}}),enabled:!!e,staleTime:1/0,initialData:(i=n.allTracks)==null?void 0:i.find(s=>s.id===e)})}const DelayButton=({delay:e,onClick:t,children:r,disabled:n=!1})=>{var m;const[i,s]=reactExports.useState(!1),l=reactExports.useRef(null),c=reactExports.useRef(null),h=(m=l.current)==null?void 0:m.offsetWidth;return reactExports.useEffect(()=>{if(c.current){const b=c.current;b.style.transition=`left ${e}ms ease-in`,b.style.left=`${h}px`,setTimeout(()=>{s(!0)},e)}},[e,h]),jsxs("div",{className:"w-full relative",ref:l,children:[jsx("div",{ref:c,style:{backgroundColor:`rgb(${dumpCSSVariable(dumpColorVariable("--background-color"))} / 0.4)`},className:classNames("z-10 absolute right-0 bottom-0 top-0 left-0 bg-background-300",(!i||n)&&"pointer-events-none")}),jsx(Button,{variant:"primary",disabled:n||!i,onClick:()=>{i&&!n&&t()},children:r})]})},useGetTracksStateQuery=queryManager(e=>["tracksState","getTracksState",e]);function useGetTracksState(e){const t=useServiceFetch(),{getQueryKey:r}=useGetTracksStateQuery();return useSuspenseQuery({queryKey:r(e),queryFn:()=>t("GET","/tracks-state/:tracksID",{params:e})})}function useUpsertTracksState(e){const t=useServiceFetch(),{updateQuery:r}=useGetTracksStateQuery();return useMutation({mutationKey:["tracksState","upsertTracksState"],mutationFn:n=>t("PUT","/tracks-state/:tracksID",{params:e,body:n}),onSuccess:n=>{r(e,()=>n)}})}function useSyncTracksState(){const{preview:e}=useCustomerAppContext(),{tracksState:t,setTracksState:r}=useTracksContext(),{id:n}=useTracksContext(),{data:i}=useGetTracksState({tracksID:n}),s=useUpsertTracksState({tracksID:n}),l=reactExports.useRef(!1);reactExports.useEffect(()=>{l.current||(l.current=!0,i&&r(i.data))},[i,r]),reactExports.useEffect(()=>{!e&&!isTracksStateEqual(i==null?void 0:i.data,t)&&!s.isLoading&&s.mutate({data:t})},[t,s,i,e])}function isTracksStateEqual(e,t){if(!e)return!1;const r=Object.entries(e.slides).sort(([i],[s])=>i.localeCompare(s)),n=Object.entries(t.slides).sort(([i],[s])=>i.localeCompare(s));if(r.length!==n.length)return!1;for(let i=0;i{const{config:e,tracksData:t,preview:r,tracksState:n}=useTracksContext();if(r){const m=t.tracks.find(b=>b.uuid===r.trackUUID);if(m){const b=m.slides.find(S=>S.uuid===r.slideUUID);if(b)return{type:"slide",slide:b}}}const i=m=>{const b=t.rewards[m];return b?{type:"reward",uuid:m,reward:b}:{type:"error",message:"Reward not found"}},s=t.tracks.find(m=>m.uuid===(e==null?void 0:e.startingTrack));if(!s)return{type:"error",message:"No starting track"};let l=s,c=l.slides[0],h=0;for(;c;){h++;const m=l.slides.findIndex(w=>w.uuid===c.uuid);if(m===-1)return{type:"slide",slide:l.slides[0]};const b=mN.uuid===_);if(!I)return{type:"slide",slide:c};w=I.next}if(w.type==="reward")return i(w.uuid);if(w.type==="track"){const _=w.uuid,I=t.tracks.find(N=>N.uuid===_);if(!I)return{type:"slide",slide:c};l=I,c=l.slides[0];continue}}if(b)c=l.slides[m+1];else return l.reward?i(l.reward):{type:"error",message:"No next slide"}}return{type:"slide",slide:l.slides[0]}};function useCompleteSlide(){const{tracksState:e,setTracksState:t}=useTracksContext();return reactExports.useCallback((r,n)=>{t({...e,slides:{...e.slides,[r]:n}})},[t,e])}function useTracksRewardText(){const{tracksData:e}=useTracksContext(),{data:t}=useGetMerchant();return reactExports.useMemo(()=>{if(!e)return;let r;for(const n of Object.values(e.rewards)){const i=getRewardText(n,t.shopInfo);if(r!==void 0&&i!==r)return;r=i}return r},[e,t])}const TrackContentSlide=({slide:e,elementsToAnimateRef:t,preview:r=!1})=>{const n=useCompleteSlide(),i=reactExports.useRef(null),s=()=>{if(!i.current)return[];const l=i.current.querySelector(".prose"),c=[];return l&&c.push(...Array.from(l.children)),c.push(...Array.from(i.current.children).slice(1)),c};return reactExports.useLayoutEffect(()=>{if(t===void 0)return;const l=s();return t.current.push(...l),()=>{t.current=t.current.filter(c=>!l.includes(c))}}),jsxs("div",{className:"flex-1 flex flex-col justify-between min-h-0 space-y-4",children:[jsxs("div",{ref:i,className:"flex flex-col flex-1 overflow-scroll scrollbar-hide space-y-4",children:[jsx(Markdown,{markdown:e.text,prose:!0}),e.videoUrl&&jsx("iframe",{title:"video",src:e.videoUrl,allow:"autoplay"})]}),jsxs(DelayButton,{delay:e.minDurationSec*1e3,onClick:()=>n(e.uuid,{type:"content"}),disabled:r,children:["Continue",jsx(Icon,{icon:"arrowRight"})]},e.uuid)]})},TrackQuestionSlide=({slide:e,elementsToAnimateRef:t,preview:r=!1})=>{const[n,i]=reactExports.useState(),[s,l]=reactExports.useState(!1),c=useCompleteSlide(),h=reactExports.useRef(null),m=reactExports.useRef(null),[b,S]=reactExports.useState(""),w=useAnswerTracksPoll(),{data:_}=useGetPollAnswersForQuestionNoSuspense({questionUUID:e.uuid}),{id:I,config:N}=useTracksContext(),P=()=>{const g=[...h.current?[h.current]:[],...m.current?[m.current]:[]];return Array.from(new Set(g))};reactExports.useLayoutEffect(()=>{if(t===void 0)return;const g=P();return t.current.push(...g),()=>{t.current=t.current.filter(C=>!g.includes(C))}});const F=reactExports.useMemo(()=>{var g;return n==="other"?b:(g=e.answers.find(C=>C.uuid===n))==null?void 0:g.text},[n,b,e]),j=()=>{if(r||!n)return;const g=n==="other"?{other:!0}:{other:!1,uuid:n};c(e.uuid,{type:"question",answer:g}),F&&w.mutate({tracksID:I,questionUUID:e.uuid,answerUUID:"uuid"in g?g.uuid:void 0,answer:F})},q=N==null?void 0:N.showPollResults,f=reactExports.useMemo(()=>{if(!(!_||!q))return!F||n!=="other"?_:{..._,[F]:(_[F]??0)+1}},[_,q,n,F]),v=Object.values(f??{}).reduce((g,C)=>g+C,0);return jsxs(CommonErrorBoundary,{children:[jsxs("div",{className:"flex-1 flex flex-col space-y-3 overflow-scroll scrollbar-hide",children:[jsx("p",{ref:h,className:"text-lg",children:e.question}),jsxs("div",{ref:m,className:"flex flex-col gap-3 pl-0.5",children:[e.answers.map((g,C)=>jsx(RadioButton,{value:n===g.uuid,onChange:()=>!s&&i(g.uuid),disabled:s,text:jsxs("div",{className:"flex-1",children:[jsx("div",{className:"text-lg",children:g.text}),s&&f?jsx(ProgressBar,{progress:f[g.text]??0,total:v,showPercentage:!0}):null]})},C)),e.other&&jsx(RadioButton,{value:n==="other",onChange:()=>!s&&i("other"),align:"center",text:jsx(Input,{placeholder:"Other...",value:b,disabled:s,onChange:g=>S(g.target.value),onFocus:()=>i("other")})})]})]}),s?jsxs(Button,{disabled:r,variant:"primary",onClick:j,children:["Continue",jsx(Icon,{icon:"arrowRight"})]}):jsxs(Button,{variant:"primary",disabled:!n||n==="other"&&!b,onClick:()=>f?l(!0):j(),children:["Submit",jsx(Icon,{icon:"arrowRight"})]})]})},TracksHelp=({onClose:e})=>{const{data:t}=useGetMerchant(),r=reactExports.useMemo(()=>[jsxs("span",{children:[jsxs("strong",{children:["Learn about ",t.title]})," through short, engaging slides"]},1),jsxs("span",{children:[jsx("strong",{children:"Answer some questions"})," so we can direct you toward the right product for you"]},2),jsxs("span",{children:[jsx("strong",{children:"Earn a discount"})," off your next purchase at"," ",t.title,"!"]},3)],[t]);return jsxs(Layout$1,{left:jsx(LayoutBack,{onClick:e}),children:[jsxs("div",{className:"flex-1 flex flex-col space-y-6",children:[jsxs("div",{className:"space-y-1",children:[jsx("div",{className:"text-display-lg",children:"How it works"}),jsxs("div",{className:"text-primary-500 text-sm flex gap-1",children:[jsx(Icon,{icon:"clock"}),"Total time: 1 min"]})]}),jsx("div",{className:"flex flex-col space-y-6",children:r.map((n,i)=>jsxs("div",{className:"flex space-x-4",children:[jsx("div",{className:"bg-accent-100 text-accent text-display-xs w-10 h-10 flex-shrink-0 rounded-full flex justify-center items-center",children:i+1}),jsx("div",{className:"text-lg",children:n})]},i))})]}),jsx(Button,{variant:"primary",onClick:e,children:"Got it!"})]})};function assert(e,t){if(!e)throw new Error(t)}const useTracksMap=()=>{var r;const{tracksData:e}=useTracksContext(),t={tracks:new Map,slides:new Map};if(!e)return t;for(const n of e.tracks){for(let i=0;im.next),...s.slide.other?[s.slide.other.next]:[]];for(const m of h)if(m.type==="continue"&&s.nextSlide)l.push(s.nextSlide);else if(m.type==="track"){const b=e.tracks.get(m.uuid);b&&l.push(b.firstSlide)}}const c=l.length===0?0:1+Math.min(...l.map(h=>getMinSlidesRemaining(e,h,r,n)));return r.set(t,c),c}function useTracksProgress(e){const t=useTracksMap(),{tracksState:r}=useTracksContext();return reactExports.useMemo(()=>{const n=getMinSlidesRemaining(t,e);return{numCompleted:Object.keys(r.slides).length,minSlidesRemaining:n}},[e,t,r.slides])}const TrackSlide=reactExports.forwardRef(({slide:e},t)=>{const r=reactExports.useRef(null),n=reactExports.useRef([]),{numCompleted:i,minSlidesRemaining:s}=useTracksProgress(e.uuid),{tracksData:l}=useTracksContext(),c=useTracksRewardText(),[h,m]=reactExports.useState(!1),{styles:b,onClick:S,onMouseEnter:w,onMouseLeave:_}=usePreviewNodeContext(),I=reactExports.useMemo(()=>l==null?void 0:l.tracks.find(N=>N.slides.some(P=>P.uuid===e.uuid)),[l,e.uuid]);return reactExports.useLayoutEffect(()=>{if(!r.current)return;const N=r.current;N.classList.add("opacity-0"),n.current.forEach((P,F)=>{P.classList.add("animatable"),P.classList.add("pending-entrance"),setTimeout(()=>{P.classList.remove("pending-entrance")},ENTRANCE_DURATION+F*ENTRANCE_INTERVAL)}),setTimeout(()=>{N.classList.remove("opacity-0")},ENTRANCE_DURATION)},[e]),h?jsx(TracksHelp,{onClose:()=>m(!1)}):jsxs("div",{className:"flex flex-col flex-1 gap-3 min-h-0",style:b,onClick:S,onMouseEnter:w,onMouseLeave:_,ref:t,children:[jsxs("div",{className:"space-y-1",children:[jsxs("div",{className:"flex justify-between items-center",children:[jsx("div",{className:"line-clamp-1 text-display-xs flex-shrink",children:(I==null?void 0:I.displayName)??(I==null?void 0:I.name)}),jsx("div",{children:jsx(Icon,{className:"text-display text-accent cursor-pointer",onClick:()=>m(!0),icon:"helpOutline"})})]}),jsx(ProgressBar,{progress:i,total:i+s+1,small:!0}),jsxs("div",{className:"flex justify-between items-center text-primary-500 text-sm",children:[jsxs("div",{className:"flex gap-1",children:[jsx(Icon,{icon:"clock"}),"1 min"]}),jsxs("div",{children:["Complete for ",c??"a reward"]})]})]}),jsx("div",{ref:r,className:classNames("flex flex-col gap-2 flex-1 min-h-0"),children:e.type==="content"?jsx(TrackContentSlide,{slide:e,elementsToAnimateRef:n},e.uuid):jsx(TrackQuestionSlide,{slide:e,elementsToAnimateRef:n},e.uuid)})]})});TrackSlide.displayName="TrackSlide";const TracksReward=({uuid:e,reward:t})=>{useRegisterEventOnMount("LEARNING_COMPLETE");const{data:r}=useGetMerchant(),{splitSignUp:n}=useEducationSignUpSettings(),[i,s]=reactExports.useState(!1),l=useClaimReward(),{id:c}=useTracksContext(),h=useIsSignedUp(),m=async()=>{await l.mutateAsync({type:"tracks",tracksID:c,uuid:e})},b=()=>{h?m():s(!0)},S=reactExports.useMemo(()=>{if(t.type==="discount")return t.discount.customQualifierText?null:getDiscountPriceQualifiers(t.discount,r.shopInfo);if(t.type==="freeShipping")return getFreeShippingQualifiers(t.freeShipping,r.shopInfo);if(t.type==="custom")return t.custom.subtitle;assertNever(t)},[t,r.shopInfo]),w=isInstagram();return jsx(Layout$1,{left:jsx("div",{children:"You earned a reward!"}),children:i?jsx("div",{className:classNames("flex-1 flex flex-col",w?"justify-end space-y-3":"space-y-3"),children:jsx(SetProfileForm,{onComplete:async()=>{await m(),s(!1)},source:{type:"widget"},split:n})}):jsxs("div",{className:"flex flex-col justify-center items-center gap-5 flex-1",children:[jsx("div",{className:"text-display-xs text-center leading-5",children:"Congrats! You've earned"}),jsxs("div",{className:"flex flex-col gap-1",children:[jsx("div",{className:"text-display-xl text-center",children:getRewardText(t,r.shopInfo)}),jsxs("div",{className:"flex flex-col gap-0.5",children:[t.type==="discount"&&jsxs("div",{className:"text-center font-medium",children:[" ",getItemsDescriptor(t.discount)]}),S&&jsx("div",{className:"text-primary-500 text-sm text-center",children:S})]})]}),jsxs(Button,{variant:"primary",onClick:b,disabled:l.isLoading,children:["Claim my reward",jsx(Icon,{icon:"arrowRight"})]}),jsx("div",{className:"h-8"})]})})},{useContext:useTracksContext,Provider:TracksProvider}=createContextWithoutDefault("tracks"),Tracks=reactExports.forwardRef(({config:e,preview:t},r)=>{useRegisterEventOnMount("LEARNING_STARTED");const{data:n}=useGetUser(),{data:i}=useGetTracksByID(e==null?void 0:e.tracksID),[s,l]=reactExports.useState({slides:{}}),c=n.isMerchantPreview?i==null?void 0:i.data:i==null?void 0:i.publicData;return!i||!c?jsx("div",{children:"No Tracks found"}):jsx(TracksProvider,{value:{id:i.id,config:e,preview:t,tracksData:c,tracksState:s,setTracksState:l},children:jsx(TracksPosition,{ref:r})})});Tracks.displayName="Tracks";const TracksPosition=reactExports.forwardRef((e,t)=>{const{tracksState:r,setTracksState:n}=useTracksContext(),i=useTracksPosition();return useSyncTracksState(),reactExports.useEffect(()=>{(i==null?void 0:i.type)==="error"&&Object.keys(r.slides).length>0&&(logger.log("Error in tracks:",i.message),n({slides:{}}))},[n,i,r]),i?i.type==="error"?jsx("div",{children:i.message}):i.type==="reward"?jsx(TracksReward,{reward:i.reward,uuid:i.uuid}):jsx(TrackSlide,{ref:t,slide:i.slide}):jsx(Loading,{})});TracksPosition.displayName="TracksPosition";const CopyNode=reactExports.forwardRef(({id:e,node:t},r)=>{var N;const{isPreview:n}=usePopupPreviewContext(),i=useClaimReward(),s=useClaimedReward(),{data:l}=useGetAllRewards(),c=l==null?void 0:l.find(P=>P.id===t.rewardID),h=reactExports.useRef(!1);reactExports.useEffect(()=>{n||!t.rewardID||s||h.current||(h.current=!0,i.mutate({type:"popupTemplate",rewardID:t.rewardID,showModal:!1,step:"popup"}))},[n,t.rewardID,i,s]);const[m,b]=reactExports.useState(!1),S=(()=>{if(!t.rewardID)return t.text;if(s)return s.shopifyCode;if((c==null?void 0:c.config.type)==="custom")return c.config.custom.shopifyCode})(),_=S??(n?"ALXXXXXXXX...":"GENERATING..."),I=reactExports.useCallback(()=>{S&&new ShopifyUtils().applyCode(S)},[S]);return reactExports.useEffect(()=>{t.applyImmediately&&I()},[t.applyImmediately,I]),jsxs(ClickableDiv,{id:e,ref:r,onClick:()=>{S&&(navigator.clipboard.writeText(S),b(!0),I())},className:classNames((N=t.styles)==null?void 0:N.classes),children:[_,jsx(Icon,{icon:m?"checkmark":"copy"})]})});CopyNode.displayName="CopyNode";function useMediatorState(){const{mediator:e}=useCustomerAppContext();return reactExports.useSyncExternalStore(t=>(e==null?void 0:e.subscribe(t))??(()=>{}),()=>e==null?void 0:e.state)}function parseShopifyGqlID(e){return t=>{const r=t.split("/"),n=r.pop(),i=r.pop();if(n){if(i!==e)throw new Error(`Expected Shopify GQL ID of type ${e}, got ${i}`);return t}else throw new Error(`Invalid Shopify GQL ID ${t}`)}}function gqlToRestID(e){return t=>{const r=t.split("/"),n=r.pop(),i=r.pop();if(!n||!i||i!==e)throw new Error(`Invalid Shopify GQL ID ${t}`);return n}}const useClosePopupAction=()=>{const{onClosePopup:e}=usePopupContext();return t=>{e==null||e({type:"action",action:t})}},usePopupStepAction=()=>{const{setStepID:e,stepID:t,history:r,template:n}=usePopupContext();return i=>{if(n)if(i.step.type==="step")e==null||e(i.step.stepID,{type:"action",action:i});else if(i.step.type==="mostRecent"){const s=r==null?void 0:r.reverse().find(l=>l!==t&&getSteps(n).some(({id:c})=>c===l));e==null||e(s??i.step.otherwise,{type:"action",action:i})}else if(i.step.type==="next"){if(t&&n){const s=getSteps(n).findIndex(c=>c.id===t),l=getSteps(n).at(s+1);l&&(e==null||e(l.id,{type:"action",action:i}))}}else assertNever(i.step)}},usePopupFloatingButtonAction=()=>{const e=useClosePopupAction(),{setStepID:t,template:r}=usePopupContext();return n=>{if(!r)return;const i=n.stepID,s=getFloatingButtons(r);s.find(c=>c.id===i)?t==null||t(i,{type:"action",action:n}):s.length>0?t==null||t(s[0].id,{type:"action",action:n}):e(DEFAULT_CLOSE_POPUP_ACTION)}},usePopupRewardAction=()=>{const{onClosePopup:e}=usePopupContext(),t=useClaimReward(),r=useApplyCode({onRedirected:()=>e==null?void 0:e({type:"redirect"})});return async n=>{const i=await t.mutateAsync({type:"popupTemplate",step:"popup",rewardID:n.rewardID,updateCache:n!=null&&n.applyImmediately?!1:void 0,showModal:!0});n.applyImmediately&&(r(i),e==null||e({type:"action",action:n}))}},usePopupPollAnswerAction=()=>{const e=useCreatePollAnswer();return async t=>{await e({questionUUID:t.questionUUID,questionText:t.questionText,answerUUID:t.answerUUID,answer:t.answer})}},useAddToCartAction=()=>e=>{new ShopifyUtils().addToCart(e.variantIDs.map(t=>{const r=parseShopifyGqlID("ProductVariant")(t);return gqlToRestID("ProductVariant")(r)}))},usePopupTapToTextAction=()=>{const{mutateAsync:e}=useRegisterEvent();return t=>{t.tapToText&&e({metric:"SIGNUP_PHONE",once:!0}),openLink(t.url,t.newTab?"_blank":"_parent")}},openLink=(e,t)=>{const r=getDocument().createElement("a");r.href=e,r.target=t,r.rel="noopener noreferrer",getDocument().body.appendChild(r),r.click(),getDocument().body.removeChild(r)},usePopupCustomCodeAction=()=>{const e=useEvaluateWithAliaObject();return async t=>{await e(t.code)}};function useExecutePopupActions(e){const t=useClosePopupAction(),r=usePopupStepAction(),n=usePopupFloatingButtonAction(),i=usePopupRewardAction(),s=usePopupPollAnswerAction(),l=useAddToCartAction(),c=usePopupTapToTextAction(),h=usePopupCustomCodeAction();return async m=>{const b=e??m;if(b)for(const S of b)S.type==="closePopup"?t(S):S.type==="step"?r(S):S.type==="floatingButton"?n(S):S.type==="reward"?await i(S):S.type==="pollAnswer"?await s(S):S.type==="addToCart"?l(S):S.type==="tapToText"?c(S):S.type==="customCode"?h(S):assertNever(S)}}function useAliaObject(){const e=usePopupStepAction(),t=useClosePopupAction(),{data:r}=useGetUser(),n=useMediatorState();return reactExports.useMemo(()=>({$alia:{user:{...r,...n==null?void 0:n.user},popup:{step:i=>e(i?{type:"step",step:{type:"step",stepID:i}}:{type:"step",step:{type:"next"}}),closePopup:()=>t(DEFAULT_CLOSE_POPUP_ACTION)}}}),[e,t,r,n])}function useEvaluateWithAliaObject(){const{$alia:e}=useAliaObject(),{mediator:t}=useCustomerAppContext(),{mutateAsync:r}=useLogError();return reactExports.useCallback(async n=>{const i=safeEval(`(async ($alia) => { ${n} })`);try{await i({...e,user:{...e.user,...t==null?void 0:t.state.user}})}catch(s){r({message:"Error evaluating code with $alia object",data:{code:n,error:unknownErrToStr(s)}})}},[e,t,r])}function useCustomCodeScriptArgs(){const{root:e}=useCustomerAppContext(),t=useExecutePopupActions(),{$alia:r}=useAliaObject(),n=reactExports.useMemo(()=>({document:e,mainDocument:getDocument(),hooks:{nextStep:()=>{t([{type:"step",step:{type:"next"}}])}},$alia:r}),[t,e,r]),i=reactExports.useCallback((s,l)=>{for(const c of CUSTOM_CODE_ARGS_KEYS)l=l.replaceAll(c,`window["${s}"].${c}`);return l},[]);return{args:n,replaceArgsReferences:i}}const CustomCodeNode=reactExports.forwardRef(({id:e,node:t},r)=>{const{isPreview:n,sizeOverride:i}=usePopupPreviewContext(),{root:s}=useCustomerAppContext(),{styles:l,onClick:c,onMouseEnter:h,onMouseLeave:m}=usePreviewNodeContext(),{args:b,replaceArgsReferences:S}=useCustomCodeScriptArgs(),w=`alia-custom-code-args-${e}`;reactExports.useEffect(()=>(window[w]=b,()=>{delete window[w]}),[b,w]),reactExports.useEffect(()=>{if(n)return;const N=getDocument().createElement("div");N.innerHTML=t.code;const P=N.querySelectorAll("script"),F=Array.from(P).map(j=>{const q=getDocument().createElement("script");return q.textContent=S(w,j.textContent??""),Array.from(j.attributes).forEach(f=>{q.setAttribute(f.name,f.value)}),s.appendChild(q),j.remove(),()=>q.remove()});return()=>F.forEach(j=>j())},[n,s,S,w,t.code]);const{rootSelector:_}=useCustomerAppContext();reactExports.useEffect(()=>{const N=getDocument().createElement("div");N.innerHTML=transformCSSValue(t.code,i)??"";const P=N.querySelectorAll("style"),F=Array.from(P).map(j=>{var v;if(getDocument().head.appendChild(j),!((v=j.sheet)==null?void 0:v.cssRules))return;const f=getDocument().createElement("style");if(s.appendChild(f),!!f.sheet)return copyAndScopeStyles(j.sheet,f.sheet,_),j.remove(),()=>f.remove()});return()=>F.forEach(j=>j==null?void 0:j())},[_,t.code,s,i]);const I=reactExports.useMemo(()=>t.code.replaceAll(/)<[^<]*)*<\/script>/gi,"").replaceAll(/)<[^<]*)*<\/style>/gi,""),[t.code]);return jsx("div",{id:e,ref:r,dangerouslySetInnerHTML:{__html:I},style:l,onClick:c,onMouseEnter:h,onMouseLeave:m})});CustomCodeNode.displayName="CustomCodeNode";function copyAndScopeStyles(e,t,r){for(const n of e.cssRules)if(n instanceof CSSStyleRule){const i=addScopeToSelector(n.selectorText,r);t.insertRule(`${i} { ${n.style.cssText} }`,t.cssRules.length)}else t.insertRule(n.cssText)}var webfontloader={exports:{}},hasRequiredWebfontloader;function requireWebfontloader(){return hasRequiredWebfontloader||(hasRequiredWebfontloader=1,function(e){(function(){function t(E,Z,se){return E.call.apply(E.bind,arguments)}function r(E,Z,se){if(!E)throw Error();if(2=Z.f?Te():E.fonts.load(v(Z.a),Z.h).then(function(Fe){1<=Fe.length?ye():setTimeout(be,25)},function(){Te()})}be()}),L=null,pe=new Promise(function(ye,Te){L=setTimeout(Te,Z.f)});Promise.race([pe,k]).then(function(){L&&(clearTimeout(L),L=null),Z.g(Z.a)},function(){Z.j(Z.a)})};function ae(E,Z,se,k,L,pe,ye){this.v=E,this.B=Z,this.c=se,this.a=k,this.s=ye||"BESbswy",this.f={},this.w=L||3e3,this.u=pe||null,this.m=this.j=this.h=this.g=null,this.g=new T(this.c,this.s),this.h=new T(this.c,this.s),this.j=new T(this.c,this.s),this.m=new T(this.c,this.s),E=new f(this.a.c+",serif",C(this.a)),E=W(E),this.g.a.style.cssText=E,E=new f(this.a.c+",sans-serif",C(this.a)),E=W(E),this.h.a.style.cssText=E,E=new f("serif",C(this.a)),E=W(E),this.j.a.style.cssText=E,E=new f("sans-serif",C(this.a)),E=W(E),this.m.a.style.cssText=E,Y(this.g),Y(this.h),Y(this.j),Y(this.m)}var D={D:"serif",C:"sans-serif"},ne=null;function xe(){if(ne===null){var E=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);ne=!!E&&(536>parseInt(E[1],10)||parseInt(E[1],10)===536&&11>=parseInt(E[2],10))}return ne}ae.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=i(),Ee(this)};function $e(E,Z,se){for(var k in D)if(D.hasOwnProperty(k)&&Z===E.f[D[k]]&&se===E.f[D[k]])return!0;return!1}function Ee(E){var Z=E.g.a.offsetWidth,se=E.h.a.offsetWidth,k;(k=Z===E.f.serif&&se===E.f["sans-serif"])||(k=xe()&&$e(E,Z,se)),k?i()-E.A>=E.w?xe()&&$e(E,Z,se)&&(E.u===null||E.u.hasOwnProperty(E.a.c))?ge(E,E.v):ge(E,E.B):we(E):ge(E,E.v)}function we(E){setTimeout(n(function(){Ee(this)},E),50)}function ge(E,Z){setTimeout(n(function(){m(this.g.a),m(this.h.a),m(this.j.a),m(this.m.a),Z(this.a)},E),0)}function ve(E,Z,se){this.c=E,this.a=Z,this.f=0,this.m=this.j=!1,this.s=se}var Ie=null;ve.prototype.g=function(E){var Z=this.a;Z.g&&b(Z.f,[Z.a.c("wf",E.c,C(E).toString(),"active")],[Z.a.c("wf",E.c,C(E).toString(),"loading"),Z.a.c("wf",E.c,C(E).toString(),"inactive")]),K(Z,"fontactive",E),this.m=!0,De(this)},ve.prototype.h=function(E){var Z=this.a;if(Z.g){var se=S(Z.f,Z.a.c("wf",E.c,C(E).toString(),"active")),k=[],L=[Z.a.c("wf",E.c,C(E).toString(),"loading")];se||k.push(Z.a.c("wf",E.c,C(E).toString(),"inactive")),b(Z.f,k,L)}K(Z,"fontinactive",E),De(this)};function De(E){--E.f==0&&E.j&&(E.m?(E=E.a,E.g&&b(E.f,[E.a.c("wf","active")],[E.a.c("wf","loading"),E.a.c("wf","inactive")]),K(E,"active")):re(E.a))}function qe(E){this.j=E,this.a=new J,this.h=0,this.f=this.g=!0}qe.prototype.load=function(E){this.c=new s(this.j,E.context||this.j),this.g=E.events!==!1,this.f=E.classes!==!1,Be(this,new A(this.c,E),E)};function Je(E,Z,se,k,L){var pe=--E.h==0;(E.f||E.g)&&setTimeout(function(){var ye=L||null,Te=k||null||{};if(se.length===0&&pe)re(Z.a);else{Z.f+=se.length,pe&&(Z.j=pe);var be,Fe=[];for(be=0;bet("GET","/fonts",{}),initialData:e.fonts,staleTime:1/0})}function loadGoogleFont(e){return webfontloaderExports.load({google:{families:[`${e}:400,500,600,700,800,900`]}}),e}const fontVariantMap={normal300:{style:"normal",weight:"300"},normal400:{style:"normal",weight:"400"},normal500:{style:"normal",weight:"500"},normal600:{style:"normal",weight:"600"},normal700:{style:"normal",weight:"700"},normal800:{style:"normal",weight:"800"},normal900:{style:"normal",weight:"900"},italic300:{style:"italic",weight:"300"},italic400:{style:"italic",weight:"400"},italic500:{style:"italic",weight:"500"},italic600:{style:"italic",weight:"600"},italic700:{style:"italic",weight:"700"},italic800:{style:"italic",weight:"800"},italic900:{style:"italic",weight:"900"}};function loadCustomFont(e){const t=`Alia-${e.name.replace(/ /g,"-")}`;return n(t,e).forEach(async i=>{try{await i.load().catch(),getDocument().fonts.add(i)}catch(s){console.error(`Alia failed to load ${e.name} ${i.weight} (${i.style}): ${s}`)}}),t;function n(i,s){const l=[];for(const c in fontVariantMap){const h=s[c],m=fontVariantMap[c];h&&l.push(new FontFace(i,h,m))}return l}}function useLoadFonts(e){const{data:t}=useGetAllFonts(),r=reactExports.useCallback((n,i,s)=>{const l=t==null?void 0:t.find(h=>h.name===n),c=l?loadCustomFont(l):loadGoogleFont(n);s.default.appendStyles(e,{[i]:`${c}, sans-serif`})},[t,e]);return reactExports.useCallback((n,i)=>{r(n.body,dumpFontVariable("--body-font"),i),r(n.display,dumpFontVariable("--display-font"),i);for(let s=0;s{var b,S,w;if(!i)return;loadColors((t==null?void 0:t.colors)??i.colors,n,l),loadBorderRadius((t==null?void 0:t.borderRadius)??i.borderRadius,n,l),s((t==null?void 0:t.fonts)??i.fonts,l);const c={text:((b=t==null?void 0:t.styles)==null?void 0:b.text)??i.styles.text,button:((S=t==null?void 0:t.styles)==null?void 0:S.button)??i.styles.button,input:((w=t==null?void 0:t.styles)==null?void 0:w.input)??i.styles.input};loadStyles(c,n,l);const m=(_=>_.text.find(I=>I.handle===BODY_DEFAULT_HANDLE))(c);m&&l.appendBreakpoint(n,m.styles)},[t,n,s,i]))}function loadColors(e,t,r){const{primary:n,accent:i,background:s,accentForeground:l}=e;r.default.appendStyles(t,{"--accent-foreground":hexToRGB(l),"--accent-color":hexToRGB(i),"--primary-color":hexToRGB(n),"--background-color":hexToRGB(s)});for(let c=0;c(parseInt(P)+j).toString();N==="body"?r.default.appendStyles(t,{[`--${N}-font-weight-normal`]:P,[`--${N}-font-weight-medium`]:P,[`--${N}-font-weight-semibold`]:F(100),[`--${N}-font-weight-bold`]:F(200)}):r.default.appendStyles(t,{[`--${N}-font-weight-normal`]:F(-100),[`--${N}-font-weight-medium`]:F(-100),[`--${N}-font-weight-semibold`]:P,[`--${N}-font-weight-bold`]:F(100)})}function w(N,P="1.1"){r.default.appendStyles(t,{[`--${N}-line-height-xs`]:P,[`--${N}-line-height-sm`]:P,[`--${N}-line-height-base`]:P,[`--${N}-line-height-lg`]:P,[`--${N}-line-height-xl`]:P})}function _(N,P="0px"){r.default.appendStyles(t,{[`--${N}-letter-spacing`]:P})}}}const{Provider:Provider$7,useContext:useContext$6}=createContextWithDefault({modal:!1}),useModalContext=useContext$6,Modal=({show:e,onClose:t,children:r,title:n,showCloseButton:i=!0})=>e?jsx(Provider$7,{value:{modal:!0},children:jsx("div",{className:"absolute top-0 right-0 bottom-0 left-0 backdrop-blur-sm backdrop-brightness-75 rounded-lg flex flex-col justify-center items-center z-50",children:jsxs("div",{className:"w-5/6 animate-fade-in-up animation-duration-150 max-w-sm p-5 bg-background shadow-2xl rounded-lg flex flex-col",children:[jsxs("div",{className:"w-full flex justify-between items-start gap-2 mb-2",children:[jsx("p",{className:"text-lg font-medium leading-6",children:n}),i&&jsx(Icon,{icon:"close",className:"text-display-sm cursor-pointer leading-4",onClick:t})]}),jsx("div",{className:"w-full flex flex-col flex-1",children:r})]})})}):null,CustomRewardCTA=({config:e})=>{var r,n;const t=(r=e.cta)==null?void 0:r.url;return t?jsx(Button,{onClick:()=>window.open(t,"_parent"),variant:"primary",children:(n=e.cta)==null?void 0:n.text}):null},ClaimedRewardProduct=({id:e,title:t})=>{const{data:r}=useGetProductUrl({id:e});return jsx(Button,{inline:!0,variant:"plain",onClick:()=>window.open(r,"_blank"),children:t})},DiscountItems=({items:e})=>e.type==="all"?null:e.customDescriptor?jsx(CustomDescriptor,{descriptor:e.customDescriptor}):e.type==="products"?jsxs("div",{className:"text-center",children:[e.products.slice(0,2).map((t,r)=>jsxs(reactExports.Fragment,{children:[r>0&&e.products.length>2&&", ",e.products.length>1&&r===e.products.length-1&&" and ",jsx(CommonErrorBoundary,{fallback:jsx("span",{children:t.title}),children:jsx(reactExports.Suspense,{fallback:jsx("span",{children:t.title}),children:jsx(ClaimedRewardProduct,{...t})})})]},t.id)),e.products.length>2&&jsxs("span",{children:[" ","and ",e.products.length-2," more"," ",e.products.length===1?"product":"products"]})]}):jsx(Fragment,{children:getCollectionsDescriptor(e)}),CustomDescriptor=({descriptor:{url:e,descriptor:t}})=>e?jsx(Button,{inline:!0,variant:"plain",onClick:()=>window.open(e,"_parent"),children:t}):jsx("span",{children:t});function useRewardExpirationTimer(e){const t=reactExports.useMemo(()=>{if(!e)return;const s=(new Date(e).getTime()-Date.now())/1e3;return Math.max(0,Math.floor(s))},[e]),[r,n]=reactExports.useState(t??0);return reactExports.useEffect(()=>{t!==void 0&&n(t)},[t]),reactExports.useEffect(()=>{if(!e)return;const i=setInterval(()=>{n(s=>Math.max(0,s-1))},1e3);return()=>clearInterval(i)},[e]),r}const DANGER_THRESHOLD_SECS=5*60,ExpirationCountDown=({expiresAt:e})=>{const t=useRewardExpirationTimer(e),r=getTimeRemainingStr(t);return e?jsxs("div",{className:classNames("flex flex-col items-center gap-2",t{const{data:r}=useGetMerchant(),{data:n}=useGetUser(),i=getRewardConfigProperty(e.config,"hideDiscountCode"),{data:s}=useGetIsOptedIn(i==="email"&&n.hasEmail?"email":i==="sms"&&n.hasPhone?"phone":void 0),l=s===!1,c=e.config.type==="discount"?e.config.discount.items.type==="all"?null:jsx(DiscountItems,{items:e.config.discount.items}):e.config.type==="freeShipping"?getFreeShippingQualifiers(e.config.freeShipping,r.shopInfo).toLowerCase():e.config.type==="custom"?null:assertNever(e.config),h=e.config.type==="discount"?e.config.discount.customQualifierText?null:getDiscountPriceQualifiers(e.config.discount,r.shopInfo):e.config.type==="custom"?e.config.custom.subtitle:null,m=e.config.type==="discount"?e.config.discount.customQualifierText||getDiscountStackingQualifiers(e.config.discount):void 0;return jsx(Modal,{show:!0,showCloseButton:!!t,onClose:t,children:jsxs("div",{className:"flex flex-col gap-6 mt-2 justify-center items-center flex-1",children:[jsxs("div",{className:"flex flex-col gap-2.5",children:[jsx("div",{className:"text-center",children:"Congrats! You've earned"}),jsxs("div",{className:"space-y-2",children:[jsx("div",{className:"text-center text-display-xl",children:getRewardText(e.config,r.shopInfo)}),c&&jsx("div",{className:"text-center text-sm",children:c}),h&&jsx("div",{className:"text-primary-500 text-sm text-center",children:h})]})]}),l?jsxs(Fragment,{children:[jsx(ClaimedRewardDivider,{}),jsx("div",{className:"text-center flex flex-col gap-1.5",children:i==="email"?jsxs(Fragment,{children:[jsx("div",{children:"We've sent your discount code to the email you provided"}),jsx("div",{className:"text-primary-500 text-xs",children:"If you don't see it, check your spam folder"})]}):jsxs(Fragment,{children:[jsx("div",{className:"text-display",children:"Check your texts"}),jsxs("div",{className:"text-sm font-normal",children:[jsx("span",{className:"font-bold",children:'Reply "Y"'})," to receive your discount code"]})]})}),jsx(ClaimedRewardDivider,{})]}):e.used?jsx("div",{className:"text-center",children:"You've already used this reward."}):jsx(Fragment,{children:jsx(ShopifyCode,{claimedReward:e,onClose:t})}),e.config.type==="custom"&&jsx(CustomRewardCTA,{config:e.config.custom}),jsx(ExpirationCountDown,{expiresAt:e.expiresAt}),m&&jsx("div",{className:"text-primary-400 text-xs leading-4 text-center",children:m})]})})},ClaimedRewardDivider=()=>jsx("div",{className:"self-center w-2/3 h-px bg-accent-100 -my-1"}),DivNode=reactExports.forwardRef(({id:e,node:t,children:r},n)=>useIsRootNode()?jsx(PopupRoot,{node:t,id:e,ref:n,children:r}):jsx(DivNodeInner,{id:e,node:t,ref:n,children:r}));DivNode.displayName="DivNode";const DivNodeInner=reactExports.forwardRef(({id:e,node:t,children:r,styles:n},i)=>{var b;const{styles:s,onClick:l,onMouseEnter:c,onMouseLeave:h}=usePreviewNodeContext(),m=useExecutePopupActions(t.onClickActions);return jsx("div",{id:e,ref:i,className:classNames((b=t.styles)==null?void 0:b.classes),style:{...s,...n},onClick:l??(S=>{var w;(w=t.onClickActions)!=null&&w.length&&S.target instanceof HTMLDivElement&&S.target.id===e&&(m(),S.stopPropagation())}),onMouseEnter:c,onMouseLeave:h,children:r})});DivNodeInner.displayName="DivNodeInner";const rootNodeStyles={inset:"unset",top:"unset",left:"unset",right:"unset",bottom:"unset",zIndex:"unset",width:"100%",height:"100%",maxWidth:"unset",maxHeight:"unset",minWidth:"unset",minHeight:"unset",rotate:"unset",transform:"unset",transformOrigin:"unset"},PopupRoot=reactExports.forwardRef(({node:e,id:t,children:r},n)=>{const{template:i,onClosePopup:s}=usePopupContext(),{setFrameStyles:l,setVisible:c}=useCustomerAppContext(),{sizeOverride:h}=usePopupPreviewContext(),m=`alia-popup-root-${t}`;useNewTheme(`#${m}`,i.themeOverride);const b=useClaimedReward(),S=useBreakpoint(),{preview:w}=useCustomerAppContext(),_=reactExports.useMemo(()=>{var v,g,C,$;const P=((g=(v=e.styles)==null?void 0:v.default)==null?void 0:g.default)??{},F=(($=(C=e.styles)==null?void 0:C[1024])==null?void 0:$.default)??{},j=S==="default"?P:{...P,...F},q=Object.keys(rootNodeStyles),f=Object.fromEntries(Object.entries(j).filter(([R])=>q.includes(R)));return Object.fromEntries(Object.entries(f).map(([R,A])=>[R,transformCSSValue(A,h)]))},[S,e.styles,h]);reactExports.useEffect(()=>{const{modal:P}=e.rootOptions??DEFAULT_ROOT_OPTIONS,F=P!=null&&P.hideOverflow?{overflow:"hidden"}:{};return l({modal:!!P,styles:{..._,zIndex:w?void 0:_.zIndex},bodyStyles:F})},[l,_,e,w]),reactExports.useEffect(()=>(c(!0),()=>c(!1)),[c]);const[I,N]=reactExports.useState(!1);return reactExports.useEffect(()=>{var F;const P=(F=detect())==null?void 0:F.os;I||P&&P!=="iOS"||setTimeout(()=>{N(!0)},25)},[I]),jsxs("div",{id:m,className:"w-full h-full",children:[jsx(CommonErrorBoundary,{children:jsxs(reactExports.Suspense,{children:[b&&b.config.showModal!==!1&&jsx(ClaimedReward,{claimedReward:b,onClose:()=>s({type:"oldClaimedRewardModal"})}),jsx(Toast,{})]})}),jsx(DivNodeInner,{id:t,node:e,ref:n,styles:rootNodeStyles,children:r},I?1:0)]})});PopupRoot.displayName="PopupRoot";function getFormattedCountdown({args:e,start:t=Date.now()}){const r=s();if(!r)return i(30);const n=Math.max(0,Math.round((r-Date.now())/1e3));return i(n);function i(l){const c=Math.floor(l/86400);l%=86400;const h=Math.floor(l/3600);l%=3600;const m=Math.floor(l/60);return l%=60,c>0?`${c}d ${h}h ${m}m`:h>0?`${h}h ${m}m`:`${m}:${l.toString().padStart(2,"0")}`}function s(){if(e.endOf)return c(e.endOf).getTime();if(e.date){const h=typeof e.date=="function"?new Date(e.date()):new Date(e.date);return isNaN(h.getTime())?null:h.getTime()}const l=(e.hours??0)*3600+(e.mins??0)*60+(e.secs??0);if(l>0)return t+l*1e3;return null;function c(h){const m=new Date(t);if(h==="minute")return new Date(m.getFullYear(),m.getMonth(),m.getDate(),m.getHours(),m.getMinutes()+1);if(h==="hour")return new Date(m.getFullYear(),m.getMonth(),m.getDate(),m.getHours()+1);if(h==="day")return new Date(m.getFullYear(),m.getMonth(),m.getDate()+1);if(h==="week"){const b=7-m.getDay();return new Date(m.getFullYear(),m.getMonth(),m.getDate()+b)}else return h==="month"?new Date(m.getFullYear(),m.getMonth()+1,1):new Date(m.getFullYear()+1,0)}}}function evalTemplateStrings({text:e,values:t,$alia:r,countdown:n}){if(!e)return"";const i=Object.entries(t).filter(([s])=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s)).map(([s,l])=>l==null?`const ${s} = null;`:`const ${s} = ${JSON.stringify(String(l))};`).join(` `);return e.replace(/\{\{(.*?)\}\}/g,(s,l)=>{const h=l.trim().replace(/\\_/g,"_").replace(/\\\[/g,"["),m=safeEval(`({ $alia, countdown }) => { ${i} return ${h} }`);try{const b=m({$alia:r,countdown:n});return b==null?"":String(b)}catch(b){return logger.error("Error evaluating template string",b),oldInject(e,t)}})}function oldInject(e,t){return e.replace(/{{([^}]+)}}/g,(r,n)=>{const i=n.trim(),s=i.replace(/\\_/g,"_"),l=t[i]??t[s];return(l==null?void 0:l.toString())??""})}const{Provider:Provider$6,useContext:useContext$5}=createContextWithDefault({}),TextVariablesProvider=({children:e,...t})=>{const r=useContext$5();return jsx(Provider$6,{value:{...r,...t},children:e})};function useEvalTemplateStrings(){const{isPreview:e}=usePopupPreviewContext(),t=useClaimedReward(),{$alia:r}=useAliaObject(),n=useContext$5(),i=useCountdown(),s=reactExports.useMemo(()=>{const l=c=>e?c:"";return{question_text:l("question_text"),answer_text:l("answer_text"),sms_consent:l("sms_consent"),...n,discount_code:(t==null?void 0:t.shopifyCode)??l("discount_code"),discount_expiration:t!=null&&t.expiresAt?i({date:t.expiresAt}):l("discount_expiration")}},[e,n,t,i]);return reactExports.useCallback(l=>evalTemplateStrings({text:l,values:s,$alia:r,countdown:i}),[s,r,i])}let start;function useCountdown(){const[e,t]=reactExports.useState(0),r=reactExports.useRef(null);return reactExports.useEffect(()=>()=>{r.current&&clearInterval(r.current)},[]),reactExports.useCallback(n=>(start||(start=Date.now()),r.current||(r.current=setInterval(()=>{t(i=>i+1)},1e3)),getFormattedCountdown({args:n,start})),[e])}const{Provider:Provider$5,useContext:useContext$4}=createContextWithoutDefault("question-node"),useQuestionNodeContext=useContext$4,QuestionNode=({node:e,children:t})=>jsx(TextVariablesProvider,{question_text:e.questionText,children:jsx(Provider$5,{value:{uuid:e.uuid,questionText:e.questionText},children:t})}),CHECKABLE_PREFIX="checkable_";function getCheckableAnswerName({questionUUID:e,answerUUID:t}){return`${CHECKABLE_PREFIX}${e}_${t}`}function getCheckableAnswerNameData(e){if(!e.startsWith(CHECKABLE_PREFIX))return;const[t,r]=e.split("_").slice(1);return{questionUUID:t,answerUUID:r}}function getAllCheckedAnswersInForm(e){const t=Object.entries(e).map(([i,s])=>r(i,s)).filter(Boolean);return{error:n(e),answers:t};function r(i,s){const l=getCheckableAnswerNameData(i);if(!l||!s)return;const{questionText:c,answer:h,checked:m}=s;if(m)return{questionUUID:l.questionUUID,questionText:c,answerUUID:l.answerUUID,answer:h}}function n(i){const s=Array.from(new Set(Object.keys(i).map(l=>getCheckableAnswerNameData(l)).filter(Boolean).map(l=>l.questionUUID)));if(s.some(l=>!t.some(c=>c.questionUUID===l)))return s.length===1?"Please choose an answer":"Please answer all questions"}}const CheckableAnswerController=({answerUUID:e,answer:t,render:r})=>{const{uuid:n,questionText:i}=useQuestionNodeContext(),s=getCheckableAnswerName({questionUUID:n,answerUUID:e}),{control:l}=useFormContext();return jsx(Controller,{name:s,control:l,shouldUnregister:!0,render:({field:c,fieldState:h,formState:m})=>{var b;return r({field:{...c,value:((b=c.value)==null?void 0:b.checked)??!1,onChange:S=>{typeof S=="boolean"&&c.onChange({questionText:i,answer:t,checked:S})}},fieldState:h,formState:m})}})},SINGLE_ANSWER_PREFIX="single_answer_";function getSingleAnswerName({questionUUID:e}){return`${SINGLE_ANSWER_PREFIX}${e}`}function getSingleAnswerNameData(e){return e.startsWith(SINGLE_ANSWER_PREFIX)?{questionUUID:e.slice(SINGLE_ANSWER_PREFIX.length)}:void 0}function getAllSingleAnswersInForm(e){return{error:void 0,answers:Object.entries(e).map(([n,i])=>r(n,i)).filter(Boolean)};function r(n,i){const s=getSingleAnswerNameData(n);if(!(!s||i==null||i===""))return{questionUUID:s.questionUUID,...i}}}const SingleAnswerController=({answerUUIDFactory:e,render:t,validationMessages:r})=>{const{uuid:n,questionText:i}=useQuestionNodeContext(),s=getSingleAnswerName({questionUUID:n}),{control:l,formState:{errors:c}}=useFormContext();return jsx(Controller,{name:s,control:l,rules:{required:!0},render:({field:h,fieldState:m,formState:b})=>{var S;return jsx(FormItem,{label:"",error:c[s],validationMessages:r,children:t({field:{...h,value:((S=h.value)==null?void 0:S.answer)??"",onChange:w=>{h.onChange({questionText:i,answer:w,answerUUID:e==null?void 0:e(w)})}},fieldState:m,formState:b})})}})};function getAllAnswersInForm(e){try{const{error:t,answers:r}=getAllCheckedAnswersInForm(e),{error:n,answers:i}=getAllSingleAnswersInForm(e);return t||n?{error:t||n,answers:[]}:{error:void 0,answers:[...r,...i]}}catch(t){return console.error(t),{error:void 0,answers:[]}}}const FORMATS={"DD-MM":{name:"date",regex:new RegExp(/^(0[1-9]|[12][0-9]|3[01])-(0[1-9]|1[0-2])$/),pattern:"##-##",autoComplete:"bday"},"MM-DD":{name:"date",regex:new RegExp(/^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/),pattern:"##-##",autoComplete:"bday"},"DD-MM-YYYY":{name:"date",regex:new RegExp(/^(0[1-9]|[12][0-9]|3[01])-(0[1-9]|1[0-2])-(19|20)\d{2}$/),pattern:"##-##-####",autoComplete:"bday"},"MM-DD-YYYY":{name:"date",regex:new RegExp(/^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])-(19|20)\d{2}$/),pattern:"##-##-####",autoComplete:"bday"},"YYYY-MM-DD":{name:"date",regex:new RegExp(/^(19|20)\d{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/),pattern:"####-##-##",autoComplete:"bday"},"DD/MM":{name:"date",regex:new RegExp(/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])$/),pattern:"##/##",autoComplete:"bday"},"MM/DD":{name:"date",regex:new RegExp(/^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])$/),pattern:"##/##",autoComplete:"bday"},"DD/MM/YYYY":{name:"date",regex:new RegExp(/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/(19|20)\d{2}$/),pattern:"##/##/####",autoComplete:"bday"},"MM/DD/YYYY":{name:"date",regex:new RegExp(/^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/(19|20)\d{2}$/),pattern:"##/##/####",autoComplete:"bday"},"YYYY/MM/DD":{name:"date",regex:new RegExp(/^(19|20)\d{2}\/(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])$/),pattern:"####/##/##",autoComplete:"bday"},"ZIP-5":{name:"ZIP code",regex:new RegExp(/^\d{5}$/),pattern:"#####",autoComplete:"postal-code"}},FreeTextNode=reactExports.forwardRef(({id:e,className:t,node:r,sharedStyle:n},i)=>{const s=r.format?FORMATS[r.format]:void 0,{register:l,formState:{errors:c}}=useFormContext(),h=getFieldName(r.name),m=!r.optional;return jsx(FormItem,{label:r.label,required:m,error:c[h],validationMessages:r.validationMessages,ref:i,children:r.multiline?reactExports.createElement(TextArea,{id:e,className:t,...l(h,{required:m,shouldUnregister:!0}),key:h,placeholder:r.placeholder,error:!!c[h],sharedStyle:n}):s?reactExports.createElement(FormattedInput,{id:e,className:t,format:s.pattern,placeholder:r.placeholder,autoComplete:s.autoComplete,...l(h,{required:m,shouldUnregister:!0,pattern:{value:s.regex,message:`Invalid ${s.name}`},validate:b=>{var S;return validateAge((S=r.validationMessages)==null?void 0:S.minAge,b)}}),key:h,error:!!c[h],sharedStyle:n}):reactExports.createElement(Input,{id:e,className:t,...l(h,{required:m,shouldUnregister:!0}),key:h,placeholder:r.placeholder,error:!!c[h],sharedStyle:n})})});FreeTextNode.displayName="FirstNameInput";const PROPERTY_NAME_PREFIX="property_",getFieldName=e=>PROPERTY_NAME_PREFIX+encodeForRHF(e),getPropertyName=e=>decodeForRHF(e.replace(PROPERTY_NAME_PREFIX,""));function encodeForRHF(e){return encodeURIComponent(e).replace(/[']/g,"%27").replace(/["]/g,"%22").replace(/[`]/g,"%60")}function decodeForRHF(e){return decodeURIComponent(e).replace(/%27/g,"'").replace(/%22/g,'"').replace(/%60/g,"`")}function getAllProperties(e){return Object.entries(e).reduce((t,[r,n])=>(r.startsWith(PROPERTY_NAME_PREFIX)&&(t[getPropertyName(r)]=n),t),{})}function validateAge(e,t){if(!e)return;const{age:r,message:n}=e,i=new Date(t.replace(/-/g,"/"));if(isNaN(i.getTime()))return"Invalid date";const s=new Date,l=s.getFullYear()-i.getFullYear(),c=s.getMonth()-i.getMonth(),h=s.getDate()-i.getDate();if(l{var f;const i=reactExports.useRef(null);reactExports.useImperativeHandle(n,()=>i.current,[]);const s=useForm(),{handleSubmit:l,formState:{isSubmitting:c,errors:h},setError:m}=s,b=useSetProfile(),{data:S}=useGetUser(),w=useExecutePopupActions(),_=useCreateManyPollAnswers(),I=useCustomerAppContext().preview!==void 0,{onClick:N,styles:P,onMouseEnter:F,onMouseLeave:j}=usePreviewNodeContext();return jsx(Provider$4,{value:{isSubmitting:c,submit:()=>{var v,g;return(g=(v=i.current)==null?void 0:v.requestSubmit)==null?void 0:g.call(v)}},children:jsx(FormProvider,{...s,children:jsxs("form",{id:e,onSubmit:l(async v=>{var g,C,$;if(!I)try{const{error:R,answers:A}=getAllAnswersInForm(v);if(R){m("root",{message:t.errorMessage||R});return}A&&A.length>0&&await _({answers:A});const M=v.name||S.name,re=(g=v.email)==null?void 0:g.toLowerCase(),K=v.phone,J={...getAllProperties(v),...Object.fromEntries(((C=t.submitProperties)==null?void 0:C.map(Y=>[Y.key,Y.value]))??[])};if(!M&&!re&&!K&&Object.keys(J).length===0){await w(t.afterSubmit);return}const{validationError:ee,results:T}=await b.mutateAsync({shouldSubscribe:t.subscribeImmediately,name:M,email:re,phone:K,source:{type:"popup"},properties:J,integrationOverrides:t.integrationOverrides,resultTypes:($=t.afterSubmitBranches)==null?void 0:$.map(Y=>Y.if.type)});if(ee){m(ee.field,{message:ee.message});return}for(const{if:Y,then:W}of t.afterSubmitBranches??[])if(W.length>0&&T.some(oe=>oe.type===Y.type&&oe.result===Y.result)){await w(W);return}await w(t.afterSubmit)}catch(R){console.error(R)}}),className:classNames("flex flex-col gap-3",(f=t.styles)==null?void 0:f.classes),ref:i,style:P,onClick:N,onMouseEnter:F,onMouseLeave:j,children:[h.root&&jsxs("div",{className:"bg-accent-900 text-accent-foreground p-3 rounded-lg flex items-center gap-2",children:[jsx(Icon,{icon:"error"}),h.root.message]}),r]})})})});FormNode.displayName="PopupForm";const Checkbox=reactExports.forwardRef(({value:e=!1,text:t,onChange:r,disabled:n=!1,...i},s)=>jsxs("label",{className:"gap-2 flex items-center relative",ref:s,...i,children:[jsx("input",{type:"checkbox",style:{width:"1em",height:"1em"},className:classNames("flex-shrink-0 appearance-none rounded border-2 border-accent-200 checked:border-accent-400 cursor-pointer disabled:cursor-default disabled:opacity-50","peer text-accent outline-none checked:bg-accent-800 transition-all duration-150 focus:ring-2 ring-accent-300"),disabled:n,checked:e,onChange:l=>{r(l.target.checked)}}),jsx(Icon,{icon:"checkmark",style:{width:"1em",height:"1em"},className:"invisible peer-checked:visible flex absolute justify-center items-center text-accent-foreground cursor-pointer"}),t]}));Checkbox.displayName="Checkbox";const DEFAULT_NAME="_yesNoCheckbox",YesNoCheckbox=reactExports.forwardRef(({id:e,node:t,children:r},n)=>{var m;const{control:i}=useFormContext(),{styles:s,onClick:l,onMouseEnter:c,onMouseLeave:h}=usePreviewNodeContext();return jsx(Controller,{name:t.name??DEFAULT_NAME,control:i,shouldUnregister:!0,rules:{required:(m=t.required)==null?void 0:m.message},render:({field:b,fieldState:S})=>{var w;return jsxs(Fragment,{children:[jsx(Checkbox,{id:e,value:b.value??!1,onChange:_=>b.onChange(_),className:classNames((w=t.styles)==null?void 0:w.classes,SHARED_STYLE_CLASSNAME(t.sharedStyle)),style:s,ref:n,onClick:l,onMouseEnter:c,onMouseLeave:h,text:r}),S.error&&jsx("p",{className:"text-red-700 text-xs",children:S.error.message})]})}})});YesNoCheckbox.displayName="YesNoCheckbox";function useElementDims(e){const[t,r]=reactExports.useState(0),[n,i]=reactExports.useState(0);return reactExports.useEffect(()=>{if(!(e!=null&&e.current))return;const s=new ResizeObserver(()=>{var l,c;r(((l=e.current)==null?void 0:l.clientWidth)??0),i(((c=e.current)==null?void 0:c.clientHeight)??0)});return s.observe(e.current),()=>s.disconnect()},[e]),{width:t,height:n}}const INIT_DEG=-20,REV_PER_SECOND=3,SpinToWin=reactExports.forwardRef(({id:e,node:t,children:r},n)=>{const[i,s]=reactExports.useRef(P()).current,l=360/t.slices.length,c=reactExports.useRef(null);reactExports.useImperativeHandle(n,()=>c.current);const h=reactExports.useRef(null),{width:m}=useElementDims(c),b=c.current?parseFloat(getComputedStyle(c.current).borderWidth):0,S=m*.46875,w=useExecutePopupActions(),[_,I]=reactExports.useState(!1);return jsxs(Fragment,{children:[jsxs("div",{id:e,ref:c,className:"relative cursor-pointer",onClick:()=>I(!0),onContextMenu:()=>!1,children:[jsx("div",{ref:h,onAnimationEnd:()=>{setTimeout(()=>{w(s.actions)},t.waitDuration*1e3)},className:"w-full h-full relative overflow-hidden bg-transparent rounded-full select-none border-none",style:{borderWidth:b,transform:`rotate(${INIT_DEG}deg)`,animation:_?`spin ${t.spinDuration}s cubic-bezier(0.42, 0.8, 0.74, 1) 1 forwards`:void 0},children:t.slices.map((j,q)=>jsx(Slice,{node:t,index:q,size:m},j.uuid))}),jsx(Arrow,{size:m}),jsx("div",{className:"absolute inset-0 m-auto rounded-full z-20",style:{width:S,height:S},children:r})]}),jsx("style",{children:` @keyframes spin { from { transform: rotate(${INIT_DEG}deg); } to { transform: rotate(${F(i)}deg); } } `})]});function P(){const j=Math.random();let q=0;for(let v=0;vv.probability>0);return f===-1?[0,t.slices[0]]:[f,t.slices[f]]}function F(j){const q=Math.random()*l-l/2,f=j*l+q*.8;return REV_PER_SECOND*t.spinDuration*360-f}});SpinToWin.displayName="SpinToWin";const Slice=({node:e,index:t,size:r})=>{const n=360/e.slices.length,i=n*t,s=e.slices[t],l=t%2===0,c=r*(l?-.140625:-.09375);return jsx("div",{className:"w-0 h-0 absolute left-0 right-0 m-auto border-transparent border-solid",style:{borderLeftWidth:r*.22*(n/45),borderRightWidth:r*.22*(n/45),borderTopWidth:r*.5,transform:`rotate(${i}deg)`,borderTopColor:`rgb(${l?"var(--accent-color)":"255 255 255"})`,transformOrigin:"50% 100%",zIndex:l?1:0},children:jsx("div",{className:"absolute text-center",style:{top:r*-.421875,left:c,right:c,color:`rgb(${l?"var(--accent-foreground)":"0 0 0"})`},children:h(s.text).map((m,b)=>jsxs(React.Fragment,{children:[m.toString(),jsx("br",{})]},b))})});function h(m){const b=m.trim().split(/\s+/),S=m.replace(/\s+/g,"").length;let w=1,_=1/0,I=0;for(let F=1;Fjsx("div",{className:"bg-primary-400 absolute left-0 right-0 m-auto",style:{width:e*.15625,height:e*.03125,top:e*-.046875},children:jsx("div",{className:"border-transparent border-solid border-t-white",style:{borderLeftWidth:e*.078125,borderRightWidth:e*.078125,borderTopWidth:e*.09375}})}),QuestionAnswerCheckboxNode=reactExports.forwardRef(({id:e,node:t},r)=>jsx(CheckableAnswerController,{answerUUID:t.uuid,answer:t.answerText,render:({field:n})=>jsx(Checkbox,{id:e,text:t.answerText,...n,ref:r})},e));QuestionAnswerCheckboxNode.displayName="QuestionAnswerCheckboxNode";const QuestionAnswerDropdownNode=reactExports.forwardRef(({id:e,node:t},r)=>{var m,b,S;const{styles:n,onClick:i,onMouseEnter:s,onMouseLeave:l}=usePreviewNodeContext(),c=(S=(b=(m=t.styles)==null?void 0:m.default)==null?void 0:b.default)==null?void 0:S.padding,h=reactExports.useRef(null);return jsx(SingleAnswerController,{validationMessages:t.validationMessages??{required:"Please choose an answer",invalid:"Please choose a valid answer"},answerUUIDFactory:w=>{var _;return(_=t.answers.find(I=>I.text===w))==null?void 0:_.uuid},render:({field:w})=>{const _=t.answers.find(I=>(I.value??I.text)===w.value);return jsxs("button",{type:"button",id:e,ref:r,style:n,onClick:i,onMouseEnter:s,onMouseLeave:l,className:"relative","aria-controls":"dropdown-menu","aria-haspopup":"listbox",onKeyDown:I=>{var N;I.key===" "&&((N=h.current)==null||N.showPicker())},children:[jsx("div",{className:"flex-1 text-start",children:(_==null?void 0:_.text)??t.placeholder??"Select an answer"}),jsx("div",{className:"flex items-center justify-center",children:jsx(Icon,{icon:"chevronDown"})}),jsxs("select",{...w,ref:I=>{h.current=I,w.ref(I)},onChange:I=>{w.onChange(I.target.value)},className:"opacity-0 absolute top-0 right-0 bottom-0 left-0 cursor-pointer",style:{padding:c},children:[jsx("option",{value:"",disabled:!0,children:t.placeholder??"Select an answer"}),t.answers.map(I=>jsx("option",{value:I.value??I.text,children:I.text},I.uuid))]})]})}})});QuestionAnswerDropdownNode.displayName="QuestionAnswerCheckboxNode";const QuestionAnswerNode=reactExports.forwardRef(({id:e,node:t},r)=>{const{uuid:n,questionText:i}=useQuestionNodeContext(),s=useCreatePollAnswer();return jsx(TextVariablesProvider,{answer_text:t.answerText,children:jsx(ButtonNode,{ref:r,id:e,node:t.button,onClick:async()=>(await s({questionUUID:n,questionText:i,answer:t.answerText,answerUUID:t.uuid}),!0)})})});QuestionAnswerNode.displayName="QuestionAnswerNode";const TextNode=reactExports.forwardRef(({id:e,node:t,children:r},n)=>{var w;const i=useEvalTemplateStrings(),{styles:s,onClick:l,onMouseEnter:c,onMouseLeave:h}=usePreviewNodeContext(),m=t.markdown?i(t.markdown):"",b=useHTMLFromMarkdown(m,t.inline),S=t.inline?"span":"div";return jsx(S,{id:e,ref:n,className:classNames(SHARED_STYLE_CLASSNAME(t.sharedStyle),(w=t.styles)==null?void 0:w.classes),style:s,onClick:l,onMouseEnter:c,onMouseLeave:h,dangerouslySetInnerHTML:r?void 0:{__html:b},children:r})});TextNode.displayName="TextNode";const CountdownNode=reactExports.forwardRef(({id:e,node:t},r)=>{const n=reactExports.useMemo(()=>{const i=t.target.type==="fixedTime"?{secs:t.target.secs,mins:t.target.mins,hours:t.target.hours}:t.target.type==="toDate"?{date:t.target.date}:t.target.type==="toEndOf"?{endOf:t.target.unit}:assertNever(t.target);return{type:"text",markdown:getTemplateString(getCountdownTemplateString(i)),styles:t.styles,sharedStyle:t.sharedStyle}},[t]);return jsx(TextNode,{id:e,node:n,ref:r})});CountdownNode.displayName="CountdownNode";const{Provider:Provider$3,useContext:useContext$3}=createContextWithDefault({}),usePreviewNodeContext=()=>useContext$3(),TemplateNodeContent=reactExports.forwardRef(({id:e,node:t,children:r,hasChildren:n,parentId:i},s)=>{var _,I,N,P,F;const{onNodeSelect:l,setHighlightedNode:c,isPreview:h}=usePopupPreviewContext(),{styles:m,onClick:b,onMouseEnter:S,onMouseLeave:w}=reactExports.useMemo(()=>({styles:l?{cursor:"default",pointerEvents:"all"}:{},onClick:j=>{e&&(j.stopPropagation(),l==null||l(e))},onMouseEnter:()=>{e&&(c==null||c(e))},onMouseLeave:()=>{e&&(c==null||c(i))}}),[e,l,i,c]);return jsx(Provider$3,{value:h?{styles:m,onClick:b,onMouseEnter:S,onMouseLeave:w}:{},children:t.type==="div"?jsx(DivNode,{id:e,node:t,ref:s,children:r}):t.type==="image"?jsx("img",{id:e,ref:s,src:t.source,alt:t.alt,className:classNames((_=t.styles)==null?void 0:_.classes),style:m,onClick:b,onMouseEnter:S,onMouseLeave:w}):t.type==="nameInput"?jsx(FirstNameInput,{id:e,ref:s,required:t.required,placeholder:t.placeholder,validationMessages:t.validationMessages,className:classNames((I=t.styles)==null?void 0:I.classes),sharedStyle:t.sharedStyle}):t.type==="emailInput"?jsx(EmailInput,{id:e,ref:s,required:t.required,placeholder:t.placeholder,validationMessages:t.validationMessages,className:classNames((N=t.styles)==null?void 0:N.classes),sharedStyle:t.sharedStyle}):t.type==="phoneInput"?jsx(PhoneInput,{id:e,ref:s,required:t.required,defaultCountryCode:t.defaultCountryCode,placeholder:t.placeholder,validationMessages:t.validationMessages,className:classNames((P=t.styles)==null?void 0:P.classes),sharedStyle:t.sharedStyle}):t.type==="freeText"?jsx(FreeTextNode,{id:e,node:t,ref:s,className:classNames((F=t.styles)==null?void 0:F.classes),sharedStyle:t.sharedStyle}):t.type==="yesNoCheckbox"?jsx(YesNoCheckbox,{id:e,ref:s,node:t,children:r}):t.type==="form"?jsx(FormNode,{id:e,node:t,ref:s,children:r}):t.type==="text"?jsx(TextNode,{id:e,node:t,ref:s,children:n?r:null}):t.type==="button"?jsx(ButtonNode,{id:e,node:t,ref:s,children:n?r:null}):t.type==="icon"?jsx(IconNode,{id:e,node:t,ref:s}):t.type==="break"?jsx("br",{}):t.type==="copy"?jsx(CopyNode,{id:e,node:t,ref:s}):t.type==="question"?jsx(QuestionNode,{node:t,children:r}):t.type==="questionAnswer"?jsx(QuestionAnswerNode,{id:e,node:t,ref:s}):t.type==="questionAnswerCheckbox"?jsx(QuestionAnswerCheckboxNode,{id:e,node:t,ref:s}):t.type==="questionAnswerDropdown"?jsx(QuestionAnswerDropdownNode,{id:e,node:t,ref:s}):t.type==="customCode"?jsx(CustomCodeNode,{id:e,node:t}):t.type==="outlet"?jsx(OutletNode,{parentId:i}):t.type==="lessons"?jsx(EducationSignUpSettingsProvider,{value:t.signUp,children:jsx(Lessons,{config:t.config,preview:t.preview})}):t.type==="tracks"?jsx(EducationSignUpSettingsProvider,{value:t.signUp,children:jsx(Tracks,{ref:s,config:t.config,preview:t.preview})}):t.type==="spinToWin"?jsx(SpinToWin,{ref:s,id:e,node:t,children:r}):t.type==="countdown"?jsx(CountdownNode,{id:e,node:t,ref:s}):assertNever(t)})});TemplateNodeContent.displayName="TemplateNodeV2";const IconNode=reactExports.forwardRef(({id:e,node:t},r)=>{var s;const n=useExecutePopupActions(t.actions),i=t.actions.some(l=>l.type==="closePopup"||l.type==="floatingButton")?"Close popup":void 0;return jsx(ClickableDiv,{id:e,ref:r,onClick:n,className:classNames((s=t.styles)==null?void 0:s.classes),"aria-label":i,children:jsx(Icon,{icon:t.icon})})});IconNode.displayName="IconNode";const ButtonNode=reactExports.forwardRef(({id:e,node:t,children:r,...n},i)=>{var S;const[s,l]=reactExports.useState(!1),c=useExecutePopupActions(),h=useEvalTemplateStrings(),{isSubmitting:m,submit:b}=useFormNodeContext()??{};return jsx(Button,{...n,className:classNames((S=t.styles)==null?void 0:S.classes),sharedStyle:t.sharedStyle,id:e,type:t.submit?"submit":"button",onClick:async()=>{var _;l(!0),await((_=n.onClick)==null?void 0:_.call(n))!==!1&&await c(t.actions),l(!1),t.submit&&(b==null||b())},disabled:s||n.disabled||m,variant:t.variant,ref:i,children:r??jsxs(Fragment,{children:[t.icon&&jsx(Icon,{icon:t.icon,inButton:!0,onClick:w=>{var _;(_=t.iconActions)!=null&&_.length&&(c(t.iconActions),w.stopPropagation())}}),h(t.text),t.rightIcon&&jsx(Icon,{icon:t.rightIcon,inButton:!0,onClick:w=>{var _;(_=t.rightIconActions)!=null&&_.length&&(c(t.rightIconActions),w.stopPropagation())}})]})})});ButtonNode.displayName="ButtonNode";function getPositionRelativeToAncestor(e,t){let r=0,n=0,i=e;for(;i&&t.contains(i);){if(r+=i.offsetLeft,n+=i.offsetTop,!i.offsetParent)return{x:0,y:0};i=i.offsetParent}return{x:r,y:n}}const TemplateNode=({node:{id:e,node:t,children:r},parentId:n})=>{const i=reactExports.useRef(null),s=reactExports.useRef(null),l=useOutletNodeContext(),c=useCustomerAppContext().root,h=c.querySelector(`#${PREVIEW_POPUP_PORTAL_ID}`),{highlightedNode:m,selectedNode:b,isPreview:S}=usePopupPreviewContext();reactExports.useEffect(()=>{if(!s.current||!S)return;let I=!1;if(i.current){const{x:P,y:F}=getPositionRelativeToAncestor(i.current,c),{offsetWidth:j,offsetHeight:q}=i.current;(j||q)&&(I=!0,s.current.style.top=`${F-4}px`,s.current.style.left=`${P-4}px`,s.current.style.width=`${j+4*2}px`,s.current.style.height=`${q+4*2}px`)}const N=I?b===e?1:m===e?.6:0:0;s.current.style.zIndex=N>0?"50":"0",s.current.style.opacity=N.toString(),s.current.style.borderRadius="4px"},[S,b,m,e,c]);const w=!l,_=jsxs(reactExports.Suspense,{children:[S&&h&&reactDomExports.createPortal(jsx("div",{className:"absolute border border-accent-foreground ring-2 ring-accent-900 pointer-events-none transition-opacity duration-100 opacity-0",ref:s}),h),jsx(TemplateNodeContent,{id:e,node:t,ref:i,parentId:n,hasChildren:!!(r!=null&&r.length),children:jsx(TemplateV2NodeChildren,{nodes:r,id:e})})]});return w?_:jsx(CommonErrorBoundary,{children:_})},{useContext:useContext$2,Provider:RootNodeProvider}=createContextWithDefault(!0),useIsRootNode=useContext$2,TemplateV2NodeChildren=({id:e,nodes:t})=>{var i;const r=(i=useOutletNodeContext())==null?void 0:i.rootId,n=e??r??null;return jsx(RootNodeProvider,{value:!1,children:t!=null&&t.length?t.map((s,l)=>jsx(TemplateNode,{parentId:n,node:s},l)):null})},{useOptionalContext,Provider:Provider$2}=createContextWithoutDefault("layout"),useLayoutContext=useOptionalContext,Layout=({id:e,children:t})=>{const{template:r}=usePopupContext(),n=r.layouts.find(i=>i.id===e);if(!n)throw new Error(`Layout ${e} not found`);return jsx(Provider$2,{value:{children:t},children:jsx(TemplateNode,{parentId:null,node:n.children})})};let hasRecordedView=!1;function useRecordOldPopupView(e=!0){const{mutate:t}=useRegisterEvent();reactExports.useEffect(()=>{const r=()=>{hasRecordedView||!e||(hasRecordedView=!0,t({metric:"POPUP_VIEW",once:!0}))};return window.addEventListener("mousemove",r),window.addEventListener("touchstart",r),()=>{window.removeEventListener("mousemove",r),window.removeEventListener("touchstart",r)}},[t,e])}function useRecordNewPopupView(e=!0){const{onPopupView:t}=useClientIntegrations(),{mutate:r}=useRegisterEvent(),n=reactExports.useRef(!1);reactExports.useEffect(()=>{if(!e)return;const i=()=>{n.current||(n.current=!0,t(),r({metric:"POPUP",once:!0}))};if(n.current)return;window.addEventListener("pointermove",i),window.addEventListener("pointerdown",i);const s=setTimeout(i,7e3);return()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerdown",i),clearTimeout(s)}},[t,r,e])}const{useContext:useContext$1,Provider:Provider$1}=createContextWithoutDefault("popup"),usePopupContext=useContext$1,Popup=reactExports.memo(({template:e,stepID:t=(i=>(i=getSteps(e).at(0))==null?void 0:i.id)(),children:r,...n})=>{const{data:s}=useGetMerchant(),l=e.steps.find(S=>S.id===t),h=!!(l!=null&&l.builderLabel)?t:void 0;useRecordOldPopupView(l&&!l.isFloatingButton),useRecordNewPopupView(l&&!l.isFloatingButton);const m=useStylesheet(reactExports.useCallback(S=>{[...e.steps.flatMap(w=>w.children),...e.layouts.map(w=>w.children)].forEach(w=>S.appendNode(w));for(const w of e.sharedStyles)S.appendClass(SHARED_STYLE_CLASSNAME(w.handle),w.styles)},[e])),b=useStepLayout(l);if(!b)throw new Error("Layout ID is required");return m?jsx(TextVariablesProvider,{sms_consent:getSMSConsentText(s),children:jsxs(Provider$1,{value:{template:e,stepID:t,...n},children:[r,jsx(Layout,{id:b,children:jsx(TemplateV2NodeChildren,{id:null,nodes:l==null?void 0:l.children},h)})]})}):null});Popup.displayName="Popup";const useGetThemeQuery=queryManager(()=>["themes","get"]);function useGetTheme(){const{initialData:e}=useCustomerAppContext(),t=useServiceFetch(),{getQueryKey:r}=useGetThemeQuery();return useSuspenseQuery({queryKey:r(),queryFn:()=>t("GET","/themes",{}),initialData:e.theme,staleTime:1/0})}function useBaseThemeConfig(){var i;const{data:e}=useGetTheme(),t=(i=useCustomerAppContext().preview)==null?void 0:i.toChildEvents,[r,n]=reactExports.useState(null);return reactExports.useEffect(()=>(t==null||t.on("updateTheme",n),()=>{t==null||t.off("updateTheme",n)}),[t]),r??(e==null?void 0:e.config)}function usePopupThemeConfig(){const{template:{themeOverride:e}}=usePopupContext(),t=useBaseThemeConfig();return overrideThemeConfig(t,e)}const Button=reactExports.forwardRef(({onClick:e,children:t,variant:r="secondary",disabled:n=!1,className:i,inline:s=!1,fullWidth:l=r!=="plain",sharedStyle:c,...h},m)=>{const b=usePopupThemeConfig(),S=r==="primary"?PRIMARY_BUTTON_HANDLE:r==="secondary"?SECONDARY_BUTTON_HANDLE:r==="plain"?PLAIN_BUTTON_HANDLE:r==="icon"?ICON_BUTTON_HANDLE:void 0,w=b==null?void 0:b.styles.button.find(v=>v.handle===(c??S)),_=classNames(SHARED_STYLE_CLASSNAME(w==null?void 0:w.handle),w==null?void 0:w.styles.classes),I=classNames(w==null?void 0:w.styles.classes,_),{styles:N,onClick:P,onMouseEnter:F,onMouseLeave:j}=usePreviewNodeContext(),{modal:q}=useModalContext(),f=classNames(s?"inline-flex":"flex","text-center duration-200 gap-2 justify-center items-center line-clamp-1 transition-[transform,color,background-color,opacity,box-shadow] cursor-pointer disabled:pointer-events-none",i,l&&"w-full",I,q&&"shiny-disabled");return jsx("button",{className:f,style:N,"aria-disabled":n,disabled:n,...h,onClick:P??(v=>!n&&(e==null?void 0:e(v))),onMouseEnter:F,onMouseLeave:j,ref:m,children:t})});Button.displayName="Button";const WILL_AUTO_APPLY_CODE_STORAGE_KEY="alia-will-auto-apply-code";function getRedirectPath({path:e,exceptIfOnPaths:t}){const r=window.location.pathname+window.location.search;if(!anyPathGlob(t,r)){if(e.startsWith("/#")){const[n,i]=r.split("?"),s=new URLSearchParams(i);new URLSearchParams(e.slice(2)).forEach((h,m)=>{s.append(m,h)});const c=s.toString();return`${n}${c?`?${c}`:""}`}return e}}function useApplyCode({setIsLoading:e,setApplied:t,onRedirected:r}){return async n=>{localStorage.setItem(WILL_AUTO_APPLY_CODE_STORAGE_KEY,n.id.toString());const i=n.shopifyCode;i&&navigator.clipboard.writeText(i);const s=getRewardConfigProperty(n.config,"redirectOnApply"),l=s?getRedirectPath(s):void 0;e==null||e(!0),l?(r==null||r(),new ShopifyUtils().redirect(i?`/discount/${i}?redirect=${l}`:l)):i&&(await wait(500),e==null||e(!1),t==null||t(!0),new ShopifyUtils().applyCode(i))}}const ShopifyCode=({claimedReward:e,onClose:t})=>{const[r,n]=reactExports.useState(!1),i=e.shopifyCode,[s,l]=reactExports.useState(localStorage.getItem(WILL_AUTO_APPLY_CODE_STORAGE_KEY)===e.id.toString()),c=useApplyCode({setIsLoading:n,setApplied:l,onRedirected:t}),h=getRewardConfigProperty(e.config,"redirectOnApply"),m=getRewardConfigProperty(e.config,"disableAutoApply"),b=!m&&(!!i||!!h),S=i?jsxs(ClickableDiv,{className:"w-3/4 cursor-pointer flex text-xl tracking-wide justify-between bg-primary-50 rounded-lg px-2.5 py-2 font-mono",onClick:()=>{m?(navigator.clipboard.writeText(i),l(!0)):c(e)},children:[jsx("span",{className:"select-all",children:i}),jsx(Icon,{icon:s?"checkmark":"copy"})]}):h?jsx(Button,{disabled:r,variant:"primary",onClick:()=>c(e),children:"Activate"}):null;return b?s?jsxs("div",{className:"flex flex-col items-center gap-6",children:[jsx(ClaimedRewardDivider,{}),jsxs("div",{className:"flex flex-col items-center gap-4",children:[S,jsx("div",{className:"text-center",children:"We've applied this discount code to your cart."})]}),jsx(ClaimedRewardDivider,{})]}):jsx("div",{className:"w-4/5",children:jsx(Button,{disabled:r,variant:"primary",onClick:()=>c(e),children:r?"Applying...":"Apply my discount"})}):S};function useIsFirstRender(){const e=reactExports.useRef(!0);return reactExports.useEffect(()=>{e.current=!1},[]),e.current}async function evaluateKlaviyoIdentifiedCond(e){const t=await klaviyoIsIdentified();return t===void 0?"skip":e.type==="klaviyo.identified"?t:!t}async function klaviyoIsIdentified(){try{const{klaviyo:e}=await klaviyoObject(),t=await timeout(1e3,async()=>await(e==null?void 0:e.isIdentified()));return t===void 0?void 0:t===!0}catch{return}}async function evaluateKlaviyoListCond(e,{integrationUsers:t}){if(!e.listID)return!0;const r=e.listID;if(s()===!0||await getKDPResult(r)===!0)return e.type==="klaviyo.inList";return e.type!=="klaviyo.inList";function s(){var l,c;for(const h of t){if(h.data.type==="KLAVIYO")return((l=h.data.subscribedLists)==null?void 0:l.includes(r))??!1;if(h.data.type==="KLAVIYO_OAUTH")return((c=h.data.subscribedLists)==null?void 0:c.includes(r))??!1}return!1}}async function evaluateKlaviyoSegmentCond(e){if(!e.segmentID)return!0;const t=e.segmentID;return await getKDPResult(t)===!0?e.type==="klaviyo.inSegment":e.type!=="klaviyo.inSegment"}const kdpResults=new Map;async function getKDPResult(e){try{if(kdpResults.has(e))return kdpResults.get(e);const{klaviyo:t}=await klaviyoObject();if(!(t!=null&&t.getGroupMembership))return;const r=await timeout(1e3,async()=>await(t==null?void 0:t.getGroupMembership([e])));if(!Array.isArray(r))return;const n=r.includes(e);return kdpResults.set(e,n),n}catch{return}}async function klaviyoObject(){try{if(!Array.from(getDocument().scripts).find(n=>n.src.includes("klaviyo.js")))return{klaviyo:void 0};const t=()=>getWindowProperty("klaviyo");return t()?{klaviyo:t()}:await timeout(1e3,async()=>await new Promise(n=>{const i=setInterval(()=>{t()&&(n({klaviyo:t()}),clearInterval(i))},100)}))??{klaviyo:void 0}}catch{return{klaviyo:void 0}}}async function evaluateTargetingRuleCond(e,t){var i,s,l,c;if(t.evaluated.includes(e.resource.id))return"skip";const r=e.resource.type==="targetingRule"?(s=(i=t.targetingRules)==null?void 0:i.rules.find(h=>h.id===e.resource.id))==null?void 0:s.config:(c=(l=t.segments.find(h=>h.id===e.resource.id))==null?void 0:l.targeting)==null?void 0:c.rule;if(!r)return"skip";const n=await evaluateTargetingRule(r,{...t,evaluated:[...t.evaluated,e.resource.id]});return n!=="skip"?e.type==="inTargetingRule"?n:!n:e.resource.type==="segment"&&e.type==="notInTargetingRule"?!1:"skip"}async function evaluateCustomCodeCond(e,t){return await Promise.race([safeEval(`(async ({ campaignID, profile: { user, actions } }) => { ${e.code} })(${JSON.stringify({campaignID:t.segmentID,profile:t})})`),wait(1e3)])===!0}const checkCookieMap={klaviyo:async()=>await klaviyoIsIdentified(),smsbump:async()=>{var e,t;return(t=(e=getWindowProperty("smsbump"))==null?void 0:e.isIdentified)==null?void 0:t.call(e)},unveild:async()=>{var e,t;return(t=(e=getWindowProperty("unveild"))==null?void 0:e.checkIfUserIdentified)==null?void 0:t.call(e)},upstack:async()=>{var e,t;return await((t=(e=getWindowProperty("_upsShopifyClient"))==null?void 0:e.isKnown)==null?void 0:t.call(e))}};async function evaluateCookieIdentificationCond(e,t){const n=(await Promise.all(Object.keys(checkCookieMap).filter(i=>!e.exclude.includes(i)).map(async i=>{try{const s=await checkCookieMap[i](t);return s===!0?!0:s===!1?!1:"skip"}catch{return"skip"}}))).some(i=>i===!0);return e.type==="cookie.identified"?n:!n}function evaluateNumFilter(e,t){switch(e.operator){case"eq":return t===e.value;case"neq":return t!==e.value;case"gt":return t>e.value;case"gte":return t>=e.value;case"lt":return tr;case"lt":return nnew URL(h)):[new URL(window.location.href)],l=(e.matchType==="exact"?e.values:e.matchType==="contains"?e.values.map(h=>`*${h}*`):assertNever(e.matchType)).some(h=>i.some(m=>c(e.pageType,m,h)));return e.type==="hasVisitedPage"||e.type==="isOnPage"?l:!l;function c(h,m,b){const S=h==="url"?m.toString():h==="path"?m.pathname+m.search:assertNever(h);return glob(w(b),w(S));function w(_){return _.replace(/\/$/,"")}}}function evaluateNumPagesViewedCond(e,{user:t}){var n;const r=(n=t.profile.history)==null?void 0:n.at(-1);return r?evaluateNumFilter(e.value,r.length):!1}function evaluateNumSessionsCond(e,{user:t}){var r;return evaluateNumFilter(e.value,((r=t.profile.history)==null?void 0:r.length)??0)}async function getCustomerPrivacy(){const e=getWindowProperty("Shopify");if(!e)return{};const t=new Promise(r=>{e==null||e.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],r)});return await Promise.race([t,wait(1e3)]),e.customerPrivacy?{marketingAllowed:e.customerPrivacy.marketingAllowed(),saleOfDataAllowed:e.customerPrivacy.saleOfDataAllowed(),analyticsProcessingAllowed:e.customerPrivacy.analyticsProcessingAllowed(),preferencesProcessingAllowed:e.customerPrivacy.preferencesProcessingAllowed()}:{}}function evaluateShopifyNumOrdersCond(e,t){return evaluateNumFilter(e.value,t.user.shopifyNumOrders??0)}function evaluateShopifyCountriesCond(e,t){const r=t.user.country;if(r===null)return!0;const n=getAllCountryCodes(e.countries).includes(r);return e.type==="shopify.inCountries"?n:!n}function evaluateMarketsCond(e,t){const r=t.user.market;return r===null?!0:e.type==="shopify.inMarkets"?e.markets.includes(r):!e.markets.includes(r)}function evaluateLocalesCond(e,t){const r=t.user.language;return r===null?!0:e.type==="shopify.inLocales"?e.locales.includes(r):!e.locales.includes(r)}async function evaluateCustomerPrivacyCond(e){const{marketingAllowed:t,saleOfDataAllowed:r,analyticsProcessingAllowed:n,preferencesProcessingAllowed:i}=await getCustomerPrivacy();return e.consentTypes.some(l=>{switch(l){case"marketing":return t;case"saleOfData":return r;case"analyticsProcessing":return n;case"preferencesProcessing":return i}})}function evaluateUtmSourceCond(e,t){const r=getLatestParamValue("utm_source",t.user),n=e.values.includes(r);return e.type==="traffic.utmSourceIsIn"?n:!n}function evaluateUtmMediumCond(e,t){const r=getLatestParamValue("utm_medium",t.user),n=e.values.includes(r);return e.type==="traffic.utmMediumIsIn"?n:!n}function getLatestParamValue(e,{profile:t}){const r=t.history.flat();for(const n of r.reverse()){const s=new URL(n).searchParams.get(e);if(s)return s}return null}function evaluateUserCreatedAtCond(e,t){return evaluateRelativeDateFilter(e.value,new Date(t.user.createdAt))}function evaluateUserDeviceCond(e,t){const r=t.user.isMobile;return r===null?!0:e.device==="mobile"?r:!r}function evaluateUserCountriesCond(e,t){const r=t.user.ipCountry;if(r===null)return"skip";const n=getAllCountryCodes(e.countries).includes(r);return e.type==="user.inCountries"?n:!n}function evaluateUserRegionsCond(e,t){const r=t.user.ipRegion;return r===null?"skip":e.type==="user.inRegions"?e.regions.includes(r):!e.regions.includes(r)}function evaluateUserActionCond(e,t){const r=t.actions.some(n=>n.data.type!==e.action.type?!1:e.filters?evaluateUserActionFilters(n,e.filters):!0);return e.type==="user.hasDoneAction"?!!r:!r}function evaluateUserActionFilters(e,t){return t.every(i=>{switch(i.type){case"userAction.date":return r(i);case"userAction.inSegments":case"userAction.notInSegments":return n(i)}});function r(i){return evaluateRelativeDateFilter(i.value,new Date(e.createdAt))}function n(i){const s=i.segmentIDs.some(l=>e.segmentID===l);return i.type==="userAction.inSegments"?s:!s}}async function evaluateCond(e,t){switch(e.type){case"inTargetingRule":case"notInTargetingRule":return evaluateTargetingRuleCond(e,t);case"customCode":return await evaluateCustomCodeCond(e,t);case"klaviyo.identified":case"klaviyo.notIdentified":return await evaluateKlaviyoIdentifiedCond(e);case"klaviyo.inList":case"klaviyo.notInList":return await evaluateKlaviyoListCond(e,t);case"klaviyo.inSegment":case"klaviyo.notInSegment":return await evaluateKlaviyoSegmentCond(e);case"isOnPage":case"isNotOnPage":case"hasVisitedPage":case"hasNotVisitedPage":return evaluatePagesCond(e,t);case"pages.numPagesViewed":return evaluateNumPagesViewedCond(e,t);case"pages.numSessions":return evaluateNumSessionsCond(e,t);case"shopify.numOrders":return evaluateShopifyNumOrdersCond(e,t);case"shopify.inMarkets":case"shopify.notInMarkets":return evaluateMarketsCond(e,t);case"shopify.inLocales":case"shopify.notInLocales":return evaluateLocalesCond(e,t);case"shopify.inCountries":case"shopify.notInCountries":return evaluateShopifyCountriesCond(e,t);case"shopify.customerPrivacyAllowed":return evaluateCustomerPrivacyCond(e);case"user.createdAt":return evaluateUserCreatedAtCond(e,t);case"user.device":return evaluateUserDeviceCond(e,t);case"user.inCountries":case"user.notInCountries":return evaluateUserCountriesCond(e,t);case"user.inRegions":case"user.notInRegions":return evaluateUserRegionsCond(e,t);case"user.hasDoneAction":case"user.hasNotDoneAction":return evaluateUserActionCond(e,t);case"traffic.utmSourceIsIn":case"traffic.utmSourceIsNotIn":return evaluateUtmSourceCond(e,t);case"traffic.utmMediumIsIn":case"traffic.utmMediumIsNotIn":return evaluateUtmMediumCond(e,t);case"cookie.identified":case"cookie.notIdentified":return evaluateCookieIdentificationCond(e,t)}}async function evaluateTargetingRule(e,t){switch(e.type){case"and":return evaluateAndRule(e,t);case"or":return evaluateOrRule(e,t)}}async function evaluateAndRule(e,t){const r=await Promise.all(e.conds.map(n=>evaluateCond(n,t)));return r.some(n=>n===!1)?!1:r.some(n=>n==="skip")?"skip":!0}async function evaluateOrRule(e,t){const r=await Promise.all(e.conds.map(n=>evaluateCond(n,t)));return r.some(n=>n===!0)?!0:r.some(n=>n==="skip")?"skip":!1}function useTargetingArgs(){const{targetingArgs:e}=useCustomerAppContext(),t=useMediatorState();return reactExports.useMemo(()=>{if(e)return{...e,...t!=null&&t.actions?{actions:t.actions}:{},...t!=null&&t.user?{user:t.user}:{}}},[e,t])}const STALE_TIME=1e3;function useReEvaluateTargeting(){var l;const{initialData:e}=useCustomerAppContext(),t=useTargetingArgs(),r=reactExports.useRef(!0);reactExports.useEffect(()=>{r.current=!0},[t]);const n=reactExports.useRef(void 0),i=reactExports.useCallback(c=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current=!0},c)},[]),s=reactExports.useRef(void 0);return reactExports.useCallback(async()=>{if(!r.current&&s.current!==void 0)return s.current;const c=await h();return s.current=c,r.current=!1,i(STALE_TIME),c;function h(){var S;const m=(S=e.userFlow)==null?void 0:S.segmentID,b=t==null?void 0:t.segments.find(w=>w.id===m);return!t||!b?"skip":evaluateTargetingRule(b.targeting.rule,{...t,evaluated:[],segmentID:b.id})}},[r,i,(l=e.userFlow)==null?void 0:l.segmentID,t])}function useOnSDKMessage(e,t){const{messages:r}=useCustomerAppContext(),n=useIsFirstRender();reactExports.useEffect(()=>r==null?void 0:r.listen({type:e,callback:t,retroactive:n}),[e,t,r,n])}function usePreloadImages(e){var l,c;const{initialData:t}=useCustomerAppContext(),r=(c=(l=t.userFlow)==null?void 0:l.config.popup)==null?void 0:c.config,{width:n}=useWindowSizeContext(),s=((r==null?void 0:r.steps.map(h=>n>=1024?h.layouts[1024]:h.layouts.default))??[]).map(h=>{var m;return(m=r==null?void 0:r.layouts.find(b=>b.id===h))==null?void 0:m.children}).filter(Boolean).flatMap(h=>getAllNodesInNode(h)).map(h=>h.node.type==="image"?h.node.source:"styles"in h.node?getBGImageFromStyles(h.node.styles):null).filter(Boolean);useQuery({queryKey:["preloadImages",s],queryFn:async()=>(await Promise.all(s.map(preloadImage)),!0),suspense:!0,staleTime:1/0,enabled:e})}async function preloadImage(e){return new Promise(t=>{const r=new Image;r.onload=t,r.onerror=t,r.src=e})}function getBGImageFromStyles(e){return getBGImageFromStylesV2(e==null?void 0:e[1024])??getBGImageFromStylesV2(e==null?void 0:e.default)}function getBGImageFromStylesV2(e){var n;const t=(n=e==null?void 0:e.default)==null?void 0:n.backgroundImage;if(!t)return null;const r=t.match(/url\((['"]?)(.*?)\1\)/);return(r==null?void 0:r[2])??null}class CartWatcher{constructor(){Xe(this,"cart",null);Xe(this,"listeners",[]);Xe(this,"cartResourceObserver",null);try{this.restoreCart(),this.emitCartChanges().then(()=>this.observeCartChanges())}catch(t){console.error("Error instantiating cart watcher",t)}}restoreCart(){const t=localStorage.getItem("alia-cart");t&&(this.cart=JSON.parse(t))}saveCart(){localStorage.setItem("alia-cart",JSON.stringify(this.cart))}listen(t){return this.listeners.push(t),()=>{this.listeners=this.listeners.filter(r=>r!==t)}}async fetchCartData(){try{return await(await fetch("/cart.js")).json()}catch{return{items:[],total_price:0}}}findCartDifferences(t){if(!this.cart)return{added:t.items,removed:[]};const n={added:((i,s)=>i.filter(l=>!s.some(c=>l.key===c.key)))(t.items,this.cart.items)};return this.cart.items.forEach(i=>{const s=t.items.find(h=>h.key===i.key&&h.quantity!==i.quantity);if(!s)return;const l=s.quantity-i.quantity,c={...s};c.quantity=Math.abs(l),l>0&&n.added.push(c)}),n}async emitCartChanges(){const t=await this.fetchCartData(),r=this.findCartDifferences(t);this.cart=t,this.saveCart(),r.added.length&&this.listeners.forEach(n=>n(r))}observeCartChanges(){this.cartResourceObserver=new PerformanceObserver(t=>{t.getEntries().forEach(r=>{const n=r.initiatorType;n&&["xmlhttprequest","fetch"].includes(n)&&/\/cart\//.test(r.name)&&this.emitCartChanges()})}),this.cartResourceObserver.observe({entryTypes:["resource"]})}}function useAddToCartCond(e){const[t,r]=reactExports.useState([]);return reactExports.useEffect(()=>{const n=()=>{const i=e.cart;i&&r(i.items.map(s=>s.variant_id.toString()))};return e.emitCartChanges().then(n),e.listen(n)},[e]),reactExports.useCallback(n=>t.length===0?!1:n.onlyVariantIds?n.onlyVariantIds.map(s=>gqlToRestID("ProductVariant")(parseShopifyGqlID("ProductVariant")(s))).some(s=>t.includes(s)):!0,[t])}function useCartValueCond(e){const[t,r]=reactExports.useState(0);return reactExports.useEffect(()=>{const n=()=>{const i=e.cart;if(!i)return;const s=i.total_price/100;r(s)};return e.emitCartChanges().then(n),e.listen(n)},[e]),reactExports.useCallback(n=>t>=n.value,[t])}function useCartConds(){const e=reactExports.useMemo(()=>new CartWatcher,[]),t=useAddToCartCond(e),r=useCartValueCond(e);return{addToCartCond:t,cartValueCond:r}}function useIdleCond(){const[e,t]=reactExports.useState(0),r=reactExports.useRef(e),n=reactExports.useCallback(i=>{r.current!==i&&(r.current=i,t(i))},[]);return reactExports.useEffect(()=>{const i=setInterval(()=>{n(r.current+1)},1e3);return()=>clearInterval(i)},[n]),reactExports.useEffect(()=>{const i=()=>n(0);return getDocument().addEventListener("mousemove",i),getDocument().addEventListener("scroll",i),getDocument().addEventListener("touchstart",i),()=>{getDocument().removeEventListener("mousemove",i),getDocument().removeEventListener("scroll",i),getDocument().removeEventListener("touchstart",i)}},[n]),reactExports.useCallback(i=>e>=i.seconds,[e])}function useMouseLeaveCond(){const[e,t]=reactExports.useState(!1),r=reactExports.useRef(!1),n=reactExports.useCallback(i=>{r.current!==i&&(r.current=i,t(i))},[]);return reactExports.useEffect(()=>{const i=()=>n(!1),s=()=>n(!0);return getDocument().addEventListener("mouseleave",s),getDocument().addEventListener("mouseenter",i),()=>{getDocument().removeEventListener("mouseleave",s),getDocument().removeEventListener("mouseenter",i)}},[n]),reactExports.useCallback(()=>e,[e])}const SCROLL_INTERVAL=200;function useQuickScrollUpCond(){const[e,t]=reactExports.useState(!1),r=reactExports.useRef(!1),n=reactExports.useCallback(s=>{r.current!==s&&(r.current=s,t(s))},[]),i=reactExports.useRef(window.scrollY);return reactExports.useEffect(()=>{const s=setInterval(()=>{window.scrollY-i.current<-500&&n(!0),i.current=window.scrollY},SCROLL_INTERVAL);return()=>clearInterval(s)},[n]),reactExports.useCallback(()=>e,[e])}const DEBOUNCE_INTERVAL=100;function useScrollDepth(){const[e,t]=reactExports.useState(0),r=reactExports.useRef(e),n=reactExports.useRef(Date.now()),i=reactExports.useRef(null);return reactExports.useEffect(()=>{const s=()=>{const c=getDocument().body.scrollHeight-window.innerHeight,h=window.scrollY/c,m=Math.round(h*100);m!==r.current&&(t(m),r.current=m,n.current=Date.now())},l=()=>{Date.now()-n.current{s()},DEBOUNCE_INTERVAL)):s()};return getDocument().addEventListener("scroll",l),()=>getDocument().removeEventListener("scroll",l)},[]),e}function useScrollDepthCond(){const e=useScrollDepth();return reactExports.useCallback(t=>e>=t.depth,[e])}function useTimeOnPageCond(){const[e,t]=reactExports.useState(0);return reactExports.useEffect(()=>{const r=setInterval(()=>{const n=Date.now()-window.performance.timeOrigin,i=Math.floor(n/1e3);t(i)},1e3);return()=>clearInterval(r)},[]),reactExports.useCallback(r=>r.delay?e>=r.delay:!0,[e])}function useBasicTriggers({value:e,triggerStep:t}){var F;const r=reactExports.useMemo(()=>(e==null?void 0:e.triggers.filter(j=>j.type==="basic"))??[],[e]),n=(F=useMediatorState())==null?void 0:F.actions,[i,s]=reactExports.useState(!1);reactExports.useEffect(()=>{const j=()=>{const f=getLastShown(n),v=e==null?void 0:e.notIfAnyPopupShownInLast;if(!v)return s(!0);s(typeof f=="number"?evaluateRelativeDateFilter({...v,operator:"gt"},new Date(f)):f==="never")};j();const q=setInterval(j,1e3);return()=>clearInterval(q)},[n,e]);const l=useBreakpoint(),c=useGetTriggerStep(),h=reactExports.useCallback(j=>{const q=c(j.step);if(q){if(!i){logger.debug("Trigger aborted because popup was shown recently");return}t(q,j)}},[t,c,i]),m=useTimeOnPageCond(),b=useMouseLeaveCond(),S=useIdleCond(),w=useQuickScrollUpCond(),_=useScrollDepthCond(),{addToCartCond:I,cartValueCond:N}=useCartConds(),P=reactExports.useCallback(j=>{switch(j.type){case"timeOnPage":return m(j);case"mouseLeave":return b();case"idle":return S(j);case"quickScrollUp":return w();case"scrollDepth":return _(j);case"addToCart":return I(j);case"cartValue":return N(j)}},[m,b,S,w,_,I,N]);reactExports.useEffect(()=>{const j=r.filter(v=>v.device==="mobile"&&l!=="default"||v.device==="desktop"&&l!=="1024"?!1:v.requireAllConds?v.conds.every(P):v.conds.some(P)),q=j.find(v=>{var g;return!((g=c(v.step))!=null&&g.isFloatingButton)});if(q){h(q);return}const f=j.at(0);f&&h(f)},[P,h,l,r,c])}function getLastShown(e){if(!e)return Number.NEGATIVE_INFINITY;const t=[...e].sort((i,s)=>new Date(s.createdAt).getTime()-new Date(i.createdAt).getTime()),r=t.find(i=>!(i.data.type!=="popupStep"||i.data.isFloatingButton));if(!r)return"never";const n=t.find(i=>i.segmentID!==r.segmentID||i.createdAt[r,100-n]))}function useGetUserSmartTriggerCoefs(e){const t=useServiceFetch(),{data:r,...n}=useQuery({queryKey:["userSmartTriggers","get"],queryFn:()=>t("GET","/settings",{}),suspense:!0,enabled:e});return{data:r?unobfuscateSmartTrigger(r):void 0,...n}}function interceptNavigation({onLinkClick:e,onHistoryChange:t}){getDocument().addEventListener("click",i=>{if(i.target instanceof HTMLElement){const s=i.target.closest("a");s&&(e==null||e(s))}});const r=history.pushState;history.pushState=function(i,s,l){let c;try{c=t==null?void 0:t(l)}catch(h){logger.error("Error intercepting navigation",h)}return r.call(this,i,s,c??l)};const n=history.replaceState;history.replaceState=function(i,s,l){let c;try{c=t==null?void 0:t(l)}catch(h){logger.error("Error intercepting navigation",h)}return n.call(this,i,s,c??l)}}class SessionTracker{constructor(t,r){Xe(this,"isNewSession");Xe(this,"flowID",null);Xe(this,"onEngaged",null);this.flowID=t??null,this.onEngaged=r??null,this.setupEngagedListeners(),getFromStorage("session",this.getStorageKey())?this.isNewSession=!1:(this.isNewSession=!0,this.setValue({start:Date.now(),isEngaged:!1}))}getStorageKey(){return`alia-session${this.flowID?`-${this.flowID}`:""}`}getValue(){return getFromStorage("session",this.getStorageKey())}setValue(t){setInStorage("session",this.getStorageKey(),t)}setupEngagedListeners(){interceptNavigation({onLinkClick:t=>{t.href&&t.hostname===window.location.hostname&&this.handleEngagedSession()},onHistoryChange:()=>{this.handleEngagedSession()}})}handleNewSession(){this.isNewSession}handleEngagedSession(){var r;const t=this.getValue();t.isEngaged||(this.setValue({...t,isEngaged:!0}),(r=this.onEngaged)==null||r.call(this))}}const SCORE_THRESHOLD=100;function useSmartTrigger({value:e,triggerStep:t}){const r=e==null?void 0:e.triggers.find(b=>b.type==="smart"),n=useTargetingArgs(),i=useRegisterEvent(),s=useGetTriggerStep(),l=reactExports.useRef(new Map),c=reactExports.useRef(!1),h=reactExports.useCallback(async(b,S)=>{l.current.set(b,S);const w=[...l.current.values()].reduce((N,P)=>N+P,0);if(!r||w{if(n)return m(n)},[m,n])}function useEvaluateScore(e,t){const{data:r}=useGetUserSmartTriggerCoefs(!!e),n=useQuickScrollUpCond(),i=useMouseLeaveCond(),s=useScrollDepth(),l=reactExports.useMemo(()=>new CartWatcher,[]),[c,h]=reactExports.useState(0);reactExports.useEffect(()=>{const _=()=>{const I=l.cart;I&&h(I.items.length)};return l.emitCartChanges().then(_),l.listen(_)},[l]);const m=reactExports.useMemo(()=>({isOrganicTraffic:(_,I)=>{const N=getLatestParamValue("utm_source",_.user),P=!N||["google","bing"].some(F=>N.includes(F));I(P?1:0)},productPageDistance:(_,I)=>{const N=_.user.profile.history.flat();if(!N.length)return;const P=N.reverse().findIndex(w);if(P===-1){I(0);return}const F=1-P/N.length;I(F)},itemsInCart:(_,I)=>{I(b(c))},mobile:(_,I)=>{I(_.user.isMobile?1:0)},scrollDepth:(_,I)=>{I(s/100)},timeSinceLastTrigger:(_,I)=>{const N=()=>{const F=getLastShown(_.actions),j=typeof F=="number"?F:F==="now"?Date.now():new SessionTracker().getValue().start,q=(Date.now()-j)/1e3,f=1-S(q,.5,(e==null?void 0:e.delayFromLastTrigger)??15);I(f)};N();const P=setInterval(N,1e3);return()=>clearInterval(P)},numSessions:(_,I)=>{I(b(_.user.profile.history.length-1))},numPagesViewed:(_,I)=>{var P;const N=((P=_.user.profile.history.at(-1))==null?void 0:P.length)??1;I(b(N-1))},timeOnPage:(_,I)=>{const N=window.performance.timeOrigin+1e3,P=setInterval(()=>{const F=Date.now()-N;I(b(F/1e3))},1e3);return()=>clearInterval(P)},exitIntent:(_,I)=>{I(n()||i()?1:0)},numProductPages:(_,I)=>{const N=_.user.profile.history.flat().filter(w).length;I(b(N))},landedOnProductPage:(_,I)=>{const N=_.user.profile.history.at(-1),P=N==null?void 0:N.at(0);I(P&&w(P)?1:0)},numViewedPolicies:(_,I)=>{const N=["faq","privacy","terms","refund","shipping"],P=_.user.profile.history.flat().filter(F=>N.some(j=>F.toLowerCase().includes(j))).length;I(b(P))},hoursFromPeak:(_,I)=>{const P=new Date,F=P.getHours()+P.getMinutes()/60,j=Math.min(Math.abs(F-13),Math.abs(F-13+24),Math.abs(F-13-24));I(1-j/12)},timeToInteraction:(_,I)=>{try{new PerformanceObserver(N=>{for(const P of N.getEntries())I(b(P.startTime/1e3))}).observe({type:"first-input",buffered:!0})}catch{}}}),[n,i,s,e==null?void 0:e.delayFromLastTrigger,c]);return reactExports.useCallback(_=>{if(!r)return;const I=[];for(const N in r){const P=N,F=m[P];if(!F)continue;const j=F(_,q=>{const f=Math.min(Math.max(q,-1),1);t(P,r[P]*f)});j&&I.push(j)}return()=>I.forEach(N=>N())},[m,t,r]);function b(_){return _<0?0:_/(_+1)}function S(_,I,N){return 1/(1+Math.exp(-.5*(_-N)))}function w(_){return _.includes("/products")||_.includes("/collections")}}function usePopupTrigger({goToPopupStep:e}){var b;const{currentStep:t}=useFlowStateContext(),{initialData:r,mediator:n}=useCustomerAppContext(),{data:{isMerchantPreview:i}}=useGetUser(),s=(b=r.userFlow)==null?void 0:b.config,l=s==null?void 0:s.triggers;usePreloadImages((l==null?void 0:l.preloadImages)??!1);const c=useReEvaluateTargeting(),h=reactExports.useCallback((S,w)=>{var N,P;if(!l||!r.userFlow)return!1;const _=n==null?void 0:n.state.actions,I=getLastStepAction(_==null?void 0:_.filter(F=>{var j;return F.segmentID===((j=r.userFlow)==null?void 0:j.segmentID)}),F=>!S.isFloatingButton&&F.isFloatingButton?!1:w.type==="basic"?!0:F.reason.type==="trigger"&&F.reason.triggerType==="smart");if(I!=="never"&&!(l.triggerAgainAfter&&evaluateRelativeDateFilter({value:l.triggerAgainAfter.value||1,unit:l.triggerAgainAfter.unit,operator:"gt"},new Date(I))))return logger.debug(`Trigger aborted because trigger again after not passed for ${w.type} trigger`),!1;if(t.step==="popup"){if(S.isFloatingButton)return logger.debug("Floating button trigger aborted because popup is open"),!1;const F=t.popupStepID,j=(P=(N=s==null?void 0:s.popup)==null?void 0:N.config)==null?void 0:P.steps.find(q=>q.id===F);if(j&&!j.isFloatingButton)return logger.debug("Trigger aborted because modal is already open"),!1}return!0},[t,s,r.userFlow,l,n]),m=reactExports.useCallback(async(S,w)=>h(S,w)?!i&&await c()===!1?(logger.debug("Trigger aborted because targeting rule is now false"),!1):h(S,w)?e(S.id,{type:"trigger",triggerType:w.type,triggerID:w.id}):!1:!1,[e,c,i,h]);useBasicTriggers({value:l,triggerStep:m}),useSmartTrigger({value:l,triggerStep:m})}function useGetTriggerStep(){var r,n;const{initialData:e}=useCustomerAppContext(),t=(n=(r=e.userFlow)==null?void 0:r.config.popup)==null?void 0:n.config;return reactExports.useCallback(i=>i?t==null?void 0:t.steps.find(s=>s.id===i):getSteps(t).at(0),[t])}function getLastStepAction(e=[],t){const r=[...e].sort((n,i)=>new Date(i.createdAt).getTime()-new Date(n.createdAt).getTime());for(const{data:n,createdAt:i}of r)if(n.type==="popupStep"&&t(n))return new Date(i).getTime();return"never"}const PopupTriggers=({goToPopupStep:e})=>(usePopupTrigger({goToPopupStep:e}),null),FlowPopup=({value:e})=>{var F;const t=e.config;useGroundIntegration();const r=(F=t.steps.find(j=>!j.isFloatingButton))==null?void 0:F.id,{initialData:n}=useCustomerAppContext(),i=useCreateUserAction(),s=useReEvaluateTargeting(),{currentStep:l,pushStep:c,state:h,closePopup:m}=useFlowStateContext(),b=reactExports.useCallback((j=r,q)=>{const f=t.steps.find(g=>g.id===j);if(!f||!j)return!1;const v=c({step:"popup",popupStepID:j,floatingButton:f.isFloatingButton,triggerType:q.type==="trigger"&&q.triggerType==="smart"?"smart":void 0});return v&&i({type:"popupStep",stepID:j,isFloatingButton:f.isFloatingButton===!0,reason:q}),v},[c,t,r,i]),S=reactExports.useCallback(()=>{logger.debug("Triggered programatically"),b(void 0,{type:"programmatic"})},[b]),{segmentID:w,flowID:_}=n.userFlow??{};useOnSDKMessage("open",reactExports.useCallback(async({triggerID:j,campaignID:q,ignoreTargeting:f})=>{if(f===!1&&await s()===!1){logger.debug("Trigger aborted because targeting rule is now false");return}q?q.toString()===(w==null?void 0:w.toString())&&S():j?getNewPopupID(_??0)===Number(j)&&S():S()},[S,_,w,s]));const I=useIsFirstRender();reactExports.useEffect(()=>{if(!I)return;const j=["alia","alia_popup"],q=new URLSearchParams(window.location.search);j.some(v=>q.get(v)==="1")&&(logger.debug("Triggered by alia=1 param"),S())},[I,S]),reactExports.useEffect(()=>{const j=q=>{q.key==="Escape"&&l.step==="popup"&&m({type:"escapeKey"})};return getDocument().addEventListener("keydown",j),()=>getDocument().removeEventListener("keydown",j)}),useOnSDKMessage("close",reactExports.useCallback(()=>m({type:"programmatic"}),[m]));const N=reactExports.useMemo(()=>h==null?void 0:h.steps.filter(j=>j.step==="popup").map(j=>j.popupStepID).filter(Boolean),[h]),P=N.at(-1);return jsxs(reactExports.Suspense,{children:[jsx(PopupTriggers,{value:e,goToPopupStep:b}),l.step==="popup"&&jsx(CommonErrorBoundary,{onError:()=>m({type:"error"}),children:jsx(Popup,{stepID:P,setStepID:b,history:N,onClosePopup:m,template:t})})]})},{Provider:FlowStateContextProvider,useContext:useFlowStateContext}=createContextWithoutDefault("flow"),moreRecentOf=(e,t)=>e&&new Date(e.updatedAt)>new Date(t.updatedAt)?e:t;function useFlowState(){const{data:e}=useGetUserFlow();if(!e)throw new Error("Flow not found");const t=`user-flow-v2-${e.id}`,r=getFromStorage("local",t),n=moreRecentOf(r,e),[i,s]=reactExports.useState(n.state),{mediator:l}=useCustomerAppContext(),{onPopupClose:c}=useClientIntegrations(),{mutateAsync:h}=useUpdateUserFlow(),m=reactExports.useCallback(async N=>{s(N),setInStorage("local",t,{state:N,updatedAt:new Date().toISOString()}),await h(N)},[h,t]),b=i.steps[i.steps.length-1],S=reactExports.useMemo(()=>[...i.steps].reverse().slice(1).find(N=>N.step!=="minimized")??{step:"popup"},[i.steps]),w=reactExports.useCallback(N=>{const P=l==null?void 0:l.state.modalFlowID;if(N.step==="popup"&&!N.floatingButton){if(P&&P!==e.flowID)return logger.debug("Not opening modal because another modal is open"),!1;l==null||l.update(()=>({modalFlowID:e.flowID}))}else P===e.flowID&&(l==null||l.update(()=>({modalFlowID:null})));return(b==null?void 0:b.step)==="popup"&&!b.floatingButton&&(N.step!=="popup"||N.floatingButton)&&c(),m({...i,steps:[...i.steps,{...N,timestamp:Date.now()}]}),!0},[i,m,l,e.flowID,c,b]),_=useCreateUserAction(),I=reactExports.useCallback(N=>{var P;if(w({step:"minimized"}),_({type:"popupClose",reason:N}),N.type==="action"&&N.action.type==="closePopup"&&((P=N.action)!=null&&P.redirect)){const F=getRedirectPath(N.action.redirect);F&&new ShopifyUtils().redirect(F)}},[w,_]);return{state:i,currentStep:b??{step:"minimized"},lastStep:S,pushStep:w,closePopup:I}}const UserFlow=()=>{var c;const{state:e,currentStep:t,lastStep:r,pushStep:n,closePopup:i}=useFlowState(),{initialData:s}=useCustomerAppContext(),l=(c=s.userFlow)==null?void 0:c.config.popup;return l?jsx(FlowStateContextProvider,{value:{state:e,currentStep:t,lastStep:r,pushStep:n,closePopup:i},children:jsx(FlowPopup,{value:l})}):null},appCSSRaw='@import"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap";#alia-root *:where(:not(html,body,svg,path)){all:revert}:host,#alia-root{--app-width: 360px;--body-font: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue";--display-font: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue";--border-radius-lg: 8px;--toastify-icon-color-info: white;--toastify-icon-color-success: white;--toastify-icon-color-warning: white;--toastify-icon-color-error: white;all:initial;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:host *,#alia-root *,:host :before,#alia-root :before,:host :after,#alia-root :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }:host ::backdrop,#alia-root ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }:host *,#alia-root *,:host :before,#alia-root :before,:host :after,#alia-root :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:host :before,#alia-root :before,:host :after,#alia-root :after{--tw-content: ""}#alia-iframe-html,:host :host,#alia-root :host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}#alia-iframe-body{margin:0;line-height:inherit}:host hr,#alia-root hr{height:0;color:inherit;border-top-width:1px}:host abbr:where([title]),#alia-root abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}:host h1,#alia-root h1,:host h2,#alia-root h2,:host h3,#alia-root h3,:host h4,#alia-root h4,:host h5,#alia-root h5,:host h6,#alia-root h6{font-size:inherit;font-weight:inherit}:host a,#alia-root a{color:inherit;text-decoration:inherit}:host b,#alia-root b,:host strong,#alia-root strong{font-weight:bolder}:host code,#alia-root code,:host kbd,#alia-root kbd,:host samp,#alia-root samp,:host pre,#alia-root pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}:host small,#alia-root small{font-size:80%}:host sub,#alia-root sub,:host sup,#alia-root sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}:host sub,#alia-root sub{bottom:-.25em}:host sup,#alia-root sup{top:-.5em}:host table,#alia-root table{text-indent:0;border-color:inherit;border-collapse:collapse}:host button,#alia-root button,:host input,#alia-root input,:host optgroup,#alia-root optgroup,:host select,#alia-root select,:host textarea,#alia-root textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}:host button,#alia-root button,:host select,#alia-root select{text-transform:none}:host button,#alia-root button,:host input:where([type=button]),#alia-root input:where([type=button]),:host input:where([type=reset]),#alia-root input:where([type=reset]),:host input:where([type=submit]),#alia-root input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:host :-moz-focusring,#alia-root :-moz-focusring{outline:auto}:host :-moz-ui-invalid,#alia-root :-moz-ui-invalid{box-shadow:none}:host progress,#alia-root progress{vertical-align:baseline}:host ::-webkit-inner-spin-button,#alia-root ::-webkit-inner-spin-button,:host ::-webkit-outer-spin-button,#alia-root ::-webkit-outer-spin-button{height:auto}:host [type=search],#alia-root [type=search]{-webkit-appearance:textfield;outline-offset:-2px}:host ::-webkit-search-decoration,#alia-root ::-webkit-search-decoration{-webkit-appearance:none}:host ::-webkit-file-upload-button,#alia-root ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:host summary,#alia-root summary{display:list-item}:host blockquote,#alia-root blockquote,:host dl,#alia-root dl,:host dd,#alia-root dd,:host h1,#alia-root h1,:host h2,#alia-root h2,:host h3,#alia-root h3,:host h4,#alia-root h4,:host h5,#alia-root h5,:host h6,#alia-root h6,:host hr,#alia-root hr,:host figure,#alia-root figure,:host p,#alia-root p,:host pre,#alia-root pre{margin:0}:host fieldset,#alia-root fieldset{margin:0;padding:0}:host legend,#alia-root legend{padding:0}:host ol,#alia-root ol,:host ul,#alia-root ul,:host menu,#alia-root menu{list-style:none;margin:0;padding:0}:host dialog,#alia-root dialog{padding:0}:host textarea,#alia-root textarea{resize:vertical}:host input::-moz-placeholder,#alia-root input::-moz-placeholder,:host textarea::-moz-placeholder,#alia-root textarea::-moz-placeholder{opacity:1;color:#9ca3af}:host input::placeholder,#alia-root input::placeholder,:host textarea::placeholder,#alia-root textarea::placeholder{opacity:1;color:#9ca3af}:host button,#alia-root button,:host [role=button],#alia-root [role=button]{cursor:pointer}:host :disabled,#alia-root :disabled{cursor:default}:host img,#alia-root img,:host svg,#alia-root svg,:host video,#alia-root video,:host canvas,#alia-root canvas,:host audio,#alia-root audio,:host iframe,#alia-root iframe,:host embed,#alia-root embed,:host object,#alia-root object{display:block;vertical-align:middle}:host img,#alia-root img,:host video,#alia-root video{max-width:100%;height:auto}:host [hidden]:where(:not([hidden=until-found])),#alia-root [hidden]:where(:not([hidden=until-found])){display:none}:host .container,#alia-root .container{width:100%}@media (min-width: 550px){:host .container,#alia-root .container{max-width:550px}}@media (min-width: 640px){:host .container,#alia-root .container{max-width:640px}}@media (min-width: 768px){:host .container,#alia-root .container{max-width:768px}}@media (min-width: 1024px){:host .container,#alia-root .container{max-width:1024px}}@media (min-width: 1280px){:host .container,#alia-root .container{max-width:1280px}}@media (min-width: 1536px){:host .container,#alia-root .container{max-width:1536px}}:host .prose,#alia-root .prose{color:var(--primary-color)}:host .pointer-events-none,#alia-root .pointer-events-none{pointer-events:none}:host .visible,#alia-root .visible{visibility:visible}:host .invisible,#alia-root .invisible{visibility:hidden}:host .static,#alia-root .static{position:static}:host .fixed,#alia-root .fixed{position:fixed}:host .absolute,#alia-root .absolute{position:absolute}:host .relative,#alia-root .relative{position:relative}:host .inset-0,#alia-root .inset-0{top:0;right:0;bottom:0;left:0}:host .bottom-0,#alia-root .bottom-0{bottom:0}:host .left-0,#alia-root .left-0{left:0}:host .right-0,#alia-root .right-0{right:0}:host .top-0,#alia-root .top-0{top:0}:host .top-4,#alia-root .top-4{top:16px}:host .z-10,#alia-root .z-10{z-index:10}:host .z-20,#alia-root .z-20{z-index:20}:host .z-50,#alia-root .z-50{z-index:50}:host .m-auto,#alia-root .m-auto{margin:auto}:host .-mx-1,#alia-root .-mx-1{margin-left:-4px;margin-right:-4px}:host .-mx-2,#alia-root .-mx-2{margin-left:-8px;margin-right:-8px}:host .-mx-5,#alia-root .-mx-5{margin-left:-20px;margin-right:-20px}:host .-my-1,#alia-root .-my-1{margin-top:-4px;margin-bottom:-4px}:host .-mt-1,#alia-root .-mt-1{margin-top:-4px}:host .mb-1,#alia-root .mb-1{margin-bottom:4px}:host .mb-2,#alia-root .mb-2{margin-bottom:8px}:host .ml-2,#alia-root .ml-2{margin-left:8px}:host .mt-2,#alia-root .mt-2{margin-top:8px}:host .line-clamp-1,#alia-root .line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}:host .block,#alia-root .block{display:block}:host .inline,#alia-root .inline{display:inline}:host .flex,#alia-root .flex{display:flex}:host .inline-flex,#alia-root .inline-flex{display:inline-flex}:host .hidden,#alia-root .hidden{display:none}:host .h-0,#alia-root .h-0{height:0px}:host .h-1\\.5,#alia-root .h-1\\.5{height:6px}:host .h-10,#alia-root .h-10{height:40px}:host .h-2,#alia-root .h-2{height:8px}:host .h-2\\.5,#alia-root .h-2\\.5{height:10px}:host .h-20,#alia-root .h-20{height:80px}:host .h-3,#alia-root .h-3{height:12px}:host .h-5,#alia-root .h-5{height:20px}:host .h-6,#alia-root .h-6{height:24px}:host .h-8,#alia-root .h-8{height:32px}:host .h-\\[18px\\],#alia-root .h-\\[18px\\]{height:18px}:host .h-\\[4\\.5rem\\],#alia-root .h-\\[4\\.5rem\\]{height:72px}:host .h-full,#alia-root .h-full{height:100%}:host .h-px,#alia-root .h-px{height:1px}:host .max-h-16,#alia-root .max-h-16{max-height:64px}:host .max-h-40,#alia-root .max-h-40{max-height:160px}:host .min-h-0,#alia-root .min-h-0{min-height:0px}:host .min-h-\\[200px\\],#alia-root .min-h-\\[200px\\]{min-height:200px}:host .w-0,#alia-root .w-0{width:0px}:host .w-10,#alia-root .w-10{width:40px}:host .w-16,#alia-root .w-16{width:64px}:host .w-2,#alia-root .w-2{width:8px}:host .w-2\\.5,#alia-root .w-2\\.5{width:10px}:host .w-2\\/3,#alia-root .w-2\\/3{width:66.666667%}:host .w-20,#alia-root .w-20{width:80px}:host .w-3,#alia-root .w-3{width:12px}:host .w-3\\/4,#alia-root .w-3\\/4{width:75%}:host .w-4\\/5,#alia-root .w-4\\/5{width:80%}:host .w-5,#alia-root .w-5{width:20px}:host .w-5\\/6,#alia-root .w-5\\/6{width:83.333333%}:host .w-80,#alia-root .w-80{width:320px}:host .w-\\[18px\\],#alia-root .w-\\[18px\\]{width:18px}:host .w-\\[4\\.5rem\\],#alia-root .w-\\[4\\.5rem\\]{width:72px}:host .w-full,#alia-root .w-full{width:100%}:host .w-max,#alia-root .w-max{width:-moz-max-content;width:max-content}:host .max-w-sm,#alia-root .max-w-sm{max-width:384px}:host .flex-1,#alia-root .flex-1{flex:1 1 0%}:host .flex-shrink,#alia-root .flex-shrink{flex-shrink:1}:host .flex-shrink-0,#alia-root .flex-shrink-0{flex-shrink:0}:host .transform,#alia-root .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host .cursor-default,#alia-root .cursor-default{cursor:default}:host .cursor-pointer,#alia-root .cursor-pointer{cursor:pointer}:host .select-none,#alia-root .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}:host .select-all,#alia-root .select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}:host .resize,#alia-root .resize{resize:both}:host .appearance-none,#alia-root .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .flex-row-reverse,#alia-root .flex-row-reverse{flex-direction:row-reverse}:host .flex-col,#alia-root .flex-col{flex-direction:column}:host .flex-wrap,#alia-root .flex-wrap{flex-wrap:wrap}:host .items-start,#alia-root .items-start{align-items:flex-start}:host .items-center,#alia-root .items-center{align-items:center}:host .items-stretch,#alia-root .items-stretch{align-items:stretch}:host .justify-end,#alia-root .justify-end{justify-content:flex-end}:host .justify-center,#alia-root .justify-center{justify-content:center}:host .justify-between,#alia-root .justify-between{justify-content:space-between}:host .gap-0\\.5,#alia-root .gap-0\\.5{gap:2px}:host .gap-1,#alia-root .gap-1{gap:4px}:host .gap-1\\.5,#alia-root .gap-1\\.5{gap:6px}:host .gap-2,#alia-root .gap-2{gap:8px}:host .gap-2\\.5,#alia-root .gap-2\\.5{gap:10px}:host .gap-3,#alia-root .gap-3{gap:12px}:host .gap-4,#alia-root .gap-4{gap:16px}:host .gap-5,#alia-root .gap-5{gap:20px}:host .gap-6,#alia-root .gap-6{gap:24px}:host .space-x-1>:not([hidden])~:not([hidden]),#alia-root .space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4px * var(--tw-space-x-reverse));margin-left:calc(4px * calc(1 - var(--tw-space-x-reverse)))}:host .space-x-2>:not([hidden])~:not([hidden]),#alia-root .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}:host .space-x-3>:not([hidden])~:not([hidden]),#alia-root .space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(12px * var(--tw-space-x-reverse));margin-left:calc(12px * calc(1 - var(--tw-space-x-reverse)))}:host .space-x-4>:not([hidden])~:not([hidden]),#alia-root .space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(16px * var(--tw-space-x-reverse));margin-left:calc(16px * calc(1 - var(--tw-space-x-reverse)))}:host .space-y-0\\.5>:not([hidden])~:not([hidden]),#alia-root .space-y-0\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2px * var(--tw-space-y-reverse))}:host .space-y-1>:not([hidden])~:not([hidden]),#alia-root .space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4px * var(--tw-space-y-reverse))}:host .space-y-2>:not([hidden])~:not([hidden]),#alia-root .space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * var(--tw-space-y-reverse))}:host .space-y-3>:not([hidden])~:not([hidden]),#alia-root .space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(12px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(12px * var(--tw-space-y-reverse))}:host .space-y-4>:not([hidden])~:not([hidden]),#alia-root .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(16px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(16px * var(--tw-space-y-reverse))}:host .space-y-6>:not([hidden])~:not([hidden]),#alia-root .space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(24px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(24px * var(--tw-space-y-reverse))}:host .self-center,#alia-root .self-center{align-self:center}:host .overflow-hidden,#alia-root .overflow-hidden{overflow:hidden}:host .overflow-scroll,#alia-root .overflow-scroll{overflow:scroll}:host .rounded,#alia-root .rounded{border-radius:4px}:host .rounded-full,#alia-root .rounded-full{border-radius:9999px}:host .rounded-lg,#alia-root .rounded-lg{border-radius:var(--border-radius-lg)}:host .border,#alia-root .border{border-width:1px}:host .border-2,#alia-root .border-2{border-width:2px}:host .border-\\[2px\\],#alia-root .border-\\[2px\\]{border-width:2px}:host .border-solid,#alia-root .border-solid{border-style:solid}:host .border-none,#alia-root .border-none{border-style:none}:host .border-accent,#alia-root .border-accent{border-color:rgb(var(--accent-color) / 1)}:host .border-accent-200,#alia-root .border-accent-200{border-color:rgb(var(--accent-color) / .3)}:host .border-accent-foreground,#alia-root .border-accent-foreground{border-color:rgb(var(--accent-foreground) / 1)}:host .border-transparent,#alia-root .border-transparent{border-color:transparent}:host .border-t-white,#alia-root .border-t-white{--tw-border-opacity: 1;border-top-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}:host .bg-accent,#alia-root .bg-accent{background-color:rgb(var(--accent-color) / 1)}:host .bg-accent-100,#alia-root .bg-accent-100{background-color:rgb(var(--accent-color) / .2)}:host .bg-accent-200,#alia-root .bg-accent-200{background-color:rgb(var(--accent-color) / .3)}:host .bg-accent-600,#alia-root .bg-accent-600{background-color:rgb(var(--accent-color) / .7)}:host .bg-accent-800,#alia-root .bg-accent-800{background-color:rgb(var(--accent-color) / .9)}:host .bg-accent-900,#alia-root .bg-accent-900{background-color:rgb(var(--accent-color) / 1)}:host .bg-background,#alia-root .bg-background{background-color:rgb(var(--background-color) / 1)}:host .bg-background-300,#alia-root .bg-background-300{background-color:rgb(var(--background-color) / .4)}:host .bg-gray-200,#alia-root .bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}:host .bg-primary-400,#alia-root .bg-primary-400{background-color:rgb(var(--primary-color) / .5)}:host .bg-primary-50,#alia-root .bg-primary-50{background-color:rgb(var(--primary-color) / .1)}:host .bg-transparent,#alia-root .bg-transparent{background-color:transparent}:host .object-cover,#alia-root .object-cover{-o-object-fit:cover;object-fit:cover}:host .p-3,#alia-root .p-3{padding:12px}:host .p-4,#alia-root .p-4{padding:16px}:host .p-5,#alia-root .p-5{padding:20px}:host .px-1,#alia-root .px-1{padding-left:4px;padding-right:4px}:host .px-2,#alia-root .px-2{padding-left:8px;padding-right:8px}:host .px-2\\.5,#alia-root .px-2\\.5{padding-left:10px;padding-right:10px}:host .px-5,#alia-root .px-5{padding-left:20px;padding-right:20px}:host .py-2,#alia-root .py-2{padding-top:8px;padding-bottom:8px}:host .py-px,#alia-root .py-px{padding-top:1px;padding-bottom:1px}:host .pb-2,#alia-root .pb-2{padding-bottom:8px}:host .pb-8,#alia-root .pb-8{padding-bottom:32px}:host .pl-0\\.5,#alia-root .pl-0\\.5{padding-left:2px}:host .pt-1,#alia-root .pt-1{padding-top:4px}:host .pt-2,#alia-root .pt-2{padding-top:8px}:host .text-center,#alia-root .text-center{text-align:center}:host .font-mono,#alia-root .font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}:host .text-\\[28px\\],#alia-root .text-\\[28px\\]{font-size:28px}:host .text-base,#alia-root .text-base{font-size:var(--body-text-size-base);line-height:var(--body-line-height-base);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-normal)}:host .text-lg,#alia-root .text-lg{font-size:var(--body-text-size-lg);line-height:var(--body-line-height-lg);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-normal)}:host .text-sm,#alia-root .text-sm{font-size:var(--body-text-size-sm);line-height:var(--body-line-height-sm);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-medium)}:host .text-xl,#alia-root .text-xl{font-size:var(--body-text-size-xl);line-height:var(--body-line-height-xl);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-medium)}:host .text-xs,#alia-root .text-xs{font-size:var(--body-text-size-xs);line-height:var(--body-line-height-xs);letter-spacing:var(--body-letter-spacing);font-weight:500}:host .font-bold,#alia-root .font-bold{font-weight:var(--body-font-weight-bold)}:host .font-medium,#alia-root .font-medium{font-weight:var(--body-font-weight-medium)}:host .font-normal,#alia-root .font-normal{font-weight:var(--body-font-weight-normal)}:host .font-semibold,#alia-root .font-semibold{font-weight:var(--body-font-weight-semibold)}:host .uppercase,#alia-root .uppercase{text-transform:uppercase}:host .\\!normal-case,#alia-root .\\!normal-case{text-transform:none!important}:host .italic,#alia-root .italic{font-style:italic}:host .leading-4,#alia-root .leading-4{line-height:16px}:host .leading-5,#alia-root .leading-5{line-height:20px}:host .leading-6,#alia-root .leading-6{line-height:24px}:host .leading-7,#alia-root .leading-7{line-height:28px}:host .tracking-tight,#alia-root .tracking-tight{letter-spacing:-.025em}:host .tracking-wide,#alia-root .tracking-wide{letter-spacing:.025em}:host .text-accent,#alia-root .text-accent{color:rgb(var(--accent-color) / 1)}:host .text-accent-foreground,#alia-root .text-accent-foreground{color:rgb(var(--accent-foreground) / 1)}:host .text-black,#alia-root .text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}:host .text-primary-300,#alia-root .text-primary-300{color:rgb(var(--primary-color) / .4)}:host .text-primary-400,#alia-root .text-primary-400{color:rgb(var(--primary-color) / .5)}:host .text-primary-500,#alia-root .text-primary-500{color:rgb(var(--primary-color) / .6)}:host .text-primary-600,#alia-root .text-primary-600{color:rgb(var(--primary-color) / .7)}:host .text-red-600,#alia-root .text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}:host .text-red-700,#alia-root .text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}:host .text-white,#alia-root .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}:host .underline,#alia-root .underline{text-decoration-line:underline}:host .opacity-0,#alia-root .opacity-0{opacity:0}:host .opacity-60,#alia-root .opacity-60{opacity:.6}:host .shadow,#alia-root .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:host .shadow-2xl,#alia-root .shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:host .shadow-lg,#alia-root .shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:host .outline-none,#alia-root .outline-none{outline:2px solid transparent;outline-offset:2px}:host .outline,#alia-root .outline{outline-style:solid}:host .ring-2,#alia-root .ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}:host .ring-accent-300,#alia-root .ring-accent-300{--tw-ring-color: rgb(var(--accent-color) / .4)}:host .ring-accent-900,#alia-root .ring-accent-900{--tw-ring-color: rgb(var(--accent-color) / 1)}:host .\\!filter,#alia-root .\\!filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}:host .filter,#alia-root .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:host .backdrop-blur-sm,#alia-root .backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}:host .backdrop-brightness-75,#alia-root .backdrop-brightness-75{--tw-backdrop-brightness: brightness(.75);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}:host .transition,#alia-root .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .transition-\\[transform\\,color\\,background-color\\,opacity\\,box-shadow\\],#alia-root .transition-\\[transform\\,color\\,background-color\\,opacity\\,box-shadow\\]{transition-property:transform,color,background-color,opacity,box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .transition-all,#alia-root .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .transition-opacity,#alia-root .transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .duration-100,#alia-root .duration-100{transition-duration:.1s}:host .duration-1000,#alia-root .duration-1000{transition-duration:1s}:host .duration-150,#alia-root .duration-150{transition-duration:.15s}:host .duration-200,#alia-root .duration-200{transition-duration:.2s}:host .duration-300,#alia-root .duration-300{transition-duration:.3s}:host .ease-in,#alia-root .ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}:host .scrollbar-hide,#alia-root .scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}:host .scrollbar-hide::-webkit-scrollbar,#alia-root .scrollbar-hide::-webkit-scrollbar{display:none}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}:host .duration-100,#alia-root .duration-100{animation-duration:.1s}:host .duration-1000,#alia-root .duration-1000{animation-duration:1s}:host .duration-150,#alia-root .duration-150{animation-duration:.15s}:host .duration-200,#alia-root .duration-200{animation-duration:.2s}:host .duration-300,#alia-root .duration-300{animation-duration:.3s}:host .ease-in,#alia-root .ease-in{animation-timing-function:cubic-bezier(.4,0,1,1)}:host .animation-duration-150,#alia-root .animation-duration-150{animation-duration:.15s}:host .text-start,#alia-root .text-start{text-align:start}:host .text-display-xs,#alia-root .text-display-xs{font-family:var(--display-font);font-size:var(--display-text-size-xs);line-height:var(--display-line-height-xs);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .text-display-sm,#alia-root .text-display-sm{font-family:var(--display-font);font-size:var(--display-text-size-sm);line-height:var(--display-line-height-sm);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .text-display,#alia-root .text-display{font-family:var(--display-font);font-size:var(--display-text-size-base);line-height:var(--display-line-height-base);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .text-display-lg,#alia-root .text-display-lg{font-family:var(--display-font);font-size:var(--display-text-size-lg);line-height:var(--display-line-height-lg);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .text-display-xl,#alia-root .text-display-xl{font-family:var(--display-font);font-size:var(--display-text-size-xl);line-height:var(--display-line-height-xl);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host code,#alia-root code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}:host .main,#alia-root .main{transition-property:opacity,transform}:host .main.animate-dimensions,#alia-root .main.animate-dimensions{transition-property:opacity,transform,width,height}:host .bulge:hover,#alia-root .bulge:hover{transform:scale(1.02)}:host .box,#alia-root .box{border-radius:var(--border-radius-lg);background-color:rgb(var(--primary-color) / .1);padding:16px;--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;animation-duration:.3s}:host .box.theme,#alia-root .box.theme{background-color:rgb(var(--accent-color) / .2);--tw-shadow-color: rgb(var(--accent-color) / .1);--tw-shadow: var(--tw-shadow-colored)}:host .box.theme:hover,#alia-root .box.theme:hover{--tw-shadow-color: rgb(var(--accent-color) / .1);--tw-shadow: var(--tw-shadow-colored)}:host .box.disabled,#alia-root .box.disabled{pointer-events:none;opacity:.7}:host .box.clickable,#alia-root .box.clickable{cursor:pointer}:host .box.clickable:hover,#alia-root .box.clickable:hover{--tw-scale-x: 1.01;--tw-scale-y: 1.01;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-shadow-color: rgb(var(--accent-color) / .1);--tw-shadow: var(--tw-shadow-colored)}:host .fade-bottom,#alia-root .fade-bottom{position:relative}:host .fade-bottom:after,#alia-root .fade-bottom:after{content:"";position:absolute;z-index:1;bottom:0;left:0;pointer-events:none;background-image:linear-gradient(to bottom,#fff0,#f9fafb 95%);width:100%;height:2em}:host .prose>:first-child,#alia-root .prose>:first-child{margin-top:0}:host .prose>:has(>img),#alia-root .prose>:has(>img){display:flex;justify-content:center}:host .prose li::marker,#alia-root .prose li::marker{margin-right:0;color:rgb(var(--primary-color) / .5)}:host .shadow-bottom,#alia-root .shadow-bottom{box-shadow:0 6px 4px -4px #ddd}:host .pulse,#alia-root .pulse{animation:pulse 1.5s infinite}@keyframes pulse{0%{transform:scale(1)}40%{transform:scale(1.02)}to{transform:scale(1)}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-up{0%{translate:0 12px}to{translate:0 0}}@keyframes fade-down{0%{translate:0 -12px}to{translate:0 0}}@keyframes fade-left{0%{translate:12px}to{translate:0}}@keyframes fade-right{0%{translate:-12px}to{translate:0}}@keyframes slide-up{0%{translate:0 100%}to{translate:0 0}}@keyframes slide-down{0%{translate:0 -100%}to{translate:0 0}}@keyframes slide-left{0%{translate:100%}to{translate:0}}@keyframes slide-right{0%{translate:-100%}to{translate:0}}:host .animate-fade-in,#alia-root .animate-fade-in{animation-name:fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-fade-in-up,#alia-root .animate-fade-in-up{animation-name:fade-up,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-fade-in-down,#alia-root .animate-fade-in-down{animation-name:fade-down,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-fade-in-left,#alia-root .animate-fade-in-left{animation-name:fade-left,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-fade-in-right,#alia-root .animate-fade-in-right{animation-name:fade-right,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-slide-up,#alia-root .animate-slide-up{animation-name:slide-up,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-slide-down,#alia-root .animate-slide-down{animation-name:slide-down,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-slide-left,#alia-root .animate-slide-left{animation-name:slide-left,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-slide-right,#alia-root .animate-slide-right{animation-name:slide-right,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-500,#alia-root .slide-in-500{animation-duration:.5s;animation-name:fade-up,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-down-500,#alia-root .slide-in-down-500{animation-duration:.5s;animation-name:fade-down,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-left-500,#alia-root .slide-in-left-500{animation-duration:.5s;animation-name:fade-left,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-right-500,#alia-root .slide-in-right-500{animation-duration:.5s;animation-name:fade-right,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-500-delay-1000,#alia-root .slide-in-500-delay-1000{animation-delay:1s;animation-duration:.5s;animation-name:fade-up,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-down-500-delay-1000,#alia-root .slide-in-down-500-delay-1000{animation-delay:1s;animation-duration:.5s;animation-name:fade-down,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-left-500-delay-1000,#alia-root .slide-in-left-500-delay-1000{animation-delay:1s;animation-duration:.5s;animation-name:fade-left,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-right-500-delay-1000,#alia-root .slide-in-right-500-delay-1000{animation-delay:1s;animation-duration:.5s;animation-name:fade-right,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-full-1000,#alia-root .slide-in-full-1000{animation-duration:1s;animation-name:slide-up,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-down-full-1000,#alia-root .slide-in-down-full-1000{animation-duration:1s;animation-name:slide-down,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-left-full-1000,#alia-root .slide-in-left-full-1000{animation-duration:1s;animation-name:slide-left,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-right-full-1000,#alia-root .slide-in-right-full-1000{animation-duration:1s;animation-name:slide-right,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .fade-in-90-2000,#alia-root .fade-in-90-2000{opacity:0;animation-fill-mode:forwards;animation-name:fade-in;animation-delay:1.8s;animation-duration:.2s}:host .animatable,#alia-root .animatable{transition:all .3s ease-in-out}:host .pending-entrance,#alia-root .pending-entrance{--tw-translate-y: -4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:0}:host .skeleton,#alia-root .skeleton{border-radius:var(--border-radius-lg);background-color:rgb(var(--accent-color) / 1);color:rgb(var(--accent-color) / 1);opacity:.3}@media (hover: hover){:host .shiny,#alia-root .shiny{position:relative;overflow:hidden}:host .shiny:before,#alia-root .shiny:before{z-index:100;content:"";position:absolute;display:block;width:50%;height:100%;background:linear-gradient(90deg,transparent,#ffffff20,transparent);transform:translate(-240px) skew(-20deg);transition:transform .5s ease-in-out;pointer-events:none}:host .shiny:hover:before,#alia-root .shiny:hover:before{transform:translate(30%) skew(-20deg)}:host .shiny-disabled:before,#alia-root .shiny-disabled:before{display:none!important}}:host .popup,#alia-root .popup{display:none}@media (min-width: 600px){:host .popup,#alia-root .popup{display:block}}:host .PhoneInputInput,#alia-root .PhoneInputInput{outline:none;background:none}:host .checked\\:border-accent-400:checked,#alia-root .checked\\:border-accent-400:checked{border-color:rgb(var(--accent-color) / .5)}:host .checked\\:border-accent-800:checked,#alia-root .checked\\:border-accent-800:checked{border-color:rgb(var(--accent-color) / .9)}:host .checked\\:bg-accent-800:checked,#alia-root .checked\\:bg-accent-800:checked{background-color:rgb(var(--accent-color) / .9)}:host .focus-within\\:text-accent:focus-within,#alia-root .focus-within\\:text-accent:focus-within{color:rgb(var(--accent-color) / 1)}:host .hover\\:scale-\\[1\\.01\\]:hover,#alia-root .hover\\:scale-\\[1\\.01\\]:hover{--tw-scale-x: 1.01;--tw-scale-y: 1.01;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host .focus\\:ring-2:focus,#alia-root .focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}:host .disabled\\:pointer-events-none:disabled,#alia-root .disabled\\:pointer-events-none:disabled{pointer-events:none}:host .disabled\\:cursor-default:disabled,#alia-root .disabled\\:cursor-default:disabled{cursor:default}:host .disabled\\:opacity-50:disabled,#alia-root .disabled\\:opacity-50:disabled{opacity:.5}:host .group:hover .group-hover\\:translate-x-1,#alia-root .group:hover .group-hover\\:translate-x-1{--tw-translate-x: 4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host .peer:checked~.peer-checked\\:visible,#alia-root .peer:checked~.peer-checked\\:visible{visibility:visible}:host .peer:checked~.peer-checked\\:flex,#alia-root .peer:checked~.peer-checked\\:flex{display:flex}:host .peer:disabled~.peer-disabled\\:cursor-default,#alia-root .peer:disabled~.peer-disabled\\:cursor-default{cursor:default}:host .prose-h1\\:mb-3 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h1\\:mb-3 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:12px}:host .prose-h1\\:mt-3\\.5 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h1\\:mt-3\\.5 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:14px}:host .prose-h1\\:text-display-xl :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h1\\:text-display-xl :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){font-family:var(--display-font);font-size:var(--display-text-size-xl);line-height:var(--display-line-height-xl);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .prose-h2\\:mb-2 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h2\\:mb-2 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:8px}:host .prose-h2\\:mt-2\\.5 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h2\\:mt-2\\.5 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:10px}:host .prose-h2\\:text-display-lg :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h2\\:text-display-lg :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){font-family:var(--display-font);font-size:var(--display-text-size-lg);line-height:var(--display-line-height-lg);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .prose-h3\\:mb-1\\.5 :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h3\\:mb-1\\.5 :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:6px}:host .prose-h3\\:mt-2 :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h3\\:mt-2 :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:8px}:host .prose-h3\\:text-display :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h3\\:text-display :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))){font-family:var(--display-font);font-size:var(--display-text-size-base);line-height:var(--display-line-height-base);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .prose-h4\\:my-1\\.5 :is(:where(h4):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h4\\:my-1\\.5 :is(:where(h4):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:6px;margin-bottom:6px}:host .prose-h4\\:text-display-sm :is(:where(h4):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h4\\:text-display-sm :is(:where(h4):not(:where([class~=not-prose],[class~=not-prose] *))){font-family:var(--display-font);font-size:var(--display-text-size-sm);line-height:var(--display-line-height-sm);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .prose-h5\\:my-1\\.5 :is(:where(h5):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h5\\:my-1\\.5 :is(:where(h5):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:6px;margin-bottom:6px}:host .prose-h5\\:text-display-xs :is(:where(h5):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h5\\:text-display-xs :is(:where(h5):not(:where([class~=not-prose],[class~=not-prose] *))){font-family:var(--display-font);font-size:var(--display-text-size-xs);line-height:var(--display-line-height-xs);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .prose-h6\\:my-1\\.5 :is(:where(h6):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h6\\:my-1\\.5 :is(:where(h6):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:6px;margin-bottom:6px}:host .prose-h6\\:text-display-xs :is(:where(h6):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h6\\:text-display-xs :is(:where(h6):not(:where([class~=not-prose],[class~=not-prose] *))){font-family:var(--display-font);font-size:var(--display-text-size-xs);line-height:var(--display-line-height-xs);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .prose-p\\:mb-3 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-p\\:mb-3 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:12px}:host .prose-p\\:mt-2 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-p\\:mt-2 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:8px}:host .prose-p\\:text-lg :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-p\\:text-lg :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:var(--body-text-size-lg);line-height:var(--body-line-height-lg);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-normal)}:host .prose-p\\:leading-6 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-p\\:leading-6 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){line-height:24px}:host .prose-a\\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-a\\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:underline}:host .prose-ol\\:my-2 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ol\\:my-2 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:8px;margin-bottom:8px}:host .prose-ol\\:ml-6 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ol\\:ml-6 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){margin-left:24px}:host .prose-ol\\:list-decimal :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ol\\:list-decimal :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){list-style-type:decimal}:host .prose-ol\\:text-lg :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ol\\:text-lg :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:var(--body-text-size-lg);line-height:var(--body-line-height-lg);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-normal)}:host .prose-ul\\:my-2 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ul\\:my-2 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:8px;margin-bottom:8px}:host .prose-ul\\:ml-6 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ul\\:ml-6 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){margin-left:24px}:host .prose-ul\\:list-disc :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ul\\:list-disc :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){list-style-type:disc}:host .prose-ul\\:text-lg :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ul\\:text-lg :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:var(--body-text-size-lg);line-height:var(--body-line-height-lg);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-normal)}:host .prose-li\\:my-1 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-li\\:my-1 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:4px;margin-bottom:4px}:host .prose-li\\:leading-6 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-li\\:leading-6 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){line-height:24px}:host .prose-img\\:my-3 :is(:where(img):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-img\\:my-3 :is(:where(img):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:12px;margin-bottom:12px}:host .prose-img\\:rounded-lg :is(:where(img):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-img\\:rounded-lg :is(:where(img):not(:where([class~=not-prose],[class~=not-prose] *))){border-radius:var(--border-radius-lg)}',App=()=>{var l;const{preview:e,initialData:t}=useCustomerAppContext(),[r,n]=reactExports.useState(0);reactExports.useEffect(()=>{const c=h=>{h.persisted&&n(m=>m+1)};return window.addEventListener("pageshow",c),()=>{window.removeEventListener("pageshow",c)}},[]);const i=reactExports.useRef(new QueryClient({defaultOptions:{queries:{suspense:!0,useErrorBoundary:!0,staleTime:e?1/0:30*1e3,enabled:e?!1:void 0}}})),s=useCSS(appCSSRaw);return jsx(DefaultWindowSizeProvider,{children:jsxs(ToastProvider,{children:[jsx("style",{id:`customer-app-css-${(l=t==null?void 0:t.userFlow)==null?void 0:l.flowID}`,children:s}),jsx(QueryClientProvider,{client:i.current,children:jsx(reactExports.Suspense,{fallback:null,children:jsx(CommonErrorBoundary,{children:e?jsx(PopupPreview,{}):jsx(UserFlow,{})})})})]})},r)};function polyfillLocalstorage(){try{window.localStorage.setItem("alia-test","test")}catch{Object.defineProperty(window,"localStorage",{value:{_data:{},setItem:function(t,r){return this._data[t]=String(r)},getItem:function(t){return Object.prototype.hasOwnProperty.call(this._data,t)?this._data[t]:void 0},removeItem:function(t){return delete this._data[t]},clear:function(){return this._data={}}}})}}polyfillLocalstorage();const{Provider,useContext}=createContextWithoutDefault("customer-app"),useCustomerAppContext=useContext,CustomerAppContextProvider=Provider;window.mountAliaCustomerApp=mount;function mount({target:e,messages:t,shop:r,jwt:n,useShadowDOM:i,initialData:s,targetingArgs:l,preview:c,mediator:h}){var N;e.style.outline="none",e.style.display="none";const m=`alia-root-${((N=s.userFlow)==null?void 0:N.flowID)??0}`;e.id=m;let b,S;i?(b=e.shadowRoot??e.attachShadow({mode:"open"}),S=":host"):(b=e,S=`#${m}`);const w=ReactDOM.createRoot(b),_=P=>{e.style.display=P?"block":"none"};return w.render(jsx(CustomerAppContextProvider,{value:{messages:t,root:b,rootSelector:S,shop:r,jwt:n,setFrameStyles:I,setVisible:_,preview:c,initialData:s,targetingArgs:l,mediator:h},children:jsx(App,{})})),()=>{w.unmount(),Array.from(b.children).forEach(P=>{b.removeChild(P)})};function I({modal:P,styles:F,bodyStyles:j}){const q=[];return f(e,F),c||(f(getDocument().body,j),P&&v(e)),()=>q.forEach(g=>g());function f(g,C){const $=R=>R.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();for(const[R,A]of Object.entries(C))A===void 0?g.style.removeProperty($(R)):g.style.setProperty($(R),A);q.push(()=>{f(g,Object.fromEntries(Object.entries(C).map(([R])=>[R,void 0])))})}function v(g){g.setAttribute("tabindex","-1"),g.focus(),g.setAttribute("aria-modal","true"),g.setAttribute("role","dialog"),g.setAttribute("aria-label","Alia popup"),C(g),q.push(()=>{g.removeAttribute("aria-modal"),g.removeAttribute("role"),g.removeAttribute("aria-label")});function C($){const R=setTimeout(()=>{const M=getDocument().activeElement;$.contains(M)||$.focus()},500),A=M=>{if(M.key==="Tab"){const re=getDocument().activeElement;if(re instanceof HTMLElement&&$.contains(re)){const K=$.querySelectorAll("a[href], button, input, textarea, select, details, [tabindex]:not([tabindex='-1'])"),ee=[$,...Array.from(K)].indexOf(re)%K.length,T=K[ee];T&&T instanceof HTMLElement&&(T.focus(),M.preventDefault())}}};getDocument().addEventListener("keydown",A),q.push(()=>{clearTimeout(R),getDocument().removeEventListener("keydown",A)})}}}}return exports.CustomerAppContextProvider=CustomerAppContextProvider,exports.useCustomerAppContext=useCustomerAppContext,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports}({});