@debales/ai 1.1.12 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,11 +46,11 @@ Error generating stack: `+f.message+`
46
46
  *
47
47
  * This source code is licensed under the MIT license found in the
48
48
  * LICENSE file in the root directory of this source tree.
49
- */var wE;function v9(){if(wE)return Nc;wE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var a=null;if(o!==void 0&&(a=""+o),i.key!==void 0&&(a=""+i.key),"key"in i){o={};for(var u in i)u!=="key"&&(o[u]=i[u])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:a,ref:i!==void 0?i:null,props:o}}return Nc.Fragment=t,Nc.jsx=n,Nc.jsxs=n,Nc}var SE;function y9(){return SE||(SE=1,Ny.exports=v9()),Ny.exports}var E=y9(),fo,be=typeof window<"u"?window:void 0,yi=typeof globalThis<"u"?globalThis:be,CE=Array.prototype,EE=CE.forEach,kE=CE.indexOf,Oi=yi==null?void 0:yi.navigator,st=yi==null?void 0:yi.document,_i=yi==null?void 0:yi.location,By=yi==null?void 0:yi.fetch,Py=yi!=null&&yi.XMLHttpRequest&&"withCredentials"in new yi.XMLHttpRequest?yi.XMLHttpRequest:void 0,AE=yi==null?void 0:yi.AbortController,sr=Oi==null?void 0:Oi.userAgent,At=be??{},Yo={DEBUG:!1,LIB_VERSION:"1.235.0"},Fy="$copy_autocapture",_9=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];(function(e){e.GZipJS="gzip-js",e.Base64="base64"})(fo||(fo={}));var b9=["fatal","error","warning","log","info","debug"];function zt(e,t){return e.indexOf(t)!==-1}var vh=function(e){return e.trim()},zy=function(e){return e.replace(/^\$/,"")},x9=Array.isArray,IE=Object.prototype,TE=IE.hasOwnProperty,yh=IE.toString,qn=x9||function(e){return yh.call(e)==="[object Array]"},ho=e=>typeof e=="function",Hn=e=>e===Object(e)&&!qn(e),Dl=e=>{if(Hn(e)){for(var t in e)if(TE.call(e,t))return!1;return!0}return!1},rt=e=>e===void 0,lr=e=>yh.call(e)=="[object String]",Uy=e=>lr(e)&&e.trim().length===0,$a=e=>e===null,pn=e=>rt(e)||$a(e),li=e=>yh.call(e)=="[object Number]",Da=e=>yh.call(e)==="[object Boolean]",w9=e=>e instanceof FormData,S9=e=>zt(_9,e),ME=e=>{var t={_log:function(n){if(be&&(Yo.DEBUG||At.POSTHOG_DEBUG)&&!rt(be.console)&&be.console){for(var r=("__rrweb_original__"in be.console[n])?be.console[n].__rrweb_original__:be.console[n],i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];r(e,...o)}},info:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t._log("log",...r)},warn:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t._log("warn",...r)},error:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t._log("error",...r)},critical:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning:n=>{t.error("You must initialize PostHog before calling ".concat(n))},createLogger:n=>ME("".concat(e," ").concat(n))};return t},pt=ME("[PostHog.js]"),Zr=pt.createLogger,C9=Zr("[ExternalScriptsLoader]"),OE=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return C9.warn("".concat(t," was requested but loading of external scripts is disabled.")),n("Loading of external scripts is disabled");var r=st==null?void 0:st.querySelectorAll("script");if(r){for(var i=0;i<r.length;i++)if(r[i].src===t)return n()}var o=()=>{if(!st)return n("document not found");var a=st.createElement("script");if(a.type="text/javascript",a.crossOrigin="anonymous",a.src=t,a.onload=d=>n(void 0,d),a.onerror=d=>n(d),e.config.prepare_external_dependency_script&&(a=e.config.prepare_external_dependency_script(a)),!a)return n("prepare_external_dependency_script returned null");var u,c=st.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)===null||u===void 0||u.insertBefore(a,c[0]):st.body.appendChild(a)};st!=null&&st.body?o():st==null||st.addEventListener("DOMContentLoaded",o)};function RE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RE(Object(n),!0).forEach(function(r){Ve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $E(e,t){if(e==null)return{};var n,r,i=function(a,u){if(a==null)return{};var c,d,p={},h=Object.keys(a);for(d=0;d<h.length;d++)c=h[d],u.indexOf(c)>=0||(p[c]=a[c]);return p}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}At.__PosthogExtensions__=At.__PosthogExtensions__||{},At.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r="/static/".concat(t,".js")+"?v=".concat(e.version);if(t==="remote-config"&&(r="/array/".concat(e.config.token,"/config.js")),t==="toolbar"){var i=3e5,o=Math.floor(Date.now()/i)*i;r="".concat(r,"&t=").concat(o)}var a=e.requestRouter.endpointFor("assets",r);OE(e,a,n)},At.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);OE(e,r,n)};var _h={};function La(e,t,n){if(qn(e)){if(EE&&e.forEach===EE)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===_h)return}}}function wn(e,t,n){if(!pn(e)){if(qn(e))return La(e,t,n);if(w9(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===_h)return}else for(var i in e)if(TE.call(e,i)&&t.call(n,e[i],i)===_h)return}}var ur=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return La(n,function(i){for(var o in i)i[o]!==void 0&&(e[o]=i[o])}),e},bh=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return La(n,function(i){La(i,function(o){e.push(o)})}),e};function xh(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var DE=function(e){try{return e()}catch{return}},E9=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(i){pt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),pt.critical(i)}}},Bc=function(e){var t={};return wn(e,function(n,r){lr(n)&&n.length>0&&(t[r]=n)}),t};function k9(e,t){return n=e,r=o=>lr(o)&&!$a(t)?o.slice(0,t):o,i=new Set,function o(a,u){return a!==Object(a)?r?r(a,u):a:i.has(a)?void 0:(i.add(a),qn(a)?(c=[],La(a,d=>{c.push(o(d))})):(c={},wn(a,(d,p)=>{i.has(d)||(c[p]=o(d,p))})),c);var c}(n);var n,r,i}var A9=["herokuapp.com","vercel.app","netlify.app"];function I9(e){var t=e==null?void 0:e.hostname;if(!lr(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of A9)if(n===r)return!1;return!0}function LE(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function tr(e,t,n,r){var{capture:i=!1,passive:o=!0}=r??{};e==null||e.addEventListener(t,n,{capture:i,passive:o})}var NE="$people_distinct_id",Pc="__alias",Fc="__timers",BE="$autocapture_disabled_server_side",jy="$heatmaps_enabled_server_side",PE="$exception_capture_enabled_server_side",FE="$web_vitals_enabled_server_side",zE="$dead_clicks_enabled_server_side",UE="$web_vitals_allowed_metrics",qy="$session_recording_enabled_server_side",jE="$console_log_recording_enabled_server_side",qE="$session_recording_network_payload_capture",HE="$session_recording_masking",GE="$session_recording_canvas_recording",VE="$replay_sample_rate",ZE="$replay_minimum_duration",YE="$replay_script_config",wh="$sesid",zc="$session_is_sampled",Hy="$session_recording_url_trigger_activated_session",Gy="$session_recording_event_trigger_activated_session",Ll="$enabled_feature_flags",Sh="$early_access_features",Vy="$feature_flag_details",Uc="$stored_person_properties",Ps="$stored_group_properties",Zy="$surveys",Ch="$surveys_activated",Eh="$flag_call_reported",Wo="$user_state",Yy="$client_session_props",Wy="$capture_rate_limit",Ky="$initial_campaign_params",Qy="$initial_referrer_info",Xy="$initial_person_info",kh="$epp",WE="__POSTHOG_TOOLBAR__",KE="$posthog_cookieless",T9=[NE,Pc,"__cmpns",Fc,qy,jy,wh,Ll,Wo,Sh,Vy,Ps,Uc,Zy,Eh,Yy,Wy,Ky,Qy,kh];function QE(e){var t;return e instanceof Element&&(e.id===WE||!((t=e.closest)===null||t===void 0||!t.call(e,".toolbar-global-fade-container")))}function Ah(e){return!!e&&e.nodeType===1}function Na(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function XE(e){return!!e&&e.nodeType===3}function JE(e){return!!e&&e.nodeType===11}function Jy(e){return e?vh(e).split(/\s+/):[]}function ek(e){var t=be==null?void 0:be.location.href;return!!(t&&e&&e.some(n=>t.match(n)))}function Ih(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Jy(t)}function tk(e){return pn(e)?null:vh(e).split(/(\s+)/).filter(t=>Nl(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Th(e){var t="";return t_(e)&&!ik(e)&&e.childNodes&&e.childNodes.length&&wn(e.childNodes,function(n){var r;XE(n)&&n.textContent&&(t+=(r=tk(n.textContent))!==null&&r!==void 0?r:"")}),vh(t)}function nk(e){return rt(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var e_=["a","button","form","input","select","textarea","label"];function rk(e){var t=e.parentNode;return!(!t||!Ah(t))&&t}function M9(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!be||!e||Na(e,"html")||!Ah(e)||n!=null&&n.url_allowlist&&!ek(n.url_allowlist)||n!=null&&n.url_ignorelist&&ek(n.url_ignorelist))return!1;if(n!=null&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some(v=>t.type===v))return!1}for(var a=!1,u=[e],c=!0,d=e;d.parentNode&&!Na(d,"body");)if(JE(d.parentNode))u.push(d.parentNode.host),d=d.parentNode.host;else{if(!(c=rk(d)))break;if(r||e_.indexOf(c.tagName.toLowerCase())>-1)a=!0;else{var p=be.getComputedStyle(c);p&&p.getPropertyValue("cursor")==="pointer"&&(a=!0)}u.push(c),d=c}if(!function(v,_){var S=_==null?void 0:_.element_allowlist;if(rt(S))return!0;var x=function(k){if(S.some(A=>k.tagName.toLowerCase()===A))return{v:!0}};for(var b of v){var C=x(b);if(typeof C=="object")return C.v}return!1}(u,n)||!function(v,_){var S=_==null?void 0:_.css_selector_allowlist;if(rt(S))return!0;var x=function(k){if(S.some(A=>k.matches(A)))return{v:!0}};for(var b of v){var C=x(b);if(typeof C=="object")return C.v}return!1}(u,n))return!1;var h=be.getComputedStyle(e);if(h&&h.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var m=e.tagName.toLowerCase();switch(m){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return a?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(e_.indexOf(m)>-1||e.getAttribute("contenteditable")==="true")}}function t_(e){for(var t=e;t.parentNode&&!Na(t,"body");t=t.parentNode){var n=Ih(t);if(zt(n,"ph-sensitive")||zt(n,"ph-no-capture"))return!1}if(zt(Ih(e),"ph-include"))return!0;var r=e.type||"";if(lr(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!(lr(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function ik(e){return!!(Na(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Na(e,"select")||Na(e,"textarea")||e.getAttribute("contenteditable")==="true")}var ok="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",O9=new RegExp("^(?:".concat(ok,")$")),R9=new RegExp(ok),ak="\\d{3}-?\\d{2}-?\\d{4}",$9=new RegExp("^(".concat(ak,")$")),D9=new RegExp("(".concat(ak,")"));function Nl(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(pn(e)||lr(e)&&(e=vh(e),(t?O9:R9).test((e||"").replace(/[- ]/g,""))||(t?$9:D9).test(e)))}function sk(e){var t=Th(e);return Nl(t="".concat(t," ").concat(lk(e)).trim())?t:""}function lk(e){var t="";return e&&e.childNodes&&e.childNodes.length&&wn(e.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{var i=Th(n);t="".concat(t," ").concat(i).trim(),n.childNodes&&n.childNodes.length&&(t="".concat(t," ").concat(lk(n)).trim())}catch(o){pt.error("[AutoCapture]",o)}}),t}function L9(e){return function(t){var n=t.map(r=>{var i,o,a="";if(r.tag_name&&(a+=r.tag_name),r.attr_class)for(var u of(r.attr_class.sort(),r.attr_class))a+=".".concat(u.replace(/"/g,""));var c=Ee(Ee(Ee(Ee({},r.text?{text:r.text}:{}),{},{"nth-child":(i=r.nth_child)!==null&&i!==void 0?i:0,"nth-of-type":(o=r.nth_of_type)!==null&&o!==void 0?o:0},r.href?{href:r.href}:{}),r.attr_id?{attr_id:r.attr_id}:{}),r.attributes),d={};return xh(c).sort((p,h)=>{var[m]=p,[v]=h;return m.localeCompare(v)}).forEach(p=>{var[h,m]=p;return d[uk(h.toString())]=uk(m.toString())}),a+=":",a+=xh(c).map(p=>{var[h,m]=p;return"".concat(h,'="').concat(m,'"')}).join("")});return n.join(";")}(function(t){return t.map(n=>{var r,i,o={text:(r=n.$el_text)===null||r===void 0?void 0:r.slice(0,400),tag_name:n.tag_name,href:(i=n.attr__href)===null||i===void 0?void 0:i.slice(0,2048),attr_class:N9(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return xh(n).filter(a=>{var[u]=a;return u.indexOf("attr__")===0}).forEach(a=>{var[u,c]=a;return o.attributes[u]=c}),o})}(e))}function uk(e){return e.replace(/"|\\"/g,'\\"')}function N9(e){var t=e.attr__class;return t?qn(t)?t:Jy(t):void 0}class ck{constructor(){this.clicks=[]}isRageClick(t,n,r){var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(n-i.y)<30&&r-i.timestamp<1e3){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var B9=["localhost","127.0.0.1"],Bl=e=>{var t=st==null?void 0:st.createElement("a");return rt(t)?null:(t.href=e,t)},P9=function(e){var t,n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",i=[];return wn(e,function(o,a){rt(o)||rt(a)||a==="undefined"||(t=encodeURIComponent((u=>u instanceof File)(o)?o.name:o.toString()),n=encodeURIComponent(a),i[i.length]=n+"="+t)}),i.join(r)},Mh=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!qn(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{pt.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},n_=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),i=r[0]||"",o=r[1],a=i.split("?"),u=a[1],c=a[0],d=(u||"").split("&"),p=[],h=0;h<d.length;h++){var m=d[h].split("=");qn(m)&&(t.includes(m[0])?p.push(m[0]+"="+n):p.push(d[h]))}var v=c;return u!=null&&(v+="?"+p.join("&")),o!=null&&(v+="#"+o),v},Oh=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},fk=Zr("[AutoCapture]");function r_(e,t){return t.length>e?t.slice(0,e)+"...":t}function F9(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Ah(t));return t}function z9(e,t,n,r){var i=e.tagName.toLowerCase(),o={tag_name:i};e_.indexOf(i)>-1&&!n&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?o.$el_text=r_(1024,sk(e)):o.$el_text=r_(1024,Th(e)));var a=Ih(e);a.length>0&&(o.classes=a.filter(function(p){return p!==""})),wn(e.attributes,function(p){var h;if((!ik(e)||["name","id","class","aria-label"].indexOf(p.name)!==-1)&&(r==null||!r.includes(p.name))&&!t&&Nl(p.value)&&(h=p.name,!lr(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var m=p.value;p.name==="class"&&(m=Jy(m).join(" ")),o["attr__"+p.name]=r_(1024,m)}});for(var u=1,c=1,d=e;d=F9(d);)u++,d.tagName===e.tagName&&c++;return o.nth_child=u,o.nth_of_type=c,o}function U9(e,t){for(var n,r,{e:i,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:u,elementsChainAsString:c}=t,d=[e],p=e;p.parentNode&&!Na(p,"body");)JE(p.parentNode)?(d.push(p.parentNode.host),p=p.parentNode.host):(d.push(p.parentNode),p=p.parentNode);var h,m=[],v={},_=!1,S=!1;if(wn(d,A=>{var I=t_(A);A.tagName.toLowerCase()==="a"&&(_=A.getAttribute("href"),_=I&&_&&Nl(_)&&_),zt(Ih(A),"ph-no-capture")&&(S=!0),m.push(z9(A,o,a,u));var $=function(B){if(!t_(B))return{};var U={};return wn(B.attributes,function(G){if(G.name&&G.name.indexOf("data-ph-capture-attribute")===0){var P=G.name.replace("data-ph-capture-attribute-",""),K=G.value;P&&K&&Nl(K)&&(U[P]=K)}}),U}(A);ur(v,$)}),S)return{props:{},explicitNoCapture:S};if(a||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?m[0].$el_text=sk(e):m[0].$el_text=Th(e)),_){var x,b;m[0].attr__href=_;var C=(x=Bl(_))===null||x===void 0?void 0:x.host,k=be==null||(b=be.location)===null||b===void 0?void 0:b.host;C&&k&&C!==k&&(h=_)}return{props:ur({$event_type:i.type,$ce_version:1},c?{}:{$elements:m},{$elements_chain:L9(m)},(n=m[0])!==null&&n!==void 0&&n.$el_text?{$el_text:(r=m[0])===null||r===void 0?void 0:r.$el_text}:{},h&&i.type==="click"?{$external_click_url:h}:{},v)}}class j9{constructor(t){Ve(this,"_initialized",!1),Ve(this,"_isDisabledServerSide",null),Ve(this,"rageclicks",new ck),Ve(this,"_elementsChainAsString",!1),this.instance=t,this._elementSelectors=null}get config(){var t,n,r=Hn(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(t=r.url_allowlist)===null||t===void 0?void 0:t.map(i=>new RegExp(i)),r.url_ignorelist=(n=r.url_ignorelist)===null||n===void 0?void 0:n.map(i=>new RegExp(i)),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if(be&&st){var t=r=>{r=r||(be==null?void 0:be.event);try{this._captureEvent(r)}catch(i){fk.error("Failed to capture event",i)}};if(tr(st,"submit",t,{capture:!0}),tr(st,"change",t,{capture:!0}),tr(st,"click",t,{capture:!0}),this.config.capture_copied_text){var n=r=>{r=r||(be==null?void 0:be.event),this._captureEvent(r,Fy)};tr(st,"copy",n,{capture:!0}),tr(st,"cut",n,{capture:!0})}}}else fk.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this._elementsChainAsString=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[BE]:!!t.autocapture_opt_out}),this._isDisabledServerSide=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this._elementSelectors=t}getElementSelectors(t){var n,r=[];return(n=this._elementSelectors)===null||n===void 0||n.forEach(i=>{var o=st==null?void 0:st.querySelectorAll(i);o==null||o.forEach(a=>{t===a&&r.push(i)})}),r}get isEnabled(){var t,n,r=(t=this.instance.persistence)===null||t===void 0?void 0:t.props[BE],i=this._isDisabledServerSide;if($a(i)&&!Da(r)&&!this.instance.config.advanced_disable_decide)return!1;var o=(n=this._isDisabledServerSide)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!o}_captureEvent(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,i=nk(t);XE(i)&&(i=i.parentNode||null),n==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this._captureEvent(t,"$rageclick");var o=n===Fy;if(i&&M9(i,t,this.config,o,o?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:u}=U9(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(u)return!1;var c=this.getElementSelectors(i);if(c&&c.length>0&&(a.$element_selectors=c),n===Fy){var d,p=tk(be==null||(d=be.getSelection())===null||d===void 0?void 0:d.toString()),h=t.type||"clipboard";if(!p)return!1;a.$selected_content=p,a.$copy_type=h}return this.instance.capture(n,a),!0}}}isBrowserSupported(){return ho(st==null?void 0:st.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return li(e)&&isFinite(e)&&Math.floor(e)===e});var dk="0123456789abcdef";class Rh{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new Rh(o)}toString(){for(var t="",n=0;n<this.bytes.length;n++)t=t+dk.charAt(this.bytes[n]>>>4)+dk.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Rh(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;n<16;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class q9{constructor(){Ve(this,"timestamp",0),Ve(this,"counter",0),Ve(this,"random",new H9)}generate(){var t=this.generateOrAbort();if(rt(t)){this.timestamp=0;var n=this.generateOrAbort();if(rt(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.timestamp)this.timestamp=t,this.resetCounter();else{if(!(t+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Rh.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}var hk,pk=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};be&&!rt(be.crypto)&&crypto.getRandomValues&&(pk=e=>crypto.getRandomValues(e));class H9{constructor(){Ve(this,"buffer",new Uint32Array(8)),Ve(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(pk(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}var Ba=()=>G9().toString(),G9=()=>(hk||(hk=new q9)).generate(),V9="Thu, 01 Jan 1970 00:00:00 GMT",jc="",Z9=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Y9(e,t){if(t){var n=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:st;if(jc)return jc;if(!o||["localhost","127.0.0.1"].includes(i))return"";for(var a=i.split("."),u=Math.min(a.length,8),c="dmn_chk_"+Ba(),d=new RegExp("(^|;)\\s*"+c+"=1");!jc&&u--;){var p=a.slice(u).join("."),h=c+"=1;domain=."+p;o.cookie=h,d.test(o.cookie)&&(o.cookie=h+";expires="+V9,jc=p)}return jc}(e);if(!n){var r=(i=>{var o=i.match(Z9);return o?o[0]:""})(e);r!==n&&pt.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var Pa,Ko={is_supported:()=>!!st,error:function(e){pt.error("cookieStore error: "+e)},get:function(e){if(st){try{for(var t=e+"=",n=st.cookie.split(";").filter(o=>o.length),r=0;r<n.length;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}},parse:function(e){var t;try{t=JSON.parse(Ko.get(e))||{}}catch{}return t},set:function(e,t,n,r,i){if(st)try{var o="",a="",u=Y9(st.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+24*n*60*60*1e3),o="; expires="+c.toUTCString()}i&&(a="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+u+a;return d.length>3686.4&&pt.warn("cookieStore warning: large cookie, len="+d.length),st.cookie=d,d}catch{return}},remove:function(e,t){try{Ko.set(e,"",-1,t)}catch{return}}},i_=null,_r={is_supported:function(){if(!$a(i_))return i_;var e=!0;if(rt(be))e=!1;else try{var t="__mplssupport__";_r.set(t,"xyz"),_r.get(t)!=='"xyz"'&&(e=!1),_r.remove(t)}catch{e=!1}return e||pt.error("localStorage unsupported; falling back to cookie store"),i_=e,e},error:function(e){pt.error("localStorage error: "+e)},get:function(e){try{return be==null?void 0:be.localStorage.getItem(e)}catch(t){_r.error(t)}return null},parse:function(e){try{return JSON.parse(_r.get(e))||{}}catch{}return null},set:function(e,t){try{be==null||be.localStorage.setItem(e,JSON.stringify(t))}catch(n){_r.error(n)}},remove:function(e){try{be==null||be.localStorage.removeItem(e)}catch(t){_r.error(t)}}},W9=["distinct_id",wh,zc,kh,Xy],$h=Ee(Ee({},_r),{},{parse:function(e){try{var t={};try{t=Ko.parse(e)||{}}catch{}var n=ur(t,JSON.parse(_r.get(e)||"{}"));return _r.set(e,n),n}catch{}return null},set:function(e,t,n,r,i,o){try{_r.set(e,t,void 0,void 0,o);var a={};W9.forEach(u=>{t[u]&&(a[u]=t[u])}),Object.keys(a).length&&Ko.set(e,a,n,r,i,o)}catch(u){_r.error(u)}},remove:function(e,t){try{be==null||be.localStorage.removeItem(e),Ko.remove(e,t)}catch(n){_r.error(n)}}}),Dh={},K9={is_supported:function(){return!0},error:function(e){pt.error("memoryStorage error: "+e)},get:function(e){return Dh[e]||null},parse:function(e){return Dh[e]||null},set:function(e,t){Dh[e]=t},remove:function(e){delete Dh[e]}},Fs=null,Rr={is_supported:function(){if(!$a(Fs))return Fs;if(Fs=!0,rt(be))Fs=!1;else try{var e="__support__";Rr.set(e,"xyz"),Rr.get(e)!=='"xyz"'&&(Fs=!1),Rr.remove(e)}catch{Fs=!1}return Fs},error:function(e){pt.error("sessionStorage error: ",e)},get:function(e){try{return be==null?void 0:be.sessionStorage.getItem(e)}catch(t){Rr.error(t)}return null},parse:function(e){try{return JSON.parse(Rr.get(e))||null}catch{}return null},set:function(e,t){try{be==null||be.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){Rr.error(n)}},remove:function(e){try{be==null||be.sessionStorage.removeItem(e)}catch(t){Rr.error(t)}}};(function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"})(Pa||(Pa={}));class Q9{constructor(t){this.instance=t}get config(){return this.instance.config}get consent(){return this.getDnt()?Pa.DENIED:this.storedConsent}isOptedOut(){return this.consent===Pa.DENIED||this.consent===Pa.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(t){this.storage.set(this.storageKey,t?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:t,opt_out_capturing_cookie_prefix:n}=this.instance.config;return(n||"__ph_opt_in_out_")+t}get storedConsent(){var t=this.storage.get(this.storageKey);return t==="1"?Pa.GRANTED:t==="0"?Pa.DENIED:Pa.PENDING}get storage(){if(!this._storage){var t=this.config.opt_out_capturing_persistence_type;this._storage=t==="localStorage"?_r:Ko;var n=t==="localStorage"?Ko:_r;n.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(n.get(this.storageKey)==="1"),n.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!LE([Oi==null?void 0:Oi.doNotTrack,Oi==null?void 0:Oi.msDoNotTrack,At.doNotTrack],t=>zt([!0,1,"1","yes"],t))}}var Lh=Zr("[Dead Clicks]"),X9=()=>!0,J9=e=>{var t,n=!((t=e.instance.persistence)===null||t===void 0||!t.get_property(zE)),r=e.instance.config.capture_dead_clicks;return Da(r)?r:n};class gk{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[zE]:t==null?void 0:t.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(t){var n,r,i;(n=At.__PosthogExtensions__)!==null&&n!==void 0&&n.initDeadClicksAutocapture&&t(),(r=At.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"dead-clicks-autocapture",o=>{o?Lh.error("failed to load script",o):t()})}start(){var t;if(st){if(!this._lazyLoadedDeadClicksAutocapture&&(t=At.__PosthogExtensions__)!==null&&t!==void 0&&t.initDeadClicksAutocapture){var n=Hn(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=At.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this._lazyLoadedDeadClicksAutocapture.start(st),Lh.info("starting...")}}else Lh.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Lh.info("stopping..."))}}var o_=Zr("[ExceptionAutocapture]");class e8{constructor(t){var n;Ve(this,"startCapturing",()=>{var r;if(be&&this.isEnabled&&(r=At.__PosthogExtensions__)!==null&&r!==void 0&&r.errorWrappingFunctions){var i=At.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=At.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=At.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.unwrapOnError&&this.config.capture_unhandled_errors&&(this.unwrapOnError=i(this.captureException.bind(this))),!this.unwrapUnhandledRejection&&this.config.capture_unhandled_rejections&&(this.unwrapUnhandledRejection=o(this.captureException.bind(this))),!this.unwrapConsoleError&&this.config.capture_console_errors&&(this.unwrapConsoleError=a(this.captureException.bind(this)))}catch(u){o_.error("failed to start",u),this.stopCapturing()}}}),this.instance=t,this.remoteEnabled=!((n=this.instance.persistence)===null||n===void 0||!n.props[PE]),this.config=this.requiredConfig(),this.startIfEnabled()}requiredConfig(){var t=this.instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Hn(t)?n=Ee(Ee({},n),t):(rt(t)?this.remoteEnabled:t)&&(n=Ee(Ee({},n),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.config.capture_console_errors||this.config.capture_unhandled_errors||this.config.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(o_.info("enabled"),this.loadScript(this.startCapturing))}loadScript(t){var n,r,i;(n=At.__PosthogExtensions__)!==null&&n!==void 0&&n.errorWrappingFunctions&&t(),(r=At.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"exception-autocapture",o=>{if(o)return o_.error("failed to load script",o);t()})}stopCapturing(){var t,n,r;(t=this.unwrapOnError)===null||t===void 0||t.call(this),this.unwrapOnError=void 0,(n=this.unwrapUnhandledRejection)===null||n===void 0||n.call(this),this.unwrapUnhandledRejection=void 0,(r=this.unwrapConsoleError)===null||r===void 0||r.call(this),this.unwrapConsoleError=void 0}onRemoteConfig(t){var n=t.autocaptureExceptions;this.remoteEnabled=!!n||!1,this.config=this.requiredConfig(),this.instance.persistence&&this.instance.persistence.register({[PE]:this.remoteEnabled}),this.startIfEnabled()}captureException(t){var n=this.instance.requestRouter.endpointFor("ui");t.$exception_personURL="".concat(n,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(t)}}function mk(e){return!rt(Event)&&vk(e,Event)}function vk(e,t){try{return e instanceof t}catch{return!1}}function Nh(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function a_(e){return Nh(e,"DOMError")}var yk=/\(error: (.*)\)/,_k=50,Pl="?";function s_(e,t,n,r){var i={platform:"web:javascript",filename:e,function:t==="<anonymous>"?Pl:t,in_app:!0};return rt(n)||(i.lineno=n),rt(r)||(i.colno=r),i}var t8=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,n8=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,r8=/\((\S*)(?::(\d+))(?::(\d+))\)/,i8=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,o8=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,a8=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.sort((i,o)=>i[0]-o[0]).map(i=>i[1]);return function(i){for(var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=[],u=i.split(`
50
- `),c=o;c<u.length;c++){var d=u[c];if(!(d.length>1024)){var p=yk.test(d)?d.replace(yk,"$1"):d;if(!p.match(/\S*Error: /)){for(var h of r){var m=h(p);if(m){a.push(m);break}}if(a.length>=_k)break}}}return function(v){if(!v.length)return[];var _=Array.from(v);return _.reverse(),_.slice(0,_k).map(S=>Ee(Ee({},S),{},{filename:S.filename||s8(_).filename,function:S.function||Pl}))}(a)}}([30,e=>{var t=t8.exec(e);if(t){var[,n,r,i]=t;return s_(n,Pl,+r,+i)}var o=n8.exec(e);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=r8.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[u,c]=xk(o[1]||Pl,o[2]);return s_(c,u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,e=>{var t=i8.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=o8.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],i=t[1]||Pl;return[i,r]=xk(i,r),s_(r,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]);function s8(e){return e[e.length-1]||{}}var Bh,bk,l_,xk=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Pl,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]},l8=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function u_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=e.stacktrace||e.stack||"",r=function(a){return a&&u8.test(a.message)?1:0}(e);try{var i=a8,o=function(a,u){var c=function(d){var p=globalThis._posthogChunkIds;if(!p)return{};var h=Object.keys(p);return l_&&h.length===bk||(bk=h.length,l_=h.reduce((m,v)=>{Bh||(Bh={});var _=Bh[v];if(_)m[_[0]]=_[1];else for(var S=d(v),x=S.length-1;x>=0;x--){var b=S[x],C=b==null?void 0:b.filename,k=p[v];if(C&&k){m[C]=k,Bh[v]=[C,k];break}}return m},{})),l_}(u);return a.forEach(d=>{d.filename&&(d.chunk_id=c[d.filename])}),a}(i(n,r),i);return o.slice(0,o.length-t)}catch{}return[]}var u8=/Minified React error #\d+;/i;function c_(e,t){var n,r,i=u_(e),o=(n=t==null?void 0:t.handled)===null||n===void 0||n,a=(r=t==null?void 0:t.synthetic)!==null&&r!==void 0&&r;return{$exception_list:[{type:t!=null&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:function(u){var c=u.message;return c.error&&typeof c.error.message=="string"?String(c.error.message):String(c)}(e),stacktrace:{frames:i,type:"raw"},mechanism:{handled:o,synthetic:a}}],$exception_level:"error"}}function f_(e,t){var n,r,i,o=(n=t==null?void 0:t.handled)===null||n===void 0||n,a=(r=t==null?void 0:t.synthetic)===null||r===void 0||r,u={type:t!=null&&t.overrideExceptionType?t.overrideExceptionType:(i=t==null?void 0:t.defaultExceptionType)!==null&&i!==void 0?i:"Error",value:e||(t==null?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:a}};if(t!=null&&t.syntheticException){var c=u_(t.syntheticException,1);c.length&&(u.stacktrace={frames:c,type:"raw"})}return{$exception_list:[u],$exception_level:"error"}}function c8(e){return lr(e)&&!Uy(e)&&b9.indexOf(e)>=0}function f8(e,t){var n,r,i=(n=t==null?void 0:t.handled)===null||n===void 0||n,o=(r=t==null?void 0:t.synthetic)===null||r===void 0||r,a=t!=null&&t.overrideExceptionType?t.overrideExceptionType:mk(e)?e.constructor.name:"Error",u="Non-Error 'exception' captured with keys: ".concat(function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:40,m=Object.keys(p);if(m.sort(),!m.length)return"[object has no keys]";for(var v=m.length;v>0;v--){var _=m.slice(0,v).join(", ");if(!(_.length>h))return v===m.length||_.length<=h?_:"".concat(_.slice(0,h),"...")}return""}(e)),c={type:a,value:u,mechanism:{handled:i,synthetic:o}};if(t!=null&&t.syntheticException){var d=u_(t==null?void 0:t.syntheticException,1);d.length&&(c.stacktrace={frames:d,type:"raw"})}return{$exception_list:[c],$exception_level:c8(e.level)?e.level:"error"}}function d8(e,t){var{error:n,event:r}=e,i={$exception_list:[]},o=n||r;if(a_(o)||function(v){return Nh(v,"DOMException")}(o)){var a=o;if(function(v){return"stack"in v}(o))i=c_(o,t);else{var u=a.name||(a_(a)?"DOMError":"DOMException"),c=a.message?"".concat(u,": ").concat(a.message):u,d=a_(a)?"DOMError":"DOMException";i=f_(c,Ee(Ee({},t),{},{overrideExceptionType:d,defaultExceptionMessage:c}))}return"code"in a&&(i.$exception_DOMException_code="".concat(a.code)),i}if(function(v){return Nh(v,"ErrorEvent")}(o)&&o.error)return c_(o.error,t);if(function(v){switch(Object.prototype.toString.call(v)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return vk(v,Error)}}(o))return c_(o,t);if(function(v){return Nh(v,"Object")}(o)||mk(o))return f8(o,t);if(rt(n)&&lr(r)){var p="Error",h=r,m=r.match(l8);return m&&(p=m[1],h=m[2]),f_(h,Ee(Ee({},t),{},{overrideExceptionType:p,defaultExceptionMessage:h}))}return f_(o,t)}function Ph(e){var t,n;return((t=JSON.stringify(e,(n=[],function(r,i){if(Hn(i)){for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(i)?"[Circular]":(n.push(i),i)}return i})))===null||t===void 0?void 0:t.length)||0}function d_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),i=e.data.slice(n);return[d_({size:Ph(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),d_({size:Ph(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap(o=>o)}return[e]}var Qo=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Qo||{}),po=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(po||{}),h_="[SessionRecording]",p_="redacted",Fh={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},h8=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],p8=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],g8=["/s/","/e/","/i/"];function wk(e,t,n,r){if(pn(e))return e;var i=(t==null?void 0:t["content-length"])||function(o){return new Blob([o]).size}(e);return lr(i)&&(i=parseInt(i)),i>n?h_+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function Sk(e,t){if(pn(e))return e;var n=e;return Nl(n,!1)||(n=h_+" "+t+" body "+p_),wn(p8,r=>{var i,o;(i=n)!==null&&i!==void 0&&i.length&&((o=n)===null||o===void 0?void 0:o.indexOf(r))!==-1&&(n=h_+" "+t+" body "+p_+" as might contain: "+r)}),n}var m8=(e,t)=>{var n,r,i,o={payloadSizeLimitBytes:Fh.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Fh.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Fh.payloadHostDenyList]},a=e.session_recording.recordHeaders!==!1&&t.recordHeaders,u=e.session_recording.recordBody!==!1&&t.recordBody,c=e.capture_performance!==!1&&t.recordPerformance,d=(n=o,i=Math.min(1e6,(r=n.payloadSizeLimitBytes)!==null&&r!==void 0?r:1e6),m=>(m!=null&&m.requestBody&&(m.requestBody=wk(m.requestBody,m.requestHeaders,i,"Request")),m!=null&&m.responseBody&&(m.responseBody=wk(m.responseBody,m.responseHeaders,i,"Response")),m)),p=m=>{return d(((S,x)=>{var b,C=Bl(S.name),k=x.indexOf("http")===0?(b=Bl(x))===null||b===void 0?void 0:b.pathname:x;k==="/"&&(k="");var A=C==null?void 0:C.pathname.replace(k||"","");if(!(C&&A&&g8.some(I=>A.indexOf(I)===0)))return S})((_=(v=m).requestHeaders,pn(_)||wn(Object.keys(_??{}),S=>{h8.includes(S.toLowerCase())&&(_[S]=p_)}),v),e.api_host));var v,_},h=ho(e.session_recording.maskNetworkRequestFn);return h&&ho(e.session_recording.maskCapturedNetworkRequestFn)&&pt.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=m=>{var v=e.session_recording.maskNetworkRequestFn({url:m.name});return Ee(Ee({},m),{},{name:v==null?void 0:v.url})}),o.maskRequestFn=ho(e.session_recording.maskCapturedNetworkRequestFn)?m=>{var v,_,S,x=p(m);return x&&(v=(_=(S=e.session_recording).maskCapturedNetworkRequestFn)===null||_===void 0?void 0:_.call(S,x))!==null&&v!==void 0?v:void 0}:m=>function(v){if(!rt(v))return v.requestBody=Sk(v.requestBody,"Request"),v.responseBody=Sk(v.responseBody,"Response"),v}(p(m)),Ee(Ee(Ee({},Fh),o),{},{recordHeaders:a,recordBody:u,recordPerformance:c,recordInitialRequests:c})};function Hi(e,t,n,r,i){return t>n&&(pt.warn("min cannot be greater than max."),t=n),li(e)?e>n?(r&&pt.warn(r+" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(r&&pt.warn(r+" cannot be less than min: "+t+". Using min value instead."),t):e:(r&&pt.warn(r+" must be a number. using max or fallback. max: "+n+", fallback: "+i),Hi(i||n,t,n,r))}class v8{constructor(t){var n,r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ve(this,"bucketSize",100),Ve(this,"refillRate",10),Ve(this,"mutationBuckets",{}),Ve(this,"loggedTracker",{}),Ve(this,"refillBuckets",()=>{Object.keys(this.mutationBuckets).forEach(o=>{this.mutationBuckets[o]=this.mutationBuckets[o]+this.refillRate,this.mutationBuckets[o]>=this.bucketSize&&delete this.mutationBuckets[o]})}),Ve(this,"getNodeOrRelevantParent",o=>{var a=this.rrweb.mirror.getNode(o);if((a==null?void 0:a.nodeName)!=="svg"&&a instanceof Element){var u=a.closest("svg");if(u)return[this.rrweb.mirror.getId(u),u]}return[o,a]}),Ve(this,"numberOfChanges",o=>{var a,u,c,d,p,h,m,v;return((a=(u=o.removes)===null||u===void 0?void 0:u.length)!==null&&a!==void 0?a:0)+((c=(d=o.attributes)===null||d===void 0?void 0:d.length)!==null&&c!==void 0?c:0)+((p=(h=o.texts)===null||h===void 0?void 0:h.length)!==null&&p!==void 0?p:0)+((m=(v=o.adds)===null||v===void 0?void 0:v.length)!==null&&m!==void 0?m:0)}),Ve(this,"throttleMutations",o=>{if(o.type!==3||o.data.source!==0)return o;var a=o.data,u=this.numberOfChanges(a);a.attributes&&(a.attributes=a.attributes.filter(d=>{var p,h,m,[v,_]=this.getNodeOrRelevantParent(d.id);return this.mutationBuckets[v]===0?!1:(this.mutationBuckets[v]=(p=this.mutationBuckets[v])!==null&&p!==void 0?p:this.bucketSize,this.mutationBuckets[v]=Math.max(this.mutationBuckets[v]-1,0),this.mutationBuckets[v]===0&&(this.loggedTracker[v]||(this.loggedTracker[v]=!0,(h=(m=this.options).onBlockedNode)===null||h===void 0||h.call(m,v,_))),d)}));var c=this.numberOfChanges(a);return c!==0||u===c?o:void 0}),this.rrweb=t,this.options=i,this.refillRate=Hi((n=this.options.refillRate)!==null&&n!==void 0?n:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=Hi((r=this.options.bucketSize)!==null&&r!==void 0?r:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}}var Gi=Uint8Array,bi=Uint16Array,Fl=Uint32Array,g_=new Gi([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),m_=new Gi([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ck=new Gi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ek=function(e,t){for(var n=new bi(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Fl(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},kk=Ek(g_,2),y8=kk[0],v_=kk[1];y8[28]=258,v_[258]=28;for(var Ak=Ek(m_,0)[1],Ik=new bi(32768),Tn=0;Tn<32768;++Tn){var zs=(43690&Tn)>>>1|(21845&Tn)<<1;zs=(61680&(zs=(52428&zs)>>>2|(13107&zs)<<2))>>>4|(3855&zs)<<4,Ik[Tn]=((65280&zs)>>>8|(255&zs)<<8)>>>1}var qc=function(e,t,n){for(var r=e.length,i=0,o=new bi(t);i<r;++i)++o[e[i]-1];var a,u=new bi(t);for(i=0;i<t;++i)u[i]=u[i-1]+o[i-1]<<1;for(a=new bi(r),i=0;i<r;++i)a[i]=Ik[u[e[i]-1]++]>>>15-e[i];return a},Us=new Gi(288);for(Tn=0;Tn<144;++Tn)Us[Tn]=8;for(Tn=144;Tn<256;++Tn)Us[Tn]=9;for(Tn=256;Tn<280;++Tn)Us[Tn]=7;for(Tn=280;Tn<288;++Tn)Us[Tn]=8;var zh=new Gi(32);for(Tn=0;Tn<32;++Tn)zh[Tn]=5;var _8=qc(Us,9),b8=qc(zh,5),Tk=function(e){return(e/8>>0)+(7&e&&1)},Mk=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof bi?bi:e instanceof Fl?Fl:Gi)(n-t);return r.set(e.subarray(t,n)),r},Xo=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Hc=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},y_=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new Gi(0),0];if(i==1){var a=new Gi(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort(function(I,$){return I.f-$.f}),n.push({s:-1,f:25001});var u=n[0],c=n[1],d=0,p=1,h=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};p!=i-1;)u=n[n[d].f<n[h].f?d++:h++],c=n[d!=p&&n[d].f<n[h].f?d++:h++],n[p++]={s:-1,f:u.f+c.f,l:u,r:c};var m=o[0].s;for(r=1;r<i;++r)o[r].s>m&&(m=o[r].s);var v=new bi(m+1),_=__(n[p-1],v,0);if(_>t){r=0;var S=0,x=_-t,b=1<<x;for(o.sort(function(I,$){return v[$.s]-v[I.s]||I.f-$.f});r<i;++r){var C=o[r].s;if(!(v[C]>t))break;S+=b-(1<<_-v[C]),v[C]=t}for(S>>>=x;S>0;){var k=o[r].s;v[k]<t?S-=1<<t-v[k]++-1:++r}for(;r>=0&&S;--r){var A=o[r].s;v[A]==t&&(--v[A],++S)}_=t}return[new Gi(v),_]},__=function(e,t,n){return e.s==-1?Math.max(__(e.l,t,n+1),__(e.r,t,n+1)):t[e.s]=n},Ok=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new bi(++t),r=0,i=e[0],o=1,a=function(c){n[r++]=c},u=1;u<=t;++u)if(e[u]==i&&u!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[u]}return[n.subarray(0,r),t]},Gc=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},b_=function(e,t,n){var r=n.length,i=Tk(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},Rk=function(e,t,n,r,i,o,a,u,c,d,p){Xo(t,p++,n),++i[256];for(var h=y_(i,15),m=h[0],v=h[1],_=y_(o,15),S=_[0],x=_[1],b=Ok(m),C=b[0],k=b[1],A=Ok(S),I=A[0],$=A[1],B=new bi(19),U=0;U<C.length;++U)B[31&C[U]]++;for(U=0;U<I.length;++U)B[31&I[U]]++;for(var G=y_(B,7),P=G[0],K=G[1],re=19;re>4&&!P[Ck[re-1]];--re);var ue,Z,ie,V,Q=d+5<<3,ye=Gc(i,Us)+Gc(o,zh)+a,Te=Gc(i,m)+Gc(o,S)+a+14+3*re+Gc(B,P)+(2*B[16]+3*B[17]+7*B[18]);if(Q<=ye&&Q<=Te)return b_(t,p,e.subarray(c,c+d));if(Xo(t,p,1+(Te<ye)),p+=2,Te<ye){ue=qc(m,v),Z=m,ie=qc(S,x),V=S;var T=qc(P,K);for(Xo(t,p,k-257),Xo(t,p+5,$-1),Xo(t,p+10,re-4),p+=14,U=0;U<re;++U)Xo(t,p+3*U,P[Ck[U]]);p+=3*re;for(var X=[C,I],ve=0;ve<2;++ve){var L=X[ve];for(U=0;U<L.length;++U){var we=31&L[U];Xo(t,p,T[we]),p+=P[we],we>15&&(Xo(t,p,L[U]>>>5&127),p+=L[U]>>>12)}}}else ue=_8,Z=Us,ie=b8,V=zh;for(U=0;U<u;++U)if(r[U]>255){we=r[U]>>>18&31,Hc(t,p,ue[we+257]),p+=Z[we+257],we>7&&(Xo(t,p,r[U]>>>23&31),p+=g_[we]);var Ue=31&r[U];Hc(t,p,ie[Ue]),p+=V[Ue],Ue>3&&(Hc(t,p,r[U]>>>5&8191),p+=m_[Ue])}else Hc(t,p,ue[r[U]]),p+=Z[r[U]];return Hc(t,p,ue[256]),p+Z[256]},x8=new Fl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),w8=function(){for(var e=new Fl(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),S8=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=w8[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},C8=function(e,t,n,r,i){return function(o,a,u,c,d,p){var h=o.length,m=new Gi(c+h+5*(1+Math.floor(h/7e3))+d),v=m.subarray(c,m.length-d),_=0;if(!a||h<8)for(var S=0;S<=h;S+=65535){var x=S+65535;x<h?_=b_(v,_,o.subarray(S,x)):(v[S]=p,_=b_(v,_,o.subarray(S,h)))}else{for(var b=x8[a-1],C=b>>>13,k=8191&b,A=(1<<u)-1,I=new bi(32768),$=new bi(A+1),B=Math.ceil(u/3),U=2*B,G=function(He){return(o[He]^o[He+1]<<B^o[He+2]<<U)&A},P=new Fl(25e3),K=new bi(288),re=new bi(32),ue=0,Z=0,ie=(S=0,0),V=0,Q=0;S<h;++S){var ye=G(S),Te=32767&S,T=$[ye];if(I[Te]=T,$[ye]=Te,V<=S){var X=h-S;if((ue>7e3||ie>24576)&&X>423){_=Rk(o,v,0,P,K,re,Z,ie,Q,S-Q,_),ie=ue=Z=0,Q=S;for(var ve=0;ve<286;++ve)K[ve]=0;for(ve=0;ve<30;++ve)re[ve]=0}var L=2,we=0,Ue=k,de=Te-T&32767;if(X>2&&ye==G(S-de))for(var tt=Math.min(C,X)-1,Ze=Math.min(32767,S),lt=Math.min(258,X);de<=Ze&&--Ue&&Te!=T;){if(o[S+L]==o[S+L-de]){for(var gt=0;gt<lt&&o[S+gt]==o[S+gt-de];++gt);if(gt>L){if(L=gt,we=de,gt>tt)break;var je=Math.min(de,gt-2),Se=0;for(ve=0;ve<je;++ve){var Ye=S-de+ve+32768&32767,Qe=Ye-I[Ye]+32768&32767;Qe>Se&&(Se=Qe,T=Ye)}}}de+=(Te=T)-(T=I[Te])+32768&32767}if(we){P[ie++]=268435456|v_[L]<<18|Ak[we];var ot=31&v_[L],et=31&Ak[we];Z+=g_[ot]+m_[et],++K[257+ot],++re[et],V=S+L,++ue}else P[ie++]=o[S],++K[o[S]]}}_=Rk(o,v,p,P,K,re,Z,ie,Q,S-Q,_)}return Mk(m,0,c+Tk(_)+d)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)},x_=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},E8=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&x_(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},k8=function(e){return 10+(e.filename&&e.filename.length+1||0)};function $k(e,t){t===void 0&&(t={});var n=S8(),r=e.length;n.p(e);var i=C8(e,t,k8(t),8),o=i.length;return E8(i,t),x_(i,o-8,n.d()),x_(i,o-4,r),i}function Dk(e,t){var n=e.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new Gi(e.length+(e.length>>>1)),i=0,o=function(d){r[i++]=d},a=0;a<n;++a){if(i+5>r.length){var u=new Gi(i+8+(n-a<<1));u.set(r),r=u}var c=e.charCodeAt(a);c<128||t?o(c):c<2048?(o(192|c>>>6),o(128|63&c)):c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++a))>>>18),o(128|c>>>12&63),o(128|c>>>6&63),o(128|63&c)):(o(224|c>>>12),o(128|c>>>6&63),o(128|63&c))}return Mk(r,0,i)}function A8(e,t){return function(n){for(var r=0,i=0;i<n.length;i++)r=(r<<5)-r+n.charCodeAt(i),r|=0;return Math.abs(r)}(e)%100<Hi(100*t,0,100)}var Vc="[SessionRecording]",Yr=Zr(Vc);function Uh(){var e,t;return At==null||(e=At.__PosthogExtensions__)===null||e===void 0||(t=e.rrweb)===null||t===void 0?void 0:t.record}var I8=3e5,T8=[po.MouseMove,po.MouseInteraction,po.Scroll,po.ViewportResize,po.Input,po.TouchMove,po.MediaInteraction,po.Drag],Lk=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function js(e){return function(t,n){for(var r="",i=0;i<t.length;){var o=t[i++];r+=String.fromCharCode(o)}return r}($k(Dk(JSON.stringify(e))))}function Nk(e){return e.type===Qo.Custom&&e.data.tag==="sessionIdle"}function Bk(e,t){return t.some(n=>n.matching==="regex"&&new RegExp(n.url).test(e))}class M8{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(Vc+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var t,n;return this.triggerStatus==="trigger_pending"?6e4:(t=(n=this.instance.config.session_recording)===null||n===void 0?void 0:n.full_snapshot_interval_millis)!==null&&t!==void 0?t:I8}get isSampled(){var t=this.instance.get_property(zc);return Da(t)?t:null}get sessionDuration(){var t,n,r=(t=this.buffer)===null||t===void 0?void 0:t.data[((n=this.buffer)===null||n===void 0?void 0:n.data.length)-1],{sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i:null}get isRecordingEnabled(){var t=!!this.instance.get_property(qy),n=!this.instance.config.disable_session_recording;return be&&t&&n}get isConsoleLogCaptureEnabled(){var t=!!this.instance.get_property(jE),n=this.instance.config.enable_recording_console_log;return n??t}get canvasRecording(){var t,n,r,i,o,a,u=this.instance.config.session_recording.captureCanvas,c=this.instance.get_property(GE),d=(t=(n=u==null?void 0:u.recordCanvas)!==null&&n!==void 0?n:c==null?void 0:c.enabled)!==null&&t!==void 0&&t,p=(r=(i=u==null?void 0:u.canvasFps)!==null&&i!==void 0?i:c==null?void 0:c.fps)!==null&&r!==void 0?r:4,h=(o=(a=u==null?void 0:u.canvasQuality)!==null&&a!==void 0?a:c==null?void 0:c.quality)!==null&&o!==void 0?o:.4;if(typeof h=="string"){var m=parseFloat(h);h=isNaN(m)?.4:m}return{enabled:d,fps:Hi(p,0,12,"canvas recording fps",4),quality:Hi(h,0,1,"canvas recording quality",.4)}}get networkPayloadCapture(){var t,n,r=this.instance.get_property(qE),i={recordHeaders:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.recordHeaders,recordBody:(n=this.instance.config.session_recording)===null||n===void 0?void 0:n.recordBody},o=(i==null?void 0:i.recordHeaders)||(r==null?void 0:r.recordHeaders),a=(i==null?void 0:i.recordBody)||(r==null?void 0:r.recordBody),u=Hn(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,c=!!(Da(u)?u:r!=null&&r.capturePerformance);return o||a||c?{recordHeaders:o,recordBody:a,recordPerformance:c}:void 0}get masking(){var t,n,r,i,o,a,u=this.instance.get_property(HE),c={maskAllInputs:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.maskAllInputs,maskTextSelector:(n=this.instance.config.session_recording)===null||n===void 0?void 0:n.maskTextSelector,blockSelector:(r=this.instance.config.session_recording)===null||r===void 0?void 0:r.blockSelector},d=(i=c==null?void 0:c.maskAllInputs)!==null&&i!==void 0?i:u==null?void 0:u.maskAllInputs,p=(o=c==null?void 0:c.maskTextSelector)!==null&&o!==void 0?o:u==null?void 0:u.maskTextSelector,h=(a=c==null?void 0:c.blockSelector)!==null&&a!==void 0?a:u==null?void 0:u.blockSelector;return rt(d)&&rt(p)&&rt(h)?void 0:{maskAllInputs:d==null||d,maskTextSelector:p,blockSelector:h}}get sampleRate(){var t=this.instance.get_property(VE);return li(t)?t:null}get minimumDuration(){var t=this.instance.get_property(ZE);return li(t)?t:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this.isSampled===!1?"disabled":this._urlBlocked?"paused":pn(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":Da(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var t;return this._urlTriggers.length===0?"trigger_disabled":((t=this.instance)===null||t===void 0?void 0:t.get_property(Hy))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var t;return this._eventTriggers.length===0?"trigger_disabled":((t=this.instance)===null||t===void 0?void 0:t.get_property(Gy))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var t=this.eventTriggerStatus==="trigger_activated"||this.urlTriggerStatus==="trigger_activated",n=this.eventTriggerStatus==="trigger_pending"||this.urlTriggerStatus==="trigger_pending";return t?"trigger_activated":n?"trigger_pending":"trigger_disabled"}constructor(t){if(Ve(this,"queuedRRWebEvents",[]),Ve(this,"isIdle","unknown"),Ve(this,"_linkedFlagSeen",!1),Ve(this,"_lastActivityTimestamp",Date.now()),Ve(this,"_linkedFlag",null),Ve(this,"_removePageViewCaptureHook",void 0),Ve(this,"_onSessionIdListener",void 0),Ve(this,"_persistDecideOnSessionListener",void 0),Ve(this,"_samplingSessionListener",void 0),Ve(this,"_urlTriggers",[]),Ve(this,"_urlBlocklist",[]),Ve(this,"_urlBlocked",!1),Ve(this,"_eventTriggers",[]),Ve(this,"_removeEventTriggerCaptureHook",void 0),Ve(this,"_forceAllowLocalhostNetworkCapture",!1),Ve(this,"_onBeforeUnload",()=>{this._flushBuffer()}),Ve(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),Ve(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),Ve(this,"_onVisibilityChange",()=>{if(st!=null&&st.visibilityState){var i="window "+st.visibilityState;this._tryAddCustomEvent(i,{})}}),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Yr.error("started without valid sessionManager"),new Error(Vc+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(Vc+" cannot be used with __preview_experimental_cookieless_mode.");var{sessionId:n,windowId:r}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=n,this.windowId=r,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Yr.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(t){this.isRecordingEnabled?(this._startCapture(t),tr(be,"beforeunload",this._onBeforeUnload),tr(be,"offline",this._onOffline),tr(be,"online",this._onOnline),tr(be,"visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),pn(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",n=>{try{if(n.event==="$pageview"){var r=n!=null&&n.properties.$current_url?this._maskUrl(n==null?void 0:n.properties.$current_url):"";if(!r)return;this._tryAddCustomEvent("$pageview",{href:r})}}catch(i){Yr.error("Could not add $pageview to rrweb session",i)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((n,r,i)=>{var o,a,u,c;i&&(this._tryAddCustomEvent("$session_id_change",{sessionId:n,windowId:r,changeReason:i}),(o=this.instance)===null||o===void 0||(a=o.persistence)===null||a===void 0||a.unregister(Gy),(u=this.instance)===null||u===void 0||(c=u.persistence)===null||c===void 0||c.unregister(Hy))}))):this.stopRecording()}stopRecording(){var t,n,r,i;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,be==null||be.removeEventListener("beforeunload",this._onBeforeUnload),be==null||be.removeEventListener("offline",this._onOffline),be==null||be.removeEventListener("online",this._onOnline),be==null||be.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),(t=this._removePageViewCaptureHook)===null||t===void 0||t.call(this),this._removePageViewCaptureHook=void 0,(n=this._removeEventTriggerCaptureHook)===null||n===void 0||n.call(this),this._removeEventTriggerCaptureHook=void 0,(r=this._onSessionIdListener)===null||r===void 0||r.call(this),this._onSessionIdListener=void 0,(i=this._samplingSessionListener)===null||i===void 0||i.call(this),this._samplingSessionListener=void 0,Yr.info("stopped"))}_resetSampling(){var t;(t=this.instance.persistence)===null||t===void 0||t.unregister(zc)}makeSamplingDecision(t){var n,r=this.sessionId!==t,i=this.sampleRate;if(li(i)){var o=this.isSampled,a=r||!Da(o),u=a?A8(t,i):o;a&&(u?this._reportStarted("sampled"):Yr.warn("Sample rate (".concat(i,") has determined that this sessionId (").concat(t,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:i,isSampled:u})),(n=this.instance.persistence)===null||n===void 0||n.register({[zc]:u})}else this._resetSampling()}onRemoteConfig(t){var n,r,i,o,a,u;if(this._tryAddCustomEvent("$remote_config_received",t),this._persistRemoteConfig(t),this._linkedFlag=((n=t.sessionRecording)===null||n===void 0?void 0:n.linkedFlag)||null,(r=t.sessionRecording)!==null&&r!==void 0&&r.endpoint&&(this._endpoint=(u=t.sessionRecording)===null||u===void 0?void 0:u.endpoint),this._setupSampling(),!pn(this._linkedFlag)&&!this._linkedFlagSeen){var c=lr(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,d=lr(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((p,h)=>{var m=Hn(h)&&c in h,v=d?h[c]===d:m;v&&this._reportStarted("linked_flag_matched",{linkedFlag:c,linkedVariant:d}),this._linkedFlagSeen=v})}(i=t.sessionRecording)!==null&&i!==void 0&&i.urlTriggers&&(this._urlTriggers=t.sessionRecording.urlTriggers),(o=t.sessionRecording)!==null&&o!==void 0&&o.urlBlocklist&&(this._urlBlocklist=t.sessionRecording.urlBlocklist),(a=t.sessionRecording)!==null&&a!==void 0&&a.eventTriggers&&(this._eventTriggers=t.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){li(this.sampleRate)&&pn(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(t=>{this.makeSamplingDecision(t)}))}_persistRemoteConfig(t){if(this.instance.persistence){var n,r=this.instance.persistence,i=()=>{var o,a,u,c,d,p,h,m,v,_=(o=t.sessionRecording)===null||o===void 0?void 0:o.sampleRate,S=pn(_)?null:parseFloat(_);pn(S)&&this._resetSampling();var x=(a=t.sessionRecording)===null||a===void 0?void 0:a.minimumDurationMilliseconds;r.register({[qy]:!!t.sessionRecording,[jE]:(u=t.sessionRecording)===null||u===void 0?void 0:u.consoleLogRecordingEnabled,[qE]:Ee({capturePerformance:t.capturePerformance},(c=t.sessionRecording)===null||c===void 0?void 0:c.networkPayloadCapture),[HE]:(d=t.sessionRecording)===null||d===void 0?void 0:d.masking,[GE]:{enabled:(p=t.sessionRecording)===null||p===void 0?void 0:p.recordCanvas,fps:(h=t.sessionRecording)===null||h===void 0?void 0:h.canvasFps,quality:(m=t.sessionRecording)===null||m===void 0?void 0:m.canvasQuality},[VE]:S,[ZE]:rt(x)?null:x,[YE]:(v=t.sessionRecording)===null||v===void 0?void 0:v.scriptConfig})};i(),(n=this._persistDecideOnSessionListener)===null||n===void 0||n.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(i)}}log(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(n=this.instance.sessionRecording)===null||n===void 0||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:r,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}_startCapture(t){if(!rt(Object.assign)&&!rt(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var n,r;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),Uh()?this._onScriptLoaded():(n=At.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,this.scriptName,i=>{if(i)return Yr.error("could not load recorder",i);this._onScriptLoaded()}),Yr.info("starting"),this.status==="active"&&this._reportStarted(t||"recording_initialized")}}get scriptName(){var t,n,r;return((t=this.instance)===null||t===void 0||(n=t.persistence)===null||n===void 0||(r=n.get_property(YE))===null||r===void 0?void 0:r.script)||"recorder"}isInteractiveEvent(t){var n;return t.type===3&&T8.indexOf((n=t.data)===null||n===void 0?void 0:n.source)!==-1}_updateWindowAndSessionIds(t){var n=this.isInteractiveEvent(t);n||this.isIdle||t.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var r=!1;if(n&&(this._lastActivityTimestamp=t.timestamp,this.isIdle)){var i=this.isIdle==="unknown";this.isIdle=!1,i||(this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.isIdle){var{windowId:o,sessionId:a}=this.sessionManager.checkAndGetSessionAndWindowId(!n,t.timestamp),u=this.sessionId!==a,c=this.windowId!==o;this.windowId=o,this.sessionId=a,u||c?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):r&&this._scheduleFullSnapshot()}}_tryRRWebMethod(t){try{return t.rrwebMethod(),!0}catch(n){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt++,rrwebMethod:t.rrwebMethod}):Yr.warn("could not emit queued rrweb event.",n,t),!1}}_tryAddCustomEvent(t,n){return this._tryRRWebMethod(Lk(()=>Uh().addCustomEvent(t,n)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(Lk(()=>Uh().takeFullSnapshot()))}_onScriptLoaded(){var t,n,r,i,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},a=this.instance.config.session_recording;for(var[u,c]of Object.entries(a||{}))u in o&&(u==="maskInputOptions"?o.maskInputOptions=Ee({password:!0},c):o[u]=c);this.canvasRecording&&this.canvasRecording.enabled&&(o.recordCanvas=!0,o.sampling={canvas:this.canvasRecording.fps},o.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.masking&&(o.maskAllInputs=(n=this.masking.maskAllInputs)===null||n===void 0||n,o.maskTextSelector=(r=this.masking.maskTextSelector)!==null&&r!==void 0?r:void 0,o.blockSelector=(i=this.masking.blockSelector)!==null&&i!==void 0?i:void 0);var d=Uh();if(d){this.mutationRateLimiter=(t=this.mutationRateLimiter)!==null&&t!==void 0?t:new v8(d,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(h,m)=>{var v="Too many mutations on node '".concat(h,"'. Rate limiting. This could be due to SVG animations or something similar");Yr.info(v,{node:m}),this.log(Vc+" "+v,"warn")}});var p=this._gatherRRWebPlugins();this.stopRrweb=d(Ee({emit:h=>{this.onRRwebEmit(h)},plugins:p},o)),this._lastActivityTimestamp=Date.now(),this.isIdle=Da(this.isIdle)?this.isIdle:"unknown",this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:o,activePlugins:p.map(h=>h==null?void 0:h.name)}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else Yr.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this.isIdle!==!0){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},t))}}_gatherRRWebPlugins(){var t,n,r,i,o=[],a=(t=At.__PosthogExtensions__)===null||t===void 0||(n=t.rrwebPlugins)===null||n===void 0?void 0:n.getRecordConsolePlugin;a&&this.isConsoleLogCaptureEnabled&&o.push(a());var u=(r=At.__PosthogExtensions__)===null||r===void 0||(i=r.rrwebPlugins)===null||i===void 0?void 0:i.getRecordNetworkPlugin;return this.networkPayloadCapture&&ho(u)&&(!B9.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?o.push(u(m8(this.instance.config,this.networkPayloadCapture))):Yr.info("NetworkCapture not started because we are on localhost.")),o}onRRwebEmit(t){var n;if(this._processQueuedEvents(),t&&Hn(t)){if(t.type===Qo.Meta){var r=this._maskUrl(t.data.href);if(this._lastHref=r,!r)return;t.data.href=r}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),!this._urlBlocked||function(h){return h.type===Qo.Custom&&h.data.tag==="recording paused"}(t)){t.type===Qo.FullSnapshot&&this._scheduleFullSnapshot(),t.type===Qo.FullSnapshot&&this.triggerStatus==="trigger_pending"&&this.clearBuffer();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(t):t;if(i){var o=function(h){var m=h;if(m&&Hn(m)&&m.type===6&&Hn(m.data)&&m.data.plugin==="rrweb/console@1"){m.data.payload.payload.length>10&&(m.data.payload.payload=m.data.payload.payload.slice(0,10),m.data.payload.payload.push("...[truncated]"));for(var v=[],_=0;_<m.data.payload.payload.length;_++)m.data.payload.payload[_]&&m.data.payload.payload[_].length>2e3?v.push(m.data.payload.payload[_].slice(0,2e3)+"...[truncated]"):v.push(m.data.payload.payload[_]);return m.data.payload.payload=v,h}return h}(i);if(this._updateWindowAndSessionIds(o),this.isIdle!==!0||Nk(o)){if(Nk(o)){var a=o.data.payload;if(a){var u=a.lastActivityTimestamp,c=a.threshold;o.timestamp=u+c}}var d=(n=this.instance.config.session_recording.compress_events)===null||n===void 0||n?function(h){if(Ph(h)<1024)return h;try{if(h.type===Qo.FullSnapshot)return Ee(Ee({},h),{},{data:js(h.data),cv:"2024-10"});if(h.type===Qo.IncrementalSnapshot&&h.data.source===po.Mutation)return Ee(Ee({},h),{},{cv:"2024-10",data:Ee(Ee({},h.data),{},{texts:js(h.data.texts),attributes:js(h.data.attributes),removes:js(h.data.removes),adds:js(h.data.adds)})});if(h.type===Qo.IncrementalSnapshot&&h.data.source===po.StyleSheetRule)return Ee(Ee({},h),{},{cv:"2024-10",data:Ee(Ee({},h.data),{},{adds:h.data.adds?js(h.data.adds):void 0,removes:h.data.removes?js(h.data.removes):void 0})})}catch(m){Yr.error("could not compress event - will use uncompressed event",m)}return h}(o):o,p={$snapshot_bytes:Ph(d),$snapshot_data:d,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(p):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&be){var t=this._maskUrl(be.location.href);this._lastHref!==t&&(this._tryAddCustomEvent("$url_changed",{href:t}),this._lastHref=t)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var t=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],t.forEach(n=>{Date.now()-n.enqueuedAt<=2e3&&this._tryRRWebMethod(n)})}}_maskUrl(t){var n=this.instance.config.session_recording;if(n.maskNetworkRequestFn){var r,i={url:t};return(r=i=n.maskNetworkRequestFn(i))===null||r===void 0?void 0:r.url}return t}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,n=this.sessionDuration,r=li(n)&&n>=0,i=li(t)&&r&&n<t;return this.status==="buffering"||this.status==="paused"||this.status==="disabled"||i?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&d_(this.buffer).forEach(o=>{this._captureSnapshot({$snapshot_bytes:o.size,$snapshot_data:o.data,$session_id:o.sessionId,$window_id:o.windowId,$lib:"web",$lib_version:Yo.LIB_VERSION})}),this.clearBuffer())}_captureSnapshotBuffered(t){var n,r=2+(((n=this.buffer)===null||n===void 0?void 0:n.data.length)||0);!this.isIdle&&(this.buffer.size+t.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=t.$snapshot_bytes,this.buffer.data.push(t.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(t){this.instance.capture("$snapshot",t,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(be!==void 0&&be.location.href){var t=be.location.href,n=this._urlBlocked,r=Bk(t,this._urlBlocklist);r&&!n?this._pauseRecording():!r&&n&&this._resumeRecording(),Bk(t,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(t){var n,r;this.triggerStatus==="trigger_pending"&&((n=this.instance)===null||n===void 0||(r=n.persistence)===null||r===void 0||r.register({[t==="url"?Hy:Gy]:this.sessionId}),this._flushBuffer(),this._reportStarted(t+"_trigger_matched"))}_pauseRecording(){this._urlBlocked||(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Yr.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){this._urlBlocked&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Yr.info("recording resumed"))}_addEventTriggerListener(){this._eventTriggers.length!==0&&pn(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",t=>{try{this._eventTriggers.includes(t.event)&&this._activateTrigger("event")}catch(n){Yr.error("Could not activate event trigger",n)}}))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var t;(t=this.instance.persistence)===null||t===void 0||t.register({[zc]:!0}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(t){this._activateTrigger(t)}_reportStarted(t,n){this.instance.register_for_session({$session_recording_start_reason:t}),Yr.info(t.replace("_"," "),n),zt(["recording_initialized","session_id_changed"],t)||this._tryAddCustomEvent(t,n)}}var w_=Zr("[SegmentIntegration]");function O8(e,t){var n=e.config.segment;if(!n)return t();(function(r,i){var o=r.config.segment;if(!o)return i();var a=c=>{var d=()=>c.anonymousId()||Ba();r.config.get_device_id=d,c.id()&&(r.register({distinct_id:c.id(),$device_id:d()}),r.persistence.set_property(Wo,"identified")),i()},u=o.user();"then"in u&&ho(u.then)?u.then(c=>a(c)):a(u)})(e,()=>{n.register((r=>{Promise&&Promise.resolve||w_.warn("This browser does not have Promise support, and can not use the segment integration");var i=(o,a)=>{var u;if(!a)return o;o.event.userId||o.event.anonymousId===r.get_distinct_id()||(w_.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(w_.info("UserId set, identifying with PostHog"),r.identify(o.event.userId));var c=r._calculate_event_properties(a,(u=o.event.properties)!==null&&u!==void 0?u:{},new Date);return o.event.properties=Object.assign({},c,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>i(o,o.event.event),page:o=>i(o,"$pageview"),identify:o=>i(o,"$identify"),screen:o=>i(o,"$screen")}})(e)).then(()=>{t()})})}var Pk="posthog-js";function Fk(e){var{organization:t,projectId:n,prefix:r,severityAllowList:i=["error"]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=>{var a,u,c,d,p;if(!(i==="*"||i.includes(o.level))||!e.__loaded)return o;o.tags||(o.tags={});var h=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));o.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var m=((a=o.exception)===null||a===void 0?void 0:a.values)||[],v=m.map(S=>Ee(Ee({},S),{},{stacktrace:S.stacktrace?Ee(Ee({},S.stacktrace),{},{type:"raw",frames:(S.stacktrace.frames||[]).map(x=>Ee(Ee({},x),{},{platform:"web:javascript"}))}):void 0})),_={$exception_message:((u=m[0])===null||u===void 0?void 0:u.value)||o.message,$exception_type:(c=m[0])===null||c===void 0?void 0:c.type,$exception_personURL:h,$exception_level:o.level,$exception_list:v,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((d=m[0])===null||d===void 0?void 0:d.value)||o.message,$sentry_exception_type:(p=m[0])===null||p===void 0?void 0:p.type,$sentry_tags:o.tags};return t&&n&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+o.event_id),e.exceptions.sendExceptionEvent(_),o}}class R8{constructor(t,n,r,i,o){this.name=Pk,this.setupOnce=function(a){a(Fk(t,{organization:n,projectId:r,prefix:i,severityAllowList:o}))}}}var Jo,$8=be!=null&&be.location?Oh(be.location.hash,"__posthog")||Oh(location.hash,"state"):null,zk="_postHogToolbarParams",Uk=Zr("[Toolbar]");(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"})(Jo||(Jo={}));class D8{constructor(t){this.instance=t}setToolbarState(t){At.ph_toolbar_state=t}getToolbarState(){var t;return(t=At.ph_toolbar_state)!==null&&t!==void 0?t:Jo.UNINITIALIZED}maybeLoadToolbar(){var t,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!be||!st)return!1;r=(t=r)!==null&&t!==void 0?t:be.location,o=(n=o)!==null&&n!==void 0?n:be.history;try{if(!i){try{be.localStorage.setItem("test","test"),be.localStorage.removeItem("test")}catch{return!1}i=be==null?void 0:be.localStorage}var a,u=$8||Oh(r.hash,"__posthog")||Oh(r.hash,"state"),c=u?DE(()=>JSON.parse(atob(decodeURIComponent(u))))||DE(()=>JSON.parse(decodeURIComponent(u))):null;return c&&c.action==="ph_authorize"?((a=c).source="url",a&&Object.keys(a).length>0&&(c.desiredHash?r.hash=c.desiredHash:o?o.replaceState(o.state,"",r.pathname+r.search):r.hash="")):((a=JSON.parse(i.getItem(zk)||"{}")).source="localstorage",delete a.userIntent),!(!a.token||this.instance.config.token!==a.token)&&(this.loadToolbar(a),!0)}catch{return!1}}_callLoadToolbar(t){var n=At.ph_load_toolbar||At.ph_load_editor;!pn(n)&&ho(n)?n(t,this.instance):Uk.warn("No toolbar load function found")}loadToolbar(t){var n=!(st==null||!st.getElementById(WE));if(!be||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=Ee(Ee({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(be.localStorage.setItem(zk,JSON.stringify(Ee(Ee({},i),{},{source:void 0}))),this.getToolbarState()===Jo.LOADED)this._callLoadToolbar(i);else if(this.getToolbarState()===Jo.UNINITIALIZED){var o,a;this.setToolbarState(Jo.LOADING),(o=At.__PosthogExtensions__)===null||o===void 0||(a=o.loadExternalDependency)===null||a===void 0||a.call(o,this.instance,"toolbar",u=>{if(u)return Uk.error("[Toolbar] Failed to load",u),void this.setToolbarState(Jo.UNINITIALIZED);this.setToolbarState(Jo.LOADED),this._callLoadToolbar(i)}),tr(be,"turbolinks:load",()=>{this.setToolbarState(Jo.UNINITIALIZED),this.loadToolbar(i)})}return!0}_loadEditor(t){return this.loadToolbar(t)}maybeLoadEditor(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(t,n,r)}}var L8=Zr("[TracingHeaders]");class N8{constructor(t){Ve(this,"_restoreXHRPatch",void 0),Ve(this,"_restoreFetchPatch",void 0),Ve(this,"_startCapturing",()=>{var n,r,i,o;rt(this._restoreXHRPatch)&&((n=At.__PosthogExtensions__)===null||n===void 0||(r=n.tracingHeadersPatchFns)===null||r===void 0||r._patchXHR(this.instance.sessionManager)),rt(this._restoreFetchPatch)&&((i=At.__PosthogExtensions__)===null||i===void 0||(o=i.tracingHeadersPatchFns)===null||o===void 0||o._patchFetch(this.instance.sessionManager))}),this.instance=t}_loadScript(t){var n,r,i;(n=At.__PosthogExtensions__)!==null&&n!==void 0&&n.tracingHeadersPatchFns&&t(),(r=At.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"tracing-headers",o=>{if(o)return L8.error("failed to load script",o);t()})}startIfEnabledOrStop(){var t,n;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((t=this._restoreXHRPatch)===null||t===void 0||t.call(this),(n=this._restoreFetchPatch)===null||n===void 0||n.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var Fa=Zr("[Web Vitals]"),jk=9e5;let B8=class{constructor(t){var n;Ve(this,"_enabledServerSide",!1),Ve(this,"_initialized",!1),Ve(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),Ve(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((r,i)=>Ee(Ee({},r),{},{["$web_vitals_".concat(i.name,"_event")]:Ee({},i),["$web_vitals_".concat(i.name,"_value")]:i.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),Ve(this,"_addToBuffer",r=>{var i,o=(i=this.instance.sessionManager)===null||i===void 0?void 0:i.checkAndGetSessionAndWindowId(!0);if(rt(o))Fa.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this._currentURL();rt(a)||(pn(r==null?void 0:r.name)||pn(r==null?void 0:r.value)?Fa.error("Invalid metric received",r):this._maxAllowedValue&&r.value>=this._maxAllowedValue?Fa.error("Ignoring metric with value >= "+this._maxAllowedValue,r):(this.buffer.url!==a&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),rt(this.buffer.url)&&(this.buffer.url=a),this.buffer.firstMetricTimestamp=rt(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(Ee(Ee({},r),{},{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),Ve(this,"_startCapturing",()=>{var r,i,o,a,u=At.__PosthogExtensions__;rt(u)||rt(u.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:i,onFCP:o,onINP:a}=u.postHogWebVitalsCallbacks),r&&i&&o&&a?(this.allowedMetrics.indexOf("LCP")>-1&&r(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this._addToBuffer.bind(this)),this._initialized=!0):Fa.error("web vitals callbacks not loaded - not starting")}),this.instance=t,this._enabledServerSide=!((n=this.instance.persistence)===null||n===void 0||!n.props[FE]),this.startIfEnabled()}get allowedMetrics(){var t,n,r=Hn(this.instance.config.capture_performance)?(t=this.instance.config.capture_performance)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return rt(r)?((n=this.instance.persistence)===null||n===void 0?void 0:n.props[UE])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Hn(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var t=Hn(this.instance.config.capture_performance)&&li(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:jk;return 0<t&&t<=6e4?jk:t}get isEnabled(){var t=_i==null?void 0:_i.protocol;if(t!=="http:"&&t!=="https:")return Fa.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=Hn(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Da(n)?n:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(Fa.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(t){var n=Hn(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Hn(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[FE]:n}),this.instance.persistence.register({[UE]:r})),this._enabledServerSide=n,this.startIfEnabled()}loadScript(t){var n,r,i;(n=At.__PosthogExtensions__)!==null&&n!==void 0&&n.postHogWebVitalsCallbacks&&t(),(r=At.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"web-vitals",o=>{o?Fa.error("failed to load script",o):t()})}_currentURL(){var t=be?be.location.href:void 0;return t||Fa.error("Could not determine current URL"),t}};var P8=Zr("[Heatmaps]");function qk(e){return Hn(e)&&"clientX"in e&&"clientY"in e&&li(e.clientX)&&li(e.clientY)}class F8{constructor(t){var n;Ve(this,"rageclicks",new ck),Ve(this,"_enabledServerSide",!1),Ve(this,"_initialized",!1),Ve(this,"_flushInterval",null),this.instance=t,this._enabledServerSide=!((n=this.instance.persistence)===null||n===void 0||!n.props[jy])}get flushIntervalMilliseconds(){var t=5e3;return Hn(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return rt(this.instance.config.capture_heatmaps)?rt(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;P8.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var t,n;clearInterval((t=this._flushInterval)!==null&&t!==void 0?t:void 0),(n=this.deadClicksCapture)===null||n===void 0||n.stop(),this.getAndClearBuffer()}}onRemoteConfig(t){var n=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[jy]:n}),this._enabledServerSide=n,this.startIfEnabled()}getAndClearBuffer(){var t=this.buffer;return this.buffer=void 0,t}_onDeadClick(t){this._onClick(t.originalEvent,"deadclick")}_setupListeners(){be&&st&&(tr(be,"beforeunload",this.flush.bind(this)),tr(st,"click",t=>this._onClick(t||(be==null?void 0:be.event)),{capture:!0}),tr(st,"mousemove",t=>this._onMouseMove(t||(be==null?void 0:be.event)),{capture:!0}),this.deadClicksCapture=new gk(this.instance,X9,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(t,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),a=function(u,c,d){for(var p=u;p&&Ah(p)&&!Na(p,"body");){if(p===d)return!1;if(zt(c,be==null?void 0:be.getComputedStyle(p).position))return!0;p=rk(p)}return!1}(nk(t),["fixed","sticky"],o);return{x:t.clientX+(a?0:i),y:t.clientY+(a?0:r),target_fixed:a,type:n}}_onClick(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"click";if(!QE(t.target)&&qk(t)){var i=this._getProperties(t,r);(n=this.rageclicks)!==null&&n!==void 0&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this._capture(Ee(Ee({},i),{},{type:"rageclick"})),this._capture(i)}}_onMouseMove(t){!QE(t.target)&&qk(t)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(t,"mousemove"))},500))}_capture(t){if(be){var n=be.location.href;this.buffer=this.buffer||{},this.buffer[n]||(this.buffer[n]=[]),this.buffer[n].push(t)}}flush(){this.buffer&&!Dl(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class z8{constructor(t){this._instance=t}doPageView(t,n){var r,i=this._previousPageViewProperties(t,n);return this._currentPageview={pathname:(r=be==null?void 0:be.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var n;return this._previousPageViewProperties(t,(n=this._currentPageview)===null||n===void 0?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this._currentPageview)===null||t===void 0?void 0:t.pageViewId}}_previousPageViewProperties(t,n){var r=this._currentPageview;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:u,maxScrollY:c,maxContentHeight:d,lastContentY:p,maxContentY:h}=o;if(!(rt(a)||rt(u)||rt(c)||rt(d)||rt(p)||rt(h))){a=Math.ceil(a),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d),p=Math.ceil(p),h=Math.ceil(h);var m=a<=1?1:Hi(u/a,0,1),v=a<=1?1:Hi(c/a,0,1),_=d<=1?1:Hi(p/d,0,1),S=d<=1?1:Hi(h/d,0,1);i=ur(i,{$prev_pageview_last_scroll:u,$prev_pageview_last_scroll_percentage:m,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:p,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:S})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}class U8{constructor(t){this.instance=t}sendExceptionEvent(t){this.instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var Vi="Mobile",jh="iOS",Eo="Android",Zc="Tablet",Hk=Eo+" "+Zc,Gk="iPad",Vk="Apple",Zk=Vk+" Watch",Yc="Safari",zl="BlackBerry",Yk="Samsung",Wk=Yk+"Browser",Kk=Yk+" Internet",qs="Chrome",j8=qs+" OS",Qk=qs+" "+jh,S_="Internet Explorer",Xk=S_+" "+Vi,C_="Opera",q8=C_+" Mini",E_="Edge",Jk="Microsoft "+E_,Ul="Firefox",eA=Ul+" "+jh,Wc="Nintendo",Kc="PlayStation",jl="Xbox",tA=Eo+" "+Vi,nA=Vi+" "+Yc,Qc="Windows",k_=Qc+" Phone",rA="Nokia",A_="Ouya",iA="Generic",H8=iA+" "+Vi.toLowerCase(),oA=iA+" "+Zc.toLowerCase(),I_="Konqueror",ui="(\\d+(\\.\\d+)?)",T_=new RegExp("Version/"+ui),G8=new RegExp(jl,"i"),V8=new RegExp(Kc+" \\w+","i"),Z8=new RegExp(Wc+" \\w+","i"),M_=new RegExp(zl+"|PlayBook|BB10","i"),Y8={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},O_,W8=(e,t)=>t&&zt(t,Vk)||function(n){return zt(n,Yc)&&!zt(n,qs)&&!zt(n,Eo)}(e),aA=function(e,t){return t=t||"",zt(e," OPR/")&&zt(e,"Mini")?q8:zt(e," OPR/")?C_:M_.test(e)?zl:zt(e,"IE"+Vi)||zt(e,"WPDesktop")?Xk:zt(e,Wk)?Kk:zt(e,E_)||zt(e,"Edg/")?Jk:zt(e,"FBIOS")?"Facebook "+Vi:zt(e,"UCWEB")||zt(e,"UCBrowser")?"UC Browser":zt(e,"CriOS")?Qk:zt(e,"CrMo")||zt(e,qs)?qs:zt(e,Eo)&&zt(e,Yc)?tA:zt(e,"FxiOS")?eA:zt(e.toLowerCase(),I_.toLowerCase())?I_:W8(e,t)?zt(e,Vi)?nA:Yc:zt(e,Ul)?Ul:zt(e,"MSIE")||zt(e,"Trident/")?S_:zt(e,"Gecko")?Ul:""},K8={[Xk]:[new RegExp("rv:"+ui)],[Jk]:[new RegExp(E_+"?\\/"+ui)],[qs]:[new RegExp("("+qs+"|CrMo)\\/"+ui)],[Qk]:[new RegExp("CriOS\\/"+ui)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ui)],[Yc]:[T_],[nA]:[T_],[C_]:[new RegExp("(Opera|OPR)\\/"+ui)],[Ul]:[new RegExp(Ul+"\\/"+ui)],[eA]:[new RegExp("FxiOS\\/"+ui)],[I_]:[new RegExp("Konqueror[:/]?"+ui,"i")],[zl]:[new RegExp(zl+" "+ui),T_],[tA]:[new RegExp("android\\s"+ui,"i")],[Kk]:[new RegExp(Wk+"\\/"+ui)],[S_]:[new RegExp("(rv:|MSIE )"+ui)],Mozilla:[new RegExp("rv:"+ui)]},sA=[[new RegExp(jl+"; "+jl+" (.*?)[);]","i"),e=>[jl,e&&e[1]||""]],[new RegExp(Wc,"i"),[Wc,""]],[new RegExp(Kc,"i"),[Kc,""]],[M_,[zl,""]],[new RegExp(Qc,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[k_,""];if(new RegExp(Vi).test(t)&&!/IEMobile\b/.test(t))return[Qc+" "+Vi,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=Y8[r]||"";return/arm/i.test(t)&&(i="RT"),[Qc,i]}return[Qc,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[jh,t.join(".")]}return[jh,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=rt(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Eo+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Eo+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Eo,t.join(".")]}return[Eo,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[j8,""]],[/Linux|debian/i,["Linux",""]]],lA=function(e){return Z8.test(e)?Wc:V8.test(e)?Kc:G8.test(e)?jl:new RegExp(A_,"i").test(e)?A_:new RegExp("("+k_+"|WPDesktop)","i").test(e)?k_:/iPad/.test(e)?Gk:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Zk:M_.test(e)?zl:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(rA,"i").test(e)?rA:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Vi).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Eo:Hk:Eo:new RegExp("(pda|"+Vi+")","i").test(e)?H8:new RegExp(Zc,"i").test(e)&&!new RegExp(Zc+" pc","i").test(e)?oA:""},qh="https?://(.*)",Hh=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],Q8=bh(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Hh),R_="<masked>",Dn={campaignParams:function(){var{customTrackedParams:e,maskPersonalDataProperties:t,customPersonalDataProperties:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!st)return{};var r=t?bh([],Hh,n||[]):[];return this._campaignParamsFromUrl(n_(st.URL,r,R_),e)},_campaignParamsFromUrl:function(e,t){var n=Q8.concat(t||[]),r={};return wn(n,function(i){var o=Mh(e,i);r[i]=o||null}),r},_searchEngine:function(e){return e?e.search(qh+"google.([^/?]*)")===0?"google":e.search(qh+"bing.com")===0?"bing":e.search(qh+"yahoo.com")===0?"yahoo":e.search(qh+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=Dn._searchEngine(e),n=t!="yahoo"?"q":"p",r={};if(!$a(t)){r.$search_engine=t;var i=st?Mh(st.referrer,n):"";i.length&&(r.ph_keyword=i)}return r},searchInfo:function(){var e=st==null?void 0:st.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:aA,browserVersion:function(e,t){var n=aA(e,t),r=K8[n];if(rt(r))return null;for(var i=0;i<r.length;i++){var o=r[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var e=this.browserLanguage();return typeof e=="string"?e.split("-")[0]:void 0},os:function(e){for(var t=0;t<sA.length;t++){var[n,r]=sA[t],i=n.exec(e),o=i&&(ho(r)?r(i,e):r);if(o)return o}return["",""]},device:lA,deviceType:function(e){var t=lA(e);return t===Gk||t===Hk||t==="Kobo"||t==="Kindle Fire"||t===oA?Zc:t===Wc||t===jl||t===Kc||t===A_?"Console":t===Zk?"Wearable":t?Vi:"Desktop"},referrer:function(){return(st==null?void 0:st.referrer)||"$direct"},referringDomain:function(){var e;return st!=null&&st.referrer&&((e=Bl(st.referrer))===null||e===void 0?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},personInfo:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e?bh([],Hh,t||[]):[],r=_i==null?void 0:_i.href.substring(0,1e3);return{r:this.referrer().substring(0,1e3),u:r?n_(r,n,R_):void 0}},personPropsFromInfo:function(e){var t,{r:n,u:r}=e,i={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=Bl(n))===null||t===void 0?void 0:t.host};if(r){i.$current_url=r;var o=Bl(r);i.$host=o==null?void 0:o.host,i.$pathname=o==null?void 0:o.pathname;var a=this._campaignParamsFromUrl(r);ur(i,a)}if(n){var u=this._searchInfoFromReferrer(n);ur(i,u)}return i},initialPersonPropsFromInfo:function(e){var t=this.personPropsFromInfo(e),n={};return wn(t,function(r,i){n["$initial_".concat(zy(i))]=r}),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},timezoneOffset:function(){try{return new Date().getTimezoneOffset()}catch{return}},properties:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!sr)return{};var n=e?bh([],Hh,t||[]):[],[r,i]=Dn.os(sr);return ur(Bc({$os:r,$os_version:i,$browser:Dn.browser(sr,navigator.vendor),$device:Dn.device(sr),$device_type:Dn.deviceType(sr),$timezone:Dn.timezone(),$timezone_offset:Dn.timezoneOffset()}),{$current_url:n_(_i==null?void 0:_i.href,n,R_),$host:_i==null?void 0:_i.host,$pathname:_i==null?void 0:_i.pathname,$raw_user_agent:sr.length>1e3?sr.substring(0,997)+"...":sr,$browser_version:Dn.browserVersion(sr,navigator.vendor),$browser_language:Dn.browserLanguage(),$browser_language_prefix:Dn.browserLanguagePrefix(),$screen_height:be==null?void 0:be.screen.height,$screen_width:be==null?void 0:be.screen.width,$viewport_height:be==null?void 0:be.innerHeight,$viewport_width:be==null?void 0:be.innerWidth,$lib:"web",$lib_version:Yo.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!sr)return{};var[e,t]=Dn.os(sr);return ur(Bc({$os:e,$os_version:t,$browser:Dn.browser(sr,navigator.vendor)}),{$browser_version:Dn.browserVersion(sr,navigator.vendor)})}},ko=Zr("[FeatureFlags]"),$_="$active_feature_flags",ql="$override_feature_flags",uA="$feature_flag_payloads",Xc="$override_feature_flag_payloads",cA="$feature_flag_request_id",fA=e=>{var t={};for(var[n,r]of xh(e||{}))r&&(t[n]=r);return t},X8=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(n=>{var r;return[n,(r=t[n].variant)!==null&&r!==void 0?r:t[n].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(n=>t[n].enabled).filter(n=>{var r;return(r=t[n].metadata)===null||r===void 0?void 0:r.payload}).map(n=>{var r;return[n,(r=t[n].metadata)===null||r===void 0?void 0:r.payload]}))):ko.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e};(function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"})(O_||(O_={}));class J8{constructor(t){Ve(this,"_override_warning",!1),Ve(this,"_hasLoadedFlags",!1),Ve(this,"_requestInFlight",!1),Ve(this,"_reloadingDisabled",!1),Ve(this,"_additionalReloadRequested",!1),Ve(this,"_decideCalled",!1),Ve(this,"_flagsLoadedFromRemote",!1),this.instance=t,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var t=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:t})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.instance.get_property(Vy),n=this.instance.get_property(ql),r=this.instance.get_property(Xc);if(!r&&!n)return t||{};var i=ur({},t||{}),o=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var a of o){var u,c,d=i[a],p=n==null?void 0:n[a],h=rt(p)?(u=d==null?void 0:d.enabled)!==null&&u!==void 0&&u:!!p,m=rt(p)?d.variant:typeof p=="string"?p:void 0,v=r==null?void 0:r[a],_=Ee(Ee({},d),{},{enabled:h,variant:h?m??(d==null?void 0:d.variant):void 0});h!==(d==null?void 0:d.enabled)&&(_.original_enabled=d==null?void 0:d.enabled),m!==(d==null?void 0:d.variant)&&(_.original_variant=d==null?void 0:d.variant),v&&(_.metadata=Ee(Ee({},d==null?void 0:d.metadata),{},{payload:v,original_payload:d==null||(c=d.metadata)===null||c===void 0?void 0:c.payload})),i[a]=_}return this._override_warning||(ko.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:i}),this._override_warning=!0),i}getFlagVariants(){var t=this.instance.get_property(Ll),n=this.instance.get_property(ql);if(!n)return t||{};for(var r=ur({},t),i=Object.keys(n),o=0;o<i.length;o++)r[i[o]]=n[i[o]];return this._override_warning||(ko.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:n,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var t=this.instance.get_property(uA),n=this.instance.get_property(Xc);if(!n)return t||{};for(var r=ur({},t||{}),i=Object.keys(n),o=0;o<i.length;o++)r[i[o]]=n[i[o]];return this._override_warning||(ko.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:n,finalPayloads:r}),this._override_warning=!0),r}reloadFeatureFlags(){this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout(()=>{this._callDecideEndpoint()},5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this._reloadingDisabled=t}_callDecideEndpoint(t){var n;if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var r={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Ee(Ee({},((n=this.instance.persistence)===null||n===void 0?void 0:n.get_initial_props())||{}),this.instance.get_property(Uc)||{}),group_properties:this.instance.get_property(Ps)};(t!=null&&t.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0);var i=this.instance.config.__preview_flags_v2&&this.instance.config.__preview_remote_config;i&&(r.timezone=Dn.timezone()),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api",i?"/flags/?v=2":"/decide/?v=4"),data:r,compression:this.instance.config.disable_compression?void 0:fo.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:o=>{var a,u,c,d=!0;o.statusCode===200&&(this._additionalReloadRequested||(this.$anon_distinct_id=void 0),d=!1),this._requestInFlight=!1,this._decideCalled||(this._decideCalled=!0,this.instance._onRemoteConfig((c=o.json)!==null&&c!==void 0?c:{})),r.disable_flags&&!this._additionalReloadRequested||(this._flagsLoadedFromRemote=!d,o.json&&(a=o.json.quotaLimited)!==null&&a!==void 0&&a.includes(O_.FeatureFlags)?ko.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(this.receivedFeatureFlags((u=o.json)!==null&&u!==void 0?u:{},d),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint())))}})}}getFeatureFlag(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],i="".concat(r),o=this.instance.get_property(cA)||void 0,a=this.instance.get_property(Eh)||{};if((n.send_event||!("send_event"in n))&&(!(t in a)||!a[t].includes(i))){var u,c,d,p,h,m,v,_,S,x,b;qn(a[t])?a[t].push(i):a[t]=[i],(u=this.instance.persistence)===null||u===void 0||u.register({[Eh]:a});var C=this.getFeatureFlagDetails(t),k={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:o,$feature_flag_bootstrapped_response:((c=this.instance.config.bootstrap)===null||c===void 0||(d=c.featureFlags)===null||d===void 0?void 0:d[t])||null,$feature_flag_bootstrapped_payload:((p=this.instance.config.bootstrap)===null||p===void 0||(h=p.featureFlagPayloads)===null||h===void 0?void 0:h[t])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};rt(C==null||(m=C.metadata)===null||m===void 0?void 0:m.version)||(k.$feature_flag_version=C.metadata.version);var A,I=(v=C==null||(_=C.reason)===null||_===void 0?void 0:_.description)!==null&&v!==void 0?v:C==null||(S=C.reason)===null||S===void 0?void 0:S.code;I&&(k.$feature_flag_reason=I),C!=null&&(x=C.metadata)!==null&&x!==void 0&&x.id&&(k.$feature_flag_id=C.metadata.id),rt(C==null?void 0:C.original_variant)&&rt(C==null?void 0:C.original_enabled)||(k.$feature_flag_original_response=rt(C.original_variant)?C.original_enabled:C.original_variant),C!=null&&(b=C.metadata)!==null&&b!==void 0&&b.original_payload&&(k.$feature_flag_original_payload=C==null||(A=C.metadata)===null||A===void 0?void 0:A.original_payload),this.instance.capture("$feature_flag_called",k)}return r}ko.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,n){var r=this.instance.config.token;this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=4"),data:{distinct_id:this.instance.get_distinct_id(),token:r},compression:this.instance.config.disable_compression?void 0:fo.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:i=>{var o,a=(o=i.json)===null||o===void 0?void 0:o.featureFlagPayloads;n((a==null?void 0:a[t])||void 0)}})}isFeatureEnabled(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(t,n);ko.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(n=>n!==t)}receivedFeatureFlags(t,n){if(this.instance.persistence){this._hasLoadedFlags=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(a,u){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{},h=X8(a),m=h.flags,v=h.featureFlags,_=h.featureFlagPayloads;if(v){var S=a.requestId;if(qn(v)){ko.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var x={};if(v)for(var b=0;b<v.length;b++)x[v[b]]=!0;u&&u.register({[$_]:v,[Ll]:x})}else{var C=v,k=_,A=m;a.errorsWhileComputingFlags&&(C=Ee(Ee({},c),C),k=Ee(Ee({},d),k),A=Ee(Ee({},p),A)),u&&u.register(Ee({[$_]:Object.keys(fA(C)),[Ll]:C||{},[uA]:k||{},[Vy]:A||{}},S?{[cA]:S}:{}))}}})(t,this.instance.persistence,r,i,o),this._fireFeatureFlagsCallbacks(n)}}override(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];ko.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:n})}overrideFeatureFlags(t){if(!this.instance.__loaded||!this.instance.persistence)return ko.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.instance.persistence.unregister(ql),this.instance.persistence.unregister(Xc),void this._fireFeatureFlagsCallbacks();if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this._override_warning=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.instance.persistence.unregister(ql);else if(r.flags)if(qn(r.flags)){for(var i={},o=0;o<r.flags.length;o++)i[r.flags[o]]=!0;this.instance.persistence.register({[ql]:i})}else this.instance.persistence.register({[ql]:r.flags})}return"payloads"in r&&(r.payloads===!1?this.instance.persistence.unregister(Xc):r.payloads&&this.instance.persistence.register({[Xc]:r.payloads})),void this._fireFeatureFlagsCallbacks()}this._fireFeatureFlagsCallbacks()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this._hasLoadedFlags){var{flags:n,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();t(n,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,n){var r,i=(this.instance.get_property(Sh)||[]).find(c=>c.flagKey===t),o={["$feature_enrollment/".concat(t)]:n},a={$feature_flag:t,$feature_enrollment:n,$set:o};i&&(a.$early_access_feature_name=i.name),this.instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var u=Ee(Ee({},this.getFlagVariants()),{},{[t]:n});(r=this.instance.persistence)===null||r===void 0||r.register({[$_]:Object.keys(fA(u)),[Ll]:u}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=arguments.length>2?arguments[2]:void 0,i=this.instance.get_property(Sh),o=r?"&".concat(r.map(a=>"stage=".concat(a)).join("&")):"";if(i&&!n)return t(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token).concat(o)),method:"GET",callback:a=>{var u;if(a.json){var c=a.json.earlyAccessFeatures;return(u=this.instance.persistence)===null||u===void 0||u.register({[Sh]:c}),t(c)}}})}_prepareFeatureFlagsForCallbacks(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter(r=>n[r]),flagVariants:Object.keys(n).filter(r=>n[r]).reduce((r,i)=>(r[i]=n[i],r),{})}}_fireFeatureFlagsCallbacks(t){var{flags:n,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(i=>i(n,r,{errorsLoading:t}))}setPersonPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Uc)||{};this.instance.register({[Uc]:Ee(Ee({},r),t)}),n&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(Uc)}setGroupPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Ps)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(i=>{r[i]=Ee(Ee({},r[i]),t[i]),delete t[i]}),this.instance.register({[Ps]:Ee(Ee({},r),t)}),n&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var n=this.instance.get_property(Ps)||{};this.instance.register({[Ps]:Ee(Ee({},n),{},{[t]:{}})})}else this.instance.unregister(Ps)}}var eB=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class D_{constructor(t){this.config=t,this.props={},this.campaign_params_saved=!1,this.name=(n=>{var r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(t),this.storage=this.buildStorage(t),this.load(),t.debug&&pt.info("Persistence loaded",t.persistence,Ee({},this.props)),this.update_config(t,t),this.save()}buildStorage(t){eB.indexOf(t.persistence.toLowerCase())===-1&&(pt.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=t.persistence.toLowerCase();return n==="localstorage"&&_r.is_supported()?_r:n==="localstorage+cookie"&&$h.is_supported()?$h:n==="sessionstorage"&&Rr.is_supported()?Rr:n==="memory"?K9:n==="cookie"?Ko:$h.is_supported()?$h:Ko}properties(){var t={};return wn(this.props,function(n,r){if(r===Ll&&Hn(n))for(var i=Object.keys(n),o=0;o<i.length;o++)t["$feature/".concat(i[o])]=n[i[o]];else u=r,c=!1,($a(a=T9)?c:kE&&a.indexOf===kE?a.indexOf(u)!=-1:(wn(a,function(d){if(c||(c=d===u))return _h}),c))||(t[r]=n);var a,u,c}),t}load(){if(!this.disabled){var t=this.storage.parse(this.name);t&&(this.props=ur({},t))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(Hn(t)){rt(n)&&(n="None"),this.expire_days=rt(r)?this.default_expiry:r;var i=!1;if(wn(t,(o,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.props[a]=o,i=!0)}),i)return this.save(),!0}return!1}register(t,n){if(Hn(t)){this.expire_days=rt(n)?this.default_expiry:n;var r=!1;if(wn(t,(i,o)=>{t.hasOwnProperty(o)&&this.props[o]!==i&&(this.props[o]=i,r=!0)}),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var t=Dn.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});Dl(Bc(t))||this.register(t),this.campaign_params_saved=!0}}update_search_keyword(){this.register(Dn.searchInfo())}update_referrer_info(){this.register_once(Dn.referrerInfo(),void 0)}set_initial_person_info(){this.props[Ky]||this.props[Qy]||this.register_once({[Xy]:Dn.personInfo({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties})},void 0)}get_referrer_info(){return Bc({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var t={};wn([Qy,Ky],i=>{var o=this.props[i];o&&wn(o,function(a,u){t["$initial_"+zy(u)]=a})});var n=this.props[Xy];if(n){var r=Dn.initialPersonPropsFromInfo(n);ur(t,r)}return t}safe_merge(t){return wn(this.props,function(n,r){r in t||(t[r]=n)}),t}update_config(t,n){if(this.default_expiry=this.expire_days=t.cookie_expiration,this.set_disabled(t.disable_persistence),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence){var r=this.buildStorage(t),i=this.props;this.clear(),this.storage=r,this.props=i,this.save()}}set_disabled(t){this.disabled=t,this.disabled?this.remove():this.save()}set_cross_subdomain(t){t!==this.cross_subdomain&&(this.cross_subdomain=t,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(t){t!==this.secure&&(this.secure=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Fc]||{};r[t]=n,this.props[Fc]=r,this.save()}remove_event_timer(t){var n=(this.props[Fc]||{})[t];return rt(n)||(delete this.props[Fc][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var dA,Gn,hA,Hs,pA,gA,L_,mA,vA,yA,_A,bA,xA,N_={},wA=[],tB=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,B_=Array.isArray;function za(e,t){for(var n in t)e[n]=t[n];return e}function SA(e){var t=e.parentNode;t&&t.removeChild(e)}function P_(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++hA,__i:-1,__u:0};return i==null&&Gn.vnode!=null&&Gn.vnode(o),o}function F_(e){return e.children}function Gh(e,t){this.props=e,this.context=t}function Hl(e,t){if(t==null)return e.__?Hl(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Hl(e):null}function CA(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return CA(e)}}function z_(e){(!e.__d&&(e.__d=!0)&&Hs.push(e)&&!Vh.__r++||pA!==Gn.debounceRendering)&&((pA=Gn.debounceRendering)||gA)(Vh)}function Vh(){var e,t,n,r,i,o,a,u,c;for(Hs.sort(L_);e=Hs.shift();)e.__d&&(t=Hs.length,r=void 0,o=(i=(n=e).__v).__e,u=[],c=[],(a=n.__P)&&((r=za({},i)).__v=i.__v+1,Gn.vnode&&Gn.vnode(r),MA(a,r,i,n.__n,a.ownerSVGElement!==void 0,32&i.__u?[o]:null,u,o??Hl(i),!!(32&i.__u),c),r.__.__k[r.__i]=r,iB(u,r,c),r.__e!=o&&CA(r)),Hs.length>t&&Hs.sort(L_));Vh.__r=0}function EA(e,t,n,r,i,o,a,u,c,d,p){var h,m,v,_,S,x=r&&r.__k||wA,b=t.length;for(n.__d=c,nB(n,t,x),c=n.__d,h=0;h<b;h++)(v=n.__k[h])!=null&&typeof v!="boolean"&&typeof v!="function"&&(m=v.__i===-1?N_:x[v.__i]||N_,v.__i=h,MA(e,v,m,i,o,a,u,c,d,p),_=v.__e,v.ref&&m.ref!=v.ref&&(m.ref&&U_(m.ref,null,v),p.push(v.ref,v.__c||_,v)),S==null&&_!=null&&(S=_),65536&v.__u||m.__k===v.__k?c=kA(v,c,e):typeof v.type=="function"&&v.__d!==void 0?c=v.__d:_&&(c=_.nextSibling),v.__d=void 0,v.__u&=-196609);n.__d=c,n.__e=S}function nB(e,t,n){var r,i,o,a,u,c=t.length,d=n.length,p=d,h=0;for(e.__k=[],r=0;r<c;r++)(i=e.__k[r]=(i=t[r])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?P_(null,i,null,null,i):B_(i)?P_(F_,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?P_(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,u=rB(i,n,a=r+h,p),i.__i=u,o=null,u!==-1&&(p--,(o=n[u])&&(o.__u|=131072)),o==null||o.__v===null?(u==-1&&h--,typeof i.type!="function"&&(i.__u|=65536)):u!==a&&(u===a+1?h++:u>a?p>c-a?h+=u-a:h--:h=u<a&&u==a-1?u-a:0,u!==r+h&&(i.__u|=65536))):(o=n[r])&&o.key==null&&o.__e&&(o.__e==e.__d&&(e.__d=Hl(o)),j_(o,o,!1),n[r]=null,p--);if(p)for(r=0;r<d;r++)(o=n[r])!=null&&(131072&o.__u)==0&&(o.__e==e.__d&&(e.__d=Hl(o)),j_(o,o))}function kA(e,t,n){var r,i;if(typeof e.type=="function"){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=kA(r[i],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function rB(e,t,n,r){var i=e.key,o=e.type,a=n-1,u=n+1,c=t[n];if(c===null||c&&i==c.key&&o===c.type)return n;if(r>(c!=null&&(131072&c.__u)==0?1:0))for(;a>=0||u<t.length;){if(a>=0){if((c=t[a])&&(131072&c.__u)==0&&i==c.key&&o===c.type)return a;a--}if(u<t.length){if((c=t[u])&&(131072&c.__u)==0&&i==c.key&&o===c.type)return u;u++}}return-1}function AA(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||tB.test(t)?n:n+"px"}function Zh(e,t,n,r,i){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||AA(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||AA(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?TA:IA,o)):e.removeEventListener(t,o?TA:IA,o);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function IA(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Gn.event?Gn.event(e):e)}function TA(e){return this.l[e.type+!0](Gn.event?Gn.event(e):e)}function MA(e,t,n,r,i,o,a,u,c,d){var p,h,m,v,_,S,x,b,C,k,A,I,$,B,U,G=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),o=[u=t.__e=n.__e]),(p=Gn.__b)&&p(t);e:if(typeof G=="function")try{if(b=t.props,C=(p=G.contextType)&&r[p.__c],k=p?C?C.props.value:p.__:r,n.__c?x=(h=t.__c=n.__c).__=h.__E:("prototype"in G&&G.prototype.render?t.__c=h=new G(b,k):(t.__c=h=new Gh(b,k),h.constructor=G,h.render=aB),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=k,h.__n=r,m=h.__d=!0,h.__h=[],h._sb=[]),h.__s==null&&(h.__s=h.state),G.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=za({},h.__s)),za(h.__s,G.getDerivedStateFromProps(b,h.__s))),v=h.props,_=h.state,h.__v=t,m)G.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(G.getDerivedStateFromProps==null&&b!==v&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(b,k),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(b,h.__s,k)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(P){P&&(P.__=t)}),A=0;A<h._sb.length;A++)h.__h.push(h._sb[A]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(b,h.__s,k),h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(v,_,S)})}if(h.context=k,h.props=b,h.__P=e,h.__e=!1,I=Gn.__r,$=0,"prototype"in G&&G.prototype.render){for(h.state=h.__s,h.__d=!1,I&&I(t),p=h.render(h.props,h.state,h.context),B=0;B<h._sb.length;B++)h.__h.push(h._sb[B]);h._sb=[]}else do h.__d=!1,I&&I(t),p=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++$<25);h.state=h.__s,h.getChildContext!=null&&(r=za(za({},r),h.getChildContext())),m||h.getSnapshotBeforeUpdate==null||(S=h.getSnapshotBeforeUpdate(v,_)),EA(e,B_(U=p!=null&&p.type===F_&&p.key==null?p.props.children:p)?U:[U],t,n,r,i,o,a,u,c,d),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),x&&(h.__E=h.__=null)}catch(P){t.__v=null,c||o!=null?(t.__e=u,t.__u|=c?160:32,o[o.indexOf(u)]=null):(t.__e=n.__e,t.__k=n.__k),Gn.__e(P,t,n)}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=oB(n.__e,t,n,r,i,o,a,c,d);(p=Gn.diffed)&&p(t)}function iB(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)U_(n[r],n[++r],n[++r]);Gn.__c&&Gn.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){Gn.__e(o,i.__v)}})}function oB(e,t,n,r,i,o,a,u,c){var d,p,h,m,v,_,S,x=n.props,b=t.props,C=t.type;if(C==="svg"&&(i=!0),o!=null){for(d=0;d<o.length;d++)if((v=o[d])&&"setAttribute"in v==!!C&&(C?v.localName===C:v.nodeType===3)){e=v,o[d]=null;break}}if(e==null){if(C===null)return document.createTextNode(b);e=i?document.createElementNS("http://www.w3.org/2000/svg",C):document.createElement(C,b.is&&b),o=null,u=!1}if(C===null)x===b||u&&e.data===b||(e.data=b);else{if(o=o&&dA.call(e.childNodes),x=n.props||N_,!u&&o!=null)for(x={},d=0;d<e.attributes.length;d++)x[(v=e.attributes[d]).name]=v.value;for(d in x)v=x[d],d=="children"||(d=="dangerouslySetInnerHTML"?h=v:d==="key"||d in b||Zh(e,d,null,v,i));for(d in b)v=b[d],d=="children"?m=v:d=="dangerouslySetInnerHTML"?p=v:d=="value"?_=v:d=="checked"?S=v:d==="key"||u&&typeof v!="function"||x[d]===v||Zh(e,d,v,x[d],i);if(p)u||h&&(p.__html===h.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(h&&(e.innerHTML=""),EA(e,B_(m)?m:[m],t,n,r,i&&C!=="foreignObject",o,a,o?o[0]:n.__k&&Hl(n,0),u,c),o!=null)for(d=o.length;d--;)o[d]!=null&&SA(o[d]);u||(d="value",_!==void 0&&(_!==e[d]||C==="progress"&&!_||C==="option"&&_!==x[d])&&Zh(e,d,_,x[d],!1),d="checked",S!==void 0&&S!==e[d]&&Zh(e,d,S,x[d],!1))}return e}function U_(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){Gn.__e(r,n)}}function j_(e,t,n){var r,i;if(Gn.unmount&&Gn.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||U_(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){Gn.__e(o,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&j_(r[i],t,n||typeof e.type!="function");n||e.__e==null||SA(e.__e),e.__=e.__e=e.__d=void 0}function aB(e,t,n){return this.constructor(e,n)}dA=wA.slice,Gn={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(u){e=u}throw e}},hA=0,Gh.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=za({},this.state),typeof e=="function"&&(e=e(za({},n),this.props)),e&&za(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),z_(this))},Gh.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),z_(this))},Gh.prototype.render=F_,Hs=[],gA=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,L_=function(e,t){return e.__v.__b-t.__v.__b},Vh.__r=0,mA=0,function(e){e.Button="button",e.Tab="tab",e.Selector="selector"}(vA||(vA={})),function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(yA||(yA={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(_A||(_A={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(bA||(bA={})),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}(xA||(xA={})),function(e,t){var n={__c:t="__cC"+mA++,__:e,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,o;return this.getChildContext||(i=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.some(function(u){u.__e=!0,z_(u)})},this.sub=function(a){i.push(a);var u=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),u&&u.call(a)}}),r.children}};n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{}});var Gl=function(e,t){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};class OA{constructor(){Ve(this,"events",{}),this.events={}}on(t,n){return this.events[t]||(this.events[t]=[]),this.events[t].push(n),()=>{this.events[t]=this.events[t].filter(r=>r!==n)}}emit(t,n){for(var r of this.events[t]||[])r(n);for(var i of this.events["*"]||[])i(t,n)}}class Gs{constructor(t){Ve(this,"_debugEventEmitter",new OA),Ve(this,"checkStep",(n,r)=>this.checkStepEvent(n,r)&&this.checkStepUrl(n,r)&&this.checkStepElement(n,r)),Ve(this,"checkStepEvent",(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event)),this.instance=t,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var t;if(!rt((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)){var n;(n=this.instance)===null||n===void 0||n._addCaptureHook((r,i)=>{this.on(r,i)})}}register(t){var n,r;if(!rt((n=this.instance)===null||n===void 0?void 0:n._addCaptureHook)&&(t.forEach(a=>{var u,c;(u=this.actionRegistry)===null||u===void 0||u.add(a),(c=a.steps)===null||c===void 0||c.forEach(d=>{var p;(p=this.actionEvents)===null||p===void 0||p.add((d==null?void 0:d.event)||"")})}),(r=this.instance)!==null&&r!==void 0&&r.autocapture)){var i,o=new Set;t.forEach(a=>{var u;(u=a.steps)===null||u===void 0||u.forEach(c=>{c!=null&&c.selector&&o.add(c==null?void 0:c.selector)})}),(i=this.instance)===null||i===void 0||i.autocapture.setElementSelectors(o)}}on(t,n){var r;n!=null&&t.length!=0&&(this.actionEvents.has(t)||this.actionEvents.has(n==null?void 0:n.event))&&this.actionRegistry&&((r=this.actionRegistry)===null||r===void 0?void 0:r.size)>0&&this.actionRegistry.forEach(i=>{this.checkAction(n,i)&&this._debugEventEmitter.emit("actionCaptured",i.name)})}_addActionHook(t){this.onAction("actionCaptured",n=>t(n))}checkAction(t,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.checkStep(t,r))return!0;return!1}onAction(t,n){return this._debugEventEmitter.on(t,n)}checkStepUrl(t,n){if(n!=null&&n.url){var r,i=t==null||(r=t.properties)===null||r===void 0?void 0:r.$current_url;if(!i||typeof i!="string"||!Gs.matchString(i,n==null?void 0:n.url,(n==null?void 0:n.url_matching)||"contains"))return!1}return!0}static matchString(t,n,r){switch(r){case"regex":return!!be&&Gl(t,n);case"exact":return n===t;case"contains":var i=Gs.escapeStringRegexp(n).replace(/_/g,".").replace(/%/g,".*");return Gl(t,i);default:return!1}}static escapeStringRegexp(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(t,n){if((n!=null&&n.href||n!=null&&n.tag_name||n!=null&&n.text)&&!this.getElementsList(t).some(o=>!(n!=null&&n.href&&!Gs.matchString(o.href||"",n==null?void 0:n.href,(n==null?void 0:n.href_matching)||"exact"))&&(n==null||!n.tag_name||o.tag_name===(n==null?void 0:n.tag_name))&&!(n!=null&&n.text&&!Gs.matchString(o.text||"",n==null?void 0:n.text,(n==null?void 0:n.text_matching)||"exact")&&!Gs.matchString(o.$el_text||"",n==null?void 0:n.text,(n==null?void 0:n.text_matching)||"exact"))))return!1;if(n!=null&&n.selector){var r,i=t==null||(r=t.properties)===null||r===void 0?void 0:r.$element_selectors;if(!i||!i.includes(n==null?void 0:n.selector))return!1}return!0}getElementsList(t){return(t==null?void 0:t.properties.$elements)==null?[]:t==null?void 0:t.properties.$elements}}class Jc{constructor(t){this.instance=t,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(t){var n;rt((n=this.instance)===null||n===void 0?void 0:n._addCaptureHook)||(this.setupEventBasedSurveys(t),this.setupActionBasedSurveys(t))}setupActionBasedSurveys(t){var n=t.filter(r=>{var i,o,a,u;return((i=r.conditions)===null||i===void 0?void 0:i.actions)&&((o=r.conditions)===null||o===void 0||(a=o.actions)===null||a===void 0||(u=a.values)===null||u===void 0?void 0:u.length)>0});n.length!==0&&(this.actionMatcher==null&&(this.actionMatcher=new Gs(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(r=>{this.onAction(r)})),n.forEach(r=>{var i,o,a,u,c,d,p,h,m,v;r.conditions&&(i=r.conditions)!==null&&i!==void 0&&i.actions&&(o=r.conditions)!==null&&o!==void 0&&(a=o.actions)!==null&&a!==void 0&&a.values&&((u=r.conditions)===null||u===void 0||(c=u.actions)===null||c===void 0||(d=c.values)===null||d===void 0?void 0:d.length)>0&&((p=this.actionMatcher)===null||p===void 0||p.register(r.conditions.actions.values),(h=r.conditions)===null||h===void 0||(m=h.actions)===null||m===void 0||(v=m.values)===null||v===void 0||v.forEach(_=>{if(_&&_.name){var S=this.actionToSurveys.get(_.name);S&&S.push(r.id),this.actionToSurveys.set(_.name,S||[r.id])}}))}))}setupEventBasedSurveys(t){var n;t.filter(r=>{var i,o,a,u;return((i=r.conditions)===null||i===void 0?void 0:i.events)&&((o=r.conditions)===null||o===void 0||(a=o.events)===null||a===void 0||(u=a.values)===null||u===void 0?void 0:u.length)>0}).length!==0&&((n=this.instance)===null||n===void 0||n._addCaptureHook((r,i)=>{this.onEvent(r,i)}),t.forEach(r=>{var i,o,a;(i=r.conditions)===null||i===void 0||(o=i.events)===null||o===void 0||(a=o.values)===null||a===void 0||a.forEach(u=>{if(u&&u.name){var c=this.eventToSurveys.get(u.name);c&&c.push(r.id),this.eventToSurveys.set(u.name,c||[r.id])}})}))}onEvent(t,n){var r,i,o=((r=this.instance)===null||r===void 0||(i=r.persistence)===null||i===void 0?void 0:i.props[Ch])||[];if(Jc.SURVEY_SHOWN_EVENT_NAME==t&&n&&o.length>0){var a,u=n==null||(a=n.properties)===null||a===void 0?void 0:a.$survey_id;if(u){var c=o.indexOf(u);c>=0&&(o.splice(c,1),this._updateActivatedSurveys(o))}}else this.eventToSurveys.has(t)&&this._updateActivatedSurveys(o.concat(this.eventToSurveys.get(t)||[]))}onAction(t){var n,r,i=((n=this.instance)===null||n===void 0||(r=n.persistence)===null||r===void 0?void 0:r.props[Ch])||[];this.actionToSurveys.has(t)&&this._updateActivatedSurveys(i.concat(this.actionToSurveys.get(t)||[]))}_updateActivatedSurveys(t){var n,r;(n=this.instance)===null||n===void 0||(r=n.persistence)===null||r===void 0||r.register({[Ch]:[...new Set(t)]})}getSurveys(){var t,n,r=(t=this.instance)===null||t===void 0||(n=t.persistence)===null||n===void 0?void 0:n.props[Ch];return r||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}Ve(Jc,"SURVEY_SHOWN_EVENT_NAME","survey shown");var $r=Zr("[Surveys]"),RA={icontains:(e,t)=>e.some(n=>t.toLowerCase().includes(n.toLowerCase())),not_icontains:(e,t)=>e.every(n=>!t.toLowerCase().includes(n.toLowerCase())),regex:(e,t)=>e.some(n=>Gl(t,n)),not_regex:(e,t)=>e.every(n=>!Gl(t,n)),exact:(e,t)=>e.some(n=>t===n),is_not:(e,t)=>e.every(n=>t!==n)};function $A(e){return e??"icontains"}class sB{constructor(t){Ve(this,"_isFetchingSurveys",!1),Ve(this,"_isInitializingSurveys",!1),Ve(this,"_surveyCallbacks",[]),this.instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){var n=t.surveys;if(pn(n))return $r.warn("Decide not loaded yet. Not loading surveys.");var r=qn(n);this._hasSurveys=r?n.length>0:n,$r.info("decide response received, hasSurveys: ".concat(this._hasSurveys)),this._hasSurveys&&this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var t=(()=>{for(var n=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);i!=null&&i.startsWith("seenSurvey_")&&n.push(i)}return n})();t.forEach(n=>localStorage.removeItem(n))}loadIfEnabled(){if(!this._surveyManager)if(this._isInitializingSurveys)$r.info("Already initializing surveys, skipping...");else if(this.instance.config.disable_surveys)$r.info("Disabled. Not loading surveys.");else{var t=At==null?void 0:At.__PosthogExtensions__;if(t)if(this._hasSurveys){this._isInitializingSurveys=!0;try{var n=t.generateSurveys;if(n)this._surveyManager=n(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new Jc(this.instance),$r.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0});else{var r=t.loadExternalDependency;if(r)r(this.instance,"surveys",o=>{if(o||!t.generateSurveys)return $r.error("Could not load surveys script",o),void(this._isInitializingSurveys=!1);this._surveyManager=t.generateSurveys(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new Jc(this.instance),$r.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0})});else{var i="PostHog loadExternalDependency extension not found. Cannot load remote config.";$r.error(i),this._isInitializingSurveys=!1,this._notifySurveyCallbacks({isLoaded:!1,error:i})}}}catch(o){throw $r.error("Error initializing surveys",o),this._isInitializingSurveys=!1,this._notifySurveyCallbacks({isLoaded:!1,error:"Error initializing surveys"}),o}}else $r.info("No surveys to load.");else $r.error("PostHog Extensions not found.")}}onSurveysLoaded(t){return this._surveyCallbacks.push(t),this._surveyManager&&this._notifySurveyCallbacks({isLoaded:!0}),()=>{this._surveyCallbacks=this._surveyCallbacks.filter(n=>n!==t)}}getSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return $r.info("Disabled. Not loading surveys."),t([]);var r=this.instance.get_property(Zy);if(r&&!n)return t(r,{isLoaded:!0});if(this._isFetchingSurveys)return t([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this._isFetchingSurveys=!0,this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",timeout:this.instance.config.surveys_request_timeout_ms,callback:i=>{var o;this._isFetchingSurveys=!1;var a=i.statusCode;if(a!==200||!i.json){var u="Surveys API could not be loaded, status: ".concat(a);return $r.error(u),t([],{isLoaded:!1,error:u})}var c,d=i.json.surveys||[],p=d.filter(h=>{var m,v,_,S,x,b,C,k,A,I,$,B;return((m=h.conditions)===null||m===void 0?void 0:m.events)&&((v=h.conditions)===null||v===void 0||(_=v.events)===null||_===void 0?void 0:_.values)&&((S=h.conditions)===null||S===void 0||(x=S.events)===null||x===void 0||(b=x.values)===null||b===void 0?void 0:b.length)>0||((C=h.conditions)===null||C===void 0?void 0:C.actions)&&((k=h.conditions)===null||k===void 0||(A=k.actions)===null||A===void 0?void 0:A.values)&&((I=h.conditions)===null||I===void 0||($=I.actions)===null||$===void 0||(B=$.values)===null||B===void 0?void 0:B.length)>0});return p.length>0&&((c=this._surveyEventReceiver)===null||c===void 0||c.register(p)),(o=this.instance.persistence)===null||o===void 0||o.register({[Zy]:d}),t(d,{isLoaded:!0})}})}catch(i){throw this._isFetchingSurveys=!1,i}}_notifySurveyCallbacks(t){for(var n of this._surveyCallbacks)try{t.isLoaded?this.getSurveys(n):n([],t)}catch(r){$r.error("Error in survey callback",r)}}isSurveyFeatureFlagEnabled(t){return!t||this.instance.featureFlags.isFeatureEnabled(t)}getActiveMatchingSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(r=>{var i,o=r.filter(c=>!(!c.start_date||c.end_date)).filter(c=>{var d;if(!c.conditions)return!0;var p=function(v){var _,S,x;if((_=v.conditions)===null||_===void 0||!_.url)return!0;var b=be==null||(S=be.location)===null||S===void 0?void 0:S.href;if(!b)return!1;var C=[v.conditions.url];return RA[$A((x=v.conditions)===null||x===void 0?void 0:x.urlMatchType)](C,b)}(c),h=(d=c.conditions)===null||d===void 0||!d.selector||(st==null?void 0:st.querySelector(c.conditions.selector)),m=function(v){var _,S,x;if((_=v.conditions)===null||_===void 0||!_.deviceTypes||((S=v.conditions)===null||S===void 0?void 0:S.deviceTypes.length)===0)return!0;if(!sr)return!1;var b=Dn.deviceType(sr);return RA[$A((x=v.conditions)===null||x===void 0?void 0:x.deviceTypesMatchType)](v.conditions.deviceTypes,b)}(c);return p&&h&&m}),a=(i=this._surveyEventReceiver)===null||i===void 0?void 0:i.getSurveys(),u=o.filter(c=>{var d,p,h,m,v,_,S,x,b;if(!(c.linked_flag_key||c.targeting_flag_key||c.internal_targeting_flag_key||(d=c.feature_flag_keys)!==null&&d!==void 0&&d.length))return!0;var C=this.isSurveyFeatureFlagEnabled(c.linked_flag_key),k=this.isSurveyFeatureFlagEnabled(c.targeting_flag_key),A=((p=(h=c.conditions)===null||h===void 0||(m=h.events)===null||m===void 0||(v=m.values)===null||v===void 0?void 0:v.length)!==null&&p!==void 0?p:0)>0,I=((_=(S=c.conditions)===null||S===void 0||(x=S.actions)===null||x===void 0||(b=x.values)===null||b===void 0?void 0:b.length)!==null&&_!==void 0?_:0)>0,$=!A&&!I||(a==null?void 0:a.includes(c.id)),B=this._canActivateRepeatedly(c)||this.isSurveyFeatureFlagEnabled(c.internal_targeting_flag_key),U=this.checkFlags(c);return C&&k&&B&&$&&U});return t(u)},n)}checkFlags(t){var n;return(n=t.feature_flag_keys)===null||n===void 0||!n.length||t.feature_flag_keys.every(r=>{var{key:i,value:o}=r;return!i||!o||this.instance.featureFlags.isFeatureEnabled(o)})}_canActivateRepeatedly(t){var n;return pn((n=At.__PosthogExtensions__)===null||n===void 0?void 0:n.canActivateRepeatedly)?($r.warn("init was not called"),!1):At.__PosthogExtensions__.canActivateRepeatedly(t)}canRenderSurvey(t){if(pn(this._surveyManager))return $r.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=null;return this.getSurveys(r=>{var i=r.filter(o=>o.id===t)[0];n=i?Ee({},this._surveyManager.canRenderSurvey(i)):{visible:!1,disabledReason:"Survey not found"}}),n}renderSurvey(t,n){pn(this._surveyManager)?$r.warn("init was not called"):this.getSurveys(r=>{var i=r.filter(o=>o.id===t)[0];this._surveyManager.renderSurvey(i,st==null?void 0:st.querySelector(n))})}}var DA=Zr("[RateLimiter]");class lB{constructor(t){var n,r;Ve(this,"serverLimits",{}),Ve(this,"lastEventRateLimited",!1),Ve(this,"checkForLimiting",i=>{var o=i.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(a=>{DA.info("".concat(a||"events"," is quota limited.")),this.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void DA.warn('could not rate limit - continuing. Error: "'.concat(a==null?void 0:a.message,'"'),{text:o})}}),this.instance=t,this.captureEventsPerSecond=((n=t.config.rate_limiting)===null||n===void 0?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=t.config.rate_limiting)===null||r===void 0?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var t,n,r,i=arguments.length>0&&arguments[0]!==void 0&&arguments[0],o=new Date().getTime(),a=(t=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_property(Wy))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:o};a.tokens+=(o-a.last)/1e3*this.captureEventsPerSecond,a.last=o,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var u=a.tokens<1;return u||i||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||i||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(r=this.instance.persistence)===null||r===void 0||r.set_property(Wy,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Vs=Zr("[RemoteConfig]");class uB{constructor(t){this.instance=t}get remoteConfig(){var t,n;return(t=At._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(n=t[this.instance.config.token])===null||n===void 0?void 0:n.config}_loadRemoteConfigJs(t){var n,r,i;(n=At.__PosthogExtensions__)!==null&&n!==void 0&&n.loadExternalDependency?(r=At.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"remote-config",()=>t(this.remoteConfig)):(Vs.error("PostHog Extensions not found. Cannot load remote config."),t())}_loadRemoteConfigJSON(t){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:n=>{t(n.json)}})}load(){try{if(this.remoteConfig)return Vs.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void Vs.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs(t=>{if(!t)return Vs.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON(n=>{this.onRemoteConfig(n)});this.onRemoteConfig(t)})}catch(t){Vs.error("Error loading remote config",t)}}onRemoteConfig(t){t?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(t),t.hasFeatureFlags!==!1&&this.instance.featureFlags.ensureFlagsLoaded()):Vs.info("__preview_remote_config is disabled. Logging config instead",t):Vs.error("Failed to fetch remote config from PostHog.")}}var cB=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,`
49
+ */var wE;function v9(){if(wE)return Nc;wE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var a=null;if(o!==void 0&&(a=""+o),i.key!==void 0&&(a=""+i.key),"key"in i){o={};for(var u in i)u!=="key"&&(o[u]=i[u])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:a,ref:i!==void 0?i:null,props:o}}return Nc.Fragment=t,Nc.jsx=n,Nc.jsxs=n,Nc}var SE;function y9(){return SE||(SE=1,Ny.exports=v9()),Ny.exports}var E=y9(),fo,be=typeof window<"u"?window:void 0,yi=typeof globalThis<"u"?globalThis:be,CE=Array.prototype,EE=CE.forEach,kE=CE.indexOf,Oi=yi==null?void 0:yi.navigator,st=yi==null?void 0:yi.document,_i=yi==null?void 0:yi.location,By=yi==null?void 0:yi.fetch,Py=yi!=null&&yi.XMLHttpRequest&&"withCredentials"in new yi.XMLHttpRequest?yi.XMLHttpRequest:void 0,AE=yi==null?void 0:yi.AbortController,sr=Oi==null?void 0:Oi.userAgent,At=be??{},Yo={DEBUG:!1,LIB_VERSION:"1.235.0"},Fy="$copy_autocapture",_9=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];(function(e){e.GZipJS="gzip-js",e.Base64="base64"})(fo||(fo={}));var b9=["fatal","error","warning","log","info","debug"];function zt(e,t){return e.indexOf(t)!==-1}var vh=function(e){return e.trim()},zy=function(e){return e.replace(/^\$/,"")},x9=Array.isArray,IE=Object.prototype,TE=IE.hasOwnProperty,yh=IE.toString,qn=x9||function(e){return yh.call(e)==="[object Array]"},ho=e=>typeof e=="function",Hn=e=>e===Object(e)&&!qn(e),Dl=e=>{if(Hn(e)){for(var t in e)if(TE.call(e,t))return!1;return!0}return!1},rt=e=>e===void 0,lr=e=>yh.call(e)=="[object String]",Uy=e=>lr(e)&&e.trim().length===0,$a=e=>e===null,pn=e=>rt(e)||$a(e),li=e=>yh.call(e)=="[object Number]",Da=e=>yh.call(e)==="[object Boolean]",w9=e=>e instanceof FormData,S9=e=>zt(_9,e),ME=e=>{var t={_log:function(n){if(be&&(Yo.DEBUG||At.POSTHOG_DEBUG)&&!rt(be.console)&&be.console){for(var r=("__rrweb_original__"in be.console[n])?be.console[n].__rrweb_original__:be.console[n],i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];r(e,...o)}},info:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t._log("log",...r)},warn:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t._log("warn",...r)},error:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t._log("error",...r)},critical:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning:n=>{t.error("You must initialize PostHog before calling ".concat(n))},createLogger:n=>ME("".concat(e," ").concat(n))};return t},pt=ME("[PostHog.js]"),Zr=pt.createLogger,C9=Zr("[ExternalScriptsLoader]"),OE=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return C9.warn("".concat(t," was requested but loading of external scripts is disabled.")),n("Loading of external scripts is disabled");var r=st==null?void 0:st.querySelectorAll("script");if(r){for(var i=0;i<r.length;i++)if(r[i].src===t)return n()}var o=()=>{if(!st)return n("document not found");var a=st.createElement("script");if(a.type="text/javascript",a.crossOrigin="anonymous",a.src=t,a.onload=d=>n(void 0,d),a.onerror=d=>n(d),e.config.prepare_external_dependency_script&&(a=e.config.prepare_external_dependency_script(a)),!a)return n("prepare_external_dependency_script returned null");var u,c=st.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)===null||u===void 0||u.insertBefore(a,c[0]):st.body.appendChild(a)};st!=null&&st.body?o():st==null||st.addEventListener("DOMContentLoaded",o)};function RE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RE(Object(n),!0).forEach(function(r){Ve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $E(e,t){if(e==null)return{};var n,r,i=function(a,u){if(a==null)return{};var c,d,p={},h=Object.keys(a);for(d=0;d<h.length;d++)c=h[d],u.indexOf(c)>=0||(p[c]=a[c]);return p}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}At.__PosthogExtensions__=At.__PosthogExtensions__||{},At.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r="/static/".concat(t,".js")+"?v=".concat(e.version);if(t==="remote-config"&&(r="/array/".concat(e.config.token,"/config.js")),t==="toolbar"){var i=3e5,o=Math.floor(Date.now()/i)*i;r="".concat(r,"&t=").concat(o)}var a=e.requestRouter.endpointFor("assets",r);OE(e,a,n)},At.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);OE(e,r,n)};var _h={};function La(e,t,n){if(qn(e)){if(EE&&e.forEach===EE)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===_h)return}}}function wn(e,t,n){if(!pn(e)){if(qn(e))return La(e,t,n);if(w9(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===_h)return}else for(var i in e)if(TE.call(e,i)&&t.call(n,e[i],i)===_h)return}}var ur=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return La(n,function(i){for(var o in i)i[o]!==void 0&&(e[o]=i[o])}),e},bh=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return La(n,function(i){La(i,function(o){e.push(o)})}),e};function xh(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var DE=function(e){try{return e()}catch{return}},E9=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(i){pt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),pt.critical(i)}}},Bc=function(e){var t={};return wn(e,function(n,r){lr(n)&&n.length>0&&(t[r]=n)}),t};function k9(e,t){return n=e,r=o=>lr(o)&&!$a(t)?o.slice(0,t):o,i=new Set,function o(a,u){return a!==Object(a)?r?r(a,u):a:i.has(a)?void 0:(i.add(a),qn(a)?(c=[],La(a,d=>{c.push(o(d))})):(c={},wn(a,(d,p)=>{i.has(d)||(c[p]=o(d,p))})),c);var c}(n);var n,r,i}var A9=["herokuapp.com","vercel.app","netlify.app"];function I9(e){var t=e==null?void 0:e.hostname;if(!lr(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of A9)if(n===r)return!1;return!0}function LE(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function tr(e,t,n,r){var{capture:i=!1,passive:o=!0}=r??{};e==null||e.addEventListener(t,n,{capture:i,passive:o})}var NE="$people_distinct_id",Pc="__alias",Fc="__timers",BE="$autocapture_disabled_server_side",jy="$heatmaps_enabled_server_side",PE="$exception_capture_enabled_server_side",FE="$web_vitals_enabled_server_side",zE="$dead_clicks_enabled_server_side",UE="$web_vitals_allowed_metrics",qy="$session_recording_enabled_server_side",jE="$console_log_recording_enabled_server_side",qE="$session_recording_network_payload_capture",HE="$session_recording_masking",GE="$session_recording_canvas_recording",VE="$replay_sample_rate",ZE="$replay_minimum_duration",YE="$replay_script_config",wh="$sesid",zc="$session_is_sampled",Hy="$session_recording_url_trigger_activated_session",Gy="$session_recording_event_trigger_activated_session",Ll="$enabled_feature_flags",Sh="$early_access_features",Vy="$feature_flag_details",Uc="$stored_person_properties",Ps="$stored_group_properties",Zy="$surveys",Ch="$surveys_activated",Eh="$flag_call_reported",Wo="$user_state",Yy="$client_session_props",Wy="$capture_rate_limit",Ky="$initial_campaign_params",Qy="$initial_referrer_info",Xy="$initial_person_info",kh="$epp",WE="__POSTHOG_TOOLBAR__",KE="$posthog_cookieless",T9=[NE,Pc,"__cmpns",Fc,qy,jy,wh,Ll,Wo,Sh,Vy,Ps,Uc,Zy,Eh,Yy,Wy,Ky,Qy,kh];function QE(e){var t;return e instanceof Element&&(e.id===WE||!((t=e.closest)===null||t===void 0||!t.call(e,".toolbar-global-fade-container")))}function Ah(e){return!!e&&e.nodeType===1}function Na(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function XE(e){return!!e&&e.nodeType===3}function JE(e){return!!e&&e.nodeType===11}function Jy(e){return e?vh(e).split(/\s+/):[]}function ek(e){var t=be==null?void 0:be.location.href;return!!(t&&e&&e.some(n=>t.match(n)))}function Ih(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Jy(t)}function tk(e){return pn(e)?null:vh(e).split(/(\s+)/).filter(t=>Nl(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Th(e){var t="";return t_(e)&&!ik(e)&&e.childNodes&&e.childNodes.length&&wn(e.childNodes,function(n){var r;XE(n)&&n.textContent&&(t+=(r=tk(n.textContent))!==null&&r!==void 0?r:"")}),vh(t)}function nk(e){return rt(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var e_=["a","button","form","input","select","textarea","label"];function rk(e){var t=e.parentNode;return!(!t||!Ah(t))&&t}function M9(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!be||!e||Na(e,"html")||!Ah(e)||n!=null&&n.url_allowlist&&!ek(n.url_allowlist)||n!=null&&n.url_ignorelist&&ek(n.url_ignorelist))return!1;if(n!=null&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some(v=>t.type===v))return!1}for(var a=!1,u=[e],c=!0,d=e;d.parentNode&&!Na(d,"body");)if(JE(d.parentNode))u.push(d.parentNode.host),d=d.parentNode.host;else{if(!(c=rk(d)))break;if(r||e_.indexOf(c.tagName.toLowerCase())>-1)a=!0;else{var p=be.getComputedStyle(c);p&&p.getPropertyValue("cursor")==="pointer"&&(a=!0)}u.push(c),d=c}if(!function(v,_){var S=_==null?void 0:_.element_allowlist;if(rt(S))return!0;var x=function(k){if(S.some(A=>k.tagName.toLowerCase()===A))return{v:!0}};for(var b of v){var C=x(b);if(typeof C=="object")return C.v}return!1}(u,n)||!function(v,_){var S=_==null?void 0:_.css_selector_allowlist;if(rt(S))return!0;var x=function(k){if(S.some(A=>k.matches(A)))return{v:!0}};for(var b of v){var C=x(b);if(typeof C=="object")return C.v}return!1}(u,n))return!1;var h=be.getComputedStyle(e);if(h&&h.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var m=e.tagName.toLowerCase();switch(m){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return a?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(e_.indexOf(m)>-1||e.getAttribute("contenteditable")==="true")}}function t_(e){for(var t=e;t.parentNode&&!Na(t,"body");t=t.parentNode){var n=Ih(t);if(zt(n,"ph-sensitive")||zt(n,"ph-no-capture"))return!1}if(zt(Ih(e),"ph-include"))return!0;var r=e.type||"";if(lr(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!(lr(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function ik(e){return!!(Na(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Na(e,"select")||Na(e,"textarea")||e.getAttribute("contenteditable")==="true")}var ok="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",O9=new RegExp("^(?:".concat(ok,")$")),R9=new RegExp(ok),ak="\\d{3}-?\\d{2}-?\\d{4}",$9=new RegExp("^(".concat(ak,")$")),D9=new RegExp("(".concat(ak,")"));function Nl(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(pn(e)||lr(e)&&(e=vh(e),(t?O9:R9).test((e||"").replace(/[- ]/g,""))||(t?$9:D9).test(e)))}function sk(e){var t=Th(e);return Nl(t="".concat(t," ").concat(lk(e)).trim())?t:""}function lk(e){var t="";return e&&e.childNodes&&e.childNodes.length&&wn(e.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{var i=Th(n);t="".concat(t," ").concat(i).trim(),n.childNodes&&n.childNodes.length&&(t="".concat(t," ").concat(lk(n)).trim())}catch(o){pt.error("[AutoCapture]",o)}}),t}function L9(e){return function(t){var n=t.map(r=>{var i,o,a="";if(r.tag_name&&(a+=r.tag_name),r.attr_class)for(var u of(r.attr_class.sort(),r.attr_class))a+=".".concat(u.replace(/"/g,""));var c=Ee(Ee(Ee(Ee({},r.text?{text:r.text}:{}),{},{"nth-child":(i=r.nth_child)!==null&&i!==void 0?i:0,"nth-of-type":(o=r.nth_of_type)!==null&&o!==void 0?o:0},r.href?{href:r.href}:{}),r.attr_id?{attr_id:r.attr_id}:{}),r.attributes),d={};return xh(c).sort((p,h)=>{var[m]=p,[v]=h;return m.localeCompare(v)}).forEach(p=>{var[h,m]=p;return d[uk(h.toString())]=uk(m.toString())}),a+=":",a+=xh(c).map(p=>{var[h,m]=p;return"".concat(h,'="').concat(m,'"')}).join("")});return n.join(";")}(function(t){return t.map(n=>{var r,i,o={text:(r=n.$el_text)===null||r===void 0?void 0:r.slice(0,400),tag_name:n.tag_name,href:(i=n.attr__href)===null||i===void 0?void 0:i.slice(0,2048),attr_class:N9(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return xh(n).filter(a=>{var[u]=a;return u.indexOf("attr__")===0}).forEach(a=>{var[u,c]=a;return o.attributes[u]=c}),o})}(e))}function uk(e){return e.replace(/"|\\"/g,'\\"')}function N9(e){var t=e.attr__class;return t?qn(t)?t:Jy(t):void 0}class ck{constructor(){this.clicks=[]}isRageClick(t,n,r){var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(n-i.y)<30&&r-i.timestamp<1e3){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var B9=["localhost","127.0.0.1"],Bl=e=>{var t=st==null?void 0:st.createElement("a");return rt(t)?null:(t.href=e,t)},P9=function(e){var t,n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",i=[];return wn(e,function(o,a){rt(o)||rt(a)||a==="undefined"||(t=encodeURIComponent((u=>u instanceof File)(o)?o.name:o.toString()),n=encodeURIComponent(a),i[i.length]=n+"="+t)}),i.join(r)},Mh=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!qn(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{pt.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},n_=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),i=r[0]||"",o=r[1],a=i.split("?"),u=a[1],c=a[0],d=(u||"").split("&"),p=[],h=0;h<d.length;h++){var m=d[h].split("=");qn(m)&&(t.includes(m[0])?p.push(m[0]+"="+n):p.push(d[h]))}var v=c;return u!=null&&(v+="?"+p.join("&")),o!=null&&(v+="#"+o),v},Oh=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},fk=Zr("[AutoCapture]");function r_(e,t){return t.length>e?t.slice(0,e)+"...":t}function F9(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Ah(t));return t}function z9(e,t,n,r){var i=e.tagName.toLowerCase(),o={tag_name:i};e_.indexOf(i)>-1&&!n&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?o.$el_text=r_(1024,sk(e)):o.$el_text=r_(1024,Th(e)));var a=Ih(e);a.length>0&&(o.classes=a.filter(function(p){return p!==""})),wn(e.attributes,function(p){var h;if((!ik(e)||["name","id","class","aria-label"].indexOf(p.name)!==-1)&&(r==null||!r.includes(p.name))&&!t&&Nl(p.value)&&(h=p.name,!lr(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var m=p.value;p.name==="class"&&(m=Jy(m).join(" ")),o["attr__"+p.name]=r_(1024,m)}});for(var u=1,c=1,d=e;d=F9(d);)u++,d.tagName===e.tagName&&c++;return o.nth_child=u,o.nth_of_type=c,o}function U9(e,t){for(var n,r,{e:i,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:u,elementsChainAsString:c}=t,d=[e],p=e;p.parentNode&&!Na(p,"body");)JE(p.parentNode)?(d.push(p.parentNode.host),p=p.parentNode.host):(d.push(p.parentNode),p=p.parentNode);var h,m=[],v={},_=!1,S=!1;if(wn(d,A=>{var I=t_(A);A.tagName.toLowerCase()==="a"&&(_=A.getAttribute("href"),_=I&&_&&Nl(_)&&_),zt(Ih(A),"ph-no-capture")&&(S=!0),m.push(z9(A,o,a,u));var $=function(B){if(!t_(B))return{};var U={};return wn(B.attributes,function(G){if(G.name&&G.name.indexOf("data-ph-capture-attribute")===0){var P=G.name.replace("data-ph-capture-attribute-",""),K=G.value;P&&K&&Nl(K)&&(U[P]=K)}}),U}(A);ur(v,$)}),S)return{props:{},explicitNoCapture:S};if(a||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?m[0].$el_text=sk(e):m[0].$el_text=Th(e)),_){var x,b;m[0].attr__href=_;var C=(x=Bl(_))===null||x===void 0?void 0:x.host,k=be==null||(b=be.location)===null||b===void 0?void 0:b.host;C&&k&&C!==k&&(h=_)}return{props:ur({$event_type:i.type,$ce_version:1},c?{}:{$elements:m},{$elements_chain:L9(m)},(n=m[0])!==null&&n!==void 0&&n.$el_text?{$el_text:(r=m[0])===null||r===void 0?void 0:r.$el_text}:{},h&&i.type==="click"?{$external_click_url:h}:{},v)}}class j9{constructor(t){Ve(this,"_initialized",!1),Ve(this,"_isDisabledServerSide",null),Ve(this,"rageclicks",new ck),Ve(this,"_elementsChainAsString",!1),this.instance=t,this._elementSelectors=null}get config(){var t,n,r=Hn(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(t=r.url_allowlist)===null||t===void 0?void 0:t.map(i=>new RegExp(i)),r.url_ignorelist=(n=r.url_ignorelist)===null||n===void 0?void 0:n.map(i=>new RegExp(i)),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if(be&&st){var t=r=>{r=r||(be==null?void 0:be.event);try{this._captureEvent(r)}catch(i){fk.error("Failed to capture event",i)}};if(tr(st,"submit",t,{capture:!0}),tr(st,"change",t,{capture:!0}),tr(st,"click",t,{capture:!0}),this.config.capture_copied_text){var n=r=>{r=r||(be==null?void 0:be.event),this._captureEvent(r,Fy)};tr(st,"copy",n,{capture:!0}),tr(st,"cut",n,{capture:!0})}}}else fk.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this._elementsChainAsString=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[BE]:!!t.autocapture_opt_out}),this._isDisabledServerSide=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this._elementSelectors=t}getElementSelectors(t){var n,r=[];return(n=this._elementSelectors)===null||n===void 0||n.forEach(i=>{var o=st==null?void 0:st.querySelectorAll(i);o==null||o.forEach(a=>{t===a&&r.push(i)})}),r}get isEnabled(){var t,n,r=(t=this.instance.persistence)===null||t===void 0?void 0:t.props[BE],i=this._isDisabledServerSide;if($a(i)&&!Da(r)&&!this.instance.config.advanced_disable_decide)return!1;var o=(n=this._isDisabledServerSide)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!o}_captureEvent(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,i=nk(t);XE(i)&&(i=i.parentNode||null),n==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this._captureEvent(t,"$rageclick");var o=n===Fy;if(i&&M9(i,t,this.config,o,o?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:u}=U9(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(u)return!1;var c=this.getElementSelectors(i);if(c&&c.length>0&&(a.$element_selectors=c),n===Fy){var d,p=tk(be==null||(d=be.getSelection())===null||d===void 0?void 0:d.toString()),h=t.type||"clipboard";if(!p)return!1;a.$selected_content=p,a.$copy_type=h}return this.instance.capture(n,a),!0}}}isBrowserSupported(){return ho(st==null?void 0:st.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return li(e)&&isFinite(e)&&Math.floor(e)===e});var dk="0123456789abcdef";class Rh{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new Rh(o)}toString(){for(var t="",n=0;n<this.bytes.length;n++)t=t+dk.charAt(this.bytes[n]>>>4)+dk.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Rh(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;n<16;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class q9{constructor(){Ve(this,"timestamp",0),Ve(this,"counter",0),Ve(this,"random",new H9)}generate(){var t=this.generateOrAbort();if(rt(t)){this.timestamp=0;var n=this.generateOrAbort();if(rt(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.timestamp)this.timestamp=t,this.resetCounter();else{if(!(t+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Rh.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}var hk,pk=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};be&&!rt(be.crypto)&&crypto.getRandomValues&&(pk=e=>crypto.getRandomValues(e));class H9{constructor(){Ve(this,"buffer",new Uint32Array(8)),Ve(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(pk(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}var Ba=()=>G9().toString(),G9=()=>(hk||(hk=new q9)).generate(),V9="Thu, 01 Jan 1970 00:00:00 GMT",jc="",Z9=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Y9(e,t){if(t){var n=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:st;if(jc)return jc;if(!o||["localhost","127.0.0.1"].includes(i))return"";for(var a=i.split("."),u=Math.min(a.length,8),c="dmn_chk_"+Ba(),d=new RegExp("(^|;)\\s*"+c+"=1");!jc&&u--;){var p=a.slice(u).join("."),h=c+"=1;domain=."+p;o.cookie=h,d.test(o.cookie)&&(o.cookie=h+";expires="+V9,jc=p)}return jc}(e);if(!n){var r=(i=>{var o=i.match(Z9);return o?o[0]:""})(e);r!==n&&pt.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var Pa,Ko={is_supported:()=>!!st,error:function(e){pt.error("cookieStore error: "+e)},get:function(e){if(st){try{for(var t=e+"=",n=st.cookie.split(";").filter(o=>o.length),r=0;r<n.length;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}},parse:function(e){var t;try{t=JSON.parse(Ko.get(e))||{}}catch{}return t},set:function(e,t,n,r,i){if(st)try{var o="",a="",u=Y9(st.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+24*n*60*60*1e3),o="; expires="+c.toUTCString()}i&&(a="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+u+a;return d.length>3686.4&&pt.warn("cookieStore warning: large cookie, len="+d.length),st.cookie=d,d}catch{return}},remove:function(e,t){try{Ko.set(e,"",-1,t)}catch{return}}},i_=null,_r={is_supported:function(){if(!$a(i_))return i_;var e=!0;if(rt(be))e=!1;else try{var t="__mplssupport__";_r.set(t,"xyz"),_r.get(t)!=='"xyz"'&&(e=!1),_r.remove(t)}catch{e=!1}return e||pt.error("localStorage unsupported; falling back to cookie store"),i_=e,e},error:function(e){pt.error("localStorage error: "+e)},get:function(e){try{return be==null?void 0:be.localStorage.getItem(e)}catch(t){_r.error(t)}return null},parse:function(e){try{return JSON.parse(_r.get(e))||{}}catch{}return null},set:function(e,t){try{be==null||be.localStorage.setItem(e,JSON.stringify(t))}catch(n){_r.error(n)}},remove:function(e){try{be==null||be.localStorage.removeItem(e)}catch(t){_r.error(t)}}},W9=["distinct_id",wh,zc,kh,Xy],$h=Ee(Ee({},_r),{},{parse:function(e){try{var t={};try{t=Ko.parse(e)||{}}catch{}var n=ur(t,JSON.parse(_r.get(e)||"{}"));return _r.set(e,n),n}catch{}return null},set:function(e,t,n,r,i,o){try{_r.set(e,t,void 0,void 0,o);var a={};W9.forEach(u=>{t[u]&&(a[u]=t[u])}),Object.keys(a).length&&Ko.set(e,a,n,r,i,o)}catch(u){_r.error(u)}},remove:function(e,t){try{be==null||be.localStorage.removeItem(e),Ko.remove(e,t)}catch(n){_r.error(n)}}}),Dh={},K9={is_supported:function(){return!0},error:function(e){pt.error("memoryStorage error: "+e)},get:function(e){return Dh[e]||null},parse:function(e){return Dh[e]||null},set:function(e,t){Dh[e]=t},remove:function(e){delete Dh[e]}},Fs=null,Rr={is_supported:function(){if(!$a(Fs))return Fs;if(Fs=!0,rt(be))Fs=!1;else try{var e="__support__";Rr.set(e,"xyz"),Rr.get(e)!=='"xyz"'&&(Fs=!1),Rr.remove(e)}catch{Fs=!1}return Fs},error:function(e){pt.error("sessionStorage error: ",e)},get:function(e){try{return be==null?void 0:be.sessionStorage.getItem(e)}catch(t){Rr.error(t)}return null},parse:function(e){try{return JSON.parse(Rr.get(e))||null}catch{}return null},set:function(e,t){try{be==null||be.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){Rr.error(n)}},remove:function(e){try{be==null||be.sessionStorage.removeItem(e)}catch(t){Rr.error(t)}}};(function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"})(Pa||(Pa={}));class Q9{constructor(t){this.instance=t}get config(){return this.instance.config}get consent(){return this.getDnt()?Pa.DENIED:this.storedConsent}isOptedOut(){return this.consent===Pa.DENIED||this.consent===Pa.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(t){this.storage.set(this.storageKey,t?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:t,opt_out_capturing_cookie_prefix:n}=this.instance.config;return(n||"__ph_opt_in_out_")+t}get storedConsent(){var t=this.storage.get(this.storageKey);return t==="1"?Pa.GRANTED:t==="0"?Pa.DENIED:Pa.PENDING}get storage(){if(!this._storage){var t=this.config.opt_out_capturing_persistence_type;this._storage=t==="localStorage"?_r:Ko;var n=t==="localStorage"?Ko:_r;n.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(n.get(this.storageKey)==="1"),n.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!LE([Oi==null?void 0:Oi.doNotTrack,Oi==null?void 0:Oi.msDoNotTrack,At.doNotTrack],t=>zt([!0,1,"1","yes"],t))}}var Lh=Zr("[Dead Clicks]"),X9=()=>!0,J9=e=>{var t,n=!((t=e.instance.persistence)===null||t===void 0||!t.get_property(zE)),r=e.instance.config.capture_dead_clicks;return Da(r)?r:n};class gk{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[zE]:t==null?void 0:t.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(t){var n,r,i;(n=At.__PosthogExtensions__)!==null&&n!==void 0&&n.initDeadClicksAutocapture&&t(),(r=At.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"dead-clicks-autocapture",o=>{o?Lh.error("failed to load script",o):t()})}start(){var t;if(st){if(!this._lazyLoadedDeadClicksAutocapture&&(t=At.__PosthogExtensions__)!==null&&t!==void 0&&t.initDeadClicksAutocapture){var n=Hn(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=At.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this._lazyLoadedDeadClicksAutocapture.start(st),Lh.info("starting...")}}else Lh.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Lh.info("stopping..."))}}var o_=Zr("[ExceptionAutocapture]");class eB{constructor(t){var n;Ve(this,"startCapturing",()=>{var r;if(be&&this.isEnabled&&(r=At.__PosthogExtensions__)!==null&&r!==void 0&&r.errorWrappingFunctions){var i=At.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=At.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=At.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.unwrapOnError&&this.config.capture_unhandled_errors&&(this.unwrapOnError=i(this.captureException.bind(this))),!this.unwrapUnhandledRejection&&this.config.capture_unhandled_rejections&&(this.unwrapUnhandledRejection=o(this.captureException.bind(this))),!this.unwrapConsoleError&&this.config.capture_console_errors&&(this.unwrapConsoleError=a(this.captureException.bind(this)))}catch(u){o_.error("failed to start",u),this.stopCapturing()}}}),this.instance=t,this.remoteEnabled=!((n=this.instance.persistence)===null||n===void 0||!n.props[PE]),this.config=this.requiredConfig(),this.startIfEnabled()}requiredConfig(){var t=this.instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Hn(t)?n=Ee(Ee({},n),t):(rt(t)?this.remoteEnabled:t)&&(n=Ee(Ee({},n),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.config.capture_console_errors||this.config.capture_unhandled_errors||this.config.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(o_.info("enabled"),this.loadScript(this.startCapturing))}loadScript(t){var n,r,i;(n=At.__PosthogExtensions__)!==null&&n!==void 0&&n.errorWrappingFunctions&&t(),(r=At.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"exception-autocapture",o=>{if(o)return o_.error("failed to load script",o);t()})}stopCapturing(){var t,n,r;(t=this.unwrapOnError)===null||t===void 0||t.call(this),this.unwrapOnError=void 0,(n=this.unwrapUnhandledRejection)===null||n===void 0||n.call(this),this.unwrapUnhandledRejection=void 0,(r=this.unwrapConsoleError)===null||r===void 0||r.call(this),this.unwrapConsoleError=void 0}onRemoteConfig(t){var n=t.autocaptureExceptions;this.remoteEnabled=!!n||!1,this.config=this.requiredConfig(),this.instance.persistence&&this.instance.persistence.register({[PE]:this.remoteEnabled}),this.startIfEnabled()}captureException(t){var n=this.instance.requestRouter.endpointFor("ui");t.$exception_personURL="".concat(n,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(t)}}function mk(e){return!rt(Event)&&vk(e,Event)}function vk(e,t){try{return e instanceof t}catch{return!1}}function Nh(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function a_(e){return Nh(e,"DOMError")}var yk=/\(error: (.*)\)/,_k=50,Pl="?";function s_(e,t,n,r){var i={platform:"web:javascript",filename:e,function:t==="<anonymous>"?Pl:t,in_app:!0};return rt(n)||(i.lineno=n),rt(r)||(i.colno=r),i}var tB=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,nB=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,rB=/\((\S*)(?::(\d+))(?::(\d+))\)/,iB=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,oB=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,aB=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.sort((i,o)=>i[0]-o[0]).map(i=>i[1]);return function(i){for(var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=[],u=i.split(`
50
+ `),c=o;c<u.length;c++){var d=u[c];if(!(d.length>1024)){var p=yk.test(d)?d.replace(yk,"$1"):d;if(!p.match(/\S*Error: /)){for(var h of r){var m=h(p);if(m){a.push(m);break}}if(a.length>=_k)break}}}return function(v){if(!v.length)return[];var _=Array.from(v);return _.reverse(),_.slice(0,_k).map(S=>Ee(Ee({},S),{},{filename:S.filename||sB(_).filename,function:S.function||Pl}))}(a)}}([30,e=>{var t=tB.exec(e);if(t){var[,n,r,i]=t;return s_(n,Pl,+r,+i)}var o=nB.exec(e);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=rB.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[u,c]=xk(o[1]||Pl,o[2]);return s_(c,u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,e=>{var t=iB.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=oB.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],i=t[1]||Pl;return[i,r]=xk(i,r),s_(r,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]);function sB(e){return e[e.length-1]||{}}var Bh,bk,l_,xk=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Pl,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]},lB=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function u_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=e.stacktrace||e.stack||"",r=function(a){return a&&uB.test(a.message)?1:0}(e);try{var i=aB,o=function(a,u){var c=function(d){var p=globalThis._posthogChunkIds;if(!p)return{};var h=Object.keys(p);return l_&&h.length===bk||(bk=h.length,l_=h.reduce((m,v)=>{Bh||(Bh={});var _=Bh[v];if(_)m[_[0]]=_[1];else for(var S=d(v),x=S.length-1;x>=0;x--){var b=S[x],C=b==null?void 0:b.filename,k=p[v];if(C&&k){m[C]=k,Bh[v]=[C,k];break}}return m},{})),l_}(u);return a.forEach(d=>{d.filename&&(d.chunk_id=c[d.filename])}),a}(i(n,r),i);return o.slice(0,o.length-t)}catch{}return[]}var uB=/Minified React error #\d+;/i;function c_(e,t){var n,r,i=u_(e),o=(n=t==null?void 0:t.handled)===null||n===void 0||n,a=(r=t==null?void 0:t.synthetic)!==null&&r!==void 0&&r;return{$exception_list:[{type:t!=null&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:function(u){var c=u.message;return c.error&&typeof c.error.message=="string"?String(c.error.message):String(c)}(e),stacktrace:{frames:i,type:"raw"},mechanism:{handled:o,synthetic:a}}],$exception_level:"error"}}function f_(e,t){var n,r,i,o=(n=t==null?void 0:t.handled)===null||n===void 0||n,a=(r=t==null?void 0:t.synthetic)===null||r===void 0||r,u={type:t!=null&&t.overrideExceptionType?t.overrideExceptionType:(i=t==null?void 0:t.defaultExceptionType)!==null&&i!==void 0?i:"Error",value:e||(t==null?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:a}};if(t!=null&&t.syntheticException){var c=u_(t.syntheticException,1);c.length&&(u.stacktrace={frames:c,type:"raw"})}return{$exception_list:[u],$exception_level:"error"}}function cB(e){return lr(e)&&!Uy(e)&&b9.indexOf(e)>=0}function fB(e,t){var n,r,i=(n=t==null?void 0:t.handled)===null||n===void 0||n,o=(r=t==null?void 0:t.synthetic)===null||r===void 0||r,a=t!=null&&t.overrideExceptionType?t.overrideExceptionType:mk(e)?e.constructor.name:"Error",u="Non-Error 'exception' captured with keys: ".concat(function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:40,m=Object.keys(p);if(m.sort(),!m.length)return"[object has no keys]";for(var v=m.length;v>0;v--){var _=m.slice(0,v).join(", ");if(!(_.length>h))return v===m.length||_.length<=h?_:"".concat(_.slice(0,h),"...")}return""}(e)),c={type:a,value:u,mechanism:{handled:i,synthetic:o}};if(t!=null&&t.syntheticException){var d=u_(t==null?void 0:t.syntheticException,1);d.length&&(c.stacktrace={frames:d,type:"raw"})}return{$exception_list:[c],$exception_level:cB(e.level)?e.level:"error"}}function dB(e,t){var{error:n,event:r}=e,i={$exception_list:[]},o=n||r;if(a_(o)||function(v){return Nh(v,"DOMException")}(o)){var a=o;if(function(v){return"stack"in v}(o))i=c_(o,t);else{var u=a.name||(a_(a)?"DOMError":"DOMException"),c=a.message?"".concat(u,": ").concat(a.message):u,d=a_(a)?"DOMError":"DOMException";i=f_(c,Ee(Ee({},t),{},{overrideExceptionType:d,defaultExceptionMessage:c}))}return"code"in a&&(i.$exception_DOMException_code="".concat(a.code)),i}if(function(v){return Nh(v,"ErrorEvent")}(o)&&o.error)return c_(o.error,t);if(function(v){switch(Object.prototype.toString.call(v)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return vk(v,Error)}}(o))return c_(o,t);if(function(v){return Nh(v,"Object")}(o)||mk(o))return fB(o,t);if(rt(n)&&lr(r)){var p="Error",h=r,m=r.match(lB);return m&&(p=m[1],h=m[2]),f_(h,Ee(Ee({},t),{},{overrideExceptionType:p,defaultExceptionMessage:h}))}return f_(o,t)}function Ph(e){var t,n;return((t=JSON.stringify(e,(n=[],function(r,i){if(Hn(i)){for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(i)?"[Circular]":(n.push(i),i)}return i})))===null||t===void 0?void 0:t.length)||0}function d_(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),i=e.data.slice(n);return[d_({size:Ph(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),d_({size:Ph(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap(o=>o)}return[e]}var Qo=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Qo||{}),po=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(po||{}),h_="[SessionRecording]",p_="redacted",Fh={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},hB=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],pB=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],gB=["/s/","/e/","/i/"];function wk(e,t,n,r){if(pn(e))return e;var i=(t==null?void 0:t["content-length"])||function(o){return new Blob([o]).size}(e);return lr(i)&&(i=parseInt(i)),i>n?h_+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function Sk(e,t){if(pn(e))return e;var n=e;return Nl(n,!1)||(n=h_+" "+t+" body "+p_),wn(pB,r=>{var i,o;(i=n)!==null&&i!==void 0&&i.length&&((o=n)===null||o===void 0?void 0:o.indexOf(r))!==-1&&(n=h_+" "+t+" body "+p_+" as might contain: "+r)}),n}var mB=(e,t)=>{var n,r,i,o={payloadSizeLimitBytes:Fh.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Fh.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Fh.payloadHostDenyList]},a=e.session_recording.recordHeaders!==!1&&t.recordHeaders,u=e.session_recording.recordBody!==!1&&t.recordBody,c=e.capture_performance!==!1&&t.recordPerformance,d=(n=o,i=Math.min(1e6,(r=n.payloadSizeLimitBytes)!==null&&r!==void 0?r:1e6),m=>(m!=null&&m.requestBody&&(m.requestBody=wk(m.requestBody,m.requestHeaders,i,"Request")),m!=null&&m.responseBody&&(m.responseBody=wk(m.responseBody,m.responseHeaders,i,"Response")),m)),p=m=>{return d(((S,x)=>{var b,C=Bl(S.name),k=x.indexOf("http")===0?(b=Bl(x))===null||b===void 0?void 0:b.pathname:x;k==="/"&&(k="");var A=C==null?void 0:C.pathname.replace(k||"","");if(!(C&&A&&gB.some(I=>A.indexOf(I)===0)))return S})((_=(v=m).requestHeaders,pn(_)||wn(Object.keys(_??{}),S=>{hB.includes(S.toLowerCase())&&(_[S]=p_)}),v),e.api_host));var v,_},h=ho(e.session_recording.maskNetworkRequestFn);return h&&ho(e.session_recording.maskCapturedNetworkRequestFn)&&pt.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=m=>{var v=e.session_recording.maskNetworkRequestFn({url:m.name});return Ee(Ee({},m),{},{name:v==null?void 0:v.url})}),o.maskRequestFn=ho(e.session_recording.maskCapturedNetworkRequestFn)?m=>{var v,_,S,x=p(m);return x&&(v=(_=(S=e.session_recording).maskCapturedNetworkRequestFn)===null||_===void 0?void 0:_.call(S,x))!==null&&v!==void 0?v:void 0}:m=>function(v){if(!rt(v))return v.requestBody=Sk(v.requestBody,"Request"),v.responseBody=Sk(v.responseBody,"Response"),v}(p(m)),Ee(Ee(Ee({},Fh),o),{},{recordHeaders:a,recordBody:u,recordPerformance:c,recordInitialRequests:c})};function Hi(e,t,n,r,i){return t>n&&(pt.warn("min cannot be greater than max."),t=n),li(e)?e>n?(r&&pt.warn(r+" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(r&&pt.warn(r+" cannot be less than min: "+t+". Using min value instead."),t):e:(r&&pt.warn(r+" must be a number. using max or fallback. max: "+n+", fallback: "+i),Hi(i||n,t,n,r))}class vB{constructor(t){var n,r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ve(this,"bucketSize",100),Ve(this,"refillRate",10),Ve(this,"mutationBuckets",{}),Ve(this,"loggedTracker",{}),Ve(this,"refillBuckets",()=>{Object.keys(this.mutationBuckets).forEach(o=>{this.mutationBuckets[o]=this.mutationBuckets[o]+this.refillRate,this.mutationBuckets[o]>=this.bucketSize&&delete this.mutationBuckets[o]})}),Ve(this,"getNodeOrRelevantParent",o=>{var a=this.rrweb.mirror.getNode(o);if((a==null?void 0:a.nodeName)!=="svg"&&a instanceof Element){var u=a.closest("svg");if(u)return[this.rrweb.mirror.getId(u),u]}return[o,a]}),Ve(this,"numberOfChanges",o=>{var a,u,c,d,p,h,m,v;return((a=(u=o.removes)===null||u===void 0?void 0:u.length)!==null&&a!==void 0?a:0)+((c=(d=o.attributes)===null||d===void 0?void 0:d.length)!==null&&c!==void 0?c:0)+((p=(h=o.texts)===null||h===void 0?void 0:h.length)!==null&&p!==void 0?p:0)+((m=(v=o.adds)===null||v===void 0?void 0:v.length)!==null&&m!==void 0?m:0)}),Ve(this,"throttleMutations",o=>{if(o.type!==3||o.data.source!==0)return o;var a=o.data,u=this.numberOfChanges(a);a.attributes&&(a.attributes=a.attributes.filter(d=>{var p,h,m,[v,_]=this.getNodeOrRelevantParent(d.id);return this.mutationBuckets[v]===0?!1:(this.mutationBuckets[v]=(p=this.mutationBuckets[v])!==null&&p!==void 0?p:this.bucketSize,this.mutationBuckets[v]=Math.max(this.mutationBuckets[v]-1,0),this.mutationBuckets[v]===0&&(this.loggedTracker[v]||(this.loggedTracker[v]=!0,(h=(m=this.options).onBlockedNode)===null||h===void 0||h.call(m,v,_))),d)}));var c=this.numberOfChanges(a);return c!==0||u===c?o:void 0}),this.rrweb=t,this.options=i,this.refillRate=Hi((n=this.options.refillRate)!==null&&n!==void 0?n:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=Hi((r=this.options.bucketSize)!==null&&r!==void 0?r:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}}var Gi=Uint8Array,bi=Uint16Array,Fl=Uint32Array,g_=new Gi([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),m_=new Gi([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ck=new Gi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ek=function(e,t){for(var n=new bi(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Fl(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},kk=Ek(g_,2),yB=kk[0],v_=kk[1];yB[28]=258,v_[258]=28;for(var Ak=Ek(m_,0)[1],Ik=new bi(32768),Tn=0;Tn<32768;++Tn){var zs=(43690&Tn)>>>1|(21845&Tn)<<1;zs=(61680&(zs=(52428&zs)>>>2|(13107&zs)<<2))>>>4|(3855&zs)<<4,Ik[Tn]=((65280&zs)>>>8|(255&zs)<<8)>>>1}var qc=function(e,t,n){for(var r=e.length,i=0,o=new bi(t);i<r;++i)++o[e[i]-1];var a,u=new bi(t);for(i=0;i<t;++i)u[i]=u[i-1]+o[i-1]<<1;for(a=new bi(r),i=0;i<r;++i)a[i]=Ik[u[e[i]-1]++]>>>15-e[i];return a},Us=new Gi(288);for(Tn=0;Tn<144;++Tn)Us[Tn]=8;for(Tn=144;Tn<256;++Tn)Us[Tn]=9;for(Tn=256;Tn<280;++Tn)Us[Tn]=7;for(Tn=280;Tn<288;++Tn)Us[Tn]=8;var zh=new Gi(32);for(Tn=0;Tn<32;++Tn)zh[Tn]=5;var _B=qc(Us,9),bB=qc(zh,5),Tk=function(e){return(e/8>>0)+(7&e&&1)},Mk=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof bi?bi:e instanceof Fl?Fl:Gi)(n-t);return r.set(e.subarray(t,n)),r},Xo=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Hc=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},y_=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new Gi(0),0];if(i==1){var a=new Gi(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort(function(I,$){return I.f-$.f}),n.push({s:-1,f:25001});var u=n[0],c=n[1],d=0,p=1,h=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};p!=i-1;)u=n[n[d].f<n[h].f?d++:h++],c=n[d!=p&&n[d].f<n[h].f?d++:h++],n[p++]={s:-1,f:u.f+c.f,l:u,r:c};var m=o[0].s;for(r=1;r<i;++r)o[r].s>m&&(m=o[r].s);var v=new bi(m+1),_=__(n[p-1],v,0);if(_>t){r=0;var S=0,x=_-t,b=1<<x;for(o.sort(function(I,$){return v[$.s]-v[I.s]||I.f-$.f});r<i;++r){var C=o[r].s;if(!(v[C]>t))break;S+=b-(1<<_-v[C]),v[C]=t}for(S>>>=x;S>0;){var k=o[r].s;v[k]<t?S-=1<<t-v[k]++-1:++r}for(;r>=0&&S;--r){var A=o[r].s;v[A]==t&&(--v[A],++S)}_=t}return[new Gi(v),_]},__=function(e,t,n){return e.s==-1?Math.max(__(e.l,t,n+1),__(e.r,t,n+1)):t[e.s]=n},Ok=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new bi(++t),r=0,i=e[0],o=1,a=function(c){n[r++]=c},u=1;u<=t;++u)if(e[u]==i&&u!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[u]}return[n.subarray(0,r),t]},Gc=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},b_=function(e,t,n){var r=n.length,i=Tk(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},Rk=function(e,t,n,r,i,o,a,u,c,d,p){Xo(t,p++,n),++i[256];for(var h=y_(i,15),m=h[0],v=h[1],_=y_(o,15),S=_[0],x=_[1],b=Ok(m),C=b[0],k=b[1],A=Ok(S),I=A[0],$=A[1],B=new bi(19),U=0;U<C.length;++U)B[31&C[U]]++;for(U=0;U<I.length;++U)B[31&I[U]]++;for(var G=y_(B,7),P=G[0],K=G[1],re=19;re>4&&!P[Ck[re-1]];--re);var ue,Z,ie,V,Q=d+5<<3,ye=Gc(i,Us)+Gc(o,zh)+a,Te=Gc(i,m)+Gc(o,S)+a+14+3*re+Gc(B,P)+(2*B[16]+3*B[17]+7*B[18]);if(Q<=ye&&Q<=Te)return b_(t,p,e.subarray(c,c+d));if(Xo(t,p,1+(Te<ye)),p+=2,Te<ye){ue=qc(m,v),Z=m,ie=qc(S,x),V=S;var T=qc(P,K);for(Xo(t,p,k-257),Xo(t,p+5,$-1),Xo(t,p+10,re-4),p+=14,U=0;U<re;++U)Xo(t,p+3*U,P[Ck[U]]);p+=3*re;for(var X=[C,I],ve=0;ve<2;++ve){var L=X[ve];for(U=0;U<L.length;++U){var we=31&L[U];Xo(t,p,T[we]),p+=P[we],we>15&&(Xo(t,p,L[U]>>>5&127),p+=L[U]>>>12)}}}else ue=_B,Z=Us,ie=bB,V=zh;for(U=0;U<u;++U)if(r[U]>255){we=r[U]>>>18&31,Hc(t,p,ue[we+257]),p+=Z[we+257],we>7&&(Xo(t,p,r[U]>>>23&31),p+=g_[we]);var Ue=31&r[U];Hc(t,p,ie[Ue]),p+=V[Ue],Ue>3&&(Hc(t,p,r[U]>>>5&8191),p+=m_[Ue])}else Hc(t,p,ue[r[U]]),p+=Z[r[U]];return Hc(t,p,ue[256]),p+Z[256]},xB=new Fl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),wB=function(){for(var e=new Fl(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),SB=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=wB[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},CB=function(e,t,n,r,i){return function(o,a,u,c,d,p){var h=o.length,m=new Gi(c+h+5*(1+Math.floor(h/7e3))+d),v=m.subarray(c,m.length-d),_=0;if(!a||h<8)for(var S=0;S<=h;S+=65535){var x=S+65535;x<h?_=b_(v,_,o.subarray(S,x)):(v[S]=p,_=b_(v,_,o.subarray(S,h)))}else{for(var b=xB[a-1],C=b>>>13,k=8191&b,A=(1<<u)-1,I=new bi(32768),$=new bi(A+1),B=Math.ceil(u/3),U=2*B,G=function(He){return(o[He]^o[He+1]<<B^o[He+2]<<U)&A},P=new Fl(25e3),K=new bi(288),re=new bi(32),ue=0,Z=0,ie=(S=0,0),V=0,Q=0;S<h;++S){var ye=G(S),Te=32767&S,T=$[ye];if(I[Te]=T,$[ye]=Te,V<=S){var X=h-S;if((ue>7e3||ie>24576)&&X>423){_=Rk(o,v,0,P,K,re,Z,ie,Q,S-Q,_),ie=ue=Z=0,Q=S;for(var ve=0;ve<286;++ve)K[ve]=0;for(ve=0;ve<30;++ve)re[ve]=0}var L=2,we=0,Ue=k,de=Te-T&32767;if(X>2&&ye==G(S-de))for(var tt=Math.min(C,X)-1,Ze=Math.min(32767,S),lt=Math.min(258,X);de<=Ze&&--Ue&&Te!=T;){if(o[S+L]==o[S+L-de]){for(var gt=0;gt<lt&&o[S+gt]==o[S+gt-de];++gt);if(gt>L){if(L=gt,we=de,gt>tt)break;var je=Math.min(de,gt-2),Se=0;for(ve=0;ve<je;++ve){var Ye=S-de+ve+32768&32767,Qe=Ye-I[Ye]+32768&32767;Qe>Se&&(Se=Qe,T=Ye)}}}de+=(Te=T)-(T=I[Te])+32768&32767}if(we){P[ie++]=268435456|v_[L]<<18|Ak[we];var ot=31&v_[L],et=31&Ak[we];Z+=g_[ot]+m_[et],++K[257+ot],++re[et],V=S+L,++ue}else P[ie++]=o[S],++K[o[S]]}}_=Rk(o,v,p,P,K,re,Z,ie,Q,S-Q,_)}return Mk(m,0,c+Tk(_)+d)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)},x_=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},EB=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&x_(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},kB=function(e){return 10+(e.filename&&e.filename.length+1||0)};function $k(e,t){t===void 0&&(t={});var n=SB(),r=e.length;n.p(e);var i=CB(e,t,kB(t),8),o=i.length;return EB(i,t),x_(i,o-8,n.d()),x_(i,o-4,r),i}function Dk(e,t){var n=e.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new Gi(e.length+(e.length>>>1)),i=0,o=function(d){r[i++]=d},a=0;a<n;++a){if(i+5>r.length){var u=new Gi(i+8+(n-a<<1));u.set(r),r=u}var c=e.charCodeAt(a);c<128||t?o(c):c<2048?(o(192|c>>>6),o(128|63&c)):c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++a))>>>18),o(128|c>>>12&63),o(128|c>>>6&63),o(128|63&c)):(o(224|c>>>12),o(128|c>>>6&63),o(128|63&c))}return Mk(r,0,i)}function AB(e,t){return function(n){for(var r=0,i=0;i<n.length;i++)r=(r<<5)-r+n.charCodeAt(i),r|=0;return Math.abs(r)}(e)%100<Hi(100*t,0,100)}var Vc="[SessionRecording]",Yr=Zr(Vc);function Uh(){var e,t;return At==null||(e=At.__PosthogExtensions__)===null||e===void 0||(t=e.rrweb)===null||t===void 0?void 0:t.record}var IB=3e5,TB=[po.MouseMove,po.MouseInteraction,po.Scroll,po.ViewportResize,po.Input,po.TouchMove,po.MediaInteraction,po.Drag],Lk=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function js(e){return function(t,n){for(var r="",i=0;i<t.length;){var o=t[i++];r+=String.fromCharCode(o)}return r}($k(Dk(JSON.stringify(e))))}function Nk(e){return e.type===Qo.Custom&&e.data.tag==="sessionIdle"}function Bk(e,t){return t.some(n=>n.matching==="regex"&&new RegExp(n.url).test(e))}class MB{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(Vc+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var t,n;return this.triggerStatus==="trigger_pending"?6e4:(t=(n=this.instance.config.session_recording)===null||n===void 0?void 0:n.full_snapshot_interval_millis)!==null&&t!==void 0?t:IB}get isSampled(){var t=this.instance.get_property(zc);return Da(t)?t:null}get sessionDuration(){var t,n,r=(t=this.buffer)===null||t===void 0?void 0:t.data[((n=this.buffer)===null||n===void 0?void 0:n.data.length)-1],{sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i:null}get isRecordingEnabled(){var t=!!this.instance.get_property(qy),n=!this.instance.config.disable_session_recording;return be&&t&&n}get isConsoleLogCaptureEnabled(){var t=!!this.instance.get_property(jE),n=this.instance.config.enable_recording_console_log;return n??t}get canvasRecording(){var t,n,r,i,o,a,u=this.instance.config.session_recording.captureCanvas,c=this.instance.get_property(GE),d=(t=(n=u==null?void 0:u.recordCanvas)!==null&&n!==void 0?n:c==null?void 0:c.enabled)!==null&&t!==void 0&&t,p=(r=(i=u==null?void 0:u.canvasFps)!==null&&i!==void 0?i:c==null?void 0:c.fps)!==null&&r!==void 0?r:4,h=(o=(a=u==null?void 0:u.canvasQuality)!==null&&a!==void 0?a:c==null?void 0:c.quality)!==null&&o!==void 0?o:.4;if(typeof h=="string"){var m=parseFloat(h);h=isNaN(m)?.4:m}return{enabled:d,fps:Hi(p,0,12,"canvas recording fps",4),quality:Hi(h,0,1,"canvas recording quality",.4)}}get networkPayloadCapture(){var t,n,r=this.instance.get_property(qE),i={recordHeaders:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.recordHeaders,recordBody:(n=this.instance.config.session_recording)===null||n===void 0?void 0:n.recordBody},o=(i==null?void 0:i.recordHeaders)||(r==null?void 0:r.recordHeaders),a=(i==null?void 0:i.recordBody)||(r==null?void 0:r.recordBody),u=Hn(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,c=!!(Da(u)?u:r!=null&&r.capturePerformance);return o||a||c?{recordHeaders:o,recordBody:a,recordPerformance:c}:void 0}get masking(){var t,n,r,i,o,a,u=this.instance.get_property(HE),c={maskAllInputs:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.maskAllInputs,maskTextSelector:(n=this.instance.config.session_recording)===null||n===void 0?void 0:n.maskTextSelector,blockSelector:(r=this.instance.config.session_recording)===null||r===void 0?void 0:r.blockSelector},d=(i=c==null?void 0:c.maskAllInputs)!==null&&i!==void 0?i:u==null?void 0:u.maskAllInputs,p=(o=c==null?void 0:c.maskTextSelector)!==null&&o!==void 0?o:u==null?void 0:u.maskTextSelector,h=(a=c==null?void 0:c.blockSelector)!==null&&a!==void 0?a:u==null?void 0:u.blockSelector;return rt(d)&&rt(p)&&rt(h)?void 0:{maskAllInputs:d==null||d,maskTextSelector:p,blockSelector:h}}get sampleRate(){var t=this.instance.get_property(VE);return li(t)?t:null}get minimumDuration(){var t=this.instance.get_property(ZE);return li(t)?t:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this.isSampled===!1?"disabled":this._urlBlocked?"paused":pn(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":Da(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var t;return this._urlTriggers.length===0?"trigger_disabled":((t=this.instance)===null||t===void 0?void 0:t.get_property(Hy))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var t;return this._eventTriggers.length===0?"trigger_disabled":((t=this.instance)===null||t===void 0?void 0:t.get_property(Gy))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var t=this.eventTriggerStatus==="trigger_activated"||this.urlTriggerStatus==="trigger_activated",n=this.eventTriggerStatus==="trigger_pending"||this.urlTriggerStatus==="trigger_pending";return t?"trigger_activated":n?"trigger_pending":"trigger_disabled"}constructor(t){if(Ve(this,"queuedRRWebEvents",[]),Ve(this,"isIdle","unknown"),Ve(this,"_linkedFlagSeen",!1),Ve(this,"_lastActivityTimestamp",Date.now()),Ve(this,"_linkedFlag",null),Ve(this,"_removePageViewCaptureHook",void 0),Ve(this,"_onSessionIdListener",void 0),Ve(this,"_persistDecideOnSessionListener",void 0),Ve(this,"_samplingSessionListener",void 0),Ve(this,"_urlTriggers",[]),Ve(this,"_urlBlocklist",[]),Ve(this,"_urlBlocked",!1),Ve(this,"_eventTriggers",[]),Ve(this,"_removeEventTriggerCaptureHook",void 0),Ve(this,"_forceAllowLocalhostNetworkCapture",!1),Ve(this,"_onBeforeUnload",()=>{this._flushBuffer()}),Ve(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),Ve(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),Ve(this,"_onVisibilityChange",()=>{if(st!=null&&st.visibilityState){var i="window "+st.visibilityState;this._tryAddCustomEvent(i,{})}}),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Yr.error("started without valid sessionManager"),new Error(Vc+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(Vc+" cannot be used with __preview_experimental_cookieless_mode.");var{sessionId:n,windowId:r}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=n,this.windowId=r,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Yr.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(t){this.isRecordingEnabled?(this._startCapture(t),tr(be,"beforeunload",this._onBeforeUnload),tr(be,"offline",this._onOffline),tr(be,"online",this._onOnline),tr(be,"visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),pn(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",n=>{try{if(n.event==="$pageview"){var r=n!=null&&n.properties.$current_url?this._maskUrl(n==null?void 0:n.properties.$current_url):"";if(!r)return;this._tryAddCustomEvent("$pageview",{href:r})}}catch(i){Yr.error("Could not add $pageview to rrweb session",i)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((n,r,i)=>{var o,a,u,c;i&&(this._tryAddCustomEvent("$session_id_change",{sessionId:n,windowId:r,changeReason:i}),(o=this.instance)===null||o===void 0||(a=o.persistence)===null||a===void 0||a.unregister(Gy),(u=this.instance)===null||u===void 0||(c=u.persistence)===null||c===void 0||c.unregister(Hy))}))):this.stopRecording()}stopRecording(){var t,n,r,i;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,be==null||be.removeEventListener("beforeunload",this._onBeforeUnload),be==null||be.removeEventListener("offline",this._onOffline),be==null||be.removeEventListener("online",this._onOnline),be==null||be.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),(t=this._removePageViewCaptureHook)===null||t===void 0||t.call(this),this._removePageViewCaptureHook=void 0,(n=this._removeEventTriggerCaptureHook)===null||n===void 0||n.call(this),this._removeEventTriggerCaptureHook=void 0,(r=this._onSessionIdListener)===null||r===void 0||r.call(this),this._onSessionIdListener=void 0,(i=this._samplingSessionListener)===null||i===void 0||i.call(this),this._samplingSessionListener=void 0,Yr.info("stopped"))}_resetSampling(){var t;(t=this.instance.persistence)===null||t===void 0||t.unregister(zc)}makeSamplingDecision(t){var n,r=this.sessionId!==t,i=this.sampleRate;if(li(i)){var o=this.isSampled,a=r||!Da(o),u=a?AB(t,i):o;a&&(u?this._reportStarted("sampled"):Yr.warn("Sample rate (".concat(i,") has determined that this sessionId (").concat(t,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:i,isSampled:u})),(n=this.instance.persistence)===null||n===void 0||n.register({[zc]:u})}else this._resetSampling()}onRemoteConfig(t){var n,r,i,o,a,u;if(this._tryAddCustomEvent("$remote_config_received",t),this._persistRemoteConfig(t),this._linkedFlag=((n=t.sessionRecording)===null||n===void 0?void 0:n.linkedFlag)||null,(r=t.sessionRecording)!==null&&r!==void 0&&r.endpoint&&(this._endpoint=(u=t.sessionRecording)===null||u===void 0?void 0:u.endpoint),this._setupSampling(),!pn(this._linkedFlag)&&!this._linkedFlagSeen){var c=lr(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,d=lr(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((p,h)=>{var m=Hn(h)&&c in h,v=d?h[c]===d:m;v&&this._reportStarted("linked_flag_matched",{linkedFlag:c,linkedVariant:d}),this._linkedFlagSeen=v})}(i=t.sessionRecording)!==null&&i!==void 0&&i.urlTriggers&&(this._urlTriggers=t.sessionRecording.urlTriggers),(o=t.sessionRecording)!==null&&o!==void 0&&o.urlBlocklist&&(this._urlBlocklist=t.sessionRecording.urlBlocklist),(a=t.sessionRecording)!==null&&a!==void 0&&a.eventTriggers&&(this._eventTriggers=t.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){li(this.sampleRate)&&pn(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(t=>{this.makeSamplingDecision(t)}))}_persistRemoteConfig(t){if(this.instance.persistence){var n,r=this.instance.persistence,i=()=>{var o,a,u,c,d,p,h,m,v,_=(o=t.sessionRecording)===null||o===void 0?void 0:o.sampleRate,S=pn(_)?null:parseFloat(_);pn(S)&&this._resetSampling();var x=(a=t.sessionRecording)===null||a===void 0?void 0:a.minimumDurationMilliseconds;r.register({[qy]:!!t.sessionRecording,[jE]:(u=t.sessionRecording)===null||u===void 0?void 0:u.consoleLogRecordingEnabled,[qE]:Ee({capturePerformance:t.capturePerformance},(c=t.sessionRecording)===null||c===void 0?void 0:c.networkPayloadCapture),[HE]:(d=t.sessionRecording)===null||d===void 0?void 0:d.masking,[GE]:{enabled:(p=t.sessionRecording)===null||p===void 0?void 0:p.recordCanvas,fps:(h=t.sessionRecording)===null||h===void 0?void 0:h.canvasFps,quality:(m=t.sessionRecording)===null||m===void 0?void 0:m.canvasQuality},[VE]:S,[ZE]:rt(x)?null:x,[YE]:(v=t.sessionRecording)===null||v===void 0?void 0:v.scriptConfig})};i(),(n=this._persistDecideOnSessionListener)===null||n===void 0||n.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(i)}}log(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(n=this.instance.sessionRecording)===null||n===void 0||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:r,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}_startCapture(t){if(!rt(Object.assign)&&!rt(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var n,r;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),Uh()?this._onScriptLoaded():(n=At.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,this.scriptName,i=>{if(i)return Yr.error("could not load recorder",i);this._onScriptLoaded()}),Yr.info("starting"),this.status==="active"&&this._reportStarted(t||"recording_initialized")}}get scriptName(){var t,n,r;return((t=this.instance)===null||t===void 0||(n=t.persistence)===null||n===void 0||(r=n.get_property(YE))===null||r===void 0?void 0:r.script)||"recorder"}isInteractiveEvent(t){var n;return t.type===3&&TB.indexOf((n=t.data)===null||n===void 0?void 0:n.source)!==-1}_updateWindowAndSessionIds(t){var n=this.isInteractiveEvent(t);n||this.isIdle||t.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var r=!1;if(n&&(this._lastActivityTimestamp=t.timestamp,this.isIdle)){var i=this.isIdle==="unknown";this.isIdle=!1,i||(this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.isIdle){var{windowId:o,sessionId:a}=this.sessionManager.checkAndGetSessionAndWindowId(!n,t.timestamp),u=this.sessionId!==a,c=this.windowId!==o;this.windowId=o,this.sessionId=a,u||c?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):r&&this._scheduleFullSnapshot()}}_tryRRWebMethod(t){try{return t.rrwebMethod(),!0}catch(n){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt++,rrwebMethod:t.rrwebMethod}):Yr.warn("could not emit queued rrweb event.",n,t),!1}}_tryAddCustomEvent(t,n){return this._tryRRWebMethod(Lk(()=>Uh().addCustomEvent(t,n)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(Lk(()=>Uh().takeFullSnapshot()))}_onScriptLoaded(){var t,n,r,i,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},a=this.instance.config.session_recording;for(var[u,c]of Object.entries(a||{}))u in o&&(u==="maskInputOptions"?o.maskInputOptions=Ee({password:!0},c):o[u]=c);this.canvasRecording&&this.canvasRecording.enabled&&(o.recordCanvas=!0,o.sampling={canvas:this.canvasRecording.fps},o.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.masking&&(o.maskAllInputs=(n=this.masking.maskAllInputs)===null||n===void 0||n,o.maskTextSelector=(r=this.masking.maskTextSelector)!==null&&r!==void 0?r:void 0,o.blockSelector=(i=this.masking.blockSelector)!==null&&i!==void 0?i:void 0);var d=Uh();if(d){this.mutationRateLimiter=(t=this.mutationRateLimiter)!==null&&t!==void 0?t:new vB(d,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(h,m)=>{var v="Too many mutations on node '".concat(h,"'. Rate limiting. This could be due to SVG animations or something similar");Yr.info(v,{node:m}),this.log(Vc+" "+v,"warn")}});var p=this._gatherRRWebPlugins();this.stopRrweb=d(Ee({emit:h=>{this.onRRwebEmit(h)},plugins:p},o)),this._lastActivityTimestamp=Date.now(),this.isIdle=Da(this.isIdle)?this.isIdle:"unknown",this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:o,activePlugins:p.map(h=>h==null?void 0:h.name)}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else Yr.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this.isIdle!==!0){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},t))}}_gatherRRWebPlugins(){var t,n,r,i,o=[],a=(t=At.__PosthogExtensions__)===null||t===void 0||(n=t.rrwebPlugins)===null||n===void 0?void 0:n.getRecordConsolePlugin;a&&this.isConsoleLogCaptureEnabled&&o.push(a());var u=(r=At.__PosthogExtensions__)===null||r===void 0||(i=r.rrwebPlugins)===null||i===void 0?void 0:i.getRecordNetworkPlugin;return this.networkPayloadCapture&&ho(u)&&(!B9.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?o.push(u(mB(this.instance.config,this.networkPayloadCapture))):Yr.info("NetworkCapture not started because we are on localhost.")),o}onRRwebEmit(t){var n;if(this._processQueuedEvents(),t&&Hn(t)){if(t.type===Qo.Meta){var r=this._maskUrl(t.data.href);if(this._lastHref=r,!r)return;t.data.href=r}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),!this._urlBlocked||function(h){return h.type===Qo.Custom&&h.data.tag==="recording paused"}(t)){t.type===Qo.FullSnapshot&&this._scheduleFullSnapshot(),t.type===Qo.FullSnapshot&&this.triggerStatus==="trigger_pending"&&this.clearBuffer();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(t):t;if(i){var o=function(h){var m=h;if(m&&Hn(m)&&m.type===6&&Hn(m.data)&&m.data.plugin==="rrweb/console@1"){m.data.payload.payload.length>10&&(m.data.payload.payload=m.data.payload.payload.slice(0,10),m.data.payload.payload.push("...[truncated]"));for(var v=[],_=0;_<m.data.payload.payload.length;_++)m.data.payload.payload[_]&&m.data.payload.payload[_].length>2e3?v.push(m.data.payload.payload[_].slice(0,2e3)+"...[truncated]"):v.push(m.data.payload.payload[_]);return m.data.payload.payload=v,h}return h}(i);if(this._updateWindowAndSessionIds(o),this.isIdle!==!0||Nk(o)){if(Nk(o)){var a=o.data.payload;if(a){var u=a.lastActivityTimestamp,c=a.threshold;o.timestamp=u+c}}var d=(n=this.instance.config.session_recording.compress_events)===null||n===void 0||n?function(h){if(Ph(h)<1024)return h;try{if(h.type===Qo.FullSnapshot)return Ee(Ee({},h),{},{data:js(h.data),cv:"2024-10"});if(h.type===Qo.IncrementalSnapshot&&h.data.source===po.Mutation)return Ee(Ee({},h),{},{cv:"2024-10",data:Ee(Ee({},h.data),{},{texts:js(h.data.texts),attributes:js(h.data.attributes),removes:js(h.data.removes),adds:js(h.data.adds)})});if(h.type===Qo.IncrementalSnapshot&&h.data.source===po.StyleSheetRule)return Ee(Ee({},h),{},{cv:"2024-10",data:Ee(Ee({},h.data),{},{adds:h.data.adds?js(h.data.adds):void 0,removes:h.data.removes?js(h.data.removes):void 0})})}catch(m){Yr.error("could not compress event - will use uncompressed event",m)}return h}(o):o,p={$snapshot_bytes:Ph(d),$snapshot_data:d,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(p):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&be){var t=this._maskUrl(be.location.href);this._lastHref!==t&&(this._tryAddCustomEvent("$url_changed",{href:t}),this._lastHref=t)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var t=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],t.forEach(n=>{Date.now()-n.enqueuedAt<=2e3&&this._tryRRWebMethod(n)})}}_maskUrl(t){var n=this.instance.config.session_recording;if(n.maskNetworkRequestFn){var r,i={url:t};return(r=i=n.maskNetworkRequestFn(i))===null||r===void 0?void 0:r.url}return t}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,n=this.sessionDuration,r=li(n)&&n>=0,i=li(t)&&r&&n<t;return this.status==="buffering"||this.status==="paused"||this.status==="disabled"||i?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&d_(this.buffer).forEach(o=>{this._captureSnapshot({$snapshot_bytes:o.size,$snapshot_data:o.data,$session_id:o.sessionId,$window_id:o.windowId,$lib:"web",$lib_version:Yo.LIB_VERSION})}),this.clearBuffer())}_captureSnapshotBuffered(t){var n,r=2+(((n=this.buffer)===null||n===void 0?void 0:n.data.length)||0);!this.isIdle&&(this.buffer.size+t.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=t.$snapshot_bytes,this.buffer.data.push(t.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(t){this.instance.capture("$snapshot",t,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(be!==void 0&&be.location.href){var t=be.location.href,n=this._urlBlocked,r=Bk(t,this._urlBlocklist);r&&!n?this._pauseRecording():!r&&n&&this._resumeRecording(),Bk(t,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(t){var n,r;this.triggerStatus==="trigger_pending"&&((n=this.instance)===null||n===void 0||(r=n.persistence)===null||r===void 0||r.register({[t==="url"?Hy:Gy]:this.sessionId}),this._flushBuffer(),this._reportStarted(t+"_trigger_matched"))}_pauseRecording(){this._urlBlocked||(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Yr.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){this._urlBlocked&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Yr.info("recording resumed"))}_addEventTriggerListener(){this._eventTriggers.length!==0&&pn(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",t=>{try{this._eventTriggers.includes(t.event)&&this._activateTrigger("event")}catch(n){Yr.error("Could not activate event trigger",n)}}))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var t;(t=this.instance.persistence)===null||t===void 0||t.register({[zc]:!0}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(t){this._activateTrigger(t)}_reportStarted(t,n){this.instance.register_for_session({$session_recording_start_reason:t}),Yr.info(t.replace("_"," "),n),zt(["recording_initialized","session_id_changed"],t)||this._tryAddCustomEvent(t,n)}}var w_=Zr("[SegmentIntegration]");function OB(e,t){var n=e.config.segment;if(!n)return t();(function(r,i){var o=r.config.segment;if(!o)return i();var a=c=>{var d=()=>c.anonymousId()||Ba();r.config.get_device_id=d,c.id()&&(r.register({distinct_id:c.id(),$device_id:d()}),r.persistence.set_property(Wo,"identified")),i()},u=o.user();"then"in u&&ho(u.then)?u.then(c=>a(c)):a(u)})(e,()=>{n.register((r=>{Promise&&Promise.resolve||w_.warn("This browser does not have Promise support, and can not use the segment integration");var i=(o,a)=>{var u;if(!a)return o;o.event.userId||o.event.anonymousId===r.get_distinct_id()||(w_.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(w_.info("UserId set, identifying with PostHog"),r.identify(o.event.userId));var c=r._calculate_event_properties(a,(u=o.event.properties)!==null&&u!==void 0?u:{},new Date);return o.event.properties=Object.assign({},c,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>i(o,o.event.event),page:o=>i(o,"$pageview"),identify:o=>i(o,"$identify"),screen:o=>i(o,"$screen")}})(e)).then(()=>{t()})})}var Pk="posthog-js";function Fk(e){var{organization:t,projectId:n,prefix:r,severityAllowList:i=["error"]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=>{var a,u,c,d,p;if(!(i==="*"||i.includes(o.level))||!e.__loaded)return o;o.tags||(o.tags={});var h=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));o.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var m=((a=o.exception)===null||a===void 0?void 0:a.values)||[],v=m.map(S=>Ee(Ee({},S),{},{stacktrace:S.stacktrace?Ee(Ee({},S.stacktrace),{},{type:"raw",frames:(S.stacktrace.frames||[]).map(x=>Ee(Ee({},x),{},{platform:"web:javascript"}))}):void 0})),_={$exception_message:((u=m[0])===null||u===void 0?void 0:u.value)||o.message,$exception_type:(c=m[0])===null||c===void 0?void 0:c.type,$exception_personURL:h,$exception_level:o.level,$exception_list:v,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((d=m[0])===null||d===void 0?void 0:d.value)||o.message,$sentry_exception_type:(p=m[0])===null||p===void 0?void 0:p.type,$sentry_tags:o.tags};return t&&n&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+o.event_id),e.exceptions.sendExceptionEvent(_),o}}class RB{constructor(t,n,r,i,o){this.name=Pk,this.setupOnce=function(a){a(Fk(t,{organization:n,projectId:r,prefix:i,severityAllowList:o}))}}}var Jo,$B=be!=null&&be.location?Oh(be.location.hash,"__posthog")||Oh(location.hash,"state"):null,zk="_postHogToolbarParams",Uk=Zr("[Toolbar]");(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"})(Jo||(Jo={}));class DB{constructor(t){this.instance=t}setToolbarState(t){At.ph_toolbar_state=t}getToolbarState(){var t;return(t=At.ph_toolbar_state)!==null&&t!==void 0?t:Jo.UNINITIALIZED}maybeLoadToolbar(){var t,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!be||!st)return!1;r=(t=r)!==null&&t!==void 0?t:be.location,o=(n=o)!==null&&n!==void 0?n:be.history;try{if(!i){try{be.localStorage.setItem("test","test"),be.localStorage.removeItem("test")}catch{return!1}i=be==null?void 0:be.localStorage}var a,u=$B||Oh(r.hash,"__posthog")||Oh(r.hash,"state"),c=u?DE(()=>JSON.parse(atob(decodeURIComponent(u))))||DE(()=>JSON.parse(decodeURIComponent(u))):null;return c&&c.action==="ph_authorize"?((a=c).source="url",a&&Object.keys(a).length>0&&(c.desiredHash?r.hash=c.desiredHash:o?o.replaceState(o.state,"",r.pathname+r.search):r.hash="")):((a=JSON.parse(i.getItem(zk)||"{}")).source="localstorage",delete a.userIntent),!(!a.token||this.instance.config.token!==a.token)&&(this.loadToolbar(a),!0)}catch{return!1}}_callLoadToolbar(t){var n=At.ph_load_toolbar||At.ph_load_editor;!pn(n)&&ho(n)?n(t,this.instance):Uk.warn("No toolbar load function found")}loadToolbar(t){var n=!(st==null||!st.getElementById(WE));if(!be||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=Ee(Ee({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(be.localStorage.setItem(zk,JSON.stringify(Ee(Ee({},i),{},{source:void 0}))),this.getToolbarState()===Jo.LOADED)this._callLoadToolbar(i);else if(this.getToolbarState()===Jo.UNINITIALIZED){var o,a;this.setToolbarState(Jo.LOADING),(o=At.__PosthogExtensions__)===null||o===void 0||(a=o.loadExternalDependency)===null||a===void 0||a.call(o,this.instance,"toolbar",u=>{if(u)return Uk.error("[Toolbar] Failed to load",u),void this.setToolbarState(Jo.UNINITIALIZED);this.setToolbarState(Jo.LOADED),this._callLoadToolbar(i)}),tr(be,"turbolinks:load",()=>{this.setToolbarState(Jo.UNINITIALIZED),this.loadToolbar(i)})}return!0}_loadEditor(t){return this.loadToolbar(t)}maybeLoadEditor(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(t,n,r)}}var LB=Zr("[TracingHeaders]");class NB{constructor(t){Ve(this,"_restoreXHRPatch",void 0),Ve(this,"_restoreFetchPatch",void 0),Ve(this,"_startCapturing",()=>{var n,r,i,o;rt(this._restoreXHRPatch)&&((n=At.__PosthogExtensions__)===null||n===void 0||(r=n.tracingHeadersPatchFns)===null||r===void 0||r._patchXHR(this.instance.sessionManager)),rt(this._restoreFetchPatch)&&((i=At.__PosthogExtensions__)===null||i===void 0||(o=i.tracingHeadersPatchFns)===null||o===void 0||o._patchFetch(this.instance.sessionManager))}),this.instance=t}_loadScript(t){var n,r,i;(n=At.__PosthogExtensions__)!==null&&n!==void 0&&n.tracingHeadersPatchFns&&t(),(r=At.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"tracing-headers",o=>{if(o)return LB.error("failed to load script",o);t()})}startIfEnabledOrStop(){var t,n;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((t=this._restoreXHRPatch)===null||t===void 0||t.call(this),(n=this._restoreFetchPatch)===null||n===void 0||n.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var Fa=Zr("[Web Vitals]"),jk=9e5;let BB=class{constructor(t){var n;Ve(this,"_enabledServerSide",!1),Ve(this,"_initialized",!1),Ve(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),Ve(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((r,i)=>Ee(Ee({},r),{},{["$web_vitals_".concat(i.name,"_event")]:Ee({},i),["$web_vitals_".concat(i.name,"_value")]:i.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),Ve(this,"_addToBuffer",r=>{var i,o=(i=this.instance.sessionManager)===null||i===void 0?void 0:i.checkAndGetSessionAndWindowId(!0);if(rt(o))Fa.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this._currentURL();rt(a)||(pn(r==null?void 0:r.name)||pn(r==null?void 0:r.value)?Fa.error("Invalid metric received",r):this._maxAllowedValue&&r.value>=this._maxAllowedValue?Fa.error("Ignoring metric with value >= "+this._maxAllowedValue,r):(this.buffer.url!==a&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),rt(this.buffer.url)&&(this.buffer.url=a),this.buffer.firstMetricTimestamp=rt(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(Ee(Ee({},r),{},{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),Ve(this,"_startCapturing",()=>{var r,i,o,a,u=At.__PosthogExtensions__;rt(u)||rt(u.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:i,onFCP:o,onINP:a}=u.postHogWebVitalsCallbacks),r&&i&&o&&a?(this.allowedMetrics.indexOf("LCP")>-1&&r(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this._addToBuffer.bind(this)),this._initialized=!0):Fa.error("web vitals callbacks not loaded - not starting")}),this.instance=t,this._enabledServerSide=!((n=this.instance.persistence)===null||n===void 0||!n.props[FE]),this.startIfEnabled()}get allowedMetrics(){var t,n,r=Hn(this.instance.config.capture_performance)?(t=this.instance.config.capture_performance)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return rt(r)?((n=this.instance.persistence)===null||n===void 0?void 0:n.props[UE])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Hn(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var t=Hn(this.instance.config.capture_performance)&&li(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:jk;return 0<t&&t<=6e4?jk:t}get isEnabled(){var t=_i==null?void 0:_i.protocol;if(t!=="http:"&&t!=="https:")return Fa.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=Hn(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Da(n)?n:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(Fa.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(t){var n=Hn(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Hn(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[FE]:n}),this.instance.persistence.register({[UE]:r})),this._enabledServerSide=n,this.startIfEnabled()}loadScript(t){var n,r,i;(n=At.__PosthogExtensions__)!==null&&n!==void 0&&n.postHogWebVitalsCallbacks&&t(),(r=At.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"web-vitals",o=>{o?Fa.error("failed to load script",o):t()})}_currentURL(){var t=be?be.location.href:void 0;return t||Fa.error("Could not determine current URL"),t}};var PB=Zr("[Heatmaps]");function qk(e){return Hn(e)&&"clientX"in e&&"clientY"in e&&li(e.clientX)&&li(e.clientY)}class FB{constructor(t){var n;Ve(this,"rageclicks",new ck),Ve(this,"_enabledServerSide",!1),Ve(this,"_initialized",!1),Ve(this,"_flushInterval",null),this.instance=t,this._enabledServerSide=!((n=this.instance.persistence)===null||n===void 0||!n.props[jy])}get flushIntervalMilliseconds(){var t=5e3;return Hn(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return rt(this.instance.config.capture_heatmaps)?rt(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;PB.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var t,n;clearInterval((t=this._flushInterval)!==null&&t!==void 0?t:void 0),(n=this.deadClicksCapture)===null||n===void 0||n.stop(),this.getAndClearBuffer()}}onRemoteConfig(t){var n=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[jy]:n}),this._enabledServerSide=n,this.startIfEnabled()}getAndClearBuffer(){var t=this.buffer;return this.buffer=void 0,t}_onDeadClick(t){this._onClick(t.originalEvent,"deadclick")}_setupListeners(){be&&st&&(tr(be,"beforeunload",this.flush.bind(this)),tr(st,"click",t=>this._onClick(t||(be==null?void 0:be.event)),{capture:!0}),tr(st,"mousemove",t=>this._onMouseMove(t||(be==null?void 0:be.event)),{capture:!0}),this.deadClicksCapture=new gk(this.instance,X9,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(t,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),a=function(u,c,d){for(var p=u;p&&Ah(p)&&!Na(p,"body");){if(p===d)return!1;if(zt(c,be==null?void 0:be.getComputedStyle(p).position))return!0;p=rk(p)}return!1}(nk(t),["fixed","sticky"],o);return{x:t.clientX+(a?0:i),y:t.clientY+(a?0:r),target_fixed:a,type:n}}_onClick(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"click";if(!QE(t.target)&&qk(t)){var i=this._getProperties(t,r);(n=this.rageclicks)!==null&&n!==void 0&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this._capture(Ee(Ee({},i),{},{type:"rageclick"})),this._capture(i)}}_onMouseMove(t){!QE(t.target)&&qk(t)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(t,"mousemove"))},500))}_capture(t){if(be){var n=be.location.href;this.buffer=this.buffer||{},this.buffer[n]||(this.buffer[n]=[]),this.buffer[n].push(t)}}flush(){this.buffer&&!Dl(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class zB{constructor(t){this._instance=t}doPageView(t,n){var r,i=this._previousPageViewProperties(t,n);return this._currentPageview={pathname:(r=be==null?void 0:be.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var n;return this._previousPageViewProperties(t,(n=this._currentPageview)===null||n===void 0?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this._currentPageview)===null||t===void 0?void 0:t.pageViewId}}_previousPageViewProperties(t,n){var r=this._currentPageview;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:u,maxScrollY:c,maxContentHeight:d,lastContentY:p,maxContentY:h}=o;if(!(rt(a)||rt(u)||rt(c)||rt(d)||rt(p)||rt(h))){a=Math.ceil(a),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d),p=Math.ceil(p),h=Math.ceil(h);var m=a<=1?1:Hi(u/a,0,1),v=a<=1?1:Hi(c/a,0,1),_=d<=1?1:Hi(p/d,0,1),S=d<=1?1:Hi(h/d,0,1);i=ur(i,{$prev_pageview_last_scroll:u,$prev_pageview_last_scroll_percentage:m,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:p,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:S})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}class UB{constructor(t){this.instance=t}sendExceptionEvent(t){this.instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var Vi="Mobile",jh="iOS",Eo="Android",Zc="Tablet",Hk=Eo+" "+Zc,Gk="iPad",Vk="Apple",Zk=Vk+" Watch",Yc="Safari",zl="BlackBerry",Yk="Samsung",Wk=Yk+"Browser",Kk=Yk+" Internet",qs="Chrome",jB=qs+" OS",Qk=qs+" "+jh,S_="Internet Explorer",Xk=S_+" "+Vi,C_="Opera",qB=C_+" Mini",E_="Edge",Jk="Microsoft "+E_,Ul="Firefox",eA=Ul+" "+jh,Wc="Nintendo",Kc="PlayStation",jl="Xbox",tA=Eo+" "+Vi,nA=Vi+" "+Yc,Qc="Windows",k_=Qc+" Phone",rA="Nokia",A_="Ouya",iA="Generic",HB=iA+" "+Vi.toLowerCase(),oA=iA+" "+Zc.toLowerCase(),I_="Konqueror",ui="(\\d+(\\.\\d+)?)",T_=new RegExp("Version/"+ui),GB=new RegExp(jl,"i"),VB=new RegExp(Kc+" \\w+","i"),ZB=new RegExp(Wc+" \\w+","i"),M_=new RegExp(zl+"|PlayBook|BB10","i"),YB={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},O_,WB=(e,t)=>t&&zt(t,Vk)||function(n){return zt(n,Yc)&&!zt(n,qs)&&!zt(n,Eo)}(e),aA=function(e,t){return t=t||"",zt(e," OPR/")&&zt(e,"Mini")?qB:zt(e," OPR/")?C_:M_.test(e)?zl:zt(e,"IE"+Vi)||zt(e,"WPDesktop")?Xk:zt(e,Wk)?Kk:zt(e,E_)||zt(e,"Edg/")?Jk:zt(e,"FBIOS")?"Facebook "+Vi:zt(e,"UCWEB")||zt(e,"UCBrowser")?"UC Browser":zt(e,"CriOS")?Qk:zt(e,"CrMo")||zt(e,qs)?qs:zt(e,Eo)&&zt(e,Yc)?tA:zt(e,"FxiOS")?eA:zt(e.toLowerCase(),I_.toLowerCase())?I_:WB(e,t)?zt(e,Vi)?nA:Yc:zt(e,Ul)?Ul:zt(e,"MSIE")||zt(e,"Trident/")?S_:zt(e,"Gecko")?Ul:""},KB={[Xk]:[new RegExp("rv:"+ui)],[Jk]:[new RegExp(E_+"?\\/"+ui)],[qs]:[new RegExp("("+qs+"|CrMo)\\/"+ui)],[Qk]:[new RegExp("CriOS\\/"+ui)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ui)],[Yc]:[T_],[nA]:[T_],[C_]:[new RegExp("(Opera|OPR)\\/"+ui)],[Ul]:[new RegExp(Ul+"\\/"+ui)],[eA]:[new RegExp("FxiOS\\/"+ui)],[I_]:[new RegExp("Konqueror[:/]?"+ui,"i")],[zl]:[new RegExp(zl+" "+ui),T_],[tA]:[new RegExp("android\\s"+ui,"i")],[Kk]:[new RegExp(Wk+"\\/"+ui)],[S_]:[new RegExp("(rv:|MSIE )"+ui)],Mozilla:[new RegExp("rv:"+ui)]},sA=[[new RegExp(jl+"; "+jl+" (.*?)[);]","i"),e=>[jl,e&&e[1]||""]],[new RegExp(Wc,"i"),[Wc,""]],[new RegExp(Kc,"i"),[Kc,""]],[M_,[zl,""]],[new RegExp(Qc,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[k_,""];if(new RegExp(Vi).test(t)&&!/IEMobile\b/.test(t))return[Qc+" "+Vi,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=YB[r]||"";return/arm/i.test(t)&&(i="RT"),[Qc,i]}return[Qc,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[jh,t.join(".")]}return[jh,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=rt(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Eo+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Eo+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Eo,t.join(".")]}return[Eo,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[jB,""]],[/Linux|debian/i,["Linux",""]]],lA=function(e){return ZB.test(e)?Wc:VB.test(e)?Kc:GB.test(e)?jl:new RegExp(A_,"i").test(e)?A_:new RegExp("("+k_+"|WPDesktop)","i").test(e)?k_:/iPad/.test(e)?Gk:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Zk:M_.test(e)?zl:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(rA,"i").test(e)?rA:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Vi).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Eo:Hk:Eo:new RegExp("(pda|"+Vi+")","i").test(e)?HB:new RegExp(Zc,"i").test(e)&&!new RegExp(Zc+" pc","i").test(e)?oA:""},qh="https?://(.*)",Hh=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],QB=bh(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Hh),R_="<masked>",Dn={campaignParams:function(){var{customTrackedParams:e,maskPersonalDataProperties:t,customPersonalDataProperties:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!st)return{};var r=t?bh([],Hh,n||[]):[];return this._campaignParamsFromUrl(n_(st.URL,r,R_),e)},_campaignParamsFromUrl:function(e,t){var n=QB.concat(t||[]),r={};return wn(n,function(i){var o=Mh(e,i);r[i]=o||null}),r},_searchEngine:function(e){return e?e.search(qh+"google.([^/?]*)")===0?"google":e.search(qh+"bing.com")===0?"bing":e.search(qh+"yahoo.com")===0?"yahoo":e.search(qh+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=Dn._searchEngine(e),n=t!="yahoo"?"q":"p",r={};if(!$a(t)){r.$search_engine=t;var i=st?Mh(st.referrer,n):"";i.length&&(r.ph_keyword=i)}return r},searchInfo:function(){var e=st==null?void 0:st.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:aA,browserVersion:function(e,t){var n=aA(e,t),r=KB[n];if(rt(r))return null;for(var i=0;i<r.length;i++){var o=r[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var e=this.browserLanguage();return typeof e=="string"?e.split("-")[0]:void 0},os:function(e){for(var t=0;t<sA.length;t++){var[n,r]=sA[t],i=n.exec(e),o=i&&(ho(r)?r(i,e):r);if(o)return o}return["",""]},device:lA,deviceType:function(e){var t=lA(e);return t===Gk||t===Hk||t==="Kobo"||t==="Kindle Fire"||t===oA?Zc:t===Wc||t===jl||t===Kc||t===A_?"Console":t===Zk?"Wearable":t?Vi:"Desktop"},referrer:function(){return(st==null?void 0:st.referrer)||"$direct"},referringDomain:function(){var e;return st!=null&&st.referrer&&((e=Bl(st.referrer))===null||e===void 0?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},personInfo:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e?bh([],Hh,t||[]):[],r=_i==null?void 0:_i.href.substring(0,1e3);return{r:this.referrer().substring(0,1e3),u:r?n_(r,n,R_):void 0}},personPropsFromInfo:function(e){var t,{r:n,u:r}=e,i={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=Bl(n))===null||t===void 0?void 0:t.host};if(r){i.$current_url=r;var o=Bl(r);i.$host=o==null?void 0:o.host,i.$pathname=o==null?void 0:o.pathname;var a=this._campaignParamsFromUrl(r);ur(i,a)}if(n){var u=this._searchInfoFromReferrer(n);ur(i,u)}return i},initialPersonPropsFromInfo:function(e){var t=this.personPropsFromInfo(e),n={};return wn(t,function(r,i){n["$initial_".concat(zy(i))]=r}),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},timezoneOffset:function(){try{return new Date().getTimezoneOffset()}catch{return}},properties:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!sr)return{};var n=e?bh([],Hh,t||[]):[],[r,i]=Dn.os(sr);return ur(Bc({$os:r,$os_version:i,$browser:Dn.browser(sr,navigator.vendor),$device:Dn.device(sr),$device_type:Dn.deviceType(sr),$timezone:Dn.timezone(),$timezone_offset:Dn.timezoneOffset()}),{$current_url:n_(_i==null?void 0:_i.href,n,R_),$host:_i==null?void 0:_i.host,$pathname:_i==null?void 0:_i.pathname,$raw_user_agent:sr.length>1e3?sr.substring(0,997)+"...":sr,$browser_version:Dn.browserVersion(sr,navigator.vendor),$browser_language:Dn.browserLanguage(),$browser_language_prefix:Dn.browserLanguagePrefix(),$screen_height:be==null?void 0:be.screen.height,$screen_width:be==null?void 0:be.screen.width,$viewport_height:be==null?void 0:be.innerHeight,$viewport_width:be==null?void 0:be.innerWidth,$lib:"web",$lib_version:Yo.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!sr)return{};var[e,t]=Dn.os(sr);return ur(Bc({$os:e,$os_version:t,$browser:Dn.browser(sr,navigator.vendor)}),{$browser_version:Dn.browserVersion(sr,navigator.vendor)})}},ko=Zr("[FeatureFlags]"),$_="$active_feature_flags",ql="$override_feature_flags",uA="$feature_flag_payloads",Xc="$override_feature_flag_payloads",cA="$feature_flag_request_id",fA=e=>{var t={};for(var[n,r]of xh(e||{}))r&&(t[n]=r);return t},XB=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(n=>{var r;return[n,(r=t[n].variant)!==null&&r!==void 0?r:t[n].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(n=>t[n].enabled).filter(n=>{var r;return(r=t[n].metadata)===null||r===void 0?void 0:r.payload}).map(n=>{var r;return[n,(r=t[n].metadata)===null||r===void 0?void 0:r.payload]}))):ko.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e};(function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"})(O_||(O_={}));class JB{constructor(t){Ve(this,"_override_warning",!1),Ve(this,"_hasLoadedFlags",!1),Ve(this,"_requestInFlight",!1),Ve(this,"_reloadingDisabled",!1),Ve(this,"_additionalReloadRequested",!1),Ve(this,"_decideCalled",!1),Ve(this,"_flagsLoadedFromRemote",!1),this.instance=t,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var t=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:t})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.instance.get_property(Vy),n=this.instance.get_property(ql),r=this.instance.get_property(Xc);if(!r&&!n)return t||{};var i=ur({},t||{}),o=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var a of o){var u,c,d=i[a],p=n==null?void 0:n[a],h=rt(p)?(u=d==null?void 0:d.enabled)!==null&&u!==void 0&&u:!!p,m=rt(p)?d.variant:typeof p=="string"?p:void 0,v=r==null?void 0:r[a],_=Ee(Ee({},d),{},{enabled:h,variant:h?m??(d==null?void 0:d.variant):void 0});h!==(d==null?void 0:d.enabled)&&(_.original_enabled=d==null?void 0:d.enabled),m!==(d==null?void 0:d.variant)&&(_.original_variant=d==null?void 0:d.variant),v&&(_.metadata=Ee(Ee({},d==null?void 0:d.metadata),{},{payload:v,original_payload:d==null||(c=d.metadata)===null||c===void 0?void 0:c.payload})),i[a]=_}return this._override_warning||(ko.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:i}),this._override_warning=!0),i}getFlagVariants(){var t=this.instance.get_property(Ll),n=this.instance.get_property(ql);if(!n)return t||{};for(var r=ur({},t),i=Object.keys(n),o=0;o<i.length;o++)r[i[o]]=n[i[o]];return this._override_warning||(ko.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:n,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var t=this.instance.get_property(uA),n=this.instance.get_property(Xc);if(!n)return t||{};for(var r=ur({},t||{}),i=Object.keys(n),o=0;o<i.length;o++)r[i[o]]=n[i[o]];return this._override_warning||(ko.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:n,finalPayloads:r}),this._override_warning=!0),r}reloadFeatureFlags(){this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout(()=>{this._callDecideEndpoint()},5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this._reloadingDisabled=t}_callDecideEndpoint(t){var n;if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var r={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Ee(Ee({},((n=this.instance.persistence)===null||n===void 0?void 0:n.get_initial_props())||{}),this.instance.get_property(Uc)||{}),group_properties:this.instance.get_property(Ps)};(t!=null&&t.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0);var i=this.instance.config.__preview_flags_v2&&this.instance.config.__preview_remote_config;i&&(r.timezone=Dn.timezone()),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api",i?"/flags/?v=2":"/decide/?v=4"),data:r,compression:this.instance.config.disable_compression?void 0:fo.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:o=>{var a,u,c,d=!0;o.statusCode===200&&(this._additionalReloadRequested||(this.$anon_distinct_id=void 0),d=!1),this._requestInFlight=!1,this._decideCalled||(this._decideCalled=!0,this.instance._onRemoteConfig((c=o.json)!==null&&c!==void 0?c:{})),r.disable_flags&&!this._additionalReloadRequested||(this._flagsLoadedFromRemote=!d,o.json&&(a=o.json.quotaLimited)!==null&&a!==void 0&&a.includes(O_.FeatureFlags)?ko.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(this.receivedFeatureFlags((u=o.json)!==null&&u!==void 0?u:{},d),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint())))}})}}getFeatureFlag(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],i="".concat(r),o=this.instance.get_property(cA)||void 0,a=this.instance.get_property(Eh)||{};if((n.send_event||!("send_event"in n))&&(!(t in a)||!a[t].includes(i))){var u,c,d,p,h,m,v,_,S,x,b;qn(a[t])?a[t].push(i):a[t]=[i],(u=this.instance.persistence)===null||u===void 0||u.register({[Eh]:a});var C=this.getFeatureFlagDetails(t),k={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:o,$feature_flag_bootstrapped_response:((c=this.instance.config.bootstrap)===null||c===void 0||(d=c.featureFlags)===null||d===void 0?void 0:d[t])||null,$feature_flag_bootstrapped_payload:((p=this.instance.config.bootstrap)===null||p===void 0||(h=p.featureFlagPayloads)===null||h===void 0?void 0:h[t])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};rt(C==null||(m=C.metadata)===null||m===void 0?void 0:m.version)||(k.$feature_flag_version=C.metadata.version);var A,I=(v=C==null||(_=C.reason)===null||_===void 0?void 0:_.description)!==null&&v!==void 0?v:C==null||(S=C.reason)===null||S===void 0?void 0:S.code;I&&(k.$feature_flag_reason=I),C!=null&&(x=C.metadata)!==null&&x!==void 0&&x.id&&(k.$feature_flag_id=C.metadata.id),rt(C==null?void 0:C.original_variant)&&rt(C==null?void 0:C.original_enabled)||(k.$feature_flag_original_response=rt(C.original_variant)?C.original_enabled:C.original_variant),C!=null&&(b=C.metadata)!==null&&b!==void 0&&b.original_payload&&(k.$feature_flag_original_payload=C==null||(A=C.metadata)===null||A===void 0?void 0:A.original_payload),this.instance.capture("$feature_flag_called",k)}return r}ko.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,n){var r=this.instance.config.token;this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=4"),data:{distinct_id:this.instance.get_distinct_id(),token:r},compression:this.instance.config.disable_compression?void 0:fo.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:i=>{var o,a=(o=i.json)===null||o===void 0?void 0:o.featureFlagPayloads;n((a==null?void 0:a[t])||void 0)}})}isFeatureEnabled(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(t,n);ko.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(n=>n!==t)}receivedFeatureFlags(t,n){if(this.instance.persistence){this._hasLoadedFlags=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(a,u){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{},h=XB(a),m=h.flags,v=h.featureFlags,_=h.featureFlagPayloads;if(v){var S=a.requestId;if(qn(v)){ko.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var x={};if(v)for(var b=0;b<v.length;b++)x[v[b]]=!0;u&&u.register({[$_]:v,[Ll]:x})}else{var C=v,k=_,A=m;a.errorsWhileComputingFlags&&(C=Ee(Ee({},c),C),k=Ee(Ee({},d),k),A=Ee(Ee({},p),A)),u&&u.register(Ee({[$_]:Object.keys(fA(C)),[Ll]:C||{},[uA]:k||{},[Vy]:A||{}},S?{[cA]:S}:{}))}}})(t,this.instance.persistence,r,i,o),this._fireFeatureFlagsCallbacks(n)}}override(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];ko.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:n})}overrideFeatureFlags(t){if(!this.instance.__loaded||!this.instance.persistence)return ko.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.instance.persistence.unregister(ql),this.instance.persistence.unregister(Xc),void this._fireFeatureFlagsCallbacks();if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this._override_warning=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.instance.persistence.unregister(ql);else if(r.flags)if(qn(r.flags)){for(var i={},o=0;o<r.flags.length;o++)i[r.flags[o]]=!0;this.instance.persistence.register({[ql]:i})}else this.instance.persistence.register({[ql]:r.flags})}return"payloads"in r&&(r.payloads===!1?this.instance.persistence.unregister(Xc):r.payloads&&this.instance.persistence.register({[Xc]:r.payloads})),void this._fireFeatureFlagsCallbacks()}this._fireFeatureFlagsCallbacks()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this._hasLoadedFlags){var{flags:n,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();t(n,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,n){var r,i=(this.instance.get_property(Sh)||[]).find(c=>c.flagKey===t),o={["$feature_enrollment/".concat(t)]:n},a={$feature_flag:t,$feature_enrollment:n,$set:o};i&&(a.$early_access_feature_name=i.name),this.instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var u=Ee(Ee({},this.getFlagVariants()),{},{[t]:n});(r=this.instance.persistence)===null||r===void 0||r.register({[$_]:Object.keys(fA(u)),[Ll]:u}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=arguments.length>2?arguments[2]:void 0,i=this.instance.get_property(Sh),o=r?"&".concat(r.map(a=>"stage=".concat(a)).join("&")):"";if(i&&!n)return t(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token).concat(o)),method:"GET",callback:a=>{var u;if(a.json){var c=a.json.earlyAccessFeatures;return(u=this.instance.persistence)===null||u===void 0||u.register({[Sh]:c}),t(c)}}})}_prepareFeatureFlagsForCallbacks(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter(r=>n[r]),flagVariants:Object.keys(n).filter(r=>n[r]).reduce((r,i)=>(r[i]=n[i],r),{})}}_fireFeatureFlagsCallbacks(t){var{flags:n,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(i=>i(n,r,{errorsLoading:t}))}setPersonPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Uc)||{};this.instance.register({[Uc]:Ee(Ee({},r),t)}),n&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(Uc)}setGroupPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Ps)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(i=>{r[i]=Ee(Ee({},r[i]),t[i]),delete t[i]}),this.instance.register({[Ps]:Ee(Ee({},r),t)}),n&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var n=this.instance.get_property(Ps)||{};this.instance.register({[Ps]:Ee(Ee({},n),{},{[t]:{}})})}else this.instance.unregister(Ps)}}var e8=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class D_{constructor(t){this.config=t,this.props={},this.campaign_params_saved=!1,this.name=(n=>{var r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(t),this.storage=this.buildStorage(t),this.load(),t.debug&&pt.info("Persistence loaded",t.persistence,Ee({},this.props)),this.update_config(t,t),this.save()}buildStorage(t){e8.indexOf(t.persistence.toLowerCase())===-1&&(pt.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=t.persistence.toLowerCase();return n==="localstorage"&&_r.is_supported()?_r:n==="localstorage+cookie"&&$h.is_supported()?$h:n==="sessionstorage"&&Rr.is_supported()?Rr:n==="memory"?K9:n==="cookie"?Ko:$h.is_supported()?$h:Ko}properties(){var t={};return wn(this.props,function(n,r){if(r===Ll&&Hn(n))for(var i=Object.keys(n),o=0;o<i.length;o++)t["$feature/".concat(i[o])]=n[i[o]];else u=r,c=!1,($a(a=T9)?c:kE&&a.indexOf===kE?a.indexOf(u)!=-1:(wn(a,function(d){if(c||(c=d===u))return _h}),c))||(t[r]=n);var a,u,c}),t}load(){if(!this.disabled){var t=this.storage.parse(this.name);t&&(this.props=ur({},t))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(Hn(t)){rt(n)&&(n="None"),this.expire_days=rt(r)?this.default_expiry:r;var i=!1;if(wn(t,(o,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.props[a]=o,i=!0)}),i)return this.save(),!0}return!1}register(t,n){if(Hn(t)){this.expire_days=rt(n)?this.default_expiry:n;var r=!1;if(wn(t,(i,o)=>{t.hasOwnProperty(o)&&this.props[o]!==i&&(this.props[o]=i,r=!0)}),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var t=Dn.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});Dl(Bc(t))||this.register(t),this.campaign_params_saved=!0}}update_search_keyword(){this.register(Dn.searchInfo())}update_referrer_info(){this.register_once(Dn.referrerInfo(),void 0)}set_initial_person_info(){this.props[Ky]||this.props[Qy]||this.register_once({[Xy]:Dn.personInfo({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties})},void 0)}get_referrer_info(){return Bc({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var t={};wn([Qy,Ky],i=>{var o=this.props[i];o&&wn(o,function(a,u){t["$initial_"+zy(u)]=a})});var n=this.props[Xy];if(n){var r=Dn.initialPersonPropsFromInfo(n);ur(t,r)}return t}safe_merge(t){return wn(this.props,function(n,r){r in t||(t[r]=n)}),t}update_config(t,n){if(this.default_expiry=this.expire_days=t.cookie_expiration,this.set_disabled(t.disable_persistence),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence){var r=this.buildStorage(t),i=this.props;this.clear(),this.storage=r,this.props=i,this.save()}}set_disabled(t){this.disabled=t,this.disabled?this.remove():this.save()}set_cross_subdomain(t){t!==this.cross_subdomain&&(this.cross_subdomain=t,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(t){t!==this.secure&&(this.secure=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Fc]||{};r[t]=n,this.props[Fc]=r,this.save()}remove_event_timer(t){var n=(this.props[Fc]||{})[t];return rt(n)||(delete this.props[Fc][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var dA,Gn,hA,Hs,pA,gA,L_,mA,vA,yA,_A,bA,xA,N_={},wA=[],t8=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,B_=Array.isArray;function za(e,t){for(var n in t)e[n]=t[n];return e}function SA(e){var t=e.parentNode;t&&t.removeChild(e)}function P_(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++hA,__i:-1,__u:0};return i==null&&Gn.vnode!=null&&Gn.vnode(o),o}function F_(e){return e.children}function Gh(e,t){this.props=e,this.context=t}function Hl(e,t){if(t==null)return e.__?Hl(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Hl(e):null}function CA(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return CA(e)}}function z_(e){(!e.__d&&(e.__d=!0)&&Hs.push(e)&&!Vh.__r++||pA!==Gn.debounceRendering)&&((pA=Gn.debounceRendering)||gA)(Vh)}function Vh(){var e,t,n,r,i,o,a,u,c;for(Hs.sort(L_);e=Hs.shift();)e.__d&&(t=Hs.length,r=void 0,o=(i=(n=e).__v).__e,u=[],c=[],(a=n.__P)&&((r=za({},i)).__v=i.__v+1,Gn.vnode&&Gn.vnode(r),MA(a,r,i,n.__n,a.ownerSVGElement!==void 0,32&i.__u?[o]:null,u,o??Hl(i),!!(32&i.__u),c),r.__.__k[r.__i]=r,i8(u,r,c),r.__e!=o&&CA(r)),Hs.length>t&&Hs.sort(L_));Vh.__r=0}function EA(e,t,n,r,i,o,a,u,c,d,p){var h,m,v,_,S,x=r&&r.__k||wA,b=t.length;for(n.__d=c,n8(n,t,x),c=n.__d,h=0;h<b;h++)(v=n.__k[h])!=null&&typeof v!="boolean"&&typeof v!="function"&&(m=v.__i===-1?N_:x[v.__i]||N_,v.__i=h,MA(e,v,m,i,o,a,u,c,d,p),_=v.__e,v.ref&&m.ref!=v.ref&&(m.ref&&U_(m.ref,null,v),p.push(v.ref,v.__c||_,v)),S==null&&_!=null&&(S=_),65536&v.__u||m.__k===v.__k?c=kA(v,c,e):typeof v.type=="function"&&v.__d!==void 0?c=v.__d:_&&(c=_.nextSibling),v.__d=void 0,v.__u&=-196609);n.__d=c,n.__e=S}function n8(e,t,n){var r,i,o,a,u,c=t.length,d=n.length,p=d,h=0;for(e.__k=[],r=0;r<c;r++)(i=e.__k[r]=(i=t[r])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?P_(null,i,null,null,i):B_(i)?P_(F_,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?P_(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,u=r8(i,n,a=r+h,p),i.__i=u,o=null,u!==-1&&(p--,(o=n[u])&&(o.__u|=131072)),o==null||o.__v===null?(u==-1&&h--,typeof i.type!="function"&&(i.__u|=65536)):u!==a&&(u===a+1?h++:u>a?p>c-a?h+=u-a:h--:h=u<a&&u==a-1?u-a:0,u!==r+h&&(i.__u|=65536))):(o=n[r])&&o.key==null&&o.__e&&(o.__e==e.__d&&(e.__d=Hl(o)),j_(o,o,!1),n[r]=null,p--);if(p)for(r=0;r<d;r++)(o=n[r])!=null&&(131072&o.__u)==0&&(o.__e==e.__d&&(e.__d=Hl(o)),j_(o,o))}function kA(e,t,n){var r,i;if(typeof e.type=="function"){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=kA(r[i],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function r8(e,t,n,r){var i=e.key,o=e.type,a=n-1,u=n+1,c=t[n];if(c===null||c&&i==c.key&&o===c.type)return n;if(r>(c!=null&&(131072&c.__u)==0?1:0))for(;a>=0||u<t.length;){if(a>=0){if((c=t[a])&&(131072&c.__u)==0&&i==c.key&&o===c.type)return a;a--}if(u<t.length){if((c=t[u])&&(131072&c.__u)==0&&i==c.key&&o===c.type)return u;u++}}return-1}function AA(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||t8.test(t)?n:n+"px"}function Zh(e,t,n,r,i){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||AA(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||AA(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?TA:IA,o)):e.removeEventListener(t,o?TA:IA,o);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function IA(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Gn.event?Gn.event(e):e)}function TA(e){return this.l[e.type+!0](Gn.event?Gn.event(e):e)}function MA(e,t,n,r,i,o,a,u,c,d){var p,h,m,v,_,S,x,b,C,k,A,I,$,B,U,G=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),o=[u=t.__e=n.__e]),(p=Gn.__b)&&p(t);e:if(typeof G=="function")try{if(b=t.props,C=(p=G.contextType)&&r[p.__c],k=p?C?C.props.value:p.__:r,n.__c?x=(h=t.__c=n.__c).__=h.__E:("prototype"in G&&G.prototype.render?t.__c=h=new G(b,k):(t.__c=h=new Gh(b,k),h.constructor=G,h.render=a8),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=k,h.__n=r,m=h.__d=!0,h.__h=[],h._sb=[]),h.__s==null&&(h.__s=h.state),G.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=za({},h.__s)),za(h.__s,G.getDerivedStateFromProps(b,h.__s))),v=h.props,_=h.state,h.__v=t,m)G.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(G.getDerivedStateFromProps==null&&b!==v&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(b,k),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(b,h.__s,k)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(P){P&&(P.__=t)}),A=0;A<h._sb.length;A++)h.__h.push(h._sb[A]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(b,h.__s,k),h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(v,_,S)})}if(h.context=k,h.props=b,h.__P=e,h.__e=!1,I=Gn.__r,$=0,"prototype"in G&&G.prototype.render){for(h.state=h.__s,h.__d=!1,I&&I(t),p=h.render(h.props,h.state,h.context),B=0;B<h._sb.length;B++)h.__h.push(h._sb[B]);h._sb=[]}else do h.__d=!1,I&&I(t),p=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++$<25);h.state=h.__s,h.getChildContext!=null&&(r=za(za({},r),h.getChildContext())),m||h.getSnapshotBeforeUpdate==null||(S=h.getSnapshotBeforeUpdate(v,_)),EA(e,B_(U=p!=null&&p.type===F_&&p.key==null?p.props.children:p)?U:[U],t,n,r,i,o,a,u,c,d),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),x&&(h.__E=h.__=null)}catch(P){t.__v=null,c||o!=null?(t.__e=u,t.__u|=c?160:32,o[o.indexOf(u)]=null):(t.__e=n.__e,t.__k=n.__k),Gn.__e(P,t,n)}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=o8(n.__e,t,n,r,i,o,a,c,d);(p=Gn.diffed)&&p(t)}function i8(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)U_(n[r],n[++r],n[++r]);Gn.__c&&Gn.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){Gn.__e(o,i.__v)}})}function o8(e,t,n,r,i,o,a,u,c){var d,p,h,m,v,_,S,x=n.props,b=t.props,C=t.type;if(C==="svg"&&(i=!0),o!=null){for(d=0;d<o.length;d++)if((v=o[d])&&"setAttribute"in v==!!C&&(C?v.localName===C:v.nodeType===3)){e=v,o[d]=null;break}}if(e==null){if(C===null)return document.createTextNode(b);e=i?document.createElementNS("http://www.w3.org/2000/svg",C):document.createElement(C,b.is&&b),o=null,u=!1}if(C===null)x===b||u&&e.data===b||(e.data=b);else{if(o=o&&dA.call(e.childNodes),x=n.props||N_,!u&&o!=null)for(x={},d=0;d<e.attributes.length;d++)x[(v=e.attributes[d]).name]=v.value;for(d in x)v=x[d],d=="children"||(d=="dangerouslySetInnerHTML"?h=v:d==="key"||d in b||Zh(e,d,null,v,i));for(d in b)v=b[d],d=="children"?m=v:d=="dangerouslySetInnerHTML"?p=v:d=="value"?_=v:d=="checked"?S=v:d==="key"||u&&typeof v!="function"||x[d]===v||Zh(e,d,v,x[d],i);if(p)u||h&&(p.__html===h.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(h&&(e.innerHTML=""),EA(e,B_(m)?m:[m],t,n,r,i&&C!=="foreignObject",o,a,o?o[0]:n.__k&&Hl(n,0),u,c),o!=null)for(d=o.length;d--;)o[d]!=null&&SA(o[d]);u||(d="value",_!==void 0&&(_!==e[d]||C==="progress"&&!_||C==="option"&&_!==x[d])&&Zh(e,d,_,x[d],!1),d="checked",S!==void 0&&S!==e[d]&&Zh(e,d,S,x[d],!1))}return e}function U_(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){Gn.__e(r,n)}}function j_(e,t,n){var r,i;if(Gn.unmount&&Gn.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||U_(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){Gn.__e(o,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&j_(r[i],t,n||typeof e.type!="function");n||e.__e==null||SA(e.__e),e.__=e.__e=e.__d=void 0}function a8(e,t,n){return this.constructor(e,n)}dA=wA.slice,Gn={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(u){e=u}throw e}},hA=0,Gh.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=za({},this.state),typeof e=="function"&&(e=e(za({},n),this.props)),e&&za(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),z_(this))},Gh.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),z_(this))},Gh.prototype.render=F_,Hs=[],gA=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,L_=function(e,t){return e.__v.__b-t.__v.__b},Vh.__r=0,mA=0,function(e){e.Button="button",e.Tab="tab",e.Selector="selector"}(vA||(vA={})),function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(yA||(yA={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(_A||(_A={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(bA||(bA={})),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}(xA||(xA={})),function(e,t){var n={__c:t="__cC"+mA++,__:e,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,o;return this.getChildContext||(i=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.some(function(u){u.__e=!0,z_(u)})},this.sub=function(a){i.push(a);var u=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),u&&u.call(a)}}),r.children}};n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{}});var Gl=function(e,t){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};class OA{constructor(){Ve(this,"events",{}),this.events={}}on(t,n){return this.events[t]||(this.events[t]=[]),this.events[t].push(n),()=>{this.events[t]=this.events[t].filter(r=>r!==n)}}emit(t,n){for(var r of this.events[t]||[])r(n);for(var i of this.events["*"]||[])i(t,n)}}class Gs{constructor(t){Ve(this,"_debugEventEmitter",new OA),Ve(this,"checkStep",(n,r)=>this.checkStepEvent(n,r)&&this.checkStepUrl(n,r)&&this.checkStepElement(n,r)),Ve(this,"checkStepEvent",(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event)),this.instance=t,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var t;if(!rt((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)){var n;(n=this.instance)===null||n===void 0||n._addCaptureHook((r,i)=>{this.on(r,i)})}}register(t){var n,r;if(!rt((n=this.instance)===null||n===void 0?void 0:n._addCaptureHook)&&(t.forEach(a=>{var u,c;(u=this.actionRegistry)===null||u===void 0||u.add(a),(c=a.steps)===null||c===void 0||c.forEach(d=>{var p;(p=this.actionEvents)===null||p===void 0||p.add((d==null?void 0:d.event)||"")})}),(r=this.instance)!==null&&r!==void 0&&r.autocapture)){var i,o=new Set;t.forEach(a=>{var u;(u=a.steps)===null||u===void 0||u.forEach(c=>{c!=null&&c.selector&&o.add(c==null?void 0:c.selector)})}),(i=this.instance)===null||i===void 0||i.autocapture.setElementSelectors(o)}}on(t,n){var r;n!=null&&t.length!=0&&(this.actionEvents.has(t)||this.actionEvents.has(n==null?void 0:n.event))&&this.actionRegistry&&((r=this.actionRegistry)===null||r===void 0?void 0:r.size)>0&&this.actionRegistry.forEach(i=>{this.checkAction(n,i)&&this._debugEventEmitter.emit("actionCaptured",i.name)})}_addActionHook(t){this.onAction("actionCaptured",n=>t(n))}checkAction(t,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.checkStep(t,r))return!0;return!1}onAction(t,n){return this._debugEventEmitter.on(t,n)}checkStepUrl(t,n){if(n!=null&&n.url){var r,i=t==null||(r=t.properties)===null||r===void 0?void 0:r.$current_url;if(!i||typeof i!="string"||!Gs.matchString(i,n==null?void 0:n.url,(n==null?void 0:n.url_matching)||"contains"))return!1}return!0}static matchString(t,n,r){switch(r){case"regex":return!!be&&Gl(t,n);case"exact":return n===t;case"contains":var i=Gs.escapeStringRegexp(n).replace(/_/g,".").replace(/%/g,".*");return Gl(t,i);default:return!1}}static escapeStringRegexp(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(t,n){if((n!=null&&n.href||n!=null&&n.tag_name||n!=null&&n.text)&&!this.getElementsList(t).some(o=>!(n!=null&&n.href&&!Gs.matchString(o.href||"",n==null?void 0:n.href,(n==null?void 0:n.href_matching)||"exact"))&&(n==null||!n.tag_name||o.tag_name===(n==null?void 0:n.tag_name))&&!(n!=null&&n.text&&!Gs.matchString(o.text||"",n==null?void 0:n.text,(n==null?void 0:n.text_matching)||"exact")&&!Gs.matchString(o.$el_text||"",n==null?void 0:n.text,(n==null?void 0:n.text_matching)||"exact"))))return!1;if(n!=null&&n.selector){var r,i=t==null||(r=t.properties)===null||r===void 0?void 0:r.$element_selectors;if(!i||!i.includes(n==null?void 0:n.selector))return!1}return!0}getElementsList(t){return(t==null?void 0:t.properties.$elements)==null?[]:t==null?void 0:t.properties.$elements}}class Jc{constructor(t){this.instance=t,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(t){var n;rt((n=this.instance)===null||n===void 0?void 0:n._addCaptureHook)||(this.setupEventBasedSurveys(t),this.setupActionBasedSurveys(t))}setupActionBasedSurveys(t){var n=t.filter(r=>{var i,o,a,u;return((i=r.conditions)===null||i===void 0?void 0:i.actions)&&((o=r.conditions)===null||o===void 0||(a=o.actions)===null||a===void 0||(u=a.values)===null||u===void 0?void 0:u.length)>0});n.length!==0&&(this.actionMatcher==null&&(this.actionMatcher=new Gs(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(r=>{this.onAction(r)})),n.forEach(r=>{var i,o,a,u,c,d,p,h,m,v;r.conditions&&(i=r.conditions)!==null&&i!==void 0&&i.actions&&(o=r.conditions)!==null&&o!==void 0&&(a=o.actions)!==null&&a!==void 0&&a.values&&((u=r.conditions)===null||u===void 0||(c=u.actions)===null||c===void 0||(d=c.values)===null||d===void 0?void 0:d.length)>0&&((p=this.actionMatcher)===null||p===void 0||p.register(r.conditions.actions.values),(h=r.conditions)===null||h===void 0||(m=h.actions)===null||m===void 0||(v=m.values)===null||v===void 0||v.forEach(_=>{if(_&&_.name){var S=this.actionToSurveys.get(_.name);S&&S.push(r.id),this.actionToSurveys.set(_.name,S||[r.id])}}))}))}setupEventBasedSurveys(t){var n;t.filter(r=>{var i,o,a,u;return((i=r.conditions)===null||i===void 0?void 0:i.events)&&((o=r.conditions)===null||o===void 0||(a=o.events)===null||a===void 0||(u=a.values)===null||u===void 0?void 0:u.length)>0}).length!==0&&((n=this.instance)===null||n===void 0||n._addCaptureHook((r,i)=>{this.onEvent(r,i)}),t.forEach(r=>{var i,o,a;(i=r.conditions)===null||i===void 0||(o=i.events)===null||o===void 0||(a=o.values)===null||a===void 0||a.forEach(u=>{if(u&&u.name){var c=this.eventToSurveys.get(u.name);c&&c.push(r.id),this.eventToSurveys.set(u.name,c||[r.id])}})}))}onEvent(t,n){var r,i,o=((r=this.instance)===null||r===void 0||(i=r.persistence)===null||i===void 0?void 0:i.props[Ch])||[];if(Jc.SURVEY_SHOWN_EVENT_NAME==t&&n&&o.length>0){var a,u=n==null||(a=n.properties)===null||a===void 0?void 0:a.$survey_id;if(u){var c=o.indexOf(u);c>=0&&(o.splice(c,1),this._updateActivatedSurveys(o))}}else this.eventToSurveys.has(t)&&this._updateActivatedSurveys(o.concat(this.eventToSurveys.get(t)||[]))}onAction(t){var n,r,i=((n=this.instance)===null||n===void 0||(r=n.persistence)===null||r===void 0?void 0:r.props[Ch])||[];this.actionToSurveys.has(t)&&this._updateActivatedSurveys(i.concat(this.actionToSurveys.get(t)||[]))}_updateActivatedSurveys(t){var n,r;(n=this.instance)===null||n===void 0||(r=n.persistence)===null||r===void 0||r.register({[Ch]:[...new Set(t)]})}getSurveys(){var t,n,r=(t=this.instance)===null||t===void 0||(n=t.persistence)===null||n===void 0?void 0:n.props[Ch];return r||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}Ve(Jc,"SURVEY_SHOWN_EVENT_NAME","survey shown");var $r=Zr("[Surveys]"),RA={icontains:(e,t)=>e.some(n=>t.toLowerCase().includes(n.toLowerCase())),not_icontains:(e,t)=>e.every(n=>!t.toLowerCase().includes(n.toLowerCase())),regex:(e,t)=>e.some(n=>Gl(t,n)),not_regex:(e,t)=>e.every(n=>!Gl(t,n)),exact:(e,t)=>e.some(n=>t===n),is_not:(e,t)=>e.every(n=>t!==n)};function $A(e){return e??"icontains"}class s8{constructor(t){Ve(this,"_isFetchingSurveys",!1),Ve(this,"_isInitializingSurveys",!1),Ve(this,"_surveyCallbacks",[]),this.instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){var n=t.surveys;if(pn(n))return $r.warn("Decide not loaded yet. Not loading surveys.");var r=qn(n);this._hasSurveys=r?n.length>0:n,$r.info("decide response received, hasSurveys: ".concat(this._hasSurveys)),this._hasSurveys&&this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var t=(()=>{for(var n=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);i!=null&&i.startsWith("seenSurvey_")&&n.push(i)}return n})();t.forEach(n=>localStorage.removeItem(n))}loadIfEnabled(){if(!this._surveyManager)if(this._isInitializingSurveys)$r.info("Already initializing surveys, skipping...");else if(this.instance.config.disable_surveys)$r.info("Disabled. Not loading surveys.");else{var t=At==null?void 0:At.__PosthogExtensions__;if(t)if(this._hasSurveys){this._isInitializingSurveys=!0;try{var n=t.generateSurveys;if(n)this._surveyManager=n(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new Jc(this.instance),$r.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0});else{var r=t.loadExternalDependency;if(r)r(this.instance,"surveys",o=>{if(o||!t.generateSurveys)return $r.error("Could not load surveys script",o),void(this._isInitializingSurveys=!1);this._surveyManager=t.generateSurveys(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new Jc(this.instance),$r.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0})});else{var i="PostHog loadExternalDependency extension not found. Cannot load remote config.";$r.error(i),this._isInitializingSurveys=!1,this._notifySurveyCallbacks({isLoaded:!1,error:i})}}}catch(o){throw $r.error("Error initializing surveys",o),this._isInitializingSurveys=!1,this._notifySurveyCallbacks({isLoaded:!1,error:"Error initializing surveys"}),o}}else $r.info("No surveys to load.");else $r.error("PostHog Extensions not found.")}}onSurveysLoaded(t){return this._surveyCallbacks.push(t),this._surveyManager&&this._notifySurveyCallbacks({isLoaded:!0}),()=>{this._surveyCallbacks=this._surveyCallbacks.filter(n=>n!==t)}}getSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return $r.info("Disabled. Not loading surveys."),t([]);var r=this.instance.get_property(Zy);if(r&&!n)return t(r,{isLoaded:!0});if(this._isFetchingSurveys)return t([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this._isFetchingSurveys=!0,this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",timeout:this.instance.config.surveys_request_timeout_ms,callback:i=>{var o;this._isFetchingSurveys=!1;var a=i.statusCode;if(a!==200||!i.json){var u="Surveys API could not be loaded, status: ".concat(a);return $r.error(u),t([],{isLoaded:!1,error:u})}var c,d=i.json.surveys||[],p=d.filter(h=>{var m,v,_,S,x,b,C,k,A,I,$,B;return((m=h.conditions)===null||m===void 0?void 0:m.events)&&((v=h.conditions)===null||v===void 0||(_=v.events)===null||_===void 0?void 0:_.values)&&((S=h.conditions)===null||S===void 0||(x=S.events)===null||x===void 0||(b=x.values)===null||b===void 0?void 0:b.length)>0||((C=h.conditions)===null||C===void 0?void 0:C.actions)&&((k=h.conditions)===null||k===void 0||(A=k.actions)===null||A===void 0?void 0:A.values)&&((I=h.conditions)===null||I===void 0||($=I.actions)===null||$===void 0||(B=$.values)===null||B===void 0?void 0:B.length)>0});return p.length>0&&((c=this._surveyEventReceiver)===null||c===void 0||c.register(p)),(o=this.instance.persistence)===null||o===void 0||o.register({[Zy]:d}),t(d,{isLoaded:!0})}})}catch(i){throw this._isFetchingSurveys=!1,i}}_notifySurveyCallbacks(t){for(var n of this._surveyCallbacks)try{t.isLoaded?this.getSurveys(n):n([],t)}catch(r){$r.error("Error in survey callback",r)}}isSurveyFeatureFlagEnabled(t){return!t||this.instance.featureFlags.isFeatureEnabled(t)}getActiveMatchingSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(r=>{var i,o=r.filter(c=>!(!c.start_date||c.end_date)).filter(c=>{var d;if(!c.conditions)return!0;var p=function(v){var _,S,x;if((_=v.conditions)===null||_===void 0||!_.url)return!0;var b=be==null||(S=be.location)===null||S===void 0?void 0:S.href;if(!b)return!1;var C=[v.conditions.url];return RA[$A((x=v.conditions)===null||x===void 0?void 0:x.urlMatchType)](C,b)}(c),h=(d=c.conditions)===null||d===void 0||!d.selector||(st==null?void 0:st.querySelector(c.conditions.selector)),m=function(v){var _,S,x;if((_=v.conditions)===null||_===void 0||!_.deviceTypes||((S=v.conditions)===null||S===void 0?void 0:S.deviceTypes.length)===0)return!0;if(!sr)return!1;var b=Dn.deviceType(sr);return RA[$A((x=v.conditions)===null||x===void 0?void 0:x.deviceTypesMatchType)](v.conditions.deviceTypes,b)}(c);return p&&h&&m}),a=(i=this._surveyEventReceiver)===null||i===void 0?void 0:i.getSurveys(),u=o.filter(c=>{var d,p,h,m,v,_,S,x,b;if(!(c.linked_flag_key||c.targeting_flag_key||c.internal_targeting_flag_key||(d=c.feature_flag_keys)!==null&&d!==void 0&&d.length))return!0;var C=this.isSurveyFeatureFlagEnabled(c.linked_flag_key),k=this.isSurveyFeatureFlagEnabled(c.targeting_flag_key),A=((p=(h=c.conditions)===null||h===void 0||(m=h.events)===null||m===void 0||(v=m.values)===null||v===void 0?void 0:v.length)!==null&&p!==void 0?p:0)>0,I=((_=(S=c.conditions)===null||S===void 0||(x=S.actions)===null||x===void 0||(b=x.values)===null||b===void 0?void 0:b.length)!==null&&_!==void 0?_:0)>0,$=!A&&!I||(a==null?void 0:a.includes(c.id)),B=this._canActivateRepeatedly(c)||this.isSurveyFeatureFlagEnabled(c.internal_targeting_flag_key),U=this.checkFlags(c);return C&&k&&B&&$&&U});return t(u)},n)}checkFlags(t){var n;return(n=t.feature_flag_keys)===null||n===void 0||!n.length||t.feature_flag_keys.every(r=>{var{key:i,value:o}=r;return!i||!o||this.instance.featureFlags.isFeatureEnabled(o)})}_canActivateRepeatedly(t){var n;return pn((n=At.__PosthogExtensions__)===null||n===void 0?void 0:n.canActivateRepeatedly)?($r.warn("init was not called"),!1):At.__PosthogExtensions__.canActivateRepeatedly(t)}canRenderSurvey(t){if(pn(this._surveyManager))return $r.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=null;return this.getSurveys(r=>{var i=r.filter(o=>o.id===t)[0];n=i?Ee({},this._surveyManager.canRenderSurvey(i)):{visible:!1,disabledReason:"Survey not found"}}),n}renderSurvey(t,n){pn(this._surveyManager)?$r.warn("init was not called"):this.getSurveys(r=>{var i=r.filter(o=>o.id===t)[0];this._surveyManager.renderSurvey(i,st==null?void 0:st.querySelector(n))})}}var DA=Zr("[RateLimiter]");class l8{constructor(t){var n,r;Ve(this,"serverLimits",{}),Ve(this,"lastEventRateLimited",!1),Ve(this,"checkForLimiting",i=>{var o=i.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(a=>{DA.info("".concat(a||"events"," is quota limited.")),this.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void DA.warn('could not rate limit - continuing. Error: "'.concat(a==null?void 0:a.message,'"'),{text:o})}}),this.instance=t,this.captureEventsPerSecond=((n=t.config.rate_limiting)===null||n===void 0?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=t.config.rate_limiting)===null||r===void 0?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var t,n,r,i=arguments.length>0&&arguments[0]!==void 0&&arguments[0],o=new Date().getTime(),a=(t=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_property(Wy))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:o};a.tokens+=(o-a.last)/1e3*this.captureEventsPerSecond,a.last=o,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var u=a.tokens<1;return u||i||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||i||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(r=this.instance.persistence)===null||r===void 0||r.set_property(Wy,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Vs=Zr("[RemoteConfig]");class u8{constructor(t){this.instance=t}get remoteConfig(){var t,n;return(t=At._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(n=t[this.instance.config.token])===null||n===void 0?void 0:n.config}_loadRemoteConfigJs(t){var n,r,i;(n=At.__PosthogExtensions__)!==null&&n!==void 0&&n.loadExternalDependency?(r=At.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"remote-config",()=>t(this.remoteConfig)):(Vs.error("PostHog Extensions not found. Cannot load remote config."),t())}_loadRemoteConfigJSON(t){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:n=>{t(n.json)}})}load(){try{if(this.remoteConfig)return Vs.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void Vs.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs(t=>{if(!t)return Vs.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON(n=>{this.onRemoteConfig(n)});this.onRemoteConfig(t)})}catch(t){Vs.error("Error loading remote config",t)}}onRemoteConfig(t){t?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(t),t.hasFeatureFlags!==!1&&this.instance.featureFlags.ensureFlagsLoaded()):Vs.info("__preview_remote_config is disabled. Logging config instead",t):Vs.error("Failed to fetch remote config from PostHog.")}}var c8=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,`
51
51
  `).replace(/\r/g,`
52
- `)).length,i=0;i<r;i++){var a=e.charCodeAt(i),u=null;a<128?n++:u=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),$a(u)||(n>t&&(o+=e.substring(t,n)),o+=u,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},fB=!!Py||!!By,LA="text/plain",Yh=(e,t)=>{var[n,r]=e.split("?"),i=Ee({},t);r==null||r.split("&").forEach(a=>{var[u]=a.split("=");delete i[u]});var o=P9(i);return o=o?(r?r+"&":"")+o:r,"".concat(n,"?").concat(o)},ef=(e,t)=>JSON.stringify(e,(n,r)=>typeof r=="bigint"?r.toString():r,t),q_=e=>{var{data:t,compression:n}=e;if(t){if(n===fo.GZipJS){var r=$k(Dk(ef(t)),{mtime:0}),i=new Blob([r],{type:LA});return{contentType:LA,body:i,estimatedSize:i.size}}if(n===fo.Base64){var o=function(c){var d,p,h,m,v,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",S=0,x=0,b="",C=[];if(!c)return c;c=cB(c);do d=(v=c.charCodeAt(S++)<<16|c.charCodeAt(S++)<<8|c.charCodeAt(S++))>>18&63,p=v>>12&63,h=v>>6&63,m=63&v,C[x++]=_.charAt(d)+_.charAt(p)+_.charAt(h)+_.charAt(m);while(S<c.length);switch(b=C.join(""),c.length%3){case 1:b=b.slice(0,-2)+"==";break;case 2:b=b.slice(0,-1)+"="}return b}(ef(t)),a=(c=>"data="+encodeURIComponent(typeof c=="string"?c:ef(c)))(o);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var u=ef(t);return{contentType:"application/json",body:u,estimatedSize:new Blob([u]).size}}},tf=[];By&&tf.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:i,estimatedSize:o}=(t=q_(e))!==null&&t!==void 0?t:{},a=new Headers;wn(e.headers,function(p,h){a.append(h,p)}),r&&a.append("Content-Type",r);var u=e.url,c=null;if(AE){var d=new AE;c={signal:d.signal,timeout:setTimeout(()=>d.abort(),e.timeout)}}By(u,Ee({method:(e==null?void 0:e.method)||"GET",headers:a,keepalive:e.method==="POST"&&(o||0)<52428.8,body:i,signal:(n=c)===null||n===void 0?void 0:n.signal},e.fetchOptions)).then(p=>p.text().then(h=>{var m,v={statusCode:p.status,text:h};if(p.status===200)try{v.json=JSON.parse(h)}catch(_){pt.error(_)}(m=e.callback)===null||m===void 0||m.call(e,v)})).catch(p=>{var h;pt.error(p),(h=e.callback)===null||h===void 0||h.call(e,{statusCode:0,text:p})}).finally(()=>c?clearTimeout(c.timeout):null)}}),Py&&tf.push({transport:"XHR",method:e=>{var t,n=new Py;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:i}=(t=q_(e))!==null&&t!==void 0?t:{};wn(e.headers,function(o,a){n.setRequestHeader(a,o)}),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=()=>{if(n.readyState===4){var o,a={statusCode:n.status,text:n.responseText};if(n.status===200)try{a.json=JSON.parse(n.responseText)}catch{}(o=e.callback)===null||o===void 0||o.call(e,a)}},n.send(i)}}),Oi!=null&&Oi.sendBeacon&&tf.push({transport:"sendBeacon",method:e=>{var t=Yh(e.url,{beacon:"1"});try{var n,{contentType:r,body:i}=(n=q_(e))!==null&&n!==void 0?n:{},o=typeof i=="string"?new Blob([i],{type:r}):i;Oi.sendBeacon(t,o)}catch{}}});var H_=3e3;class dB{constructor(t,n){Ve(this,"isPaused",!0),Ve(this,"queue",[]),this.flushTimeoutMs=Hi((n==null?void 0:n.flush_interval_ms)||H_,250,5e3,"flush interval",H_),this.sendRequest=t}enqueue(t){this.queue.push(t),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},n=Object.values(t),r=[...n.filter(i=>i.url.indexOf("/e")===0),...n.filter(i=>i.url.indexOf("/e")!==0)];r.map(i=>{this.sendRequest(Ee(Ee({},i),{},{transport:"sendBeacon"}))})}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var t=this;this.isPaused||(this.flushTimeout=setTimeout(()=>{if(this.clearFlushTimeout(),this.queue.length>0){var n=this.formatQueue(),r=function(o){var a=n[o],u=new Date().getTime();a.data&&qn(a.data)&&wn(a.data,c=>{c.offset=Math.abs(c.timestamp-u),delete c.timestamp}),t.sendRequest(a)};for(var i in n)r(i)}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var t={};return wn(this.queue,n=>{var r,i=n,o=(i?i.batchKey:null)||i.url;rt(t[o])&&(t[o]=Ee(Ee({},i),{},{data:[]})),(r=t[o].data)===null||r===void 0||r.push(i.data)}),this.queue=[],t}}var hB=["retriesPerformedSoFar"];class pB{constructor(t){Ve(this,"isPolling",!1),Ve(this,"pollIntervalMs",3e3),Ve(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!rt(be)&&"onLine"in be.navigator&&(this.areWeOnline=be.navigator.onLine,tr(be,"online",()=>{this.areWeOnline=!0,this.flush()}),tr(be,"offline",()=>{this.areWeOnline=!1}))}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=$E(t,hB);li(n)&&n>0&&(r.url=Yh(r.url,{retry_count:n})),this.instance._send_request(Ee(Ee({},r),{},{callback:i=>{var o;i.statusCode!==200&&(i.statusCode<400||i.statusCode>=500)&&(n??0)<10?this.enqueue(Ee({retriesPerformedSoFar:n},r)):(o=r.callback)===null||o===void 0||o.call(r,i)}}))}enqueue(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=function(a){var u=3e3*Math.pow(2,a),c=u/2,d=Math.min(18e5,u),p=(Math.random()-.5)*(d-c);return Math.ceil(d+p)}(n),i=Date.now()+r;this.queue.push({retryAt:i,requestOptions:t});var o="Enqueued failed request for retry in ".concat(r);navigator.onLine||(o+=" (Browser is offline)"),pt.warn(o),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout(()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()},this.pollIntervalMs)}flush(){var t=Date.now(),n=[],r=this.queue.filter(o=>o.retryAt<t||(n.push(o),!1));if(this.queue=n,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(Ee(Ee({},t),{},{transport:"sendBeacon"}))}catch(n){pt.error(n)}this.queue=[]}}class gB{constructor(t){Ve(this,"_updateScrollData",()=>{var n,r,i,o;this.context||(this.context={});var a=this.scrollElement(),u=this.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,d=u+((a==null?void 0:a.clientHeight)||0),p=(a==null?void 0:a.scrollHeight)||0;this.context.lastScrollY=Math.ceil(u),this.context.maxScrollY=Math.max(u,(n=this.context.maxScrollY)!==null&&n!==void 0?n:0),this.context.maxScrollHeight=Math.max(c,(r=this.context.maxScrollHeight)!==null&&r!==void 0?r:0),this.context.lastContentY=d,this.context.maxContentY=Math.max(d,(i=this.context.maxContentY)!==null&&i!==void 0?i:0),this.context.maxContentHeight=Math.max(p,(o=this.context.maxContentHeight)!==null&&o!==void 0?o:0)}),this.instance=t}getContext(){return this.context}resetContext(){var t=this.context;return setTimeout(this._updateScrollData,0),t}startMeasuringScrollPosition(){tr(be,"scroll",this._updateScrollData,{capture:!0}),tr(be,"scrollend",this._updateScrollData,{capture:!0}),tr(be,"resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return be==null?void 0:be.document.documentElement;var t=qn(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var n of t){var r=be==null?void 0:be.document.querySelector(n);if(r)return r}}scrollY(){if(this.instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return be&&(be.scrollY||be.pageYOffset||be.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return be&&(be.scrollX||be.pageXOffset||be.document.documentElement.scrollLeft)||0}}var mB=e=>Dn.personInfo({maskPersonalDataProperties:e==null?void 0:e.config.mask_personal_data_properties,customPersonalDataProperties:e==null?void 0:e.config.custom_personal_data_properties});class vB{constructor(t,n,r,i){Ve(this,"_onSessionIdCallback",o=>{var a=this._getStored();if(!a||a.sessionId!==o){var u={sessionId:o,props:this._sessionSourceParamGenerator(this.instance)};this._persistence.register({[Yy]:u})}}),this.instance=t,this._sessionIdManager=n,this._persistence=r,this._sessionSourceParamGenerator=i||mB,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[Yy]}getSetOnceProps(){var t,n=(t=this._getStored())===null||t===void 0?void 0:t.props;return n?"r"in n?Dn.personPropsFromInfo(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return wn(Bc(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_".concat(zy(r))]=n}),t}}var NA=Zr("[SessionId]");class yB{constructor(t,n,r){var i;if(Ve(this,"_sessionIdChangedHandlers",[]),!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=t.config,this.persistence=t.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||Ba,this._windowIdGenerator=r||Ba;var o=this.config.persistence_name||this.config.token,a=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Hi(a,60,36e3,"session_idle_timeout_seconds",1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var u=Rr.parse(this._window_id_storage_key),c=Rr.parse(this._primary_window_exists_storage_key);u&&!c?this._windowId=u:Rr.remove(this._window_id_storage_key),Rr.set(this._primary_window_exists_storage_key,!0)}if((i=this.config.bootstrap)!==null&&i!==void 0&&i.sessionID)try{var d=(p=>{var h=p.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),d)}catch(p){NA.error("Invalid sessionID in bootstrap",p)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return rt(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(t),this._sessionId&&t(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(n=>n!==t)}}_canUseSessionStorage(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Rr.is_supported()}_setWindowId(t){t!==this._windowId&&(this._windowId=t,this._canUseSessionStorage()&&Rr.set(this._window_id_storage_key,t))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Rr.parse(this._window_id_storage_key):null}_setSessionId(t,n,r){t===this._sessionId&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this._sessionId=t,this.persistence.register({[wh]:[n,t,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var t=this.persistence.props[wh];return qn(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){tr(be,"beforeunload",()=>{this._canUseSessionStorage()&&Rr.remove(this._primary_window_exists_storage_key)},{capture:!1})}checkAndGetSessionAndWindowId(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var r=n||new Date().getTime(),[i,o,a]=this._getSessionId(),u=this._getWindowId(),c=li(a)&&a>0&&Math.abs(r-a)>864e5,d=!1,p=!o,h=!t&&Math.abs(r-i)>this.sessionTimeoutMs;p||h||c?(o=this._sessionIdGenerator(),u=this._windowIdGenerator(),NA.info("new session ID generated",{sessionId:o,windowId:u,changeReason:{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:c}}),a=r,d=!0):u||(u=this._windowIdGenerator(),d=!0);var m=i===0||!t||c?r:i,v=a===0?new Date().getTime():a;return this._setWindowId(u),this._setSessionId(o,m,v),t||this.resetIdleTimer(),d&&this._sessionIdChangedHandlers.forEach(_=>_(o,u,d?{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:c}:void 0)),{sessionId:o,windowId:u,sessionStartTimestamp:v,changeReason:d?{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:c}:void 0,lastActivityTimestamp:i}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var _B=["$set_once","$set"],Ua=Zr("[SiteApps]");class bB{constructor(t){this.instance=t,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(t,n){if(n){var r=this.globalsForEvent(n);this.bufferedInvocations.push(r),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var t,n;return(t=At._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(n=t[this.instance.config.token])===null||n===void 0?void 0:n.siteApps}init(){if(this.isEnabled){var t=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{t(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(t){var n,r,i,o,a,u,c;if(!t)throw new Error("Event payload is required");var d={},p=this.instance.get_property("$groups")||[],h=this.instance.get_property("$stored_group_properties")||{};for(var[m,v]of Object.entries(h))d[m]={id:p[m],type:m,properties:v};var{$set_once:_,$set:S}=t;return{event:Ee(Ee({},$E(t,_B)),{},{properties:Ee(Ee(Ee({},t.properties),S?{$set:Ee(Ee({},(n=(r=t.properties)===null||r===void 0?void 0:r.$set)!==null&&n!==void 0?n:{}),S)}:{}),_?{$set_once:Ee(Ee({},(i=(o=t.properties)===null||o===void 0?void 0:o.$set_once)!==null&&i!==void 0?i:{}),_)}:{}),elements_chain:(a=(u=t.properties)===null||u===void 0?void 0:u.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(c=t.properties)===null||c===void 0?void 0:c.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:d}}setupSiteApp(t){var n=this.apps[t.id],r=()=>{var u;!n.errored&&this.bufferedInvocations.length&&(Ua.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(t.id)),this.bufferedInvocations.forEach(c=>{var d;return(d=n.processEvent)===null||d===void 0?void 0:d.call(n,c)}),n.processedBuffer=!0),Object.values(this.apps).every(c=>c.processedBuffer||c.errored)&&((u=this.stopBuffering)===null||u===void 0||u.call(this))},i=!1,o=u=>{n.errored=!u,n.loaded=!0,Ua.info("Site app with id ".concat(t.id," ").concat(u?"loaded":"errored")),i&&r()};try{var{processEvent:a}=t.init({posthog:this.instance,callback:u=>{o(u)}});a&&(n.processEvent=a),i=!0}catch(u){Ua.error("Error while initializing PostHog app with config id ".concat(t.id),u),o(!1)}if(i&&n.loaded)try{r()}catch(u){Ua.error("Error while processing buffered events PostHog app with config id ".concat(t.id),u),n.errored=!0}}setupSiteApps(){var t=this.siteAppLoaders||[];for(var n of t)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}onCapturedEvent(t){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{var i;(i=r.processEvent)===null||i===void 0||i.call(r,n)}catch(o){Ua.error("Error while processing event ".concat(t.event," for site app ").concat(r.id),o)}}}onRemoteConfig(t){var n,r,i,o=this;if((n=this.siteAppLoaders)!==null&&n!==void 0&&n.length)return this.isEnabled?(this.setupSiteApps(),void this.instance.on("eventCaptured",d=>this.onCapturedEvent(d))):void Ua.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.stopBuffering)===null||r===void 0||r.call(this),(i=t.siteApps)!==null&&i!==void 0&&i.length)if(this.isEnabled){var a=function(d,p){var h,m;At["__$$ph_site_app_".concat(d)]=o.instance,(h=At.__PosthogExtensions__)===null||h===void 0||(m=h.loadSiteApp)===null||m===void 0||m.call(h,o.instance,p,v=>{if(v)return Ua.error("Error while initializing PostHog app with config id ".concat(d),v)})};for(var{id:u,url:c}of t.siteApps)a(u,c)}else Ua.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Zs,xB=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","bytespider"],BA=function(e,t){if(!e)return!1;var n=e.toLowerCase();return xB.concat(t||[]).some(r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1})},PA=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&BA(n,t))return!0;try{var r=e==null?void 0:e.userAgentData;if(r!=null&&r.brands&&r.brands.some(i=>BA(i==null?void 0:i.brand,t)))return!0}catch{}return!!e.webdriver};function FA(e,t,n){return ef({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}(function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"})(Zs||(Zs={}));var zA="i.posthog.com";class wB{constructor(t){Ve(this,"_regionCache",{}),this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get uiHost(){var t,n=(t=this.instance.config.ui_host)===null||t===void 0?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace(".".concat(zA),".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Zs.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Zs.EU:this._regionCache[this.apiHost]=Zs.CUSTOM),this._regionCache[this.apiHost]}endpointFor(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(n&&(n=n[0]==="/"?n:"/".concat(n)),t==="ui")return this.uiHost+n;if(this.region===Zs.CUSTOM)return this.apiHost+n;var r=zA+n;switch(t){case"assets":return"https://".concat(this.region,"-assets.").concat(r);case"api":return"https://".concat(this.region,".").concat(r)}}}var SB={icontains:(e,t)=>!!be&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!be&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!be&&Gl(t.href,e),not_regex:(e,t)=>!!be&&!Gl(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Wr{constructor(t){var n=this;Ve(this,"getWebExperimentsAndEvaluateDisplayLogic",function(){var r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];n.getWebExperiments(i=>{Wr.logInfo("retrieved web experiments from the server"),n._flagToExperiments=new Map,i.forEach(o=>{if(o.feature_flag_key){var a;n._flagToExperiments&&(Wr.logInfo("setting flag key ",o.feature_flag_key," to web experiment ",o),(a=n._flagToExperiments)===null||a===void 0||a.set(o.feature_flag_key,o));var u=n.instance.getFeatureFlag(o.feature_flag_key);lr(u)&&o.variants[u]&&n.applyTransforms(o.name,u,o.variants[u].transforms)}else if(o.variants)for(var c in o.variants){var d=o.variants[c];Wr.matchesTestVariant(d)&&n.applyTransforms(o.name,c,d.transforms)}})},r)}),this.instance=t,this.instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}onFeatureFlags(t){if(this._is_bot())Wr.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(pn(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Wr.logInfo("applying feature flags",t),t.forEach(n=>{var r;if(this._flagToExperiments&&(r=this._flagToExperiments)!==null&&r!==void 0&&r.has(n)){var i,o=this.instance.getFeatureFlag(n),a=(i=this._flagToExperiments)===null||i===void 0?void 0:i.get(n);o&&a!=null&&a.variants[o]&&this.applyTransforms(a.name,o,a.variants[o].transforms)}})}}previewWebExperiment(){var t=Wr.getWindowLocation();if(t!=null&&t.search){var n=Mh(t==null?void 0:t.search,"__experiment_id"),r=Mh(t==null?void 0:t.search,"__experiment_variant");n&&r&&(Wr.logInfo("previewing web experiments ".concat(n," && ").concat(r)),this.getWebExperiments(i=>{this.showPreviewWebExperiment(parseInt(n),r,i)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this.instance.config.disable_web_experiments&&!r)return t([]);var i=this.instance.get_property("$web_experiments");if(i&&!n)return t(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return t([]);var a=o.json.experiments||[];return t(a)}})}showPreviewWebExperiment(t,n,r){var i=r.filter(o=>o.id===t);i&&i.length>0&&(Wr.logInfo("Previewing web experiment [".concat(i[0].name,"] with variant [").concat(n,"]")),this.applyTransforms(i[0].name,n,i[0].variants[n].transforms))}static matchesTestVariant(t){return!pn(t.conditions)&&Wr.matchUrlConditions(t)&&Wr.matchUTMConditions(t)}static matchUrlConditions(t){var n;if(pn(t.conditions)||pn((n=t.conditions)===null||n===void 0?void 0:n.url))return!0;var r,i,o,a=Wr.getWindowLocation();return!!a&&((r=t.conditions)===null||r===void 0||!r.url||SB[(i=(o=t.conditions)===null||o===void 0?void 0:o.urlMatchType)!==null&&i!==void 0?i:"icontains"](t.conditions.url,a))}static getWindowLocation(){return be==null?void 0:be.location}static matchUTMConditions(t){var n;if(pn(t.conditions)||pn((n=t.conditions)===null||n===void 0?void 0:n.utm))return!0;var r=Dn.campaignParams();if(r.utm_source){var i,o,a,u,c,d,p,h,m,v,_,S,x,b,C,k,A=(i=t.conditions)===null||i===void 0||(o=i.utm)===null||o===void 0||!o.utm_campaign||((a=t.conditions)===null||a===void 0||(u=a.utm)===null||u===void 0?void 0:u.utm_campaign)==r.utm_campaign,I=(c=t.conditions)===null||c===void 0||(d=c.utm)===null||d===void 0||!d.utm_source||((p=t.conditions)===null||p===void 0||(h=p.utm)===null||h===void 0?void 0:h.utm_source)==r.utm_source,$=(m=t.conditions)===null||m===void 0||(v=m.utm)===null||v===void 0||!v.utm_medium||((_=t.conditions)===null||_===void 0||(S=_.utm)===null||S===void 0?void 0:S.utm_medium)==r.utm_medium,B=(x=t.conditions)===null||x===void 0||(b=x.utm)===null||b===void 0||!b.utm_term||((C=t.conditions)===null||C===void 0||(k=C.utm)===null||k===void 0?void 0:k.utm_term)==r.utm_term;return A&&$&&B&&I}return!1}static logInfo(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];pt.info("[WebExperiments] ".concat(t),r)}applyTransforms(t,n,r){this._is_bot()?Wr.logInfo("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach(i=>{if(i.selector){var o;Wr.logInfo("applying transform of variant ".concat(n," for experiment ").concat(t," "),i);var a=(o=document)===null||o===void 0?void 0:o.querySelectorAll(i.selector);a==null||a.forEach(u=>{var c=u;i.html&&(c.innerHTML=i.html),i.css&&c.setAttribute("style",i.css)})}}):Wr.logInfo("Control variants leave the page unmodified.")}_is_bot(){return Oi&&this.instance?PA(Oi,this.instance.config.custom_blocked_useragents):void 0}}var nf={},G_=()=>{},Vl="posthog",UA=!fB&&(sr==null?void 0:sr.indexOf("MSIE"))===-1&&(sr==null?void 0:sr.indexOf("Mozilla"))===-1,jA=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:I9(st==null?void 0:st.location),persistence:"localStorage+cookie",persistence_name:"",loaded:G_,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:_i&&lr(_i==null?void 0:_i.search)&&_i.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(be==null||(e=be.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var n="Bad HTTP status: "+t.statusCode+" "+t.text;pt.error(n)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:H_},_onCapture:G_}},qA=e=>{var t={};rt(e.process_person)||(t.person_profiles=e.process_person),rt(e.xhr_headers)||(t.request_headers=e.xhr_headers),rt(e.cookie_name)||(t.persistence_name=e.cookie_name),rt(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),rt(e.store_google)||(t.save_campaign_params=e.store_google),rt(e.verbose)||(t.debug=e.verbose);var n=ur({},t,e);return qn(e.property_blacklist)&&(rt(e.property_denylist)?n.property_denylist=e.property_blacklist:qn(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:pt.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class CB{constructor(){Ve(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(t){pt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Wh{get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){Ve(this,"webPerformance",new CB),Ve(this,"_personProcessingSetOncePropertiesSent",!1),Ve(this,"version",Yo.LIB_VERSION),Ve(this,"_internalEventEmitter",new OA),this.config=jA(),this.SentryIntegration=R8,this.sentryIntegration=t=>function(n,r){var i=Fk(n,r);return{name:Pk,processEvent:o=>i(o)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.featureFlags=new J8(this),this.toolbar=new D8(this),this.scrollManager=new gB(this),this.pageViewManager=new z8(this),this.surveys=new sB(this),this.experiments=new Wr(this),this.exceptions=new U8(this),this.rateLimiter=new lB(this),this.requestRouter=new wB(this),this.consent=new Q9(this),this.people={set:(t,n,r)=>{var i=lr(t)?{[t]:n}:t;this.setPersonProperties(i),r==null||r({})},set_once:(t,n,r)=>{var i=lr(t)?{[t]:n}:t;this.setPersonProperties(void 0,i),r==null||r({})}},this.on("eventCaptured",t=>pt.info('send "'.concat(t==null?void 0:t.event,'"'),t))}init(t,n,r){if(r&&r!==Vl){var i,o=(i=nf[r])!==null&&i!==void 0?i:new Wh;return o._init(t,n,r),nf[r]=o,nf[Vl][r]=o,o}return this._init(t,n,r)}_init(t){var n,r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(rt(t)||Uy(t))return pt.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return pt.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],i.person_profiles&&(this._initialPersonProfilesConfig=i.person_profiles),this.set_config(ur({},jA(),qA(i),{name:o,token:t})),this.config.on_xhr_error&&pt.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:fo.GZipJS,this.persistence=new D_(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new D_(Ee(Ee({},this.config),{},{persistence:"sessionStorage"}));var a=Ee({},this.persistence.props),u=Ee({},this.sessionPersistence.props);if(this._requestQueue=new dB(b=>this._send_retriable_request(b),this.config.request_queue_config),this._retryQueue=new pB(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new yB(this),this.sessionPropsManager=new vB(this,this.sessionManager,this.persistence)),new N8(this).startIfEnabledOrStop(),this.siteApps=new bB(this),(n=this.siteApps)===null||n===void 0||n.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new M8(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new j9(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new F8(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new B8(this),this.exceptionObserver=new e8(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new gk(this,J9),this.deadClicksAutocapture.startIfEnabled(),Yo.DEBUG=Yo.DEBUG||this.config.debug,Yo.DEBUG&&pt.info("Starting in debug mode",{this:this,config:i,thisC:Ee({},this.config),p:a,s:u}),this._sync_opt_out_with_persistence(),((r=i.bootstrap)===null||r===void 0?void 0:r.distinctID)!==void 0){var c,d,p=this.config.get_device_id(Ba()),h=(c=i.bootstrap)!==null&&c!==void 0&&c.isIdentifiedID?p:i.bootstrap.distinctID;this.persistence.set_property(Wo,(d=i.bootstrap)!==null&&d!==void 0&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:h})}if(this._hasBootstrappedFeatureFlags()){var m,v,_=Object.keys(((m=i.bootstrap)===null||m===void 0?void 0:m.featureFlags)||{}).filter(b=>{var C,k;return!((C=i.bootstrap)===null||C===void 0||(k=C.featureFlags)===null||k===void 0||!k[b])}).reduce((b,C)=>{var k,A;return b[C]=((k=i.bootstrap)===null||k===void 0||(A=k.featureFlags)===null||A===void 0?void 0:A[C])||!1,b},{}),S=Object.keys(((v=i.bootstrap)===null||v===void 0?void 0:v.featureFlagPayloads)||{}).filter(b=>_[b]).reduce((b,C)=>{var k,A,I,$;return(k=i.bootstrap)!==null&&k!==void 0&&(A=k.featureFlagPayloads)!==null&&A!==void 0&&A[C]&&(b[C]=(I=i.bootstrap)===null||I===void 0||($=I.featureFlagPayloads)===null||$===void 0?void 0:$[C]),b},{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:S})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:KE,$device_id:null},"");else if(!this.get_distinct_id()){var x=this.config.get_device_id(Ba());this.register_once({distinct_id:x,$device_id:x},""),this.persistence.set_property(Wo,"anonymous")}return tr(be,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),i.segment?O8(this,()=>this._loaded()):this._loaded(),ho(this.config._onCapture)&&this.config._onCapture!==G_&&(pt.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",b=>this.config._onCapture(b.event,b))),this}_onRemoteConfig(t){var n,r,i,o,a,u,c,d;if(!st||!st.body)return pt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this._onRemoteConfig(t)},500);this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=zt(t.supportedCompression,fo.GZipJS)?fo.GZipJS:zt(t.supportedCompression,fo.Base64)?fo.Base64:void 0),(n=t.analytics)!==null&&n!==void 0&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),(r=this.siteApps)===null||r===void 0||r.onRemoteConfig(t),(i=this.sessionRecording)===null||i===void 0||i.onRemoteConfig(t),(o=this.autocapture)===null||o===void 0||o.onRemoteConfig(t),(a=this.heatmaps)===null||a===void 0||a.onRemoteConfig(t),this.surveys.onRemoteConfig(t),(u=this.webVitalsAutocapture)===null||u===void 0||u.onRemoteConfig(t),(c=this.exceptionObserver)===null||c===void 0||c.onRemoteConfig(t),(d=this.deadClicksAutocapture)===null||d===void 0||d.onRemoteConfig(t)}_loaded(){try{this.config.loaded(this)}catch(t){pt.critical("`loaded` function failed",t)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),new uB(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var t;this.has_opted_out_capturing()||this.config.request_batching&&((t=this._requestQueue)===null||t===void 0||t.enable())}_dom_loaded(){this.has_opted_out_capturing()||La(this.__request_queue,t=>this._send_retriable_request(t)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var t,n;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(t=this._requestQueue)===null||t===void 0||t.unload(),(n=this._retryQueue)===null||n===void 0||n.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(UA?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Yh(t.url,{ip:this.config.ip?1:0}),t.headers=Ee({},this.config.request_headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,i,o,a=Ee({},n);a.timeout=a.timeout||6e4,a.url=Yh(a.url,{_:new Date().getTime().toString(),ver:Yo.LIB_VERSION,compression:a.compression});var u=(r=a.transport)!==null&&r!==void 0?r:"fetch",c=(i=(o=LE(tf,d=>d.transport===u))===null||o===void 0?void 0:o.method)!==null&&i!==void 0?i:tf[0].method;if(!c)throw new Error("No available transport method");c(a)})(Ee(Ee({},t),{},{callback:n=>{var r,i,o;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((i=(o=this.config).on_request_error)===null||i===void 0||i.call(o,n)),(r=t.callback)===null||r===void 0||r.call(t,n)}}))))}_send_retriable_request(t){this._retryQueue?this._retryQueue.retriableRequest(t):this._send_request(t)}_execute_array(t){var n,r=[],i=[],o=[];La(t,u=>{u&&(n=u[0],qn(n)?o.push(u):ho(u)?u.call(this):qn(u)&&n==="alias"?r.push(u):qn(u)&&n.indexOf("capture")!==-1&&ho(this[n])?o.push(u):i.push(u))});var a=function(u,c){La(u,function(d){if(qn(d[0])){var p=c;wn(d,function(h){p=p[h[0]].apply(p,h.slice(1))})}else this[d[0]].apply(this,d.slice(1))},c)};a(r,this),a(i,this),a(o,this)}_hasBootstrappedFeatureFlags(){var t,n;return((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags)&&Object.keys((n=this.config.bootstrap)===null||n===void 0?void 0:n.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!rt(t)&&lr(t)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){n!=null&&n.$current_url&&!lr(n==null?void 0:n.$current_url)&&(pt.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,u=(r==null?void 0:r.timestamp)||a,c=Ba(),d={uuid:c,event:t,properties:this._calculate_event_properties(t,n||{},u,c)};o&&(d.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),r!=null&&r.$set&&(d.$set=r==null?void 0:r.$set);var p=this._calculate_set_once_properties(r==null?void 0:r.$set_once);p&&(d.$set_once=p),(d=k9(d,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=u,rt(r==null?void 0:r.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=a);var h=Ee(Ee({},d.properties.$set),d.$set);if(Dl(h)||this.setPersonPropertiesForFlags(h),!pn(this.config.before_send)){var m=this._runBeforeSend(d);if(!m)return;d=m}this._internalEventEmitter.emit("eventCaptured",d);var v={method:"POST",url:(i=r==null?void 0:r._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:d,compression:"best-available",batchKey:r==null?void 0:r._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this._send_retriable_request(v):this._requestQueue.enqueue(v),d}pt.critical("This capture call is ignored due to client rate limiting.")}}else pt.error("No event name provided to posthog.capture")}else pt.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",n=>t(n.event,n))}_calculate_event_properties(t,n,r,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=this.persistence.remove_event_timer(t),a=Ee({},n);if(a.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(a.$cookieless_mode=!0),t==="$snapshot"){var u=Ee(Ee({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!lr(a.distinct_id)&&!li(a.distinct_id)||Uy(a.distinct_id))&&pt.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var c,d=Dn.properties({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});if(this.sessionManager){var{sessionId:p,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId();a.$session_id=p,a.$window_id=h}this.sessionPropsManager&&ur(a,this.sessionPropsManager.getSessionProps());try{var m,v;this.sessionRecording&&(a.$recording_status=this.sessionRecording.status,a.$sdk_debug_replay_internal_buffer_length=this.sessionRecording.buffer.data.length,a.$sdk_debug_replay_internal_buffer_size=this.sessionRecording.buffer.size),a.$sdk_debug_retry_queue_size=(m=this._retryQueue)===null||m===void 0||(v=m.queue)===null||v===void 0?void 0:v.length}catch(b){a.$sdk_debug_error_capturing_properties=String(b)}if(this.requestRouter.region===Zs.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),c=t==="$pageview"?this.pageViewManager.doPageView(r,i):t==="$pageleave"?this.pageViewManager.doPageLeave(r):this.pageViewManager.doEvent(),a=ur(a,c),t==="$pageview"&&st&&(a.title=st.title),!rt(o)){var _=r.getTime()-o;a.$duration=parseFloat((_/1e3).toFixed(3))}sr&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=ur({},d,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),qn(this.config.property_denylist)?wn(this.config.property_denylist,function(b){delete a[b]}):pt.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(pt.error("sanitize_properties is deprecated. Use before_send instead"),a=S(a,t));var x=this._hasPersonProcessing();return a.$process_person_profile=x,x&&this._requirePersonProcessing("_calculate_event_properties"),a}_calculate_set_once_properties(t){var n;if(!this.persistence||!this._hasPersonProcessing()||this._personProcessingSetOncePropertiesSent)return t;var r=this.persistence.get_initial_props(),i=(n=this.sessionPropsManager)===null||n===void 0?void 0:n.getSetOnceProps(),o=ur({},r,i||{},t||{}),a=this.config.sanitize_properties;return a&&(pt.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),this._personProcessingSetOncePropertiesSent=!0,Dl(o)?void 0:o}register(t,n){var r;(r=this.persistence)===null||r===void 0||r.register(t,n)}register_once(t,n,r){var i;(i=this.persistence)===null||i===void 0||i.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)===null||n===void 0||n.register(t)}unregister(t){var n;(n=this.persistence)===null||n===void 0||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(t)}_register_single(t,n){this.register({[t]:n})}getFeatureFlag(t,n){return this.featureFlags.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(t,n){return this.featureFlags.isFeatureEnabled(t,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(t,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,n)}getEarlyAccessFeatures(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=arguments.length>2?arguments[2]:void 0;return this.featureFlags.getEarlyAccessFeatures(t,n,r)}on(t,n){return this._internalEventEmitter.on(t,n)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(t,n)}getActiveMatchingSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(t,n)}renderSurvey(t,n){this.surveys.renderSurvey(t,n)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}identify(t,n,r){if(!this.__loaded||!this.persistence)return pt.uninitializedWarning("posthog.identify");if(li(t)&&(t=t.toString(),pt.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t){if(["distinct_id","distinctid"].includes(t.toLowerCase()))pt.critical('The string "'.concat(t,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var o=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}t!==i&&t!==this.get_property(Pc)&&(this.unregister(Pc),this.register({distinct_id:t}));var a=(this.persistence.get_property(Wo)||"anonymous")==="anonymous";t!==i&&a?(this.persistence.set_property(Wo,"identified"),this.setPersonPropertiesForFlags(Ee(Ee({},r||{}),n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this._cachedPersonProperties=FA(t,n,r),this.featureFlags.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(Eh))}}else pt.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){if((t||n)&&this._requirePersonProcessing("posthog.setPersonProperties")){var r=FA(this.get_distinct_id(),t,n);this._cachedPersonProperties!==r?(this.setPersonPropertiesForFlags(Ee(Ee({},n||{}),t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}),this._cachedPersonProperties=r):pt.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:Ee(Ee({},i),{},{[t]:n})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),i[t]===n||r||this.reloadFeatureFlags()}}else pt.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,n)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var n,r,i,o;if(pt.info("reset"),!this.__loaded)return pt.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)===null||n===void 0||n.clear(),(r=this.sessionPersistence)===null||r===void 0||r.clear(),this.surveys.reset(),(i=this.persistence)===null||i===void 0||i.set_property(Wo,"anonymous"),(o=this.sessionManager)===null||o===void 0||o.resetSessionId(),this._cachedPersonProperties=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:KE,$device_id:null},"");else{var u=this.config.get_device_id(Ba());this.register_once({distinct_id:u,$device_id:t?u:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(n));if(t!=null&&t.withTimestamp&&r){var o,a=(o=t.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return i;var u=Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0);i+="?t=".concat(u)}return i}alias(t,n){return t===this.get_property(NE)?(pt.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(rt(n)&&(n=this.get_distinct_id()),t!==n?(this._register_single(Pc,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(pt.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n,r,i,o,a=Ee({},this.config);Hn(t)&&(ur(this.config,qA(t)),(n=this.persistence)===null||n===void 0||n.update_config(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new D_(Ee(Ee({},this.config),{},{persistence:"sessionStorage"})),_r.is_supported()&&_r.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(Yo.DEBUG=!0,pt.info("set_config",JSON.stringify({config:t,oldConfig:a,newConfig:Ee({},this.config)},null,2))),(r=this.sessionRecording)===null||r===void 0||r.startIfEnabledOrStop(),(i=this.autocapture)===null||i===void 0||i.startIfEnabled(),(o=this.heatmaps)===null||o===void 0||o.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(t){var n=t===!0,r={sampling:n||!(t==null||!t.sampling),linked_flag:n||!(t==null||!t.linked_flag),url_trigger:n||!(t==null||!t.url_trigger),event_trigger:n||!(t==null||!t.event_trigger)};if(Object.values(r).some(Boolean)){var i,o,a,u,c;(i=this.sessionManager)===null||i===void 0||i.checkAndGetSessionAndWindowId(),r.sampling&&((o=this.sessionRecording)===null||o===void 0||o.overrideSampling()),r.linked_flag&&((a=this.sessionRecording)===null||a===void 0||a.overrideLinkedFlag()),r.url_trigger&&((u=this.sessionRecording)===null||u===void 0||u.overrideTrigger("url")),r.event_trigger&&((c=this.sessionRecording)===null||c===void 0||c.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)===null||t===void 0||!t.started)}captureException(t,n){var r=new Error("PostHog syntheticException");this.exceptions.sendExceptionEvent(Ee(Ee({},d8((i=>i instanceof Error)(t)?{error:t,event:t.message}:{event:t},{syntheticException:r})),n))}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:Vl;return n!==Vl&&(n=Vl+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)===null||t===void 0?void 0:t.get_property(Wo))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property(Wo))==="identified"}_hasPersonProcessing(){var t,n,r,i;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Dl(this.getGroups())&&((t=this.persistence)===null||t===void 0||(n=t.props)===null||n===void 0||!n[Pc])&&((r=this.persistence)===null||r===void 0||(i=r.props)===null||i===void 0||!i[kh]))}_shouldCapturePageleave(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(t){return this.config.person_profiles==="never"?(pt.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(kh,!0),!0)}_sync_opt_out_with_persistence(){var t,n,r,i,o=this.consent.isOptedOut(),a=this.config.opt_out_persistence_by_default,u=this.config.disable_persistence||o&&!!a;((t=this.persistence)===null||t===void 0?void 0:t.disabled)!==u&&((r=this.persistence)===null||r===void 0||r.set_disabled(u)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.disabled)!==u&&((i=this.sessionPersistence)===null||i===void 0||i.set_disabled(u))}opt_in_capturing(t){var n;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(rt(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((n=t==null?void 0:t.captureEventName)!==null&&n!==void 0?n:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Oi?PA(Oi,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){st&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:st.title},{send_instantly:!0}))}debug(t){t===!1?(be==null||be.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(be==null||be.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}_runBeforeSend(t){if(pn(this.config.before_send))return t;var n=qn(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of n){if(r=i(r),pn(r)){var o="Event '".concat(t.event,"' was rejected in beforeSend function");return S9(t.event)?pt.warn("".concat(o,". This can cause unexpected behavior.")):pt.info(o),null}r.properties&&!Dl(r.properties)||pt.warn("Event '".concat(t.event,"' has no properties after beforeSend function, this is likely an error."))}return r}getPageViewId(){var t;return(t=this.pageViewManager._currentPageview)===null||t===void 0?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}}(function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=E9(e.prototype[t[n]])})(Wh,["identify"]);var HA,Zi=(HA=nf[Vl]=new Wh,function(){function e(){e.done||(e.done=!0,UA=!1,wn(nf,function(t){t._dom_loaded()}))}st!=null&&st.addEventListener?st.readyState==="complete"?e():tr(st,"DOMContentLoaded",e,{capture:!1}):be&&pt.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),HA),GA=R.createContext({client:Zi});function VA(e,t,n){if(n===void 0&&(n=new WeakMap),e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(n.has(e)&&n.get(e)===t)return!0;n.set(e,t);var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(var o=0,a=r;o<a.length;o++){var u=a[o];if(!i.includes(u)||!VA(e[u],t[u],n))return!1}return!0}function EB(e){var t=e.children,n=e.client,r=e.apiKey,i=e.options,o=R.useState(!1),a=o[0],u=o[1],c=R.useMemo(function(){return n?(r&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),i&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),n):r?a!==!1?(r!==a.previousAPIKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),i&&!VA(i,a.previousOptions)&&Zi.set_config(i),u({previousAPIKey:r,previousOptions:i??{}}),Zi):(Zi.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),Zi.init(r,i),u({previousAPIKey:r,previousOptions:i??{}}),Zi):(console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),Zi)},[n,r,JSON.stringify(i)]);return er.createElement(GA.Provider,{value:{client:c}},t)}var V_=function(){var e=R.useContext(GA).client;return e};function ja(e){var t=V_(),n=R.useState(function(){return t.isFeatureEnabled(e)}),r=n[0],i=n[1];return R.useEffect(function(){return t.onFeatureFlags(function(){i(t.isFeatureEnabled(e))})},[t,e]),r}function Ys(e){var t=V_(),n=R.useState(function(){return t.getFeatureFlagPayload(e)}),r=n[0],i=n[1];return R.useEffect(function(){return t.onFeatureFlags(function(){i(t.getFeatureFlagPayload(e))})},[t,e]),r}function kB(e){var t=V_(),n=R.useState(function(){return t.getFeatureFlag(e)}),r=n[0],i=n[1];return R.useEffect(function(){return t.onFeatureFlags(function(){i(t.getFeatureFlag(e))})},[t,e]),r}var Kh=yE();function Dae(){}function Lae(){}function AB(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const IB=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TB=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,MB={};function ZA(e,t){return(MB.jsx?TB:IB).test(e)}const OB=/[ \t\n\f\r]/g;function RB(e){return typeof e=="object"?e.type==="text"?YA(e.value):!1:YA(e)}function YA(e){return e.replace(OB,"")===""}class rf{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}rf.prototype.normal={},rf.prototype.property={},rf.prototype.space=void 0;function WA(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new rf(n,r,t)}function Z_(e){return e.toLowerCase()}class xi{constructor(t,n){this.attribute=n,this.property=t}}xi.prototype.attribute="",xi.prototype.booleanish=!1,xi.prototype.boolean=!1,xi.prototype.commaOrSpaceSeparated=!1,xi.prototype.commaSeparated=!1,xi.prototype.defined=!1,xi.prototype.mustUseProperty=!1,xi.prototype.number=!1,xi.prototype.overloadedBoolean=!1,xi.prototype.property="",xi.prototype.spaceSeparated=!1,xi.prototype.space=void 0;let $B=0;const Mt=Ws(),cr=Ws(),KA=Ws(),ze=Ws(),kn=Ws(),Zl=Ws(),Ri=Ws();function Ws(){return 2**++$B}const Y_=Object.freeze(Object.defineProperty({__proto__:null,boolean:Mt,booleanish:cr,commaOrSpaceSeparated:Ri,commaSeparated:Zl,number:ze,overloadedBoolean:KA,spaceSeparated:kn},Symbol.toStringTag,{value:"Module"})),W_=Object.keys(Y_);class K_ extends xi{constructor(t,n,r,i){let o=-1;if(super(t,n),QA(this,"space",i),typeof r=="number")for(;++o<W_.length;){const a=W_[o];QA(this,W_[o],(r&Y_[a])===Y_[a])}}}K_.prototype.defined=!0;function QA(e,t,n){n&&(e[t]=n)}function Yl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new K_(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Z_(r)]=r,n[Z_(o.attribute)]=r}return new rf(t,n,e.space)}const XA=Yl({properties:{ariaActiveDescendant:null,ariaAtomic:cr,ariaAutoComplete:null,ariaBusy:cr,ariaChecked:cr,ariaColCount:ze,ariaColIndex:ze,ariaColSpan:ze,ariaControls:kn,ariaCurrent:null,ariaDescribedBy:kn,ariaDetails:null,ariaDisabled:cr,ariaDropEffect:kn,ariaErrorMessage:null,ariaExpanded:cr,ariaFlowTo:kn,ariaGrabbed:cr,ariaHasPopup:null,ariaHidden:cr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kn,ariaLevel:ze,ariaLive:null,ariaModal:cr,ariaMultiLine:cr,ariaMultiSelectable:cr,ariaOrientation:null,ariaOwns:kn,ariaPlaceholder:null,ariaPosInSet:ze,ariaPressed:cr,ariaReadOnly:cr,ariaRelevant:null,ariaRequired:cr,ariaRoleDescription:kn,ariaRowCount:ze,ariaRowIndex:ze,ariaRowSpan:ze,ariaSelected:cr,ariaSetSize:ze,ariaSort:null,ariaValueMax:ze,ariaValueMin:ze,ariaValueNow:ze,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function JA(e,t){return t in e?e[t]:t}function eI(e,t){return JA(e,t.toLowerCase())}const DB=Yl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zl,acceptCharset:kn,accessKey:kn,action:null,allow:null,allowFullScreen:Mt,allowPaymentRequest:Mt,allowUserMedia:Mt,alt:null,as:null,async:Mt,autoCapitalize:null,autoComplete:kn,autoFocus:Mt,autoPlay:Mt,blocking:kn,capture:null,charSet:null,checked:Mt,cite:null,className:kn,cols:ze,colSpan:null,content:null,contentEditable:cr,controls:Mt,controlsList:kn,coords:ze|Zl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Mt,defer:Mt,dir:null,dirName:null,disabled:Mt,download:KA,draggable:cr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Mt,formTarget:null,headers:kn,height:ze,hidden:Mt,high:ze,href:null,hrefLang:null,htmlFor:kn,httpEquiv:kn,id:null,imageSizes:null,imageSrcSet:null,inert:Mt,inputMode:null,integrity:null,is:null,isMap:Mt,itemId:null,itemProp:kn,itemRef:kn,itemScope:Mt,itemType:kn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Mt,low:ze,manifest:null,max:null,maxLength:ze,media:null,method:null,min:null,minLength:ze,multiple:Mt,muted:Mt,name:null,nonce:null,noModule:Mt,noValidate:Mt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Mt,optimum:ze,pattern:null,ping:kn,placeholder:null,playsInline:Mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Mt,referrerPolicy:null,rel:kn,required:Mt,reversed:Mt,rows:ze,rowSpan:ze,sandbox:kn,scope:null,scoped:Mt,seamless:Mt,selected:Mt,shadowRootClonable:Mt,shadowRootDelegatesFocus:Mt,shadowRootMode:null,shape:null,size:ze,sizes:null,slot:null,span:ze,spellCheck:cr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ze,step:null,style:null,tabIndex:ze,target:null,title:null,translate:null,type:null,typeMustMatch:Mt,useMap:null,value:cr,width:ze,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kn,axis:null,background:null,bgColor:null,border:ze,borderColor:null,bottomMargin:ze,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Mt,declare:Mt,event:null,face:null,frame:null,frameBorder:null,hSpace:ze,leftMargin:ze,link:null,longDesc:null,lowSrc:null,marginHeight:ze,marginWidth:ze,noResize:Mt,noHref:Mt,noShade:Mt,noWrap:Mt,object:null,profile:null,prompt:null,rev:null,rightMargin:ze,rules:null,scheme:null,scrolling:cr,standby:null,summary:null,text:null,topMargin:ze,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ze,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Mt,disableRemotePlayback:Mt,prefix:null,property:null,results:ze,security:null,unselectable:null},space:"html",transform:eI}),LB=Yl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ri,accentHeight:ze,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ze,amplitude:ze,arabicForm:null,ascent:ze,attributeName:null,attributeType:null,azimuth:ze,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ze,by:null,calcMode:null,capHeight:ze,className:kn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ze,diffuseConstant:ze,direction:null,display:null,dur:null,divisor:ze,dominantBaseline:null,download:Mt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ze,enableBackground:null,end:null,event:null,exponent:ze,externalResourcesRequired:null,fill:null,fillOpacity:ze,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Zl,g2:Zl,glyphName:Zl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ze,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ze,horizOriginX:ze,horizOriginY:ze,id:null,ideographic:ze,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ze,k:ze,k1:ze,k2:ze,k3:ze,k4:ze,kernelMatrix:Ri,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ze,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ze,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ze,overlineThickness:ze,paintOrder:null,panose1:null,path:null,pathLength:ze,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ze,pointsAtY:ze,pointsAtZ:ze,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ri,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ri,rev:Ri,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ri,requiredFeatures:Ri,requiredFonts:Ri,requiredFormats:Ri,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ze,specularExponent:ze,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ze,strikethroughThickness:ze,string:null,stroke:null,strokeDashArray:Ri,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ze,strokeOpacity:ze,strokeWidth:null,style:null,surfaceScale:ze,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ri,tabIndex:ze,tableValues:null,target:null,targetX:ze,targetY:ze,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ri,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ze,underlineThickness:ze,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ze,values:null,vAlphabetic:ze,vMathematical:ze,vectorEffect:null,vHanging:ze,vIdeographic:ze,version:null,vertAdvY:ze,vertOriginX:ze,vertOriginY:ze,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ze,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:JA}),tI=Yl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),nI=Yl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:eI}),rI=Yl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),NB={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},BB=/[A-Z]/g,iI=/-[a-z]/g,PB=/^data[-\w.:]+$/i;function FB(e,t){const n=Z_(t);let r=t,i=xi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&PB.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(iI,UB);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!iI.test(o)){let a=o.replace(BB,zB);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=K_}return new i(r,t)}function zB(e){return"-"+e.toLowerCase()}function UB(e){return e.charAt(1).toUpperCase()}const jB=WA([XA,DB,tI,nI,rI],"html"),Q_=WA([XA,LB,tI,nI,rI],"svg");function qB(e){return e.join(" ").trim()}var Wl={},X_,oI;function HB(){if(oI)return X_;oI=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,u=/^\s+|\s+$/g,c=`
53
- `,d="/",p="*",h="",m="comment",v="declaration";X_=function(S,x){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];x=x||{};var b=1,C=1;function k(ue){var Z=ue.match(t);Z&&(b+=Z.length);var ie=ue.lastIndexOf(c);C=~ie?ue.length-ie:C+ue.length}function A(){var ue={line:b,column:C};return function(Z){return Z.position=new I(ue),U(),Z}}function I(ue){this.start=ue,this.end={line:b,column:C},this.source=x.source}I.prototype.content=S;function $(ue){var Z=new Error(x.source+":"+b+":"+C+": "+ue);if(Z.reason=ue,Z.filename=x.source,Z.line=b,Z.column=C,Z.source=S,!x.silent)throw Z}function B(ue){var Z=ue.exec(S);if(Z){var ie=Z[0];return k(ie),S=S.slice(ie.length),Z}}function U(){B(n)}function G(ue){var Z;for(ue=ue||[];Z=P();)Z!==!1&&ue.push(Z);return ue}function P(){var ue=A();if(!(d!=S.charAt(0)||p!=S.charAt(1))){for(var Z=2;h!=S.charAt(Z)&&(p!=S.charAt(Z)||d!=S.charAt(Z+1));)++Z;if(Z+=2,h===S.charAt(Z-1))return $("End of comment missing");var ie=S.slice(2,Z-2);return C+=2,k(ie),S=S.slice(Z),C+=2,ue({type:m,comment:ie})}}function K(){var ue=A(),Z=B(r);if(Z){if(P(),!B(i))return $("property missing ':'");var ie=B(o),V=ue({type:v,property:_(Z[0].replace(e,h)),value:ie?_(ie[0].replace(e,h)):h});return B(a),V}}function re(){var ue=[];G(ue);for(var Z;Z=K();)Z!==!1&&(ue.push(Z),G(ue));return ue}return U(),re()};function _(S){return S?S.replace(u,h):h}return X_}var aI;function GB(){if(aI)return Wl;aI=1;var e=Wl&&Wl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wl,"__esModule",{value:!0}),Wl.default=n;var t=e(HB());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var a=(0,t.default)(r),u=typeof i=="function";return a.forEach(function(c){if(c.type==="declaration"){var d=c.property,p=c.value;u?i(d,p,c):p&&(o=o||{},o[d]=p)}}),o}return Wl}var of={},sI;function VB(){if(sI)return of;sI=1,Object.defineProperty(of,"__esModule",{value:!0}),of.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(d){return!d||n.test(d)||e.test(d)},a=function(d,p){return p.toUpperCase()},u=function(d,p){return"".concat(p,"-")},c=function(d,p){return p===void 0&&(p={}),o(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(i,u):d=d.replace(r,u),d.replace(t,a))};return of.camelCase=c,of}var af,lI;function ZB(){if(lI)return af;lI=1;var e=af&&af.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(GB()),n=VB();function r(i,o){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(u,c){u&&c&&(a[(0,n.camelCase)(u,o)]=c)}),a}return r.default=r,af=r,af}var YB=ZB();const WB=qi(YB),uI=cI("end"),J_=cI("start");function cI(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function KB(e){const t=J_(e),n=uI(e);if(t&&n)return{start:t,end:n}}function sf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?fI(e.position):"start"in e||"end"in e?fI(e):"line"in e||"column"in e?eb(e):""}function eb(e){return dI(e&&e.line)+":"+dI(e&&e.column)}function fI(e){return eb(e&&e.start)+"-"+eb(e&&e.end)}function dI(e){return e&&typeof e=="number"?e:1}class Kr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?o.ruleId=r:(o.source=r.slice(0,c),o.ruleId=r.slice(c+1))}if(!o.place&&o.ancestors&&o.ancestors){const c=o.ancestors[o.ancestors.length-1];c&&(o.place=c.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=u?u.line:void 0,this.name=sf(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Kr.prototype.file="",Kr.prototype.name="",Kr.prototype.reason="",Kr.prototype.message="",Kr.prototype.stack="",Kr.prototype.column=void 0,Kr.prototype.line=void 0,Kr.prototype.ancestors=void 0,Kr.prototype.cause=void 0,Kr.prototype.fatal=void 0,Kr.prototype.place=void 0,Kr.prototype.ruleId=void 0,Kr.prototype.source=void 0;const tb={}.hasOwnProperty,QB=new Map,XB=/[A-Z]/g,JB=new Set(["table","tbody","thead","tfoot","tr"]),eP=new Set(["td","th"]),hI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function tP(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=uP(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=lP(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Q_:jB,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=pI(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function pI(e,t,n){if(t.type==="element")return nP(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return rP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return oP(e,t,n);if(t.type==="mdxjsEsm")return iP(e,t);if(t.type==="root")return aP(e,t,n);if(t.type==="text")return sP(e,t)}function nP(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Q_,e.schema=i),e.ancestors.push(t);const o=mI(e,t.tagName,!1),a=cP(e,t);let u=rb(e,t);return JB.has(t.tagName)&&(u=u.filter(function(c){return typeof c=="string"?!RB(c):!0})),gI(e,a,o,t),nb(a,u),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function rP(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}lf(e,t.position)}function iP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);lf(e,t.position)}function oP(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Q_,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:mI(e,t.name,!0),a=fP(e,t),u=rb(e,t);return gI(e,a,o,t),nb(a,u),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function aP(e,t,n){const r={};return nb(r,rb(e,t)),e.create(t,e.Fragment,r,n)}function sP(e,t){return t.value}function gI(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function nb(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function lP(e,t,n){return r;function r(i,o,a,u){const d=Array.isArray(a.children)?n:t;return u?d(o,a,u):d(o,a)}}function uP(e,t){return n;function n(r,i,o,a){const u=Array.isArray(o.children),c=J_(r);return t(i,o,a,u,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function cP(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&tb.call(t.properties,i)){const o=dP(e,i,t.properties[i]);if(o){const[a,u]=o;e.tableCellAlignToStyle&&a==="align"&&typeof u=="string"&&eP.has(t.tagName)?r=u:n[a]=u}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function fP(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const u=a.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else lf(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else lf(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function rb(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:QB;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const c=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(c){const d=i.get(c)||0;a=c+"-"+d,i.set(c,d+1)}}const u=pI(e,o,a);u!==void 0&&n.push(u)}return n}function dP(e,t,n){const r=FB(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?AB(n):qB(n)),r.property==="style"){let i=typeof n=="object"?n:hP(e,String(n));return e.stylePropertyNameCase==="css"&&(i=pP(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?NB[r.property]||r.property:r.attribute,n]}}function hP(e,t){try{return WB(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Kr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=hI+"#cannot-parse-style-attribute",i}}function mI(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const u=ZA(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:u,computed:!!(o&&u.type==="Literal"),optional:!1}:u}r=a}else r=ZA(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return tb.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);lf(e)}function lf(e,t){const n=new Kr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=hI+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pP(e){const t={};let n;for(n in e)tb.call(e,n)&&(t[gP(n)]=e[n]);return t}function gP(e){let t=e.replace(XB,mP);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function mP(e){return"-"+e.toLowerCase()}const ib={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},vP={};function ob(e,t){const n=vP,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return vI(e,r,i)}function vI(e,t,n){if(yP(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return yI(e.children,t,n)}return Array.isArray(e)?yI(e,t,n):""}function yI(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=vI(e[i],t,n);return r.join("")}function yP(e){return!!(e&&typeof e=="object")}const _I=document.createElement("i");function ab(e){const t="&"+e+";";_I.innerHTML=t;const n=_I.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function $i(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function Yi(e,t){return e.length>0?($i(e,e.length,0,t),e):t}const bI={}.hasOwnProperty;function xI(e){const t={};let n=-1;for(;++n<e.length;)_P(t,e[n]);return t}function _P(e,t){let n;for(n in t){const i=(bI.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){bI.call(i,a)||(i[a]=[]);const u=o[a];bP(i[a],Array.isArray(u)?u:u?[u]:[])}}}function bP(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);$i(e,0,0,r)}function wI(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function go(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ci=qa(/[A-Za-z]/),Qr=qa(/[\dA-Za-z]/),xP=qa(/[#-'*+\--9=?A-Z^-~]/);function Qh(e){return e!==null&&(e<32||e===127)}const sb=qa(/\d/),wP=qa(/[\dA-Fa-f]/),SP=qa(/[!-/:-@[-`{-~]/);function _t(e){return e!==null&&e<-2}function Sn(e){return e!==null&&(e<0||e===32)}function Ut(e){return e===-2||e===-1||e===32}const Xh=qa(new RegExp("\\p{P}|\\p{S}","u")),Ks=qa(/\s/);function qa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Kl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&Qr(e.charCodeAt(n+1))&&Qr(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(a=String.fromCharCode(o,u),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Qt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(c){return Ut(c)?(e.enter(n),u(c)):t(c)}function u(c){return Ut(c)&&o++<i?(e.consume(c),u):(e.exit(n),t(c))}}const CP={tokenize:EP};function EP(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Qt(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),o(u)}function o(u){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,a(u)}function a(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return _t(u)?(e.consume(u),e.exit("chunkText"),o):(e.consume(u),a)}}const kP={tokenize:AP},SI={tokenize:IP};function AP(e){const t=this,n=[];let r=0,i,o,a;return u;function u(k){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,c,d)(k)}return d(k)}function c(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&C();const A=t.events.length;let I=A,$;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){$=t.events[I][1].end;break}b(r);let B=A;for(;B<t.events.length;)t.events[B][1].end={...$},B++;return $i(t.events,I+1,0,t.events.slice(A)),t.events.length=B,d(k)}return u(k)}function d(k){if(r===n.length){if(!i)return m(k);if(i.currentConstruct&&i.currentConstruct.concrete)return _(k);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(SI,p,h)(k)}function p(k){return i&&C(),b(r),m(k)}function h(k){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,_(k)}function m(k){return t.containerState={},e.attempt(SI,v,_)(k)}function v(k){return r++,n.push([t.currentConstruct,t.containerState]),m(k)}function _(k){if(k===null){i&&C(),b(0),e.consume(k);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),S(k)}function S(k){if(k===null){x(e.exit("chunkFlow"),!0),b(0),e.consume(k);return}return _t(k)?(e.consume(k),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(k),S)}function x(k,A){const I=t.sliceStream(k);if(A&&I.push(null),k.previous=o,o&&(o.next=k),o=k,i.defineSkip(k.start),i.write(I),t.parser.lazy[k.start.line]){let $=i.events.length;for(;$--;)if(i.events[$][1].start.offset<a&&(!i.events[$][1].end||i.events[$][1].end.offset>a))return;const B=t.events.length;let U=B,G,P;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(G){P=t.events[U][1].end;break}G=!0}for(b(r),$=B;$<t.events.length;)t.events[$][1].end={...P},$++;$i(t.events,U+1,0,t.events.slice(B)),t.events.length=$}}function b(k){let A=n.length;for(;A-- >k;){const I=n[A];t.containerState=I[1],I[0].exit.call(t,e)}n.length=k}function C(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function IP(e,t,n){return Qt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ql(e){if(e===null||Sn(e)||Ks(e))return 1;if(Xh(e))return 2}function Jh(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const lb={name:"attention",resolveAll:TP,tokenize:MP};function TP(e,t){let n=-1,r,i,o,a,u,c,d,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[n][1].start};CI(h,-c),CI(m,c),a={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},u={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},o={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...a.start},end:{...u.end}},e[r][1].end={...a.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Yi(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Yi(d,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),d=Yi(d,Jh(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Yi(d,[["exit",o,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=Yi(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,$i(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function MP(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ql(r);let o;return a;function a(c){return o=c,e.enter("attentionSequence"),u(c)}function u(c){if(c===o)return e.consume(c),u;const d=e.exit("attentionSequence"),p=Ql(c),h=!p||p===2&&i||n.includes(c),m=!i||i===2&&p||n.includes(r);return d._open=!!(o===42?h:h&&(i||!m)),d._close=!!(o===42?m:m&&(p||!h)),t(c)}}function CI(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const OP={name:"autolink",tokenize:RP};function RP(e,t,n){let r=0;return i;function i(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(v){return ci(v)?(e.consume(v),a):v===64?n(v):d(v)}function a(v){return v===43||v===45||v===46||Qr(v)?(r=1,u(v)):d(v)}function u(v){return v===58?(e.consume(v),r=0,c):(v===43||v===45||v===46||Qr(v))&&r++<32?(e.consume(v),u):(r=0,d(v))}function c(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Qh(v)?n(v):(e.consume(v),c)}function d(v){return v===64?(e.consume(v),p):xP(v)?(e.consume(v),d):n(v)}function p(v){return Qr(v)?h(v):n(v)}function h(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):m(v)}function m(v){if((v===45||Qr(v))&&r++<63){const _=v===45?m:h;return e.consume(v),_}return n(v)}}const uf={partial:!0,tokenize:$P};function $P(e,t,n){return r;function r(o){return Ut(o)?Qt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||_t(o)?t(o):n(o)}}const EI={continuation:{tokenize:LP},exit:NP,name:"blockQuote",tokenize:DP};function DP(e,t,n){const r=this;return i;function i(a){if(a===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Ut(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function LP(e,t,n){const r=this;return i;function i(a){return Ut(a)?Qt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(EI,t,n)(a)}}function NP(e){e.exit("blockQuote")}const kI={name:"characterEscape",tokenize:BP};function BP(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return SP(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const AI={name:"characterReference",tokenize:PP};function PP(e,t,n){const r=this;let i=0,o,a;return u;function u(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,a=Qr,p(h))}function d(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=wP,p):(e.enter("characterReferenceValue"),o=7,a=sb,p(h))}function p(h){if(h===59&&i){const m=e.exit("characterReferenceValue");return a===Qr&&!ab(r.sliceSerialize(m))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<o?(e.consume(h),p):n(h)}}const II={partial:!0,tokenize:zP},TI={concrete:!0,name:"codeFenced",tokenize:FP};function FP(e,t,n){const r=this,i={partial:!0,tokenize:I};let o=0,a=0,u;return c;function c($){return d($)}function d($){const B=r.events[r.events.length-1];return o=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,u=$,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p($)}function p($){return $===u?(a++,e.consume($),p):a<3?n($):(e.exit("codeFencedFenceSequence"),Ut($)?Qt(e,h,"whitespace")($):h($))}function h($){return $===null||_t($)?(e.exit("codeFencedFence"),r.interrupt?t($):e.check(II,S,A)($)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m($))}function m($){return $===null||_t($)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h($)):Ut($)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Qt(e,v,"whitespace")($)):$===96&&$===u?n($):(e.consume($),m)}function v($){return $===null||_t($)?h($):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_($))}function _($){return $===null||_t($)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h($)):$===96&&$===u?n($):(e.consume($),_)}function S($){return e.attempt(i,A,x)($)}function x($){return e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),b}function b($){return o>0&&Ut($)?Qt(e,C,"linePrefix",o+1)($):C($)}function C($){return $===null||_t($)?e.check(II,S,A)($):(e.enter("codeFlowValue"),k($))}function k($){return $===null||_t($)?(e.exit("codeFlowValue"),C($)):(e.consume($),k)}function A($){return e.exit("codeFenced"),t($)}function I($,B,U){let G=0;return P;function P(ie){return $.enter("lineEnding"),$.consume(ie),$.exit("lineEnding"),K}function K(ie){return $.enter("codeFencedFence"),Ut(ie)?Qt($,re,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ie):re(ie)}function re(ie){return ie===u?($.enter("codeFencedFenceSequence"),ue(ie)):U(ie)}function ue(ie){return ie===u?(G++,$.consume(ie),ue):G>=a?($.exit("codeFencedFenceSequence"),Ut(ie)?Qt($,Z,"whitespace")(ie):Z(ie)):U(ie)}function Z(ie){return ie===null||_t(ie)?($.exit("codeFencedFence"),B(ie)):U(ie)}}}function zP(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const ub={name:"codeIndented",tokenize:jP},UP={partial:!0,tokenize:qP};function jP(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Qt(e,o,"linePrefix",5)(d)}function o(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?c(d):_t(d)?e.attempt(UP,a,c)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||_t(d)?(e.exit("codeFlowValue"),a(d)):(e.consume(d),u)}function c(d){return e.exit("codeIndented"),t(d)}}function qP(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):_t(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Qt(e,o,"linePrefix",5)(a)}function o(a){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):_t(a)?i(a):n(a)}}const HP={name:"codeText",previous:VP,resolve:GP,tokenize:ZP};function GP(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function VP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ZP(e,t,n){let r=0,i,o;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),u(h)}function u(h){return h===96?(e.consume(h),r++,u):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(o=e.enter("codeTextSequence"),i=0,p(h)):_t(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||_t(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),d)}function p(h){return h===96?(e.consume(h),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",d(h))}}class YP{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&cf(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),cf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),cf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);cf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);cf(this.left,n.reverse())}}}function cf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function MI(e){const t={};let n=-1,r,i,o,a,u,c,d;const p=new YP(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,o=0,o<c.length&&c[o][1].type==="lineEndingBlank"&&(o+=2),o<c.length&&c[o][1].type==="content"))for(;++o<c.length&&c[o][1].type!=="content";)c[o][1].type==="chunkText"&&(c[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,WP(p,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=p.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},u=p.slice(i,n),u.unshift(r),p.splice(i,n-i+1,u))}}return $i(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function WP(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const u=a.events,c=[],d={};let p,h,m=-1,v=n,_=0,S=0;const x=[S];for(;v;){for(;e.get(++i)[1]!==v;);o.push(i),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),h&&a.defineSkip(v.start),v._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(p),v._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=v,v=v.next}for(v=n;++m<u.length;)u[m][0]==="exit"&&u[m-1][0]==="enter"&&u[m][1].type===u[m-1][1].type&&u[m][1].start.line!==u[m][1].end.line&&(S=m+1,x.push(S),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(a.events=[],v?(v._tokenizer=void 0,v.previous=void 0):x.pop(),m=x.length;m--;){const b=u.slice(x[m],x[m+1]),C=o.pop();c.push([C,C+b.length-1]),e.splice(C,2,b)}for(c.reverse(),m=-1;++m<c.length;)d[_+c[m][0]]=_+c[m][1],_+=c[m][1]-c[m][0]-1;return d}const KP={resolve:XP,tokenize:JP},QP={partial:!0,tokenize:eF};function XP(e){return MI(e),e}function JP(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?o(u):_t(u)?e.check(QP,a,o)(u):(e.consume(u),i)}function o(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function a(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function eF(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Qt(e,o,"linePrefix")}function o(a){if(a===null||_t(a))return n(a);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function OI(e,t,n,r,i,o,a,u,c){const d=c||Number.POSITIVE_INFINITY;let p=0;return h;function h(b){return b===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(b),e.exit(o),m):b===null||b===32||b===41||Qh(b)?n(b):(e.enter(r),e.enter(a),e.enter(u),e.enter("chunkString",{contentType:"string"}),S(b))}function m(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),v(b))}function v(b){return b===62?(e.exit("chunkString"),e.exit(u),m(b)):b===null||b===60||_t(b)?n(b):(e.consume(b),b===92?_:v)}function _(b){return b===60||b===62||b===92?(e.consume(b),v):v(b)}function S(b){return!p&&(b===null||b===41||Sn(b))?(e.exit("chunkString"),e.exit(u),e.exit(a),e.exit(r),t(b)):p<d&&b===40?(e.consume(b),p++,S):b===41?(e.consume(b),p--,S):b===null||b===32||b===40||Qh(b)?n(b):(e.consume(b),b===92?x:S)}function x(b){return b===40||b===41||b===92?(e.consume(b),S):S(b)}}function RI(e,t,n,r,i,o){const a=this;let u=0,c;return d;function d(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(o),p}function p(v){return u>999||v===null||v===91||v===93&&!c||v===94&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(v):v===93?(e.exit(o),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):_t(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||v===91||v===93||_t(v)||u++>999?(e.exit("chunkString"),p(v)):(e.consume(v),c||(c=!Ut(v)),v===92?m:h)}function m(v){return v===91||v===92||v===93?(e.consume(v),u++,h):h(v)}}function $I(e,t,n,r,i,o){let a;return u;function u(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),a=m===40?41:m,c):n(m)}function c(m){return m===a?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(o),d(m))}function d(m){return m===a?(e.exit(o),c(a)):m===null?n(m):_t(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Qt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===a||m===null||_t(m)?(e.exit("chunkString"),d(m)):(e.consume(m),m===92?h:p)}function h(m){return m===a||m===92?(e.consume(m),p):p(m)}}function ff(e,t){let n;return r;function r(i){return _t(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ut(i)?Qt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const tF={name:"definition",tokenize:rF},nF={partial:!0,tokenize:iF};function rF(e,t,n){const r=this;let i;return o;function o(v){return e.enter("definition"),a(v)}function a(v){return RI.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function u(v){return i=go(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),c):n(v)}function c(v){return Sn(v)?ff(e,d)(v):d(v)}function d(v){return OI(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(nF,h,h)(v)}function h(v){return Ut(v)?Qt(e,m,"whitespace")(v):m(v)}function m(v){return v===null||_t(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function iF(e,t,n){return r;function r(u){return Sn(u)?ff(e,i)(u):n(u)}function i(u){return $I(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return Ut(u)?Qt(e,a,"whitespace")(u):a(u)}function a(u){return u===null||_t(u)?t(u):n(u)}}const oF={name:"hardBreakEscape",tokenize:aF};function aF(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return _t(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const sF={name:"headingAtx",resolve:lF,tokenize:uF};function lF(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},$i(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function uF(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),a(p)}function a(p){return p===35&&r++<6?(e.consume(p),a):p===null||Sn(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),c(p)):p===null||_t(p)?(e.exit("atxHeading"),t(p)):Ut(p)?Qt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function c(p){return p===35?(e.consume(p),c):(e.exit("atxHeadingSequence"),u(p))}function d(p){return p===null||p===35||Sn(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),d)}}const cF=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],DI=["pre","script","style","textarea"],fF={concrete:!0,name:"htmlFlow",resolveTo:pF,tokenize:gF},dF={partial:!0,tokenize:vF},hF={partial:!0,tokenize:mF};function pF(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function gF(e,t,n){const r=this;let i,o,a,u,c;return d;function d(L){return p(L)}function p(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),h}function h(L){return L===33?(e.consume(L),m):L===47?(e.consume(L),o=!0,S):L===63?(e.consume(L),i=3,r.interrupt?t:T):ci(L)?(e.consume(L),a=String.fromCharCode(L),x):n(L)}function m(L){return L===45?(e.consume(L),i=2,v):L===91?(e.consume(L),i=5,u=0,_):ci(L)?(e.consume(L),i=4,r.interrupt?t:T):n(L)}function v(L){return L===45?(e.consume(L),r.interrupt?t:T):n(L)}function _(L){const we="CDATA[";return L===we.charCodeAt(u++)?(e.consume(L),u===we.length?r.interrupt?t:re:_):n(L)}function S(L){return ci(L)?(e.consume(L),a=String.fromCharCode(L),x):n(L)}function x(L){if(L===null||L===47||L===62||Sn(L)){const we=L===47,Ue=a.toLowerCase();return!we&&!o&&DI.includes(Ue)?(i=1,r.interrupt?t(L):re(L)):cF.includes(a.toLowerCase())?(i=6,we?(e.consume(L),b):r.interrupt?t(L):re(L)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):o?C(L):k(L))}return L===45||Qr(L)?(e.consume(L),a+=String.fromCharCode(L),x):n(L)}function b(L){return L===62?(e.consume(L),r.interrupt?t:re):n(L)}function C(L){return Ut(L)?(e.consume(L),C):P(L)}function k(L){return L===47?(e.consume(L),P):L===58||L===95||ci(L)?(e.consume(L),A):Ut(L)?(e.consume(L),k):P(L)}function A(L){return L===45||L===46||L===58||L===95||Qr(L)?(e.consume(L),A):I(L)}function I(L){return L===61?(e.consume(L),$):Ut(L)?(e.consume(L),I):k(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),c=L,B):Ut(L)?(e.consume(L),$):U(L)}function B(L){return L===c?(e.consume(L),c=null,G):L===null||_t(L)?n(L):(e.consume(L),B)}function U(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||Sn(L)?I(L):(e.consume(L),U)}function G(L){return L===47||L===62||Ut(L)?k(L):n(L)}function P(L){return L===62?(e.consume(L),K):n(L)}function K(L){return L===null||_t(L)?re(L):Ut(L)?(e.consume(L),K):n(L)}function re(L){return L===45&&i===2?(e.consume(L),V):L===60&&i===1?(e.consume(L),Q):L===62&&i===4?(e.consume(L),X):L===63&&i===3?(e.consume(L),T):L===93&&i===5?(e.consume(L),Te):_t(L)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(dF,ve,ue)(L)):L===null||_t(L)?(e.exit("htmlFlowData"),ue(L)):(e.consume(L),re)}function ue(L){return e.check(hF,Z,ve)(L)}function Z(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),ie}function ie(L){return L===null||_t(L)?ue(L):(e.enter("htmlFlowData"),re(L))}function V(L){return L===45?(e.consume(L),T):re(L)}function Q(L){return L===47?(e.consume(L),a="",ye):re(L)}function ye(L){if(L===62){const we=a.toLowerCase();return DI.includes(we)?(e.consume(L),X):re(L)}return ci(L)&&a.length<8?(e.consume(L),a+=String.fromCharCode(L),ye):re(L)}function Te(L){return L===93?(e.consume(L),T):re(L)}function T(L){return L===62?(e.consume(L),X):L===45&&i===2?(e.consume(L),T):re(L)}function X(L){return L===null||_t(L)?(e.exit("htmlFlowData"),ve(L)):(e.consume(L),X)}function ve(L){return e.exit("htmlFlow"),t(L)}}function mF(e,t,n){const r=this;return i;function i(a){return _t(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function vF(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(uf,t,n)}}const yF={name:"htmlText",tokenize:_F};function _F(e,t,n){const r=this;let i,o,a;return u;function u(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),c}function c(T){return T===33?(e.consume(T),d):T===47?(e.consume(T),I):T===63?(e.consume(T),k):ci(T)?(e.consume(T),U):n(T)}function d(T){return T===45?(e.consume(T),p):T===91?(e.consume(T),o=0,_):ci(T)?(e.consume(T),C):n(T)}function p(T){return T===45?(e.consume(T),v):n(T)}function h(T){return T===null?n(T):T===45?(e.consume(T),m):_t(T)?(a=h,Q(T)):(e.consume(T),h)}function m(T){return T===45?(e.consume(T),v):h(T)}function v(T){return T===62?V(T):T===45?m(T):h(T)}function _(T){const X="CDATA[";return T===X.charCodeAt(o++)?(e.consume(T),o===X.length?S:_):n(T)}function S(T){return T===null?n(T):T===93?(e.consume(T),x):_t(T)?(a=S,Q(T)):(e.consume(T),S)}function x(T){return T===93?(e.consume(T),b):S(T)}function b(T){return T===62?V(T):T===93?(e.consume(T),b):S(T)}function C(T){return T===null||T===62?V(T):_t(T)?(a=C,Q(T)):(e.consume(T),C)}function k(T){return T===null?n(T):T===63?(e.consume(T),A):_t(T)?(a=k,Q(T)):(e.consume(T),k)}function A(T){return T===62?V(T):k(T)}function I(T){return ci(T)?(e.consume(T),$):n(T)}function $(T){return T===45||Qr(T)?(e.consume(T),$):B(T)}function B(T){return _t(T)?(a=B,Q(T)):Ut(T)?(e.consume(T),B):V(T)}function U(T){return T===45||Qr(T)?(e.consume(T),U):T===47||T===62||Sn(T)?G(T):n(T)}function G(T){return T===47?(e.consume(T),V):T===58||T===95||ci(T)?(e.consume(T),P):_t(T)?(a=G,Q(T)):Ut(T)?(e.consume(T),G):V(T)}function P(T){return T===45||T===46||T===58||T===95||Qr(T)?(e.consume(T),P):K(T)}function K(T){return T===61?(e.consume(T),re):_t(T)?(a=K,Q(T)):Ut(T)?(e.consume(T),K):G(T)}function re(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),i=T,ue):_t(T)?(a=re,Q(T)):Ut(T)?(e.consume(T),re):(e.consume(T),Z)}function ue(T){return T===i?(e.consume(T),i=void 0,ie):T===null?n(T):_t(T)?(a=ue,Q(T)):(e.consume(T),ue)}function Z(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||Sn(T)?G(T):(e.consume(T),Z)}function ie(T){return T===47||T===62||Sn(T)?G(T):n(T)}function V(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function Q(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),ye}function ye(T){return Ut(T)?Qt(e,Te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):Te(T)}function Te(T){return e.enter("htmlTextData"),a(T)}}const cb={name:"labelEnd",resolveAll:SF,resolveTo:CF,tokenize:EF},bF={tokenize:kF},xF={tokenize:AF},wF={tokenize:IF};function SF(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&$i(e,0,e.length,n),e}function CF(e,t){let n=e.length,r=0,i,o,a,u;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const c={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},p={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return u=[["enter",c,t],["enter",d,t]],u=Yi(u,e.slice(o+1,o+r+3)),u=Yi(u,[["enter",p,t]]),u=Yi(u,Jh(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),u=Yi(u,[["exit",p,t],e[a-2],e[a-1],["exit",d,t]]),u=Yi(u,e.slice(a+1)),u=Yi(u,[["exit",c,t]]),$i(e,o,e.length,u),e}function EF(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return u;function u(m){return o?o._inactive?h(m):(a=r.parser.defined.includes(go(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),c):n(m)}function c(m){return m===40?e.attempt(bF,p,a?p:h)(m):m===91?e.attempt(xF,p,a?d:h)(m):a?p(m):h(m)}function d(m){return e.attempt(wF,p,h)(m)}function p(m){return t(m)}function h(m){return o._balanced=!0,n(m)}}function kF(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return Sn(h)?ff(e,o)(h):o(h)}function o(h){return h===41?p(h):OI(e,a,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return Sn(h)?ff(e,c)(h):p(h)}function u(h){return n(h)}function c(h){return h===34||h===39||h===40?$I(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):p(h)}function d(h){return Sn(h)?ff(e,p)(h):p(h)}function p(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function AF(e,t,n){const r=this;return i;function i(u){return RI.call(r,e,o,a,"reference","referenceMarker","referenceString")(u)}function o(u){return r.parser.defined.includes(go(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function a(u){return n(u)}}function IF(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const TF={name:"labelStartImage",resolveAll:cb.resolveAll,tokenize:MF};function MF(e,t,n){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),o}function o(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const OF={name:"labelStartLink",resolveAll:cb.resolveAll,tokenize:RF};function RF(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const fb={name:"lineEnding",tokenize:$F};function $F(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Qt(e,t,"linePrefix")}}const ep={name:"thematicBreak",tokenize:DF};function DF(e,t,n){let r=0,i;return o;function o(d){return e.enter("thematicBreak"),a(d)}function a(d){return i=d,u(d)}function u(d){return d===i?(e.enter("thematicBreakSequence"),c(d)):r>=3&&(d===null||_t(d))?(e.exit("thematicBreak"),t(d)):n(d)}function c(d){return d===i?(e.consume(d),r++,c):(e.exit("thematicBreakSequence"),Ut(d)?Qt(e,u,"whitespace")(d):u(d))}}const wi={continuation:{tokenize:PF},exit:zF,name:"list",tokenize:BF},LF={partial:!0,tokenize:UF},NF={partial:!0,tokenize:FF};function BF(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return u;function u(v){const _=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:sb(v)){if(r.containerState.type||(r.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(ep,n,d)(v):d(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(v)}return n(v)}function c(v){return sb(v)&&++a<10?(e.consume(v),c):(!r.interrupt||a<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),d(v)):n(v)}function d(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(uf,r.interrupt?n:p,e.attempt(LF,m,h))}function p(v){return r.containerState.initialBlankLine=!0,o++,m(v)}function h(v){return Ut(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),m):n(v)}function m(v){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function PF(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(uf,i,o);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Qt(e,t,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!Ut(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(NF,t,a)(u))}function a(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Qt(e,e.attempt(wi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function FF(e,t,n){const r=this;return Qt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function zF(e){e.exit(this.containerState.type)}function UF(e,t,n){const r=this;return Qt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Ut(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const LI={name:"setextUnderline",resolveTo:jF,tokenize:qF};function jF(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function qF(e,t,n){const r=this;let i;return o;function o(d){let p=r.events.length,h;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){h=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=d,a(d)):n(d)}function a(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===i?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),Ut(d)?Qt(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||_t(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const HF={tokenize:GF};function GF(e){const t=this,n=e.attempt(uf,r,e.attempt(this.parser.constructs.flowInitial,i,Qt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(KP,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const VF={resolveAll:BI()},ZF=NI("string"),YF=NI("text");function NI(e){return{resolveAll:BI(e==="text"?WF:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,u);return a;function a(p){return d(p)?o(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),c}function c(p){return d(p)?(n.exit("data"),o(p)):(n.consume(p),c)}function d(p){if(p===null)return!0;const h=i[p];let m=-1;if(h)for(;++m<h.length;){const v=h[m];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function BI(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function WF(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,u=0,c;for(;o--;){const d=i[o];if(typeof d=="string"){for(a=d.length;d.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(d===-2)c=!0,u++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const d={type:n===e.length||c||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const KF=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:tF},disable:{null:[]},document:{42:wi,43:wi,45:wi,48:wi,49:wi,50:wi,51:wi,52:wi,53:wi,54:wi,55:wi,56:wi,57:wi,62:EI},flow:{35:sF,42:ep,45:[LI,ep],60:fF,61:LI,95:ep,96:TI,126:TI},flowInitial:{[-2]:ub,[-1]:ub,32:ub},insideSpan:{null:[lb,VF]},string:{38:AI,92:kI},text:{[-5]:fb,[-4]:fb,[-3]:fb,33:TF,38:AI,42:lb,60:[OP,yF],91:OF,92:[oF,kI],93:cb,95:lb,96:HP}},Symbol.toStringTag,{value:"Module"}));function QF(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],u=[];const c={attempt:B(I),check:B($),consume:C,enter:k,exit:A,interrupt:B($,{interrupt:!0})},d={code:null,containerState:{},defineSkip:S,events:[],now:_,parser:e,previous:null,sliceSerialize:m,sliceStream:v,write:h};let p=t.tokenize.call(d,c);return t.resolveAll&&o.push(t),d;function h(K){return a=Yi(a,K),x(),a[a.length-1]!==null?[]:(U(t,0),d.events=Jh(o,d.events,d),d.events)}function m(K,re){return JF(v(K),re)}function v(K){return XF(a,K)}function _(){const{_bufferIndex:K,_index:re,line:ue,column:Z,offset:ie}=r;return{_bufferIndex:K,_index:re,line:ue,column:Z,offset:ie}}function S(K){i[K.line]=K.column,P()}function x(){let K;for(;r._index<a.length;){const re=a[r._index];if(typeof re=="string")for(K=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===K&&r._bufferIndex<re.length;)b(re.charCodeAt(r._bufferIndex));else b(re)}}function b(K){p=p(K)}function C(K){_t(K)?(r.line++,r.column=1,r.offset+=K===-3?2:1,P()):K!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=K}function k(K,re){const ue=re||{};return ue.type=K,ue.start=_(),d.events.push(["enter",ue,d]),u.push(ue),ue}function A(K){const re=u.pop();return re.end=_(),d.events.push(["exit",re,d]),re}function I(K,re){U(K,re.from)}function $(K,re){re.restore()}function B(K,re){return ue;function ue(Z,ie,V){let Q,ye,Te,T;return Array.isArray(Z)?ve(Z):"tokenize"in Z?ve([Z]):X(Z);function X(de){return tt;function tt(Ze){const lt=Ze!==null&&de[Ze],gt=Ze!==null&&de.null,je=[...Array.isArray(lt)?lt:lt?[lt]:[],...Array.isArray(gt)?gt:gt?[gt]:[]];return ve(je)(Ze)}}function ve(de){return Q=de,ye=0,de.length===0?V:L(de[ye])}function L(de){return tt;function tt(Ze){return T=G(),Te=de,de.partial||(d.currentConstruct=de),de.name&&d.parser.constructs.disable.null.includes(de.name)?Ue():de.tokenize.call(re?Object.assign(Object.create(d),re):d,c,we,Ue)(Ze)}}function we(de){return K(Te,T),ie}function Ue(de){return T.restore(),++ye<Q.length?L(Q[ye]):V}}}function U(K,re){K.resolveAll&&!o.includes(K)&&o.push(K),K.resolve&&$i(d.events,re,d.events.length-re,K.resolve(d.events.slice(re),d)),K.resolveTo&&(d.events=K.resolveTo(d.events,d))}function G(){const K=_(),re=d.previous,ue=d.currentConstruct,Z=d.events.length,ie=Array.from(u);return{from:Z,restore:V};function V(){r=K,d.previous=re,d.currentConstruct=ue,d.events.length=Z,u=ie,P()}}function P(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function XF(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const u=a[0];typeof u=="string"?a[0]=u.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function JF(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
52
+ `)).length,i=0;i<r;i++){var a=e.charCodeAt(i),u=null;a<128?n++:u=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),$a(u)||(n>t&&(o+=e.substring(t,n)),o+=u,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},f8=!!Py||!!By,LA="text/plain",Yh=(e,t)=>{var[n,r]=e.split("?"),i=Ee({},t);r==null||r.split("&").forEach(a=>{var[u]=a.split("=");delete i[u]});var o=P9(i);return o=o?(r?r+"&":"")+o:r,"".concat(n,"?").concat(o)},ef=(e,t)=>JSON.stringify(e,(n,r)=>typeof r=="bigint"?r.toString():r,t),q_=e=>{var{data:t,compression:n}=e;if(t){if(n===fo.GZipJS){var r=$k(Dk(ef(t)),{mtime:0}),i=new Blob([r],{type:LA});return{contentType:LA,body:i,estimatedSize:i.size}}if(n===fo.Base64){var o=function(c){var d,p,h,m,v,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",S=0,x=0,b="",C=[];if(!c)return c;c=c8(c);do d=(v=c.charCodeAt(S++)<<16|c.charCodeAt(S++)<<8|c.charCodeAt(S++))>>18&63,p=v>>12&63,h=v>>6&63,m=63&v,C[x++]=_.charAt(d)+_.charAt(p)+_.charAt(h)+_.charAt(m);while(S<c.length);switch(b=C.join(""),c.length%3){case 1:b=b.slice(0,-2)+"==";break;case 2:b=b.slice(0,-1)+"="}return b}(ef(t)),a=(c=>"data="+encodeURIComponent(typeof c=="string"?c:ef(c)))(o);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var u=ef(t);return{contentType:"application/json",body:u,estimatedSize:new Blob([u]).size}}},tf=[];By&&tf.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:i,estimatedSize:o}=(t=q_(e))!==null&&t!==void 0?t:{},a=new Headers;wn(e.headers,function(p,h){a.append(h,p)}),r&&a.append("Content-Type",r);var u=e.url,c=null;if(AE){var d=new AE;c={signal:d.signal,timeout:setTimeout(()=>d.abort(),e.timeout)}}By(u,Ee({method:(e==null?void 0:e.method)||"GET",headers:a,keepalive:e.method==="POST"&&(o||0)<52428.8,body:i,signal:(n=c)===null||n===void 0?void 0:n.signal},e.fetchOptions)).then(p=>p.text().then(h=>{var m,v={statusCode:p.status,text:h};if(p.status===200)try{v.json=JSON.parse(h)}catch(_){pt.error(_)}(m=e.callback)===null||m===void 0||m.call(e,v)})).catch(p=>{var h;pt.error(p),(h=e.callback)===null||h===void 0||h.call(e,{statusCode:0,text:p})}).finally(()=>c?clearTimeout(c.timeout):null)}}),Py&&tf.push({transport:"XHR",method:e=>{var t,n=new Py;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:i}=(t=q_(e))!==null&&t!==void 0?t:{};wn(e.headers,function(o,a){n.setRequestHeader(a,o)}),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=()=>{if(n.readyState===4){var o,a={statusCode:n.status,text:n.responseText};if(n.status===200)try{a.json=JSON.parse(n.responseText)}catch{}(o=e.callback)===null||o===void 0||o.call(e,a)}},n.send(i)}}),Oi!=null&&Oi.sendBeacon&&tf.push({transport:"sendBeacon",method:e=>{var t=Yh(e.url,{beacon:"1"});try{var n,{contentType:r,body:i}=(n=q_(e))!==null&&n!==void 0?n:{},o=typeof i=="string"?new Blob([i],{type:r}):i;Oi.sendBeacon(t,o)}catch{}}});var H_=3e3;class d8{constructor(t,n){Ve(this,"isPaused",!0),Ve(this,"queue",[]),this.flushTimeoutMs=Hi((n==null?void 0:n.flush_interval_ms)||H_,250,5e3,"flush interval",H_),this.sendRequest=t}enqueue(t){this.queue.push(t),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},n=Object.values(t),r=[...n.filter(i=>i.url.indexOf("/e")===0),...n.filter(i=>i.url.indexOf("/e")!==0)];r.map(i=>{this.sendRequest(Ee(Ee({},i),{},{transport:"sendBeacon"}))})}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var t=this;this.isPaused||(this.flushTimeout=setTimeout(()=>{if(this.clearFlushTimeout(),this.queue.length>0){var n=this.formatQueue(),r=function(o){var a=n[o],u=new Date().getTime();a.data&&qn(a.data)&&wn(a.data,c=>{c.offset=Math.abs(c.timestamp-u),delete c.timestamp}),t.sendRequest(a)};for(var i in n)r(i)}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var t={};return wn(this.queue,n=>{var r,i=n,o=(i?i.batchKey:null)||i.url;rt(t[o])&&(t[o]=Ee(Ee({},i),{},{data:[]})),(r=t[o].data)===null||r===void 0||r.push(i.data)}),this.queue=[],t}}var h8=["retriesPerformedSoFar"];class p8{constructor(t){Ve(this,"isPolling",!1),Ve(this,"pollIntervalMs",3e3),Ve(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!rt(be)&&"onLine"in be.navigator&&(this.areWeOnline=be.navigator.onLine,tr(be,"online",()=>{this.areWeOnline=!0,this.flush()}),tr(be,"offline",()=>{this.areWeOnline=!1}))}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=$E(t,h8);li(n)&&n>0&&(r.url=Yh(r.url,{retry_count:n})),this.instance._send_request(Ee(Ee({},r),{},{callback:i=>{var o;i.statusCode!==200&&(i.statusCode<400||i.statusCode>=500)&&(n??0)<10?this.enqueue(Ee({retriesPerformedSoFar:n},r)):(o=r.callback)===null||o===void 0||o.call(r,i)}}))}enqueue(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=function(a){var u=3e3*Math.pow(2,a),c=u/2,d=Math.min(18e5,u),p=(Math.random()-.5)*(d-c);return Math.ceil(d+p)}(n),i=Date.now()+r;this.queue.push({retryAt:i,requestOptions:t});var o="Enqueued failed request for retry in ".concat(r);navigator.onLine||(o+=" (Browser is offline)"),pt.warn(o),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout(()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()},this.pollIntervalMs)}flush(){var t=Date.now(),n=[],r=this.queue.filter(o=>o.retryAt<t||(n.push(o),!1));if(this.queue=n,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(Ee(Ee({},t),{},{transport:"sendBeacon"}))}catch(n){pt.error(n)}this.queue=[]}}class g8{constructor(t){Ve(this,"_updateScrollData",()=>{var n,r,i,o;this.context||(this.context={});var a=this.scrollElement(),u=this.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,d=u+((a==null?void 0:a.clientHeight)||0),p=(a==null?void 0:a.scrollHeight)||0;this.context.lastScrollY=Math.ceil(u),this.context.maxScrollY=Math.max(u,(n=this.context.maxScrollY)!==null&&n!==void 0?n:0),this.context.maxScrollHeight=Math.max(c,(r=this.context.maxScrollHeight)!==null&&r!==void 0?r:0),this.context.lastContentY=d,this.context.maxContentY=Math.max(d,(i=this.context.maxContentY)!==null&&i!==void 0?i:0),this.context.maxContentHeight=Math.max(p,(o=this.context.maxContentHeight)!==null&&o!==void 0?o:0)}),this.instance=t}getContext(){return this.context}resetContext(){var t=this.context;return setTimeout(this._updateScrollData,0),t}startMeasuringScrollPosition(){tr(be,"scroll",this._updateScrollData,{capture:!0}),tr(be,"scrollend",this._updateScrollData,{capture:!0}),tr(be,"resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return be==null?void 0:be.document.documentElement;var t=qn(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var n of t){var r=be==null?void 0:be.document.querySelector(n);if(r)return r}}scrollY(){if(this.instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return be&&(be.scrollY||be.pageYOffset||be.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return be&&(be.scrollX||be.pageXOffset||be.document.documentElement.scrollLeft)||0}}var m8=e=>Dn.personInfo({maskPersonalDataProperties:e==null?void 0:e.config.mask_personal_data_properties,customPersonalDataProperties:e==null?void 0:e.config.custom_personal_data_properties});class v8{constructor(t,n,r,i){Ve(this,"_onSessionIdCallback",o=>{var a=this._getStored();if(!a||a.sessionId!==o){var u={sessionId:o,props:this._sessionSourceParamGenerator(this.instance)};this._persistence.register({[Yy]:u})}}),this.instance=t,this._sessionIdManager=n,this._persistence=r,this._sessionSourceParamGenerator=i||m8,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[Yy]}getSetOnceProps(){var t,n=(t=this._getStored())===null||t===void 0?void 0:t.props;return n?"r"in n?Dn.personPropsFromInfo(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return wn(Bc(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_".concat(zy(r))]=n}),t}}var NA=Zr("[SessionId]");class y8{constructor(t,n,r){var i;if(Ve(this,"_sessionIdChangedHandlers",[]),!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=t.config,this.persistence=t.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||Ba,this._windowIdGenerator=r||Ba;var o=this.config.persistence_name||this.config.token,a=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Hi(a,60,36e3,"session_idle_timeout_seconds",1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var u=Rr.parse(this._window_id_storage_key),c=Rr.parse(this._primary_window_exists_storage_key);u&&!c?this._windowId=u:Rr.remove(this._window_id_storage_key),Rr.set(this._primary_window_exists_storage_key,!0)}if((i=this.config.bootstrap)!==null&&i!==void 0&&i.sessionID)try{var d=(p=>{var h=p.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),d)}catch(p){NA.error("Invalid sessionID in bootstrap",p)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return rt(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(t),this._sessionId&&t(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(n=>n!==t)}}_canUseSessionStorage(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Rr.is_supported()}_setWindowId(t){t!==this._windowId&&(this._windowId=t,this._canUseSessionStorage()&&Rr.set(this._window_id_storage_key,t))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Rr.parse(this._window_id_storage_key):null}_setSessionId(t,n,r){t===this._sessionId&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this._sessionId=t,this.persistence.register({[wh]:[n,t,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var t=this.persistence.props[wh];return qn(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){tr(be,"beforeunload",()=>{this._canUseSessionStorage()&&Rr.remove(this._primary_window_exists_storage_key)},{capture:!1})}checkAndGetSessionAndWindowId(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var r=n||new Date().getTime(),[i,o,a]=this._getSessionId(),u=this._getWindowId(),c=li(a)&&a>0&&Math.abs(r-a)>864e5,d=!1,p=!o,h=!t&&Math.abs(r-i)>this.sessionTimeoutMs;p||h||c?(o=this._sessionIdGenerator(),u=this._windowIdGenerator(),NA.info("new session ID generated",{sessionId:o,windowId:u,changeReason:{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:c}}),a=r,d=!0):u||(u=this._windowIdGenerator(),d=!0);var m=i===0||!t||c?r:i,v=a===0?new Date().getTime():a;return this._setWindowId(u),this._setSessionId(o,m,v),t||this.resetIdleTimer(),d&&this._sessionIdChangedHandlers.forEach(_=>_(o,u,d?{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:c}:void 0)),{sessionId:o,windowId:u,sessionStartTimestamp:v,changeReason:d?{noSessionId:p,activityTimeout:h,sessionPastMaximumLength:c}:void 0,lastActivityTimestamp:i}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var _8=["$set_once","$set"],Ua=Zr("[SiteApps]");class b8{constructor(t){this.instance=t,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(t,n){if(n){var r=this.globalsForEvent(n);this.bufferedInvocations.push(r),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var t,n;return(t=At._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(n=t[this.instance.config.token])===null||n===void 0?void 0:n.siteApps}init(){if(this.isEnabled){var t=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{t(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(t){var n,r,i,o,a,u,c;if(!t)throw new Error("Event payload is required");var d={},p=this.instance.get_property("$groups")||[],h=this.instance.get_property("$stored_group_properties")||{};for(var[m,v]of Object.entries(h))d[m]={id:p[m],type:m,properties:v};var{$set_once:_,$set:S}=t;return{event:Ee(Ee({},$E(t,_8)),{},{properties:Ee(Ee(Ee({},t.properties),S?{$set:Ee(Ee({},(n=(r=t.properties)===null||r===void 0?void 0:r.$set)!==null&&n!==void 0?n:{}),S)}:{}),_?{$set_once:Ee(Ee({},(i=(o=t.properties)===null||o===void 0?void 0:o.$set_once)!==null&&i!==void 0?i:{}),_)}:{}),elements_chain:(a=(u=t.properties)===null||u===void 0?void 0:u.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(c=t.properties)===null||c===void 0?void 0:c.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:d}}setupSiteApp(t){var n=this.apps[t.id],r=()=>{var u;!n.errored&&this.bufferedInvocations.length&&(Ua.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(t.id)),this.bufferedInvocations.forEach(c=>{var d;return(d=n.processEvent)===null||d===void 0?void 0:d.call(n,c)}),n.processedBuffer=!0),Object.values(this.apps).every(c=>c.processedBuffer||c.errored)&&((u=this.stopBuffering)===null||u===void 0||u.call(this))},i=!1,o=u=>{n.errored=!u,n.loaded=!0,Ua.info("Site app with id ".concat(t.id," ").concat(u?"loaded":"errored")),i&&r()};try{var{processEvent:a}=t.init({posthog:this.instance,callback:u=>{o(u)}});a&&(n.processEvent=a),i=!0}catch(u){Ua.error("Error while initializing PostHog app with config id ".concat(t.id),u),o(!1)}if(i&&n.loaded)try{r()}catch(u){Ua.error("Error while processing buffered events PostHog app with config id ".concat(t.id),u),n.errored=!0}}setupSiteApps(){var t=this.siteAppLoaders||[];for(var n of t)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}onCapturedEvent(t){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{var i;(i=r.processEvent)===null||i===void 0||i.call(r,n)}catch(o){Ua.error("Error while processing event ".concat(t.event," for site app ").concat(r.id),o)}}}onRemoteConfig(t){var n,r,i,o=this;if((n=this.siteAppLoaders)!==null&&n!==void 0&&n.length)return this.isEnabled?(this.setupSiteApps(),void this.instance.on("eventCaptured",d=>this.onCapturedEvent(d))):void Ua.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.stopBuffering)===null||r===void 0||r.call(this),(i=t.siteApps)!==null&&i!==void 0&&i.length)if(this.isEnabled){var a=function(d,p){var h,m;At["__$$ph_site_app_".concat(d)]=o.instance,(h=At.__PosthogExtensions__)===null||h===void 0||(m=h.loadSiteApp)===null||m===void 0||m.call(h,o.instance,p,v=>{if(v)return Ua.error("Error while initializing PostHog app with config id ".concat(d),v)})};for(var{id:u,url:c}of t.siteApps)a(u,c)}else Ua.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Zs,x8=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","bytespider"],BA=function(e,t){if(!e)return!1;var n=e.toLowerCase();return x8.concat(t||[]).some(r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1})},PA=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&BA(n,t))return!0;try{var r=e==null?void 0:e.userAgentData;if(r!=null&&r.brands&&r.brands.some(i=>BA(i==null?void 0:i.brand,t)))return!0}catch{}return!!e.webdriver};function FA(e,t,n){return ef({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}(function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"})(Zs||(Zs={}));var zA="i.posthog.com";class w8{constructor(t){Ve(this,"_regionCache",{}),this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get uiHost(){var t,n=(t=this.instance.config.ui_host)===null||t===void 0?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace(".".concat(zA),".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Zs.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Zs.EU:this._regionCache[this.apiHost]=Zs.CUSTOM),this._regionCache[this.apiHost]}endpointFor(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(n&&(n=n[0]==="/"?n:"/".concat(n)),t==="ui")return this.uiHost+n;if(this.region===Zs.CUSTOM)return this.apiHost+n;var r=zA+n;switch(t){case"assets":return"https://".concat(this.region,"-assets.").concat(r);case"api":return"https://".concat(this.region,".").concat(r)}}}var S8={icontains:(e,t)=>!!be&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!be&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!be&&Gl(t.href,e),not_regex:(e,t)=>!!be&&!Gl(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Wr{constructor(t){var n=this;Ve(this,"getWebExperimentsAndEvaluateDisplayLogic",function(){var r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];n.getWebExperiments(i=>{Wr.logInfo("retrieved web experiments from the server"),n._flagToExperiments=new Map,i.forEach(o=>{if(o.feature_flag_key){var a;n._flagToExperiments&&(Wr.logInfo("setting flag key ",o.feature_flag_key," to web experiment ",o),(a=n._flagToExperiments)===null||a===void 0||a.set(o.feature_flag_key,o));var u=n.instance.getFeatureFlag(o.feature_flag_key);lr(u)&&o.variants[u]&&n.applyTransforms(o.name,u,o.variants[u].transforms)}else if(o.variants)for(var c in o.variants){var d=o.variants[c];Wr.matchesTestVariant(d)&&n.applyTransforms(o.name,c,d.transforms)}})},r)}),this.instance=t,this.instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}onFeatureFlags(t){if(this._is_bot())Wr.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(pn(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Wr.logInfo("applying feature flags",t),t.forEach(n=>{var r;if(this._flagToExperiments&&(r=this._flagToExperiments)!==null&&r!==void 0&&r.has(n)){var i,o=this.instance.getFeatureFlag(n),a=(i=this._flagToExperiments)===null||i===void 0?void 0:i.get(n);o&&a!=null&&a.variants[o]&&this.applyTransforms(a.name,o,a.variants[o].transforms)}})}}previewWebExperiment(){var t=Wr.getWindowLocation();if(t!=null&&t.search){var n=Mh(t==null?void 0:t.search,"__experiment_id"),r=Mh(t==null?void 0:t.search,"__experiment_variant");n&&r&&(Wr.logInfo("previewing web experiments ".concat(n," && ").concat(r)),this.getWebExperiments(i=>{this.showPreviewWebExperiment(parseInt(n),r,i)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this.instance.config.disable_web_experiments&&!r)return t([]);var i=this.instance.get_property("$web_experiments");if(i&&!n)return t(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return t([]);var a=o.json.experiments||[];return t(a)}})}showPreviewWebExperiment(t,n,r){var i=r.filter(o=>o.id===t);i&&i.length>0&&(Wr.logInfo("Previewing web experiment [".concat(i[0].name,"] with variant [").concat(n,"]")),this.applyTransforms(i[0].name,n,i[0].variants[n].transforms))}static matchesTestVariant(t){return!pn(t.conditions)&&Wr.matchUrlConditions(t)&&Wr.matchUTMConditions(t)}static matchUrlConditions(t){var n;if(pn(t.conditions)||pn((n=t.conditions)===null||n===void 0?void 0:n.url))return!0;var r,i,o,a=Wr.getWindowLocation();return!!a&&((r=t.conditions)===null||r===void 0||!r.url||S8[(i=(o=t.conditions)===null||o===void 0?void 0:o.urlMatchType)!==null&&i!==void 0?i:"icontains"](t.conditions.url,a))}static getWindowLocation(){return be==null?void 0:be.location}static matchUTMConditions(t){var n;if(pn(t.conditions)||pn((n=t.conditions)===null||n===void 0?void 0:n.utm))return!0;var r=Dn.campaignParams();if(r.utm_source){var i,o,a,u,c,d,p,h,m,v,_,S,x,b,C,k,A=(i=t.conditions)===null||i===void 0||(o=i.utm)===null||o===void 0||!o.utm_campaign||((a=t.conditions)===null||a===void 0||(u=a.utm)===null||u===void 0?void 0:u.utm_campaign)==r.utm_campaign,I=(c=t.conditions)===null||c===void 0||(d=c.utm)===null||d===void 0||!d.utm_source||((p=t.conditions)===null||p===void 0||(h=p.utm)===null||h===void 0?void 0:h.utm_source)==r.utm_source,$=(m=t.conditions)===null||m===void 0||(v=m.utm)===null||v===void 0||!v.utm_medium||((_=t.conditions)===null||_===void 0||(S=_.utm)===null||S===void 0?void 0:S.utm_medium)==r.utm_medium,B=(x=t.conditions)===null||x===void 0||(b=x.utm)===null||b===void 0||!b.utm_term||((C=t.conditions)===null||C===void 0||(k=C.utm)===null||k===void 0?void 0:k.utm_term)==r.utm_term;return A&&$&&B&&I}return!1}static logInfo(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];pt.info("[WebExperiments] ".concat(t),r)}applyTransforms(t,n,r){this._is_bot()?Wr.logInfo("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach(i=>{if(i.selector){var o;Wr.logInfo("applying transform of variant ".concat(n," for experiment ").concat(t," "),i);var a=(o=document)===null||o===void 0?void 0:o.querySelectorAll(i.selector);a==null||a.forEach(u=>{var c=u;i.html&&(c.innerHTML=i.html),i.css&&c.setAttribute("style",i.css)})}}):Wr.logInfo("Control variants leave the page unmodified.")}_is_bot(){return Oi&&this.instance?PA(Oi,this.instance.config.custom_blocked_useragents):void 0}}var nf={},G_=()=>{},Vl="posthog",UA=!f8&&(sr==null?void 0:sr.indexOf("MSIE"))===-1&&(sr==null?void 0:sr.indexOf("Mozilla"))===-1,jA=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:I9(st==null?void 0:st.location),persistence:"localStorage+cookie",persistence_name:"",loaded:G_,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:_i&&lr(_i==null?void 0:_i.search)&&_i.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(be==null||(e=be.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var n="Bad HTTP status: "+t.statusCode+" "+t.text;pt.error(n)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:H_},_onCapture:G_}},qA=e=>{var t={};rt(e.process_person)||(t.person_profiles=e.process_person),rt(e.xhr_headers)||(t.request_headers=e.xhr_headers),rt(e.cookie_name)||(t.persistence_name=e.cookie_name),rt(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),rt(e.store_google)||(t.save_campaign_params=e.store_google),rt(e.verbose)||(t.debug=e.verbose);var n=ur({},t,e);return qn(e.property_blacklist)&&(rt(e.property_denylist)?n.property_denylist=e.property_blacklist:qn(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:pt.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class C8{constructor(){Ve(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(t){pt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Wh{get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){Ve(this,"webPerformance",new C8),Ve(this,"_personProcessingSetOncePropertiesSent",!1),Ve(this,"version",Yo.LIB_VERSION),Ve(this,"_internalEventEmitter",new OA),this.config=jA(),this.SentryIntegration=RB,this.sentryIntegration=t=>function(n,r){var i=Fk(n,r);return{name:Pk,processEvent:o=>i(o)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.featureFlags=new JB(this),this.toolbar=new DB(this),this.scrollManager=new g8(this),this.pageViewManager=new zB(this),this.surveys=new s8(this),this.experiments=new Wr(this),this.exceptions=new UB(this),this.rateLimiter=new l8(this),this.requestRouter=new w8(this),this.consent=new Q9(this),this.people={set:(t,n,r)=>{var i=lr(t)?{[t]:n}:t;this.setPersonProperties(i),r==null||r({})},set_once:(t,n,r)=>{var i=lr(t)?{[t]:n}:t;this.setPersonProperties(void 0,i),r==null||r({})}},this.on("eventCaptured",t=>pt.info('send "'.concat(t==null?void 0:t.event,'"'),t))}init(t,n,r){if(r&&r!==Vl){var i,o=(i=nf[r])!==null&&i!==void 0?i:new Wh;return o._init(t,n,r),nf[r]=o,nf[Vl][r]=o,o}return this._init(t,n,r)}_init(t){var n,r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(rt(t)||Uy(t))return pt.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return pt.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],i.person_profiles&&(this._initialPersonProfilesConfig=i.person_profiles),this.set_config(ur({},jA(),qA(i),{name:o,token:t})),this.config.on_xhr_error&&pt.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:fo.GZipJS,this.persistence=new D_(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new D_(Ee(Ee({},this.config),{},{persistence:"sessionStorage"}));var a=Ee({},this.persistence.props),u=Ee({},this.sessionPersistence.props);if(this._requestQueue=new d8(b=>this._send_retriable_request(b),this.config.request_queue_config),this._retryQueue=new p8(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new y8(this),this.sessionPropsManager=new v8(this,this.sessionManager,this.persistence)),new NB(this).startIfEnabledOrStop(),this.siteApps=new b8(this),(n=this.siteApps)===null||n===void 0||n.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new MB(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new j9(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new FB(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new BB(this),this.exceptionObserver=new eB(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new gk(this,J9),this.deadClicksAutocapture.startIfEnabled(),Yo.DEBUG=Yo.DEBUG||this.config.debug,Yo.DEBUG&&pt.info("Starting in debug mode",{this:this,config:i,thisC:Ee({},this.config),p:a,s:u}),this._sync_opt_out_with_persistence(),((r=i.bootstrap)===null||r===void 0?void 0:r.distinctID)!==void 0){var c,d,p=this.config.get_device_id(Ba()),h=(c=i.bootstrap)!==null&&c!==void 0&&c.isIdentifiedID?p:i.bootstrap.distinctID;this.persistence.set_property(Wo,(d=i.bootstrap)!==null&&d!==void 0&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:h})}if(this._hasBootstrappedFeatureFlags()){var m,v,_=Object.keys(((m=i.bootstrap)===null||m===void 0?void 0:m.featureFlags)||{}).filter(b=>{var C,k;return!((C=i.bootstrap)===null||C===void 0||(k=C.featureFlags)===null||k===void 0||!k[b])}).reduce((b,C)=>{var k,A;return b[C]=((k=i.bootstrap)===null||k===void 0||(A=k.featureFlags)===null||A===void 0?void 0:A[C])||!1,b},{}),S=Object.keys(((v=i.bootstrap)===null||v===void 0?void 0:v.featureFlagPayloads)||{}).filter(b=>_[b]).reduce((b,C)=>{var k,A,I,$;return(k=i.bootstrap)!==null&&k!==void 0&&(A=k.featureFlagPayloads)!==null&&A!==void 0&&A[C]&&(b[C]=(I=i.bootstrap)===null||I===void 0||($=I.featureFlagPayloads)===null||$===void 0?void 0:$[C]),b},{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:S})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:KE,$device_id:null},"");else if(!this.get_distinct_id()){var x=this.config.get_device_id(Ba());this.register_once({distinct_id:x,$device_id:x},""),this.persistence.set_property(Wo,"anonymous")}return tr(be,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),i.segment?OB(this,()=>this._loaded()):this._loaded(),ho(this.config._onCapture)&&this.config._onCapture!==G_&&(pt.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",b=>this.config._onCapture(b.event,b))),this}_onRemoteConfig(t){var n,r,i,o,a,u,c,d;if(!st||!st.body)return pt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this._onRemoteConfig(t)},500);this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=zt(t.supportedCompression,fo.GZipJS)?fo.GZipJS:zt(t.supportedCompression,fo.Base64)?fo.Base64:void 0),(n=t.analytics)!==null&&n!==void 0&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),(r=this.siteApps)===null||r===void 0||r.onRemoteConfig(t),(i=this.sessionRecording)===null||i===void 0||i.onRemoteConfig(t),(o=this.autocapture)===null||o===void 0||o.onRemoteConfig(t),(a=this.heatmaps)===null||a===void 0||a.onRemoteConfig(t),this.surveys.onRemoteConfig(t),(u=this.webVitalsAutocapture)===null||u===void 0||u.onRemoteConfig(t),(c=this.exceptionObserver)===null||c===void 0||c.onRemoteConfig(t),(d=this.deadClicksAutocapture)===null||d===void 0||d.onRemoteConfig(t)}_loaded(){try{this.config.loaded(this)}catch(t){pt.critical("`loaded` function failed",t)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),new u8(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var t;this.has_opted_out_capturing()||this.config.request_batching&&((t=this._requestQueue)===null||t===void 0||t.enable())}_dom_loaded(){this.has_opted_out_capturing()||La(this.__request_queue,t=>this._send_retriable_request(t)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var t,n;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(t=this._requestQueue)===null||t===void 0||t.unload(),(n=this._retryQueue)===null||n===void 0||n.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(UA?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Yh(t.url,{ip:this.config.ip?1:0}),t.headers=Ee({},this.config.request_headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,i,o,a=Ee({},n);a.timeout=a.timeout||6e4,a.url=Yh(a.url,{_:new Date().getTime().toString(),ver:Yo.LIB_VERSION,compression:a.compression});var u=(r=a.transport)!==null&&r!==void 0?r:"fetch",c=(i=(o=LE(tf,d=>d.transport===u))===null||o===void 0?void 0:o.method)!==null&&i!==void 0?i:tf[0].method;if(!c)throw new Error("No available transport method");c(a)})(Ee(Ee({},t),{},{callback:n=>{var r,i,o;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((i=(o=this.config).on_request_error)===null||i===void 0||i.call(o,n)),(r=t.callback)===null||r===void 0||r.call(t,n)}}))))}_send_retriable_request(t){this._retryQueue?this._retryQueue.retriableRequest(t):this._send_request(t)}_execute_array(t){var n,r=[],i=[],o=[];La(t,u=>{u&&(n=u[0],qn(n)?o.push(u):ho(u)?u.call(this):qn(u)&&n==="alias"?r.push(u):qn(u)&&n.indexOf("capture")!==-1&&ho(this[n])?o.push(u):i.push(u))});var a=function(u,c){La(u,function(d){if(qn(d[0])){var p=c;wn(d,function(h){p=p[h[0]].apply(p,h.slice(1))})}else this[d[0]].apply(this,d.slice(1))},c)};a(r,this),a(i,this),a(o,this)}_hasBootstrappedFeatureFlags(){var t,n;return((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags)&&Object.keys((n=this.config.bootstrap)===null||n===void 0?void 0:n.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!rt(t)&&lr(t)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){n!=null&&n.$current_url&&!lr(n==null?void 0:n.$current_url)&&(pt.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,u=(r==null?void 0:r.timestamp)||a,c=Ba(),d={uuid:c,event:t,properties:this._calculate_event_properties(t,n||{},u,c)};o&&(d.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),r!=null&&r.$set&&(d.$set=r==null?void 0:r.$set);var p=this._calculate_set_once_properties(r==null?void 0:r.$set_once);p&&(d.$set_once=p),(d=k9(d,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=u,rt(r==null?void 0:r.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=a);var h=Ee(Ee({},d.properties.$set),d.$set);if(Dl(h)||this.setPersonPropertiesForFlags(h),!pn(this.config.before_send)){var m=this._runBeforeSend(d);if(!m)return;d=m}this._internalEventEmitter.emit("eventCaptured",d);var v={method:"POST",url:(i=r==null?void 0:r._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:d,compression:"best-available",batchKey:r==null?void 0:r._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this._send_retriable_request(v):this._requestQueue.enqueue(v),d}pt.critical("This capture call is ignored due to client rate limiting.")}}else pt.error("No event name provided to posthog.capture")}else pt.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",n=>t(n.event,n))}_calculate_event_properties(t,n,r,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=this.persistence.remove_event_timer(t),a=Ee({},n);if(a.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(a.$cookieless_mode=!0),t==="$snapshot"){var u=Ee(Ee({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!lr(a.distinct_id)&&!li(a.distinct_id)||Uy(a.distinct_id))&&pt.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var c,d=Dn.properties({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});if(this.sessionManager){var{sessionId:p,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId();a.$session_id=p,a.$window_id=h}this.sessionPropsManager&&ur(a,this.sessionPropsManager.getSessionProps());try{var m,v;this.sessionRecording&&(a.$recording_status=this.sessionRecording.status,a.$sdk_debug_replay_internal_buffer_length=this.sessionRecording.buffer.data.length,a.$sdk_debug_replay_internal_buffer_size=this.sessionRecording.buffer.size),a.$sdk_debug_retry_queue_size=(m=this._retryQueue)===null||m===void 0||(v=m.queue)===null||v===void 0?void 0:v.length}catch(b){a.$sdk_debug_error_capturing_properties=String(b)}if(this.requestRouter.region===Zs.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),c=t==="$pageview"?this.pageViewManager.doPageView(r,i):t==="$pageleave"?this.pageViewManager.doPageLeave(r):this.pageViewManager.doEvent(),a=ur(a,c),t==="$pageview"&&st&&(a.title=st.title),!rt(o)){var _=r.getTime()-o;a.$duration=parseFloat((_/1e3).toFixed(3))}sr&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=ur({},d,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),qn(this.config.property_denylist)?wn(this.config.property_denylist,function(b){delete a[b]}):pt.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(pt.error("sanitize_properties is deprecated. Use before_send instead"),a=S(a,t));var x=this._hasPersonProcessing();return a.$process_person_profile=x,x&&this._requirePersonProcessing("_calculate_event_properties"),a}_calculate_set_once_properties(t){var n;if(!this.persistence||!this._hasPersonProcessing()||this._personProcessingSetOncePropertiesSent)return t;var r=this.persistence.get_initial_props(),i=(n=this.sessionPropsManager)===null||n===void 0?void 0:n.getSetOnceProps(),o=ur({},r,i||{},t||{}),a=this.config.sanitize_properties;return a&&(pt.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),this._personProcessingSetOncePropertiesSent=!0,Dl(o)?void 0:o}register(t,n){var r;(r=this.persistence)===null||r===void 0||r.register(t,n)}register_once(t,n,r){var i;(i=this.persistence)===null||i===void 0||i.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)===null||n===void 0||n.register(t)}unregister(t){var n;(n=this.persistence)===null||n===void 0||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(t)}_register_single(t,n){this.register({[t]:n})}getFeatureFlag(t,n){return this.featureFlags.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(t,n){return this.featureFlags.isFeatureEnabled(t,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(t,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,n)}getEarlyAccessFeatures(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=arguments.length>2?arguments[2]:void 0;return this.featureFlags.getEarlyAccessFeatures(t,n,r)}on(t,n){return this._internalEventEmitter.on(t,n)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(t,n)}getActiveMatchingSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(t,n)}renderSurvey(t,n){this.surveys.renderSurvey(t,n)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}identify(t,n,r){if(!this.__loaded||!this.persistence)return pt.uninitializedWarning("posthog.identify");if(li(t)&&(t=t.toString(),pt.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t){if(["distinct_id","distinctid"].includes(t.toLowerCase()))pt.critical('The string "'.concat(t,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var o=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}t!==i&&t!==this.get_property(Pc)&&(this.unregister(Pc),this.register({distinct_id:t}));var a=(this.persistence.get_property(Wo)||"anonymous")==="anonymous";t!==i&&a?(this.persistence.set_property(Wo,"identified"),this.setPersonPropertiesForFlags(Ee(Ee({},r||{}),n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this._cachedPersonProperties=FA(t,n,r),this.featureFlags.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(Eh))}}else pt.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){if((t||n)&&this._requirePersonProcessing("posthog.setPersonProperties")){var r=FA(this.get_distinct_id(),t,n);this._cachedPersonProperties!==r?(this.setPersonPropertiesForFlags(Ee(Ee({},n||{}),t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}),this._cachedPersonProperties=r):pt.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:Ee(Ee({},i),{},{[t]:n})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),i[t]===n||r||this.reloadFeatureFlags()}}else pt.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,n)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var n,r,i,o;if(pt.info("reset"),!this.__loaded)return pt.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)===null||n===void 0||n.clear(),(r=this.sessionPersistence)===null||r===void 0||r.clear(),this.surveys.reset(),(i=this.persistence)===null||i===void 0||i.set_property(Wo,"anonymous"),(o=this.sessionManager)===null||o===void 0||o.resetSessionId(),this._cachedPersonProperties=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:KE,$device_id:null},"");else{var u=this.config.get_device_id(Ba());this.register_once({distinct_id:u,$device_id:t?u:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(n));if(t!=null&&t.withTimestamp&&r){var o,a=(o=t.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return i;var u=Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0);i+="?t=".concat(u)}return i}alias(t,n){return t===this.get_property(NE)?(pt.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(rt(n)&&(n=this.get_distinct_id()),t!==n?(this._register_single(Pc,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(pt.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n,r,i,o,a=Ee({},this.config);Hn(t)&&(ur(this.config,qA(t)),(n=this.persistence)===null||n===void 0||n.update_config(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new D_(Ee(Ee({},this.config),{},{persistence:"sessionStorage"})),_r.is_supported()&&_r.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(Yo.DEBUG=!0,pt.info("set_config",JSON.stringify({config:t,oldConfig:a,newConfig:Ee({},this.config)},null,2))),(r=this.sessionRecording)===null||r===void 0||r.startIfEnabledOrStop(),(i=this.autocapture)===null||i===void 0||i.startIfEnabled(),(o=this.heatmaps)===null||o===void 0||o.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(t){var n=t===!0,r={sampling:n||!(t==null||!t.sampling),linked_flag:n||!(t==null||!t.linked_flag),url_trigger:n||!(t==null||!t.url_trigger),event_trigger:n||!(t==null||!t.event_trigger)};if(Object.values(r).some(Boolean)){var i,o,a,u,c;(i=this.sessionManager)===null||i===void 0||i.checkAndGetSessionAndWindowId(),r.sampling&&((o=this.sessionRecording)===null||o===void 0||o.overrideSampling()),r.linked_flag&&((a=this.sessionRecording)===null||a===void 0||a.overrideLinkedFlag()),r.url_trigger&&((u=this.sessionRecording)===null||u===void 0||u.overrideTrigger("url")),r.event_trigger&&((c=this.sessionRecording)===null||c===void 0||c.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)===null||t===void 0||!t.started)}captureException(t,n){var r=new Error("PostHog syntheticException");this.exceptions.sendExceptionEvent(Ee(Ee({},dB((i=>i instanceof Error)(t)?{error:t,event:t.message}:{event:t},{syntheticException:r})),n))}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:Vl;return n!==Vl&&(n=Vl+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)===null||t===void 0?void 0:t.get_property(Wo))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property(Wo))==="identified"}_hasPersonProcessing(){var t,n,r,i;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Dl(this.getGroups())&&((t=this.persistence)===null||t===void 0||(n=t.props)===null||n===void 0||!n[Pc])&&((r=this.persistence)===null||r===void 0||(i=r.props)===null||i===void 0||!i[kh]))}_shouldCapturePageleave(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(t){return this.config.person_profiles==="never"?(pt.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(kh,!0),!0)}_sync_opt_out_with_persistence(){var t,n,r,i,o=this.consent.isOptedOut(),a=this.config.opt_out_persistence_by_default,u=this.config.disable_persistence||o&&!!a;((t=this.persistence)===null||t===void 0?void 0:t.disabled)!==u&&((r=this.persistence)===null||r===void 0||r.set_disabled(u)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.disabled)!==u&&((i=this.sessionPersistence)===null||i===void 0||i.set_disabled(u))}opt_in_capturing(t){var n;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(rt(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((n=t==null?void 0:t.captureEventName)!==null&&n!==void 0?n:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Oi?PA(Oi,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){st&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:st.title},{send_instantly:!0}))}debug(t){t===!1?(be==null||be.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(be==null||be.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}_runBeforeSend(t){if(pn(this.config.before_send))return t;var n=qn(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of n){if(r=i(r),pn(r)){var o="Event '".concat(t.event,"' was rejected in beforeSend function");return S9(t.event)?pt.warn("".concat(o,". This can cause unexpected behavior.")):pt.info(o),null}r.properties&&!Dl(r.properties)||pt.warn("Event '".concat(t.event,"' has no properties after beforeSend function, this is likely an error."))}return r}getPageViewId(){var t;return(t=this.pageViewManager._currentPageview)===null||t===void 0?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}}(function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=E9(e.prototype[t[n]])})(Wh,["identify"]);var HA,Zi=(HA=nf[Vl]=new Wh,function(){function e(){e.done||(e.done=!0,UA=!1,wn(nf,function(t){t._dom_loaded()}))}st!=null&&st.addEventListener?st.readyState==="complete"?e():tr(st,"DOMContentLoaded",e,{capture:!1}):be&&pt.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),HA),GA=R.createContext({client:Zi});function VA(e,t,n){if(n===void 0&&(n=new WeakMap),e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(n.has(e)&&n.get(e)===t)return!0;n.set(e,t);var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(var o=0,a=r;o<a.length;o++){var u=a[o];if(!i.includes(u)||!VA(e[u],t[u],n))return!1}return!0}function E8(e){var t=e.children,n=e.client,r=e.apiKey,i=e.options,o=R.useState(!1),a=o[0],u=o[1],c=R.useMemo(function(){return n?(r&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),i&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),n):r?a!==!1?(r!==a.previousAPIKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),i&&!VA(i,a.previousOptions)&&Zi.set_config(i),u({previousAPIKey:r,previousOptions:i??{}}),Zi):(Zi.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),Zi.init(r,i),u({previousAPIKey:r,previousOptions:i??{}}),Zi):(console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),Zi)},[n,r,JSON.stringify(i)]);return er.createElement(GA.Provider,{value:{client:c}},t)}var V_=function(){var e=R.useContext(GA).client;return e};function ja(e){var t=V_(),n=R.useState(function(){return t.isFeatureEnabled(e)}),r=n[0],i=n[1];return R.useEffect(function(){return t.onFeatureFlags(function(){i(t.isFeatureEnabled(e))})},[t,e]),r}function Ys(e){var t=V_(),n=R.useState(function(){return t.getFeatureFlagPayload(e)}),r=n[0],i=n[1];return R.useEffect(function(){return t.onFeatureFlags(function(){i(t.getFeatureFlagPayload(e))})},[t,e]),r}function k8(e){var t=V_(),n=R.useState(function(){return t.getFeatureFlag(e)}),r=n[0],i=n[1];return R.useEffect(function(){return t.onFeatureFlags(function(){i(t.getFeatureFlag(e))})},[t,e]),r}var Kh=yE();function Dae(){}function Lae(){}function A8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const I8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,T8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,M8={};function ZA(e,t){return(M8.jsx?T8:I8).test(e)}const O8=/[ \t\n\f\r]/g;function R8(e){return typeof e=="object"?e.type==="text"?YA(e.value):!1:YA(e)}function YA(e){return e.replace(O8,"")===""}class rf{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}rf.prototype.normal={},rf.prototype.property={},rf.prototype.space=void 0;function WA(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new rf(n,r,t)}function Z_(e){return e.toLowerCase()}class xi{constructor(t,n){this.attribute=n,this.property=t}}xi.prototype.attribute="",xi.prototype.booleanish=!1,xi.prototype.boolean=!1,xi.prototype.commaOrSpaceSeparated=!1,xi.prototype.commaSeparated=!1,xi.prototype.defined=!1,xi.prototype.mustUseProperty=!1,xi.prototype.number=!1,xi.prototype.overloadedBoolean=!1,xi.prototype.property="",xi.prototype.spaceSeparated=!1,xi.prototype.space=void 0;let $8=0;const Mt=Ws(),cr=Ws(),KA=Ws(),ze=Ws(),kn=Ws(),Zl=Ws(),Ri=Ws();function Ws(){return 2**++$8}const Y_=Object.freeze(Object.defineProperty({__proto__:null,boolean:Mt,booleanish:cr,commaOrSpaceSeparated:Ri,commaSeparated:Zl,number:ze,overloadedBoolean:KA,spaceSeparated:kn},Symbol.toStringTag,{value:"Module"})),W_=Object.keys(Y_);class K_ extends xi{constructor(t,n,r,i){let o=-1;if(super(t,n),QA(this,"space",i),typeof r=="number")for(;++o<W_.length;){const a=W_[o];QA(this,W_[o],(r&Y_[a])===Y_[a])}}}K_.prototype.defined=!0;function QA(e,t,n){n&&(e[t]=n)}function Yl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new K_(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Z_(r)]=r,n[Z_(o.attribute)]=r}return new rf(t,n,e.space)}const XA=Yl({properties:{ariaActiveDescendant:null,ariaAtomic:cr,ariaAutoComplete:null,ariaBusy:cr,ariaChecked:cr,ariaColCount:ze,ariaColIndex:ze,ariaColSpan:ze,ariaControls:kn,ariaCurrent:null,ariaDescribedBy:kn,ariaDetails:null,ariaDisabled:cr,ariaDropEffect:kn,ariaErrorMessage:null,ariaExpanded:cr,ariaFlowTo:kn,ariaGrabbed:cr,ariaHasPopup:null,ariaHidden:cr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kn,ariaLevel:ze,ariaLive:null,ariaModal:cr,ariaMultiLine:cr,ariaMultiSelectable:cr,ariaOrientation:null,ariaOwns:kn,ariaPlaceholder:null,ariaPosInSet:ze,ariaPressed:cr,ariaReadOnly:cr,ariaRelevant:null,ariaRequired:cr,ariaRoleDescription:kn,ariaRowCount:ze,ariaRowIndex:ze,ariaRowSpan:ze,ariaSelected:cr,ariaSetSize:ze,ariaSort:null,ariaValueMax:ze,ariaValueMin:ze,ariaValueNow:ze,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function JA(e,t){return t in e?e[t]:t}function eI(e,t){return JA(e,t.toLowerCase())}const D8=Yl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zl,acceptCharset:kn,accessKey:kn,action:null,allow:null,allowFullScreen:Mt,allowPaymentRequest:Mt,allowUserMedia:Mt,alt:null,as:null,async:Mt,autoCapitalize:null,autoComplete:kn,autoFocus:Mt,autoPlay:Mt,blocking:kn,capture:null,charSet:null,checked:Mt,cite:null,className:kn,cols:ze,colSpan:null,content:null,contentEditable:cr,controls:Mt,controlsList:kn,coords:ze|Zl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Mt,defer:Mt,dir:null,dirName:null,disabled:Mt,download:KA,draggable:cr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Mt,formTarget:null,headers:kn,height:ze,hidden:Mt,high:ze,href:null,hrefLang:null,htmlFor:kn,httpEquiv:kn,id:null,imageSizes:null,imageSrcSet:null,inert:Mt,inputMode:null,integrity:null,is:null,isMap:Mt,itemId:null,itemProp:kn,itemRef:kn,itemScope:Mt,itemType:kn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Mt,low:ze,manifest:null,max:null,maxLength:ze,media:null,method:null,min:null,minLength:ze,multiple:Mt,muted:Mt,name:null,nonce:null,noModule:Mt,noValidate:Mt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Mt,optimum:ze,pattern:null,ping:kn,placeholder:null,playsInline:Mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Mt,referrerPolicy:null,rel:kn,required:Mt,reversed:Mt,rows:ze,rowSpan:ze,sandbox:kn,scope:null,scoped:Mt,seamless:Mt,selected:Mt,shadowRootClonable:Mt,shadowRootDelegatesFocus:Mt,shadowRootMode:null,shape:null,size:ze,sizes:null,slot:null,span:ze,spellCheck:cr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ze,step:null,style:null,tabIndex:ze,target:null,title:null,translate:null,type:null,typeMustMatch:Mt,useMap:null,value:cr,width:ze,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kn,axis:null,background:null,bgColor:null,border:ze,borderColor:null,bottomMargin:ze,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Mt,declare:Mt,event:null,face:null,frame:null,frameBorder:null,hSpace:ze,leftMargin:ze,link:null,longDesc:null,lowSrc:null,marginHeight:ze,marginWidth:ze,noResize:Mt,noHref:Mt,noShade:Mt,noWrap:Mt,object:null,profile:null,prompt:null,rev:null,rightMargin:ze,rules:null,scheme:null,scrolling:cr,standby:null,summary:null,text:null,topMargin:ze,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ze,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Mt,disableRemotePlayback:Mt,prefix:null,property:null,results:ze,security:null,unselectable:null},space:"html",transform:eI}),L8=Yl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ri,accentHeight:ze,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ze,amplitude:ze,arabicForm:null,ascent:ze,attributeName:null,attributeType:null,azimuth:ze,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ze,by:null,calcMode:null,capHeight:ze,className:kn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ze,diffuseConstant:ze,direction:null,display:null,dur:null,divisor:ze,dominantBaseline:null,download:Mt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ze,enableBackground:null,end:null,event:null,exponent:ze,externalResourcesRequired:null,fill:null,fillOpacity:ze,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Zl,g2:Zl,glyphName:Zl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ze,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ze,horizOriginX:ze,horizOriginY:ze,id:null,ideographic:ze,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ze,k:ze,k1:ze,k2:ze,k3:ze,k4:ze,kernelMatrix:Ri,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ze,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ze,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ze,overlineThickness:ze,paintOrder:null,panose1:null,path:null,pathLength:ze,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ze,pointsAtY:ze,pointsAtZ:ze,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ri,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ri,rev:Ri,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ri,requiredFeatures:Ri,requiredFonts:Ri,requiredFormats:Ri,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ze,specularExponent:ze,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ze,strikethroughThickness:ze,string:null,stroke:null,strokeDashArray:Ri,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ze,strokeOpacity:ze,strokeWidth:null,style:null,surfaceScale:ze,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ri,tabIndex:ze,tableValues:null,target:null,targetX:ze,targetY:ze,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ri,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ze,underlineThickness:ze,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ze,values:null,vAlphabetic:ze,vMathematical:ze,vectorEffect:null,vHanging:ze,vIdeographic:ze,version:null,vertAdvY:ze,vertOriginX:ze,vertOriginY:ze,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ze,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:JA}),tI=Yl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),nI=Yl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:eI}),rI=Yl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),N8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},B8=/[A-Z]/g,iI=/-[a-z]/g,P8=/^data[-\w.:]+$/i;function F8(e,t){const n=Z_(t);let r=t,i=xi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&P8.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(iI,U8);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!iI.test(o)){let a=o.replace(B8,z8);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=K_}return new i(r,t)}function z8(e){return"-"+e.toLowerCase()}function U8(e){return e.charAt(1).toUpperCase()}const j8=WA([XA,D8,tI,nI,rI],"html"),Q_=WA([XA,L8,tI,nI,rI],"svg");function q8(e){return e.join(" ").trim()}var Wl={},X_,oI;function H8(){if(oI)return X_;oI=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,u=/^\s+|\s+$/g,c=`
53
+ `,d="/",p="*",h="",m="comment",v="declaration";X_=function(S,x){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];x=x||{};var b=1,C=1;function k(ue){var Z=ue.match(t);Z&&(b+=Z.length);var ie=ue.lastIndexOf(c);C=~ie?ue.length-ie:C+ue.length}function A(){var ue={line:b,column:C};return function(Z){return Z.position=new I(ue),U(),Z}}function I(ue){this.start=ue,this.end={line:b,column:C},this.source=x.source}I.prototype.content=S;function $(ue){var Z=new Error(x.source+":"+b+":"+C+": "+ue);if(Z.reason=ue,Z.filename=x.source,Z.line=b,Z.column=C,Z.source=S,!x.silent)throw Z}function B(ue){var Z=ue.exec(S);if(Z){var ie=Z[0];return k(ie),S=S.slice(ie.length),Z}}function U(){B(n)}function G(ue){var Z;for(ue=ue||[];Z=P();)Z!==!1&&ue.push(Z);return ue}function P(){var ue=A();if(!(d!=S.charAt(0)||p!=S.charAt(1))){for(var Z=2;h!=S.charAt(Z)&&(p!=S.charAt(Z)||d!=S.charAt(Z+1));)++Z;if(Z+=2,h===S.charAt(Z-1))return $("End of comment missing");var ie=S.slice(2,Z-2);return C+=2,k(ie),S=S.slice(Z),C+=2,ue({type:m,comment:ie})}}function K(){var ue=A(),Z=B(r);if(Z){if(P(),!B(i))return $("property missing ':'");var ie=B(o),V=ue({type:v,property:_(Z[0].replace(e,h)),value:ie?_(ie[0].replace(e,h)):h});return B(a),V}}function re(){var ue=[];G(ue);for(var Z;Z=K();)Z!==!1&&(ue.push(Z),G(ue));return ue}return U(),re()};function _(S){return S?S.replace(u,h):h}return X_}var aI;function G8(){if(aI)return Wl;aI=1;var e=Wl&&Wl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Wl,"__esModule",{value:!0}),Wl.default=n;var t=e(H8());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var a=(0,t.default)(r),u=typeof i=="function";return a.forEach(function(c){if(c.type==="declaration"){var d=c.property,p=c.value;u?i(d,p,c):p&&(o=o||{},o[d]=p)}}),o}return Wl}var of={},sI;function V8(){if(sI)return of;sI=1,Object.defineProperty(of,"__esModule",{value:!0}),of.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(d){return!d||n.test(d)||e.test(d)},a=function(d,p){return p.toUpperCase()},u=function(d,p){return"".concat(p,"-")},c=function(d,p){return p===void 0&&(p={}),o(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(i,u):d=d.replace(r,u),d.replace(t,a))};return of.camelCase=c,of}var af,lI;function Z8(){if(lI)return af;lI=1;var e=af&&af.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(G8()),n=V8();function r(i,o){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(u,c){u&&c&&(a[(0,n.camelCase)(u,o)]=c)}),a}return r.default=r,af=r,af}var Y8=Z8();const W8=qi(Y8),uI=cI("end"),J_=cI("start");function cI(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function K8(e){const t=J_(e),n=uI(e);if(t&&n)return{start:t,end:n}}function sf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?fI(e.position):"start"in e||"end"in e?fI(e):"line"in e||"column"in e?eb(e):""}function eb(e){return dI(e&&e.line)+":"+dI(e&&e.column)}function fI(e){return eb(e&&e.start)+"-"+eb(e&&e.end)}function dI(e){return e&&typeof e=="number"?e:1}class Kr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?o.ruleId=r:(o.source=r.slice(0,c),o.ruleId=r.slice(c+1))}if(!o.place&&o.ancestors&&o.ancestors){const c=o.ancestors[o.ancestors.length-1];c&&(o.place=c.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=u?u.line:void 0,this.name=sf(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Kr.prototype.file="",Kr.prototype.name="",Kr.prototype.reason="",Kr.prototype.message="",Kr.prototype.stack="",Kr.prototype.column=void 0,Kr.prototype.line=void 0,Kr.prototype.ancestors=void 0,Kr.prototype.cause=void 0,Kr.prototype.fatal=void 0,Kr.prototype.place=void 0,Kr.prototype.ruleId=void 0,Kr.prototype.source=void 0;const tb={}.hasOwnProperty,Q8=new Map,X8=/[A-Z]/g,J8=new Set(["table","tbody","thead","tfoot","tr"]),eP=new Set(["td","th"]),hI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function tP(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=uP(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=lP(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Q_:j8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=pI(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function pI(e,t,n){if(t.type==="element")return nP(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return rP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return oP(e,t,n);if(t.type==="mdxjsEsm")return iP(e,t);if(t.type==="root")return aP(e,t,n);if(t.type==="text")return sP(e,t)}function nP(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Q_,e.schema=i),e.ancestors.push(t);const o=mI(e,t.tagName,!1),a=cP(e,t);let u=rb(e,t);return J8.has(t.tagName)&&(u=u.filter(function(c){return typeof c=="string"?!R8(c):!0})),gI(e,a,o,t),nb(a,u),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function rP(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}lf(e,t.position)}function iP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);lf(e,t.position)}function oP(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Q_,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:mI(e,t.name,!0),a=fP(e,t),u=rb(e,t);return gI(e,a,o,t),nb(a,u),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function aP(e,t,n){const r={};return nb(r,rb(e,t)),e.create(t,e.Fragment,r,n)}function sP(e,t){return t.value}function gI(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function nb(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function lP(e,t,n){return r;function r(i,o,a,u){const d=Array.isArray(a.children)?n:t;return u?d(o,a,u):d(o,a)}}function uP(e,t){return n;function n(r,i,o,a){const u=Array.isArray(o.children),c=J_(r);return t(i,o,a,u,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function cP(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&tb.call(t.properties,i)){const o=dP(e,i,t.properties[i]);if(o){const[a,u]=o;e.tableCellAlignToStyle&&a==="align"&&typeof u=="string"&&eP.has(t.tagName)?r=u:n[a]=u}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function fP(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const u=a.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else lf(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else lf(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function rb(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Q8;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const c=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(c){const d=i.get(c)||0;a=c+"-"+d,i.set(c,d+1)}}const u=pI(e,o,a);u!==void 0&&n.push(u)}return n}function dP(e,t,n){const r=F8(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?A8(n):q8(n)),r.property==="style"){let i=typeof n=="object"?n:hP(e,String(n));return e.stylePropertyNameCase==="css"&&(i=pP(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?N8[r.property]||r.property:r.attribute,n]}}function hP(e,t){try{return W8(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Kr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=hI+"#cannot-parse-style-attribute",i}}function mI(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const u=ZA(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:u,computed:!!(o&&u.type==="Literal"),optional:!1}:u}r=a}else r=ZA(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return tb.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);lf(e)}function lf(e,t){const n=new Kr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=hI+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pP(e){const t={};let n;for(n in e)tb.call(e,n)&&(t[gP(n)]=e[n]);return t}function gP(e){let t=e.replace(X8,mP);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function mP(e){return"-"+e.toLowerCase()}const ib={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},vP={};function ob(e,t){const n=vP,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return vI(e,r,i)}function vI(e,t,n){if(yP(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return yI(e.children,t,n)}return Array.isArray(e)?yI(e,t,n):""}function yI(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=vI(e[i],t,n);return r.join("")}function yP(e){return!!(e&&typeof e=="object")}const _I=document.createElement("i");function ab(e){const t="&"+e+";";_I.innerHTML=t;const n=_I.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function $i(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function Yi(e,t){return e.length>0?($i(e,e.length,0,t),e):t}const bI={}.hasOwnProperty;function xI(e){const t={};let n=-1;for(;++n<e.length;)_P(t,e[n]);return t}function _P(e,t){let n;for(n in t){const i=(bI.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){bI.call(i,a)||(i[a]=[]);const u=o[a];bP(i[a],Array.isArray(u)?u:u?[u]:[])}}}function bP(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);$i(e,0,0,r)}function wI(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function go(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ci=qa(/[A-Za-z]/),Qr=qa(/[\dA-Za-z]/),xP=qa(/[#-'*+\--9=?A-Z^-~]/);function Qh(e){return e!==null&&(e<32||e===127)}const sb=qa(/\d/),wP=qa(/[\dA-Fa-f]/),SP=qa(/[!-/:-@[-`{-~]/);function _t(e){return e!==null&&e<-2}function Sn(e){return e!==null&&(e<0||e===32)}function Ut(e){return e===-2||e===-1||e===32}const Xh=qa(new RegExp("\\p{P}|\\p{S}","u")),Ks=qa(/\s/);function qa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Kl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&Qr(e.charCodeAt(n+1))&&Qr(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(a=String.fromCharCode(o,u),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Qt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(c){return Ut(c)?(e.enter(n),u(c)):t(c)}function u(c){return Ut(c)&&o++<i?(e.consume(c),u):(e.exit(n),t(c))}}const CP={tokenize:EP};function EP(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Qt(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),o(u)}function o(u){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,a(u)}function a(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return _t(u)?(e.consume(u),e.exit("chunkText"),o):(e.consume(u),a)}}const kP={tokenize:AP},SI={tokenize:IP};function AP(e){const t=this,n=[];let r=0,i,o,a;return u;function u(k){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,c,d)(k)}return d(k)}function c(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&C();const A=t.events.length;let I=A,$;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){$=t.events[I][1].end;break}b(r);let B=A;for(;B<t.events.length;)t.events[B][1].end={...$},B++;return $i(t.events,I+1,0,t.events.slice(A)),t.events.length=B,d(k)}return u(k)}function d(k){if(r===n.length){if(!i)return m(k);if(i.currentConstruct&&i.currentConstruct.concrete)return _(k);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(SI,p,h)(k)}function p(k){return i&&C(),b(r),m(k)}function h(k){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,_(k)}function m(k){return t.containerState={},e.attempt(SI,v,_)(k)}function v(k){return r++,n.push([t.currentConstruct,t.containerState]),m(k)}function _(k){if(k===null){i&&C(),b(0),e.consume(k);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),S(k)}function S(k){if(k===null){x(e.exit("chunkFlow"),!0),b(0),e.consume(k);return}return _t(k)?(e.consume(k),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(k),S)}function x(k,A){const I=t.sliceStream(k);if(A&&I.push(null),k.previous=o,o&&(o.next=k),o=k,i.defineSkip(k.start),i.write(I),t.parser.lazy[k.start.line]){let $=i.events.length;for(;$--;)if(i.events[$][1].start.offset<a&&(!i.events[$][1].end||i.events[$][1].end.offset>a))return;const B=t.events.length;let U=B,G,P;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(G){P=t.events[U][1].end;break}G=!0}for(b(r),$=B;$<t.events.length;)t.events[$][1].end={...P},$++;$i(t.events,U+1,0,t.events.slice(B)),t.events.length=$}}function b(k){let A=n.length;for(;A-- >k;){const I=n[A];t.containerState=I[1],I[0].exit.call(t,e)}n.length=k}function C(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function IP(e,t,n){return Qt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ql(e){if(e===null||Sn(e)||Ks(e))return 1;if(Xh(e))return 2}function Jh(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const lb={name:"attention",resolveAll:TP,tokenize:MP};function TP(e,t){let n=-1,r,i,o,a,u,c,d,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[n][1].start};CI(h,-c),CI(m,c),a={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},u={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},o={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...a.start},end:{...u.end}},e[r][1].end={...a.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Yi(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Yi(d,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),d=Yi(d,Jh(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Yi(d,[["exit",o,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=Yi(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,$i(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function MP(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ql(r);let o;return a;function a(c){return o=c,e.enter("attentionSequence"),u(c)}function u(c){if(c===o)return e.consume(c),u;const d=e.exit("attentionSequence"),p=Ql(c),h=!p||p===2&&i||n.includes(c),m=!i||i===2&&p||n.includes(r);return d._open=!!(o===42?h:h&&(i||!m)),d._close=!!(o===42?m:m&&(p||!h)),t(c)}}function CI(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const OP={name:"autolink",tokenize:RP};function RP(e,t,n){let r=0;return i;function i(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(v){return ci(v)?(e.consume(v),a):v===64?n(v):d(v)}function a(v){return v===43||v===45||v===46||Qr(v)?(r=1,u(v)):d(v)}function u(v){return v===58?(e.consume(v),r=0,c):(v===43||v===45||v===46||Qr(v))&&r++<32?(e.consume(v),u):(r=0,d(v))}function c(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Qh(v)?n(v):(e.consume(v),c)}function d(v){return v===64?(e.consume(v),p):xP(v)?(e.consume(v),d):n(v)}function p(v){return Qr(v)?h(v):n(v)}function h(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):m(v)}function m(v){if((v===45||Qr(v))&&r++<63){const _=v===45?m:h;return e.consume(v),_}return n(v)}}const uf={partial:!0,tokenize:$P};function $P(e,t,n){return r;function r(o){return Ut(o)?Qt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||_t(o)?t(o):n(o)}}const EI={continuation:{tokenize:LP},exit:NP,name:"blockQuote",tokenize:DP};function DP(e,t,n){const r=this;return i;function i(a){if(a===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Ut(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function LP(e,t,n){const r=this;return i;function i(a){return Ut(a)?Qt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(EI,t,n)(a)}}function NP(e){e.exit("blockQuote")}const kI={name:"characterEscape",tokenize:BP};function BP(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return SP(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const AI={name:"characterReference",tokenize:PP};function PP(e,t,n){const r=this;let i=0,o,a;return u;function u(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,a=Qr,p(h))}function d(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=wP,p):(e.enter("characterReferenceValue"),o=7,a=sb,p(h))}function p(h){if(h===59&&i){const m=e.exit("characterReferenceValue");return a===Qr&&!ab(r.sliceSerialize(m))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<o?(e.consume(h),p):n(h)}}const II={partial:!0,tokenize:zP},TI={concrete:!0,name:"codeFenced",tokenize:FP};function FP(e,t,n){const r=this,i={partial:!0,tokenize:I};let o=0,a=0,u;return c;function c($){return d($)}function d($){const B=r.events[r.events.length-1];return o=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,u=$,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p($)}function p($){return $===u?(a++,e.consume($),p):a<3?n($):(e.exit("codeFencedFenceSequence"),Ut($)?Qt(e,h,"whitespace")($):h($))}function h($){return $===null||_t($)?(e.exit("codeFencedFence"),r.interrupt?t($):e.check(II,S,A)($)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m($))}function m($){return $===null||_t($)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h($)):Ut($)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Qt(e,v,"whitespace")($)):$===96&&$===u?n($):(e.consume($),m)}function v($){return $===null||_t($)?h($):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_($))}function _($){return $===null||_t($)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h($)):$===96&&$===u?n($):(e.consume($),_)}function S($){return e.attempt(i,A,x)($)}function x($){return e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),b}function b($){return o>0&&Ut($)?Qt(e,C,"linePrefix",o+1)($):C($)}function C($){return $===null||_t($)?e.check(II,S,A)($):(e.enter("codeFlowValue"),k($))}function k($){return $===null||_t($)?(e.exit("codeFlowValue"),C($)):(e.consume($),k)}function A($){return e.exit("codeFenced"),t($)}function I($,B,U){let G=0;return P;function P(ie){return $.enter("lineEnding"),$.consume(ie),$.exit("lineEnding"),K}function K(ie){return $.enter("codeFencedFence"),Ut(ie)?Qt($,re,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ie):re(ie)}function re(ie){return ie===u?($.enter("codeFencedFenceSequence"),ue(ie)):U(ie)}function ue(ie){return ie===u?(G++,$.consume(ie),ue):G>=a?($.exit("codeFencedFenceSequence"),Ut(ie)?Qt($,Z,"whitespace")(ie):Z(ie)):U(ie)}function Z(ie){return ie===null||_t(ie)?($.exit("codeFencedFence"),B(ie)):U(ie)}}}function zP(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const ub={name:"codeIndented",tokenize:jP},UP={partial:!0,tokenize:qP};function jP(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Qt(e,o,"linePrefix",5)(d)}function o(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?c(d):_t(d)?e.attempt(UP,a,c)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||_t(d)?(e.exit("codeFlowValue"),a(d)):(e.consume(d),u)}function c(d){return e.exit("codeIndented"),t(d)}}function qP(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):_t(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Qt(e,o,"linePrefix",5)(a)}function o(a){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):_t(a)?i(a):n(a)}}const HP={name:"codeText",previous:VP,resolve:GP,tokenize:ZP};function GP(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function VP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ZP(e,t,n){let r=0,i,o;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),u(h)}function u(h){return h===96?(e.consume(h),r++,u):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(o=e.enter("codeTextSequence"),i=0,p(h)):_t(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||_t(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),d)}function p(h){return h===96?(e.consume(h),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",d(h))}}class YP{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&cf(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),cf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),cf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);cf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);cf(this.left,n.reverse())}}}function cf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function MI(e){const t={};let n=-1,r,i,o,a,u,c,d;const p=new YP(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,o=0,o<c.length&&c[o][1].type==="lineEndingBlank"&&(o+=2),o<c.length&&c[o][1].type==="content"))for(;++o<c.length&&c[o][1].type!=="content";)c[o][1].type==="chunkText"&&(c[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,WP(p,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=p.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},u=p.slice(i,n),u.unshift(r),p.splice(i,n-i+1,u))}}return $i(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function WP(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const u=a.events,c=[],d={};let p,h,m=-1,v=n,_=0,S=0;const x=[S];for(;v;){for(;e.get(++i)[1]!==v;);o.push(i),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),h&&a.defineSkip(v.start),v._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(p),v._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=v,v=v.next}for(v=n;++m<u.length;)u[m][0]==="exit"&&u[m-1][0]==="enter"&&u[m][1].type===u[m-1][1].type&&u[m][1].start.line!==u[m][1].end.line&&(S=m+1,x.push(S),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(a.events=[],v?(v._tokenizer=void 0,v.previous=void 0):x.pop(),m=x.length;m--;){const b=u.slice(x[m],x[m+1]),C=o.pop();c.push([C,C+b.length-1]),e.splice(C,2,b)}for(c.reverse(),m=-1;++m<c.length;)d[_+c[m][0]]=_+c[m][1],_+=c[m][1]-c[m][0]-1;return d}const KP={resolve:XP,tokenize:JP},QP={partial:!0,tokenize:eF};function XP(e){return MI(e),e}function JP(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?o(u):_t(u)?e.check(QP,a,o)(u):(e.consume(u),i)}function o(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function a(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function eF(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Qt(e,o,"linePrefix")}function o(a){if(a===null||_t(a))return n(a);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function OI(e,t,n,r,i,o,a,u,c){const d=c||Number.POSITIVE_INFINITY;let p=0;return h;function h(b){return b===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(b),e.exit(o),m):b===null||b===32||b===41||Qh(b)?n(b):(e.enter(r),e.enter(a),e.enter(u),e.enter("chunkString",{contentType:"string"}),S(b))}function m(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),v(b))}function v(b){return b===62?(e.exit("chunkString"),e.exit(u),m(b)):b===null||b===60||_t(b)?n(b):(e.consume(b),b===92?_:v)}function _(b){return b===60||b===62||b===92?(e.consume(b),v):v(b)}function S(b){return!p&&(b===null||b===41||Sn(b))?(e.exit("chunkString"),e.exit(u),e.exit(a),e.exit(r),t(b)):p<d&&b===40?(e.consume(b),p++,S):b===41?(e.consume(b),p--,S):b===null||b===32||b===40||Qh(b)?n(b):(e.consume(b),b===92?x:S)}function x(b){return b===40||b===41||b===92?(e.consume(b),S):S(b)}}function RI(e,t,n,r,i,o){const a=this;let u=0,c;return d;function d(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(o),p}function p(v){return u>999||v===null||v===91||v===93&&!c||v===94&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(v):v===93?(e.exit(o),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):_t(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||v===91||v===93||_t(v)||u++>999?(e.exit("chunkString"),p(v)):(e.consume(v),c||(c=!Ut(v)),v===92?m:h)}function m(v){return v===91||v===92||v===93?(e.consume(v),u++,h):h(v)}}function $I(e,t,n,r,i,o){let a;return u;function u(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),a=m===40?41:m,c):n(m)}function c(m){return m===a?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(o),d(m))}function d(m){return m===a?(e.exit(o),c(a)):m===null?n(m):_t(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Qt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===a||m===null||_t(m)?(e.exit("chunkString"),d(m)):(e.consume(m),m===92?h:p)}function h(m){return m===a||m===92?(e.consume(m),p):p(m)}}function ff(e,t){let n;return r;function r(i){return _t(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ut(i)?Qt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const tF={name:"definition",tokenize:rF},nF={partial:!0,tokenize:iF};function rF(e,t,n){const r=this;let i;return o;function o(v){return e.enter("definition"),a(v)}function a(v){return RI.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function u(v){return i=go(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),c):n(v)}function c(v){return Sn(v)?ff(e,d)(v):d(v)}function d(v){return OI(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(nF,h,h)(v)}function h(v){return Ut(v)?Qt(e,m,"whitespace")(v):m(v)}function m(v){return v===null||_t(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function iF(e,t,n){return r;function r(u){return Sn(u)?ff(e,i)(u):n(u)}function i(u){return $I(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return Ut(u)?Qt(e,a,"whitespace")(u):a(u)}function a(u){return u===null||_t(u)?t(u):n(u)}}const oF={name:"hardBreakEscape",tokenize:aF};function aF(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return _t(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const sF={name:"headingAtx",resolve:lF,tokenize:uF};function lF(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},$i(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function uF(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),a(p)}function a(p){return p===35&&r++<6?(e.consume(p),a):p===null||Sn(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),c(p)):p===null||_t(p)?(e.exit("atxHeading"),t(p)):Ut(p)?Qt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function c(p){return p===35?(e.consume(p),c):(e.exit("atxHeadingSequence"),u(p))}function d(p){return p===null||p===35||Sn(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),d)}}const cF=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],DI=["pre","script","style","textarea"],fF={concrete:!0,name:"htmlFlow",resolveTo:pF,tokenize:gF},dF={partial:!0,tokenize:vF},hF={partial:!0,tokenize:mF};function pF(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function gF(e,t,n){const r=this;let i,o,a,u,c;return d;function d(L){return p(L)}function p(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),h}function h(L){return L===33?(e.consume(L),m):L===47?(e.consume(L),o=!0,S):L===63?(e.consume(L),i=3,r.interrupt?t:T):ci(L)?(e.consume(L),a=String.fromCharCode(L),x):n(L)}function m(L){return L===45?(e.consume(L),i=2,v):L===91?(e.consume(L),i=5,u=0,_):ci(L)?(e.consume(L),i=4,r.interrupt?t:T):n(L)}function v(L){return L===45?(e.consume(L),r.interrupt?t:T):n(L)}function _(L){const we="CDATA[";return L===we.charCodeAt(u++)?(e.consume(L),u===we.length?r.interrupt?t:re:_):n(L)}function S(L){return ci(L)?(e.consume(L),a=String.fromCharCode(L),x):n(L)}function x(L){if(L===null||L===47||L===62||Sn(L)){const we=L===47,Ue=a.toLowerCase();return!we&&!o&&DI.includes(Ue)?(i=1,r.interrupt?t(L):re(L)):cF.includes(a.toLowerCase())?(i=6,we?(e.consume(L),b):r.interrupt?t(L):re(L)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):o?C(L):k(L))}return L===45||Qr(L)?(e.consume(L),a+=String.fromCharCode(L),x):n(L)}function b(L){return L===62?(e.consume(L),r.interrupt?t:re):n(L)}function C(L){return Ut(L)?(e.consume(L),C):P(L)}function k(L){return L===47?(e.consume(L),P):L===58||L===95||ci(L)?(e.consume(L),A):Ut(L)?(e.consume(L),k):P(L)}function A(L){return L===45||L===46||L===58||L===95||Qr(L)?(e.consume(L),A):I(L)}function I(L){return L===61?(e.consume(L),$):Ut(L)?(e.consume(L),I):k(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),c=L,B):Ut(L)?(e.consume(L),$):U(L)}function B(L){return L===c?(e.consume(L),c=null,G):L===null||_t(L)?n(L):(e.consume(L),B)}function U(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||Sn(L)?I(L):(e.consume(L),U)}function G(L){return L===47||L===62||Ut(L)?k(L):n(L)}function P(L){return L===62?(e.consume(L),K):n(L)}function K(L){return L===null||_t(L)?re(L):Ut(L)?(e.consume(L),K):n(L)}function re(L){return L===45&&i===2?(e.consume(L),V):L===60&&i===1?(e.consume(L),Q):L===62&&i===4?(e.consume(L),X):L===63&&i===3?(e.consume(L),T):L===93&&i===5?(e.consume(L),Te):_t(L)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(dF,ve,ue)(L)):L===null||_t(L)?(e.exit("htmlFlowData"),ue(L)):(e.consume(L),re)}function ue(L){return e.check(hF,Z,ve)(L)}function Z(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),ie}function ie(L){return L===null||_t(L)?ue(L):(e.enter("htmlFlowData"),re(L))}function V(L){return L===45?(e.consume(L),T):re(L)}function Q(L){return L===47?(e.consume(L),a="",ye):re(L)}function ye(L){if(L===62){const we=a.toLowerCase();return DI.includes(we)?(e.consume(L),X):re(L)}return ci(L)&&a.length<8?(e.consume(L),a+=String.fromCharCode(L),ye):re(L)}function Te(L){return L===93?(e.consume(L),T):re(L)}function T(L){return L===62?(e.consume(L),X):L===45&&i===2?(e.consume(L),T):re(L)}function X(L){return L===null||_t(L)?(e.exit("htmlFlowData"),ve(L)):(e.consume(L),X)}function ve(L){return e.exit("htmlFlow"),t(L)}}function mF(e,t,n){const r=this;return i;function i(a){return _t(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function vF(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(uf,t,n)}}const yF={name:"htmlText",tokenize:_F};function _F(e,t,n){const r=this;let i,o,a;return u;function u(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),c}function c(T){return T===33?(e.consume(T),d):T===47?(e.consume(T),I):T===63?(e.consume(T),k):ci(T)?(e.consume(T),U):n(T)}function d(T){return T===45?(e.consume(T),p):T===91?(e.consume(T),o=0,_):ci(T)?(e.consume(T),C):n(T)}function p(T){return T===45?(e.consume(T),v):n(T)}function h(T){return T===null?n(T):T===45?(e.consume(T),m):_t(T)?(a=h,Q(T)):(e.consume(T),h)}function m(T){return T===45?(e.consume(T),v):h(T)}function v(T){return T===62?V(T):T===45?m(T):h(T)}function _(T){const X="CDATA[";return T===X.charCodeAt(o++)?(e.consume(T),o===X.length?S:_):n(T)}function S(T){return T===null?n(T):T===93?(e.consume(T),x):_t(T)?(a=S,Q(T)):(e.consume(T),S)}function x(T){return T===93?(e.consume(T),b):S(T)}function b(T){return T===62?V(T):T===93?(e.consume(T),b):S(T)}function C(T){return T===null||T===62?V(T):_t(T)?(a=C,Q(T)):(e.consume(T),C)}function k(T){return T===null?n(T):T===63?(e.consume(T),A):_t(T)?(a=k,Q(T)):(e.consume(T),k)}function A(T){return T===62?V(T):k(T)}function I(T){return ci(T)?(e.consume(T),$):n(T)}function $(T){return T===45||Qr(T)?(e.consume(T),$):B(T)}function B(T){return _t(T)?(a=B,Q(T)):Ut(T)?(e.consume(T),B):V(T)}function U(T){return T===45||Qr(T)?(e.consume(T),U):T===47||T===62||Sn(T)?G(T):n(T)}function G(T){return T===47?(e.consume(T),V):T===58||T===95||ci(T)?(e.consume(T),P):_t(T)?(a=G,Q(T)):Ut(T)?(e.consume(T),G):V(T)}function P(T){return T===45||T===46||T===58||T===95||Qr(T)?(e.consume(T),P):K(T)}function K(T){return T===61?(e.consume(T),re):_t(T)?(a=K,Q(T)):Ut(T)?(e.consume(T),K):G(T)}function re(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),i=T,ue):_t(T)?(a=re,Q(T)):Ut(T)?(e.consume(T),re):(e.consume(T),Z)}function ue(T){return T===i?(e.consume(T),i=void 0,ie):T===null?n(T):_t(T)?(a=ue,Q(T)):(e.consume(T),ue)}function Z(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||Sn(T)?G(T):(e.consume(T),Z)}function ie(T){return T===47||T===62||Sn(T)?G(T):n(T)}function V(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function Q(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),ye}function ye(T){return Ut(T)?Qt(e,Te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):Te(T)}function Te(T){return e.enter("htmlTextData"),a(T)}}const cb={name:"labelEnd",resolveAll:SF,resolveTo:CF,tokenize:EF},bF={tokenize:kF},xF={tokenize:AF},wF={tokenize:IF};function SF(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&$i(e,0,e.length,n),e}function CF(e,t){let n=e.length,r=0,i,o,a,u;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const c={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},p={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return u=[["enter",c,t],["enter",d,t]],u=Yi(u,e.slice(o+1,o+r+3)),u=Yi(u,[["enter",p,t]]),u=Yi(u,Jh(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),u=Yi(u,[["exit",p,t],e[a-2],e[a-1],["exit",d,t]]),u=Yi(u,e.slice(a+1)),u=Yi(u,[["exit",c,t]]),$i(e,o,e.length,u),e}function EF(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return u;function u(m){return o?o._inactive?h(m):(a=r.parser.defined.includes(go(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),c):n(m)}function c(m){return m===40?e.attempt(bF,p,a?p:h)(m):m===91?e.attempt(xF,p,a?d:h)(m):a?p(m):h(m)}function d(m){return e.attempt(wF,p,h)(m)}function p(m){return t(m)}function h(m){return o._balanced=!0,n(m)}}function kF(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return Sn(h)?ff(e,o)(h):o(h)}function o(h){return h===41?p(h):OI(e,a,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return Sn(h)?ff(e,c)(h):p(h)}function u(h){return n(h)}function c(h){return h===34||h===39||h===40?$I(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):p(h)}function d(h){return Sn(h)?ff(e,p)(h):p(h)}function p(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function AF(e,t,n){const r=this;return i;function i(u){return RI.call(r,e,o,a,"reference","referenceMarker","referenceString")(u)}function o(u){return r.parser.defined.includes(go(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function a(u){return n(u)}}function IF(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const TF={name:"labelStartImage",resolveAll:cb.resolveAll,tokenize:MF};function MF(e,t,n){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),o}function o(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const OF={name:"labelStartLink",resolveAll:cb.resolveAll,tokenize:RF};function RF(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const fb={name:"lineEnding",tokenize:$F};function $F(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Qt(e,t,"linePrefix")}}const ep={name:"thematicBreak",tokenize:DF};function DF(e,t,n){let r=0,i;return o;function o(d){return e.enter("thematicBreak"),a(d)}function a(d){return i=d,u(d)}function u(d){return d===i?(e.enter("thematicBreakSequence"),c(d)):r>=3&&(d===null||_t(d))?(e.exit("thematicBreak"),t(d)):n(d)}function c(d){return d===i?(e.consume(d),r++,c):(e.exit("thematicBreakSequence"),Ut(d)?Qt(e,u,"whitespace")(d):u(d))}}const wi={continuation:{tokenize:PF},exit:zF,name:"list",tokenize:BF},LF={partial:!0,tokenize:UF},NF={partial:!0,tokenize:FF};function BF(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return u;function u(v){const _=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:sb(v)){if(r.containerState.type||(r.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(ep,n,d)(v):d(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(v)}return n(v)}function c(v){return sb(v)&&++a<10?(e.consume(v),c):(!r.interrupt||a<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),d(v)):n(v)}function d(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(uf,r.interrupt?n:p,e.attempt(LF,m,h))}function p(v){return r.containerState.initialBlankLine=!0,o++,m(v)}function h(v){return Ut(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),m):n(v)}function m(v){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function PF(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(uf,i,o);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Qt(e,t,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!Ut(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(NF,t,a)(u))}function a(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Qt(e,e.attempt(wi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function FF(e,t,n){const r=this;return Qt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function zF(e){e.exit(this.containerState.type)}function UF(e,t,n){const r=this;return Qt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Ut(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const LI={name:"setextUnderline",resolveTo:jF,tokenize:qF};function jF(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function qF(e,t,n){const r=this;let i;return o;function o(d){let p=r.events.length,h;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){h=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=d,a(d)):n(d)}function a(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===i?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),Ut(d)?Qt(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||_t(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const HF={tokenize:GF};function GF(e){const t=this,n=e.attempt(uf,r,e.attempt(this.parser.constructs.flowInitial,i,Qt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(KP,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const VF={resolveAll:BI()},ZF=NI("string"),YF=NI("text");function NI(e){return{resolveAll:BI(e==="text"?WF:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,u);return a;function a(p){return d(p)?o(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),c}function c(p){return d(p)?(n.exit("data"),o(p)):(n.consume(p),c)}function d(p){if(p===null)return!0;const h=i[p];let m=-1;if(h)for(;++m<h.length;){const v=h[m];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function BI(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function WF(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,u=0,c;for(;o--;){const d=i[o];if(typeof d=="string"){for(a=d.length;d.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(d===-2)c=!0,u++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const d={type:n===e.length||c||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const KF=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:tF},disable:{null:[]},document:{42:wi,43:wi,45:wi,48:wi,49:wi,50:wi,51:wi,52:wi,53:wi,54:wi,55:wi,56:wi,57:wi,62:EI},flow:{35:sF,42:ep,45:[LI,ep],60:fF,61:LI,95:ep,96:TI,126:TI},flowInitial:{[-2]:ub,[-1]:ub,32:ub},insideSpan:{null:[lb,VF]},string:{38:AI,92:kI},text:{[-5]:fb,[-4]:fb,[-3]:fb,33:TF,38:AI,42:lb,60:[OP,yF],91:OF,92:[oF,kI],93:cb,95:lb,96:HP}},Symbol.toStringTag,{value:"Module"}));function QF(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],u=[];const c={attempt:B(I),check:B($),consume:C,enter:k,exit:A,interrupt:B($,{interrupt:!0})},d={code:null,containerState:{},defineSkip:S,events:[],now:_,parser:e,previous:null,sliceSerialize:m,sliceStream:v,write:h};let p=t.tokenize.call(d,c);return t.resolveAll&&o.push(t),d;function h(K){return a=Yi(a,K),x(),a[a.length-1]!==null?[]:(U(t,0),d.events=Jh(o,d.events,d),d.events)}function m(K,re){return JF(v(K),re)}function v(K){return XF(a,K)}function _(){const{_bufferIndex:K,_index:re,line:ue,column:Z,offset:ie}=r;return{_bufferIndex:K,_index:re,line:ue,column:Z,offset:ie}}function S(K){i[K.line]=K.column,P()}function x(){let K;for(;r._index<a.length;){const re=a[r._index];if(typeof re=="string")for(K=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===K&&r._bufferIndex<re.length;)b(re.charCodeAt(r._bufferIndex));else b(re)}}function b(K){p=p(K)}function C(K){_t(K)?(r.line++,r.column=1,r.offset+=K===-3?2:1,P()):K!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=K}function k(K,re){const ue=re||{};return ue.type=K,ue.start=_(),d.events.push(["enter",ue,d]),u.push(ue),ue}function A(K){const re=u.pop();return re.end=_(),d.events.push(["exit",re,d]),re}function I(K,re){U(K,re.from)}function $(K,re){re.restore()}function B(K,re){return ue;function ue(Z,ie,V){let Q,ye,Te,T;return Array.isArray(Z)?ve(Z):"tokenize"in Z?ve([Z]):X(Z);function X(de){return tt;function tt(Ze){const lt=Ze!==null&&de[Ze],gt=Ze!==null&&de.null,je=[...Array.isArray(lt)?lt:lt?[lt]:[],...Array.isArray(gt)?gt:gt?[gt]:[]];return ve(je)(Ze)}}function ve(de){return Q=de,ye=0,de.length===0?V:L(de[ye])}function L(de){return tt;function tt(Ze){return T=G(),Te=de,de.partial||(d.currentConstruct=de),de.name&&d.parser.constructs.disable.null.includes(de.name)?Ue():de.tokenize.call(re?Object.assign(Object.create(d),re):d,c,we,Ue)(Ze)}}function we(de){return K(Te,T),ie}function Ue(de){return T.restore(),++ye<Q.length?L(Q[ye]):V}}}function U(K,re){K.resolveAll&&!o.includes(K)&&o.push(K),K.resolve&&$i(d.events,re,d.events.length-re,K.resolve(d.events.slice(re),d)),K.resolveTo&&(d.events=K.resolveTo(d.events,d))}function G(){const K=_(),re=d.previous,ue=d.currentConstruct,Z=d.events.length,ie=Array.from(u);return{from:Z,restore:V};function V(){r=K,d.previous=re,d.currentConstruct=ue,d.events.length=Z,u=ie,P()}}function P(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function XF(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const u=a[0];typeof u=="string"?a[0]=u.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function JF(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
54
54
  `;break}case-3:{a=`\r
55
55
  `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function ez(e){const r={constructs:xI([KF,...(e||{}).extensions||[]]),content:i(CP),defined:[],document:i(kP),flow:i(HF),lazy:{},string:i(ZF),text:i(YF)};return r;function i(o){return a;function a(u){return QF(r,o,u)}}}function tz(e){for(;!MI(e););return e}const PI=/[\0\t\n\r]/g;function nz(){let e=1,t="",n=!0,r;return i;function i(o,a,u){const c=[];let d,p,h,m,v;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(PI.lastIndex=h,d=PI.exec(o),m=d&&d.index!==void 0?d.index:o.length,v=o.charCodeAt(m),!d){t=o.slice(h);break}if(v===10&&h===m&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),h<m&&(c.push(o.slice(h,m)),e+=m-h),v){case 0:{c.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,c.push(-2);e++<p;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}h=m+1}return u&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const rz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iz(e){return e.replace(rz,oz)}function oz(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return wI(n.slice(o?2:1),o?16:10)}return ab(n)||e}const FI={}.hasOwnProperty;function az(e,t,n){return typeof t!="string"&&(n=t,t=void 0),sz(n)(tz(ez(n).document().write(nz()(e,t,!0))))}function sz(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(F),autolinkProtocol:G,autolinkEmail:G,atxHeading:o(ot),blockQuote:o(gt),characterEscape:G,characterReference:G,codeFenced:o(je),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(je,a),codeText:o(Se,a),codeTextData:G,data:G,codeFlowValue:G,definition:o(Ye),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Qe),hardBreakEscape:o(et),hardBreakTrailing:o(et),htmlFlow:o(He,a),htmlFlowData:G,htmlText:o(He,a),htmlTextData:G,image:o(N),label:a,link:o(F),listItem:o(ge),listItemValue:m,listOrdered:o(Y,h),listUnordered:o(Y),paragraph:o(_e),reference:L,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(ot),strong:o(Ie),thematicBreak:o(nt)},exit:{atxHeading:c(),atxHeadingSequence:I,autolink:c(),autolinkEmail:lt,autolinkProtocol:Ze,blockQuote:c(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:Ue,characterReferenceMarkerNumeric:Ue,characterReferenceValue:de,characterReference:tt,codeFenced:c(x),codeFencedFence:S,codeFencedFenceInfo:v,codeFencedFenceMeta:_,codeFlowValue:P,codeIndented:c(b),codeText:c(ie),codeTextData:P,data:P,definition:c(),definitionDestinationString:A,definitionLabelString:C,definitionTitleString:k,emphasis:c(),hardBreakEscape:c(re),hardBreakTrailing:c(re),htmlFlow:c(ue),htmlFlowData:P,htmlText:c(Z),htmlTextData:P,image:c(Q),label:Te,labelText:ye,lineEnding:K,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:we,resourceDestinationString:T,resourceTitleString:X,resource:ve,setextHeading:c(U),setextHeadingLineSequence:B,setextHeadingText:$,strong:c(),thematicBreak:c()}};zI(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ne){let me={type:"root",children:[]};const qe={stack:[me],tokenStack:[],config:t,enter:u,exit:d,buffer:a,resume:p,data:n},Xe=[];let at=-1;for(;++at<ne.length;)if(ne[at][1].type==="listOrdered"||ne[at][1].type==="listUnordered")if(ne[at][0]==="enter")Xe.push(at);else{const Tt=Xe.pop();at=i(ne,Tt,at)}for(at=-1;++at<ne.length;){const Tt=t[ne[at][0]];FI.call(Tt,ne[at][1].type)&&Tt[ne[at][1].type].call(Object.assign({sliceSerialize:ne[at][2].sliceSerialize},qe),ne[at][1])}if(qe.tokenStack.length>0){const Tt=qe.tokenStack[qe.tokenStack.length-1];(Tt[1]||UI).call(qe,void 0,Tt[0])}for(me.position={start:Ha(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:Ha(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at<t.transforms.length;)me=t.transforms[at](me)||me;return me}function i(ne,me,qe){let Xe=me-1,at=-1,Tt=!1,Bt,Et,Yt,ft;for(;++Xe<=qe;){const wt=ne[Xe];switch(wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{wt[0]==="enter"?at++:at--,ft=void 0;break}case"lineEndingBlank":{wt[0]==="enter"&&(Bt&&!ft&&!at&&!Yt&&(Yt=Xe),ft=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ft=void 0}if(!at&&wt[0]==="enter"&&wt[1].type==="listItemPrefix"||at===-1&&wt[0]==="exit"&&(wt[1].type==="listUnordered"||wt[1].type==="listOrdered")){if(Bt){let Je=Xe;for(Et=void 0;Je--;){const yt=ne[Je];if(yt[1].type==="lineEnding"||yt[1].type==="lineEndingBlank"){if(yt[0]==="exit")continue;Et&&(ne[Et][1].type="lineEndingBlank",Tt=!0),yt[1].type="lineEnding",Et=Je}else if(!(yt[1].type==="linePrefix"||yt[1].type==="blockQuotePrefix"||yt[1].type==="blockQuotePrefixWhitespace"||yt[1].type==="blockQuoteMarker"||yt[1].type==="listItemIndent"))break}Yt&&(!Et||Yt<Et)&&(Bt._spread=!0),Bt.end=Object.assign({},Et?ne[Et][1].start:wt[1].end),ne.splice(Et||Xe,0,["exit",Bt,wt[2]]),Xe++,qe++}if(wt[1].type==="listItemPrefix"){const Je={type:"listItem",_spread:!1,start:Object.assign({},wt[1].start),end:void 0};Bt=Je,ne.splice(Xe,0,["enter",Je,wt[2]]),Xe++,qe++,Yt=void 0,ft=!0}}}return ne[me][1]._spread=Tt,qe}function o(ne,me){return qe;function qe(Xe){u.call(this,ne(Xe),Xe),me&&me.call(this,Xe)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(ne,me,qe){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([me,qe||void 0]),ne.position={start:Ha(me.start),end:void 0}}function c(ne){return me;function me(qe){ne&&ne.call(this,qe),d.call(this,qe)}}function d(ne,me){const qe=this.stack.pop(),Xe=this.tokenStack.pop();if(Xe)Xe[0].type!==ne.type&&(me?me.call(this,ne,Xe[0]):(Xe[1]||UI).call(this,ne,Xe[0]));else throw new Error("Cannot close `"+ne.type+"` ("+sf({start:ne.start,end:ne.end})+"): it’s not open");qe.position.end=Ha(ne.end)}function p(){return ob(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function m(ne){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.lang=ne}function _(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.meta=ne}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne.replace(/(\r?\n|\r)$/g,"")}function C(ne){const me=this.resume(),qe=this.stack[this.stack.length-1];qe.label=me,qe.identifier=go(this.sliceSerialize(ne)).toLowerCase()}function k(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.title=ne}function A(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.url=ne}function I(ne){const me=this.stack[this.stack.length-1];if(!me.depth){const qe=this.sliceSerialize(ne).length;me.depth=qe}}function $(){this.data.setextHeadingSlurpLineEnding=!0}function B(ne){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function G(ne){const qe=this.stack[this.stack.length-1].children;let Xe=qe[qe.length-1];(!Xe||Xe.type!=="text")&&(Xe=We(),Xe.position={start:Ha(ne.start),end:void 0},qe.push(Xe)),this.stack.push(Xe)}function P(ne){const me=this.stack.pop();me.value+=this.sliceSerialize(ne),me.position.end=Ha(ne.end)}function K(ne){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const qe=me.children[me.children.length-1];qe.position.end=Ha(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(G.call(this,ne),P.call(this,ne))}function re(){this.data.atHardBreak=!0}function ue(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function Z(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function ie(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function V(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=me,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function Q(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=me,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function ye(ne){const me=this.sliceSerialize(ne),qe=this.stack[this.stack.length-2];qe.label=iz(me),qe.identifier=go(me).toLowerCase()}function Te(){const ne=this.stack[this.stack.length-1],me=this.resume(),qe=this.stack[this.stack.length-1];if(this.data.inReference=!0,qe.type==="link"){const Xe=ne.children;qe.children=Xe}else qe.alt=me}function T(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.url=ne}function X(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.title=ne}function ve(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function we(ne){const me=this.resume(),qe=this.stack[this.stack.length-1];qe.label=me,qe.identifier=go(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function Ue(ne){this.data.characterReferenceType=ne.type}function de(ne){const me=this.sliceSerialize(ne),qe=this.data.characterReferenceType;let Xe;qe?(Xe=wI(me,qe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Xe=ab(me);const at=this.stack[this.stack.length-1];at.value+=Xe}function tt(ne){const me=this.stack.pop();me.position.end=Ha(ne.end)}function Ze(ne){P.call(this,ne);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(ne)}function lt(ne){P.call(this,ne);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(ne)}function gt(){return{type:"blockquote",children:[]}}function je(){return{type:"code",lang:null,meta:null,value:""}}function Se(){return{type:"inlineCode",value:""}}function Ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Qe(){return{type:"emphasis",children:[]}}function ot(){return{type:"heading",depth:0,children:[]}}function et(){return{type:"break"}}function He(){return{type:"html",value:""}}function N(){return{type:"image",title:null,url:"",alt:null}}function F(){return{type:"link",title:null,url:"",children:[]}}function Y(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function ge(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function _e(){return{type:"paragraph",children:[]}}function Ie(){return{type:"strong",children:[]}}function We(){return{type:"text",value:""}}function nt(){return{type:"thematicBreak"}}}function Ha(e){return{line:e.line,column:e.column,offset:e.offset}}function zI(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?zI(e,r):lz(e,r)}}function lz(e,t){let n;for(n in t)if(FI.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function UI(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+sf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+sf({start:t.start,end:t.end})+") is still open")}function uz(e){const t=this;t.parser=n;function n(r){return az(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function cz(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function fz(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
56
56
  `}]}function dz(e,t){const n=t.value?t.value+`
@@ -58,7 +58,7 @@ Error generating stack: `+f.message+`
58
58
  `}),p.type==="element"&&p.tagName==="p"&&!i?a.push(...p.children):a.push(p)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
59
59
  `});const d={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,d),e.applyData(t,d)}function Cz(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=qI(n[r])}return t}function qI(e){const t=e.spread;return t??e.children.length>1}function Ez(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function kz(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Az(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Iz(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Tz(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=J_(t.children[1]),c=uI(t.children[t.children.length-1]);u&&c&&(a.position={start:u,end:c}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Mz(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,u=a?a.length:t.children.length;let c=-1;const d=[];for(;++c<u;){const h=t.children[c],m={},v=a?a[c]:void 0;v&&(m.align=v);let _={type:"element",tagName:o,properties:m,children:[]};h&&(_.children=e.all(h),e.patch(h,_),_=e.applyData(h,_)),d.push(_)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function Oz(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const HI=9,GI=32;function Rz(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(VI(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(VI(t.slice(i),i>0,!1)),o.join("")}function VI(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===HI||o===GI;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===HI||o===GI;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function $z(e,t){const n={type:"text",value:Rz(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Dz(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Lz={blockquote:cz,break:fz,code:dz,delete:hz,emphasis:pz,footnoteReference:gz,heading:mz,html:vz,imageReference:yz,image:_z,inlineCode:bz,linkReference:xz,link:wz,listItem:Sz,list:Ez,paragraph:kz,root:Az,strong:Iz,table:Tz,tableCell:Oz,tableRow:Mz,text:$z,thematicBreak:Dz,toml:tp,yaml:tp,definition:tp,footnoteDefinition:tp};function tp(){}const ZI=-1,np=0,df=1,rp=2,db=3,hb=4,pb=5,gb=6,YI=7,WI=8,KI=typeof self=="object"?self:globalThis,Nz=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case np:case ZI:return n(a,i);case df:{const u=n([],i);for(const c of a)u.push(r(c));return u}case rp:{const u=n({},i);for(const[c,d]of a)u[r(c)]=r(d);return u}case db:return n(new Date(a),i);case hb:{const{source:u,flags:c}=a;return n(new RegExp(u,c),i)}case pb:{const u=n(new Map,i);for(const[c,d]of a)u.set(r(c),r(d));return u}case gb:{const u=n(new Set,i);for(const c of a)u.add(r(c));return u}case YI:{const{name:u,message:c}=a;return n(new KI[u](c),i)}case WI:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:u}=new Uint8Array(a);return n(new DataView(u),a)}}return n(new KI[o](a),i)};return r},QI=e=>Nz(new Map,e)(0),Xl="",{toString:Bz}={},{keys:Pz}=Object,hf=e=>{const t=typeof e;if(t!=="object"||!e)return[np,t];const n=Bz.call(e).slice(8,-1);switch(n){case"Array":return[df,Xl];case"Object":return[rp,Xl];case"Date":return[db,Xl];case"RegExp":return[hb,Xl];case"Map":return[pb,Xl];case"Set":return[gb,Xl];case"DataView":return[df,n]}return n.includes("Array")?[df,n]:n.includes("Error")?[YI,n]:[rp,n]},ip=([e,t])=>e===np&&(t==="function"||t==="symbol"),Fz=(e,t,n,r)=>{const i=(a,u)=>{const c=r.push(a)-1;return n.set(u,c),c},o=a=>{if(n.has(a))return n.get(a);let[u,c]=hf(a);switch(u){case np:{let p=a;switch(c){case"bigint":u=WI,p=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return i([ZI],a)}return i([u,p],a)}case df:{if(c){let m=a;return c==="DataView"?m=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(m=new Uint8Array(a)),i([c,[...m]],a)}const p=[],h=i([u,p],a);for(const m of a)p.push(o(m));return h}case rp:{if(c)switch(c){case"BigInt":return i([c,a.toString()],a);case"Boolean":case"Number":case"String":return i([c,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const p=[],h=i([u,p],a);for(const m of Pz(a))(e||!ip(hf(a[m])))&&p.push([o(m),o(a[m])]);return h}case db:return i([u,a.toISOString()],a);case hb:{const{source:p,flags:h}=a;return i([u,{source:p,flags:h}],a)}case pb:{const p=[],h=i([u,p],a);for(const[m,v]of a)(e||!(ip(hf(m))||ip(hf(v))))&&p.push([o(m),o(v)]);return h}case gb:{const p=[],h=i([u,p],a);for(const m of a)(e||!ip(hf(m)))&&p.push(o(m));return h}}const{message:d}=a;return i([u,{name:c,message:d}],a)};return o},XI=(e,{json:t,lossy:n}={})=>{const r=[];return Fz(!(t||n),!!t,new Map,r)(e),r},op=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?QI(XI(e,t)):structuredClone(e):(e,t)=>QI(XI(e,t));function zz(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Uz(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function jz(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||zz,r=e.options.footnoteBackLabel||Uz,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let c=-1;for(;++c<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[c]);if(!d)continue;const p=e.all(d),h=String(d.identifier).toUpperCase(),m=Kl(h.toLowerCase());let v=0;const _=[],S=e.footnoteCounts.get(h);for(;S!==void 0&&++v<=S;){_.length>0&&_.push({type:"text",value:" "});let C=typeof n=="string"?n:n(c,v);typeof C=="string"&&(C={type:"text",value:C}),_.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,v),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const x=p[p.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const C=x.children[x.children.length-1];C&&C.type==="text"?C.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(..._)}else p.push(..._);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(p,!0)};e.patch(d,b),u.push(b)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...op(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
60
60
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
61
- `}]}}const ap=function(e){if(e==null)return Vz;if(typeof e=="function")return sp(e);if(typeof e=="object")return Array.isArray(e)?qz(e):Hz(e);if(typeof e=="string")return Gz(e);throw new Error("Expected function, string, or object as test")};function qz(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ap(e[n]);return sp(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Hz(e){const t=e;return sp(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Gz(e){return sp(t);function t(n){return n&&n.type===e}}function sp(e){return t;function t(n,r,i){return!!(Zz(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Vz(){return!0}function Zz(e){return e!==null&&typeof e=="object"&&"type"in e}function Gae(e){return e}const JI=[],Yz=!0,mb=!1,Wz="skip";function eT(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=ap(i),a=r?-1:1;u(e,void 0,[])();function u(c,d,p){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const v=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(c.type+(v?"<"+v+">":""))+")"})}return m;function m(){let v=JI,_,S,x;if((!t||o(c,d,p[p.length-1]||void 0))&&(v=Kz(n(c,p)),v[0]===mb))return v;if("children"in c&&c.children){const b=c;if(b.children&&v[0]!==Wz)for(S=(r?b.children.length:-1)+a,x=p.concat(b);S>-1&&S<b.children.length;){const C=b.children[S];if(_=u(C,S,x)(),_[0]===mb)return _;S=typeof _[1]=="number"?_[1]:S+a}}return v}}}function Kz(e){return Array.isArray(e)?e:typeof e=="number"?[Yz,e]:e==null?JI:[e]}function vb(e,t,n,r){let i,o,a;typeof t=="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),eT(e,o,u,i);function u(c,d){const p=d[d.length-1],h=p?p.children.indexOf(c):void 0;return a(c,h,p)}}const yb={}.hasOwnProperty,Qz={};function Xz(e,t){const n=t||Qz,r=new Map,i=new Map,o=new Map,a={...Lz,...n.handlers},u={all:d,applyData:eU,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:c,options:n,patch:Jz,wrap:nU};return vb(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const h=p.type==="definition"?r:i,m=String(p.identifier).toUpperCase();h.has(m)||h.set(m,p)}}),u;function c(p,h){const m=p.type,v=u.handlers[m];if(yb.call(u.handlers,m)&&v)return v(u,p,h);if(u.options.passThrough&&u.options.passThrough.includes(m)){if("children"in p){const{children:S,...x}=p,b=op(x);return b.children=u.all(p),b}return op(p)}return(u.options.unknownHandler||tU)(u,p,h)}function d(p){const h=[];if("children"in p){const m=p.children;let v=-1;for(;++v<m.length;){const _=u.one(m[v],p);if(_){if(v&&m[v-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=tT(_.value)),!Array.isArray(_)&&_.type==="element")){const S=_.children[0];S&&S.type==="text"&&(S.value=tT(S.value))}Array.isArray(_)?h.push(..._):h.push(_)}}}return h}}function Jz(e,t){e.position&&(t.position=KB(e))}function eU(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,op(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function tU(e,t){const n=t.data||{},r="value"in t&&!(yb.call(n,"hProperties")||yb.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function nU(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
61
+ `}]}}const ap=function(e){if(e==null)return Vz;if(typeof e=="function")return sp(e);if(typeof e=="object")return Array.isArray(e)?qz(e):Hz(e);if(typeof e=="string")return Gz(e);throw new Error("Expected function, string, or object as test")};function qz(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ap(e[n]);return sp(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Hz(e){const t=e;return sp(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Gz(e){return sp(t);function t(n){return n&&n.type===e}}function sp(e){return t;function t(n,r,i){return!!(Zz(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Vz(){return!0}function Zz(e){return e!==null&&typeof e=="object"&&"type"in e}function Gae(e){return e}const JI=[],Yz=!0,mb=!1,Wz="skip";function eT(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=ap(i),a=r?-1:1;u(e,void 0,[])();function u(c,d,p){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const v=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(c.type+(v?"<"+v+">":""))+")"})}return m;function m(){let v=JI,_,S,x;if((!t||o(c,d,p[p.length-1]||void 0))&&(v=Kz(n(c,p)),v[0]===mb))return v;if("children"in c&&c.children){const b=c;if(b.children&&v[0]!==Wz)for(S=(r?b.children.length:-1)+a,x=p.concat(b);S>-1&&S<b.children.length;){const C=b.children[S];if(_=u(C,S,x)(),_[0]===mb)return _;S=typeof _[1]=="number"?_[1]:S+a}}return v}}}function Kz(e){return Array.isArray(e)?e:typeof e=="number"?[Yz,e]:e==null?JI:[e]}function vb(e,t,n,r){let i,o,a;typeof t=="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),eT(e,o,u,i);function u(c,d){const p=d[d.length-1],h=p?p.children.indexOf(c):void 0;return a(c,h,p)}}const yb={}.hasOwnProperty,Qz={};function Xz(e,t){const n=t||Qz,r=new Map,i=new Map,o=new Map,a={...Lz,...n.handlers},u={all:d,applyData:eU,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:c,options:n,patch:Jz,wrap:nU};return vb(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const h=p.type==="definition"?r:i,m=String(p.identifier).toUpperCase();h.has(m)||h.set(m,p)}}),u;function c(p,h){const m=p.type,v=u.handlers[m];if(yb.call(u.handlers,m)&&v)return v(u,p,h);if(u.options.passThrough&&u.options.passThrough.includes(m)){if("children"in p){const{children:S,...x}=p,b=op(x);return b.children=u.all(p),b}return op(p)}return(u.options.unknownHandler||tU)(u,p,h)}function d(p){const h=[];if("children"in p){const m=p.children;let v=-1;for(;++v<m.length;){const _=u.one(m[v],p);if(_){if(v&&m[v-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=tT(_.value)),!Array.isArray(_)&&_.type==="element")){const S=_.children[0];S&&S.type==="text"&&(S.value=tT(S.value))}Array.isArray(_)?h.push(..._):h.push(_)}}}return h}}function Jz(e,t){e.position&&(t.position=K8(e))}function eU(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,op(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function tU(e,t){const n=t.data||{},r="value"in t&&!(yb.call(n,"hProperties")||yb.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function nU(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
62
62
  `});++r<e.length;)r&&n.push({type:"text",value:`
63
63
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
64
64
  `}),n}function tT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function nT(e,t){const n=Xz(e,t),r=n.one(e,void 0),i=jz(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
@@ -78,7 +78,7 @@ Error generating stack: `+f.message+`
78
78
  `,...o.current()});return/^[\t ]/.test(d)&&(d=gf(d.charCodeAt(0))+d.slice(1)),d=d?a+" "+d:a,n.options.closeAtx&&(d+=" "+a),c(),u(),d}xT.peek=I7;function xT(e){return e.value||""}function I7(){return"<"}wT.peek=T7;function wT(e,t,n,r){const i=$b(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let u=n.enter("label");const c=n.createTracker(r);let d=c.move("![");return d+=c.move(n.safe(e.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(u=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=c.move(" "+i),d+=c.move(n.safe(e.title,{before:d,after:i,...c.current()})),d+=c.move(i),u()),d+=c.move(")"),a(),d}function T7(){return"!"}ST.peek=M7;function ST(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const u=n.createTracker(r);let c=u.move("![");const d=n.safe(e.alt,{before:c,after:"]",...u.current()});c+=u.move(d+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...u.current()});return a(),n.stack=p,o(),i==="full"||!d||d!==h?c+=u.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=u.move("]"),c}function M7(){return"!"}CT.peek=O7;function CT(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const a=n.unsafe[o],u=n.compilePattern(a);let c;if(a.atBreak)for(;c=u.exec(r);){let d=c.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(c.index+1)}}return i+r+i}function O7(){return"`"}function ET(e,t){const n=ob(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}kT.peek=R7;function kT(e,t,n,r){const i=$b(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let u,c;if(ET(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let h=a.move("<");return h+=a.move(n.containerPhrasing(e,{before:h,after:">",...a.current()})),h+=a.move(">"),u(),n.stack=p,h}u=n.enter("link"),c=n.enter("label");let d=a.move("[");return d+=a.move(n.containerPhrasing(e,{before:d,after:"](",...a.current()})),d+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=a.move("<"),d+=a.move(n.safe(e.url,{before:d,after:">",...a.current()})),d+=a.move(">")):(c=n.enter("destinationRaw"),d+=a.move(n.safe(e.url,{before:d,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=a.move(" "+i),d+=a.move(n.safe(e.title,{before:d,after:i,...a.current()})),d+=a.move(i),c()),d+=a.move(")"),u(),d}function R7(e,t,n){return ET(e,n)?"<":"["}AT.peek=$7;function AT(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const u=n.createTracker(r);let c=u.move("[");const d=n.containerPhrasing(e,{before:c,after:"]",...u.current()});c+=u.move(d+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...u.current()});return a(),n.stack=p,o(),i==="full"||!d||d!==h?c+=u.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=u.move("]"),c}function $7(){return"["}function Db(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function D7(e){const t=Db(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function L7(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function IT(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function N7(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?L7(n):Db(n);const u=e.ordered?a==="."?")":".":D7(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),IT(n)===a&&p){let h=-1;for(;++h<e.children.length;){const m=e.children[h];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(a=u),n.bulletCurrent=a;const d=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),d}function B7(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function P7(e,t,n,r){const i=B7(n);let o=n.bulletCurrent||Db(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const u=n.createTracker(r);u.move(o+" ".repeat(a-o.length)),u.shift(a);const c=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),p);return c(),d;function p(h,m,v){return m?(v?"":" ".repeat(a))+h:(v?o:o+" ".repeat(a-o.length))+h}}function F7(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const z7=ap(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function U7(e,t,n,r){return(e.children.some(function(a){return z7(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function j7(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}TT.peek=q7;function TT(e,t,n,r){const i=j7(n),o=n.enter("strong"),a=n.createTracker(r),u=a.move(i+i);let c=a.move(n.containerPhrasing(e,{after:i,before:u,...a.current()}));const d=c.charCodeAt(0),p=up(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(c=gf(d)+c.slice(1));const h=c.charCodeAt(c.length-1),m=up(r.after.charCodeAt(0),h,i);m.inside&&(c=c.slice(0,-1)+gf(h));const v=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:m.outside,before:p.outside},u+c+v}function q7(e,t,n){return n.options.strong||"*"}function H7(e,t,n,r){return n.safe(e.value,r)}function G7(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function V7(e,t,n){const r=(IT(n)+(n.options.ruleSpaces?" ":"")).repeat(G7(n));return n.options.ruleSpaces?r.slice(0,-1):r}const MT={blockquote:g7,break:_T,code:x7,definition:S7,emphasis:bT,hardBreak:_T,heading:A7,html:xT,image:wT,imageReference:ST,inlineCode:CT,link:kT,linkReference:AT,list:N7,listItem:P7,paragraph:F7,root:U7,strong:TT,text:H7,thematicBreak:V7};function Z7(){return{enter:{table:Y7,tableData:OT,tableHeader:OT,tableRow:K7},exit:{codeText:Q7,table:W7,tableData:Lb,tableHeader:Lb,tableRow:Lb}}}function Y7(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function W7(e){this.exit(e),this.data.inTable=void 0}function K7(e){this.enter({type:"tableRow",children:[]},e)}function Lb(e){this.exit(e)}function OT(e){this.enter({type:"tableCell",children:[]},e)}function Q7(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,X7));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function X7(e,t){return t==="|"?t:e}function J7(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
79
79
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:a,tableCell:c,tableRow:u}};function a(v,_,S,x){return d(p(v,S,x),v.align)}function u(v,_,S,x){const b=h(v,S,x),C=d([b]);return C.slice(0,C.indexOf(`
80
80
  `))}function c(v,_,S,x){const b=S.enter("tableCell"),C=S.enter("phrasing"),k=S.containerPhrasing(v,{...x,before:o,after:o});return C(),b(),k}function d(v,_){return h7(v,{align:_,alignDelimiters:r,padding:n,stringLength:i})}function p(v,_,S){const x=v.children;let b=-1;const C=[],k=_.enter("table");for(;++b<x.length;)C[b]=h(x[b],_,S);return k(),C}function h(v,_,S){const x=v.children;let b=-1;const C=[],k=_.enter("tableRow");for(;++b<x.length;)C[b]=c(x[b],v,_,S);return k(),C}function m(v,_,S){let x=MT.inlineCode(v,_,S);return S.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function ej(){return{exit:{taskListCheckValueChecked:RT,taskListCheckValueUnchecked:RT,paragraph:nj}}}function tj(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rj}}}function RT(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function nj(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,a;for(;++o<i.length;){const u=i[o];if(u.type==="paragraph"){a=u;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function rj(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);o&&u.move(a);let c=MT.listItem(e,t,n,{...r,...u.current()});return o&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),c;function d(p){return p+a}}function ij(){return[NU(),r7(),s7(),Z7(),ej()]}function oj(e){return{extensions:[BU(),i7(e),l7(),J7(e),tj()]}}const aj={tokenize:dj,partial:!0},$T={tokenize:hj,partial:!0},DT={tokenize:pj,partial:!0},LT={tokenize:gj,partial:!0},sj={tokenize:mj,partial:!0},NT={name:"wwwAutolink",tokenize:cj,previous:PT},BT={name:"protocolAutolink",tokenize:fj,previous:FT},ea={name:"emailAutolink",tokenize:uj,previous:zT},Io={};function lj(){return{text:Io}}let Qs=48;for(;Qs<123;)Io[Qs]=ea,Qs++,Qs===58?Qs=65:Qs===91&&(Qs=97);Io[43]=ea,Io[45]=ea,Io[46]=ea,Io[95]=ea,Io[72]=[ea,BT],Io[104]=[ea,BT],Io[87]=[ea,NT],Io[119]=[ea,NT];function uj(e,t,n){const r=this;let i,o;return a;function a(h){return!Nb(h)||!zT.call(r,r.previous)||Bb(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(h))}function u(h){return Nb(h)?(e.consume(h),u):h===64?(e.consume(h),c):n(h)}function c(h){return h===46?e.check(sj,p,d)(h):h===45||h===95||Qr(h)?(o=!0,e.consume(h),c):p(h)}function d(h){return e.consume(h),i=!0,c}function p(h){return o&&i&&ci(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function cj(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!PT.call(r,r.previous)||Bb(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(aj,e.attempt($T,e.attempt(DT,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function fj(e,t,n){const r=this;let i="",o=!1;return a;function a(h){return(h===72||h===104)&&FT.call(r,r.previous)&&!Bb(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),u):n(h)}function u(h){if(ci(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),u;if(h===58){const m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(h),c}return n(h)}function c(h){return h===47?(e.consume(h),o?d:(o=!0,c)):n(h)}function d(h){return h===null||Qh(h)||Sn(h)||Ks(h)||Xh(h)?n(h):e.attempt($T,e.attempt(DT,p),n)(h)}function p(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function dj(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function hj(e,t,n){let r,i,o;return a;function a(d){return d===46||d===95?e.check(LT,c,u)(d):d===null||Sn(d)||Ks(d)||d!==45&&Xh(d)?c(d):(o=!0,e.consume(d),a)}function u(d){return d===95?r=!0:(i=r,r=void 0),e.consume(d),a}function c(d){return i||r||!o?n(d):t(d)}}function pj(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(LT,t,o)(a):a===null||Sn(a)||Ks(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function gj(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),o):u===93?(e.consume(u),i):u===60||u===null||Sn(u)||Ks(u)?t(u):n(u)}function i(u){return u===null||u===40||u===91||Sn(u)||Ks(u)?t(u):r(u)}function o(u){return ci(u)?a(u):n(u)}function a(u){return u===59?(e.consume(u),r):ci(u)?(e.consume(u),a):n(u)}}function mj(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Qr(o)?n(o):t(o)}}function PT(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Sn(e)}function FT(e){return!ci(e)}function zT(e){return!(e===47||Nb(e))}function Nb(e){return e===43||e===45||e===46||e===95||Qr(e)}function Bb(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const vj={tokenize:Ej,partial:!0};function yj(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:wj,continuation:{tokenize:Sj},exit:Cj}},text:{91:{name:"gfmFootnoteCall",tokenize:xj},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_j,resolveTo:bj}}}}function _j(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return u;function u(c){if(!a||!a._balanced)return n(c);const d=go(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function bj(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function xj(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return u;function u(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(h){if(o>999||h===93&&!a||h===null||h===91||Sn(h))return n(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(go(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Sn(h)||(a=!0),o++,e.consume(h),h===92?p:d}function p(h){return h===91||h===92||h===93?(e.consume(h),o++,d):d(h)}}function wj(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,u;return c;function c(_){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(_){return _===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(_)}function p(_){if(a>999||_===93&&!u||_===null||_===91||Sn(_))return n(_);if(_===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return o=go(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Sn(_)||(u=!0),a++,e.consume(_),_===92?h:p}function h(_){return _===91||_===92||_===93?(e.consume(_),a++,p):p(_)}function m(_){return _===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),i.includes(o)||i.push(o),Qt(e,v,"gfmFootnoteDefinitionWhitespace")):n(_)}function v(_){return t(_)}}function Sj(e,t,n){return e.check(uf,t,e.attempt(vj,t,n))}function Cj(e){e.exit("gfmFootnoteDefinition")}function Ej(e,t,n){const r=this;return Qt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function kj(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,u){let c=-1;for(;++c<a.length;)if(a[c][0]==="enter"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._close){let d=c;for(;d--;)if(a[d][0]==="exit"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._open&&a[c][1].end.offset-a[c][1].start.offset===a[d][1].end.offset-a[d][1].start.offset){a[c][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[c][1].end)},h={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[c][1].start)},m=[["enter",p,u],["enter",a[d][1],u],["exit",a[d][1],u],["enter",h,u]],v=u.parser.constructs.insideSpan.null;v&&$i(m,m.length,0,Jh(v,a.slice(d+1,c),u)),$i(m,m.length,0,[["exit",h,u],["enter",a[c][1],u],["exit",a[c][1],u],["exit",p,u]]),$i(a,d-1,c-d+3,m),c=d+m.length-2;break}}for(c=-1;++c<a.length;)a[c][1].type==="strikethroughSequenceTemporary"&&(a[c][1].type="data");return a}function o(a,u,c){const d=this.previous,p=this.events;let h=0;return m;function m(_){return d===126&&p[p.length-1][1].type!=="characterEscape"?c(_):(a.enter("strikethroughSequenceTemporary"),v(_))}function v(_){const S=Ql(d);if(_===126)return h>1?c(_):(a.consume(_),h++,v);if(h<2&&!n)return c(_);const x=a.exit("strikethroughSequenceTemporary"),b=Ql(_);return x._open=!b||b===2&&!!S,x._close=!S||S===2&&!!b,u(_)}}}class Aj{constructor(){this.map=[]}add(t,n,r){Ij(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function Ij(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Tj(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Mj(){return{flow:{null:{name:"table",tokenize:Oj,resolveAll:Rj}}}}function Oj(e,t,n){const r=this;let i=0,o=0,a;return u;function u(P){let K=r.events.length-1;for(;K>-1;){const Z=r.events[K][1].type;if(Z==="lineEnding"||Z==="linePrefix")K--;else break}const re=K>-1?r.events[K][1].type:null,ue=re==="tableHead"||re==="tableRow"?$:c;return ue===$&&r.parser.lazy[r.now().line]?n(P):ue(P)}function c(P){return e.enter("tableHead"),e.enter("tableRow"),d(P)}function d(P){return P===124||(a=!0,o+=1),p(P)}function p(P){return P===null?n(P):_t(P)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),v):n(P):Ut(P)?Qt(e,p,"whitespace")(P):(o+=1,a&&(a=!1,i+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),a=!0,p):(e.enter("data"),h(P)))}function h(P){return P===null||P===124||Sn(P)?(e.exit("data"),p(P)):(e.consume(P),P===92?m:h)}function m(P){return P===92||P===124?(e.consume(P),h):h(P)}function v(P){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(P):(e.enter("tableDelimiterRow"),a=!1,Ut(P)?Qt(e,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):_(P))}function _(P){return P===45||P===58?x(P):P===124?(a=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),S):I(P)}function S(P){return Ut(P)?Qt(e,x,"whitespace")(P):x(P)}function x(P){return P===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),b):P===45?(o+=1,b(P)):P===null||_t(P)?A(P):I(P)}function b(P){return P===45?(e.enter("tableDelimiterFiller"),C(P)):I(P)}function C(P){return P===45?(e.consume(P),C):P===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(P))}function k(P){return Ut(P)?Qt(e,A,"whitespace")(P):A(P)}function A(P){return P===124?_(P):P===null||_t(P)?!a||i!==o?I(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):I(P)}function I(P){return n(P)}function $(P){return e.enter("tableRow"),B(P)}function B(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),B):P===null||_t(P)?(e.exit("tableRow"),t(P)):Ut(P)?Qt(e,B,"whitespace")(P):(e.enter("data"),U(P))}function U(P){return P===null||P===124||Sn(P)?(e.exit("data"),B(P)):(e.consume(P),P===92?G:U)}function G(P){return P===92||P===124?(e.consume(P),U):U(P)}}function Rj(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],u=!1,c=0,d,p,h;const m=new Aj;for(;++n<e.length;){const v=e[n],_=v[1];v[0]==="enter"?_.type==="tableHead"?(u=!1,c!==0&&(UT(m,t,c,d,p),p=void 0,c=0),d={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},m.add(n,0,[["enter",d,t]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,p={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},m.add(n,0,[["enter",p,t]])),i=_.type==="tableDelimiterRow"?2:p?3:1):i&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],h=cp(m,t,o,i,void 0,h),o=[0,0,0,0]),a[2]=n)):_.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],h=cp(m,t,o,i,void 0,h)),o=a,a=[o[1],n,0,0])):_.type==="tableHead"?(u=!0,c=n):_.type==="tableRow"||_.type==="tableDelimiterRow"?(c=n,o[1]!==0?(a[0]=a[1],h=cp(m,t,o,i,n,h)):a[1]!==0&&(h=cp(m,t,a,i,n,h)),i=0):i&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(a[3]=n)}for(c!==0&&UT(m,t,c,d,p),m.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=Tj(t.events,n))}return e}function cp(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(o.end=Object.assign({},Jl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const c=Jl(t.events,n[1]);if(o={type:a,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=Jl(t.events,n[2]),p=Jl(t.events,n[3]),h={type:u,start:Object.assign({},d),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const m=t.events[n[2]],v=t.events[n[3]];if(m[1].end=Object.assign({},v[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const _=n[2]+1,S=n[3]-n[2]-1;e.add(_,S,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(o.end=Object.assign({},Jl(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function UT(e,t,n,r,i){const o=[],a=Jl(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function Jl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const $j={name:"tasklistCheck",tokenize:Lj};function Dj(){return{text:{91:$j}}}function Lj(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),o)}function o(c){return Sn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(c)}function u(c){return _t(c)?t(c):Ut(c)?e.check({tokenize:Nj},t,n)(c):n(c)}}function Nj(e,t,n){return Qt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Bj(e){return xI([lj(),yj(),kj(e),Mj(),Dj()])}const Pj={};function fp(e){const t=this,n=e||Pj,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Bj(n)),o.push(ij()),a.push(oj(n))}var Er=function(){return Er=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Er.apply(this,arguments)};function eu(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Pb,jT;function Fj(){return jT||(jT=1,Pb=function(t,n,r,i){var o=r?r.call(i,t,n):void 0;if(o!==void 0)return!!o;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var a=Object.keys(t),u=Object.keys(n);if(a.length!==u.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(n),d=0;d<a.length;d++){var p=a[d];if(!c(p))return!1;var h=t[p],m=n[p];if(o=r?r.call(i,h,m,p):void 0,o===!1||o===void 0&&h!==m)return!1}return!0}),Pb}var zj=Fj();const Uj=qi(zj);var Mn="-ms-",mf="-moz-",cn="-webkit-",qT="comm",dp="rule",Fb="decl",jj="@import",HT="@keyframes",qj="@layer",GT=Math.abs,zb=String.fromCharCode,Ub=Object.assign;function Hj(e,t){return kr(e,0)^45?(((t<<2^kr(e,0))<<2^kr(e,1))<<2^kr(e,2))<<2^kr(e,3):0}function VT(e){return e.trim()}function ta(e,t){return(e=t.exec(e))?e[0]:e}function Dt(e,t,n){return e.replace(t,n)}function hp(e,t,n){return e.indexOf(t,n)}function kr(e,t){return e.charCodeAt(t)|0}function tu(e,t,n){return e.slice(t,n)}function To(e){return e.length}function ZT(e){return e.length}function vf(e,t){return t.push(e),e}function Gj(e,t){return e.map(t).join("")}function YT(e,t){return e.filter(function(n){return!ta(n,t)})}var pp=1,nu=1,WT=0,Wi=0,fr=0,ru="";function gp(e,t,n,r,i,o,a,u){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:pp,column:nu,length:a,return:"",siblings:u}}function Va(e,t){return Ub(gp("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function iu(e){for(;e.root;)e=Va(e.root,{children:[e]});vf(e,e.siblings)}function Vj(){return fr}function Zj(){return fr=Wi>0?kr(ru,--Wi):0,nu--,fr===10&&(nu=1,pp--),fr}function mo(){return fr=Wi<WT?kr(ru,Wi++):0,nu++,fr===10&&(nu=1,pp++),fr}function Xs(){return kr(ru,Wi)}function mp(){return Wi}function vp(e,t){return tu(ru,e,t)}function jb(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Yj(e){return pp=nu=1,WT=To(ru=e),Wi=0,[]}function Wj(e){return ru="",e}function qb(e){return VT(vp(Wi-1,Hb(e===91?e+2:e===40?e+1:e)))}function Kj(e){for(;(fr=Xs())&&fr<33;)mo();return jb(e)>2||jb(fr)>3?"":" "}function Qj(e,t){for(;--t&&mo()&&!(fr<48||fr>102||fr>57&&fr<65||fr>70&&fr<97););return vp(e,mp()+(t<6&&Xs()==32&&mo()==32))}function Hb(e){for(;mo();)switch(fr){case e:return Wi;case 34:case 39:e!==34&&e!==39&&Hb(fr);break;case 40:e===41&&Hb(e);break;case 92:mo();break}return Wi}function Xj(e,t){for(;mo()&&e+fr!==57;)if(e+fr===84&&Xs()===47)break;return"/*"+vp(t,Wi-1)+"*"+zb(e===47?e:mo())}function Jj(e){for(;!jb(Xs());)mo();return vp(e,Wi)}function eq(e){return Wj(yp("",null,null,null,[""],e=Yj(e),0,[0],e))}function yp(e,t,n,r,i,o,a,u,c){for(var d=0,p=0,h=a,m=0,v=0,_=0,S=1,x=1,b=1,C=0,k="",A=i,I=o,$=r,B=k;x;)switch(_=C,C=mo()){case 40:if(_!=108&&kr(B,h-1)==58){hp(B+=Dt(qb(C),"&","&\f"),"&\f",GT(d?u[d-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:B+=qb(C);break;case 9:case 10:case 13:case 32:B+=Kj(_);break;case 92:B+=Qj(mp()-1,7);continue;case 47:switch(Xs()){case 42:case 47:vf(tq(Xj(mo(),mp()),t,n,c),c);break;default:B+="/"}break;case 123*S:u[d++]=To(B)*b;case 125*S:case 59:case 0:switch(C){case 0:case 125:x=0;case 59+p:b==-1&&(B=Dt(B,/\f/g,"")),v>0&&To(B)-h&&vf(v>32?QT(B+";",r,n,h-1,c):QT(Dt(B," ","")+";",r,n,h-2,c),c);break;case 59:B+=";";default:if(vf($=KT(B,t,n,d,p,i,u,k,A=[],I=[],h,o),o),C===123)if(p===0)yp(B,t,$,$,A,o,h,u,I);else switch(m===99&&kr(B,3)===110?100:m){case 100:case 108:case 109:case 115:yp(e,$,$,r&&vf(KT(e,$,$,0,0,i,u,k,i,A=[],h,I),I),i,I,h,u,r?A:I);break;default:yp(B,$,$,$,[""],I,0,u,I)}}d=p=v=0,S=b=1,k=B="",h=a;break;case 58:h=1+To(B),v=_;default:if(S<1){if(C==123)--S;else if(C==125&&S++==0&&Zj()==125)continue}switch(B+=zb(C),C*S){case 38:b=p>0?1:(B+="\f",-1);break;case 44:u[d++]=(To(B)-1)*b,b=1;break;case 64:Xs()===45&&(B+=qb(mo())),m=Xs(),p=h=To(k=B+=Jj(mp())),C++;break;case 45:_===45&&To(B)==2&&(S=0)}}return o}function KT(e,t,n,r,i,o,a,u,c,d,p,h){for(var m=i-1,v=i===0?o:[""],_=ZT(v),S=0,x=0,b=0;S<r;++S)for(var C=0,k=tu(e,m+1,m=GT(x=a[S])),A=e;C<_;++C)(A=VT(x>0?v[C]+" "+k:Dt(k,/&\f/g,v[C])))&&(c[b++]=A);return gp(e,t,n,i===0?dp:u,c,d,p,h)}function tq(e,t,n,r){return gp(e,t,n,qT,zb(Vj()),tu(e,2,-2),0,r)}function QT(e,t,n,r,i){return gp(e,t,n,Fb,tu(e,0,r),tu(e,r+1,-1),r,i)}function XT(e,t,n){switch(Hj(e,t)){case 5103:return cn+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return cn+e+e;case 4789:return mf+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return cn+e+mf+e+Mn+e+e;case 5936:switch(kr(e,t+11)){case 114:return cn+e+Mn+Dt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return cn+e+Mn+Dt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return cn+e+Mn+Dt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return cn+e+Mn+e+e;case 6165:return cn+e+Mn+"flex-"+e+e;case 5187:return cn+e+Dt(e,/(\w+).+(:[^]+)/,cn+"box-$1$2"+Mn+"flex-$1$2")+e;case 5443:return cn+e+Mn+"flex-item-"+Dt(e,/flex-|-self/g,"")+(ta(e,/flex-|baseline/)?"":Mn+"grid-row-"+Dt(e,/flex-|-self/g,""))+e;case 4675:return cn+e+Mn+"flex-line-pack"+Dt(e,/align-content|flex-|-self/g,"")+e;case 5548:return cn+e+Mn+Dt(e,"shrink","negative")+e;case 5292:return cn+e+Mn+Dt(e,"basis","preferred-size")+e;case 6060:return cn+"box-"+Dt(e,"-grow","")+cn+e+Mn+Dt(e,"grow","positive")+e;case 4554:return cn+Dt(e,/([^-])(transform)/g,"$1"+cn+"$2")+e;case 6187:return Dt(Dt(Dt(e,/(zoom-|grab)/,cn+"$1"),/(image-set)/,cn+"$1"),e,"")+e;case 5495:case 3959:return Dt(e,/(image-set\([^]*)/,cn+"$1$`$1");case 4968:return Dt(Dt(e,/(.+:)(flex-)?(.*)/,cn+"box-pack:$3"+Mn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+cn+e+e;case 4200:if(!ta(e,/flex-|baseline/))return Mn+"grid-column-align"+tu(e,t)+e;break;case 2592:case 3360:return Mn+Dt(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,ta(r.props,/grid-\w+-end/)})?~hp(e+(n=n[t].value),"span",0)?e:Mn+Dt(e,"-start","")+e+Mn+"grid-row-span:"+(~hp(n,"span",0)?ta(n,/\d+/):+ta(n,/\d+/)-+ta(e,/\d+/))+";":Mn+Dt(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return ta(r.props,/grid-\w+-start/)})?e:Mn+Dt(Dt(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Dt(e,/(.+)-inline(.+)/,cn+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(To(e)-1-t>6)switch(kr(e,t+1)){case 109:if(kr(e,t+4)!==45)break;case 102:return Dt(e,/(.+:)(.+)-([^]+)/,"$1"+cn+"$2-$3$1"+mf+(kr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~hp(e,"stretch",0)?XT(Dt(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Dt(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,u,c,d){return Mn+i+":"+o+d+(a?Mn+i+"-span:"+(u?c:+c-+o)+d:"")+e});case 4949:if(kr(e,t+6)===121)return Dt(e,":",":"+cn)+e;break;case 6444:switch(kr(e,kr(e,14)===45?18:11)){case 120:return Dt(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+cn+(kr(e,14)===45?"inline-":"")+"box$3$1"+cn+"$2$3$1"+Mn+"$2box$3")+e;case 100:return Dt(e,":",":"+Mn)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Dt(e,"scroll-","scroll-snap-")+e}return e}function _p(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function nq(e,t,n,r){switch(e.type){case qj:if(e.children.length)break;case jj:case Fb:return e.return=e.return||e.value;case qT:return"";case HT:return e.return=e.value+"{"+_p(e.children,r)+"}";case dp:if(!To(e.value=e.props.join(",")))return""}return To(n=_p(e.children,r))?e.return=e.value+"{"+n+"}":""}function rq(e){var t=ZT(e);return function(n,r,i,o){for(var a="",u=0;u<t;u++)a+=e[u](n,r,i,o)||"";return a}}function iq(e){return function(t){t.root||(t=t.return)&&e(t)}}function oq(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Fb:e.return=XT(e.value,e.length,n);return;case HT:return _p([Va(e,{value:Dt(e.value,"@","@"+cn)})],r);case dp:if(e.length)return Gj(n=e.props,function(i){switch(ta(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":iu(Va(e,{props:[Dt(i,/:(read-\w+)/,":"+mf+"$1")]})),iu(Va(e,{props:[i]})),Ub(e,{props:YT(n,r)});break;case"::placeholder":iu(Va(e,{props:[Dt(i,/:(plac\w+)/,":"+cn+"input-$1")]})),iu(Va(e,{props:[Dt(i,/:(plac\w+)/,":"+mf+"$1")]})),iu(Va(e,{props:[Dt(i,/:(plac\w+)/,Mn+"input-$1")]})),iu(Va(e,{props:[i]})),Ub(e,{props:YT(n,r)});break}return""})}}var aq={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Xr={NODE_ENV:"production"},ou=typeof process<"u"&&Xr!==void 0&&(Xr.REACT_APP_SC_ATTR||Xr.SC_ATTR)||"data-styled",JT="active",eM="data-styled-version",bp="6.1.17",Gb=`/*!sc*/
81
- `,xp=typeof window<"u"&&"HTMLElement"in window,sq=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Xr!==void 0&&Xr.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Xr.REACT_APP_SC_DISABLE_SPEEDY!==""?Xr.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Xr.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Xr!==void 0&&Xr.SC_DISABLE_SPEEDY!==void 0&&Xr.SC_DISABLE_SPEEDY!==""?Xr.SC_DISABLE_SPEEDY!=="false"&&Xr.SC_DISABLE_SPEEDY:Xr.NODE_ENV!=="production"),lq={},wp=Object.freeze([]),au=Object.freeze({});function tM(e,t,n){return n===void 0&&(n=au),e.theme!==n.theme&&e.theme||t||n.theme}var nM=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),uq=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,cq=/(^-|-$)/g;function rM(e){return e.replace(uq,"-").replace(cq,"")}var fq=/(a)(d)/gi,Sp=52,iM=function(e){return String.fromCharCode(e+(e>25?39:97))};function Vb(e){var t,n="";for(t=Math.abs(e);t>Sp;t=t/Sp|0)n=iM(t%Sp)+n;return(iM(t%Sp)+n).replace(fq,"$1-$2")}var Zb,oM=5381,su=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},aM=function(e){return su(oM,e)};function Yb(e){return Vb(aM(e)>>>0)}function dq(e){return e.displayName||e.name||"Component"}function Wb(e){return typeof e=="string"&&Xr.NODE_ENV==="production"}var sM=typeof Symbol=="function"&&Symbol.for,lM=sM?Symbol.for("react.memo"):60115,hq=sM?Symbol.for("react.forward_ref"):60112,pq={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},gq={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},uM={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},mq=((Zb={})[hq]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Zb[lM]=uM,Zb);function cM(e){return("type"in(t=e)&&t.type.$$typeof)===lM?uM:"$$typeof"in e?mq[e.$$typeof]:pq;var t}var vq=Object.defineProperty,yq=Object.getOwnPropertyNames,fM=Object.getOwnPropertySymbols,_q=Object.getOwnPropertyDescriptor,bq=Object.getPrototypeOf,dM=Object.prototype;function hM(e,t,n){if(typeof t!="string"){if(dM){var r=bq(t);r&&r!==dM&&hM(e,r,n)}var i=yq(t);fM&&(i=i.concat(fM(t)));for(var o=cM(e),a=cM(t),u=0;u<i.length;++u){var c=i[u];if(!(c in gq||n&&n[c]||a&&c in a||o&&c in o)){var d=_q(t,c);try{vq(e,c,d)}catch{}}}}return e}function Js(e){return typeof e=="function"}function Kb(e){return typeof e=="object"&&"styledComponentId"in e}function el(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function Cp(e,t){if(e.length===0)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function yf(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Qb(e,t,n){if(n===void 0&&(n=!1),!n&&!yf(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Qb(e[r],t[r]);else if(yf(t))for(var r in t)e[r]=Qb(e[r],t[r]);return e}function Xb(e,t){Object.defineProperty(e,"toString",{value:t})}function tl(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var xq=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r<t;r++)n+=this.groupSizes[r];return n},e.prototype.insertRules=function(t,n){if(t>=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,o=i;t>=o;)if((o<<=1)<0)throw tl(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=i;a<o;a++)this.groupSizes[a]=0}for(var u=this.indexOfGroup(t+1),c=(a=0,n.length);a<c;a++)this.tag.insertRule(u,n[a])&&(this.groupSizes[t]++,u++)},e.prototype.clearGroup=function(t){if(t<this.length){var n=this.groupSizes[t],r=this.indexOfGroup(t),i=r+n;this.groupSizes[t]=0;for(var o=r;o<i;o++)this.tag.deleteRule(r)}},e.prototype.getGroup=function(t){var n="";if(t>=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),o=i+r,a=i;a<o;a++)n+="".concat(this.tag.getRule(a)).concat(Gb);return n},e}(),Ep=new Map,kp=new Map,Ap=1,Ip=function(e){if(Ep.has(e))return Ep.get(e);for(;kp.has(Ap);)Ap++;var t=Ap++;return Ep.set(e,t),kp.set(t,e),t},wq=function(e,t){Ap=t+1,Ep.set(e,t),kp.set(t,e)},Sq="style[".concat(ou,"][").concat(eM,'="').concat(bp,'"]'),Cq=new RegExp("^".concat(ou,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Eq=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o<a;o++)(r=i[o])&&e.registerName(t,r)},kq=function(e,t){for(var n,r=((n=t.textContent)!==null&&n!==void 0?n:"").split(Gb),i=[],o=0,a=r.length;o<a;o++){var u=r[o].trim();if(u){var c=u.match(Cq);if(c){var d=0|parseInt(c[1],10),p=c[2];d!==0&&(wq(p,d),Eq(e,p,c[3]),e.getTag().insertRules(d,i)),i.length=0}else i.push(u)}}},pM=function(e){for(var t=document.querySelectorAll(Sq),n=0,r=t.length;n<r;n++){var i=t[n];i&&i.getAttribute(ou)!==JT&&(kq(e,i),i.parentNode&&i.parentNode.removeChild(i))}};function Aq(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var gM=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(u){var c=Array.from(u.querySelectorAll("style[".concat(ou,"]")));return c[c.length-1]}(n),o=i!==void 0?i.nextSibling:null;r.setAttribute(ou,JT),r.setAttribute(eM,bp);var a=Aq();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},Iq=function(){function e(t){this.element=gM(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(n){if(n.sheet)return n.sheet;for(var r=document.styleSheets,i=0,o=r.length;i<o;i++){var a=r[i];if(a.ownerNode===n)return a}throw tl(17)}(this.element),this.length=0}return e.prototype.insertRule=function(t,n){try{return this.sheet.insertRule(n,t),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.prototype.getRule=function(t){var n=this.sheet.cssRules[t];return n&&n.cssText?n.cssText:""},e}(),Tq=function(){function e(t){this.element=gM(t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(t,n){if(t<=this.length&&t>=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e}(),Mq=function(){function e(t){this.rules=[],this.length=0}return e.prototype.insertRule=function(t,n){return t<=this.length&&(this.rules.splice(t,0,n),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e}(),mM=xp,Oq={isServer:!xp,useCSSOMInjection:!sq},Tp=function(){function e(t,n,r){t===void 0&&(t=au),n===void 0&&(n={});var i=this;this.options=Er(Er({},Oq),t),this.gs=n,this.names=new Map(r),this.server=!!t.isServer,!this.server&&xp&&mM&&(mM=!1,pM(this)),Xb(this,function(){return function(o){for(var a=o.getTag(),u=a.length,c="",d=function(h){var m=function(b){return kp.get(b)}(h);if(m===void 0)return"continue";var v=o.names.get(m),_=a.getGroup(h);if(v===void 0||!v.size||_.length===0)return"continue";var S="".concat(ou,".g").concat(h,'[id="').concat(m,'"]'),x="";v!==void 0&&v.forEach(function(b){b.length>0&&(x+="".concat(b,","))}),c+="".concat(_).concat(S,'{content:"').concat(x,'"}').concat(Gb)},p=0;p<u;p++)d(p);return c}(i)})}return e.registerId=function(t){return Ip(t)},e.prototype.rehydrate=function(){!this.server&&xp&&pM(this)},e.prototype.reconstructWithOptions=function(t,n){return n===void 0&&(n=!0),new e(Er(Er({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=function(n){var r=n.useCSSOMInjection,i=n.target;return n.isServer?new Mq(i):r?new Iq(i):new Tq(i)}(this.options),new xq(t)));var t},e.prototype.hasNameForId=function(t,n){return this.names.has(t)&&this.names.get(t).has(n)},e.prototype.registerName=function(t,n){if(Ip(t),this.names.has(t))this.names.get(t).add(n);else{var r=new Set;r.add(n),this.names.set(t,r)}},e.prototype.insertRules=function(t,n,r){this.registerName(t,n),this.getTag().insertRules(Ip(t),r)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(Ip(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Rq=/&/g,$q=/^\s*\/\/.*$/gm;function vM(e,t){return e.map(function(n){return n.type==="rule"&&(n.value="".concat(t," ").concat(n.value),n.value=n.value.replaceAll(",",",".concat(t," ")),n.props=n.props.map(function(r){return"".concat(t," ").concat(r)})),Array.isArray(n.children)&&n.type!=="@keyframes"&&(n.children=vM(n.children,t)),n})}function yM(e){var t,n,r,i=e===void 0?au:e,o=i.options,a=o===void 0?au:o,u=i.plugins,c=u===void 0?wp:u,d=function(m,v,_){return _.startsWith(n)&&_.endsWith(n)&&_.replaceAll(n,"").length>0?".".concat(t):m},p=c.slice();p.push(function(m){m.type===dp&&m.value.includes("&")&&(m.props[0]=m.props[0].replace(Rq,n).replace(r,d))}),a.prefix&&p.push(oq),p.push(nq);var h=function(m,v,_,S){v===void 0&&(v=""),_===void 0&&(_=""),S===void 0&&(S="&"),t=S,n=v,r=new RegExp("\\".concat(n,"\\b"),"g");var x=m.replace($q,""),b=eq(_||v?"".concat(_," ").concat(v," { ").concat(x," }"):x);a.namespace&&(b=vM(b,a.namespace));var C=[];return _p(b,rq(p.concat(iq(function(k){return C.push(k)})))),C};return h.hash=c.length?c.reduce(function(m,v){return v.name||tl(15),su(m,v.name)},oM).toString():"",h}var Dq=new Tp,Jb=yM(),e1=er.createContext({shouldForwardProp:void 0,styleSheet:Dq,stylis:Jb});e1.Consumer;var Lq=er.createContext(void 0);function Mp(){return R.useContext(e1)}function Nq(e){var t=R.useState(e.stylisPlugins),n=t[0],r=t[1],i=Mp().styleSheet,o=R.useMemo(function(){var c=i;return e.sheet?c=e.sheet:e.target&&(c=c.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(c=c.reconstructWithOptions({useCSSOMInjection:!1})),c},[e.disableCSSOMInjection,e.sheet,e.target,i]),a=R.useMemo(function(){return yM({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})},[e.enableVendorPrefixes,e.namespace,n]);R.useEffect(function(){Uj(n,e.stylisPlugins)||r(e.stylisPlugins)},[e.stylisPlugins]);var u=R.useMemo(function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:o,stylis:a}},[e.shouldForwardProp,o,a]);return er.createElement(e1.Provider,{value:u},er.createElement(Lq.Provider,{value:a},e.children))}var _M=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=Jb);var a=r.name+o.hash;i.hasNameForId(r.id,a)||i.insertRules(r.id,a,o(r.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,Xb(this,function(){throw tl(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Jb),this.name+t.hash},e}(),Bq=function(e){return e>="A"&&e<="Z"};function bM(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(n===1&&r==="-"&&e[0]==="-")return e;Bq(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var xM=function(e){return e==null||e===!1||e===""},wM=function(e){var t,n,r=[];for(var i in e){var o=e[i];e.hasOwnProperty(i)&&!xM(o)&&(Array.isArray(o)&&o.isCss||Js(o)?r.push("".concat(bM(i),":"),o,";"):yf(o)?r.push.apply(r,eu(eu(["".concat(i," {")],wM(o),!1),["}"],!1)):r.push("".concat(bM(i),": ").concat((t=i,(n=o)==null||typeof n=="boolean"||n===""?"":typeof n!="number"||n===0||t in aq||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Za(e,t,n,r){if(xM(e))return[];if(Kb(e))return[".".concat(e.styledComponentId)];if(Js(e)){if(!Js(o=e)||o.prototype&&o.prototype.isReactComponent||!t)return[e];var i=e(t);return Za(i,t,n,r)}var o;return e instanceof _M?n?(e.inject(n,r),[e.getName(r)]):[e]:yf(e)?wM(e):Array.isArray(e)?Array.prototype.concat.apply(wp,e.map(function(a){return Za(a,t,n,r)})):[e.toString()]}function SM(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Js(n)&&!Kb(n))return!1}return!0}var Pq=aM(bp),Fq=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&SM(t),this.componentId=n,this.baseHash=su(Pq,n),this.baseStyle=r,Tp.registerId(n)}return e.prototype.generateAndInjectStyles=function(t,n,r){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,n,r):"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(this.componentId,this.staticRulesId))i=el(i,this.staticRulesId);else{var o=Cp(Za(this.rules,t,n,r)),a=Vb(su(this.baseHash,o)>>>0);if(!n.hasNameForId(this.componentId,a)){var u=r(o,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,u)}i=el(i,a),this.staticRulesId=a}else{for(var c=su(this.baseHash,r.hash),d="",p=0;p<this.rules.length;p++){var h=this.rules[p];if(typeof h=="string")d+=h;else if(h){var m=Cp(Za(h,t,n,r));c=su(c,m+p),d+=m}}if(d){var v=Vb(c>>>0);n.hasNameForId(this.componentId,v)||n.insertRules(this.componentId,v,r(d,".".concat(v),void 0,this.componentId)),i=el(i,v)}}return i},e}(),_f=er.createContext(void 0);_f.Consumer;function Op(e){var t=er.useContext(_f),n=R.useMemo(function(){return function(r,i){if(!r)throw tl(14);if(Js(r)){var o=r(i);return o}if(Array.isArray(r)||typeof r!="object")throw tl(8);return i?Er(Er({},i),r):r}(e.theme,t)},[e.theme,t]);return e.children?er.createElement(_f.Provider,{value:n},e.children):null}var t1={};function zq(e,t,n){var r=Kb(e),i=e,o=!Wb(e),a=t.attrs,u=a===void 0?wp:a,c=t.componentId,d=c===void 0?function(A,I){var $=typeof A!="string"?"sc":rM(A);t1[$]=(t1[$]||0)+1;var B="".concat($,"-").concat(Yb(bp+$+t1[$]));return I?"".concat(I,"-").concat(B):B}(t.displayName,t.parentComponentId):c,p=t.displayName,h=p===void 0?function(A){return Wb(A)?"styled.".concat(A):"Styled(".concat(dq(A),")")}(e):p,m=t.displayName&&t.componentId?"".concat(rM(t.displayName),"-").concat(t.componentId):t.componentId||d,v=r&&i.attrs?i.attrs.concat(u).filter(Boolean):u,_=t.shouldForwardProp;if(r&&i.shouldForwardProp){var S=i.shouldForwardProp;if(t.shouldForwardProp){var x=t.shouldForwardProp;_=function(A,I){return S(A,I)&&x(A,I)}}else _=S}var b=new Fq(n,m,r?i.componentStyle:void 0);function C(A,I){return function($,B,U){var G=$.attrs,P=$.componentStyle,K=$.defaultProps,re=$.foldedComponentIds,ue=$.styledComponentId,Z=$.target,ie=er.useContext(_f),V=Mp(),Q=$.shouldForwardProp||V.shouldForwardProp,ye=tM(B,ie,K)||au,Te=function(Ue,de,tt){for(var Ze,lt=Er(Er({},de),{className:void 0,theme:tt}),gt=0;gt<Ue.length;gt+=1){var je=Js(Ze=Ue[gt])?Ze(lt):Ze;for(var Se in je)lt[Se]=Se==="className"?el(lt[Se],je[Se]):Se==="style"?Er(Er({},lt[Se]),je[Se]):je[Se]}return de.className&&(lt.className=el(lt.className,de.className)),lt}(G,B,ye),T=Te.as||Z,X={};for(var ve in Te)Te[ve]===void 0||ve[0]==="$"||ve==="as"||ve==="theme"&&Te.theme===ye||(ve==="forwardedAs"?X.as=Te.forwardedAs:Q&&!Q(ve,T)||(X[ve]=Te[ve],Q||Xr.NODE_ENV));var L=function(Ue,de){var tt=Mp(),Ze=Ue.generateAndInjectStyles(de,tt.styleSheet,tt.stylis);return Ze}(P,Te),we=el(re,ue);return L&&(we+=" "+L),Te.className&&(we+=" "+Te.className),X[Wb(T)&&!nM.has(T)?"class":"className"]=we,U&&(X.ref=U),R.createElement(T,X)}(k,A,I)}C.displayName=h;var k=er.forwardRef(C);return k.attrs=v,k.componentStyle=b,k.displayName=h,k.shouldForwardProp=_,k.foldedComponentIds=r?el(i.foldedComponentIds,i.styledComponentId):"",k.styledComponentId=m,k.target=r?i.target:e,Object.defineProperty(k,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(A){this._foldedDefaultProps=r?function(I){for(var $=[],B=1;B<arguments.length;B++)$[B-1]=arguments[B];for(var U=0,G=$;U<G.length;U++)Qb(I,G[U],!0);return I}({},i.defaultProps,A):A}}),Xb(k,function(){return".".concat(k.styledComponentId)}),o&&hM(k,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),k}function CM(e,t){for(var n=[e[0]],r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}var EM=function(e){return Object.assign(e,{isCss:!0})};function fn(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Js(e)||yf(e))return EM(Za(CM(wp,eu([e],t,!0))));var r=e;return t.length===0&&r.length===1&&typeof r[0]=="string"?Za(r):EM(Za(CM(r,t)))}function n1(e,t,n){if(n===void 0&&(n=au),!t)throw tl(1,t);var r=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return e(t,n,fn.apply(void 0,eu([i],o,!1)))};return r.attrs=function(i){return n1(e,t,Er(Er({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},r.withConfig=function(i){return n1(e,t,Er(Er({},n),i))},r}var kM=function(e){return n1(zq,e)},z=kM;nM.forEach(function(e){z[e]=kM(e)});var Uq=function(){function e(t,n){this.rules=t,this.componentId=n,this.isStatic=SM(t),Tp.registerId(this.componentId+1)}return e.prototype.createStyles=function(t,n,r,i){var o=i(Cp(Za(this.rules,n,r,i)),""),a=this.componentId+t;r.insertRules(a,a,o)},e.prototype.removeStyles=function(t,n){n.clearRules(this.componentId+t)},e.prototype.renderStyles=function(t,n,r,i){t>2&&Tp.registerId(this.componentId+t),this.removeStyles(t,r),this.createStyles(t,n,r,i)},e}();function Rp(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=fn.apply(void 0,eu([e],t,!1)),i="sc-global-".concat(Yb(JSON.stringify(r))),o=new Uq(r,i),a=function(c){var d=Mp(),p=er.useContext(_f),h=er.useRef(d.styleSheet.allocateGSInstance(i)).current;return d.styleSheet.server&&u(h,c,d.styleSheet,p,d.stylis),er.useLayoutEffect(function(){if(!d.styleSheet.server)return u(h,c,d.styleSheet,p,d.stylis),function(){return o.removeStyles(h,d.styleSheet)}},[h,c,d.styleSheet,p,d.stylis]),null};function u(c,d,p,h,m){if(o.isStatic)o.renderStyles(c,lq,p,m);else{var v=Er(Er({},d),{theme:tM(d,h,a.defaultProps)});o.renderStyles(c,v,p,m)}}return er.memo(a)}function AM(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Cp(fn.apply(void 0,eu([e],t,!1))),i=Yb(r);return new _M(i,r)}const jt={CHAT_HISTORY:"chat_history",CLICKED_QUESTIONS:"clicked_questions",PENDING_BULK_ITEMS:"pending_bulk_items",LAST_SHOWN_MESSAGE_ID:"last_shown_message_id",HIDDEN_DYNAMIC_SUGGESTED_QUESTIONS:"hidden_dynamic_suggested_questions",CHAT_RATING:"chat_rating",SHOPIFY_META_DATA:"shopify_meta_data",SESSION_ID:"session_id",USER_INFO:"user_info",IS_FORM_CLOSED_BY_USER:"is_form_closed_by_user"};var $p={USER:"anurag",npm_config_user_agent:"pnpm/10.7.1 npm/? node/v20.11.1 linux x64",npm_node_execpath:"/home/anurag/.local/share/pnpm/nodejs/22.15.0/bin/node",WT_PROFILE_ID:"{51855cb2-8cce-5362-8f54-464b92b32386}",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/anurag",OLDPWD:"/home/anurag",LESS:"-R",npm_package_json:"/home/anurag/workstation/debales/debales/packages/ai/package.json",ZSH:"/home/anurag/.oh-my-zsh",LSCOLORS:"Gxfxcxdxbxegedabagacad",PAGER:"less",npm_config_userconfig:"/home/anurag/.npmrc",npm_config_local_prefix:"/home/anurag/workstation/debales/debales/packages/ai",DBUS_SESSION_BUS_ADDRESS:"unix:path=/run/user/1000/bus",P9K_TTY:"old",npm_config_engine_strict:"true",WSL_DISTRO_NAME:"Ubuntu",COLOR:"0",npm_config_otp:"785628",WAYLAND_DISPLAY:"wayland-0",LOGNAME:"anurag",PULSE_SERVER:"unix:/mnt/wslg/PulseServer",WSL_INTEROP:"/run/WSL/405_interop",NAME:"Anurag-PC",_P9K_SSH_TTY:"/dev/pts/0",_:"/home/anurag/.local/share/pnpm/pnpm",npm_config_prefix:"/home/anurag/.local/share/pnpm/nodejs/22.15.0",npm_config_npm_version:"10.9.2",npm_config_registry:"https://registry.npmjs.org/",TERM:"xterm-256color",npm_config_cache:"/home/anurag/.npm",npm_config_node_gyp:"/home/anurag/.local/share/pnpm/nodejs/22.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/anurag/workstation/debales/debales/packages/ai/node_modules/.bin:/home/anurag/workstation/debales/debales/packages/node_modules/.bin:/home/anurag/workstation/debales/debales/node_modules/.bin:/home/anurag/workstation/debales/node_modules/.bin:/home/anurag/workstation/node_modules/.bin:/home/anurag/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/home/anurag/.local/share/pnpm/nodejs/22.15.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/anurag/workstation/debales/debales/packages/ai/node_modules/.bin:/snapshot/dist/node-gyp-bin:/home/anurag/workstation/debales/debales/node_modules/.bin:/home/anurag/workstation/debales/debales/packages/ai/node_modules/.bin:/snapshot/dist/node-gyp-bin:/home/anurag/workstation/debales/debales/node_modules/.bin:/home/anurag/workstation/debales/debales/node_modules/.bin:/snapshot/dist/node-gyp-bin:/home/anurag/workstation/debales/debales/node_modules/.bin:/home/anurag/.local/share/pnpm/.tools/@pnpm+linux-x64/10.7.1/bin:/home/anurag/.gvm/bin:/mnt/c/Users/anura/AppData/Local/Programs/cursor/resources/app/bin:/home/anurag/go/bin:/usr/local/go/bin:/home/anurag/bin:/usr/local/bin:/home/anurag/.local/share/pnpm:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program:Files:(x86)/NVIDIA:Corporation/PhysX/Common:Files/NVIDIA:Corporation/NVIDIA:app/NvDLISR:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:Files/Docker/Docker/resources/bin:/mnt/c/Users/anura/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/anura/AppData/Local/Programs/Microsoft:VS:Code/bin:/home/linuxbrew/.linuxbrew/bin",NODE:"/home/anurag/.local/share/pnpm/nodejs/22.15.0/bin/node",npm_package_name:"@debales/ai",XDG_RUNTIME_DIR:"/run/user/1000/",WT_SESSION:"a0623060-60a9-4845-abe8-ec6f6135df73",npm_config_frozen_lockfile:"",DISPLAY:":0",LANG:"C.UTF-8",LS_COLORS:"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:",npm_lifecycle_script:"tsc -b && vite build --config vite.browser.config.ts",GVM_VERSION:"1.0.22",SHELL:"/usr/bin/zsh",NODE_PATH:"/home/anurag/workstation/debales/debales/node_modules/.pnpm/vite@6.2.5_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.2_terser@5.39.0_yaml@2.7.1/node_modules/vite/bin/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/vite@6.2.5_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.2_terser@5.39.0_yaml@2.7.1/node_modules/vite/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/vite@6.2.5_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.2_terser@5.39.0_yaml@2.7.1/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/@changesets+cli@2.28.1/node_modules/@changesets/cli/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/@changesets+cli@2.28.1/node_modules/@changesets/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/@changesets+cli@2.28.1/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/node_modules:/home/anurag/.local/share/pnpm/global/5/.pnpm/@pnpm+exe@10.6.3/node_modules/@pnpm/exe/node_modules:/home/anurag/.local/share/pnpm/global/5/.pnpm/@pnpm+exe@10.6.3/node_modules/@pnpm/node_modules:/home/anurag/.local/share/pnpm/global/5/.pnpm/@pnpm+exe@10.6.3/node_modules:/home/anurag/.local/share/pnpm/global/5/.pnpm/node_modules",npm_package_version:"1.1.12",npm_config_verify_deps_before_run:"false",npm_config_access:"public",npm_lifecycle_event:"build:browser",npm_config_tag:"latest",P9K_SSH:"0",npm_config_globalconfig:"/home/anurag/.config/pnpm/npmrc",npm_config_init_module:"/home/anurag/.npm-init.js",PWD:"/home/anurag/workstation/debales/debales/packages/ai",npm_execpath:"/home/anurag/.local/share/pnpm/nodejs/22.15.0/lib/node_modules/npm/bin/npm-cli.js",GVM_ROOT:"/home/anurag/.gvm",_P9K_TTY:"/dev/pts/0",npm_config_global_prefix:"/home/anurag/.local/share/pnpm/nodejs/22.15.0",PNPM_SCRIPT_SRC_DIR:"/home/anurag/workstation/debales/debales/packages/ai",npm_command:"run-script",BREW_HOME:"/home/linuxbrew/.linuxbrew/bin",HOSTTYPE:"x86_64",WSL2_GUI_APPS_ENABLED:"1",PNPM_HOME:"/home/anurag/.local/share/pnpm",GVM_PATH_BACKUP:"/home/anurag/.gvm/bin:/mnt/c/Users/anura/AppData/Local/Programs/cursor/resources/app/bin:/home/anurag/go/bin:/usr/local/go/bin:/home/anurag/bin:/usr/local/bin:/home/anurag/.local/share/pnpm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA app/NvDLISR:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Users/anura/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/anura/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/anura/AppData/Local/Programs/cursor/resources/app/bin:/home/linuxbrew/.linuxbrew/bin",WSLENV:"WT_SESSION:WT_PROFILE_ID:",INIT_CWD:"/home/anurag/workstation/debales/debales/packages/ai",npm_config_json:"true",EDITOR:"vi",NODE_ENV:"production"},it;if(typeof window>"u"){var IM={hostname:""};it={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:IM,referrer:""},screen:{width:0,height:0},location:IM,addEventListener:function(){},removeEventListener:function(){}}}else it=window;function TM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function MM(e,t,n,r,i,o,a){try{var u=e[o](a),c=u.value}catch(d){n(d);return}u.done?t(c):Promise.resolve(c).then(r,i)}function r1(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(c){MM(o,r,i,a,u,"next",c)}function u(c){MM(o,r,i,a,u,"throw",c)}a(void 0)})}}function Dp(e,t,n){return OM()?Dp=Reflect.construct:Dp=function(i,o,a){var u=[null];u.push.apply(u,o);var c=Function.bind.apply(i,u),d=new c;return a&&xf(d,a.prototype),d},Dp.apply(null,arguments)}function jq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Dr(e,t,n){return t&&jq(e.prototype,t),e}function rn(){return rn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rn.apply(this,arguments)}function i1(e){return i1=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},i1(e)}function Jr(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}}),t&&xf(e,t)}function Rt(e,t){return t!=null&&typeof Symbol<"u"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function qq(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function bf(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function xf(e,t){return xf=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},xf(e,t)}function Vt(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function Hq(e,t){if(e){if(typeof e=="string")return TM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TM(e,t)}}function Lp(e){var t=typeof Map=="function"?new Map:void 0;return Lp=function(r){if(r===null||!qq(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return Dp(r,arguments,i1(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),xf(i,r)},Lp(e)}function OM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OM=function(){return!!e})()}function dt(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=Hq(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function wf(e,t){var n,r,i,o,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(d){return function(p){return c([d,p])}}function c(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=d[0]&2?r.return:d[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,d[1])).done)return i;switch(r=0,i&&(d=[d[0]&2,i.value]),d[0]){case 0:case 1:i=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,r=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(i=a.trys,!(i=i.length>0&&i[i.length-1])&&(d[0]===6||d[0]===2)){a=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]<i[3])){a.label=d[1];break}if(d[0]===6&&a.label<i[1]){a.label=i[1],i=d;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(d);break}i[2]&&a.ops.pop(),a.trys.pop();continue}d=t.call(e,a)}catch(p){d=[6,p],r=0}finally{n=i=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function RM(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var Gq=Object.defineProperty,Vq=function(e,t,n){return t in e?Gq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ke=function(e,t,n){return Vq(e,(typeof t>"u"?"undefined":Vt(t))!=="symbol"?t+"":t,n)},$M,Zq=Object.defineProperty,Yq=function(e,t,n){return t in e?Zq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},DM=function(e,t,n){return Yq(e,(typeof t>"u"?"undefined":Vt(t))!=="symbol"?t+"":t,n)},br=function(e){return e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e}(br||{}),LM={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},NM={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Np={},Wq=function(){return!!globalThis.Zone};function o1(e){if(Np[e])return Np[e];var t=globalThis[e],n=t.prototype,r=e in LM?LM[e]:void 0,i=!!(r&&r.every(function(p){var h,m;return!!((m=(h=Object.getOwnPropertyDescriptor(n,p))==null?void 0:h.get)!=null&&m.toString().includes("[native code]"))})),o=e in NM?NM[e]:void 0,a=!!(o&&o.every(function(p){var h;return typeof n[p]=="function"&&((h=n[p])==null?void 0:h.toString().includes("[native code]"))}));if(i&&a&&!Wq())return Np[e]=t.prototype,t.prototype;try{var u=document.createElement("iframe");document.body.appendChild(u);var c=u.contentWindow;if(!c)return t.prototype;var d=c[e].prototype;return document.body.removeChild(u),d?Np[e]=d:n}catch{return n}}var a1={};function Ya(e,t,n){var r,i=e+"."+String(n);if(a1[i])return a1[i].call(t);var o=o1(e),a=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return a?(a1[i]=a,a.call(t)):t[n]}var s1={};function BM(e,t,n){var r=e+"."+String(n);if(s1[r])return s1[r].bind(t);var i=o1(e),o=i[n];return typeof o!="function"?t[n]:(s1[r]=o,o.bind(t))}function Kq(e){return Ya("Node",e,"childNodes")}function Qq(e){return Ya("Node",e,"parentNode")}function Xq(e){return Ya("Node",e,"parentElement")}function Jq(e){return Ya("Node",e,"textContent")}function eH(e,t){return BM("Node",e,"contains")(t)}function tH(e){return BM("Node",e,"getRootNode")()}function nH(e){return!e||!("host"in e)?null:Ya("ShadowRoot",e,"host")}function rH(e){return e.styleSheets}function iH(e){return!e||!("shadowRoot"in e)?null:Ya("Element",e,"shadowRoot")}function oH(e,t){return Ya("Element",e,"querySelector")(t)}function aH(e,t){return Ya("Element",e,"querySelectorAll")(t)}function sH(){return o1("MutationObserver").constructor}var ei={childNodes:Kq,parentNode:Qq,parentElement:Xq,textContent:Jq,contains:eH,getRootNode:tH,host:nH,styleSheets:rH,shadowRoot:iH,querySelector:oH,querySelectorAll:aH,mutationObserver:sH};function PM(e){return e.nodeType===e.ELEMENT_NODE}function Sf(e){var t=e&&"host"in e&&"mode"in e&&ei.host(e)||null;return!!(t&&"shadowRoot"in t&&ei.shadowRoot(t)===e)}function Cf(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function lH(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function uH(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url("+JSON.stringify(e.href)+")"];return e.layerName===""?n.push("layer"):e.layerName&&n.push("layer("+e.layerName+")"),e.supportsText&&n.push("supports("+e.supportsText+")"),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function l1(e){try{var t=e.rules||e.cssRules;if(!t)return null;var n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);var r=Array.from(t,function(i){return FM(i,n)}).join("");return lH(r)}catch{return null}}function FM(e,t){if(fH(e)){var n;try{n=l1(e.styleSheet)||uH(e)}catch{n=e.cssText}return e.styleSheet.href?Bp(n,e.styleSheet.href):n}else{var r=e.cssText;return dH(e)&&e.selectorText.includes(":")&&(r=cH(r)),t?Bp(r,t):r}}function cH(e){var t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function fH(e){return"styleSheet"in e}function dH(e){return"selectorText"in e}var zM=function(){function e(){DM(this,"idNodeMap",new Map),DM(this,"nodeMetaMap",new WeakMap)}var t=e.prototype;return t.getId=function(r){var i;if(!r)return-1;var o=(i=this.getMeta(r))==null?void 0:i.id;return o??-1},t.getNode=function(r){return this.idNodeMap.get(r)||null},t.getIds=function(){return Array.from(this.idNodeMap.keys())},t.getMeta=function(r){return this.nodeMetaMap.get(r)||null},t.removeNodeFromMap=function(r){var i=this,o=this.getId(r);this.idNodeMap.delete(o),r.childNodes&&r.childNodes.forEach(function(a){return i.removeNodeFromMap(a)})},t.has=function(r){return this.idNodeMap.has(r)},t.hasNode=function(r){return this.nodeMetaMap.has(r)},t.add=function(r,i){var o=i.id;this.idNodeMap.set(o,r),this.nodeMetaMap.set(r,i)},t.replace=function(r,i){var o=this.getNode(r);if(o){var a=this.nodeMetaMap.get(o);a&&this.nodeMetaMap.set(i,a)}this.idNodeMap.set(r,i)},t.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function hH(){return new zM}function u1(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.value,a=e.maskInputFn,u=o||"",c=i&&nl(i);return(n[r.toLowerCase()]||c&&n[c])&&(a?u=a(u,t):u="*".repeat(u.length)),u}function nl(e){return e.toLowerCase()}var UM="__rrweb_original__";function pH(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var i=0;i<e.height;i+=n){var o=t.getImageData,a=UM in o?o[UM]:o,u=new Uint32Array(a.call(t,r,i,Math.min(n,e.width-r),Math.min(n,e.height-i)).data.buffer);if(u.some(function(c){return c!==0}))return!1}return!0}function c1(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?nl(t):null}function jM(e,t){var n;try{n=new URL(e,t??window.location.href)}catch{return null}var r=/\.([0-9a-z]+)(?:$)/i,i=n.pathname.match(r),o;return(o=i==null?void 0:i[1])!=null?o:null}function gH(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var mH=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,vH=/^(?:[a-z+]+:)?\/\//i,yH=/^www\..*/i,_H=/^(data:)([^,]*),(.*)/i;function Bp(e,t){return(e||"").replace(mH,function(n,r,i,o,a,u){var c=i||a||u,d=r||o||"";if(!c)return n;if(vH.test(c)||yH.test(c)||_H.test(c))return"url("+d+c+d+")";if(c[0]==="/")return"url("+d+(gH(t)+c)+d+")";var p=t.split("/"),h=c.split("/");p.pop();for(var m=dt(h),v;!(v=m()).done;){var _=v.value;_!=="."&&(_===".."?p.pop():p.push(_))}return"url("+d+p.join("/")+d+")"})}function f1(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function bH(e,t){var n=Array.from(t.childNodes),r=[];if(n.length>1&&e&&typeof e=="string"){for(var i=f1(e),o=1;o<n.length;o++)if(n[o].textContent&&typeof n[o].textContent=="string")for(var a=f1(n[o].textContent),u=3;u<a.length;u++){var c=a.substring(0,u);if(i.split(c).length===2){for(var d=i.indexOf(c),p=d;p<e.length;p++)if(f1(e.substring(0,p)).length===d){r.push(e.substring(0,p)),e=e.substring(p);break}break}}}return r.push(e),r}function xH(e,t){return bH(e,t).join("/* rr_split */")}var wH=1,SH=new RegExp("[^a-z0-9-_:]"),Ef=-2;function qM(){return wH++}function CH(e){if(Rt(e,HTMLFormElement))return"form";var t=nl(e.tagName);return SH.test(t)?"div":t}var lu,HM,EH=/^[^ \t\n\r\u000c]+/,kH=/^[, \t\n\r\u000c]+/;function AH(e,t){if(t.trim()==="")return t;var n=0;function r(d){var p,h=d.exec(t.substring(n));return h?(p=h[0],n+=p.length,p):""}for(var i=[];r(kH),!(n>=t.length);){var o=r(EH);if(o.slice(-1)===",")o=uu(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=uu(e,o);for(var u=!1;;){var c=t.charAt(n);if(c===""){i.push((o+a).trim());break}else if(u)c===")"&&(u=!1);else if(c===","){n+=1,i.push((o+a).trim());break}else c==="("&&(u=!0);a+=c,n+=1}}}return i.join(", ")}var GM=new WeakMap;function uu(e,t){return!t||t.trim()===""?t:d1(e,t)}function IH(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function d1(e,t){var n=GM.get(e);if(n||(n=e.createElement("a"),GM.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function VM(e,t,n,r){return r&&(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(t==="table"||t==="td"||t==="th")?uu(e,r):n==="srcset"?AH(e,r):n==="style"?Bp(r,d1(e)):t==="object"&&n==="data"?uu(e,r):r)}function ZM(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function TH(e,t,n){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function Pp(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Pp(ei.parentNode(e),t,n):!1;for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return n?Pp(ei.parentNode(e),t,n):!1}function YM(e,t,n,r){var i;if(PM(e)){if(i=e,!ei.childNodes(i).length)return!1}else{if(ei.parentElement(e)===null)return!1;i=ei.parentElement(e)}try{if(typeof t=="string"){if(r){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(Pp(i,t,r))return!0;if(n){if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}}catch{}return!1}function MH(e,t,n){var r=e.contentWindow;if(r){var i=!1,o;try{o=r.document.readyState}catch{return}if(o!=="complete"){var a=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener("load",function(){clearTimeout(a),i=!0,t()});return}var u="about:blank";if(r.location.href!==u||e.src===u||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function OH(e,t,n){var r=!1,i;try{i=e.sheet}catch{return}if(!i){var o=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(o),r=!0,t()})}}function RH(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,a=t.needsMask,u=t.inlineStylesheet,c=t.maskInputOptions,d=c===void 0?{}:c,p=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,v=m===void 0?{}:m,_=t.inlineImages,S=t.recordCanvas,x=t.keepIframeSrcFn,b=t.newlyAddedElement,C=b===void 0?!1:b,k=t.cssCaptured,A=k===void 0?!1:k,I=$H(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:br.Document,childNodes:[],compatMode:e.compatMode}:{type:br.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:br.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return LH(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:u,maskInputOptions:d,maskInputFn:h,dataURLOptions:v,inlineImages:_,recordCanvas:S,keepIframeSrcFn:x,newlyAddedElement:C,rootId:I});case e.TEXT_NODE:return DH(e,{doc:n,needsMask:a,maskTextFn:p,rootId:I,cssCaptured:A});case e.CDATA_SECTION_NODE:return{type:br.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:br.Comment,textContent:ei.textContent(e)||"",rootId:I};default:return!1}}function $H(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function DH(e,t){var n=t.needsMask,r=t.maskTextFn,i=t.rootId,o=t.cssCaptured,a=ei.parentNode(e),u=a&&a.tagName,c="",d=u==="STYLE"?!0:void 0,p=u==="SCRIPT"?!0:void 0;return p?c="SCRIPT_PLACEHOLDER":o||(c=ei.textContent(e),d&&c&&(c=Bp(c,d1(t.doc)))),!d&&!p&&c&&n&&(c=r?r(c,ei.parentElement(e)):c.replace(/[\S]/g,"*")),{type:br.Text,textContent:c||"",rootId:i}}function LH(e,t){for(var n=t.doc,r=t.blockClass,i=t.blockSelector,o=t.inlineStylesheet,a=t.maskInputOptions,u=a===void 0?{}:a,c=t.maskInputFn,d=t.dataURLOptions,p=d===void 0?{}:d,h=t.inlineImages,m=t.recordCanvas,v=t.keepIframeSrcFn,_=t.newlyAddedElement,S=_===void 0?!1:_,x=t.rootId,b=TH(e,r,i),C=CH(e),k={},A=e.attributes.length,I=0;I<A;I++){var $=e.attributes[I];ZM(C,$.name,$.value)||(k[$.name]=VM(n,C,nl($.name),$.value))}if(C==="link"&&o){var B=Array.from(n.styleSheets).find(function(we){return we.href===e.href}),U=null;B&&(U=l1(B)),U&&(delete k.rel,delete k.href,k._cssText=U)}if(C==="style"&&e.sheet){var G=l1(e.sheet);G&&(e.childNodes.length>1&&(G=xH(G,e)),k._cssText=G)}if(C==="input"||C==="textarea"||C==="select"){var P=e.value,K=e.checked;k.type!=="radio"&&k.type!=="checkbox"&&k.type!=="submit"&&k.type!=="button"&&P?k.value=u1({element:e,type:c1(e),tagName:C,value:P,maskInputOptions:u,maskInputFn:c}):K&&(k.checked=K)}if(C==="option"&&(e.selected&&!u.select?k.selected=!0:delete k.selected),C==="dialog"&&e.open&&(k.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),C==="canvas"&&m){if(e.__context==="2d")pH(e)||(k.rr_dataURL=e.toDataURL(p.type,p.quality));else if(!("__context"in e)){var re=e.toDataURL(p.type,p.quality),ue=n.createElement("canvas");ue.width=e.width,ue.height=e.height;var Z=ue.toDataURL(p.type,p.quality);re!==Z&&(k.rr_dataURL=re)}}if(C==="img"&&h){lu||(lu=n.createElement("canvas"),HM=lu.getContext("2d"));var ie=e,V=ie.currentSrc||ie.getAttribute("src")||"<unknown-src>",Q=ie.crossOrigin,ye=function(){ie.removeEventListener("load",ye);try{lu.width=ie.naturalWidth,lu.height=ie.naturalHeight,HM.drawImage(ie,0,0),k.rr_dataURL=lu.toDataURL(p.type,p.quality)}catch(we){if(ie.crossOrigin!=="anonymous"){ie.crossOrigin="anonymous",ie.complete&&ie.naturalWidth!==0?ye():ie.addEventListener("load",ye);return}else console.warn("Cannot inline img src="+V+"! Error: "+we)}ie.crossOrigin==="anonymous"&&(Q?k.crossOrigin=Q:ie.removeAttribute("crossorigin"))};ie.complete&&ie.naturalWidth!==0?ye():ie.addEventListener("load",ye)}if(C==="audio"||C==="video"){var Te=k;Te.rr_mediaState=e.paused?"paused":"played",Te.rr_mediaCurrentTime=e.currentTime,Te.rr_mediaPlaybackRate=e.playbackRate,Te.rr_mediaMuted=e.muted,Te.rr_mediaLoop=e.loop,Te.rr_mediaVolume=e.volume}if(S||(e.scrollLeft&&(k.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(k.rr_scrollTop=e.scrollTop)),b){var T=e.getBoundingClientRect(),X=T.width,ve=T.height;k={class:k.class,rr_width:""+X+"px",rr_height:""+ve+"px"}}C==="iframe"&&!v(k.src)&&(e.contentDocument||(k.rr_src=k.src),delete k.src);var L;try{customElements.get(C)&&(L=!0)}catch{}return{type:br.Element,tagName:C,attributes:k,childNodes:[],isSVG:IH(e)||void 0,needBlock:b,rootId:x,isCustom:L}}function An(e){return e==null?"":e.toLowerCase()}function NH(e,t){if(t.comment&&e.type===br.Comment)return!0;if(e.type===br.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&jM(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(An(e.attributes.name).match(/^msapplication-tile(image|color)$/)||An(e.attributes.name)==="application-name"||An(e.attributes.rel)==="icon"||An(e.attributes.rel)==="apple-touch-icon"||An(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&An(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(An(e.attributes.property).match(/^(og|twitter|fb):/)||An(e.attributes.name).match(/^(og|twitter):/)||An(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(An(e.attributes.name)==="robots"||An(e.attributes.name)==="googlebot"||An(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(An(e.attributes.name)==="author"||An(e.attributes.name)==="generator"||An(e.attributes.name)==="framework"||An(e.attributes.name)==="publisher"||An(e.attributes.name)==="progid"||An(e.attributes.property).match(/^article:/)||An(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(An(e.attributes.name)==="google-site-verification"||An(e.attributes.name)==="yandex-verification"||An(e.attributes.name)==="csrf-token"||An(e.attributes.name)==="p:domain_verify"||An(e.attributes.name)==="verify-v1"||An(e.attributes.name)==="verification"||An(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function cu(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,a=t.maskTextClass,u=t.maskTextSelector,c=t.skipChild,d=c===void 0?!1:c,p=t.inlineStylesheet,h=p===void 0?!0:p,m=t.maskInputOptions,v=m===void 0?{}:m,_=t.maskTextFn,S=t.maskInputFn,x=t.slimDOMOptions,b=t.dataURLOptions,C=b===void 0?{}:b,k=t.inlineImages,A=k===void 0?!1:k,I=t.recordCanvas,$=I===void 0?!1:I,B=t.onSerialize,U=t.onIframeLoad,G=t.iframeLoadTimeout,P=G===void 0?5e3:G,K=t.onStylesheetLoad,re=t.stylesheetLoadTimeout,ue=re===void 0?5e3:re,Z=t.keepIframeSrcFn,ie=Z===void 0?function(){return!1}:Z,V=t.newlyAddedElement,Q=V===void 0?!1:V,ye=t.cssCaptured,Te=ye===void 0?!1:ye,T=t.needsMask,X=t.preserveWhiteSpace,ve=X===void 0?!0:X;if(!T){var L=T===void 0;T=YM(e,a,u,L)}var we=RH(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:T,inlineStylesheet:h,maskInputOptions:v,maskTextFn:_,maskInputFn:S,dataURLOptions:C,inlineImages:A,recordCanvas:$,keepIframeSrcFn:ie,newlyAddedElement:Q,cssCaptured:Te});if(!we)return console.warn(e,"not serialized"),null;var Ue;r.hasNode(e)?Ue=r.getId(e):NH(we,x)||!ve&&we.type===br.Text&&!we.textContent.replace(/^\s+|\s+$/gm,"").length?Ue=Ef:Ue=qM();var de=Object.assign(we,{id:Ue});if(r.add(e,de),Ue===Ef)return null;B&&B(e);var tt=!d;if(de.type===br.Element){tt=tt&&!de.needBlock,delete de.needBlock;var Ze=ei.shadowRoot(e);Ze&&Cf(Ze)&&(de.isShadowHost=!0)}if((de.type===br.Document||de.type===br.Element)&&tt){x.headWhitespace&&de.type===br.Element&&de.tagName==="head"&&(ve=!1);var lt={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:T,maskTextClass:a,maskTextSelector:u,skipChild:d,inlineStylesheet:h,maskInputOptions:v,maskTextFn:_,maskInputFn:S,slimDOMOptions:x,dataURLOptions:C,inlineImages:A,recordCanvas:$,preserveWhiteSpace:ve,onSerialize:B,onIframeLoad:U,iframeLoadTimeout:P,onStylesheetLoad:K,stylesheetLoadTimeout:ue,keepIframeSrcFn:ie,cssCaptured:!1};if(!(de.type===br.Element&&de.tagName==="textarea"&&de.attributes.value!==void 0)){de.type===br.Element&&de.attributes._cssText!==void 0&&typeof de.attributes._cssText=="string"&&(lt.cssCaptured=!0);for(var gt=dt(Array.from(ei.childNodes(e))),je;!(je=gt()).done;){var Se=je.value,Ye=cu(Se,lt);Ye&&de.childNodes.push(Ye)}}var Qe=null;if(PM(e)&&(Qe=ei.shadowRoot(e)))for(var ot=dt(Array.from(ei.childNodes(Qe))),et;!(et=ot()).done;){var He=et.value,N=cu(He,lt);N&&(Cf(Qe)&&(N.isShadow=!0),de.childNodes.push(N))}}var F=ei.parentNode(e);return F&&Sf(F)&&Cf(F)&&(de.isShadow=!0),de.type===br.Element&&de.tagName==="iframe"&&MH(e,function(){var Y=e.contentDocument;if(Y&&U){var ge=cu(Y,{doc:Y,mirror:r,blockClass:i,blockSelector:o,needsMask:T,maskTextClass:a,maskTextSelector:u,skipChild:!1,inlineStylesheet:h,maskInputOptions:v,maskTextFn:_,maskInputFn:S,slimDOMOptions:x,dataURLOptions:C,inlineImages:A,recordCanvas:$,preserveWhiteSpace:ve,onSerialize:B,onIframeLoad:U,iframeLoadTimeout:P,onStylesheetLoad:K,stylesheetLoadTimeout:ue,keepIframeSrcFn:ie});ge&&U(e,ge)}},P),de.type===br.Element&&de.tagName==="link"&&typeof de.attributes.rel=="string"&&(de.attributes.rel==="stylesheet"||de.attributes.rel==="preload"&&typeof de.attributes.href=="string"&&jM(de.attributes.href)==="css")&&OH(e,function(){if(K){var Y=cu(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:T,maskTextClass:a,maskTextSelector:u,skipChild:!1,inlineStylesheet:h,maskInputOptions:v,maskTextFn:_,maskInputFn:S,slimDOMOptions:x,dataURLOptions:C,inlineImages:A,recordCanvas:$,preserveWhiteSpace:ve,onSerialize:B,onIframeLoad:U,iframeLoadTimeout:P,onStylesheetLoad:K,stylesheetLoadTimeout:ue,keepIframeSrcFn:ie});Y&&K(e,Y)}},ue),de}function BH(e,t){var n=t||{},r=n.mirror,i=r===void 0?new zM:r,o=n.blockClass,a=o===void 0?"rr-block":o,u=n.blockSelector,c=u===void 0?null:u,d=n.maskTextClass,p=d===void 0?"rr-mask":d,h=n.maskTextSelector,m=h===void 0?null:h,v=n.inlineStylesheet,_=v===void 0?!0:v,S=n.inlineImages,x=S===void 0?!1:S,b=n.recordCanvas,C=b===void 0?!1:b,k=n.maskAllInputs,A=k===void 0?!1:k,I=n.maskTextFn,$=n.maskInputFn,B=n.slimDOM,U=B===void 0?!1:B,G=n.dataURLOptions,P=n.preserveWhiteSpace,K=n.onSerialize,re=n.onIframeLoad,ue=n.iframeLoadTimeout,Z=n.onStylesheetLoad,ie=n.stylesheetLoadTimeout,V=n.keepIframeSrcFn,Q=V===void 0?function(){return!1}:V,ye=A===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:A===!1?{password:!0}:A,Te=U===!0||U==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:U==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:U===!1?{}:U;return cu(e,{doc:e,mirror:i,blockClass:a,blockSelector:c,maskTextClass:p,maskTextSelector:m,skipChild:!1,inlineStylesheet:_,maskInputOptions:ye,maskTextFn:I,maskInputFn:$,slimDOMOptions:Te,dataURLOptions:G,inlineImages:x,recordCanvas:C,preserveWhiteSpace:P,onSerialize:K,onIframeLoad:re,iframeLoadTimeout:ue,onStylesheetLoad:Z,stylesheetLoadTimeout:ie,keepIframeSrcFn:Q,newlyAddedElement:!1})}function PH(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function FH(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return Rt(this,r)?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var h1={exports:{}},On=String,WM=function(){return{isColorSupported:!1,reset:On,bold:On,dim:On,italic:On,underline:On,inverse:On,hidden:On,strikethrough:On,black:On,red:On,green:On,yellow:On,blue:On,magenta:On,cyan:On,white:On,gray:On,bgBlack:On,bgRed:On,bgGreen:On,bgYellow:On,bgBlue:On,bgMagenta:On,bgCyan:On,bgWhite:On}};h1.exports=WM(),h1.exports.createColors=WM;var zH=h1.exports,UH={},jH=Object.freeze(Object.defineProperty({__proto__:null,default:UH},Symbol.toStringTag,{value:"Module"})),nr=FH(jH),KM=zH,QM=nr,p1=function(e){Jr(t,e);function t(r,i,o,a,u,c){var d;return d=e.call(this,r)||this,d.name="CssSyntaxError",d.reason=r,u&&(d.file=u),a&&(d.source=a),c&&(d.plugin=c),typeof i<"u"&&typeof o<"u"&&(typeof i=="number"?(d.line=i,d.column=o):(d.line=i.line,d.column=i.column,d.endLine=o.line,d.endColumn=o.column)),d.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(d,t),d}var n=t.prototype;return n.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},n.showSourceCode=function(i){var o=this;if(!this.source)return"";var a=this.source;i==null&&(i=KM.isColorSupported),QM&&i&&(a=QM(a));var u=a.split(/\r?\n/),c=Math.max(this.line-3,0),d=Math.min(this.line+2,u.length),p=String(d).length,h,m;if(i){var v=KM.createColors(!0),_=v.bold,S=v.gray,x=v.red;h=function(b){return _(x(b))},m=function(b){return S(b)}}else h=m=function(b){return b};return u.slice(c,d).map(function(b,C){var k=c+1+C,A=" "+(" "+k).slice(-p)+" | ";if(k===o.line){var I=m(A.replace(/\d/g," "))+b.slice(0,o.column-1).replace(/[^\t]/g," ");return h(">")+m(A)+b+`
81
+ `,xp=typeof window<"u"&&"HTMLElement"in window,sq=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Xr!==void 0&&Xr.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Xr.REACT_APP_SC_DISABLE_SPEEDY!==""?Xr.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Xr.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Xr!==void 0&&Xr.SC_DISABLE_SPEEDY!==void 0&&Xr.SC_DISABLE_SPEEDY!==""?Xr.SC_DISABLE_SPEEDY!=="false"&&Xr.SC_DISABLE_SPEEDY:Xr.NODE_ENV!=="production"),lq={},wp=Object.freeze([]),au=Object.freeze({});function tM(e,t,n){return n===void 0&&(n=au),e.theme!==n.theme&&e.theme||t||n.theme}var nM=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),uq=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,cq=/(^-|-$)/g;function rM(e){return e.replace(uq,"-").replace(cq,"")}var fq=/(a)(d)/gi,Sp=52,iM=function(e){return String.fromCharCode(e+(e>25?39:97))};function Vb(e){var t,n="";for(t=Math.abs(e);t>Sp;t=t/Sp|0)n=iM(t%Sp)+n;return(iM(t%Sp)+n).replace(fq,"$1-$2")}var Zb,oM=5381,su=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},aM=function(e){return su(oM,e)};function Yb(e){return Vb(aM(e)>>>0)}function dq(e){return e.displayName||e.name||"Component"}function Wb(e){return typeof e=="string"&&Xr.NODE_ENV==="production"}var sM=typeof Symbol=="function"&&Symbol.for,lM=sM?Symbol.for("react.memo"):60115,hq=sM?Symbol.for("react.forward_ref"):60112,pq={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},gq={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},uM={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},mq=((Zb={})[hq]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Zb[lM]=uM,Zb);function cM(e){return("type"in(t=e)&&t.type.$$typeof)===lM?uM:"$$typeof"in e?mq[e.$$typeof]:pq;var t}var vq=Object.defineProperty,yq=Object.getOwnPropertyNames,fM=Object.getOwnPropertySymbols,_q=Object.getOwnPropertyDescriptor,bq=Object.getPrototypeOf,dM=Object.prototype;function hM(e,t,n){if(typeof t!="string"){if(dM){var r=bq(t);r&&r!==dM&&hM(e,r,n)}var i=yq(t);fM&&(i=i.concat(fM(t)));for(var o=cM(e),a=cM(t),u=0;u<i.length;++u){var c=i[u];if(!(c in gq||n&&n[c]||a&&c in a||o&&c in o)){var d=_q(t,c);try{vq(e,c,d)}catch{}}}}return e}function Js(e){return typeof e=="function"}function Kb(e){return typeof e=="object"&&"styledComponentId"in e}function el(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function Cp(e,t){if(e.length===0)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function yf(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Qb(e,t,n){if(n===void 0&&(n=!1),!n&&!yf(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Qb(e[r],t[r]);else if(yf(t))for(var r in t)e[r]=Qb(e[r],t[r]);return e}function Xb(e,t){Object.defineProperty(e,"toString",{value:t})}function tl(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var xq=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r<t;r++)n+=this.groupSizes[r];return n},e.prototype.insertRules=function(t,n){if(t>=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,o=i;t>=o;)if((o<<=1)<0)throw tl(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=i;a<o;a++)this.groupSizes[a]=0}for(var u=this.indexOfGroup(t+1),c=(a=0,n.length);a<c;a++)this.tag.insertRule(u,n[a])&&(this.groupSizes[t]++,u++)},e.prototype.clearGroup=function(t){if(t<this.length){var n=this.groupSizes[t],r=this.indexOfGroup(t),i=r+n;this.groupSizes[t]=0;for(var o=r;o<i;o++)this.tag.deleteRule(r)}},e.prototype.getGroup=function(t){var n="";if(t>=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),o=i+r,a=i;a<o;a++)n+="".concat(this.tag.getRule(a)).concat(Gb);return n},e}(),Ep=new Map,kp=new Map,Ap=1,Ip=function(e){if(Ep.has(e))return Ep.get(e);for(;kp.has(Ap);)Ap++;var t=Ap++;return Ep.set(e,t),kp.set(t,e),t},wq=function(e,t){Ap=t+1,Ep.set(e,t),kp.set(t,e)},Sq="style[".concat(ou,"][").concat(eM,'="').concat(bp,'"]'),Cq=new RegExp("^".concat(ou,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Eq=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o<a;o++)(r=i[o])&&e.registerName(t,r)},kq=function(e,t){for(var n,r=((n=t.textContent)!==null&&n!==void 0?n:"").split(Gb),i=[],o=0,a=r.length;o<a;o++){var u=r[o].trim();if(u){var c=u.match(Cq);if(c){var d=0|parseInt(c[1],10),p=c[2];d!==0&&(wq(p,d),Eq(e,p,c[3]),e.getTag().insertRules(d,i)),i.length=0}else i.push(u)}}},pM=function(e){for(var t=document.querySelectorAll(Sq),n=0,r=t.length;n<r;n++){var i=t[n];i&&i.getAttribute(ou)!==JT&&(kq(e,i),i.parentNode&&i.parentNode.removeChild(i))}};function Aq(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var gM=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(u){var c=Array.from(u.querySelectorAll("style[".concat(ou,"]")));return c[c.length-1]}(n),o=i!==void 0?i.nextSibling:null;r.setAttribute(ou,JT),r.setAttribute(eM,bp);var a=Aq();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},Iq=function(){function e(t){this.element=gM(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(n){if(n.sheet)return n.sheet;for(var r=document.styleSheets,i=0,o=r.length;i<o;i++){var a=r[i];if(a.ownerNode===n)return a}throw tl(17)}(this.element),this.length=0}return e.prototype.insertRule=function(t,n){try{return this.sheet.insertRule(n,t),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.prototype.getRule=function(t){var n=this.sheet.cssRules[t];return n&&n.cssText?n.cssText:""},e}(),Tq=function(){function e(t){this.element=gM(t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(t,n){if(t<=this.length&&t>=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e}(),Mq=function(){function e(t){this.rules=[],this.length=0}return e.prototype.insertRule=function(t,n){return t<=this.length&&(this.rules.splice(t,0,n),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e}(),mM=xp,Oq={isServer:!xp,useCSSOMInjection:!sq},Tp=function(){function e(t,n,r){t===void 0&&(t=au),n===void 0&&(n={});var i=this;this.options=Er(Er({},Oq),t),this.gs=n,this.names=new Map(r),this.server=!!t.isServer,!this.server&&xp&&mM&&(mM=!1,pM(this)),Xb(this,function(){return function(o){for(var a=o.getTag(),u=a.length,c="",d=function(h){var m=function(b){return kp.get(b)}(h);if(m===void 0)return"continue";var v=o.names.get(m),_=a.getGroup(h);if(v===void 0||!v.size||_.length===0)return"continue";var S="".concat(ou,".g").concat(h,'[id="').concat(m,'"]'),x="";v!==void 0&&v.forEach(function(b){b.length>0&&(x+="".concat(b,","))}),c+="".concat(_).concat(S,'{content:"').concat(x,'"}').concat(Gb)},p=0;p<u;p++)d(p);return c}(i)})}return e.registerId=function(t){return Ip(t)},e.prototype.rehydrate=function(){!this.server&&xp&&pM(this)},e.prototype.reconstructWithOptions=function(t,n){return n===void 0&&(n=!0),new e(Er(Er({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=function(n){var r=n.useCSSOMInjection,i=n.target;return n.isServer?new Mq(i):r?new Iq(i):new Tq(i)}(this.options),new xq(t)));var t},e.prototype.hasNameForId=function(t,n){return this.names.has(t)&&this.names.get(t).has(n)},e.prototype.registerName=function(t,n){if(Ip(t),this.names.has(t))this.names.get(t).add(n);else{var r=new Set;r.add(n),this.names.set(t,r)}},e.prototype.insertRules=function(t,n,r){this.registerName(t,n),this.getTag().insertRules(Ip(t),r)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(Ip(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Rq=/&/g,$q=/^\s*\/\/.*$/gm;function vM(e,t){return e.map(function(n){return n.type==="rule"&&(n.value="".concat(t," ").concat(n.value),n.value=n.value.replaceAll(",",",".concat(t," ")),n.props=n.props.map(function(r){return"".concat(t," ").concat(r)})),Array.isArray(n.children)&&n.type!=="@keyframes"&&(n.children=vM(n.children,t)),n})}function yM(e){var t,n,r,i=e===void 0?au:e,o=i.options,a=o===void 0?au:o,u=i.plugins,c=u===void 0?wp:u,d=function(m,v,_){return _.startsWith(n)&&_.endsWith(n)&&_.replaceAll(n,"").length>0?".".concat(t):m},p=c.slice();p.push(function(m){m.type===dp&&m.value.includes("&")&&(m.props[0]=m.props[0].replace(Rq,n).replace(r,d))}),a.prefix&&p.push(oq),p.push(nq);var h=function(m,v,_,S){v===void 0&&(v=""),_===void 0&&(_=""),S===void 0&&(S="&"),t=S,n=v,r=new RegExp("\\".concat(n,"\\b"),"g");var x=m.replace($q,""),b=eq(_||v?"".concat(_," ").concat(v," { ").concat(x," }"):x);a.namespace&&(b=vM(b,a.namespace));var C=[];return _p(b,rq(p.concat(iq(function(k){return C.push(k)})))),C};return h.hash=c.length?c.reduce(function(m,v){return v.name||tl(15),su(m,v.name)},oM).toString():"",h}var Dq=new Tp,Jb=yM(),e1=er.createContext({shouldForwardProp:void 0,styleSheet:Dq,stylis:Jb});e1.Consumer;var Lq=er.createContext(void 0);function Mp(){return R.useContext(e1)}function Nq(e){var t=R.useState(e.stylisPlugins),n=t[0],r=t[1],i=Mp().styleSheet,o=R.useMemo(function(){var c=i;return e.sheet?c=e.sheet:e.target&&(c=c.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(c=c.reconstructWithOptions({useCSSOMInjection:!1})),c},[e.disableCSSOMInjection,e.sheet,e.target,i]),a=R.useMemo(function(){return yM({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})},[e.enableVendorPrefixes,e.namespace,n]);R.useEffect(function(){Uj(n,e.stylisPlugins)||r(e.stylisPlugins)},[e.stylisPlugins]);var u=R.useMemo(function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:o,stylis:a}},[e.shouldForwardProp,o,a]);return er.createElement(e1.Provider,{value:u},er.createElement(Lq.Provider,{value:a},e.children))}var _M=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=Jb);var a=r.name+o.hash;i.hasNameForId(r.id,a)||i.insertRules(r.id,a,o(r.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,Xb(this,function(){throw tl(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Jb),this.name+t.hash},e}(),Bq=function(e){return e>="A"&&e<="Z"};function bM(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(n===1&&r==="-"&&e[0]==="-")return e;Bq(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var xM=function(e){return e==null||e===!1||e===""},wM=function(e){var t,n,r=[];for(var i in e){var o=e[i];e.hasOwnProperty(i)&&!xM(o)&&(Array.isArray(o)&&o.isCss||Js(o)?r.push("".concat(bM(i),":"),o,";"):yf(o)?r.push.apply(r,eu(eu(["".concat(i," {")],wM(o),!1),["}"],!1)):r.push("".concat(bM(i),": ").concat((t=i,(n=o)==null||typeof n=="boolean"||n===""?"":typeof n!="number"||n===0||t in aq||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Za(e,t,n,r){if(xM(e))return[];if(Kb(e))return[".".concat(e.styledComponentId)];if(Js(e)){if(!Js(o=e)||o.prototype&&o.prototype.isReactComponent||!t)return[e];var i=e(t);return Za(i,t,n,r)}var o;return e instanceof _M?n?(e.inject(n,r),[e.getName(r)]):[e]:yf(e)?wM(e):Array.isArray(e)?Array.prototype.concat.apply(wp,e.map(function(a){return Za(a,t,n,r)})):[e.toString()]}function SM(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Js(n)&&!Kb(n))return!1}return!0}var Pq=aM(bp),Fq=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&SM(t),this.componentId=n,this.baseHash=su(Pq,n),this.baseStyle=r,Tp.registerId(n)}return e.prototype.generateAndInjectStyles=function(t,n,r){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,n,r):"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(this.componentId,this.staticRulesId))i=el(i,this.staticRulesId);else{var o=Cp(Za(this.rules,t,n,r)),a=Vb(su(this.baseHash,o)>>>0);if(!n.hasNameForId(this.componentId,a)){var u=r(o,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,u)}i=el(i,a),this.staticRulesId=a}else{for(var c=su(this.baseHash,r.hash),d="",p=0;p<this.rules.length;p++){var h=this.rules[p];if(typeof h=="string")d+=h;else if(h){var m=Cp(Za(h,t,n,r));c=su(c,m+p),d+=m}}if(d){var v=Vb(c>>>0);n.hasNameForId(this.componentId,v)||n.insertRules(this.componentId,v,r(d,".".concat(v),void 0,this.componentId)),i=el(i,v)}}return i},e}(),_f=er.createContext(void 0);_f.Consumer;function Op(e){var t=er.useContext(_f),n=R.useMemo(function(){return function(r,i){if(!r)throw tl(14);if(Js(r)){var o=r(i);return o}if(Array.isArray(r)||typeof r!="object")throw tl(8);return i?Er(Er({},i),r):r}(e.theme,t)},[e.theme,t]);return e.children?er.createElement(_f.Provider,{value:n},e.children):null}var t1={};function zq(e,t,n){var r=Kb(e),i=e,o=!Wb(e),a=t.attrs,u=a===void 0?wp:a,c=t.componentId,d=c===void 0?function(A,I){var $=typeof A!="string"?"sc":rM(A);t1[$]=(t1[$]||0)+1;var B="".concat($,"-").concat(Yb(bp+$+t1[$]));return I?"".concat(I,"-").concat(B):B}(t.displayName,t.parentComponentId):c,p=t.displayName,h=p===void 0?function(A){return Wb(A)?"styled.".concat(A):"Styled(".concat(dq(A),")")}(e):p,m=t.displayName&&t.componentId?"".concat(rM(t.displayName),"-").concat(t.componentId):t.componentId||d,v=r&&i.attrs?i.attrs.concat(u).filter(Boolean):u,_=t.shouldForwardProp;if(r&&i.shouldForwardProp){var S=i.shouldForwardProp;if(t.shouldForwardProp){var x=t.shouldForwardProp;_=function(A,I){return S(A,I)&&x(A,I)}}else _=S}var b=new Fq(n,m,r?i.componentStyle:void 0);function C(A,I){return function($,B,U){var G=$.attrs,P=$.componentStyle,K=$.defaultProps,re=$.foldedComponentIds,ue=$.styledComponentId,Z=$.target,ie=er.useContext(_f),V=Mp(),Q=$.shouldForwardProp||V.shouldForwardProp,ye=tM(B,ie,K)||au,Te=function(Ue,de,tt){for(var Ze,lt=Er(Er({},de),{className:void 0,theme:tt}),gt=0;gt<Ue.length;gt+=1){var je=Js(Ze=Ue[gt])?Ze(lt):Ze;for(var Se in je)lt[Se]=Se==="className"?el(lt[Se],je[Se]):Se==="style"?Er(Er({},lt[Se]),je[Se]):je[Se]}return de.className&&(lt.className=el(lt.className,de.className)),lt}(G,B,ye),T=Te.as||Z,X={};for(var ve in Te)Te[ve]===void 0||ve[0]==="$"||ve==="as"||ve==="theme"&&Te.theme===ye||(ve==="forwardedAs"?X.as=Te.forwardedAs:Q&&!Q(ve,T)||(X[ve]=Te[ve],Q||Xr.NODE_ENV));var L=function(Ue,de){var tt=Mp(),Ze=Ue.generateAndInjectStyles(de,tt.styleSheet,tt.stylis);return Ze}(P,Te),we=el(re,ue);return L&&(we+=" "+L),Te.className&&(we+=" "+Te.className),X[Wb(T)&&!nM.has(T)?"class":"className"]=we,U&&(X.ref=U),R.createElement(T,X)}(k,A,I)}C.displayName=h;var k=er.forwardRef(C);return k.attrs=v,k.componentStyle=b,k.displayName=h,k.shouldForwardProp=_,k.foldedComponentIds=r?el(i.foldedComponentIds,i.styledComponentId):"",k.styledComponentId=m,k.target=r?i.target:e,Object.defineProperty(k,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(A){this._foldedDefaultProps=r?function(I){for(var $=[],B=1;B<arguments.length;B++)$[B-1]=arguments[B];for(var U=0,G=$;U<G.length;U++)Qb(I,G[U],!0);return I}({},i.defaultProps,A):A}}),Xb(k,function(){return".".concat(k.styledComponentId)}),o&&hM(k,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),k}function CM(e,t){for(var n=[e[0]],r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}var EM=function(e){return Object.assign(e,{isCss:!0})};function fn(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Js(e)||yf(e))return EM(Za(CM(wp,eu([e],t,!0))));var r=e;return t.length===0&&r.length===1&&typeof r[0]=="string"?Za(r):EM(Za(CM(r,t)))}function n1(e,t,n){if(n===void 0&&(n=au),!t)throw tl(1,t);var r=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return e(t,n,fn.apply(void 0,eu([i],o,!1)))};return r.attrs=function(i){return n1(e,t,Er(Er({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},r.withConfig=function(i){return n1(e,t,Er(Er({},n),i))},r}var kM=function(e){return n1(zq,e)},z=kM;nM.forEach(function(e){z[e]=kM(e)});var Uq=function(){function e(t,n){this.rules=t,this.componentId=n,this.isStatic=SM(t),Tp.registerId(this.componentId+1)}return e.prototype.createStyles=function(t,n,r,i){var o=i(Cp(Za(this.rules,n,r,i)),""),a=this.componentId+t;r.insertRules(a,a,o)},e.prototype.removeStyles=function(t,n){n.clearRules(this.componentId+t)},e.prototype.renderStyles=function(t,n,r,i){t>2&&Tp.registerId(this.componentId+t),this.removeStyles(t,r),this.createStyles(t,n,r,i)},e}();function Rp(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=fn.apply(void 0,eu([e],t,!1)),i="sc-global-".concat(Yb(JSON.stringify(r))),o=new Uq(r,i),a=function(c){var d=Mp(),p=er.useContext(_f),h=er.useRef(d.styleSheet.allocateGSInstance(i)).current;return d.styleSheet.server&&u(h,c,d.styleSheet,p,d.stylis),er.useLayoutEffect(function(){if(!d.styleSheet.server)return u(h,c,d.styleSheet,p,d.stylis),function(){return o.removeStyles(h,d.styleSheet)}},[h,c,d.styleSheet,p,d.stylis]),null};function u(c,d,p,h,m){if(o.isStatic)o.renderStyles(c,lq,p,m);else{var v=Er(Er({},d),{theme:tM(d,h,a.defaultProps)});o.renderStyles(c,v,p,m)}}return er.memo(a)}function AM(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Cp(fn.apply(void 0,eu([e],t,!1))),i=Yb(r);return new _M(i,r)}const jt={CHAT_HISTORY:"chat_history",CLICKED_QUESTIONS:"clicked_questions",PENDING_BULK_ITEMS:"pending_bulk_items",LAST_SHOWN_MESSAGE_ID:"last_shown_message_id",HIDDEN_DYNAMIC_SUGGESTED_QUESTIONS:"hidden_dynamic_suggested_questions",CHAT_RATING:"chat_rating",SHOPIFY_META_DATA:"shopify_meta_data",SESSION_ID:"session_id",USER_INFO:"user_info",IS_FORM_CLOSED_BY_USER:"is_form_closed_by_user"};var $p={USER:"anurag",npm_config_user_agent:"pnpm/10.7.1 npm/? node/v20.11.1 linux x64",npm_node_execpath:"/home/anurag/.local/share/pnpm/nodejs/22.15.0/bin/node",WT_PROFILE_ID:"{51855cb2-8cce-5362-8f54-464b92b32386}",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/anurag",OLDPWD:"/home/anurag",LESS:"-R",npm_package_json:"/home/anurag/workstation/debales/debales/packages/ai/package.json",ZSH:"/home/anurag/.oh-my-zsh",LSCOLORS:"Gxfxcxdxbxegedabagacad",PAGER:"less",npm_config_userconfig:"/home/anurag/.npmrc",npm_config_local_prefix:"/home/anurag/workstation/debales/debales/packages/ai",DBUS_SESSION_BUS_ADDRESS:"unix:path=/run/user/1000/bus",P9K_TTY:"old",npm_config_engine_strict:"true",WSL_DISTRO_NAME:"Ubuntu",COLOR:"0",npm_config_otp:"528141",WAYLAND_DISPLAY:"wayland-0",LOGNAME:"anurag",PULSE_SERVER:"unix:/mnt/wslg/PulseServer",WSL_INTEROP:"/run/WSL/405_interop",NAME:"Anurag-PC",_P9K_SSH_TTY:"/dev/pts/0",_:"/home/anurag/.local/share/pnpm/pnpm",npm_config_prefix:"/home/anurag/.local/share/pnpm/nodejs/22.15.0",npm_config_npm_version:"10.9.2",npm_config_registry:"https://registry.npmjs.org/",TERM:"xterm-256color",npm_config_cache:"/home/anurag/.npm",npm_config_node_gyp:"/home/anurag/.local/share/pnpm/nodejs/22.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/anurag/workstation/debales/debales/packages/ai/node_modules/.bin:/home/anurag/workstation/debales/debales/packages/node_modules/.bin:/home/anurag/workstation/debales/debales/node_modules/.bin:/home/anurag/workstation/debales/node_modules/.bin:/home/anurag/workstation/node_modules/.bin:/home/anurag/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/home/anurag/.local/share/pnpm/nodejs/22.15.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/anurag/workstation/debales/debales/packages/ai/node_modules/.bin:/snapshot/dist/node-gyp-bin:/home/anurag/workstation/debales/debales/node_modules/.bin:/home/anurag/workstation/debales/debales/packages/ai/node_modules/.bin:/snapshot/dist/node-gyp-bin:/home/anurag/workstation/debales/debales/node_modules/.bin:/home/anurag/workstation/debales/debales/node_modules/.bin:/snapshot/dist/node-gyp-bin:/home/anurag/workstation/debales/debales/node_modules/.bin:/home/anurag/.local/share/pnpm/.tools/@pnpm+linux-x64/10.7.1/bin:/home/anurag/.gvm/bin:/mnt/c/Users/anura/AppData/Local/Programs/cursor/resources/app/bin:/home/anurag/go/bin:/usr/local/go/bin:/home/anurag/bin:/usr/local/bin:/home/anurag/.local/share/pnpm:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program:Files:(x86)/NVIDIA:Corporation/PhysX/Common:Files/NVIDIA:Corporation/NVIDIA:app/NvDLISR:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:Files/Docker/Docker/resources/bin:/mnt/c/Users/anura/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/anura/AppData/Local/Programs/Microsoft:VS:Code/bin:/home/linuxbrew/.linuxbrew/bin",NODE:"/home/anurag/.local/share/pnpm/nodejs/22.15.0/bin/node",npm_package_name:"@debales/ai",XDG_RUNTIME_DIR:"/run/user/1000/",WT_SESSION:"a0623060-60a9-4845-abe8-ec6f6135df73",npm_config_frozen_lockfile:"",DISPLAY:":0",LANG:"C.UTF-8",LS_COLORS:"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:",npm_lifecycle_script:"tsc -b && vite build --config vite.browser.config.ts",GVM_VERSION:"1.0.22",SHELL:"/usr/bin/zsh",NODE_PATH:"/home/anurag/workstation/debales/debales/node_modules/.pnpm/vite@6.2.5_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.2_terser@5.39.0_yaml@2.7.1/node_modules/vite/bin/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/vite@6.2.5_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.2_terser@5.39.0_yaml@2.7.1/node_modules/vite/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/vite@6.2.5_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.2_terser@5.39.0_yaml@2.7.1/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/@changesets+cli@2.28.1/node_modules/@changesets/cli/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/@changesets+cli@2.28.1/node_modules/@changesets/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/@changesets+cli@2.28.1/node_modules:/home/anurag/workstation/debales/debales/node_modules/.pnpm/node_modules:/home/anurag/.local/share/pnpm/global/5/.pnpm/@pnpm+exe@10.6.3/node_modules/@pnpm/exe/node_modules:/home/anurag/.local/share/pnpm/global/5/.pnpm/@pnpm+exe@10.6.3/node_modules/@pnpm/node_modules:/home/anurag/.local/share/pnpm/global/5/.pnpm/@pnpm+exe@10.6.3/node_modules:/home/anurag/.local/share/pnpm/global/5/.pnpm/node_modules",npm_package_version:"1.1.13",npm_config_verify_deps_before_run:"false",npm_config_access:"public",npm_lifecycle_event:"build:browser",npm_config_tag:"latest",P9K_SSH:"0",npm_config_globalconfig:"/home/anurag/.config/pnpm/npmrc",npm_config_init_module:"/home/anurag/.npm-init.js",PWD:"/home/anurag/workstation/debales/debales/packages/ai",npm_execpath:"/home/anurag/.local/share/pnpm/nodejs/22.15.0/lib/node_modules/npm/bin/npm-cli.js",GVM_ROOT:"/home/anurag/.gvm",_P9K_TTY:"/dev/pts/0",npm_config_global_prefix:"/home/anurag/.local/share/pnpm/nodejs/22.15.0",PNPM_SCRIPT_SRC_DIR:"/home/anurag/workstation/debales/debales/packages/ai",npm_command:"run-script",BREW_HOME:"/home/linuxbrew/.linuxbrew/bin",HOSTTYPE:"x86_64",WSL2_GUI_APPS_ENABLED:"1",PNPM_HOME:"/home/anurag/.local/share/pnpm",GVM_PATH_BACKUP:"/home/anurag/.gvm/bin:/mnt/c/Users/anura/AppData/Local/Programs/cursor/resources/app/bin:/home/anurag/go/bin:/usr/local/go/bin:/home/anurag/bin:/usr/local/bin:/home/anurag/.local/share/pnpm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA app/NvDLISR:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Users/anura/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/anura/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/anura/AppData/Local/Programs/cursor/resources/app/bin:/home/linuxbrew/.linuxbrew/bin",WSLENV:"WT_SESSION:WT_PROFILE_ID:",INIT_CWD:"/home/anurag/workstation/debales/debales/packages/ai",npm_config_json:"true",EDITOR:"vi",NODE_ENV:"production"},it;if(typeof window>"u"){var IM={hostname:""};it={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:IM,referrer:""},screen:{width:0,height:0},location:IM,addEventListener:function(){},removeEventListener:function(){}}}else it=window;function TM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function MM(e,t,n,r,i,o,a){try{var u=e[o](a),c=u.value}catch(d){n(d);return}u.done?t(c):Promise.resolve(c).then(r,i)}function r1(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(c){MM(o,r,i,a,u,"next",c)}function u(c){MM(o,r,i,a,u,"throw",c)}a(void 0)})}}function Dp(e,t,n){return OM()?Dp=Reflect.construct:Dp=function(i,o,a){var u=[null];u.push.apply(u,o);var c=Function.bind.apply(i,u),d=new c;return a&&xf(d,a.prototype),d},Dp.apply(null,arguments)}function jq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Dr(e,t,n){return t&&jq(e.prototype,t),e}function rn(){return rn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rn.apply(this,arguments)}function i1(e){return i1=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},i1(e)}function Jr(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}}),t&&xf(e,t)}function Rt(e,t){return t!=null&&typeof Symbol<"u"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function qq(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function bf(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function xf(e,t){return xf=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},xf(e,t)}function Vt(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function Hq(e,t){if(e){if(typeof e=="string")return TM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TM(e,t)}}function Lp(e){var t=typeof Map=="function"?new Map:void 0;return Lp=function(r){if(r===null||!qq(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return Dp(r,arguments,i1(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),xf(i,r)},Lp(e)}function OM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OM=function(){return!!e})()}function dt(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=Hq(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function wf(e,t){var n,r,i,o,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(d){return function(p){return c([d,p])}}function c(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=d[0]&2?r.return:d[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,d[1])).done)return i;switch(r=0,i&&(d=[d[0]&2,i.value]),d[0]){case 0:case 1:i=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,r=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(i=a.trys,!(i=i.length>0&&i[i.length-1])&&(d[0]===6||d[0]===2)){a=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]<i[3])){a.label=d[1];break}if(d[0]===6&&a.label<i[1]){a.label=i[1],i=d;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(d);break}i[2]&&a.ops.pop(),a.trys.pop();continue}d=t.call(e,a)}catch(p){d=[6,p],r=0}finally{n=i=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function RM(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var Gq=Object.defineProperty,Vq=function(e,t,n){return t in e?Gq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ke=function(e,t,n){return Vq(e,(typeof t>"u"?"undefined":Vt(t))!=="symbol"?t+"":t,n)},$M,Zq=Object.defineProperty,Yq=function(e,t,n){return t in e?Zq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},DM=function(e,t,n){return Yq(e,(typeof t>"u"?"undefined":Vt(t))!=="symbol"?t+"":t,n)},br=function(e){return e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e}(br||{}),LM={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},NM={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Np={},Wq=function(){return!!globalThis.Zone};function o1(e){if(Np[e])return Np[e];var t=globalThis[e],n=t.prototype,r=e in LM?LM[e]:void 0,i=!!(r&&r.every(function(p){var h,m;return!!((m=(h=Object.getOwnPropertyDescriptor(n,p))==null?void 0:h.get)!=null&&m.toString().includes("[native code]"))})),o=e in NM?NM[e]:void 0,a=!!(o&&o.every(function(p){var h;return typeof n[p]=="function"&&((h=n[p])==null?void 0:h.toString().includes("[native code]"))}));if(i&&a&&!Wq())return Np[e]=t.prototype,t.prototype;try{var u=document.createElement("iframe");document.body.appendChild(u);var c=u.contentWindow;if(!c)return t.prototype;var d=c[e].prototype;return document.body.removeChild(u),d?Np[e]=d:n}catch{return n}}var a1={};function Ya(e,t,n){var r,i=e+"."+String(n);if(a1[i])return a1[i].call(t);var o=o1(e),a=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return a?(a1[i]=a,a.call(t)):t[n]}var s1={};function BM(e,t,n){var r=e+"."+String(n);if(s1[r])return s1[r].bind(t);var i=o1(e),o=i[n];return typeof o!="function"?t[n]:(s1[r]=o,o.bind(t))}function Kq(e){return Ya("Node",e,"childNodes")}function Qq(e){return Ya("Node",e,"parentNode")}function Xq(e){return Ya("Node",e,"parentElement")}function Jq(e){return Ya("Node",e,"textContent")}function eH(e,t){return BM("Node",e,"contains")(t)}function tH(e){return BM("Node",e,"getRootNode")()}function nH(e){return!e||!("host"in e)?null:Ya("ShadowRoot",e,"host")}function rH(e){return e.styleSheets}function iH(e){return!e||!("shadowRoot"in e)?null:Ya("Element",e,"shadowRoot")}function oH(e,t){return Ya("Element",e,"querySelector")(t)}function aH(e,t){return Ya("Element",e,"querySelectorAll")(t)}function sH(){return o1("MutationObserver").constructor}var ei={childNodes:Kq,parentNode:Qq,parentElement:Xq,textContent:Jq,contains:eH,getRootNode:tH,host:nH,styleSheets:rH,shadowRoot:iH,querySelector:oH,querySelectorAll:aH,mutationObserver:sH};function PM(e){return e.nodeType===e.ELEMENT_NODE}function Sf(e){var t=e&&"host"in e&&"mode"in e&&ei.host(e)||null;return!!(t&&"shadowRoot"in t&&ei.shadowRoot(t)===e)}function Cf(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function lH(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function uH(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url("+JSON.stringify(e.href)+")"];return e.layerName===""?n.push("layer"):e.layerName&&n.push("layer("+e.layerName+")"),e.supportsText&&n.push("supports("+e.supportsText+")"),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function l1(e){try{var t=e.rules||e.cssRules;if(!t)return null;var n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);var r=Array.from(t,function(i){return FM(i,n)}).join("");return lH(r)}catch{return null}}function FM(e,t){if(fH(e)){var n;try{n=l1(e.styleSheet)||uH(e)}catch{n=e.cssText}return e.styleSheet.href?Bp(n,e.styleSheet.href):n}else{var r=e.cssText;return dH(e)&&e.selectorText.includes(":")&&(r=cH(r)),t?Bp(r,t):r}}function cH(e){var t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function fH(e){return"styleSheet"in e}function dH(e){return"selectorText"in e}var zM=function(){function e(){DM(this,"idNodeMap",new Map),DM(this,"nodeMetaMap",new WeakMap)}var t=e.prototype;return t.getId=function(r){var i;if(!r)return-1;var o=(i=this.getMeta(r))==null?void 0:i.id;return o??-1},t.getNode=function(r){return this.idNodeMap.get(r)||null},t.getIds=function(){return Array.from(this.idNodeMap.keys())},t.getMeta=function(r){return this.nodeMetaMap.get(r)||null},t.removeNodeFromMap=function(r){var i=this,o=this.getId(r);this.idNodeMap.delete(o),r.childNodes&&r.childNodes.forEach(function(a){return i.removeNodeFromMap(a)})},t.has=function(r){return this.idNodeMap.has(r)},t.hasNode=function(r){return this.nodeMetaMap.has(r)},t.add=function(r,i){var o=i.id;this.idNodeMap.set(o,r),this.nodeMetaMap.set(r,i)},t.replace=function(r,i){var o=this.getNode(r);if(o){var a=this.nodeMetaMap.get(o);a&&this.nodeMetaMap.set(i,a)}this.idNodeMap.set(r,i)},t.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function hH(){return new zM}function u1(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.value,a=e.maskInputFn,u=o||"",c=i&&nl(i);return(n[r.toLowerCase()]||c&&n[c])&&(a?u=a(u,t):u="*".repeat(u.length)),u}function nl(e){return e.toLowerCase()}var UM="__rrweb_original__";function pH(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var i=0;i<e.height;i+=n){var o=t.getImageData,a=UM in o?o[UM]:o,u=new Uint32Array(a.call(t,r,i,Math.min(n,e.width-r),Math.min(n,e.height-i)).data.buffer);if(u.some(function(c){return c!==0}))return!1}return!0}function c1(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?nl(t):null}function jM(e,t){var n;try{n=new URL(e,t??window.location.href)}catch{return null}var r=/\.([0-9a-z]+)(?:$)/i,i=n.pathname.match(r),o;return(o=i==null?void 0:i[1])!=null?o:null}function gH(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var mH=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,vH=/^(?:[a-z+]+:)?\/\//i,yH=/^www\..*/i,_H=/^(data:)([^,]*),(.*)/i;function Bp(e,t){return(e||"").replace(mH,function(n,r,i,o,a,u){var c=i||a||u,d=r||o||"";if(!c)return n;if(vH.test(c)||yH.test(c)||_H.test(c))return"url("+d+c+d+")";if(c[0]==="/")return"url("+d+(gH(t)+c)+d+")";var p=t.split("/"),h=c.split("/");p.pop();for(var m=dt(h),v;!(v=m()).done;){var _=v.value;_!=="."&&(_===".."?p.pop():p.push(_))}return"url("+d+p.join("/")+d+")"})}function f1(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function bH(e,t){var n=Array.from(t.childNodes),r=[];if(n.length>1&&e&&typeof e=="string"){for(var i=f1(e),o=1;o<n.length;o++)if(n[o].textContent&&typeof n[o].textContent=="string")for(var a=f1(n[o].textContent),u=3;u<a.length;u++){var c=a.substring(0,u);if(i.split(c).length===2){for(var d=i.indexOf(c),p=d;p<e.length;p++)if(f1(e.substring(0,p)).length===d){r.push(e.substring(0,p)),e=e.substring(p);break}break}}}return r.push(e),r}function xH(e,t){return bH(e,t).join("/* rr_split */")}var wH=1,SH=new RegExp("[^a-z0-9-_:]"),Ef=-2;function qM(){return wH++}function CH(e){if(Rt(e,HTMLFormElement))return"form";var t=nl(e.tagName);return SH.test(t)?"div":t}var lu,HM,EH=/^[^ \t\n\r\u000c]+/,kH=/^[, \t\n\r\u000c]+/;function AH(e,t){if(t.trim()==="")return t;var n=0;function r(d){var p,h=d.exec(t.substring(n));return h?(p=h[0],n+=p.length,p):""}for(var i=[];r(kH),!(n>=t.length);){var o=r(EH);if(o.slice(-1)===",")o=uu(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=uu(e,o);for(var u=!1;;){var c=t.charAt(n);if(c===""){i.push((o+a).trim());break}else if(u)c===")"&&(u=!1);else if(c===","){n+=1,i.push((o+a).trim());break}else c==="("&&(u=!0);a+=c,n+=1}}}return i.join(", ")}var GM=new WeakMap;function uu(e,t){return!t||t.trim()===""?t:d1(e,t)}function IH(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function d1(e,t){var n=GM.get(e);if(n||(n=e.createElement("a"),GM.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function VM(e,t,n,r){return r&&(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r[0]!=="#"||n==="background"&&(t==="table"||t==="td"||t==="th")?uu(e,r):n==="srcset"?AH(e,r):n==="style"?Bp(r,d1(e)):t==="object"&&n==="data"?uu(e,r):r)}function ZM(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function TH(e,t,n){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function Pp(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Pp(ei.parentNode(e),t,n):!1;for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return n?Pp(ei.parentNode(e),t,n):!1}function YM(e,t,n,r){var i;if(PM(e)){if(i=e,!ei.childNodes(i).length)return!1}else{if(ei.parentElement(e)===null)return!1;i=ei.parentElement(e)}try{if(typeof t=="string"){if(r){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(Pp(i,t,r))return!0;if(n){if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}}catch{}return!1}function MH(e,t,n){var r=e.contentWindow;if(r){var i=!1,o;try{o=r.document.readyState}catch{return}if(o!=="complete"){var a=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener("load",function(){clearTimeout(a),i=!0,t()});return}var u="about:blank";if(r.location.href!==u||e.src===u||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function OH(e,t,n){var r=!1,i;try{i=e.sheet}catch{return}if(!i){var o=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(o),r=!0,t()})}}function RH(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,a=t.needsMask,u=t.inlineStylesheet,c=t.maskInputOptions,d=c===void 0?{}:c,p=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,v=m===void 0?{}:m,_=t.inlineImages,S=t.recordCanvas,x=t.keepIframeSrcFn,b=t.newlyAddedElement,C=b===void 0?!1:b,k=t.cssCaptured,A=k===void 0?!1:k,I=$H(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:br.Document,childNodes:[],compatMode:e.compatMode}:{type:br.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:br.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return LH(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:u,maskInputOptions:d,maskInputFn:h,dataURLOptions:v,inlineImages:_,recordCanvas:S,keepIframeSrcFn:x,newlyAddedElement:C,rootId:I});case e.TEXT_NODE:return DH(e,{doc:n,needsMask:a,maskTextFn:p,rootId:I,cssCaptured:A});case e.CDATA_SECTION_NODE:return{type:br.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:br.Comment,textContent:ei.textContent(e)||"",rootId:I};default:return!1}}function $H(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function DH(e,t){var n=t.needsMask,r=t.maskTextFn,i=t.rootId,o=t.cssCaptured,a=ei.parentNode(e),u=a&&a.tagName,c="",d=u==="STYLE"?!0:void 0,p=u==="SCRIPT"?!0:void 0;return p?c="SCRIPT_PLACEHOLDER":o||(c=ei.textContent(e),d&&c&&(c=Bp(c,d1(t.doc)))),!d&&!p&&c&&n&&(c=r?r(c,ei.parentElement(e)):c.replace(/[\S]/g,"*")),{type:br.Text,textContent:c||"",rootId:i}}function LH(e,t){for(var n=t.doc,r=t.blockClass,i=t.blockSelector,o=t.inlineStylesheet,a=t.maskInputOptions,u=a===void 0?{}:a,c=t.maskInputFn,d=t.dataURLOptions,p=d===void 0?{}:d,h=t.inlineImages,m=t.recordCanvas,v=t.keepIframeSrcFn,_=t.newlyAddedElement,S=_===void 0?!1:_,x=t.rootId,b=TH(e,r,i),C=CH(e),k={},A=e.attributes.length,I=0;I<A;I++){var $=e.attributes[I];ZM(C,$.name,$.value)||(k[$.name]=VM(n,C,nl($.name),$.value))}if(C==="link"&&o){var B=Array.from(n.styleSheets).find(function(we){return we.href===e.href}),U=null;B&&(U=l1(B)),U&&(delete k.rel,delete k.href,k._cssText=U)}if(C==="style"&&e.sheet){var G=l1(e.sheet);G&&(e.childNodes.length>1&&(G=xH(G,e)),k._cssText=G)}if(C==="input"||C==="textarea"||C==="select"){var P=e.value,K=e.checked;k.type!=="radio"&&k.type!=="checkbox"&&k.type!=="submit"&&k.type!=="button"&&P?k.value=u1({element:e,type:c1(e),tagName:C,value:P,maskInputOptions:u,maskInputFn:c}):K&&(k.checked=K)}if(C==="option"&&(e.selected&&!u.select?k.selected=!0:delete k.selected),C==="dialog"&&e.open&&(k.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),C==="canvas"&&m){if(e.__context==="2d")pH(e)||(k.rr_dataURL=e.toDataURL(p.type,p.quality));else if(!("__context"in e)){var re=e.toDataURL(p.type,p.quality),ue=n.createElement("canvas");ue.width=e.width,ue.height=e.height;var Z=ue.toDataURL(p.type,p.quality);re!==Z&&(k.rr_dataURL=re)}}if(C==="img"&&h){lu||(lu=n.createElement("canvas"),HM=lu.getContext("2d"));var ie=e,V=ie.currentSrc||ie.getAttribute("src")||"<unknown-src>",Q=ie.crossOrigin,ye=function(){ie.removeEventListener("load",ye);try{lu.width=ie.naturalWidth,lu.height=ie.naturalHeight,HM.drawImage(ie,0,0),k.rr_dataURL=lu.toDataURL(p.type,p.quality)}catch(we){if(ie.crossOrigin!=="anonymous"){ie.crossOrigin="anonymous",ie.complete&&ie.naturalWidth!==0?ye():ie.addEventListener("load",ye);return}else console.warn("Cannot inline img src="+V+"! Error: "+we)}ie.crossOrigin==="anonymous"&&(Q?k.crossOrigin=Q:ie.removeAttribute("crossorigin"))};ie.complete&&ie.naturalWidth!==0?ye():ie.addEventListener("load",ye)}if(C==="audio"||C==="video"){var Te=k;Te.rr_mediaState=e.paused?"paused":"played",Te.rr_mediaCurrentTime=e.currentTime,Te.rr_mediaPlaybackRate=e.playbackRate,Te.rr_mediaMuted=e.muted,Te.rr_mediaLoop=e.loop,Te.rr_mediaVolume=e.volume}if(S||(e.scrollLeft&&(k.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(k.rr_scrollTop=e.scrollTop)),b){var T=e.getBoundingClientRect(),X=T.width,ve=T.height;k={class:k.class,rr_width:""+X+"px",rr_height:""+ve+"px"}}C==="iframe"&&!v(k.src)&&(e.contentDocument||(k.rr_src=k.src),delete k.src);var L;try{customElements.get(C)&&(L=!0)}catch{}return{type:br.Element,tagName:C,attributes:k,childNodes:[],isSVG:IH(e)||void 0,needBlock:b,rootId:x,isCustom:L}}function An(e){return e==null?"":e.toLowerCase()}function NH(e,t){if(t.comment&&e.type===br.Comment)return!0;if(e.type===br.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&jM(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(An(e.attributes.name).match(/^msapplication-tile(image|color)$/)||An(e.attributes.name)==="application-name"||An(e.attributes.rel)==="icon"||An(e.attributes.rel)==="apple-touch-icon"||An(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&An(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(An(e.attributes.property).match(/^(og|twitter|fb):/)||An(e.attributes.name).match(/^(og|twitter):/)||An(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(An(e.attributes.name)==="robots"||An(e.attributes.name)==="googlebot"||An(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(An(e.attributes.name)==="author"||An(e.attributes.name)==="generator"||An(e.attributes.name)==="framework"||An(e.attributes.name)==="publisher"||An(e.attributes.name)==="progid"||An(e.attributes.property).match(/^article:/)||An(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(An(e.attributes.name)==="google-site-verification"||An(e.attributes.name)==="yandex-verification"||An(e.attributes.name)==="csrf-token"||An(e.attributes.name)==="p:domain_verify"||An(e.attributes.name)==="verify-v1"||An(e.attributes.name)==="verification"||An(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function cu(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,a=t.maskTextClass,u=t.maskTextSelector,c=t.skipChild,d=c===void 0?!1:c,p=t.inlineStylesheet,h=p===void 0?!0:p,m=t.maskInputOptions,v=m===void 0?{}:m,_=t.maskTextFn,S=t.maskInputFn,x=t.slimDOMOptions,b=t.dataURLOptions,C=b===void 0?{}:b,k=t.inlineImages,A=k===void 0?!1:k,I=t.recordCanvas,$=I===void 0?!1:I,B=t.onSerialize,U=t.onIframeLoad,G=t.iframeLoadTimeout,P=G===void 0?5e3:G,K=t.onStylesheetLoad,re=t.stylesheetLoadTimeout,ue=re===void 0?5e3:re,Z=t.keepIframeSrcFn,ie=Z===void 0?function(){return!1}:Z,V=t.newlyAddedElement,Q=V===void 0?!1:V,ye=t.cssCaptured,Te=ye===void 0?!1:ye,T=t.needsMask,X=t.preserveWhiteSpace,ve=X===void 0?!0:X;if(!T){var L=T===void 0;T=YM(e,a,u,L)}var we=RH(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:T,inlineStylesheet:h,maskInputOptions:v,maskTextFn:_,maskInputFn:S,dataURLOptions:C,inlineImages:A,recordCanvas:$,keepIframeSrcFn:ie,newlyAddedElement:Q,cssCaptured:Te});if(!we)return console.warn(e,"not serialized"),null;var Ue;r.hasNode(e)?Ue=r.getId(e):NH(we,x)||!ve&&we.type===br.Text&&!we.textContent.replace(/^\s+|\s+$/gm,"").length?Ue=Ef:Ue=qM();var de=Object.assign(we,{id:Ue});if(r.add(e,de),Ue===Ef)return null;B&&B(e);var tt=!d;if(de.type===br.Element){tt=tt&&!de.needBlock,delete de.needBlock;var Ze=ei.shadowRoot(e);Ze&&Cf(Ze)&&(de.isShadowHost=!0)}if((de.type===br.Document||de.type===br.Element)&&tt){x.headWhitespace&&de.type===br.Element&&de.tagName==="head"&&(ve=!1);var lt={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:T,maskTextClass:a,maskTextSelector:u,skipChild:d,inlineStylesheet:h,maskInputOptions:v,maskTextFn:_,maskInputFn:S,slimDOMOptions:x,dataURLOptions:C,inlineImages:A,recordCanvas:$,preserveWhiteSpace:ve,onSerialize:B,onIframeLoad:U,iframeLoadTimeout:P,onStylesheetLoad:K,stylesheetLoadTimeout:ue,keepIframeSrcFn:ie,cssCaptured:!1};if(!(de.type===br.Element&&de.tagName==="textarea"&&de.attributes.value!==void 0)){de.type===br.Element&&de.attributes._cssText!==void 0&&typeof de.attributes._cssText=="string"&&(lt.cssCaptured=!0);for(var gt=dt(Array.from(ei.childNodes(e))),je;!(je=gt()).done;){var Se=je.value,Ye=cu(Se,lt);Ye&&de.childNodes.push(Ye)}}var Qe=null;if(PM(e)&&(Qe=ei.shadowRoot(e)))for(var ot=dt(Array.from(ei.childNodes(Qe))),et;!(et=ot()).done;){var He=et.value,N=cu(He,lt);N&&(Cf(Qe)&&(N.isShadow=!0),de.childNodes.push(N))}}var F=ei.parentNode(e);return F&&Sf(F)&&Cf(F)&&(de.isShadow=!0),de.type===br.Element&&de.tagName==="iframe"&&MH(e,function(){var Y=e.contentDocument;if(Y&&U){var ge=cu(Y,{doc:Y,mirror:r,blockClass:i,blockSelector:o,needsMask:T,maskTextClass:a,maskTextSelector:u,skipChild:!1,inlineStylesheet:h,maskInputOptions:v,maskTextFn:_,maskInputFn:S,slimDOMOptions:x,dataURLOptions:C,inlineImages:A,recordCanvas:$,preserveWhiteSpace:ve,onSerialize:B,onIframeLoad:U,iframeLoadTimeout:P,onStylesheetLoad:K,stylesheetLoadTimeout:ue,keepIframeSrcFn:ie});ge&&U(e,ge)}},P),de.type===br.Element&&de.tagName==="link"&&typeof de.attributes.rel=="string"&&(de.attributes.rel==="stylesheet"||de.attributes.rel==="preload"&&typeof de.attributes.href=="string"&&jM(de.attributes.href)==="css")&&OH(e,function(){if(K){var Y=cu(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:T,maskTextClass:a,maskTextSelector:u,skipChild:!1,inlineStylesheet:h,maskInputOptions:v,maskTextFn:_,maskInputFn:S,slimDOMOptions:x,dataURLOptions:C,inlineImages:A,recordCanvas:$,preserveWhiteSpace:ve,onSerialize:B,onIframeLoad:U,iframeLoadTimeout:P,onStylesheetLoad:K,stylesheetLoadTimeout:ue,keepIframeSrcFn:ie});Y&&K(e,Y)}},ue),de}function BH(e,t){var n=t||{},r=n.mirror,i=r===void 0?new zM:r,o=n.blockClass,a=o===void 0?"rr-block":o,u=n.blockSelector,c=u===void 0?null:u,d=n.maskTextClass,p=d===void 0?"rr-mask":d,h=n.maskTextSelector,m=h===void 0?null:h,v=n.inlineStylesheet,_=v===void 0?!0:v,S=n.inlineImages,x=S===void 0?!1:S,b=n.recordCanvas,C=b===void 0?!1:b,k=n.maskAllInputs,A=k===void 0?!1:k,I=n.maskTextFn,$=n.maskInputFn,B=n.slimDOM,U=B===void 0?!1:B,G=n.dataURLOptions,P=n.preserveWhiteSpace,K=n.onSerialize,re=n.onIframeLoad,ue=n.iframeLoadTimeout,Z=n.onStylesheetLoad,ie=n.stylesheetLoadTimeout,V=n.keepIframeSrcFn,Q=V===void 0?function(){return!1}:V,ye=A===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:A===!1?{password:!0}:A,Te=U===!0||U==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:U==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:U===!1?{}:U;return cu(e,{doc:e,mirror:i,blockClass:a,blockSelector:c,maskTextClass:p,maskTextSelector:m,skipChild:!1,inlineStylesheet:_,maskInputOptions:ye,maskTextFn:I,maskInputFn:$,slimDOMOptions:Te,dataURLOptions:G,inlineImages:x,recordCanvas:C,preserveWhiteSpace:P,onSerialize:K,onIframeLoad:re,iframeLoadTimeout:ue,onStylesheetLoad:Z,stylesheetLoadTimeout:ie,keepIframeSrcFn:Q,newlyAddedElement:!1})}function PH(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function FH(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return Rt(this,r)?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var h1={exports:{}},On=String,WM=function(){return{isColorSupported:!1,reset:On,bold:On,dim:On,italic:On,underline:On,inverse:On,hidden:On,strikethrough:On,black:On,red:On,green:On,yellow:On,blue:On,magenta:On,cyan:On,white:On,gray:On,bgBlack:On,bgRed:On,bgGreen:On,bgYellow:On,bgBlue:On,bgMagenta:On,bgCyan:On,bgWhite:On}};h1.exports=WM(),h1.exports.createColors=WM;var zH=h1.exports,UH={},jH=Object.freeze(Object.defineProperty({__proto__:null,default:UH},Symbol.toStringTag,{value:"Module"})),nr=FH(jH),KM=zH,QM=nr,p1=function(e){Jr(t,e);function t(r,i,o,a,u,c){var d;return d=e.call(this,r)||this,d.name="CssSyntaxError",d.reason=r,u&&(d.file=u),a&&(d.source=a),c&&(d.plugin=c),typeof i<"u"&&typeof o<"u"&&(typeof i=="number"?(d.line=i,d.column=o):(d.line=i.line,d.column=i.column,d.endLine=o.line,d.endColumn=o.column)),d.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(d,t),d}var n=t.prototype;return n.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},n.showSourceCode=function(i){var o=this;if(!this.source)return"";var a=this.source;i==null&&(i=KM.isColorSupported),QM&&i&&(a=QM(a));var u=a.split(/\r?\n/),c=Math.max(this.line-3,0),d=Math.min(this.line+2,u.length),p=String(d).length,h,m;if(i){var v=KM.createColors(!0),_=v.bold,S=v.gray,x=v.red;h=function(b){return _(x(b))},m=function(b){return S(b)}}else h=m=function(b){return b};return u.slice(c,d).map(function(b,C){var k=c+1+C,A=" "+(" "+k).slice(-p)+" | ";if(k===o.line){var I=m(A.replace(/\d/g," "))+b.slice(0,o.column-1).replace(/[^\t]/g," ");return h(">")+m(A)+b+`
82
82
  `+I+h("^")}return" "+m(A)+b}).join(`
83
83
  `)},n.toString=function(){var i=this.showSourceCode();return i&&(i=`
84
84
 
@@ -136,7 +136,7 @@ or you can use record.mirror to access the mirror instance during recording.`,qR
136
136
  `+m+"]":"["+v.join(",")+"]",a=m,p}for(d in _)Bg.call(_,d)&&(p=r(d,_),p&&v.push(n(d)+(a?": ":":")+p));return p=v.length===0?"{}":a?"{"+v.join(",")+m+"}":"{"+v.join(",")+"}",a=m,p}};return r("",{"":t})}}(),O.JSONDecode=function(){var e,t,n={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
137
137
  `,r:"\r",t:" "},r,i=function(v){var _=new SyntaxError(v);throw _.at=e,_.text=r,_},o=function(v){return v&&v!==t&&i("Expected '"+v+"' instead of '"+t+"'"),t=r.charAt(e),e+=1,t},a=function(){var v,_="";for(t==="-"&&(_="-",o("-"));t>="0"&&t<="9";)_+=t,o();if(t===".")for(_+=".";o()&&t>="0"&&t<="9";)_+=t;if(t==="e"||t==="E")for(_+=t,o(),(t==="-"||t==="+")&&(_+=t,o());t>="0"&&t<="9";)_+=t,o();if(v=+_,!isFinite(v))i("Bad number");else return v},u=function(){var v,_,S="",x;if(t==='"')for(;o();){if(t==='"')return o(),S;if(t==="\\")if(o(),t==="u"){for(x=0,_=0;_<4&&(v=parseInt(o(),16),!!isFinite(v));_+=1)x=x*16+v;S+=String.fromCharCode(x)}else if(typeof n[t]=="string")S+=n[t];else break;else S+=t}i("Bad string")},c=function(){for(;t&&t<=" ";)o()},d=function(){switch(t){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}i('Unexpected "'+t+'"')},p,h=function(){var v=[];if(t==="["){if(o("["),c(),t==="]")return o("]"),v;for(;t;){if(v.push(p()),c(),t==="]")return o("]"),v;o(","),c()}}i("Bad array")},m=function(){var v,_={};if(t==="{"){if(o("{"),c(),t==="}")return o("}"),_;for(;t;){if(v=u(),c(),o(":"),Object.hasOwnProperty.call(_,v)&&i('Duplicate key "'+v+'"'),_[v]=p(),c(),t==="}")return o("}"),_;o(","),c()}}i("Bad object")};return p=function(){switch(c(),t){case"{":return m();case"[":return h();case'"':return u();case"-":return a();default:return t>="0"&&t<="9"?a():d()}},function(v){var _;return r=v,e=0,t=" ",_=p(),c(),t&&i("Syntax error"),_}}(),O.base64Encode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n,r,i,o,a,u,c,d,p=0,h=0,m="",v=[];if(!e)return e;e=O.utf8Encode(e);do n=e.charCodeAt(p++),r=e.charCodeAt(p++),i=e.charCodeAt(p++),d=n<<16|r<<8|i,o=d>>18&63,a=d>>12&63,u=d>>6&63,c=d&63,v[h++]=t.charAt(o)+t.charAt(a)+t.charAt(u)+t.charAt(c);while(p<e.length);switch(m=v.join(""),e.length%3){case 1:m=m.slice(0,-2)+"==";break;case 2:m=m.slice(0,-1)+"=";break}return m},O.utf8Encode=function(e){e=(e+"").replace(/\r\n/g,`
138
138
  `).replace(/\r/g,`
139
- `);var t="",n,r,i=0,o;for(n=r=0,i=e.length,o=0;o<i;o++){var a=e.charCodeAt(o),u=null;a<128?r++:a>127&&a<2048?u=String.fromCharCode(a>>6|192,a&63|128):u=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),u!==null&&(r>n&&(t+=e.substring(n,r)),t+=u,n=r=o+1)}return r>n&&(t+=e.substring(n,e.length)),t},O.UUID=function(){try{return it.crypto.randomUUID()}catch{for(var e=new Array(36),t=0;t<36;t++)e[t]=Math.floor(Math.random()*16);return e[14]=4,e[19]=e[19]&=-5,e[19]=e[19]|=8,e[8]=e[13]=e[18]=e[23]="-",O.map(e,function(r){return r.toString(16)}).join("")}};var O$=["ahrefsbot","ahrefssiteaudit","amazonbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandex","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];O.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<O$.length;t++)if(e.indexOf(O$[t])!==-1)return!0;return!1},O.HTTPBuildQuery=function(e,t){var n,r,i=[];return O.isUndefined(t)&&(t="&"),O.each(e,function(o,a){n=encodeURIComponent(o.toString()),r=encodeURIComponent(a),i[i.length]=r+"="+n}),i.join(t)},O.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var n="[\\?&]"+t+"=([^&#]*)",r=new RegExp(n),i=r.exec(e);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch{on.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},O.cookie={get:function(e){for(var t=e+"=",n=dn.cookie.split(";"),r=0;r<n.length;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(e){var t;try{t=O.JSONDecode(O.cookie.get(e))||{}}catch{}return t},set_seconds:function(e,t,n,r,i,o,a){var u="",c="",d="";if(a)u="; domain="+a;else if(r){var p=D$(dn.location.hostname);u=p?"; domain=."+p:""}if(n){var h=new Date;h.setTime(h.getTime()+n*1e3),c="; expires="+h.toGMTString()}o&&(i=!0,d="; SameSite=None"),i&&(d+="; secure"),dn.cookie=e+"="+encodeURIComponent(t)+c+"; path=/"+u+d},set:function(e,t,n,r,i,o,a){var u="",c="",d="";if(a)u="; domain="+a;else if(r){var p=D$(dn.location.hostname);u=p?"; domain=."+p:""}if(n){var h=new Date;h.setTime(h.getTime()+n*24*60*60*1e3),c="; expires="+h.toGMTString()}o&&(i=!0,d="; SameSite=None"),i&&(d+="; secure");var m=e+"="+encodeURIComponent(t)+c+"; path=/"+u+d;return dn.cookie=m,m},remove:function(e,t,n){O.cookie.set(e,"",-1,t,!1,!1,n)}};var R$=function(e){var t=!0;try{var n="__mplss_"+Nx(8),r="xyz";e.setItem(n,r),e.getItem(n)!==r&&(t=!1),e.removeItem(n)}catch{t=!1}return t},Dx=null,Vf=function(e,t){return Dx!==null&&!t?Dx:Dx=R$(e||it.localStorage)},Lx=null,yW=function(e,t){return Lx!==null&&!t?Lx:Lx=R$(e||it.sessionStorage)};function $$(e,t,n){var r=function(i){on.error(t+" error: "+i)};return{is_supported:function(i){var o=n(e,i);return o||on.error(t+" unsupported"),o},error:r,get:function(i){try{return e.getItem(i)}catch(o){r(o)}return null},parse:function(i){try{return O.JSONDecode(e.getItem(i))||{}}catch{}return null},set:function(i,o){try{e.setItem(i,o)}catch(a){r(a)}},remove:function(i){try{e.removeItem(i)}catch(o){r(o)}}}}O.localStorage=$$(it.localStorage,"localStorage",Vf),O.sessionStorage=$$(it.sessionStorage,"sessionStorage",yW),O.register_event=function(){var e=function(r,i,o,a,u){if(!r){on.error("No valid element provided to register_event");return}if(r.addEventListener&&!a)r.addEventListener(i,o,!!u);else{var c="on"+i,d=r[c];r[c]=t(r,o,d)}};function t(r,i,o){var a=function(u){if(u=u||n(it.event),!!u){var c=!0,d,p;return O.isFunction(o)&&(d=o(u)),p=i.call(r,u),(d===!1||p===!1)&&(c=!1),c}};return a}function n(r){return r&&(r.preventDefault=n.preventDefault,r.stopPropagation=n.stopPropagation),r}return n.preventDefault=function(){this.returnValue=!1},n.stopPropagation=function(){this.cancelBubble=!0},e}();var _W=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');O.dom_query=function(){function e(i){return i.all?i.all:i.getElementsByTagName("*")}var t=/[\t\r\n]/g;function n(i,o){var a=" "+o+" ";return(" "+i.className+" ").replace(t," ").indexOf(a)>=0}function r(i){if(!dn.getElementsByTagName)return[];var o=i.split(" "),a,u,c,d,p,h,m,v,_,S,x=[dn];for(h=0;h<o.length;h++){if(a=o[h].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){u=a.split("#"),c=u[0];var b=u[1],C=dn.getElementById(b);if(!C||c&&C.nodeName.toLowerCase()!=c)return[];x=[C];continue}if(a.indexOf(".")>-1){u=a.split("."),c=u[0];var k=u[1];for(c||(c="*"),d=[],p=0,m=0;m<x.length;m++)for(c=="*"?_=e(x[m]):_=x[m].getElementsByTagName(c),v=0;v<_.length;v++)d[p++]=_[v];for(x=[],S=0,m=0;m<d.length;m++)d[m].className&&O.isString(d[m].className)&&n(d[m],k)&&(x[S++]=d[m]);continue}var A=a.match(_W);if(A){c=A[1];var I=A[2],$=A[3],B=A[4];for(c||(c="*"),d=[],p=0,m=0;m<x.length;m++)for(c=="*"?_=e(x[m]):_=x[m].getElementsByTagName(c),v=0;v<_.length;v++)d[p++]=_[v];x=[],S=0;var U;switch($){case"=":U=function(G){return G.getAttribute(I)==B};break;case"~":U=function(G){return G.getAttribute(I).match(new RegExp("\\b"+B+"\\b"))};break;case"|":U=function(G){return G.getAttribute(I).match(new RegExp("^"+B+"-?"))};break;case"^":U=function(G){return G.getAttribute(I).indexOf(B)===0};break;case"$":U=function(G){return G.getAttribute(I).lastIndexOf(B)==G.getAttribute(I).length-B.length};break;case"*":U=function(G){return G.getAttribute(I).indexOf(B)>-1};break;default:U=function(G){return G.getAttribute(I)}}for(x=[],S=0,m=0;m<d.length;m++)U(d[m])&&(x[S++]=d[m]);continue}for(c=a,d=[],p=0,m=0;m<x.length;m++)for(_=x[m].getElementsByTagName(c),v=0;v<_.length;v++)d[p++]=_[v];x=d}return x}return function(i){return O.isElement(i)?[i]:O.isObject(i)&&!O.isUndefined(i.length)?i:r.call(this,i)}}();var bW=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],xW=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];O.info={campaignParams:function(e){var t="",n={};return O.each(bW,function(r){t=O.getQueryParam(dn.URL,r),t.length?n[r]=t:e!==void 0&&(n[r]=e)}),n},clickParams:function(){var e="",t={};return O.each(xW,function(n){e=O.getQueryParam(dn.URL,n),e.length&&(t[n]=e)}),t},marketingParams:function(){return O.extend(O.info.campaignParams(),O.info.clickParams())},searchEngine:function(e){return e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(e){var t=O.info.searchEngine(e),n=t!="yahoo"?"q":"p",r={};if(t!==null){r.$search_engine=t;var i=O.getQueryParam(e,n);i.length&&(r.mp_keyword=i)}return r},browser:function(e,t,n){return t=t||"",n||O.includes(e," OPR/")?O.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":O.includes(e,"IEMobile")||O.includes(e,"WPDesktop")?"Internet Explorer Mobile":O.includes(e,"SamsungBrowser/")?"Samsung Internet":O.includes(e,"Edge")||O.includes(e,"Edg/")?"Microsoft Edge":O.includes(e,"FBIOS")?"Facebook Mobile":O.includes(e,"Chrome")?"Chrome":O.includes(e,"CriOS")?"Chrome iOS":O.includes(e,"UCWEB")||O.includes(e,"UCBrowser")?"UC Browser":O.includes(e,"FxiOS")?"Firefox iOS":O.includes(t,"Apple")?O.includes(e,"Mobile")?"Mobile Safari":"Safari":O.includes(e,"Android")?"Android Mobile":O.includes(e,"Konqueror")?"Konqueror":O.includes(e,"Firefox")?"Firefox":O.includes(e,"MSIE")||O.includes(e,"Trident/")?"Internet Explorer":O.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r=O.info.browser(e,t,n),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},o=i[r];if(o===void 0)return null;var a=e.match(o);return a?parseFloat(a[a.length-2]):null},os:function(){var e=oa;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return it.location.href},properties:function(e){return typeof e!="object"&&(e={}),O.extend(O.strip_empty_properties({$os:O.info.os(),$browser:O.info.browser(oa,rs.vendor,Pg),$referrer:dn.referrer,$referring_domain:O.info.referringDomain(dn.referrer),$device:O.info.device(oa)}),{$current_url:O.info.currentUrl(),$browser_version:O.info.browserVersion(oa,rs.vendor,Pg),$screen_height:A$.height,$screen_width:A$.width,mp_lib:"web",$lib_version:yo.LIB_VERSION,$insert_id:Nx(),time:O.timestamp()/1e3},O.strip_empty_properties(e))},people_properties:function(){return O.extend(O.strip_empty_properties({$os:O.info.os(),$browser:O.info.browser(oa,rs.vendor,Pg)}),{$browser_version:O.info.browserVersion(oa,rs.vendor,Pg)})},mpPageViewProperties:function(){return O.strip_empty_properties({current_page_title:dn.title,current_domain:it.location.hostname,current_url_path:it.location.pathname,current_url_protocol:it.location.protocol,current_url_search:it.location.search})}};var wW=function(e,t){var n=null,r=[];return function(i){var o=this;return r.push(i),n||(n=new ln(function(a){setTimeout(function(){var u=e.apply(o,[r]);n=null,r=[],a(u)},t)})),n}},Nx=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},SW=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,CW=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,D$=function(e){var t=CW,n=e.split("."),r=n[n.length-1];(r.length>4||r==="com"||r==="org")&&(t=SW);var i=e.match(t);return i?i[0]:""},EW=function(){var e=it.navigator.onLine;return O.isUndefined(e)||e},is=function(){},Su=null,Fg=null;typeof JSON<"u"&&(Su=JSON.stringify,Fg=JSON.parse),Su=Su||O.JSONEncode,Fg=Fg||O.JSONDecode,O.info=O.info,O.info.browser=O.info.browser,O.info.browserVersion=O.info.browserVersion,O.info.device=O.info.device,O.info.properties=O.info.properties,O.isBlockedUA=O.isBlockedUA,O.isEmptyObject=O.isEmptyObject,O.isObject=O.isObject,O.JSONDecode=O.JSONDecode,O.JSONEncode=O.JSONEncode,O.toArray=O.toArray,O.NPO=ts;var kW="mixpanelBrowserDb",L$="mixpanelRecordingEvents",Bx="mixpanelRecordingRegistry",AW=1,IW=[L$,Bx],Ro=function(e){this.dbPromise=null,this.storeName=e};Ro.prototype._openDb=function(){return new ln(function(e,t){var n=it.indexedDB.open(kW,AW);n.onerror=function(){t(n.error)},n.onsuccess=function(){e(n.result)},n.onupgradeneeded=function(r){var i=r.target.result;IW.forEach(function(o){i.createObjectStore(o)})}})},Ro.prototype.init=function(){return it.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(e){return e instanceof it.IDBDatabase?ln.resolve():ln.reject(e)})):ln.reject("indexedDB is not supported in this browser")},Ro.prototype.makeTransaction=function(e,t){var n=this.storeName,r=function(i){return new ln(function(o,a){var u=i.transaction(n,e);u.oncomplete=function(){o(u)},u.onabort=u.onerror=function(){a(u.error)},t(u.objectStore(n))})};return this.dbPromise.then(r).catch((function(i){return i&&i.name==="InvalidStateError"?(this.dbPromise=this._openDb(),this.dbPromise.then(r)):ln.reject(i)}).bind(this))},Ro.prototype.setItem=function(e,t){return this.makeTransaction("readwrite",function(n){n.put(t,e)})},Ro.prototype.getItem=function(e){var t;return this.makeTransaction("readonly",function(n){t=n.get(e)}).then(function(){return t.result})},Ro.prototype.removeItem=function(e){return this.makeTransaction("readwrite",function(t){t.delete(e)})},Ro.prototype.getAll=function(){var e;return this.makeTransaction("readonly",function(t){e=t.getAll()}).then(function(){return e.result})};var TW="__mp_opt_in_out_";function MW(e,t){P$(!0,e,t)}function OW(e,t){P$(!1,e,t)}function RW(e,t){return B$(e,t)==="1"}function N$(e,t){if(DW(t))return on.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var n=B$(e,t)==="0";return n&&on.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function os(e){return zx(e,function(t){return this.get_config(t)})}function as(e){return zx(e,function(t){return this._get_config(t)})}function Cu(e){return zx(e,function(t){return this._get_config(t)})}function $W(e,t){t=t||{},Px(t).remove(Fx(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function Px(e){return e=e||{},e.persistenceType==="localStorage"?O.localStorage:O.cookie}function Fx(e,t){return t=t||{},(t.persistencePrefix||TW)+e}function B$(e,t){return Px(t).get(Fx(e,t))}function DW(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||it,n=t.navigator||{},r=!1;return O.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(i){O.includes([!0,1,"1","yes"],i)&&(r=!0)}),r}function P$(e,t,n){if(!O.isString(t)||!t.length){on.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token");return}n=n||{},Px(n).set(Fx(t,n),e?1:0,O.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})}function zx(e,t){return function(){var n=!1;try{var r=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),a=t.call(this,"opt_out_tracking_cookie_prefix"),u=t.call(this,"window");r&&(n=N$(r,{ignoreDnt:i,persistenceType:o,persistencePrefix:a,window:u}))}catch(d){on.error("Unexpected error when checking tracking opt-out status: "+d)}if(!n)return e.apply(this,arguments);var c=arguments[arguments.length-1];typeof c=="function"&&c(0)}}var LW=wu("lock"),F$=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||it.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3,this.promiseImpl=t.promiseImpl||ln};F$.prototype.withLock=function(e,t){var n=this.promiseImpl;return new n(O.bind(function(r,i){var o=t||new Date().getTime()+"|"+Math.random(),a=new Date().getTime(),u=this.storageKey,c=this.pollIntervalMS,d=this.timeoutMS,p=this.storage,h=u+":X",m=u+":Y",v=u+":Z",_=function(k){if(new Date().getTime()-a>d){LW.error("Timeout waiting for mutex on "+u+"; clearing lock. ["+o+"]"),p.removeItem(v),p.removeItem(m),b();return}setTimeout(function(){try{k()}catch(A){i(A)}},c*(Math.random()+.1))},S=function(k,A){k()?A():_(function(){S(k,A)})},x=function(){var k=p.getItem(m);return k&&k!==o?!1:(p.setItem(m,o),p.getItem(m)===o?!0:(Vf(p,!0)||i(new Error("localStorage support dropped while acquiring lock")),!1))},b=function(){p.setItem(h,o),S(x,function(){if(p.getItem(h)===o){C();return}_(function(){if(p.getItem(m)!==o){b();return}S(function(){return!p.getItem(v)},C)})})},C=function(){p.setItem(v,"1");var k=function(){p.removeItem(v),p.getItem(m)===o&&p.removeItem(m),p.getItem(h)===o&&p.removeItem(h)};e().then(function(A){k(),r(A)}).catch(function(A){k(),i(A)})};try{if(Vf(p,!0))b();else throw new Error("localStorage support check failed")}catch(k){i(k)}},this))};var Zf=function(e){this.storage=e||it.localStorage};Zf.prototype.init=function(){return ln.resolve()},Zf.prototype.setItem=function(e,t){return new ln(O.bind(function(n,r){try{this.storage.setItem(e,Su(t))}catch(i){r(i)}n()},this))},Zf.prototype.getItem=function(e){return new ln(O.bind(function(t,n){var r;try{r=Fg(this.storage.getItem(e))}catch(i){n(i)}t(r)},this))},Zf.prototype.removeItem=function(e){return new ln(O.bind(function(t,n){try{this.storage.removeItem(e)}catch(r){n(r)}t()},this))};var z$=wu("batch"),$o=function(e,t){t=t||{},this.storageKey=e,this.usePersistence=t.usePersistence,this.usePersistence&&(this.queueStorage=t.queueStorage||new Zf,this.lock=new F$(e,{storage:t.sharedLockStorage||it.localStorage,timeoutMS:t.sharedLockTimeoutMS})),this.reportError=t.errorReporter||O.bind(z$.error,z$),this.pid=t.pid||null,this.memQueue=[],this.initialized=!1,t.enqueueThrottleMs?this.enqueuePersisted=wW(O.bind(this._enqueuePersisted,this),t.enqueueThrottleMs):this.enqueuePersisted=O.bind(function(n){return this._enqueuePersisted([n])},this)};$o.prototype.ensureInit=function(){return this.initialized?ln.resolve():this.queueStorage.init().then(O.bind(function(){this.initialized=!0},this)).catch(O.bind(function(e){this.reportError("Error initializing queue persistence. Disabling persistence",e),this.initialized=!0,this.usePersistence=!1},this))},$o.prototype.enqueue=function(e,t){var n={id:Nx(),flushAfter:new Date().getTime()+t*2,payload:e};return this.usePersistence?this.enqueuePersisted(n):(this.memQueue.push(n),ln.resolve(!0))},$o.prototype._enqueuePersisted=function(e){var t=O.bind(function(){return this.ensureInit().then(O.bind(function(){return this.readFromStorage()},this)).then(O.bind(function(n){return this.saveToStorage(n.concat(e))},this)).then(O.bind(function(n){return n&&(this.memQueue=this.memQueue.concat(e)),n},this)).catch(O.bind(function(n){return this.reportError("Error enqueueing items",n,e),!1},this))},this);return this.lock.withLock(t,this.pid).catch(O.bind(function(n){return this.reportError("Error acquiring storage lock",n),!1},this))},$o.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);return this.usePersistence&&t.length<e?this.ensureInit().then(O.bind(function(){return this.readFromStorage()},this)).then(O.bind(function(n){if(n.length){var r={};O.each(t,function(a){r[a.id]=!0});for(var i=0;i<n.length;i++){var o=n[i];if(new Date().getTime()>o.flushAfter&&!r[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}return t},this)):ln.resolve(t)};var U$=function(e,t){var n=[];return O.each(e,function(r){r.id&&!t[r.id]&&n.push(r)}),n};$o.prototype.removeItemsByID=function(e){var t={};if(O.each(e,function(r){t[r]=!0}),this.memQueue=U$(this.memQueue,t),this.usePersistence){var n=O.bind(function(){return this.ensureInit().then(O.bind(function(){return this.readFromStorage()},this)).then(O.bind(function(r){return r=U$(r,t),this.saveToStorage(r)},this)).then(O.bind(function(){return this.readFromStorage()},this)).then(O.bind(function(r){for(var i=0;i<r.length;i++){var o=r[i];if(o.id&&t[o.id])throw new Error("Item not removed from storage")}return!0},this)).catch(O.bind(function(r){return this.reportError("Error removing items",r,e),!1},this))},this);return this.lock.withLock(n,this.pid).catch(O.bind(function(r){return this.reportError("Error acquiring storage lock",r),Vf(this.lock.storage,!0)?!1:n().then(O.bind(function(i){return i||this.queueStorage.removeItem(this.storageKey).then(function(){return i})},this)).catch(O.bind(function(i){return this.reportError("Error clearing queue",i),!1},this))},this))}else return ln.resolve(!0)};var j$=function(e,t){var n=[];return O.each(e,function(r){var i=r.id;if(i in t){var o=t[i];o!==null&&(r.payload=o,n.push(r))}else n.push(r)}),n};$o.prototype.updatePayloads=function(e){return this.memQueue=j$(this.memQueue,e),this.usePersistence?this.lock.withLock(O.bind(function(){return this.ensureInit().then(O.bind(function(){return this.readFromStorage()},this)).then(O.bind(function(n){return n=j$(n,e),this.saveToStorage(n)},this)).catch(O.bind(function(n){return this.reportError("Error updating items",e,n),!1},this))},this),this.pid).catch(O.bind(function(t){return this.reportError("Error acquiring storage lock",t),!1},this)):ln.resolve(!0)},$o.prototype.readFromStorage=function(){return this.ensureInit().then(O.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(O.bind(function(e){return e&&(O.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null)),e||[]},this)).catch(O.bind(function(e){return this.reportError("Error retrieving queue",e),[]},this))},$o.prototype.saveToStorage=function(e){return this.ensureInit().then(O.bind(function(){return this.queueStorage.setItem(this.storageKey,e)},this)).then(function(){return!0}).catch(O.bind(function(t){return this.reportError("Error saving queue",t),!1},this))},$o.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(O.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):ln.resolve()};var NW=10*60*1e3,Yf=wu("batch"),Qi=function(e,t){this.errorReporter=t.errorReporter,this.queue=new $o(e,{errorReporter:O.bind(this.reportError,this),queueStorage:t.queueStorage,sharedLockStorage:t.sharedLockStorage,sharedLockTimeoutMS:t.sharedLockTimeoutMS,usePersistence:t.usePersistence,enqueueThrottleMs:t.enqueueThrottleMs}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1,this._flushPromise=null};Qi.prototype.enqueue=function(e){return this.queue.enqueue(e,this.flushInterval)},Qi.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},Qi.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},Qi.prototype.clear=function(){return this.queue.clear()},Qi.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},Qi.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},Qi.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(O.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},Qi.prototype.sendRequestPromise=function(e,t){return new ln(O.bind(function(n){this.sendRequest(e,t,n)},this))},Qi.prototype.flush=function(e){if(this.requestInProgress)return Yf.log("Flush: Request already in progress"),ln.resolve();this.requestInProgress=!0,e=e||{};var t=this.libConfig.batch_request_timeout_ms,n=new Date().getTime(),r=this.batchSize;return this.queue.fillBatch(r).then(O.bind(function(i){var o=i.length===r,a=[],u={};if(O.each(i,function(h){var m=h.payload;if(this.beforeSendHook&&!h.orphaned&&(m=this.beforeSendHook(m)),m){m.event&&m.properties&&(m.properties=O.extend({},m.properties,{mp_sent_by_lib_version:yo.LIB_VERSION}));var v=!0,_=h.id;_?(this.itemIdsSentSuccessfully[_]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:h,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[_]}),v=!1):this.reportError("[dupe] found item with no ID",{item:h}),v&&a.push(m)}u[h.id]=m},this),a.length<1)return this.requestInProgress=!1,this.resetFlush(),ln.resolve();var c=O.bind(function(){return this.queue.removeItemsByID(O.map(i,function(h){return h.id})).then(O.bind(function(h){return O.each(i,O.bind(function(m){var v=m.id;v?(this.itemIdsSentSuccessfully[v]=this.itemIdsSentSuccessfully[v]||0,this.itemIdsSentSuccessfully[v]++,this.itemIdsSentSuccessfully[v]>5&&this.reportError("[dupe] item ID sent too many times",{item:m,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[v]})):this.reportError("[dupe] found item with no ID while removing",{item:m})},this)),h?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?(this.resetFlush(),ln.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),ln.resolve())},this))},this),d=O.bind(function(h){this.requestInProgress=!1;try{if(e.unloading)return this.queue.updatePayloads(u);if(O.isObject(h)&&h.error==="timeout"&&new Date().getTime()-n>=t)return this.reportError("Network timeout; retrying"),this.flush();if(O.isObject(h)&&(h.httpStatusCode>=500||h.httpStatusCode===429||h.httpStatusCode<=0&&!EW()||h.error==="timeout")){var m=this.flushInterval*2;return h.retryAfter&&(m=parseInt(h.retryAfter,10)*1e3||m),m=Math.min(NW,m),this.reportError("Error; retry in "+m+" ms"),this.scheduleFlush(m),ln.resolve()}else if(O.isObject(h)&&h.httpStatusCode===413)if(i.length>1){var v=Math.max(1,Math.floor(r/2));return this.batchSize=Math.min(this.batchSize,v,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),ln.resolve()}else return this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),c();else return c()}catch(_){this.reportError("Error handling API response",_),this.resetFlush()}},this),p={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};return e.unloading&&(p.transport="sendBeacon"),Yf.log("MIXPANEL REQUEST:",a),this.sendRequestPromise(a,p).then(d)},this)).catch(O.bind(function(i){this.reportError("Error flushing request queue",i),this.resetFlush()},this))},Qi.prototype.reportError=function(e,t){if(Yf.error.apply(Yf.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){Yf.error(n)}};var Ux=function(e){var t=Date.now();return!e||t>e.maxExpires||t>e.idleExpires},BW=250,Eu=wu("recorder"),q$=it.CompressionStream,PW={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},FW=new Set([kt.MouseMove,kt.MouseInteraction,kt.Scroll,kt.ViewportResize,kt.Input,kt.TouchMove,kt.MediaInteraction,kt.Drag,kt.Selection]);function zW(e){return e.type===Wt.IncrementalSnapshot&&FW.has(e.data.source)}var ti=function(e){this._mixpanel=e.mixpanelInstance,this._onIdleTimeout=e.onIdleTimeout||is,this._onMaxLengthReached=e.onMaxLengthReached||is,this._onBatchSent=e.onBatchSent||is,this._rrwebRecord=e.rrwebRecord||null,this._stopRecording=null,this.replayId=e.replayId,this.batchStartUrl=e.batchStartUrl||null,this.replayStartUrl=e.replayStartUrl||null,this.idleExpires=e.idleExpires||null,this.maxExpires=e.maxExpires||null,this.replayStartTime=e.replayStartTime||null,this.seqNo=e.seqNo||0,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=Hf,this.recordMinMs=0;var t=Vf(e.sharedLockStorage,!0);this.batcherKey="__mprec_"+this.getConfig("name")+"_"+this.getConfig("token")+"_"+this.replayId,this.queueStorage=new Ro(L$),this.batcher=new Qi(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:PW,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:e.sharedLockStorage,usePersistence:t,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:BW,sharedLockTimeoutMS:10*1e3})};ti.prototype.unloadPersistedData=function(){return this.batcher.stop(),this.batcher.flush().then((function(){return this.queueStorage.removeItem(this.batcherKey)}).bind(this))},ti.prototype.getConfig=function(e){return this._mixpanel.get_config(e)},ti.prototype.get_config=function(e){return this.getConfig(e)},ti.prototype.startRecording=function(e){if(this._rrwebRecord===null){this.reportError("rrweb record function not provided. ");return}if(this._stopRecording!==null){Eu.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>Hf&&(this.recordMaxMs=Hf,Eu.critical("record_max_ms cannot be greater than "+Hf+"ms. Capping value.")),this.maxExpires||(this.maxExpires=new Date().getTime()+this.recordMaxMs),this.recordMinMs=this.getConfig("record_min_ms"),this.recordMinMs>Tx&&(this.recordMinMs=Tx,Eu.critical("record_min_ms cannot be greater than "+Tx+"ms. Capping value.")),this.replayStartTime||(this.replayStartTime=new Date().getTime(),this.batchStartUrl=O.info.currentUrl(),this.replayStartUrl=O.info.currentUrl()),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=(function(){clearTimeout(this.idleTimeoutId);var i=this.getConfig("record_idle_timeout_ms");this.idleTimeoutId=setTimeout(this._onIdleTimeout,i),this.idleExpires=new Date().getTime()+i}).bind(this);t();var n=this.getConfig("record_block_selector");(n===""||n===null)&&(n=void 0);try{this._stopRecording=this._rrwebRecord({emit:(function(i){if(this.idleExpires&&this.idleExpires<i.timestamp){this._onIdleTimeout();return}zW(i)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t()),this.__enqueuePromise=this.batcher.enqueue(i)}).bind(this),blockClass:this.getConfig("record_block_class"),blockSelector:n,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15}})}catch(i){this.reportError("Unexpected error when starting rrweb recording.",i)}if(typeof this._stopRecording!="function"){this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,this.stopRecording();return}var r=this.maxExpires-new Date().getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),r)},ti.prototype.stopRecording=function(e){if(!this.isRrwebStopped()){try{this._stopRecording()}catch(n){this.reportError("Error with rrweb stopRecording",n)}this._stopRecording=null}var t;return this.batcher.stopped?t=this.batcher.clear():e||(t=this.batcher.flush()),this.batcher.stop(),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId),t},ti.prototype.isRrwebStopped=function(){return this._stopRecording===null},ti.prototype.flushEventsWithOptOut=function(e,t,n){var r=(function(i){i===0&&(this.stopRecording(),n({error:"Tracking has been opted out, stopping recording."}))}).bind(this);this._flushEvents(e,t,n,r)},ti.prototype.serialize=function(){var e;try{e=this._mixpanel.get_tab_id()}catch(t){this.reportError("Error getting tab ID for serialization ",t),e=null}return{replayId:this.replayId,seqNo:this.seqNo,replayStartTime:this.replayStartTime,batchStartUrl:this.batchStartUrl,replayStartUrl:this.replayStartUrl,idleExpires:this.idleExpires,maxExpires:this.maxExpires,tabId:e}},ti.deserialize=function(e,t){var n=new ti(O.extend({},t,{replayId:e.replayId,batchStartUrl:e.batchStartUrl,replayStartUrl:e.replayStartUrl,idleExpires:e.idleExpires,maxExpires:e.maxExpires,replayStartTime:e.replayStartTime,seqNo:e.seqNo,sharedLockStorage:t.sharedLockStorage}));return n},ti.prototype._sendRequest=function(e,t,n,r){var i=(function(o,a){o.status===200&&this.replayId===e&&(this.seqNo++,this.batchStartUrl=O.info.currentUrl()),this._onBatchSent(),r({status:0,httpStatusCode:o.status,responseBody:a,retryAfter:o.headers.get("Retry-After")})}).bind(this);it.fetch(this.getConfig("api_host")+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:n}).then(function(o){o.json().then(function(a){i(o,a)}).catch(function(a){r({error:a})})}).catch(function(o){r({error:o,httpStatusCode:0})})},ti.prototype._flushEvents=os(function(e,t,n){var r=e.length;if(r>0){for(var i=this.replayId,o=1/0,a=-1/0,u=!1,c=0;c<r;c++)o=Math.min(o,e[c].timestamp),a=Math.max(a,e[c].timestamp),e[c].type===Wt.FullSnapshot&&(u=!0);if(this.seqNo===0){if(!u){n({error:"First batch does not contain a full snapshot. Aborting recording."}),this.stopRecording(!0);return}this.replayStartTime=o}else this.replayStartTime||(this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=o);var d=a-this.replayStartTime,p={$current_url:this.batchStartUrl,$lib_version:yo.LIB_VERSION,batch_start_time:o/1e3,distinct_id:String(this._mixpanel.get_distinct_id()),mp_lib:"web",replay_id:i,replay_length_ms:d,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},h=JSON.stringify(e),m=this._mixpanel.get_property("$device_id");m&&(p.$device_id=m);var v=this._mixpanel.get_property("$user_id");if(v&&(p.$user_id=v),q$){var _=new Blob([h],{type:"application/json"}).stream(),S=_.pipeThrough(new q$("gzip"));new Response(S).blob().then((function(x){p.format="gzip",this._sendRequest(i,p,x,n)}).bind(this))}else p.format="body",this._sendRequest(i,p,h,n)}}),ti.prototype.reportError=function(e,t){Eu.error.apply(Eu.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.getConfig("error_reporter")(e,t)}catch(n){Eu.error(n)}};var ku=function(e){this.idb=new Ro(Bx),this.errorReporter=e.errorReporter,this.mixpanelInstance=e.mixpanelInstance,this.sharedLockStorage=e.sharedLockStorage};ku.prototype.handleError=function(e){this.errorReporter("IndexedDB error: ",e)},ku.prototype.setActiveRecording=function(e){var t=e.tabId;return t?this.idb.init().then((function(){return this.idb.setItem(t,e)}).bind(this)).catch(this.handleError.bind(this)):(console.warn("No tab ID is set, cannot persist recording metadata."),ln.resolve())},ku.prototype.getActiveRecording=function(){return this.idb.init().then((function(){return this.idb.getItem(this.mixpanelInstance.get_tab_id())}).bind(this)).then((function(e){return Ux(e)?null:e}).bind(this)).catch(this.handleError.bind(this))},ku.prototype.clearActiveRecording=function(){return this.getActiveRecording().then((function(e){if(e)return e.maxExpires=0,this.setActiveRecording(e)}).bind(this)).catch(this.handleError.bind(this))},ku.prototype.flushInactiveRecordings=function(){return this.idb.init().then((function(){return this.idb.getAll()}).bind(this)).then((function(e){var t=e.filter(function(n){return Ux(n)}).map((function(n){var r=ti.deserialize(n,{mixpanelInstance:this.mixpanelInstance,sharedLockStorage:this.sharedLockStorage});return r.unloadPersistedData().then((function(){return this.idb.removeItem(n.tabId)}).bind(this)).catch(this.handleError.bind(this))}).bind(this));return ln.all(t)}).bind(this)).catch(this.handleError.bind(this))};var Wf=wu("recorder"),aa=function(e,t,n){this.mixpanelInstance=e,this.rrwebRecord=t||Ja,this.sharedLockStorage=n,this.recordingRegistry=new ku({mixpanelInstance:this.mixpanelInstance,errorReporter:Wf.error,sharedLockStorage:n}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null};aa.prototype.startRecording=function(e){if(e=e||{},this.activeRecording&&!this.activeRecording.isRrwebStopped()){Wf.log("Recording already in progress, skipping startRecording.");return}var t=(function(){Wf.log("Idle timeout reached, restarting recording."),this.resetRecording()}).bind(this),n=(function(){Wf.log("Max recording length reached, stopping recording."),this.resetRecording()}).bind(this),r=(function(){this.recordingRegistry.setActiveRecording(this.activeRecording.serialize()),this.__flushPromise=this.activeRecording.batcher._flushPromise}).bind(this),i={mixpanelInstance:this.mixpanelInstance,onBatchSent:r,onIdleTimeout:t,onMaxLengthReached:n,replayId:O.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return e.activeSerializedRecording?this.activeRecording=ti.deserialize(e.activeSerializedRecording,i):this.activeRecording=new ti(i),this.activeRecording.startRecording(e.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())},aa.prototype.stopRecording=function(){var e=this._stopCurrentRecording(!1);return this.recordingRegistry.clearActiveRecording(),this.activeRecording=null,e},aa.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},aa.prototype._stopCurrentRecording=function(e){return this.activeRecording?this.activeRecording.stopRecording(e):ln.resolve()},aa.prototype.resumeRecording=function(e){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),ln.resolve(null)):this.recordingRegistry.getActiveRecording().then((function(t){return t?this.startRecording({activeSerializedRecording:t}):e?this.startRecording({shouldStopBatcher:!1}):(Wf.log("No resumable recording found."),null)}).bind(this))},aa.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},aa.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(aa.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),it.__mp_recorder=aa;var zg="change",Kf="click",H$="hashchange",Au="mp_locationchange",G$="popstate",V$="scrollend",jx="submit",UW=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],Z$=["mp-include"],qx=["mp-no-track"],Y$=qx.concat(["mp-sensitive"]),jW=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],Ci=wu("autocapture");function Hx(e){for(var t={},n=W$(e).split(" "),r=0;r<n.length;r++){var i=n[r];i&&(t[i]=!0)}return t}function W$(e){switch(typeof e.className){case"string":return e.className;case"object":return e.className.baseVal||e.getAttribute("class")||"";default:return""}}function qW(e){if(e.previousElementSibling)return e.previousElementSibling;do e=e.previousSibling;while(e&&!X$(e));return e}function K$(e,t,n,r,i,o){var a={$classes:W$(e).split(" "),$tag_name:e.tagName.toLowerCase()},u=e.id;u&&(a.$id=u),Zx(e,t,i,o)&&O.each(jW.concat(r),function(h){if(e.hasAttribute(h)&&!n[h]){var m=e.getAttribute(h);Ug(m)&&(a["$attr-"+h]=m)}});for(var c=1,d=1,p=e;p=qW(p);)c++,p.tagName===e.tagName&&d++;return a.$nth_child=c,a.$nth_of_type=d,a}function HW(e,t){var n=t.allowElementCallback,r=t.allowSelectors||[],i=t.blockAttrs||[],o=t.blockElementCallback,a=t.blockSelectors||[],u=t.captureTextContent||!1,c=t.captureExtraAttrs||[],d={};O.each(i,function(A){d[A]=!0});var p=null,h=typeof e.target>"u"?e.srcElement:e.target;if(J$(h)&&(h=h.parentNode),ZW(h,e)&&Gx(h,e,n,r)&&!Vx(h,e,o,a)){for(var m=[h],v=h;v.parentNode&&!Do(v,"body");)m.push(v.parentNode),v=v.parentNode;var _=[],S,x=!1;if(O.each(m,function(A){var I=Zx(A,e,n,r);!d.href&&A.tagName.toLowerCase()==="a"&&(S=A.getAttribute("href"),S=I&&Ug(S)&&S),Vx(A,e,o,a)&&(x=!0),_.push(K$(A,e,d,c,n,r))},this),!x){var b=dn.documentElement;if(p={$event_type:e.type,$host:it.location.host,$pathname:it.location.pathname,$elements:_,$el_attr__href:S,$viewportHeight:Math.max(b.clientHeight,it.innerHeight||0),$viewportWidth:Math.max(b.clientWidth,it.innerWidth||0)},O.each(c,function(A){if(!d[A]&&h.hasAttribute(A)){var I=h.getAttribute(A);Ug(I)&&(p["$el_attr__"+A]=I)}}),u&&(C=Q$(h,e,n,r),C&&C.length&&(p.$el_text=C)),e.type===Kf&&(O.each(UW,function(A){A in e&&(p["$"+A]=e[A])}),h=GW(e)),u){var C=Q$(h,e,n,r);C&&C.length&&(p.$el_text=C)}if(h){if(!Gx(h,e,n,r)||Vx(h,e,o,a))return null;var k=K$(h,e,d,c,n,r);p.$target=k,p.$el_classes=k.$classes,O.extend(p,O.strip_empty_properties({$el_id:k.$id,$el_tag_name:k.$tag_name}))}}}return p}function Q$(e,t,n,r){var i="";return Zx(e,t,n,r)&&e.childNodes&&e.childNodes.length&&O.each(e.childNodes,function(o){J$(o)&&o.textContent&&(i+=O.trim(o.textContent).split(/(\s+)/).filter(Ug).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),O.trim(i)}function GW(e){for(var t=e.target,n=e.composedPath(),r=0;r<n.length;r++){var i=n[r];if(Do(i,"a")||Do(i,"button")||Do(i,"input")||Do(i,"select")||i.getAttribute&&i.getAttribute("role")==="button"){t=i;break}if(i===t)break}return t}function Gx(e,t,n,r){if(n)try{if(!n(e,t))return!1}catch(a){return Ci.critical("Error while checking element in allowElementCallback",a),!1}if(!r.length)return!0;for(var i=0;i<r.length;i++){var o=r[i];try{if(e.matches(o))return!0}catch(a){Ci.critical("Error while checking selector: "+o,a)}}return!1}function Vx(e,t,n,r){var i;if(n)try{if(n(e,t))return!0}catch(u){return Ci.critical("Error while checking element in blockElementCallback",u),!0}if(r&&r.length)for(i=0;i<r.length;i++){var o=r[i];try{if(e.matches(o))return!0}catch(u){Ci.critical("Error while checking selector: "+o,u)}}var a=Hx(e);for(i=0;i<qx.length;i++)if(a[qx[i]])return!0;return!1}function X$(e){return e&&e.nodeType===1}function Do(e,t){return e&&e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function J$(e){return e&&e.nodeType===3}function VW(){try{var e=dn.createElement("div");return!!e.matches}catch{return!1}}function ZW(e,t){if(!e||Do(e,"html")||!X$(e))return!1;var n=e.tagName.toLowerCase();switch(n){case"form":return t.type===jx;case"input":return["button","submit"].indexOf(e.getAttribute("type"))===-1?t.type===zg:t.type===Kf;case"select":case"textarea":return t.type===zg;default:return t.type===Kf}}function Zx(e,t,n,r){var i;if(!Gx(e,t,n,r))return!1;for(var o=e;o.parentNode&&!Do(o,"body");o=o.parentNode){var a=Hx(o);for(i=0;i<Y$.length;i++)if(a[Y$[i]])return!1}var u=Hx(e);for(i=0;i<Z$.length;i++)if(u[Z$[i]])return!0;if(Do(e,"input")||Do(e,"select")||Do(e,"textarea")||e.getAttribute("contenteditable")==="true")return!1;var c=e.type||"";if(typeof c=="string")switch(c.toLowerCase()){case"hidden":return!1;case"password":return!1}var d=e.name||e.id||"";if(typeof d=="string"){var p=/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i;if(p.test(d.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Ug(e){if(e===null||O.isUndefined(e))return!1;if(typeof e=="string"){e=O.trim(e);var t=/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;if(t.test((e||"").replace(/[- ]/g,"")))return!1;var n=/(^\d{3}-?\d{2}-?\d{4}$)/;if(n.test(e))return!1}return!0}var e2="autocapture",YW="track_pageview",t2="full-url",WW="url-with-path-and-query-string",KW="url-with-path",QW="allow_element_callback",n2="allow_selectors",r2="allow_url_regexes",i2="block_attrs",o2="block_element_callback",a2="block_selectors",s2="block_url_regexes",l2="capture_extra_attrs",u2="capture_text_content",c2="scroll_capture_all",f2="scroll_depth_percent_checkpoints",Yx="click",Wx="input",d2="pageview",Kx="scroll",Qx="submit",Lr={};Lr[n2]=[],Lr[r2]=[],Lr[i2]=[],Lr[o2]=null,Lr[a2]=[],Lr[s2]=[],Lr[l2]=[],Lr[u2]=!1,Lr[c2]=!1,Lr[f2]=[25,50,75,100],Lr[Yx]=!0,Lr[Wx]=!0,Lr[d2]=t2,Lr[Kx]=!0,Lr[Qx]=!0;var jg={$mp_autocapture:!0},XW="$mp_click",JW="$mp_input_change",eK="$mp_scroll",tK="$mp_submit",Di=function(e){this.mp=e};Di.prototype.init=function(){if(!VW()){Ci.critical("Autocapture unavailable: missing required DOM APIs");return}this.initPageviewTracking(),this.initClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking()},Di.prototype.getFullConfig=function(){var e=this.mp.get_config(e2);return e?O.isObject(e)?O.extend({},Lr,e):Lr:{}},Di.prototype.getConfig=function(e){return this.getFullConfig()[e]},Di.prototype.currentUrlBlocked=function(){var e,t=O.info.currentUrl(),n=this.getConfig(r2)||[];if(n.length){var r=!1;for(e=0;e<n.length;e++){var i=n[e];try{if(t.match(i)){r=!0;break}}catch(a){return Ci.critical("Error while checking block URL regex: "+i,a),!0}}if(!r)return!0}var o=this.getConfig(s2)||[];if(!o||!o.length)return!1;for(e=0;e<o.length;e++)try{if(t.match(o[e]))return!0}catch(a){return Ci.critical("Error while checking block URL regex: "+o[e],a),!0}return!1},Di.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(e2)?this.getConfig(d2):this.mp.get_config(YW)},Di.prototype.trackDomEvent=function(e,t){if(!this.currentUrlBlocked()){var n=HW(e,{allowElementCallback:this.getConfig(QW),allowSelectors:this.getConfig(n2),blockAttrs:this.getConfig(i2),blockElementCallback:this.getConfig(o2),blockSelectors:this.getConfig(a2),captureExtraAttrs:this.getConfig(l2),captureTextContent:this.getConfig(u2)});n&&(O.extend(n,jg),this.mp.track(t,n))}},Di.prototype.initClickTracking=function(){it.removeEventListener(Kf,this.listenerClick),this.getConfig(Yx)&&(Ci.log("Initializing click tracking"),this.listenerClick=it.addEventListener(Kf,(function(e){this.getConfig(Yx)&&this.trackDomEvent(e,XW)}).bind(this)))},Di.prototype.initInputTracking=function(){it.removeEventListener(zg,this.listenerChange),this.getConfig(Wx)&&(Ci.log("Initializing input tracking"),this.listenerChange=it.addEventListener(zg,(function(e){this.getConfig(Wx)&&this.trackDomEvent(e,JW)}).bind(this)))},Di.prototype.initPageviewTracking=function(){if(it.removeEventListener(G$,this.listenerPopstate),it.removeEventListener(H$,this.listenerHashchange),it.removeEventListener(Au,this.listenerLocationchange),!!this.pageviewTrackingConfig()){Ci.log("Initializing pageview tracking");var e="",t=!1;this.currentUrlBlocked()||(t=this.mp.track_pageview(jg)),t&&(e=O.info.currentUrl()),this.listenerPopstate=it.addEventListener(G$,function(){it.dispatchEvent(new Event(Au))}),this.listenerHashchange=it.addEventListener(H$,function(){it.dispatchEvent(new Event(Au))});var n=it.history.pushState;typeof n=="function"&&(it.history.pushState=function(i,o,a){n.call(it.history,i,o,a),it.dispatchEvent(new Event(Au))});var r=it.history.replaceState;typeof r=="function"&&(it.history.replaceState=function(i,o,a){r.call(it.history,i,o,a),it.dispatchEvent(new Event(Au))}),this.listenerLocationchange=it.addEventListener(Au,$x((function(){if(!this.currentUrlBlocked()){var i=O.info.currentUrl(),o=!1,a=i.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0],u=this.pageviewTrackingConfig();if(u===t2?o=i!==e:u===WW?o=i.split("#")[0]!==e.split("#")[0]:u===KW&&(o=a),o){var c=this.mp.track_pageview(jg);c&&(e=i),a&&(this.lastScrollCheckpoint=0,Ci.log("Path change: re-initializing scroll depth checkpoints"))}}}).bind(this)))}},Di.prototype.initScrollTracking=function(){it.removeEventListener(V$,this.listenerScroll),this.getConfig(Kx)&&(Ci.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0,this.listenerScroll=it.addEventListener(V$,$x((function(){if(this.getConfig(Kx)&&!this.currentUrlBlocked()){var e=this.getConfig(c2),t=(this.getConfig(f2)||[]).slice().sort(function(c,d){return c-d}),n=it.scrollY,r=O.extend({$scroll_top:n},jg);try{var i=dn.body.scrollHeight,o=Math.round(n/(i-it.innerHeight)*100);if(r.$scroll_height=i,r.$scroll_percentage=o,o>this.lastScrollCheckpoint)for(var a=0;a<t.length;a++){var u=t[a];o>=u&&this.lastScrollCheckpoint<u&&(r.$scroll_checkpoint=u,this.lastScrollCheckpoint=u,e=!0)}}catch(c){Ci.critical("Error while calculating scroll percentage",c)}e&&this.mp.track(eK,r)}}).bind(this))))},Di.prototype.initSubmitTracking=function(){it.removeEventListener(jx,this.listenerSubmit),this.getConfig(Qx)&&(Ci.log("Initializing submit tracking"),this.listenerSubmit=it.addEventListener(jx,(function(e){this.getConfig(Qx)&&this.trackDomEvent(e,tK)}).bind(this)))},vW(Di);var sa=function(){};sa.prototype.create_properties=function(){},sa.prototype.event_handler=function(){},sa.prototype.after_track_handler=function(){},sa.prototype.init=function(e){return this.mp=e,this},sa.prototype.track=function(e,t,n,r){var i=this,o=O.dom_query(e);if(o.length===0){on.error("The DOM query ("+e+") returned 0 elements");return}return O.each(o,function(a){O.register_event(a,this.override_event,function(u){var c={},d=i.create_properties(n,this),p=i.mp.get_config("track_links_timeout");i.event_handler(u,this,c),window.setTimeout(i.track_callback(r,d,c,!0),p),i.mp.track(t,d,i.track_callback(r,d,c))})},this),!0},sa.prototype.track_callback=function(e,t,n,r){r=r||!1;var i=this;return function(){n.callback_fired||(n.callback_fired=!0,!(e&&e(r,t)===!1)&&i.after_track_handler(t,n,r))}},sa.prototype.create_properties=function(e,t){var n;return typeof e=="function"?n=e(t):n=O.extend({},e),n};var Iu=function(){this.override_event="click"};O.inherit(Iu,sa),Iu.prototype.create_properties=function(e,t){var n=Iu.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},Iu.prototype.event_handler=function(e,t,n){n.new_tab=e.which===2||e.metaKey||e.ctrlKey||t.target==="_blank",n.href=t.href,n.new_tab||e.preventDefault()},Iu.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var qg=function(){this.override_event="submit"};O.inherit(qg,sa),qg.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},qg.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var ss="$set",Tu="$set_once",_o="$unset",al="$add",Lo="$append",sl="$union",la="$remove",nK="$delete",h2={set_action:function(e,t){var n={},r={};return O.isObject(e)?O.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[ss]=r,n},unset_action:function(e){var t={},n=[];return O.isArray(e)||(e=[e]),O.each(e,function(r){this._is_reserved_property(r)||n.push(r)},this),t[_o]=n,t},set_once_action:function(e,t){var n={},r={};return O.isObject(e)?O.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[Tu]=r,n},union_action:function(e,t){var n={},r={};return O.isObject(e)?O.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=O.isArray(i)?i:[i])},this):r[e]=O.isArray(t)?t:[t],n[sl]=r,n},append_action:function(e,t){var n={},r={};return O.isObject(e)?O.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[Lo]=r,n},remove_action:function(e,t){var n={},r={};return O.isObject(e)?O.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[la]=r,n},delete_action:function(){var e={};return e[nK]="",e}},$n=function(){};O.extend($n.prototype,h2),$n.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},$n.prototype.set=Cu(function(e,t,n){var r=this.set_action(e,t);return O.isObject(e)&&(n=t),this._send_request(r,n)}),$n.prototype.set_once=Cu(function(e,t,n){var r=this.set_once_action(e,t);return O.isObject(e)&&(n=t),this._send_request(r,n)}),$n.prototype.unset=Cu(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),$n.prototype.union=Cu(function(e,t,n){O.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)}),$n.prototype.delete=Cu(function(e){var t=this.delete_action();return this._send_request(t,e)}),$n.prototype.remove=Cu(function(e,t,n){var r=this.remove_action(e,t);return this._send_request(r,n)}),$n.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=O.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},$n.prototype._is_reserved_property=function(e){return e==="$group_key"||e==="$group_id"},$n.prototype._get_config=function(e){return this._mixpanel.get_config(e)},$n.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},$n.prototype.remove=$n.prototype.remove,$n.prototype.set=$n.prototype.set,$n.prototype.set_once=$n.prototype.set_once,$n.prototype.union=$n.prototype.union,$n.prototype.unset=$n.prototype.unset,$n.prototype.toString=$n.prototype.toString;var It=function(){};O.extend(It.prototype,h2),It.prototype._init=function(e){this._mixpanel=e},It.prototype.set=as(function(e,t,n){var r=this.set_action(e,t);return O.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r[ss]=O.extend({},O.info.people_properties(),r[ss]),this._send_request(r,n)}),It.prototype.set_once=as(function(e,t,n){var r=this.set_once_action(e,t);return O.isObject(e)&&(n=t),this._send_request(r,n)}),It.prototype.unset=as(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),It.prototype.increment=as(function(e,t,n){var r={},i={};return O.isObject(e)?(O.each(e,function(o,a){if(!this._is_reserved_property(a))if(isNaN(parseFloat(o))){on.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[a]=o},this),n=t):(O.isUndefined(t)&&(t=1),i[e]=t),r[al]=i,this._send_request(r,n)}),It.prototype.append=as(function(e,t,n){O.isObject(e)&&(n=t);var r=this.append_action(e,t);return this._send_request(r,n)}),It.prototype.remove=as(function(e,t,n){O.isObject(e)&&(n=t);var r=this.remove_action(e,t);return this._send_request(r,n)}),It.prototype.union=as(function(e,t,n){O.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)}),It.prototype.track_charge=as(function(e,t,n){if(!O.isNumber(e)&&(e=parseFloat(e),isNaN(e))){on.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",O.extend({$amount:e},t),n)}),It.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},It.prototype.delete_user=function(){if(!this._identify_called()){on.error("mixpanel.people.delete_user() requires you to call identify() first");return}var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)},It.prototype.toString=function(){return this._mixpanel.toString()+".people"},It.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=O.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),O.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),O.truncate(o,255))},It.prototype._get_config=function(e){return this._mixpanel.get_config(e)},It.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},It.prototype._enqueue=function(e){ss in e?this._mixpanel.persistence._add_to_people_queue(ss,e):Tu in e?this._mixpanel.persistence._add_to_people_queue(Tu,e):_o in e?this._mixpanel.persistence._add_to_people_queue(_o,e):al in e?this._mixpanel.persistence._add_to_people_queue(al,e):Lo in e?this._mixpanel.persistence._add_to_people_queue(Lo,e):la in e?this._mixpanel.persistence._add_to_people_queue(la,e):sl in e?this._mixpanel.persistence._add_to_people_queue(sl,e):on.error("Invalid call to _enqueue():",e)},It.prototype._flush_one_queue=function(e,t,n,r){var i=this,o=O.extend({},this._mixpanel.persistence.load_queue(e)),a=o;!O.isUndefined(o)&&O.isObject(o)&&!O.isEmptyObject(o)&&(i._mixpanel.persistence._pop_from_people_queue(e,o),i._mixpanel.persistence.save(),r&&(a=r(o)),t.call(i,a,function(u,c){u===0&&i._mixpanel.persistence._add_to_people_queue(e,o),O.isUndefined(n)||n(u,c)}))},It.prototype._flush=function(e,t,n,r,i,o,a){var u=this;this._flush_one_queue(ss,this.set,e),this._flush_one_queue(Tu,this.set_once,r),this._flush_one_queue(_o,this.unset,o,function(x){return O.keys(x)}),this._flush_one_queue(al,this.increment,t),this._flush_one_queue(sl,this.union,i);var c=this._mixpanel.persistence.load_queue(Lo);if(!O.isUndefined(c)&&O.isArray(c)&&c.length)for(var d,p=function(x,b){x===0&&u._mixpanel.persistence._add_to_people_queue(Lo,d),O.isUndefined(n)||n(x,b)},h=c.length-1;h>=0;h--)c=this._mixpanel.persistence.load_queue(Lo),d=c.pop(),u._mixpanel.persistence.save(),O.isEmptyObject(d)||u.append(d,p);var m=this._mixpanel.persistence.load_queue(la);if(!O.isUndefined(m)&&O.isArray(m)&&m.length)for(var v,_=function(x,b){x===0&&u._mixpanel.persistence._add_to_people_queue(la,v),O.isUndefined(a)||a(x,b)},S=m.length-1;S>=0;S--)m=this._mixpanel.persistence.load_queue(la),v=m.pop(),u._mixpanel.persistence.save(),O.isEmptyObject(v)||u.remove(v,_)},It.prototype._is_reserved_property=function(e){return e==="$distinct_id"||e==="$token"||e==="$device_id"||e==="$user_id"||e==="$had_persisted_distinct_id"},It.prototype.set=It.prototype.set,It.prototype.set_once=It.prototype.set_once,It.prototype.unset=It.prototype.unset,It.prototype.increment=It.prototype.increment,It.prototype.append=It.prototype.append,It.prototype.remove=It.prototype.remove,It.prototype.union=It.prototype.union,It.prototype.track_charge=It.prototype.track_charge,It.prototype.clear_charges=It.prototype.clear_charges,It.prototype.delete_user=It.prototype.delete_user,It.prototype.toString=It.prototype.toString;var Xx="__mps",Jx="__mpso",ew="__mpus",tw="__mpa",nw="__mpap",rw="__mpr",iw="__mpu",p2="$people_distinct_id",Hg="__alias",Qf="__timers",rK=[Xx,Jx,ew,tw,nw,rw,iw,p2,Hg,Qf],Nt=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;t!=="cookie"&&t!=="localStorage"&&(on.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),t==="localStorage"&&O.localStorage.is_supported()?this.storage=O.localStorage:this.storage=O.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};Nt.prototype.properties=function(){var e={};return this.load(),O.each(this.props,function(t,n){O.include(rK,n)||(e[n]=t)}),e},Nt.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=O.extend({},e))}},Nt.prototype.upgrade=function(){var e,t;this.storage===O.localStorage?(e=O.cookie.parse(this.name),O.cookie.remove(this.name),O.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===O.cookie&&(t=O.localStorage.parse(this.name),O.localStorage.remove(this.name),t&&this.register_once(t))},Nt.prototype.save=function(){this.disabled||this.storage.set(this.name,Su(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Nt.prototype.load_prop=function(e){return this.load(),this.props[e]},Nt.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Nt.prototype.clear=function(){this.remove(),this.props={}},Nt.prototype.register_once=function(e,t,n){return O.isObject(e)?(typeof t>"u"&&(t="None"),this.expire_days=typeof n>"u"?this.default_expiry:n,this.load(),O.each(e,function(r,i){(!this.props.hasOwnProperty(i)||this.props[i]===t)&&(this.props[i]=r)},this),this.save(),!0):!1},Nt.prototype.register=function(e,t){return O.isObject(e)?(this.expire_days=typeof t>"u"?this.default_expiry:t,this.load(),O.extend(this.props,e),this.save(),!0):!1},Nt.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},Nt.prototype.update_search_keyword=function(e){this.register(O.info.searchInfo(e))},Nt.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:O.info.referringDomain(e)||"$direct"},"")},Nt.prototype.get_referrer_info=function(){return O.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Nt.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},Nt.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},Nt.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},Nt.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},Nt.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Nt.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Nt.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Nt.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),r=t[e],i=this._get_or_create_queue(ss),o=this._get_or_create_queue(Tu),a=this._get_or_create_queue(_o),u=this._get_or_create_queue(al),c=this._get_or_create_queue(sl),d=this._get_or_create_queue(la,[]),p=this._get_or_create_queue(Lo,[]);n===Xx?(O.extend(i,r),this._pop_from_people_queue(al,r),this._pop_from_people_queue(sl,r),this._pop_from_people_queue(_o,r)):n===Jx?(O.each(r,function(h,m){m in o||(o[m]=h)}),this._pop_from_people_queue(_o,r)):n===ew?O.each(r,function(h){O.each([i,o,u,c],function(m){h in m&&delete m[h]}),O.each(p,function(m){h in m&&delete m[h]}),a[h]=!0}):n===tw?(O.each(r,function(h,m){m in i?i[m]+=h:(m in u||(u[m]=0),u[m]+=h)},this),this._pop_from_people_queue(_o,r)):n===iw?(O.each(r,function(h,m){O.isArray(h)&&(m in c||(c[m]=[]),O.each(h,function(v){O.include(c[m],v)||c[m].push(v)}))}),this._pop_from_people_queue(_o,r)):n===rw?(d.push(r),this._pop_from_people_queue(Lo,r)):n===nw&&(p.push(r),this._pop_from_people_queue(_o,r)),on.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),on.log(t),this.save()},Nt.prototype._pop_from_people_queue=function(e,t){var n=this.props[this._get_queue_key(e)];O.isUndefined(n)||O.each(t,function(r,i){e===Lo||e===la?O.each(n,function(o){o[i]===r&&delete o[i]}):delete n[i]},this)},Nt.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},Nt.prototype._get_queue_key=function(e){if(e===ss)return Xx;if(e===Tu)return Jx;if(e===_o)return ew;if(e===al)return tw;if(e===Lo)return nw;if(e===la)return rw;if(e===sl)return iw;on.error("Invalid queue:",e)},Nt.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=O.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},Nt.prototype.set_event_timer=function(e,t){var n=this.load_prop(Qf)||{};n[e]=t,this.props[Qf]=n,this.save()},Nt.prototype.remove_event_timer=function(e){var t=this.load_prop(Qf)||{},n=t[e];return O.isUndefined(n)||(delete this.props[Qf][e],this.save()),n};var ow,g2=function(e,t){throw new Error(e+" not available in this build.")},ni,m2=0,iK=1,oK=function(e){return e},Xi="mixpanel",v2="base64",aK="json",aw="$device:",Mu=it.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,y2=!Mu&&oa.indexOf("MSIE")===-1&&oa.indexOf("Mozilla")===-1,Gg=null;rs.sendBeacon&&(Gg=function(){return rs.sendBeacon.apply(rs,arguments)});var _2={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},b2={api_host:"https://api-js.mixpanel.com",api_routes:_2,api_method:"POST",api_transport:"XHR",api_payload_format:v2,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:is,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:is,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_canvas:!1,record_collect_fonts:!1,record_idle_timeout_ms:30*60*1e3,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:Hf,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},x2=!1,fe=function(){},sw=function(e,t,n){var r,i=n===Xi?ni:ni[n];if(i&&ow===m2)r=i;else{if(i&&!O.isArray(i)){on.error("You have already initialized "+n);return}r=new fe}if(r._cached_groups={},r._init(e,t,n),r.people=new It,r.people._init(r),!r.get_config("skip_first_touch_marketing")){var o=O.info.campaignParams(null),a={},u=!1;O.each(o,function(c,d){a["initial_"+d]=c,c&&(u=!0)}),u&&r.people.set_once(a)}return yo.DEBUG=yo.DEBUG||r.get_config("debug"),!O.isUndefined(i)&&O.isArray(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r};fe.prototype.init=function(e,t,n){if(O.isUndefined(n)){this.report_error("You must name your new library: init(token, config, name)");return}if(n===Xi){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var r=sw(e,t,n);return ni[n]=r,r._loaded(),r},fe.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var r={};if(!("api_payload_format"in t)){var i=t.api_host||b2.api_host;i.match(/\.mixpanel\.com/)&&(r.api_payload_format=aK)}if(this.set_config(O.extend({},b2,r,t,{name:n,token:e,callback_fn:(n===Xi?n:Xi+"."+n)+"._jsc"})),this._jsc=is,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!O.localStorage.is_supported(!0)||!Mu)this._batch_requests=!1,on.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),O.each(this.get_batcher_configs(),function(u){on.log("Clearing batch queue "+u.queue_key),O.localStorage.remove(u.queue_key)});else if(this.init_batchers(),Gg&&it.addEventListener){var o=O.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);it.addEventListener("pagehide",function(u){u.persisted&&o()}),it.addEventListener("visibilitychange",function(){dn.visibilityState==="hidden"&&o()})}}this.persistence=this.cookie=new Nt(this.config),this.unpersisted_superprops={},this._gdpr_init();var a=O.UUID();this.get_distinct_id()||this.register_once({distinct_id:aw+a,$device_id:a},""),this.autocapture=new Di(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},fe.prototype._init_tab_id=function(){if(O.sessionStorage.is_supported())try{var e=this.get_config("name")+"_"+this.get_config("token"),t="mp_tab_id_"+e,n="mp_gen_new_tab_id_"+e;(O.sessionStorage.get(n)||!O.sessionStorage.get(t))&&O.sessionStorage.set(t,"$tab-"+O.UUID()),O.sessionStorage.set(n,"1"),this.tab_id=O.sessionStorage.get(t),it.addEventListener("beforeunload",function(){O.sessionStorage.remove(n)})}catch(r){this.report_error("Error initializing tab id",r)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")},fe.prototype.get_tab_id=function(){return this.tab_id||null},fe.prototype._should_load_recorder=function(){var e=new Ro(Bx),t=this.get_tab_id();return e.init().then(function(){return e.getAll()}).then(function(n){for(var r=0;r<n.length;r++)if(Ux(n[r])||n[r].tabId===t)return!0;return!1}).catch(O.bind(function(n){this.report_error("Error checking recording registry",n)},this))},fe.prototype._check_and_start_session_recording=os(function(e){if(!it.MutationObserver){on.critical("Browser does not support MutationObserver; skipping session recording");return}var t=O.bind(function(r){var i=O.bind(function(){this._recorder=this._recorder||new it.__mp_recorder(this),this._recorder.resumeRecording(r)},this);O.isUndefined(it.__mp_recorder)?g2(this.get_config("recorder_src"),i):i()},this),n=this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent");e||n?t(!0):this._should_load_recorder().then(function(r){r&&t(!1)})}),fe.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},fe.prototype.stop_session_recording=function(){this._recorder&&this._recorder.stopRecording()},fe.prototype.pause_session_recording=function(){this._recorder&&this._recorder.pauseRecording()},fe.prototype.resume_session_recording=function(){this._recorder&&this._recorder.resumeRecording()},fe.prototype.get_session_recording_properties=function(){var e={},t=this._get_session_replay_id();return t&&(e.$mp_replay_id=t),e},fe.prototype.get_session_replay_url=function(){var e=null,t=this._get_session_replay_id();if(t){var n=O.HTTPBuildQuery({replay_id:t,distinct_id:this.get_distinct_id(),token:this.get_config("token")});e="https://mixpanel.com/projects/replay-redirect?"+n}return e},fe.prototype._get_session_replay_id=function(){var e=null;return this._recorder&&(e=this._recorder.replayId),e||null},fe.prototype.__get_recorder=function(){return this._recorder},fe.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var e=O.info.campaignParams(null);O.each(e,(function(t,n){this.unregister(n)}).bind(this))}},fe.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(dn.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(O.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(dn.referrer)},fe.prototype._dom_loaded=function(){O.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||O.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue},fe.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!x2)return this.__dom_loaded_queue.push([e,t]),!1;var n=new e().init(this);return n.track.apply(n,t)},fe.prototype._prepare_callback=function(e,t){if(O.isUndefined(e))return null;if(Mu){var n=function(a){e(a,t)};return n}else{var r=this._jsc,i=""+Math.floor(Math.random()*1e8),o=this.get_config("callback_fn")+"["+i+"]";return r[i]=function(a){delete r[i],e(a,t)},o}},fe.prototype._send_request=function(e,t,n,r){var i=!0;if(y2)return this.__request_queue.push(arguments),i;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},a=null;!r&&(O.isFunction(n)||typeof n=="string")&&(r=n,n=null),n=O.extend(o,n||{}),Mu||(n.method="GET");var u=n.method==="POST",c=Gg&&u&&n.transport.toLowerCase()==="sendbeacon",d=n.verbose;t.verbose&&(d=!0),this.get_config("test")&&(t.test=1),d&&(t.verbose=1),this.get_config("img")&&(t.img=1),Mu||(r?t.callback=r:(d||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=new Date().getTime().toString(),u&&(a="data="+encodeURIComponent(t.data),delete t.data),e+="?"+O.HTTPBuildQuery(t);var p=this;if("img"in t){var h=dn.createElement("img");h.src=e,dn.body.appendChild(h)}else if(c){try{i=Gg(e,a)}catch(b){p.report_error(b),i=!1}try{r&&r(i?1:0)}catch(b){p.report_error(b)}}else if(Mu)try{var m=new XMLHttpRequest;m.open(n.method,e,!0);var v=this.get_config("xhr_headers");if(u&&(v["Content-Type"]="application/x-www-form-urlencoded"),O.each(v,function(b,C){m.setRequestHeader(C,b)}),n.timeout_ms&&typeof m.timeout<"u"){m.timeout=n.timeout_ms;var _=new Date().getTime()}m.withCredentials=!0,m.onreadystatechange=function(){if(m.readyState===4)if(m.status===200){if(r)if(d){var b;try{b=O.JSONDecode(m.responseText)}catch(A){if(p.report_error(A),n.ignore_json_errors)b=m.responseText;else return}r(b)}else r(Number(m.responseText))}else{var C;if(m.timeout&&!m.status&&new Date().getTime()-_>=m.timeout?C="timeout":C="Bad HTTP status: "+m.status+" "+m.statusText,p.report_error(C),r)if(d){var k=m.responseHeaders||{};r({status:0,httpStatusCode:m.status,error:C,retryAfter:k["Retry-After"]})}else r(0)}},m.send(a)}catch(b){p.report_error(b),i=!1}else{var S=dn.createElement("script");S.type="text/javascript",S.async=!0,S.defer=!0,S.src=e;var x=dn.getElementsByTagName("script")[0];x.parentNode.insertBefore(S,x)}return i},fe.prototype._execute_array=function(e){var t,n=[],r=[],i=[];O.each(e,function(a){a&&(t=a[0],O.isArray(t)?i.push(a):typeof a=="function"?a.call(this):O.isArray(a)&&t==="alias"?n.push(a):O.isArray(a)&&t.indexOf("track")!==-1&&typeof this[t]=="function"?i.push(a):r.push(a))},this);var o=function(a,u){O.each(a,function(c){if(O.isArray(c[0])){var d=u;O.each(c,function(p){d=d[p[0]].apply(d,p.slice(1))})}else this[c[0]].apply(this,c.slice(1))},u)};o(n,this),o(r,this),o(i,this)},fe.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},fe.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token"),t=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+t.track,queue_key:e+"_ev"},people:{type:"people",endpoint:"/"+t.engage,queue_key:e+"_pp"},groups:{type:"groups",endpoint:"/"+t.groups,queue_key:e+"_gr"}},this._batcher_configs},fe.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=O.bind(function(n){return new Qi(n.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:O.bind(function(r,i,o){this._send_request(this.get_config("api_host")+n.endpoint,this._encode_data_for_request(r),i,this._prepare_callback(o,r))},this),beforeSendHook:O.bind(function(r){return this._run_hook("before_send_"+n.type,r)},this),stopAllBatchingFunc:O.bind(this.stop_batch_senders,this),usePersistence:!0})},this),t=this.get_batcher_configs();this.request_batchers={events:e(t.events),people:e(t.people),groups:e(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},fe.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,O.each(this.request_batchers,function(e){e.start()}))},fe.prototype.stop_batch_senders=function(){this._batch_requests=!1,O.each(this.request_batchers,function(e){e.stop(),e.clear()})},fe.prototype.push=function(e){this._execute_array([e])},fe.prototype.disable=function(e){typeof e>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},fe.prototype._encode_data_for_request=function(e){var t=Su(e);return this.get_config("api_payload_format")===v2&&(t=O.base64Encode(t)),{data:t}},fe.prototype._track_or_batch=function(e,t){var n=O.truncate(e.data,255),r=e.endpoint,i=e.batcher,o=e.should_send_immediately,a=e.send_request_options||{};t=t||is;var u=!0,c=O.bind(function(){return a.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(on.log("MIXPANEL REQUEST:"),on.log(n),this._send_request(r,this._encode_data_for_request(n),a,this._prepare_callback(t,n))):null},this);return this._batch_requests&&!o?i.enqueue(n).then(function(d){d?t(1,n):c()}):u=c(),u&&n},fe.prototype.track=os(function(e,t,n,r){!r&&typeof n=="function"&&(r=n,n=null),n=n||{};var i=n.transport;i&&(n.transport=i);var o=n.send_immediately;if(typeof r!="function"&&(r=is),O.isUndefined(e)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(e)){r(0);return}t=O.extend({},t),t.token=this.get_config("token");var a=this.persistence.remove_event_timer(e);if(!O.isUndefined(a)){var u=new Date().getTime()-a;t.$duration=parseFloat((u/1e3).toFixed(3))}this._set_default_superprops();var c=this.get_config("track_marketing")?O.info.marketingParams():{};t=O.extend({},O.info.properties({mp_loader:this.get_config("mp_loader")}),c,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var d=this.get_config("property_blacklist");O.isArray(d)?O.each(d,function(m){delete t[m]}):this.report_error("Invalid value for property_blacklist config: "+d);var p={event:e,properties:t},h=this._track_or_batch({type:"events",data:p,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:n},r);return h}),fe.prototype.set_group=os(function(e,t,n){O.isArray(t)||(t=[t]);var r={};return r[e]=t,this.register(r),this.people.set(e,t,n)}),fe.prototype.add_group=os(function(e,t,n){var r=this.get_property(e),i={};return r===void 0?(i[e]=[t],this.register(i)):r.indexOf(t)===-1&&(r.push(t),i[e]=r,this.register(i)),this.people.union(e,t,n)}),fe.prototype.remove_group=os(function(e,t,n){var r=this.get_property(e);if(r!==void 0){var i=r.indexOf(t);i>-1&&(r.splice(i,1),this.register({group_key:r})),r.length===0&&this.unregister(e)}return this.people.remove(e,t,n)}),fe.prototype.track_with_groups=os(function(e,t,n,r){var i=O.extend({},t||{});return O.each(n,function(o,a){o!=null&&(i[a]=o)}),this.track(e,i,r)}),fe.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},fe.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},fe.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),r=this._cached_groups[n];return(r===void 0||r._group_key!==e||r._group_id!==t)&&(r=new $n,r._init(this,e,t),this._cached_groups[n]=r),r},fe.prototype.track_pageview=os(function(e,t){typeof e!="object"&&(e={}),t=t||{};var n=t.event_name||"$mp_web_page_view",r=O.extend(O.info.mpPageViewProperties(),O.info.campaignParams(),O.info.clickParams()),i=O.extend({},r,e);return this.track(n,i)}),fe.prototype.track_links=function(){return this._track_dom.call(this,Iu,arguments)},fe.prototype.track_forms=function(){return this._track_dom.call(this,qg,arguments)},fe.prototype.time_event=function(e){if(O.isUndefined(e)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(e)||this.persistence.set_event_timer(e,new Date().getTime())};var sK={persistent:!0},lw=function(e){var t;return O.isObject(e)?t=e:O.isUndefined(e)?t={}:t={days:e},O.extend({},sK,t)};fe.prototype.register=function(e,t){var n=lw(t);n.persistent?this.persistence.register(e,n.days):O.extend(this.unpersisted_superprops,e)},fe.prototype.register_once=function(e,t,n){var r=lw(n);r.persistent?this.persistence.register_once(e,t,r.days):(typeof t>"u"&&(t="None"),O.each(e,function(i,o){(!this.unpersisted_superprops.hasOwnProperty(o)||this.unpersisted_superprops[o]===t)&&(this.unpersisted_superprops[o]=i)},this))},fe.prototype.unregister=function(e,t){t=lw(t),t.persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},fe.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},fe.prototype.identify=function(e,t,n,r,i,o,a,u){var c=this.get_distinct_id();if(e&&c!==e){if(typeof e=="string"&&e.indexOf(aw)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var d=c;this.register_once({$had_persisted_distinct_id:!0,$device_id:d},"")}e!==c&&e!==this.get_property(Hg)&&(this.unregister(Hg),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,r,i,o,a,u),e!==c&&this.track("$identify",{distinct_id:e,$anon_distinct_id:c},{skip_hooks:!0})},fe.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=O.UUID();this.register_once({distinct_id:aw+e,$device_id:e},"")},fe.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},fe.prototype.alias=function(e,t){if(e===this.get_property(p2))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return O.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Hg,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},function(){n.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},fe.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},fe.prototype.set_config=function(e){if(O.isObject(e)){O.extend(this.config,e);var t=e.batch_size;t&&O.each(this.request_batchers,function(n){n.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),yo.DEBUG=yo.DEBUG||this.get_config("debug"),"autocapture"in e&&this.autocapture&&this.autocapture.init()}},fe.prototype.get_config=function(e){return this.config[e]},fe.prototype._run_hook=function(e){var t=(this.config.hooks[e]||oK).apply(this,ns.call(arguments,1));return typeof t>"u"&&(this.report_error(e+" hook did not return a value"),t=null),t},fe.prototype.get_property=function(e){return this.persistence.load_prop([e])},fe.prototype.toString=function(){var e=this.get_config("name");return e!==Xi&&(e=Xi+"."+e),e},fe.prototype._event_is_disabled=function(e){return O.isBlockedUA(oa)||this._flags.disable_all_events||O.include(this.__disabled_events,e)},fe.prototype._gdpr_init=function(){var e=this.get_config("opt_out_tracking_persistence_type")==="localStorage";e&&O.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||O.cookie.get("mp_optout"))&&(O.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},fe.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else if(e&&e.enable_persistence)t=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==t&&this.persistence.set_disabled(t),t?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()},fe.prototype._gdpr_call_func=function(e,t){return t=O.extend({track:O.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),O.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},fe.prototype.opt_in_tracking=function(e){e=O.extend({enable_persistence:!0},e),this._gdpr_call_func(MW,e),this._gdpr_update_persistence(e)},fe.prototype.opt_out_tracking=function(e){e=O.extend({clear_persistence:!0,delete_user:!0},e),e.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(OW,e),this._gdpr_update_persistence(e)},fe.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(RW,e)},fe.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(N$,e)},fe.prototype.clear_opt_in_out_tracking=function(e){e=O.extend({enable_persistence:!0},e),this._gdpr_call_func($W,e),this._gdpr_update_persistence(e)},fe.prototype.report_error=function(e,t){on.error.apply(on.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){on.error(n)}},fe.prototype.init=fe.prototype.init,fe.prototype.reset=fe.prototype.reset,fe.prototype.disable=fe.prototype.disable,fe.prototype.time_event=fe.prototype.time_event,fe.prototype.track=fe.prototype.track,fe.prototype.track_links=fe.prototype.track_links,fe.prototype.track_forms=fe.prototype.track_forms,fe.prototype.track_pageview=fe.prototype.track_pageview,fe.prototype.register=fe.prototype.register,fe.prototype.register_once=fe.prototype.register_once,fe.prototype.unregister=fe.prototype.unregister,fe.prototype.identify=fe.prototype.identify,fe.prototype.alias=fe.prototype.alias,fe.prototype.name_tag=fe.prototype.name_tag,fe.prototype.set_config=fe.prototype.set_config,fe.prototype.get_config=fe.prototype.get_config,fe.prototype.get_property=fe.prototype.get_property,fe.prototype.get_distinct_id=fe.prototype.get_distinct_id,fe.prototype.toString=fe.prototype.toString,fe.prototype.opt_out_tracking=fe.prototype.opt_out_tracking,fe.prototype.opt_in_tracking=fe.prototype.opt_in_tracking,fe.prototype.has_opted_out_tracking=fe.prototype.has_opted_out_tracking,fe.prototype.has_opted_in_tracking=fe.prototype.has_opted_in_tracking,fe.prototype.clear_opt_in_out_tracking=fe.prototype.clear_opt_in_out_tracking,fe.prototype.get_group=fe.prototype.get_group,fe.prototype.set_group=fe.prototype.set_group,fe.prototype.add_group=fe.prototype.add_group,fe.prototype.remove_group=fe.prototype.remove_group,fe.prototype.track_with_groups=fe.prototype.track_with_groups,fe.prototype.start_batch_senders=fe.prototype.start_batch_senders,fe.prototype.stop_batch_senders=fe.prototype.stop_batch_senders,fe.prototype.start_session_recording=fe.prototype.start_session_recording,fe.prototype.stop_session_recording=fe.prototype.stop_session_recording,fe.prototype.pause_session_recording=fe.prototype.pause_session_recording,fe.prototype.resume_session_recording=fe.prototype.resume_session_recording,fe.prototype.get_session_recording_properties=fe.prototype.get_session_recording_properties,fe.prototype.get_session_replay_url=fe.prototype.get_session_replay_url,fe.prototype.get_tab_id=fe.prototype.get_tab_id,fe.prototype.DEFAULT_API_ROUTES=_2,fe.prototype.__get_recorder=fe.prototype.__get_recorder,Nt.prototype.properties=Nt.prototype.properties,Nt.prototype.update_search_keyword=Nt.prototype.update_search_keyword,Nt.prototype.update_referrer_info=Nt.prototype.update_referrer_info,Nt.prototype.get_cross_subdomain=Nt.prototype.get_cross_subdomain,Nt.prototype.clear=Nt.prototype.clear;var Ou={},lK=function(){O.each(Ou,function(e,t){t!==Xi&&(ni[t]=e)}),ni._=O},uK=function(){ni.init=function(e,t,n){if(n)return ni[n]||(ni[n]=Ou[n]=sw(e,t,n),ni[n]._loaded()),ni[n];var r=ni;Ou[Xi]?r=Ou[Xi]:e&&(r=sw(e,t,Xi),r._loaded(),Ou[Xi]=r),ni=r,ow===iK&&(it[Xi]=ni),lK()}},cK=function(){function e(){e.done||(e.done=!0,x2=!0,y2=!1,O.each(Ou,function(r){r._dom_loaded()}))}function t(){try{dn.documentElement.doScroll("left")}catch{setTimeout(t,1);return}e()}if(dn.addEventListener)dn.readyState==="complete"?e():dn.addEventListener("DOMContentLoaded",e,!1);else if(dn.attachEvent){dn.attachEvent("onreadystatechange",e);var n=!1;try{n=it.frameElement===null}catch{}dn.documentElement.doScroll&&n&&t()}O.register_event(it,"load",e,!0)};function fK(e){return g2=e,ow=m2,ni=new fe,uK(),ni.init(),cK(),ni}function dK(e,t){t()}var ls=fK(dK);const Zn="https://saas.brainlox.com",hK="https://debales-web-app-server.azurewebsites.net",w2={"blossom-and-rhyme-6":"84e28f5a553bc260c8276723d0f365bc","doorbellmount-dea1de94-1728660454527":"f825468f4202c28be0d29c849a997208",artzfolio:"789feea8eb479f2db1144448f6465f7f",minature:"b22ef9c8fdbeb4a297947903891c5fd9","nonetz-3f0b8348-1736183595738":"a19d837ea53890c892a2b351e54afc11",bodytales:"703aa3f61539de0786fa19f82644fa8b",athflex:"b9f412aa0c6991abf8b8e3db70b2a506",www:"2637bf921fb09742d550941fbebe7160","GTK-Restaurant":"dbcb03738f942ec7c968f45833ee47bf","derkins-co-uk":"f109fd32c98dac150ba902bd69feeeed","imemyselfcare-com":"bbbe4af618eeab278a4015b4ddf8827f"},pK="phc_nzwftWluHb06OLHwbfhb2xmhk88Ffc9OjjR8Jz5Q327",Vg=e=>({layout:{position:{isLeft:e.isLeft??!1,zIndex:e.zIndex??1e3},height:{option:e.heightOption??"Normal"},responsive:{fullScreenOnMobile:e.fullScreenOnMobile??!0,mobileDisplayMode:e.mobileDisplayMode??"normal"}},colors:{background:e.backgroundColor,font:e.fontColor,supportButtonBackgroundColor:e.supportButtonBackgroundColor??"'#ffa500'",bot:{background:e.botBackgroundColor,message:e.botMessageColor,font:e.botFontColor},user:{message:e.userMessageColor,font:e.userFontColor},header:{font:e.headerFontColor},footer:{background:e.footerBackgroundColor,inputBorder:e.fonterInputBorderColor},cta:{background:e.callToActionBackgroundColor,font:e.callToActionFontColor},suggestedQuestions:{font:e.suggestedQuestionsFontColor,background:e.suggestedQuestionsBackgroundColor,hover:e.suggestedQuestionsHoverColor,crossButton:{color:e.suggestedQuestionsCrossButtonColor,background:e.suggestedQuestionsCrossButtonBackgroundColor},highlight:e.suggestedQuestionsHighlightColor},chatButton:{animation:e.chatButtonBackgroundAnimationColor}},typography:{fontFamily:void 0,fontSize:void 0,lineHeight:void 0},borders:{radius:"4px",width:"1px"},animations:{chatButton:{type:e.chatButtonBackgroundAnimationType??"Ping",enabled:e.enableChatButtonBackgroundAnimation??!1}},branding:{visibility:{showBot:e.show_bot??!0,debalesBranding:e.debales_branding??!0},logo:{removeBackground:e.removeLogoBackground??!1}}});function an(){const e=sessionStorage.getItem("debalesSessionID");if(e)return e;const t=crypto.randomUUID();return sessionStorage.setItem("debalesSessionID",t),t}function gK(){return sessionStorage.getItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:window.DebalesChat.projectId}))}function Nr(){const e=localStorage.getItem(qt(jt.USER_INFO));return e?JSON.parse(e):null}function ua(e){localStorage.setItem(qt(jt.USER_INFO),JSON.stringify(e))}function ri(e){if(e.current){const t=e.current.lastElementChild;if(t)if(window.matchMedia("(max-width: 768px)").matches)e.current.scrollTop=e.current.scrollHeight,setTimeout(()=>{e.current&&(e.current.scrollTop=e.current.scrollHeight)},50);else{const r=e.current.scrollTop,i=t.getBoundingClientRect().bottom+e.current.scrollTop-e.current.clientHeight,o=300,a=performance.now(),u=c=>{const d=c-a,p=Math.min(d/o,1),h=p<.5?4*p*p*p:1-Math.pow(-2*p+2,3)/2;e.current.scrollTop=r+(i-r)*h,p<1&&requestAnimationFrame(u)};requestAnimationFrame(u)}}}function mK(){return window.location.pathname}function Xf(){const e=/test|demo|example|debales/i,t=Nr()??"";return!!(t&&e.test(t.email))}function Zg(e){const t=mK(),r=Array.from(new Set(e.map(o=>o.path))).filter(o=>new RegExp(`^${o}(/|$)`).test(t));if(r.length>0){r.sort((u,c)=>c.length-u.length);const o=r[0];return e.filter(u=>u.path===o&&u.enable!==!1).sort((u,c)=>(u.sortOrder??0)-(c.sortOrder??0))}return e.filter(o=>o.path==="/"&&o.enable!==!1).sort((o,a)=>(o.sortOrder??0)-(a.sortOrder??0))}const S2=new Set,Yg=e=>{const t=w2[e];if(!t)return console.warn("No Mixpanel token found"),null;if(S2.has(e))return ls;ls.init(t,{debug:!0,track_pageview:!0,persistence:"localStorage"}),console.log("Mixpanel initialized");const n=Nr();return n&&n.email&&ls.identify(n.email),S2.add(e),ls},vK=async(e,t)=>{if(Xf())return;const n=window.DebalesChat.projectId??t.projectId;if(!w2[n]){console.warn("No Mixpanel token found");return}ls.track(e,t)},yK=()=>{const e=localStorage.getItem("anonymousUserId");if(e)return e;const t=crypto.randomUUID();return localStorage.setItem("anonymousUserId",t),t};function ll(e){return e?e.split("<br>").filter(n=>n.trim().length>0).map(n=>n.trim()):[""]}const Br=e=>e.toLowerCase().includes("gaiabay")||e.toLowerCase().includes("debales-testing"),_K=e=>{const t=e.findIndex(o=>o.type==="dynamic");if(t===-1)return e;const n=e.filter(o=>o.type==="static"),r=e.filter(o=>o.type==="dynamic");return[...n.slice(0,t),r,...n.slice(t)]};function qt(e,t){return t!=null&&t.botId?`debales_${t.botId}_${e}`:`debales_${e}`}const C2=R.createContext(null),Jf=()=>{const e=R.useContext(C2);if(!e)throw new Error("useCart must be used within a CartProvider");return e};var bK="2.0.0",Ru="",E2="?",Wg="function",us="undefined",$u="object",uw="string",ed="major",Fe="model",Le="name",$e="type",Ge="vendor",Pe="version",Ei="architecture",Du="console",$t="mobile",Bn="tablet",ii="smarttv",td="wearable",cw="xr",fw="embedded",nd="inapp",k2="user-agent",dw=500,hw="brands",ul="formFactors",pw="fullVersionList",Lu="platform",gw="platformVersion",Kg="bitness",cs="sec-ch-ua",xK=cs+"-full-version-list",wK=cs+"-arch",SK=cs+"-"+Kg,CK=cs+"-form-factors",EK=cs+"-"+$t,kK=cs+"-"+Fe,A2=cs+"-"+Lu,AK=A2+"-version",I2=[hw,pw,$t,Fe,Lu,gw,Ei,ul,Kg],Li="browser",ca="cpu",No="device",fa="engine",Ji="os",Nu="result",Qg="Amazon",rd="Apple",T2="ASUS",M2="BlackBerry",cl="Google",O2="Huawei",R2="Lenovo",IK="Honor",mw="LG",Xg="Microsoft",$2="Motorola",id="Samsung",D2="Sharp",Jg="Sony",vw="Xiaomi",yw="Zebra",Bu="Mobile ",od=" Browser",L2="Chrome",fs="Chromecast",TK="Edge",ad="Firefox",sd="Opera",N2="Facebook",B2="Sogou",_w="Windows",MK=typeof window!==us,ki=MK&&window.navigator?window.navigator:void 0,ds=ki&&ki.userAgentData?ki.userAgentData:void 0,OK=function(e,t){var n={},r=t;if(!tm(t)){r={};for(var i in t)for(var o in t[i])r[o]=t[i][o].concat(r[o]?r[o]:[])}for(var a in e)n[a]=r[a]&&r[a].length%2===0?r[a].concat(e[a]):e[a];return n},em=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},bw=function(e,t){if(typeof e===$u&&e.length>0){for(var n in e)if(da(e[n])==da(t))return!0;return!1}return Pu(e)?da(t).indexOf(da(e))!==-1:!1},tm=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||(t?tm(e[n]):!1)},Pu=function(e){return typeof e===uw},xw=function(e){if(e){for(var t=[],n=fl(/\\?\"/g,e).split(","),r=0;r<n.length;r++)if(n[r].indexOf(";")>-1){var i=ud(n[r]).split(";v=");t[r]={brand:i[0],version:i[1]}}else t[r]=ud(n[r]);return t}},da=function(e){return Pu(e)?e.toLowerCase():e},ww=function(e){return Pu(e)?fl(/[^\d\.]/g,e).split(".")[0]:void 0},ha=function(e){for(var t in e){var n=e[t];typeof n==$u&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},fl=function(e,t){return Pu(t)?t.replace(e,Ru):t},ld=function(e){return fl(/\\?\"/g,e)},ud=function(e,t){if(Pu(e))return e=fl(/^\s\s*/,e),typeof t===us?e:e.substring(0,dw)},P2=function(e,t){if(!(!e||!t))for(var n=0,r,i,o,a,u,c;n<t.length&&!u;){var d=t[n],p=t[n+1];for(r=i=0;r<d.length&&!u&&d[r];)if(u=d[r++].exec(e),u)for(o=0;o<p.length;o++)c=u[++i],a=p[o],typeof a===$u&&a.length>0?a.length===2?typeof a[1]==Wg?this[a[0]]=a[1].call(this,c):this[a[0]]=a[1]:a.length===3?typeof a[1]===Wg&&!(a[1].exec&&a[1].test)?this[a[0]]=c?a[1].call(this,c,a[2]):void 0:this[a[0]]=c?c.replace(a[1],a[2]):void 0:a.length===4&&(this[a[0]]=c?a[3].call(this,c.replace(a[1],a[2])):void 0):this[a]=c||void 0;n+=2}},cd=function(e,t){for(var n in t)if(typeof t[n]===$u&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(bw(t[n][r],e))return n===E2?void 0:n}else if(bw(t[n],e))return n===E2?void 0:n;return t.hasOwnProperty("*")?t["*"]:e},F2={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},z2={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},U2={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[Pe,[Le,Bu+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[Pe,[Le,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[Le,Pe],[/opios[\/ ]+([\w\.]+)/i],[Pe,[Le,sd+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[Pe,[Le,sd+" GX"]],[/\bopr\/([\w\.]+)/i],[Pe,[Le,sd]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[Pe,[Le,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[Pe,[Le,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[Le,Pe],[/quark(?:pc)?\/([-\w\.]+)/i],[Pe,[Le,"Quark"]],[/\bddg\/([\w\.]+)/i],[Pe,[Le,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[Pe,[Le,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[Pe,[Le,"WeChat"]],[/konqueror\/([\w\.]+)/i],[Pe,[Le,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[Pe,[Le,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[Pe,[Le,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[Pe,[Le,"Smart "+R2+od]],[/(avast|avg)\/([\w\.]+)/i],[[Le,/(.+)/,"$1 Secure"+od],Pe],[/\bfocus\/([\w\.]+)/i],[Pe,[Le,ad+" Focus"]],[/\bopt\/([\w\.]+)/i],[Pe,[Le,sd+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[Pe,[Le,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[Pe,[Le,"Dolphin"]],[/coast\/([\w\.]+)/i],[Pe,[Le,sd+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[Pe,[Le,"MIUI"+od]],[/fxios\/([\w\.-]+)/i],[Pe,[Le,Bu+ad]],[/\bqihoobrowser\/?([\w\.]*)/i],[Pe,[Le,"360"]],[/\b(qq)\/([\w\.]+)/i],[[Le,/(.+)/,"$1Browser"],Pe],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[Le,/(.+)/,"$1"+od],Pe],[/samsungbrowser\/([\w\.]+)/i],[Pe,[Le,id+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[Pe,[Le,B2+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[Le,B2+" Mobile"],Pe],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[Le,Pe],[/(lbbrowser|rekonq)/i],[Le],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[Pe,Le],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[Le,N2],Pe,[$e,nd]],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat)[\/ ]([-\w\.]+)/i],[Le,Pe,[$e,nd]],[/\bgsa\/([\w\.]+) .*safari\//i],[Pe,[Le,"GSA"],[$e,nd]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[Pe,[Le,"TikTok"],[$e,nd]],[/\[(linkedin)app\]/i],[Le,[$e,nd]],[/(chromium)[\/ ]([-\w\.]+)/i],[Le,Pe],[/headlesschrome(?:\/([\w\.]+)| )/i],[Pe,[Le,L2+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[Le,L2+" WebView"],Pe],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[Pe,[Le,"Android"+od]],[/chrome\/([\w\.]+) mobile/i],[Pe,[Le,Bu+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[Le,Pe],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[Pe,[Le,Bu+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[Le,Bu+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[Pe,Le],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[Le,[Pe,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[Le,Pe],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[Le,Bu+ad],Pe],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[Le,"Netscape"],Pe],[/(wolvic|librewolf)\/([\w\.]+)/i],[Le,Pe],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[Pe,[Le,ad+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[Le,[Pe,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[Le,[Pe,/[^\d\.]+./,Ru]]],cpu:[[/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i],[[Ei,"amd64"]],[/(ia32(?=;))/i,/((?:i[346]|x)86)[;\)]/i],[[Ei,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[Ei,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[Ei,"armhf"]],[/windows (ce|mobile); ppc;/i],[[Ei,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[Ei,/ower/,Ru,da]],[/(sun4\w)[;\)]/i],[[Ei,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[Ei,da]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[Fe,[Ge,id],[$e,Bn]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[Fe,[Ge,id],[$e,$t]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[Fe,[Ge,rd],[$e,$t]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[Fe,[Ge,rd],[$e,Bn]],[/(macintosh);/i],[Fe,[Ge,rd]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[Fe,[Ge,D2],[$e,$t]],[/(?:honor)([-\w ]+)[;\)]/i],[Fe,[Ge,IK],[$e,$t]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[Fe,[Ge,O2],[$e,Bn]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[Fe,[Ge,O2],[$e,$t]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[Fe,/_/g," "],[Ge,vw],[$e,$t]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[Fe,/_/g," "],[Ge,vw],[$e,Bn]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[Fe,[Ge,"OPPO"],[$e,$t]],[/\b(opd2\d{3}a?) bui/i],[Fe,[Ge,"OPPO"],[$e,Bn]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[Fe,[Ge,"Vivo"],[$e,$t]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[Fe,[Ge,"Realme"],[$e,$t]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[Fe,[Ge,$2],[$e,$t]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[Fe,[Ge,$2],[$e,Bn]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[Fe,[Ge,mw],[$e,Bn]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[Fe,[Ge,mw],[$e,$t]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[Fe,[Ge,R2],[$e,Bn]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[Fe,/_/g," "],[Ge,"Nokia"],[$e,$t]],[/(pixel c)\b/i],[Fe,[Ge,cl],[$e,Bn]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[Fe,[Ge,cl],[$e,$t]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[Fe,[Ge,Jg],[$e,$t]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[Fe,"Xperia Tablet"],[Ge,Jg],[$e,Bn]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[Fe,[Ge,"OnePlus"],[$e,$t]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[Fe,[Ge,Qg],[$e,Bn]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[Fe,/(.+)/g,"Fire Phone $1"],[Ge,Qg],[$e,$t]],[/(playbook);[-\w\),; ]+(rim)/i],[Fe,Ge,[$e,Bn]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[Fe,[Ge,M2],[$e,$t]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[Fe,[Ge,T2],[$e,Bn]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[Fe,[Ge,T2],[$e,$t]],[/(nexus 9)/i],[Fe,[Ge,"HTC"],[$e,Bn]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[Ge,[Fe,/_/g," "],[$e,$t]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[Fe,[Ge,"TCL"],[$e,Bn]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[Fe,[Ge,"TCL"],[$e,$t]],[/(itel) ((\w+))/i],[[Ge,da],Fe,[$e,cd,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[Fe,[Ge,"Acer"],[$e,Bn]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[Fe,[Ge,"Meizu"],[$e,$t]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[Fe,[Ge,"Ulefone"],[$e,$t]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[Fe,[Ge,"Energizer"],[$e,$t]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[Fe,[Ge,"Cat"],[$e,$t]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[Fe,[Ge,"Smartfren"],[$e,$t]],[/droid.+; (a(?:015|06[35]|142p?))/i],[Fe,[Ge,"Nothing"],[$e,$t]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[Ge,Fe,[$e,$t]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[Ge,Fe,[$e,Bn]],[/(surface duo)/i],[Fe,[Ge,Xg],[$e,Bn]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[Fe,[Ge,"Fairphone"],[$e,$t]],[/(shield[\w ]+) b/i],[Fe,[Ge,"Nvidia"],[$e,Bn]],[/(sprint) (\w+)/i],[Ge,Fe,[$e,$t]],[/(kin\.[onetw]{3})/i],[[Fe,/\./g," "],[Ge,Xg],[$e,$t]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[Fe,[Ge,yw],[$e,Bn]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[Fe,[Ge,yw],[$e,$t]],[/smart-tv.+(samsung)/i],[Ge,[$e,ii]],[/hbbtv.+maple;(\d+)/i],[[Fe,/^/,"SmartTV"],[Ge,id],[$e,ii]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[Ge,mw],[$e,ii]],[/(apple) ?tv/i],[Ge,[Fe,rd+" TV"],[$e,ii]],[/crkey.*devicetype\/chromecast/i],[[Fe,fs+" Third Generation"],[Ge,cl],[$e,ii]],[/crkey.*devicetype\/([^/]*)/i],[[Fe,/^/,"Chromecast "],[Ge,cl],[$e,ii]],[/fuchsia.*crkey/i],[[Fe,fs+" Nest Hub"],[Ge,cl],[$e,ii]],[/crkey/i],[[Fe,fs],[Ge,cl],[$e,ii]],[/droid.+aft(\w+)( bui|\))/i],[Fe,[Ge,Qg],[$e,ii]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[Fe,[Ge,D2],[$e,ii]],[/(bravia[\w ]+)( bui|\))/i],[Fe,[Ge,Jg],[$e,ii]],[/(mitv-\w{5}) bui/i],[Fe,[Ge,vw],[$e,ii]],[/Hbbtv.*(technisat) (.*);/i],[Ge,Fe,[$e,ii]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[Ge,ud],[Fe,ud],[$e,ii]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[$e,ii]],[/(ouya)/i,/(nintendo) (\w+)/i],[Ge,Fe,[$e,Du]],[/droid.+; (shield) bui/i],[Fe,[Ge,"Nvidia"],[$e,Du]],[/(playstation \w+)/i],[Fe,[Ge,Jg],[$e,Du]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[Fe,[Ge,Xg],[$e,Du]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[Fe,[Ge,id],[$e,td]],[/((pebble))app/i],[Ge,Fe,[$e,td]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[Fe,[Ge,rd],[$e,td]],[/droid.+; (wt63?0{2,3})\)/i],[Fe,[Ge,yw],[$e,td]],[/droid.+; (glass) \d/i],[Fe,[Ge,cl],[$e,cw]],[/(pico) (4|neo3(?: link|pro)?)/i],[Ge,Fe,[$e,cw]],[/; (quest( \d| pro)?)/i],[Fe,[Ge,N2],[$e,cw]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[Ge,[$e,fw]],[/(aeobc)\b/i],[Fe,[Ge,Qg],[$e,fw]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[Fe,[$e,$t]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[Fe,[$e,Bn]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[$e,Bn]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[$e,$t]],[/(android[-\w\. ]{0,9});.+buil/i],[Fe,[Ge,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[Pe,[Le,TK+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[Le,Pe],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[Pe,[Le,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[Le,Pe],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[Pe,Le]],os:[[/microsoft (windows) (vista|xp)/i],[Le,Pe],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[Le,[Pe,cd,F2]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[Pe,cd,F2],[Le,_w]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[Pe,/_/g,"."],[Le,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[Le,"macOS"],[Pe,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[Pe,[Le,fs+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[Pe,[Le,fs+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[Pe,[Le,fs+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[Pe,[Le,fs+" Linux"]],[/crkey\/([\d\.]+)/i],[Pe,[Le,fs]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[Pe,Le],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[Le,Pe],[/\(bb(10);/i],[Pe,[Le,M2]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[Pe,[Le,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[Pe,[Le,ad+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[Pe,[Le,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[Pe,[Le,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[Le,"Chrome OS"],Pe],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[Le,Pe],[/(sunos) ?([\w\.\d]*)/i],[[Le,"Solaris"],Pe],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[Le,Pe]]},nm=function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return ha.call(e.init,[[Li,[Le,Pe,ed,$e]],[ca,[Ei]],[No,[$e,Fe,Ge]],[fa,[Le,Pe]],[Ji,[Le,Pe]]]),ha.call(e.isIgnore,[[Li,[Pe,ed]],[fa,[Pe]],[Ji,[Pe]]]),ha.call(e.isIgnoreRgx,[[Li,/ ?browser$/i],[Ji,/ ?os$/i]]),ha.call(e.toString,[[Li,[Le,Pe]],[ca,[Ei]],[No,[Ge,Fe]],[fa,[Le,Pe]],[Ji,[Le,Pe]]]),e}(),RK=function(e,t){var n=nm.init[t],r=nm.isIgnore[t]||0,i=nm.isIgnoreRgx[t]||0,o=nm.toString[t]||0;function a(){ha.call(this,n)}return a.prototype.getItem=function(){return e},a.prototype.withClientHints=function(){return ds?ds.getHighEntropyValues(I2).then(function(u){return e.setCH(new j2(u,!1)).parseCH().get()}):e.parseCH().get()},a.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=Nu&&(a.prototype.is=function(u){var c=!1;for(var d in this)if(this.hasOwnProperty(d)&&!bw(r,d)&&da(i?fl(i,this[d]):this[d])==da(i?fl(i,u):u)){if(c=!0,u!=us)break}else if(u==us&&c){c=!c;break}return c},a.prototype.toString=function(){var u=Ru;for(var c in o)typeof this[o[c]]!==us&&(u+=(u?" ":Ru)+this[o[c]]);return u||us}),ds||(a.prototype.then=function(u){var c=this,d=function(){for(var h in c)c.hasOwnProperty(h)&&(this[h]=c[h])};d.prototype={is:a.prototype.is,toString:a.prototype.toString};var p=new d;return u(p),p}),new a};function j2(e,t){if(e=e||{},ha.call(this,I2),t)ha.call(this,[[hw,xw(e[cs])],[pw,xw(e[xK])],[$t,/\?1/.test(e[EK])],[Fe,ld(e[kK])],[Lu,ld(e[A2])],[gw,ld(e[AK])],[Ei,ld(e[wK])],[ul,xw(e[CK])],[Kg,ld(e[SK])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==us&&(this[n]=e[n])}function q2(e,t,n,r){return this.get=function(i){return i?this.data.hasOwnProperty(i)?this.data[i]:void 0:this.data},this.set=function(i,o){return this.data[i]=o,this},this.setCH=function(i){return this.uaCH=i,this},this.detectFeature=function(){if(ki&&ki.userAgent==this.ua)switch(this.itemType){case Li:ki.brave&&typeof ki.brave.isBrave==Wg&&this.set(Le,"Brave");break;case No:!this.get($e)&&ds&&ds[$t]&&this.set($e,$t),this.get(Fe)=="Macintosh"&&ki&&typeof ki.standalone!==us&&ki.maxTouchPoints&&ki.maxTouchPoints>2&&this.set(Fe,"iPad").set($e,Bn);break;case Ji:!this.get(Le)&&ds&&ds[Lu]&&this.set(Le,ds[Lu]);break;case Nu:var i=this.data,o=function(a){return i[a].getItem().detectFeature().get()};this.set(Li,o(Li)).set(ca,o(ca)).set(No,o(No)).set(fa,o(fa)).set(Ji,o(Ji))}return this},this.parseUA=function(){return this.itemType!=Nu&&P2.call(this.data,this.ua,this.rgxMap),this.itemType==Li&&this.set(ed,ww(this.get(Pe))),this},this.parseCH=function(){var i=this.uaCH,o=this.rgxMap;switch(this.itemType){case Li:var a=i[pw]||i[hw],u;if(a)for(var c in a){var d=fl(/(Google|Microsoft) /,a[c].brand||a[c]),p=a[c].version;!/not.a.brand/i.test(d)&&(!u||/chrom/i.test(u)&&!/chromi/i.test(d))&&(this.set(Le,d).set(Pe,p).set(ed,ww(p)),u=d)}break;case ca:var h=i[Ei];h&&(h&&i[Kg]=="64"&&(h+="64"),P2.call(this.data,h+";",o));break;case No:if(i[$t]&&this.set($e,$t),i[Fe]&&this.set(Fe,i[Fe]),i[Fe]=="Xbox"&&this.set($e,Du).set(Ge,Xg),i[ul]){var m;if(typeof i[ul]!="string")for(var v=0;!m&&v<i[ul].length;)m=cd(i[ul][v++],z2);else m=cd(i[ul],z2);this.set($e,m)}break;case Ji:var _=i[Lu];if(_){var S=i[gw];_==_w&&(S=parseInt(ww(S),10)>=13?"11":"10"),this.set(Le,_).set(Pe,S)}this.get(Le)==_w&&i[Fe]=="Xbox"&&this.set(Le,"Xbox").set(Pe,void 0);break;case Nu:var x=this.data,b=function(C){return x[C].getItem().setCH(i).parseCH().get()};this.set(Li,b(Li)).set(ca,b(ca)).set(No,b(No)).set(fa,b(fa)).set(Ji,b(Ji))}return this},ha.call(this,[["itemType",e],["ua",t],["uaCH",r],["rgxMap",n],["data",RK(this,e)]]),this}function pa(e,t,n){if(typeof e===$u?(tm(e,!0)?(typeof t===$u&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e===uw&&!tm(t,!0)&&(n=t,t=void 0),n&&typeof n.append===Wg){var r={};n.forEach(function(c,d){r[d]=c}),n=r}if(!(this instanceof pa))return new pa(e,t,n).getResult();var i=typeof e===uw?e:n&&n[k2]?n[k2]:ki&&ki.userAgent?ki.userAgent:Ru,o=new j2(n,!0),a=t?OK(U2,t):U2,u=function(c){return c==Nu?function(){return new q2(c,i,a,o).set("ua",i).set(Li,this.getBrowser()).set(ca,this.getCPU()).set(No,this.getDevice()).set(fa,this.getEngine()).set(Ji,this.getOS()).get()}:function(){return new q2(c,i,a[c],o).parseUA().get()}};return ha.call(this,[["getBrowser",u(Li)],["getCPU",u(ca)],["getDevice",u(No)],["getEngine",u(fa)],["getOS",u(Ji)],["getResult",u(Nu)],["getUA",function(){return i}],["setUA",function(c){return Pu(c)&&(i=c.length>dw?ud(c,dw):c),this}]]).setUA(i),this}pa.VERSION=bK,pa.BROWSER=em([Le,Pe,ed,$e]),pa.CPU=em([Ei]),pa.DEVICE=em([Fe,Ge,$e,Du,$t,ii,Bn,td,fw]),pa.ENGINE=pa.OS=em([Le,Pe]);const to=class to{constructor(t){Cr(this,"config");Cr(this,"storedData");Cr(this,"deviceInfo");Cr(this,"localStorageKey","_dsjfs312313kj3debales_analytics_");this.config=t,this.deviceInfo=this.getDeviceInfo(),this.localStorageKey=t.localStorageKey||this.localStorageKey+this.config.projectName,this.config.testing=t.testing||(()=>!1);const n=localStorage.getItem(this.localStorageKey);if(n)this.storedData=JSON.parse(n),this.config.debug&&console.log("Using Existing Stored data:",this.storedData);else{const r=crypto.randomUUID();this.storedData={projectName:this.config.projectName,anonId:r,distinctId:r},this.config.debug&&console.log("Using New Stored data:",this.storedData),this.updateStorage()}this.config.debug&&console.log("Analytics initialized:",this.storedData)}static init(t){to.instance||(to.instance=new to(t))}static getInstance(){if(!to.instance)throw new Error("DebalesAnalytics is not initialized. Call init() first.");return to.instance}static async identify(t,n){return to.getInstance().identifyInternal(t,n)}static track(t,n){to.getInstance().trackInternal(t,n)}static getDistinctId(){return to.getInstance().storedData.distinctId}static getAnonId(){return to.getInstance().storedData.anonId}async identifyInternal(t,n){try{if(this.config.testing&&this.config.testing())return;let r,i,o;if(n){const{name:c,phone:d,...p}=n;r=c,i=d,o=p}const a={distinctId:this.storedData.distinctId,anonId:[this.storedData.anonId],projectName:this.config.projectName,email:t,name:r,phone:i,properties:o},u=await this.sendRequest("/api/analytic/identify",a);u&&u.success&&u.distinctId&&(this.config.debug&&console.log("identify success new distint id"),this.storedData.distinctId=u.distinctId,this.storedData.email=t,this.updateStorage(),u.isIdentified&&this.trackInternal("identify")),this.config.debug&&console.log("Identify event sent:",a)}catch(r){console.error("Failed to identify user:",r)}}trackInternal(t,n){if(this.config.testing&&this.config.testing())return;const r={projectName:this.config.projectName,distinctId:this.storedData.distinctId,anonId:this.storedData.anonId,eventName:t,osVersion:this.deviceInfo.osVersion,browserVersion:this.deviceInfo.browserVersion,operatingSystem:this.deviceInfo.os,browser:this.deviceInfo.browser,currentUrl:window.location.href,chatId:an()+this.config.projectName,properties:n};this.sendRequest("/api/analytic/track",r),this.config.debug&&console.log("Track event sent:",r)}updateStorage(){localStorage.setItem(this.localStorageKey,JSON.stringify(this.storedData))}async sendRequest(t,n){try{const r=await fetch(`${Zn}${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return await r.json()}catch(r){console.error("Failed to send analytics data:",r)}}getDeviceInfo(){const n=new pa().getResult();return{browser:n.browser.name,os:n.os.name,browserVersion:n.browser.version,osVersion:n.os.version}}};Cr(to,"instance",null);let Sw=to;const Bo=Sw;function $K(e){dT(e,[/\r?\n|\r/g,DK])}function DK(){return{type:"break"}}function rm(){return function(e){$K(e)}}const mt={OPEN_STATE_CHANGE:"open_state_change",CHAT_BUTTON_CLICKED:"Chat button clicked",USER_FORM_FILLED:"User form filled",ADD_BULK_ITEM:"Add bulk item",USER_FORM_CLOSE:"user_form_close",CHECKOUT_CLICKED:"Checkout Clicked",ADD_TO_CART_CLICKED:"add to cart clicked",SUGGESTED_QUESTION_CLICKED:"Suggested Question Clicked",INITIAL_LEADING_QUERY_SUGGESTED_QUESTION_CLICKED:"Initial Leading Query Suggested Question Clicked",LEADING_QUERY_CLICKED:"Leading Query Clicked",COLLECTION_VIDEO_CLICKED:"Collection Video Clicked",COLLECTION_IMAGE_CLICKED:"Collection Image Clicked",VIEW_PRODUCT_CLICKED:"view product clicked",PRODUCT_VIDEO_CLICKED:"Product Video Clicked",PRODUCT_IMAGE_CLICKED:"Product Image Clicked",SHOW_SIMILAR_CLICKED:"show similar clicked",CHAT_MESSAGE_SENT:"chat_message_sent",CHAT_MESSAGE_TYPING_STARTED:"chat_message_typing_started",CHAT_MESSAGE_TYPING_ENDED:"chat_message_typing_ended",DISCOUNT_VIEWED:"discount_viewed",SHOPIFY_LINK_CLICKED:"shopify_link_clicked"},hn={OPEN_STATE_CHANGE:"open_state_change"},im=e=>{window.DebalesChat||(window.DebalesChat={isOpen:!1,projectId:e,getSessionId:()=>an(),getChatId:()=>an()+"_"+e,getAnonId:()=>Bo.getAnonId(),isIdentified:()=>{if(Zi._isIdentified())return!0;const t=Nr();return!!(t&&t.email)},getIdentifiedUser:()=>Nr(),getDistinctId:()=>Zi.get_distinct_id(),getOldDistinctId:()=>Bo.getDistinctId(),debug:!1,identify:(t,n)=>{Zi._isIdentified()||Zi.identify(t,{...n,project:e}),Bo.identify(t,n),ua({email:t,name:n==null?void 0:n.name,phone:n==null?void 0:n.phone})},track:(t,n)=>{Bo.track(t,{...n,sessionId:window.DebalesChat.getSessionId()}),Zi.capture(t,{...n}),vK(t,{...n,sessionId:an(),projectId:e})},onOpenChange:t=>{const n=r=>{t(r.detail.isOpen)};return window.addEventListener(hn.OPEN_STATE_CHANGE,n),()=>window.removeEventListener(hn.OPEN_STATE_CHANGE,n)},removeOpenChangeListener:t=>{const n=r=>{t(r.detail.isOpen)};window.removeEventListener(hn.OPEN_STATE_CHANGE,n)},open:()=>{window.DebalesChat.isOpen||window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:!0,projectId:e}}))},close:()=>{window.DebalesChat.isOpen&&window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:!1,projectId:e}}))},toggle:()=>{window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:!window.DebalesChat.isOpen,projectId:e}}))}})};var Pr=(e=>(e.DEFAULT="DEFAULT",e.SHOPIFY="SHOPIFY",e.WOOCOMMERCE="WOOCOMMERCE",e.MAGENTO="MAGENTO",e.UNKNOWN="UNKNOWN",e))(Pr||{});class hs{static detect(){var t,n,r,i,o,a;if(typeof window<"u"&&window.Shopify!==void 0&&window.Shopify.routes!==void 0)return Pr.SHOPIFY;if(typeof window<"u"&&document.body.classList.contains("woocommerce"))return Pr.WOOCOMMERCE;if(typeof window<"u"){if(window.MAGENTO_VERSION!==void 0||window.MAGE!==void 0||window.Mage!==void 0||["page-wrapper","magento-theme","catalog-product-view","catalog-category-view"].some(h=>document.body.classList.contains(h)))return Pr.MAGENTO;const c=document.getElementsByTagName("script");for(const h of Array.from(c))if(h.src.includes("mage/")||h.src.includes("magento")||(t=h.textContent)!=null&&t.includes("Mage.")||(n=h.textContent)!=null&&n.includes("require(")||(r=h.getAttribute("data-requiremodule"))!=null&&r.startsWith("mage")||(i=h.getAttribute("data-requiremodule"))!=null&&i.startsWith("Magento"))return Pr.MAGENTO;if(document.cookie.split(";").some(h=>h.trim().startsWith("mage-")||h.trim().startsWith("form_key")))return Pr.MAGENTO;const p=document.getElementsByTagName("meta");for(const h of Array.from(p))if((o=h.getAttribute("content"))!=null&&o.includes("Magento")||(a=h.getAttribute("name"))!=null&&a.includes("magento"))return Pr.MAGENTO}return Pr.UNKNOWN}}const om=z.button`
139
+ `);var t="",n,r,i=0,o;for(n=r=0,i=e.length,o=0;o<i;o++){var a=e.charCodeAt(o),u=null;a<128?r++:a>127&&a<2048?u=String.fromCharCode(a>>6|192,a&63|128):u=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),u!==null&&(r>n&&(t+=e.substring(n,r)),t+=u,n=r=o+1)}return r>n&&(t+=e.substring(n,e.length)),t},O.UUID=function(){try{return it.crypto.randomUUID()}catch{for(var e=new Array(36),t=0;t<36;t++)e[t]=Math.floor(Math.random()*16);return e[14]=4,e[19]=e[19]&=-5,e[19]=e[19]|=8,e[8]=e[13]=e[18]=e[23]="-",O.map(e,function(r){return r.toString(16)}).join("")}};var O$=["ahrefsbot","ahrefssiteaudit","amazonbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandex","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];O.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<O$.length;t++)if(e.indexOf(O$[t])!==-1)return!0;return!1},O.HTTPBuildQuery=function(e,t){var n,r,i=[];return O.isUndefined(t)&&(t="&"),O.each(e,function(o,a){n=encodeURIComponent(o.toString()),r=encodeURIComponent(a),i[i.length]=r+"="+n}),i.join(t)},O.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var n="[\\?&]"+t+"=([^&#]*)",r=new RegExp(n),i=r.exec(e);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch{on.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},O.cookie={get:function(e){for(var t=e+"=",n=dn.cookie.split(";"),r=0;r<n.length;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(e){var t;try{t=O.JSONDecode(O.cookie.get(e))||{}}catch{}return t},set_seconds:function(e,t,n,r,i,o,a){var u="",c="",d="";if(a)u="; domain="+a;else if(r){var p=D$(dn.location.hostname);u=p?"; domain=."+p:""}if(n){var h=new Date;h.setTime(h.getTime()+n*1e3),c="; expires="+h.toGMTString()}o&&(i=!0,d="; SameSite=None"),i&&(d+="; secure"),dn.cookie=e+"="+encodeURIComponent(t)+c+"; path=/"+u+d},set:function(e,t,n,r,i,o,a){var u="",c="",d="";if(a)u="; domain="+a;else if(r){var p=D$(dn.location.hostname);u=p?"; domain=."+p:""}if(n){var h=new Date;h.setTime(h.getTime()+n*24*60*60*1e3),c="; expires="+h.toGMTString()}o&&(i=!0,d="; SameSite=None"),i&&(d+="; secure");var m=e+"="+encodeURIComponent(t)+c+"; path=/"+u+d;return dn.cookie=m,m},remove:function(e,t,n){O.cookie.set(e,"",-1,t,!1,!1,n)}};var R$=function(e){var t=!0;try{var n="__mplss_"+Nx(8),r="xyz";e.setItem(n,r),e.getItem(n)!==r&&(t=!1),e.removeItem(n)}catch{t=!1}return t},Dx=null,Vf=function(e,t){return Dx!==null&&!t?Dx:Dx=R$(e||it.localStorage)},Lx=null,yW=function(e,t){return Lx!==null&&!t?Lx:Lx=R$(e||it.sessionStorage)};function $$(e,t,n){var r=function(i){on.error(t+" error: "+i)};return{is_supported:function(i){var o=n(e,i);return o||on.error(t+" unsupported"),o},error:r,get:function(i){try{return e.getItem(i)}catch(o){r(o)}return null},parse:function(i){try{return O.JSONDecode(e.getItem(i))||{}}catch{}return null},set:function(i,o){try{e.setItem(i,o)}catch(a){r(a)}},remove:function(i){try{e.removeItem(i)}catch(o){r(o)}}}}O.localStorage=$$(it.localStorage,"localStorage",Vf),O.sessionStorage=$$(it.sessionStorage,"sessionStorage",yW),O.register_event=function(){var e=function(r,i,o,a,u){if(!r){on.error("No valid element provided to register_event");return}if(r.addEventListener&&!a)r.addEventListener(i,o,!!u);else{var c="on"+i,d=r[c];r[c]=t(r,o,d)}};function t(r,i,o){var a=function(u){if(u=u||n(it.event),!!u){var c=!0,d,p;return O.isFunction(o)&&(d=o(u)),p=i.call(r,u),(d===!1||p===!1)&&(c=!1),c}};return a}function n(r){return r&&(r.preventDefault=n.preventDefault,r.stopPropagation=n.stopPropagation),r}return n.preventDefault=function(){this.returnValue=!1},n.stopPropagation=function(){this.cancelBubble=!0},e}();var _W=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');O.dom_query=function(){function e(i){return i.all?i.all:i.getElementsByTagName("*")}var t=/[\t\r\n]/g;function n(i,o){var a=" "+o+" ";return(" "+i.className+" ").replace(t," ").indexOf(a)>=0}function r(i){if(!dn.getElementsByTagName)return[];var o=i.split(" "),a,u,c,d,p,h,m,v,_,S,x=[dn];for(h=0;h<o.length;h++){if(a=o[h].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){u=a.split("#"),c=u[0];var b=u[1],C=dn.getElementById(b);if(!C||c&&C.nodeName.toLowerCase()!=c)return[];x=[C];continue}if(a.indexOf(".")>-1){u=a.split("."),c=u[0];var k=u[1];for(c||(c="*"),d=[],p=0,m=0;m<x.length;m++)for(c=="*"?_=e(x[m]):_=x[m].getElementsByTagName(c),v=0;v<_.length;v++)d[p++]=_[v];for(x=[],S=0,m=0;m<d.length;m++)d[m].className&&O.isString(d[m].className)&&n(d[m],k)&&(x[S++]=d[m]);continue}var A=a.match(_W);if(A){c=A[1];var I=A[2],$=A[3],B=A[4];for(c||(c="*"),d=[],p=0,m=0;m<x.length;m++)for(c=="*"?_=e(x[m]):_=x[m].getElementsByTagName(c),v=0;v<_.length;v++)d[p++]=_[v];x=[],S=0;var U;switch($){case"=":U=function(G){return G.getAttribute(I)==B};break;case"~":U=function(G){return G.getAttribute(I).match(new RegExp("\\b"+B+"\\b"))};break;case"|":U=function(G){return G.getAttribute(I).match(new RegExp("^"+B+"-?"))};break;case"^":U=function(G){return G.getAttribute(I).indexOf(B)===0};break;case"$":U=function(G){return G.getAttribute(I).lastIndexOf(B)==G.getAttribute(I).length-B.length};break;case"*":U=function(G){return G.getAttribute(I).indexOf(B)>-1};break;default:U=function(G){return G.getAttribute(I)}}for(x=[],S=0,m=0;m<d.length;m++)U(d[m])&&(x[S++]=d[m]);continue}for(c=a,d=[],p=0,m=0;m<x.length;m++)for(_=x[m].getElementsByTagName(c),v=0;v<_.length;v++)d[p++]=_[v];x=d}return x}return function(i){return O.isElement(i)?[i]:O.isObject(i)&&!O.isUndefined(i.length)?i:r.call(this,i)}}();var bW=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],xW=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];O.info={campaignParams:function(e){var t="",n={};return O.each(bW,function(r){t=O.getQueryParam(dn.URL,r),t.length?n[r]=t:e!==void 0&&(n[r]=e)}),n},clickParams:function(){var e="",t={};return O.each(xW,function(n){e=O.getQueryParam(dn.URL,n),e.length&&(t[n]=e)}),t},marketingParams:function(){return O.extend(O.info.campaignParams(),O.info.clickParams())},searchEngine:function(e){return e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(e){var t=O.info.searchEngine(e),n=t!="yahoo"?"q":"p",r={};if(t!==null){r.$search_engine=t;var i=O.getQueryParam(e,n);i.length&&(r.mp_keyword=i)}return r},browser:function(e,t,n){return t=t||"",n||O.includes(e," OPR/")?O.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":O.includes(e,"IEMobile")||O.includes(e,"WPDesktop")?"Internet Explorer Mobile":O.includes(e,"SamsungBrowser/")?"Samsung Internet":O.includes(e,"Edge")||O.includes(e,"Edg/")?"Microsoft Edge":O.includes(e,"FBIOS")?"Facebook Mobile":O.includes(e,"Chrome")?"Chrome":O.includes(e,"CriOS")?"Chrome iOS":O.includes(e,"UCWEB")||O.includes(e,"UCBrowser")?"UC Browser":O.includes(e,"FxiOS")?"Firefox iOS":O.includes(t,"Apple")?O.includes(e,"Mobile")?"Mobile Safari":"Safari":O.includes(e,"Android")?"Android Mobile":O.includes(e,"Konqueror")?"Konqueror":O.includes(e,"Firefox")?"Firefox":O.includes(e,"MSIE")||O.includes(e,"Trident/")?"Internet Explorer":O.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r=O.info.browser(e,t,n),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},o=i[r];if(o===void 0)return null;var a=e.match(o);return a?parseFloat(a[a.length-2]):null},os:function(){var e=oa;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return it.location.href},properties:function(e){return typeof e!="object"&&(e={}),O.extend(O.strip_empty_properties({$os:O.info.os(),$browser:O.info.browser(oa,rs.vendor,Pg),$referrer:dn.referrer,$referring_domain:O.info.referringDomain(dn.referrer),$device:O.info.device(oa)}),{$current_url:O.info.currentUrl(),$browser_version:O.info.browserVersion(oa,rs.vendor,Pg),$screen_height:A$.height,$screen_width:A$.width,mp_lib:"web",$lib_version:yo.LIB_VERSION,$insert_id:Nx(),time:O.timestamp()/1e3},O.strip_empty_properties(e))},people_properties:function(){return O.extend(O.strip_empty_properties({$os:O.info.os(),$browser:O.info.browser(oa,rs.vendor,Pg)}),{$browser_version:O.info.browserVersion(oa,rs.vendor,Pg)})},mpPageViewProperties:function(){return O.strip_empty_properties({current_page_title:dn.title,current_domain:it.location.hostname,current_url_path:it.location.pathname,current_url_protocol:it.location.protocol,current_url_search:it.location.search})}};var wW=function(e,t){var n=null,r=[];return function(i){var o=this;return r.push(i),n||(n=new ln(function(a){setTimeout(function(){var u=e.apply(o,[r]);n=null,r=[],a(u)},t)})),n}},Nx=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},SW=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,CW=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,D$=function(e){var t=CW,n=e.split("."),r=n[n.length-1];(r.length>4||r==="com"||r==="org")&&(t=SW);var i=e.match(t);return i?i[0]:""},EW=function(){var e=it.navigator.onLine;return O.isUndefined(e)||e},is=function(){},Su=null,Fg=null;typeof JSON<"u"&&(Su=JSON.stringify,Fg=JSON.parse),Su=Su||O.JSONEncode,Fg=Fg||O.JSONDecode,O.info=O.info,O.info.browser=O.info.browser,O.info.browserVersion=O.info.browserVersion,O.info.device=O.info.device,O.info.properties=O.info.properties,O.isBlockedUA=O.isBlockedUA,O.isEmptyObject=O.isEmptyObject,O.isObject=O.isObject,O.JSONDecode=O.JSONDecode,O.JSONEncode=O.JSONEncode,O.toArray=O.toArray,O.NPO=ts;var kW="mixpanelBrowserDb",L$="mixpanelRecordingEvents",Bx="mixpanelRecordingRegistry",AW=1,IW=[L$,Bx],Ro=function(e){this.dbPromise=null,this.storeName=e};Ro.prototype._openDb=function(){return new ln(function(e,t){var n=it.indexedDB.open(kW,AW);n.onerror=function(){t(n.error)},n.onsuccess=function(){e(n.result)},n.onupgradeneeded=function(r){var i=r.target.result;IW.forEach(function(o){i.createObjectStore(o)})}})},Ro.prototype.init=function(){return it.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(e){return e instanceof it.IDBDatabase?ln.resolve():ln.reject(e)})):ln.reject("indexedDB is not supported in this browser")},Ro.prototype.makeTransaction=function(e,t){var n=this.storeName,r=function(i){return new ln(function(o,a){var u=i.transaction(n,e);u.oncomplete=function(){o(u)},u.onabort=u.onerror=function(){a(u.error)},t(u.objectStore(n))})};return this.dbPromise.then(r).catch((function(i){return i&&i.name==="InvalidStateError"?(this.dbPromise=this._openDb(),this.dbPromise.then(r)):ln.reject(i)}).bind(this))},Ro.prototype.setItem=function(e,t){return this.makeTransaction("readwrite",function(n){n.put(t,e)})},Ro.prototype.getItem=function(e){var t;return this.makeTransaction("readonly",function(n){t=n.get(e)}).then(function(){return t.result})},Ro.prototype.removeItem=function(e){return this.makeTransaction("readwrite",function(t){t.delete(e)})},Ro.prototype.getAll=function(){var e;return this.makeTransaction("readonly",function(t){e=t.getAll()}).then(function(){return e.result})};var TW="__mp_opt_in_out_";function MW(e,t){P$(!0,e,t)}function OW(e,t){P$(!1,e,t)}function RW(e,t){return B$(e,t)==="1"}function N$(e,t){if(DW(t))return on.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var n=B$(e,t)==="0";return n&&on.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function os(e){return zx(e,function(t){return this.get_config(t)})}function as(e){return zx(e,function(t){return this._get_config(t)})}function Cu(e){return zx(e,function(t){return this._get_config(t)})}function $W(e,t){t=t||{},Px(t).remove(Fx(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function Px(e){return e=e||{},e.persistenceType==="localStorage"?O.localStorage:O.cookie}function Fx(e,t){return t=t||{},(t.persistencePrefix||TW)+e}function B$(e,t){return Px(t).get(Fx(e,t))}function DW(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||it,n=t.navigator||{},r=!1;return O.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(i){O.includes([!0,1,"1","yes"],i)&&(r=!0)}),r}function P$(e,t,n){if(!O.isString(t)||!t.length){on.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token");return}n=n||{},Px(n).set(Fx(t,n),e?1:0,O.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})}function zx(e,t){return function(){var n=!1;try{var r=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),a=t.call(this,"opt_out_tracking_cookie_prefix"),u=t.call(this,"window");r&&(n=N$(r,{ignoreDnt:i,persistenceType:o,persistencePrefix:a,window:u}))}catch(d){on.error("Unexpected error when checking tracking opt-out status: "+d)}if(!n)return e.apply(this,arguments);var c=arguments[arguments.length-1];typeof c=="function"&&c(0)}}var LW=wu("lock"),F$=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||it.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3,this.promiseImpl=t.promiseImpl||ln};F$.prototype.withLock=function(e,t){var n=this.promiseImpl;return new n(O.bind(function(r,i){var o=t||new Date().getTime()+"|"+Math.random(),a=new Date().getTime(),u=this.storageKey,c=this.pollIntervalMS,d=this.timeoutMS,p=this.storage,h=u+":X",m=u+":Y",v=u+":Z",_=function(k){if(new Date().getTime()-a>d){LW.error("Timeout waiting for mutex on "+u+"; clearing lock. ["+o+"]"),p.removeItem(v),p.removeItem(m),b();return}setTimeout(function(){try{k()}catch(A){i(A)}},c*(Math.random()+.1))},S=function(k,A){k()?A():_(function(){S(k,A)})},x=function(){var k=p.getItem(m);return k&&k!==o?!1:(p.setItem(m,o),p.getItem(m)===o?!0:(Vf(p,!0)||i(new Error("localStorage support dropped while acquiring lock")),!1))},b=function(){p.setItem(h,o),S(x,function(){if(p.getItem(h)===o){C();return}_(function(){if(p.getItem(m)!==o){b();return}S(function(){return!p.getItem(v)},C)})})},C=function(){p.setItem(v,"1");var k=function(){p.removeItem(v),p.getItem(m)===o&&p.removeItem(m),p.getItem(h)===o&&p.removeItem(h)};e().then(function(A){k(),r(A)}).catch(function(A){k(),i(A)})};try{if(Vf(p,!0))b();else throw new Error("localStorage support check failed")}catch(k){i(k)}},this))};var Zf=function(e){this.storage=e||it.localStorage};Zf.prototype.init=function(){return ln.resolve()},Zf.prototype.setItem=function(e,t){return new ln(O.bind(function(n,r){try{this.storage.setItem(e,Su(t))}catch(i){r(i)}n()},this))},Zf.prototype.getItem=function(e){return new ln(O.bind(function(t,n){var r;try{r=Fg(this.storage.getItem(e))}catch(i){n(i)}t(r)},this))},Zf.prototype.removeItem=function(e){return new ln(O.bind(function(t,n){try{this.storage.removeItem(e)}catch(r){n(r)}t()},this))};var z$=wu("batch"),$o=function(e,t){t=t||{},this.storageKey=e,this.usePersistence=t.usePersistence,this.usePersistence&&(this.queueStorage=t.queueStorage||new Zf,this.lock=new F$(e,{storage:t.sharedLockStorage||it.localStorage,timeoutMS:t.sharedLockTimeoutMS})),this.reportError=t.errorReporter||O.bind(z$.error,z$),this.pid=t.pid||null,this.memQueue=[],this.initialized=!1,t.enqueueThrottleMs?this.enqueuePersisted=wW(O.bind(this._enqueuePersisted,this),t.enqueueThrottleMs):this.enqueuePersisted=O.bind(function(n){return this._enqueuePersisted([n])},this)};$o.prototype.ensureInit=function(){return this.initialized?ln.resolve():this.queueStorage.init().then(O.bind(function(){this.initialized=!0},this)).catch(O.bind(function(e){this.reportError("Error initializing queue persistence. Disabling persistence",e),this.initialized=!0,this.usePersistence=!1},this))},$o.prototype.enqueue=function(e,t){var n={id:Nx(),flushAfter:new Date().getTime()+t*2,payload:e};return this.usePersistence?this.enqueuePersisted(n):(this.memQueue.push(n),ln.resolve(!0))},$o.prototype._enqueuePersisted=function(e){var t=O.bind(function(){return this.ensureInit().then(O.bind(function(){return this.readFromStorage()},this)).then(O.bind(function(n){return this.saveToStorage(n.concat(e))},this)).then(O.bind(function(n){return n&&(this.memQueue=this.memQueue.concat(e)),n},this)).catch(O.bind(function(n){return this.reportError("Error enqueueing items",n,e),!1},this))},this);return this.lock.withLock(t,this.pid).catch(O.bind(function(n){return this.reportError("Error acquiring storage lock",n),!1},this))},$o.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);return this.usePersistence&&t.length<e?this.ensureInit().then(O.bind(function(){return this.readFromStorage()},this)).then(O.bind(function(n){if(n.length){var r={};O.each(t,function(a){r[a.id]=!0});for(var i=0;i<n.length;i++){var o=n[i];if(new Date().getTime()>o.flushAfter&&!r[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}return t},this)):ln.resolve(t)};var U$=function(e,t){var n=[];return O.each(e,function(r){r.id&&!t[r.id]&&n.push(r)}),n};$o.prototype.removeItemsByID=function(e){var t={};if(O.each(e,function(r){t[r]=!0}),this.memQueue=U$(this.memQueue,t),this.usePersistence){var n=O.bind(function(){return this.ensureInit().then(O.bind(function(){return this.readFromStorage()},this)).then(O.bind(function(r){return r=U$(r,t),this.saveToStorage(r)},this)).then(O.bind(function(){return this.readFromStorage()},this)).then(O.bind(function(r){for(var i=0;i<r.length;i++){var o=r[i];if(o.id&&t[o.id])throw new Error("Item not removed from storage")}return!0},this)).catch(O.bind(function(r){return this.reportError("Error removing items",r,e),!1},this))},this);return this.lock.withLock(n,this.pid).catch(O.bind(function(r){return this.reportError("Error acquiring storage lock",r),Vf(this.lock.storage,!0)?!1:n().then(O.bind(function(i){return i||this.queueStorage.removeItem(this.storageKey).then(function(){return i})},this)).catch(O.bind(function(i){return this.reportError("Error clearing queue",i),!1},this))},this))}else return ln.resolve(!0)};var j$=function(e,t){var n=[];return O.each(e,function(r){var i=r.id;if(i in t){var o=t[i];o!==null&&(r.payload=o,n.push(r))}else n.push(r)}),n};$o.prototype.updatePayloads=function(e){return this.memQueue=j$(this.memQueue,e),this.usePersistence?this.lock.withLock(O.bind(function(){return this.ensureInit().then(O.bind(function(){return this.readFromStorage()},this)).then(O.bind(function(n){return n=j$(n,e),this.saveToStorage(n)},this)).catch(O.bind(function(n){return this.reportError("Error updating items",e,n),!1},this))},this),this.pid).catch(O.bind(function(t){return this.reportError("Error acquiring storage lock",t),!1},this)):ln.resolve(!0)},$o.prototype.readFromStorage=function(){return this.ensureInit().then(O.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(O.bind(function(e){return e&&(O.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null)),e||[]},this)).catch(O.bind(function(e){return this.reportError("Error retrieving queue",e),[]},this))},$o.prototype.saveToStorage=function(e){return this.ensureInit().then(O.bind(function(){return this.queueStorage.setItem(this.storageKey,e)},this)).then(function(){return!0}).catch(O.bind(function(t){return this.reportError("Error saving queue",t),!1},this))},$o.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(O.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):ln.resolve()};var NW=10*60*1e3,Yf=wu("batch"),Qi=function(e,t){this.errorReporter=t.errorReporter,this.queue=new $o(e,{errorReporter:O.bind(this.reportError,this),queueStorage:t.queueStorage,sharedLockStorage:t.sharedLockStorage,sharedLockTimeoutMS:t.sharedLockTimeoutMS,usePersistence:t.usePersistence,enqueueThrottleMs:t.enqueueThrottleMs}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1,this._flushPromise=null};Qi.prototype.enqueue=function(e){return this.queue.enqueue(e,this.flushInterval)},Qi.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},Qi.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},Qi.prototype.clear=function(){return this.queue.clear()},Qi.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},Qi.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},Qi.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(O.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},Qi.prototype.sendRequestPromise=function(e,t){return new ln(O.bind(function(n){this.sendRequest(e,t,n)},this))},Qi.prototype.flush=function(e){if(this.requestInProgress)return Yf.log("Flush: Request already in progress"),ln.resolve();this.requestInProgress=!0,e=e||{};var t=this.libConfig.batch_request_timeout_ms,n=new Date().getTime(),r=this.batchSize;return this.queue.fillBatch(r).then(O.bind(function(i){var o=i.length===r,a=[],u={};if(O.each(i,function(h){var m=h.payload;if(this.beforeSendHook&&!h.orphaned&&(m=this.beforeSendHook(m)),m){m.event&&m.properties&&(m.properties=O.extend({},m.properties,{mp_sent_by_lib_version:yo.LIB_VERSION}));var v=!0,_=h.id;_?(this.itemIdsSentSuccessfully[_]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:h,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[_]}),v=!1):this.reportError("[dupe] found item with no ID",{item:h}),v&&a.push(m)}u[h.id]=m},this),a.length<1)return this.requestInProgress=!1,this.resetFlush(),ln.resolve();var c=O.bind(function(){return this.queue.removeItemsByID(O.map(i,function(h){return h.id})).then(O.bind(function(h){return O.each(i,O.bind(function(m){var v=m.id;v?(this.itemIdsSentSuccessfully[v]=this.itemIdsSentSuccessfully[v]||0,this.itemIdsSentSuccessfully[v]++,this.itemIdsSentSuccessfully[v]>5&&this.reportError("[dupe] item ID sent too many times",{item:m,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[v]})):this.reportError("[dupe] found item with no ID while removing",{item:m})},this)),h?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?(this.resetFlush(),ln.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),ln.resolve())},this))},this),d=O.bind(function(h){this.requestInProgress=!1;try{if(e.unloading)return this.queue.updatePayloads(u);if(O.isObject(h)&&h.error==="timeout"&&new Date().getTime()-n>=t)return this.reportError("Network timeout; retrying"),this.flush();if(O.isObject(h)&&(h.httpStatusCode>=500||h.httpStatusCode===429||h.httpStatusCode<=0&&!EW()||h.error==="timeout")){var m=this.flushInterval*2;return h.retryAfter&&(m=parseInt(h.retryAfter,10)*1e3||m),m=Math.min(NW,m),this.reportError("Error; retry in "+m+" ms"),this.scheduleFlush(m),ln.resolve()}else if(O.isObject(h)&&h.httpStatusCode===413)if(i.length>1){var v=Math.max(1,Math.floor(r/2));return this.batchSize=Math.min(this.batchSize,v,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),ln.resolve()}else return this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),c();else return c()}catch(_){this.reportError("Error handling API response",_),this.resetFlush()}},this),p={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};return e.unloading&&(p.transport="sendBeacon"),Yf.log("MIXPANEL REQUEST:",a),this.sendRequestPromise(a,p).then(d)},this)).catch(O.bind(function(i){this.reportError("Error flushing request queue",i),this.resetFlush()},this))},Qi.prototype.reportError=function(e,t){if(Yf.error.apply(Yf.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){Yf.error(n)}};var Ux=function(e){var t=Date.now();return!e||t>e.maxExpires||t>e.idleExpires},BW=250,Eu=wu("recorder"),q$=it.CompressionStream,PW={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},FW=new Set([kt.MouseMove,kt.MouseInteraction,kt.Scroll,kt.ViewportResize,kt.Input,kt.TouchMove,kt.MediaInteraction,kt.Drag,kt.Selection]);function zW(e){return e.type===Wt.IncrementalSnapshot&&FW.has(e.data.source)}var ti=function(e){this._mixpanel=e.mixpanelInstance,this._onIdleTimeout=e.onIdleTimeout||is,this._onMaxLengthReached=e.onMaxLengthReached||is,this._onBatchSent=e.onBatchSent||is,this._rrwebRecord=e.rrwebRecord||null,this._stopRecording=null,this.replayId=e.replayId,this.batchStartUrl=e.batchStartUrl||null,this.replayStartUrl=e.replayStartUrl||null,this.idleExpires=e.idleExpires||null,this.maxExpires=e.maxExpires||null,this.replayStartTime=e.replayStartTime||null,this.seqNo=e.seqNo||0,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=Hf,this.recordMinMs=0;var t=Vf(e.sharedLockStorage,!0);this.batcherKey="__mprec_"+this.getConfig("name")+"_"+this.getConfig("token")+"_"+this.replayId,this.queueStorage=new Ro(L$),this.batcher=new Qi(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:PW,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:e.sharedLockStorage,usePersistence:t,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:BW,sharedLockTimeoutMS:10*1e3})};ti.prototype.unloadPersistedData=function(){return this.batcher.stop(),this.batcher.flush().then((function(){return this.queueStorage.removeItem(this.batcherKey)}).bind(this))},ti.prototype.getConfig=function(e){return this._mixpanel.get_config(e)},ti.prototype.get_config=function(e){return this.getConfig(e)},ti.prototype.startRecording=function(e){if(this._rrwebRecord===null){this.reportError("rrweb record function not provided. ");return}if(this._stopRecording!==null){Eu.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>Hf&&(this.recordMaxMs=Hf,Eu.critical("record_max_ms cannot be greater than "+Hf+"ms. Capping value.")),this.maxExpires||(this.maxExpires=new Date().getTime()+this.recordMaxMs),this.recordMinMs=this.getConfig("record_min_ms"),this.recordMinMs>Tx&&(this.recordMinMs=Tx,Eu.critical("record_min_ms cannot be greater than "+Tx+"ms. Capping value.")),this.replayStartTime||(this.replayStartTime=new Date().getTime(),this.batchStartUrl=O.info.currentUrl(),this.replayStartUrl=O.info.currentUrl()),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=(function(){clearTimeout(this.idleTimeoutId);var i=this.getConfig("record_idle_timeout_ms");this.idleTimeoutId=setTimeout(this._onIdleTimeout,i),this.idleExpires=new Date().getTime()+i}).bind(this);t();var n=this.getConfig("record_block_selector");(n===""||n===null)&&(n=void 0);try{this._stopRecording=this._rrwebRecord({emit:(function(i){if(this.idleExpires&&this.idleExpires<i.timestamp){this._onIdleTimeout();return}zW(i)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t()),this.__enqueuePromise=this.batcher.enqueue(i)}).bind(this),blockClass:this.getConfig("record_block_class"),blockSelector:n,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15}})}catch(i){this.reportError("Unexpected error when starting rrweb recording.",i)}if(typeof this._stopRecording!="function"){this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,this.stopRecording();return}var r=this.maxExpires-new Date().getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),r)},ti.prototype.stopRecording=function(e){if(!this.isRrwebStopped()){try{this._stopRecording()}catch(n){this.reportError("Error with rrweb stopRecording",n)}this._stopRecording=null}var t;return this.batcher.stopped?t=this.batcher.clear():e||(t=this.batcher.flush()),this.batcher.stop(),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId),t},ti.prototype.isRrwebStopped=function(){return this._stopRecording===null},ti.prototype.flushEventsWithOptOut=function(e,t,n){var r=(function(i){i===0&&(this.stopRecording(),n({error:"Tracking has been opted out, stopping recording."}))}).bind(this);this._flushEvents(e,t,n,r)},ti.prototype.serialize=function(){var e;try{e=this._mixpanel.get_tab_id()}catch(t){this.reportError("Error getting tab ID for serialization ",t),e=null}return{replayId:this.replayId,seqNo:this.seqNo,replayStartTime:this.replayStartTime,batchStartUrl:this.batchStartUrl,replayStartUrl:this.replayStartUrl,idleExpires:this.idleExpires,maxExpires:this.maxExpires,tabId:e}},ti.deserialize=function(e,t){var n=new ti(O.extend({},t,{replayId:e.replayId,batchStartUrl:e.batchStartUrl,replayStartUrl:e.replayStartUrl,idleExpires:e.idleExpires,maxExpires:e.maxExpires,replayStartTime:e.replayStartTime,seqNo:e.seqNo,sharedLockStorage:t.sharedLockStorage}));return n},ti.prototype._sendRequest=function(e,t,n,r){var i=(function(o,a){o.status===200&&this.replayId===e&&(this.seqNo++,this.batchStartUrl=O.info.currentUrl()),this._onBatchSent(),r({status:0,httpStatusCode:o.status,responseBody:a,retryAfter:o.headers.get("Retry-After")})}).bind(this);it.fetch(this.getConfig("api_host")+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:n}).then(function(o){o.json().then(function(a){i(o,a)}).catch(function(a){r({error:a})})}).catch(function(o){r({error:o,httpStatusCode:0})})},ti.prototype._flushEvents=os(function(e,t,n){var r=e.length;if(r>0){for(var i=this.replayId,o=1/0,a=-1/0,u=!1,c=0;c<r;c++)o=Math.min(o,e[c].timestamp),a=Math.max(a,e[c].timestamp),e[c].type===Wt.FullSnapshot&&(u=!0);if(this.seqNo===0){if(!u){n({error:"First batch does not contain a full snapshot. Aborting recording."}),this.stopRecording(!0);return}this.replayStartTime=o}else this.replayStartTime||(this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=o);var d=a-this.replayStartTime,p={$current_url:this.batchStartUrl,$lib_version:yo.LIB_VERSION,batch_start_time:o/1e3,distinct_id:String(this._mixpanel.get_distinct_id()),mp_lib:"web",replay_id:i,replay_length_ms:d,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},h=JSON.stringify(e),m=this._mixpanel.get_property("$device_id");m&&(p.$device_id=m);var v=this._mixpanel.get_property("$user_id");if(v&&(p.$user_id=v),q$){var _=new Blob([h],{type:"application/json"}).stream(),S=_.pipeThrough(new q$("gzip"));new Response(S).blob().then((function(x){p.format="gzip",this._sendRequest(i,p,x,n)}).bind(this))}else p.format="body",this._sendRequest(i,p,h,n)}}),ti.prototype.reportError=function(e,t){Eu.error.apply(Eu.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.getConfig("error_reporter")(e,t)}catch(n){Eu.error(n)}};var ku=function(e){this.idb=new Ro(Bx),this.errorReporter=e.errorReporter,this.mixpanelInstance=e.mixpanelInstance,this.sharedLockStorage=e.sharedLockStorage};ku.prototype.handleError=function(e){this.errorReporter("IndexedDB error: ",e)},ku.prototype.setActiveRecording=function(e){var t=e.tabId;return t?this.idb.init().then((function(){return this.idb.setItem(t,e)}).bind(this)).catch(this.handleError.bind(this)):(console.warn("No tab ID is set, cannot persist recording metadata."),ln.resolve())},ku.prototype.getActiveRecording=function(){return this.idb.init().then((function(){return this.idb.getItem(this.mixpanelInstance.get_tab_id())}).bind(this)).then((function(e){return Ux(e)?null:e}).bind(this)).catch(this.handleError.bind(this))},ku.prototype.clearActiveRecording=function(){return this.getActiveRecording().then((function(e){if(e)return e.maxExpires=0,this.setActiveRecording(e)}).bind(this)).catch(this.handleError.bind(this))},ku.prototype.flushInactiveRecordings=function(){return this.idb.init().then((function(){return this.idb.getAll()}).bind(this)).then((function(e){var t=e.filter(function(n){return Ux(n)}).map((function(n){var r=ti.deserialize(n,{mixpanelInstance:this.mixpanelInstance,sharedLockStorage:this.sharedLockStorage});return r.unloadPersistedData().then((function(){return this.idb.removeItem(n.tabId)}).bind(this)).catch(this.handleError.bind(this))}).bind(this));return ln.all(t)}).bind(this)).catch(this.handleError.bind(this))};var Wf=wu("recorder"),aa=function(e,t,n){this.mixpanelInstance=e,this.rrwebRecord=t||Ja,this.sharedLockStorage=n,this.recordingRegistry=new ku({mixpanelInstance:this.mixpanelInstance,errorReporter:Wf.error,sharedLockStorage:n}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null};aa.prototype.startRecording=function(e){if(e=e||{},this.activeRecording&&!this.activeRecording.isRrwebStopped()){Wf.log("Recording already in progress, skipping startRecording.");return}var t=(function(){Wf.log("Idle timeout reached, restarting recording."),this.resetRecording()}).bind(this),n=(function(){Wf.log("Max recording length reached, stopping recording."),this.resetRecording()}).bind(this),r=(function(){this.recordingRegistry.setActiveRecording(this.activeRecording.serialize()),this.__flushPromise=this.activeRecording.batcher._flushPromise}).bind(this),i={mixpanelInstance:this.mixpanelInstance,onBatchSent:r,onIdleTimeout:t,onMaxLengthReached:n,replayId:O.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return e.activeSerializedRecording?this.activeRecording=ti.deserialize(e.activeSerializedRecording,i):this.activeRecording=new ti(i),this.activeRecording.startRecording(e.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())},aa.prototype.stopRecording=function(){var e=this._stopCurrentRecording(!1);return this.recordingRegistry.clearActiveRecording(),this.activeRecording=null,e},aa.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},aa.prototype._stopCurrentRecording=function(e){return this.activeRecording?this.activeRecording.stopRecording(e):ln.resolve()},aa.prototype.resumeRecording=function(e){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),ln.resolve(null)):this.recordingRegistry.getActiveRecording().then((function(t){return t?this.startRecording({activeSerializedRecording:t}):e?this.startRecording({shouldStopBatcher:!1}):(Wf.log("No resumable recording found."),null)}).bind(this))},aa.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},aa.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(aa.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),it.__mp_recorder=aa;var zg="change",Kf="click",H$="hashchange",Au="mp_locationchange",G$="popstate",V$="scrollend",jx="submit",UW=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],Z$=["mp-include"],qx=["mp-no-track"],Y$=qx.concat(["mp-sensitive"]),jW=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],Ci=wu("autocapture");function Hx(e){for(var t={},n=W$(e).split(" "),r=0;r<n.length;r++){var i=n[r];i&&(t[i]=!0)}return t}function W$(e){switch(typeof e.className){case"string":return e.className;case"object":return e.className.baseVal||e.getAttribute("class")||"";default:return""}}function qW(e){if(e.previousElementSibling)return e.previousElementSibling;do e=e.previousSibling;while(e&&!X$(e));return e}function K$(e,t,n,r,i,o){var a={$classes:W$(e).split(" "),$tag_name:e.tagName.toLowerCase()},u=e.id;u&&(a.$id=u),Zx(e,t,i,o)&&O.each(jW.concat(r),function(h){if(e.hasAttribute(h)&&!n[h]){var m=e.getAttribute(h);Ug(m)&&(a["$attr-"+h]=m)}});for(var c=1,d=1,p=e;p=qW(p);)c++,p.tagName===e.tagName&&d++;return a.$nth_child=c,a.$nth_of_type=d,a}function HW(e,t){var n=t.allowElementCallback,r=t.allowSelectors||[],i=t.blockAttrs||[],o=t.blockElementCallback,a=t.blockSelectors||[],u=t.captureTextContent||!1,c=t.captureExtraAttrs||[],d={};O.each(i,function(A){d[A]=!0});var p=null,h=typeof e.target>"u"?e.srcElement:e.target;if(J$(h)&&(h=h.parentNode),ZW(h,e)&&Gx(h,e,n,r)&&!Vx(h,e,o,a)){for(var m=[h],v=h;v.parentNode&&!Do(v,"body");)m.push(v.parentNode),v=v.parentNode;var _=[],S,x=!1;if(O.each(m,function(A){var I=Zx(A,e,n,r);!d.href&&A.tagName.toLowerCase()==="a"&&(S=A.getAttribute("href"),S=I&&Ug(S)&&S),Vx(A,e,o,a)&&(x=!0),_.push(K$(A,e,d,c,n,r))},this),!x){var b=dn.documentElement;if(p={$event_type:e.type,$host:it.location.host,$pathname:it.location.pathname,$elements:_,$el_attr__href:S,$viewportHeight:Math.max(b.clientHeight,it.innerHeight||0),$viewportWidth:Math.max(b.clientWidth,it.innerWidth||0)},O.each(c,function(A){if(!d[A]&&h.hasAttribute(A)){var I=h.getAttribute(A);Ug(I)&&(p["$el_attr__"+A]=I)}}),u&&(C=Q$(h,e,n,r),C&&C.length&&(p.$el_text=C)),e.type===Kf&&(O.each(UW,function(A){A in e&&(p["$"+A]=e[A])}),h=GW(e)),u){var C=Q$(h,e,n,r);C&&C.length&&(p.$el_text=C)}if(h){if(!Gx(h,e,n,r)||Vx(h,e,o,a))return null;var k=K$(h,e,d,c,n,r);p.$target=k,p.$el_classes=k.$classes,O.extend(p,O.strip_empty_properties({$el_id:k.$id,$el_tag_name:k.$tag_name}))}}}return p}function Q$(e,t,n,r){var i="";return Zx(e,t,n,r)&&e.childNodes&&e.childNodes.length&&O.each(e.childNodes,function(o){J$(o)&&o.textContent&&(i+=O.trim(o.textContent).split(/(\s+)/).filter(Ug).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),O.trim(i)}function GW(e){for(var t=e.target,n=e.composedPath(),r=0;r<n.length;r++){var i=n[r];if(Do(i,"a")||Do(i,"button")||Do(i,"input")||Do(i,"select")||i.getAttribute&&i.getAttribute("role")==="button"){t=i;break}if(i===t)break}return t}function Gx(e,t,n,r){if(n)try{if(!n(e,t))return!1}catch(a){return Ci.critical("Error while checking element in allowElementCallback",a),!1}if(!r.length)return!0;for(var i=0;i<r.length;i++){var o=r[i];try{if(e.matches(o))return!0}catch(a){Ci.critical("Error while checking selector: "+o,a)}}return!1}function Vx(e,t,n,r){var i;if(n)try{if(n(e,t))return!0}catch(u){return Ci.critical("Error while checking element in blockElementCallback",u),!0}if(r&&r.length)for(i=0;i<r.length;i++){var o=r[i];try{if(e.matches(o))return!0}catch(u){Ci.critical("Error while checking selector: "+o,u)}}var a=Hx(e);for(i=0;i<qx.length;i++)if(a[qx[i]])return!0;return!1}function X$(e){return e&&e.nodeType===1}function Do(e,t){return e&&e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function J$(e){return e&&e.nodeType===3}function VW(){try{var e=dn.createElement("div");return!!e.matches}catch{return!1}}function ZW(e,t){if(!e||Do(e,"html")||!X$(e))return!1;var n=e.tagName.toLowerCase();switch(n){case"form":return t.type===jx;case"input":return["button","submit"].indexOf(e.getAttribute("type"))===-1?t.type===zg:t.type===Kf;case"select":case"textarea":return t.type===zg;default:return t.type===Kf}}function Zx(e,t,n,r){var i;if(!Gx(e,t,n,r))return!1;for(var o=e;o.parentNode&&!Do(o,"body");o=o.parentNode){var a=Hx(o);for(i=0;i<Y$.length;i++)if(a[Y$[i]])return!1}var u=Hx(e);for(i=0;i<Z$.length;i++)if(u[Z$[i]])return!0;if(Do(e,"input")||Do(e,"select")||Do(e,"textarea")||e.getAttribute("contenteditable")==="true")return!1;var c=e.type||"";if(typeof c=="string")switch(c.toLowerCase()){case"hidden":return!1;case"password":return!1}var d=e.name||e.id||"";if(typeof d=="string"){var p=/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i;if(p.test(d.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Ug(e){if(e===null||O.isUndefined(e))return!1;if(typeof e=="string"){e=O.trim(e);var t=/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;if(t.test((e||"").replace(/[- ]/g,"")))return!1;var n=/(^\d{3}-?\d{2}-?\d{4}$)/;if(n.test(e))return!1}return!0}var e3="autocapture",YW="track_pageview",t3="full-url",WW="url-with-path-and-query-string",KW="url-with-path",QW="allow_element_callback",n3="allow_selectors",r3="allow_url_regexes",i3="block_attrs",o3="block_element_callback",a3="block_selectors",s3="block_url_regexes",l3="capture_extra_attrs",u3="capture_text_content",c3="scroll_capture_all",f3="scroll_depth_percent_checkpoints",Yx="click",Wx="input",d3="pageview",Kx="scroll",Qx="submit",Lr={};Lr[n3]=[],Lr[r3]=[],Lr[i3]=[],Lr[o3]=null,Lr[a3]=[],Lr[s3]=[],Lr[l3]=[],Lr[u3]=!1,Lr[c3]=!1,Lr[f3]=[25,50,75,100],Lr[Yx]=!0,Lr[Wx]=!0,Lr[d3]=t3,Lr[Kx]=!0,Lr[Qx]=!0;var jg={$mp_autocapture:!0},XW="$mp_click",JW="$mp_input_change",eK="$mp_scroll",tK="$mp_submit",Di=function(e){this.mp=e};Di.prototype.init=function(){if(!VW()){Ci.critical("Autocapture unavailable: missing required DOM APIs");return}this.initPageviewTracking(),this.initClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking()},Di.prototype.getFullConfig=function(){var e=this.mp.get_config(e3);return e?O.isObject(e)?O.extend({},Lr,e):Lr:{}},Di.prototype.getConfig=function(e){return this.getFullConfig()[e]},Di.prototype.currentUrlBlocked=function(){var e,t=O.info.currentUrl(),n=this.getConfig(r3)||[];if(n.length){var r=!1;for(e=0;e<n.length;e++){var i=n[e];try{if(t.match(i)){r=!0;break}}catch(a){return Ci.critical("Error while checking block URL regex: "+i,a),!0}}if(!r)return!0}var o=this.getConfig(s3)||[];if(!o||!o.length)return!1;for(e=0;e<o.length;e++)try{if(t.match(o[e]))return!0}catch(a){return Ci.critical("Error while checking block URL regex: "+o[e],a),!0}return!1},Di.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(e3)?this.getConfig(d3):this.mp.get_config(YW)},Di.prototype.trackDomEvent=function(e,t){if(!this.currentUrlBlocked()){var n=HW(e,{allowElementCallback:this.getConfig(QW),allowSelectors:this.getConfig(n3),blockAttrs:this.getConfig(i3),blockElementCallback:this.getConfig(o3),blockSelectors:this.getConfig(a3),captureExtraAttrs:this.getConfig(l3),captureTextContent:this.getConfig(u3)});n&&(O.extend(n,jg),this.mp.track(t,n))}},Di.prototype.initClickTracking=function(){it.removeEventListener(Kf,this.listenerClick),this.getConfig(Yx)&&(Ci.log("Initializing click tracking"),this.listenerClick=it.addEventListener(Kf,(function(e){this.getConfig(Yx)&&this.trackDomEvent(e,XW)}).bind(this)))},Di.prototype.initInputTracking=function(){it.removeEventListener(zg,this.listenerChange),this.getConfig(Wx)&&(Ci.log("Initializing input tracking"),this.listenerChange=it.addEventListener(zg,(function(e){this.getConfig(Wx)&&this.trackDomEvent(e,JW)}).bind(this)))},Di.prototype.initPageviewTracking=function(){if(it.removeEventListener(G$,this.listenerPopstate),it.removeEventListener(H$,this.listenerHashchange),it.removeEventListener(Au,this.listenerLocationchange),!!this.pageviewTrackingConfig()){Ci.log("Initializing pageview tracking");var e="",t=!1;this.currentUrlBlocked()||(t=this.mp.track_pageview(jg)),t&&(e=O.info.currentUrl()),this.listenerPopstate=it.addEventListener(G$,function(){it.dispatchEvent(new Event(Au))}),this.listenerHashchange=it.addEventListener(H$,function(){it.dispatchEvent(new Event(Au))});var n=it.history.pushState;typeof n=="function"&&(it.history.pushState=function(i,o,a){n.call(it.history,i,o,a),it.dispatchEvent(new Event(Au))});var r=it.history.replaceState;typeof r=="function"&&(it.history.replaceState=function(i,o,a){r.call(it.history,i,o,a),it.dispatchEvent(new Event(Au))}),this.listenerLocationchange=it.addEventListener(Au,$x((function(){if(!this.currentUrlBlocked()){var i=O.info.currentUrl(),o=!1,a=i.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0],u=this.pageviewTrackingConfig();if(u===t3?o=i!==e:u===WW?o=i.split("#")[0]!==e.split("#")[0]:u===KW&&(o=a),o){var c=this.mp.track_pageview(jg);c&&(e=i),a&&(this.lastScrollCheckpoint=0,Ci.log("Path change: re-initializing scroll depth checkpoints"))}}}).bind(this)))}},Di.prototype.initScrollTracking=function(){it.removeEventListener(V$,this.listenerScroll),this.getConfig(Kx)&&(Ci.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0,this.listenerScroll=it.addEventListener(V$,$x((function(){if(this.getConfig(Kx)&&!this.currentUrlBlocked()){var e=this.getConfig(c3),t=(this.getConfig(f3)||[]).slice().sort(function(c,d){return c-d}),n=it.scrollY,r=O.extend({$scroll_top:n},jg);try{var i=dn.body.scrollHeight,o=Math.round(n/(i-it.innerHeight)*100);if(r.$scroll_height=i,r.$scroll_percentage=o,o>this.lastScrollCheckpoint)for(var a=0;a<t.length;a++){var u=t[a];o>=u&&this.lastScrollCheckpoint<u&&(r.$scroll_checkpoint=u,this.lastScrollCheckpoint=u,e=!0)}}catch(c){Ci.critical("Error while calculating scroll percentage",c)}e&&this.mp.track(eK,r)}}).bind(this))))},Di.prototype.initSubmitTracking=function(){it.removeEventListener(jx,this.listenerSubmit),this.getConfig(Qx)&&(Ci.log("Initializing submit tracking"),this.listenerSubmit=it.addEventListener(jx,(function(e){this.getConfig(Qx)&&this.trackDomEvent(e,tK)}).bind(this)))},vW(Di);var sa=function(){};sa.prototype.create_properties=function(){},sa.prototype.event_handler=function(){},sa.prototype.after_track_handler=function(){},sa.prototype.init=function(e){return this.mp=e,this},sa.prototype.track=function(e,t,n,r){var i=this,o=O.dom_query(e);if(o.length===0){on.error("The DOM query ("+e+") returned 0 elements");return}return O.each(o,function(a){O.register_event(a,this.override_event,function(u){var c={},d=i.create_properties(n,this),p=i.mp.get_config("track_links_timeout");i.event_handler(u,this,c),window.setTimeout(i.track_callback(r,d,c,!0),p),i.mp.track(t,d,i.track_callback(r,d,c))})},this),!0},sa.prototype.track_callback=function(e,t,n,r){r=r||!1;var i=this;return function(){n.callback_fired||(n.callback_fired=!0,!(e&&e(r,t)===!1)&&i.after_track_handler(t,n,r))}},sa.prototype.create_properties=function(e,t){var n;return typeof e=="function"?n=e(t):n=O.extend({},e),n};var Iu=function(){this.override_event="click"};O.inherit(Iu,sa),Iu.prototype.create_properties=function(e,t){var n=Iu.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},Iu.prototype.event_handler=function(e,t,n){n.new_tab=e.which===2||e.metaKey||e.ctrlKey||t.target==="_blank",n.href=t.href,n.new_tab||e.preventDefault()},Iu.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var qg=function(){this.override_event="submit"};O.inherit(qg,sa),qg.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},qg.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var ss="$set",Tu="$set_once",_o="$unset",al="$add",Lo="$append",sl="$union",la="$remove",nK="$delete",h3={set_action:function(e,t){var n={},r={};return O.isObject(e)?O.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[ss]=r,n},unset_action:function(e){var t={},n=[];return O.isArray(e)||(e=[e]),O.each(e,function(r){this._is_reserved_property(r)||n.push(r)},this),t[_o]=n,t},set_once_action:function(e,t){var n={},r={};return O.isObject(e)?O.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[Tu]=r,n},union_action:function(e,t){var n={},r={};return O.isObject(e)?O.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=O.isArray(i)?i:[i])},this):r[e]=O.isArray(t)?t:[t],n[sl]=r,n},append_action:function(e,t){var n={},r={};return O.isObject(e)?O.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[Lo]=r,n},remove_action:function(e,t){var n={},r={};return O.isObject(e)?O.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[la]=r,n},delete_action:function(){var e={};return e[nK]="",e}},$n=function(){};O.extend($n.prototype,h3),$n.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},$n.prototype.set=Cu(function(e,t,n){var r=this.set_action(e,t);return O.isObject(e)&&(n=t),this._send_request(r,n)}),$n.prototype.set_once=Cu(function(e,t,n){var r=this.set_once_action(e,t);return O.isObject(e)&&(n=t),this._send_request(r,n)}),$n.prototype.unset=Cu(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),$n.prototype.union=Cu(function(e,t,n){O.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)}),$n.prototype.delete=Cu(function(e){var t=this.delete_action();return this._send_request(t,e)}),$n.prototype.remove=Cu(function(e,t,n){var r=this.remove_action(e,t);return this._send_request(r,n)}),$n.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=O.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},$n.prototype._is_reserved_property=function(e){return e==="$group_key"||e==="$group_id"},$n.prototype._get_config=function(e){return this._mixpanel.get_config(e)},$n.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},$n.prototype.remove=$n.prototype.remove,$n.prototype.set=$n.prototype.set,$n.prototype.set_once=$n.prototype.set_once,$n.prototype.union=$n.prototype.union,$n.prototype.unset=$n.prototype.unset,$n.prototype.toString=$n.prototype.toString;var It=function(){};O.extend(It.prototype,h3),It.prototype._init=function(e){this._mixpanel=e},It.prototype.set=as(function(e,t,n){var r=this.set_action(e,t);return O.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r[ss]=O.extend({},O.info.people_properties(),r[ss]),this._send_request(r,n)}),It.prototype.set_once=as(function(e,t,n){var r=this.set_once_action(e,t);return O.isObject(e)&&(n=t),this._send_request(r,n)}),It.prototype.unset=as(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),It.prototype.increment=as(function(e,t,n){var r={},i={};return O.isObject(e)?(O.each(e,function(o,a){if(!this._is_reserved_property(a))if(isNaN(parseFloat(o))){on.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[a]=o},this),n=t):(O.isUndefined(t)&&(t=1),i[e]=t),r[al]=i,this._send_request(r,n)}),It.prototype.append=as(function(e,t,n){O.isObject(e)&&(n=t);var r=this.append_action(e,t);return this._send_request(r,n)}),It.prototype.remove=as(function(e,t,n){O.isObject(e)&&(n=t);var r=this.remove_action(e,t);return this._send_request(r,n)}),It.prototype.union=as(function(e,t,n){O.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)}),It.prototype.track_charge=as(function(e,t,n){if(!O.isNumber(e)&&(e=parseFloat(e),isNaN(e))){on.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",O.extend({$amount:e},t),n)}),It.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},It.prototype.delete_user=function(){if(!this._identify_called()){on.error("mixpanel.people.delete_user() requires you to call identify() first");return}var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)},It.prototype.toString=function(){return this._mixpanel.toString()+".people"},It.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=O.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),O.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),O.truncate(o,255))},It.prototype._get_config=function(e){return this._mixpanel.get_config(e)},It.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},It.prototype._enqueue=function(e){ss in e?this._mixpanel.persistence._add_to_people_queue(ss,e):Tu in e?this._mixpanel.persistence._add_to_people_queue(Tu,e):_o in e?this._mixpanel.persistence._add_to_people_queue(_o,e):al in e?this._mixpanel.persistence._add_to_people_queue(al,e):Lo in e?this._mixpanel.persistence._add_to_people_queue(Lo,e):la in e?this._mixpanel.persistence._add_to_people_queue(la,e):sl in e?this._mixpanel.persistence._add_to_people_queue(sl,e):on.error("Invalid call to _enqueue():",e)},It.prototype._flush_one_queue=function(e,t,n,r){var i=this,o=O.extend({},this._mixpanel.persistence.load_queue(e)),a=o;!O.isUndefined(o)&&O.isObject(o)&&!O.isEmptyObject(o)&&(i._mixpanel.persistence._pop_from_people_queue(e,o),i._mixpanel.persistence.save(),r&&(a=r(o)),t.call(i,a,function(u,c){u===0&&i._mixpanel.persistence._add_to_people_queue(e,o),O.isUndefined(n)||n(u,c)}))},It.prototype._flush=function(e,t,n,r,i,o,a){var u=this;this._flush_one_queue(ss,this.set,e),this._flush_one_queue(Tu,this.set_once,r),this._flush_one_queue(_o,this.unset,o,function(x){return O.keys(x)}),this._flush_one_queue(al,this.increment,t),this._flush_one_queue(sl,this.union,i);var c=this._mixpanel.persistence.load_queue(Lo);if(!O.isUndefined(c)&&O.isArray(c)&&c.length)for(var d,p=function(x,b){x===0&&u._mixpanel.persistence._add_to_people_queue(Lo,d),O.isUndefined(n)||n(x,b)},h=c.length-1;h>=0;h--)c=this._mixpanel.persistence.load_queue(Lo),d=c.pop(),u._mixpanel.persistence.save(),O.isEmptyObject(d)||u.append(d,p);var m=this._mixpanel.persistence.load_queue(la);if(!O.isUndefined(m)&&O.isArray(m)&&m.length)for(var v,_=function(x,b){x===0&&u._mixpanel.persistence._add_to_people_queue(la,v),O.isUndefined(a)||a(x,b)},S=m.length-1;S>=0;S--)m=this._mixpanel.persistence.load_queue(la),v=m.pop(),u._mixpanel.persistence.save(),O.isEmptyObject(v)||u.remove(v,_)},It.prototype._is_reserved_property=function(e){return e==="$distinct_id"||e==="$token"||e==="$device_id"||e==="$user_id"||e==="$had_persisted_distinct_id"},It.prototype.set=It.prototype.set,It.prototype.set_once=It.prototype.set_once,It.prototype.unset=It.prototype.unset,It.prototype.increment=It.prototype.increment,It.prototype.append=It.prototype.append,It.prototype.remove=It.prototype.remove,It.prototype.union=It.prototype.union,It.prototype.track_charge=It.prototype.track_charge,It.prototype.clear_charges=It.prototype.clear_charges,It.prototype.delete_user=It.prototype.delete_user,It.prototype.toString=It.prototype.toString;var Xx="__mps",Jx="__mpso",ew="__mpus",tw="__mpa",nw="__mpap",rw="__mpr",iw="__mpu",p3="$people_distinct_id",Hg="__alias",Qf="__timers",rK=[Xx,Jx,ew,tw,nw,rw,iw,p3,Hg,Qf],Nt=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;t!=="cookie"&&t!=="localStorage"&&(on.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),t==="localStorage"&&O.localStorage.is_supported()?this.storage=O.localStorage:this.storage=O.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};Nt.prototype.properties=function(){var e={};return this.load(),O.each(this.props,function(t,n){O.include(rK,n)||(e[n]=t)}),e},Nt.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=O.extend({},e))}},Nt.prototype.upgrade=function(){var e,t;this.storage===O.localStorage?(e=O.cookie.parse(this.name),O.cookie.remove(this.name),O.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===O.cookie&&(t=O.localStorage.parse(this.name),O.localStorage.remove(this.name),t&&this.register_once(t))},Nt.prototype.save=function(){this.disabled||this.storage.set(this.name,Su(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Nt.prototype.load_prop=function(e){return this.load(),this.props[e]},Nt.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Nt.prototype.clear=function(){this.remove(),this.props={}},Nt.prototype.register_once=function(e,t,n){return O.isObject(e)?(typeof t>"u"&&(t="None"),this.expire_days=typeof n>"u"?this.default_expiry:n,this.load(),O.each(e,function(r,i){(!this.props.hasOwnProperty(i)||this.props[i]===t)&&(this.props[i]=r)},this),this.save(),!0):!1},Nt.prototype.register=function(e,t){return O.isObject(e)?(this.expire_days=typeof t>"u"?this.default_expiry:t,this.load(),O.extend(this.props,e),this.save(),!0):!1},Nt.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},Nt.prototype.update_search_keyword=function(e){this.register(O.info.searchInfo(e))},Nt.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:O.info.referringDomain(e)||"$direct"},"")},Nt.prototype.get_referrer_info=function(){return O.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Nt.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},Nt.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},Nt.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},Nt.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},Nt.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Nt.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Nt.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Nt.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),r=t[e],i=this._get_or_create_queue(ss),o=this._get_or_create_queue(Tu),a=this._get_or_create_queue(_o),u=this._get_or_create_queue(al),c=this._get_or_create_queue(sl),d=this._get_or_create_queue(la,[]),p=this._get_or_create_queue(Lo,[]);n===Xx?(O.extend(i,r),this._pop_from_people_queue(al,r),this._pop_from_people_queue(sl,r),this._pop_from_people_queue(_o,r)):n===Jx?(O.each(r,function(h,m){m in o||(o[m]=h)}),this._pop_from_people_queue(_o,r)):n===ew?O.each(r,function(h){O.each([i,o,u,c],function(m){h in m&&delete m[h]}),O.each(p,function(m){h in m&&delete m[h]}),a[h]=!0}):n===tw?(O.each(r,function(h,m){m in i?i[m]+=h:(m in u||(u[m]=0),u[m]+=h)},this),this._pop_from_people_queue(_o,r)):n===iw?(O.each(r,function(h,m){O.isArray(h)&&(m in c||(c[m]=[]),O.each(h,function(v){O.include(c[m],v)||c[m].push(v)}))}),this._pop_from_people_queue(_o,r)):n===rw?(d.push(r),this._pop_from_people_queue(Lo,r)):n===nw&&(p.push(r),this._pop_from_people_queue(_o,r)),on.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),on.log(t),this.save()},Nt.prototype._pop_from_people_queue=function(e,t){var n=this.props[this._get_queue_key(e)];O.isUndefined(n)||O.each(t,function(r,i){e===Lo||e===la?O.each(n,function(o){o[i]===r&&delete o[i]}):delete n[i]},this)},Nt.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},Nt.prototype._get_queue_key=function(e){if(e===ss)return Xx;if(e===Tu)return Jx;if(e===_o)return ew;if(e===al)return tw;if(e===Lo)return nw;if(e===la)return rw;if(e===sl)return iw;on.error("Invalid queue:",e)},Nt.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=O.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},Nt.prototype.set_event_timer=function(e,t){var n=this.load_prop(Qf)||{};n[e]=t,this.props[Qf]=n,this.save()},Nt.prototype.remove_event_timer=function(e){var t=this.load_prop(Qf)||{},n=t[e];return O.isUndefined(n)||(delete this.props[Qf][e],this.save()),n};var ow,g3=function(e,t){throw new Error(e+" not available in this build.")},ni,m3=0,iK=1,oK=function(e){return e},Xi="mixpanel",v3="base64",aK="json",aw="$device:",Mu=it.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,y3=!Mu&&oa.indexOf("MSIE")===-1&&oa.indexOf("Mozilla")===-1,Gg=null;rs.sendBeacon&&(Gg=function(){return rs.sendBeacon.apply(rs,arguments)});var _3={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},b3={api_host:"https://api-js.mixpanel.com",api_routes:_3,api_method:"POST",api_transport:"XHR",api_payload_format:v3,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:is,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:is,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_canvas:!1,record_collect_fonts:!1,record_idle_timeout_ms:30*60*1e3,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:Hf,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},x3=!1,fe=function(){},sw=function(e,t,n){var r,i=n===Xi?ni:ni[n];if(i&&ow===m3)r=i;else{if(i&&!O.isArray(i)){on.error("You have already initialized "+n);return}r=new fe}if(r._cached_groups={},r._init(e,t,n),r.people=new It,r.people._init(r),!r.get_config("skip_first_touch_marketing")){var o=O.info.campaignParams(null),a={},u=!1;O.each(o,function(c,d){a["initial_"+d]=c,c&&(u=!0)}),u&&r.people.set_once(a)}return yo.DEBUG=yo.DEBUG||r.get_config("debug"),!O.isUndefined(i)&&O.isArray(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r};fe.prototype.init=function(e,t,n){if(O.isUndefined(n)){this.report_error("You must name your new library: init(token, config, name)");return}if(n===Xi){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var r=sw(e,t,n);return ni[n]=r,r._loaded(),r},fe.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var r={};if(!("api_payload_format"in t)){var i=t.api_host||b3.api_host;i.match(/\.mixpanel\.com/)&&(r.api_payload_format=aK)}if(this.set_config(O.extend({},b3,r,t,{name:n,token:e,callback_fn:(n===Xi?n:Xi+"."+n)+"._jsc"})),this._jsc=is,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!O.localStorage.is_supported(!0)||!Mu)this._batch_requests=!1,on.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),O.each(this.get_batcher_configs(),function(u){on.log("Clearing batch queue "+u.queue_key),O.localStorage.remove(u.queue_key)});else if(this.init_batchers(),Gg&&it.addEventListener){var o=O.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);it.addEventListener("pagehide",function(u){u.persisted&&o()}),it.addEventListener("visibilitychange",function(){dn.visibilityState==="hidden"&&o()})}}this.persistence=this.cookie=new Nt(this.config),this.unpersisted_superprops={},this._gdpr_init();var a=O.UUID();this.get_distinct_id()||this.register_once({distinct_id:aw+a,$device_id:a},""),this.autocapture=new Di(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},fe.prototype._init_tab_id=function(){if(O.sessionStorage.is_supported())try{var e=this.get_config("name")+"_"+this.get_config("token"),t="mp_tab_id_"+e,n="mp_gen_new_tab_id_"+e;(O.sessionStorage.get(n)||!O.sessionStorage.get(t))&&O.sessionStorage.set(t,"$tab-"+O.UUID()),O.sessionStorage.set(n,"1"),this.tab_id=O.sessionStorage.get(t),it.addEventListener("beforeunload",function(){O.sessionStorage.remove(n)})}catch(r){this.report_error("Error initializing tab id",r)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")},fe.prototype.get_tab_id=function(){return this.tab_id||null},fe.prototype._should_load_recorder=function(){var e=new Ro(Bx),t=this.get_tab_id();return e.init().then(function(){return e.getAll()}).then(function(n){for(var r=0;r<n.length;r++)if(Ux(n[r])||n[r].tabId===t)return!0;return!1}).catch(O.bind(function(n){this.report_error("Error checking recording registry",n)},this))},fe.prototype._check_and_start_session_recording=os(function(e){if(!it.MutationObserver){on.critical("Browser does not support MutationObserver; skipping session recording");return}var t=O.bind(function(r){var i=O.bind(function(){this._recorder=this._recorder||new it.__mp_recorder(this),this._recorder.resumeRecording(r)},this);O.isUndefined(it.__mp_recorder)?g3(this.get_config("recorder_src"),i):i()},this),n=this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent");e||n?t(!0):this._should_load_recorder().then(function(r){r&&t(!1)})}),fe.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},fe.prototype.stop_session_recording=function(){this._recorder&&this._recorder.stopRecording()},fe.prototype.pause_session_recording=function(){this._recorder&&this._recorder.pauseRecording()},fe.prototype.resume_session_recording=function(){this._recorder&&this._recorder.resumeRecording()},fe.prototype.get_session_recording_properties=function(){var e={},t=this._get_session_replay_id();return t&&(e.$mp_replay_id=t),e},fe.prototype.get_session_replay_url=function(){var e=null,t=this._get_session_replay_id();if(t){var n=O.HTTPBuildQuery({replay_id:t,distinct_id:this.get_distinct_id(),token:this.get_config("token")});e="https://mixpanel.com/projects/replay-redirect?"+n}return e},fe.prototype._get_session_replay_id=function(){var e=null;return this._recorder&&(e=this._recorder.replayId),e||null},fe.prototype.__get_recorder=function(){return this._recorder},fe.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var e=O.info.campaignParams(null);O.each(e,(function(t,n){this.unregister(n)}).bind(this))}},fe.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(dn.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(O.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(dn.referrer)},fe.prototype._dom_loaded=function(){O.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||O.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue},fe.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!x3)return this.__dom_loaded_queue.push([e,t]),!1;var n=new e().init(this);return n.track.apply(n,t)},fe.prototype._prepare_callback=function(e,t){if(O.isUndefined(e))return null;if(Mu){var n=function(a){e(a,t)};return n}else{var r=this._jsc,i=""+Math.floor(Math.random()*1e8),o=this.get_config("callback_fn")+"["+i+"]";return r[i]=function(a){delete r[i],e(a,t)},o}},fe.prototype._send_request=function(e,t,n,r){var i=!0;if(y3)return this.__request_queue.push(arguments),i;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},a=null;!r&&(O.isFunction(n)||typeof n=="string")&&(r=n,n=null),n=O.extend(o,n||{}),Mu||(n.method="GET");var u=n.method==="POST",c=Gg&&u&&n.transport.toLowerCase()==="sendbeacon",d=n.verbose;t.verbose&&(d=!0),this.get_config("test")&&(t.test=1),d&&(t.verbose=1),this.get_config("img")&&(t.img=1),Mu||(r?t.callback=r:(d||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=new Date().getTime().toString(),u&&(a="data="+encodeURIComponent(t.data),delete t.data),e+="?"+O.HTTPBuildQuery(t);var p=this;if("img"in t){var h=dn.createElement("img");h.src=e,dn.body.appendChild(h)}else if(c){try{i=Gg(e,a)}catch(b){p.report_error(b),i=!1}try{r&&r(i?1:0)}catch(b){p.report_error(b)}}else if(Mu)try{var m=new XMLHttpRequest;m.open(n.method,e,!0);var v=this.get_config("xhr_headers");if(u&&(v["Content-Type"]="application/x-www-form-urlencoded"),O.each(v,function(b,C){m.setRequestHeader(C,b)}),n.timeout_ms&&typeof m.timeout<"u"){m.timeout=n.timeout_ms;var _=new Date().getTime()}m.withCredentials=!0,m.onreadystatechange=function(){if(m.readyState===4)if(m.status===200){if(r)if(d){var b;try{b=O.JSONDecode(m.responseText)}catch(A){if(p.report_error(A),n.ignore_json_errors)b=m.responseText;else return}r(b)}else r(Number(m.responseText))}else{var C;if(m.timeout&&!m.status&&new Date().getTime()-_>=m.timeout?C="timeout":C="Bad HTTP status: "+m.status+" "+m.statusText,p.report_error(C),r)if(d){var k=m.responseHeaders||{};r({status:0,httpStatusCode:m.status,error:C,retryAfter:k["Retry-After"]})}else r(0)}},m.send(a)}catch(b){p.report_error(b),i=!1}else{var S=dn.createElement("script");S.type="text/javascript",S.async=!0,S.defer=!0,S.src=e;var x=dn.getElementsByTagName("script")[0];x.parentNode.insertBefore(S,x)}return i},fe.prototype._execute_array=function(e){var t,n=[],r=[],i=[];O.each(e,function(a){a&&(t=a[0],O.isArray(t)?i.push(a):typeof a=="function"?a.call(this):O.isArray(a)&&t==="alias"?n.push(a):O.isArray(a)&&t.indexOf("track")!==-1&&typeof this[t]=="function"?i.push(a):r.push(a))},this);var o=function(a,u){O.each(a,function(c){if(O.isArray(c[0])){var d=u;O.each(c,function(p){d=d[p[0]].apply(d,p.slice(1))})}else this[c[0]].apply(this,c.slice(1))},u)};o(n,this),o(r,this),o(i,this)},fe.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},fe.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token"),t=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+t.track,queue_key:e+"_ev"},people:{type:"people",endpoint:"/"+t.engage,queue_key:e+"_pp"},groups:{type:"groups",endpoint:"/"+t.groups,queue_key:e+"_gr"}},this._batcher_configs},fe.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=O.bind(function(n){return new Qi(n.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:O.bind(function(r,i,o){this._send_request(this.get_config("api_host")+n.endpoint,this._encode_data_for_request(r),i,this._prepare_callback(o,r))},this),beforeSendHook:O.bind(function(r){return this._run_hook("before_send_"+n.type,r)},this),stopAllBatchingFunc:O.bind(this.stop_batch_senders,this),usePersistence:!0})},this),t=this.get_batcher_configs();this.request_batchers={events:e(t.events),people:e(t.people),groups:e(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},fe.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,O.each(this.request_batchers,function(e){e.start()}))},fe.prototype.stop_batch_senders=function(){this._batch_requests=!1,O.each(this.request_batchers,function(e){e.stop(),e.clear()})},fe.prototype.push=function(e){this._execute_array([e])},fe.prototype.disable=function(e){typeof e>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},fe.prototype._encode_data_for_request=function(e){var t=Su(e);return this.get_config("api_payload_format")===v3&&(t=O.base64Encode(t)),{data:t}},fe.prototype._track_or_batch=function(e,t){var n=O.truncate(e.data,255),r=e.endpoint,i=e.batcher,o=e.should_send_immediately,a=e.send_request_options||{};t=t||is;var u=!0,c=O.bind(function(){return a.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(on.log("MIXPANEL REQUEST:"),on.log(n),this._send_request(r,this._encode_data_for_request(n),a,this._prepare_callback(t,n))):null},this);return this._batch_requests&&!o?i.enqueue(n).then(function(d){d?t(1,n):c()}):u=c(),u&&n},fe.prototype.track=os(function(e,t,n,r){!r&&typeof n=="function"&&(r=n,n=null),n=n||{};var i=n.transport;i&&(n.transport=i);var o=n.send_immediately;if(typeof r!="function"&&(r=is),O.isUndefined(e)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(e)){r(0);return}t=O.extend({},t),t.token=this.get_config("token");var a=this.persistence.remove_event_timer(e);if(!O.isUndefined(a)){var u=new Date().getTime()-a;t.$duration=parseFloat((u/1e3).toFixed(3))}this._set_default_superprops();var c=this.get_config("track_marketing")?O.info.marketingParams():{};t=O.extend({},O.info.properties({mp_loader:this.get_config("mp_loader")}),c,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var d=this.get_config("property_blacklist");O.isArray(d)?O.each(d,function(m){delete t[m]}):this.report_error("Invalid value for property_blacklist config: "+d);var p={event:e,properties:t},h=this._track_or_batch({type:"events",data:p,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:n},r);return h}),fe.prototype.set_group=os(function(e,t,n){O.isArray(t)||(t=[t]);var r={};return r[e]=t,this.register(r),this.people.set(e,t,n)}),fe.prototype.add_group=os(function(e,t,n){var r=this.get_property(e),i={};return r===void 0?(i[e]=[t],this.register(i)):r.indexOf(t)===-1&&(r.push(t),i[e]=r,this.register(i)),this.people.union(e,t,n)}),fe.prototype.remove_group=os(function(e,t,n){var r=this.get_property(e);if(r!==void 0){var i=r.indexOf(t);i>-1&&(r.splice(i,1),this.register({group_key:r})),r.length===0&&this.unregister(e)}return this.people.remove(e,t,n)}),fe.prototype.track_with_groups=os(function(e,t,n,r){var i=O.extend({},t||{});return O.each(n,function(o,a){o!=null&&(i[a]=o)}),this.track(e,i,r)}),fe.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},fe.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},fe.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),r=this._cached_groups[n];return(r===void 0||r._group_key!==e||r._group_id!==t)&&(r=new $n,r._init(this,e,t),this._cached_groups[n]=r),r},fe.prototype.track_pageview=os(function(e,t){typeof e!="object"&&(e={}),t=t||{};var n=t.event_name||"$mp_web_page_view",r=O.extend(O.info.mpPageViewProperties(),O.info.campaignParams(),O.info.clickParams()),i=O.extend({},r,e);return this.track(n,i)}),fe.prototype.track_links=function(){return this._track_dom.call(this,Iu,arguments)},fe.prototype.track_forms=function(){return this._track_dom.call(this,qg,arguments)},fe.prototype.time_event=function(e){if(O.isUndefined(e)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(e)||this.persistence.set_event_timer(e,new Date().getTime())};var sK={persistent:!0},lw=function(e){var t;return O.isObject(e)?t=e:O.isUndefined(e)?t={}:t={days:e},O.extend({},sK,t)};fe.prototype.register=function(e,t){var n=lw(t);n.persistent?this.persistence.register(e,n.days):O.extend(this.unpersisted_superprops,e)},fe.prototype.register_once=function(e,t,n){var r=lw(n);r.persistent?this.persistence.register_once(e,t,r.days):(typeof t>"u"&&(t="None"),O.each(e,function(i,o){(!this.unpersisted_superprops.hasOwnProperty(o)||this.unpersisted_superprops[o]===t)&&(this.unpersisted_superprops[o]=i)},this))},fe.prototype.unregister=function(e,t){t=lw(t),t.persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},fe.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},fe.prototype.identify=function(e,t,n,r,i,o,a,u){var c=this.get_distinct_id();if(e&&c!==e){if(typeof e=="string"&&e.indexOf(aw)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var d=c;this.register_once({$had_persisted_distinct_id:!0,$device_id:d},"")}e!==c&&e!==this.get_property(Hg)&&(this.unregister(Hg),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,r,i,o,a,u),e!==c&&this.track("$identify",{distinct_id:e,$anon_distinct_id:c},{skip_hooks:!0})},fe.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=O.UUID();this.register_once({distinct_id:aw+e,$device_id:e},"")},fe.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},fe.prototype.alias=function(e,t){if(e===this.get_property(p3))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return O.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Hg,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},function(){n.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},fe.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},fe.prototype.set_config=function(e){if(O.isObject(e)){O.extend(this.config,e);var t=e.batch_size;t&&O.each(this.request_batchers,function(n){n.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),yo.DEBUG=yo.DEBUG||this.get_config("debug"),"autocapture"in e&&this.autocapture&&this.autocapture.init()}},fe.prototype.get_config=function(e){return this.config[e]},fe.prototype._run_hook=function(e){var t=(this.config.hooks[e]||oK).apply(this,ns.call(arguments,1));return typeof t>"u"&&(this.report_error(e+" hook did not return a value"),t=null),t},fe.prototype.get_property=function(e){return this.persistence.load_prop([e])},fe.prototype.toString=function(){var e=this.get_config("name");return e!==Xi&&(e=Xi+"."+e),e},fe.prototype._event_is_disabled=function(e){return O.isBlockedUA(oa)||this._flags.disable_all_events||O.include(this.__disabled_events,e)},fe.prototype._gdpr_init=function(){var e=this.get_config("opt_out_tracking_persistence_type")==="localStorage";e&&O.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||O.cookie.get("mp_optout"))&&(O.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},fe.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else if(e&&e.enable_persistence)t=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==t&&this.persistence.set_disabled(t),t?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()},fe.prototype._gdpr_call_func=function(e,t){return t=O.extend({track:O.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),O.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},fe.prototype.opt_in_tracking=function(e){e=O.extend({enable_persistence:!0},e),this._gdpr_call_func(MW,e),this._gdpr_update_persistence(e)},fe.prototype.opt_out_tracking=function(e){e=O.extend({clear_persistence:!0,delete_user:!0},e),e.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(OW,e),this._gdpr_update_persistence(e)},fe.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(RW,e)},fe.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(N$,e)},fe.prototype.clear_opt_in_out_tracking=function(e){e=O.extend({enable_persistence:!0},e),this._gdpr_call_func($W,e),this._gdpr_update_persistence(e)},fe.prototype.report_error=function(e,t){on.error.apply(on.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){on.error(n)}},fe.prototype.init=fe.prototype.init,fe.prototype.reset=fe.prototype.reset,fe.prototype.disable=fe.prototype.disable,fe.prototype.time_event=fe.prototype.time_event,fe.prototype.track=fe.prototype.track,fe.prototype.track_links=fe.prototype.track_links,fe.prototype.track_forms=fe.prototype.track_forms,fe.prototype.track_pageview=fe.prototype.track_pageview,fe.prototype.register=fe.prototype.register,fe.prototype.register_once=fe.prototype.register_once,fe.prototype.unregister=fe.prototype.unregister,fe.prototype.identify=fe.prototype.identify,fe.prototype.alias=fe.prototype.alias,fe.prototype.name_tag=fe.prototype.name_tag,fe.prototype.set_config=fe.prototype.set_config,fe.prototype.get_config=fe.prototype.get_config,fe.prototype.get_property=fe.prototype.get_property,fe.prototype.get_distinct_id=fe.prototype.get_distinct_id,fe.prototype.toString=fe.prototype.toString,fe.prototype.opt_out_tracking=fe.prototype.opt_out_tracking,fe.prototype.opt_in_tracking=fe.prototype.opt_in_tracking,fe.prototype.has_opted_out_tracking=fe.prototype.has_opted_out_tracking,fe.prototype.has_opted_in_tracking=fe.prototype.has_opted_in_tracking,fe.prototype.clear_opt_in_out_tracking=fe.prototype.clear_opt_in_out_tracking,fe.prototype.get_group=fe.prototype.get_group,fe.prototype.set_group=fe.prototype.set_group,fe.prototype.add_group=fe.prototype.add_group,fe.prototype.remove_group=fe.prototype.remove_group,fe.prototype.track_with_groups=fe.prototype.track_with_groups,fe.prototype.start_batch_senders=fe.prototype.start_batch_senders,fe.prototype.stop_batch_senders=fe.prototype.stop_batch_senders,fe.prototype.start_session_recording=fe.prototype.start_session_recording,fe.prototype.stop_session_recording=fe.prototype.stop_session_recording,fe.prototype.pause_session_recording=fe.prototype.pause_session_recording,fe.prototype.resume_session_recording=fe.prototype.resume_session_recording,fe.prototype.get_session_recording_properties=fe.prototype.get_session_recording_properties,fe.prototype.get_session_replay_url=fe.prototype.get_session_replay_url,fe.prototype.get_tab_id=fe.prototype.get_tab_id,fe.prototype.DEFAULT_API_ROUTES=_3,fe.prototype.__get_recorder=fe.prototype.__get_recorder,Nt.prototype.properties=Nt.prototype.properties,Nt.prototype.update_search_keyword=Nt.prototype.update_search_keyword,Nt.prototype.update_referrer_info=Nt.prototype.update_referrer_info,Nt.prototype.get_cross_subdomain=Nt.prototype.get_cross_subdomain,Nt.prototype.clear=Nt.prototype.clear;var Ou={},lK=function(){O.each(Ou,function(e,t){t!==Xi&&(ni[t]=e)}),ni._=O},uK=function(){ni.init=function(e,t,n){if(n)return ni[n]||(ni[n]=Ou[n]=sw(e,t,n),ni[n]._loaded()),ni[n];var r=ni;Ou[Xi]?r=Ou[Xi]:e&&(r=sw(e,t,Xi),r._loaded(),Ou[Xi]=r),ni=r,ow===iK&&(it[Xi]=ni),lK()}},cK=function(){function e(){e.done||(e.done=!0,x3=!0,y3=!1,O.each(Ou,function(r){r._dom_loaded()}))}function t(){try{dn.documentElement.doScroll("left")}catch{setTimeout(t,1);return}e()}if(dn.addEventListener)dn.readyState==="complete"?e():dn.addEventListener("DOMContentLoaded",e,!1);else if(dn.attachEvent){dn.attachEvent("onreadystatechange",e);var n=!1;try{n=it.frameElement===null}catch{}dn.documentElement.doScroll&&n&&t()}O.register_event(it,"load",e,!0)};function fK(e){return g3=e,ow=m3,ni=new fe,uK(),ni.init(),cK(),ni}function dK(e,t){t()}var ls=fK(dK);const Zn="https://debales.ai",hK="https://debales-web-app-server-prod.azurewebsites.net",w3={"blossom-and-rhyme-6":"84e28f5a553bc260c8276723d0f365bc","doorbellmount-dea1de94-1728660454527":"f825468f4202c28be0d29c849a997208",artzfolio:"789feea8eb479f2db1144448f6465f7f",minature:"b22ef9c8fdbeb4a297947903891c5fd9","nonetz-3f0b8348-1736183595738":"a19d837ea53890c892a2b351e54afc11",bodytales:"703aa3f61539de0786fa19f82644fa8b",athflex:"b9f412aa0c6991abf8b8e3db70b2a506",www:"2637bf921fb09742d550941fbebe7160","GTK-Restaurant":"dbcb03738f942ec7c968f45833ee47bf","derkins-co-uk":"f109fd32c98dac150ba902bd69feeeed","imemyselfcare-com":"bbbe4af618eeab278a4015b4ddf8827f"},pK="phc_OKaClHZDmbEpVscrwceWJB5lsMYbMaV586L7pai6ZKD",Vg=e=>({layout:{position:{isLeft:e.isLeft??!1,zIndex:e.zIndex??1e3},height:{option:e.heightOption??"Normal"},responsive:{fullScreenOnMobile:e.fullScreenOnMobile??!0,mobileDisplayMode:e.mobileDisplayMode??"normal"}},colors:{background:e.backgroundColor,font:e.fontColor,supportButtonBackgroundColor:e.supportButtonBackgroundColor??"'#ffa500'",bot:{background:e.botBackgroundColor,message:e.botMessageColor,font:e.botFontColor},user:{message:e.userMessageColor,font:e.userFontColor},header:{font:e.headerFontColor},footer:{background:e.footerBackgroundColor,inputBorder:e.fonterInputBorderColor},cta:{background:e.callToActionBackgroundColor,font:e.callToActionFontColor},suggestedQuestions:{font:e.suggestedQuestionsFontColor,background:e.suggestedQuestionsBackgroundColor,hover:e.suggestedQuestionsHoverColor,crossButton:{color:e.suggestedQuestionsCrossButtonColor,background:e.suggestedQuestionsCrossButtonBackgroundColor},highlight:e.suggestedQuestionsHighlightColor},chatButton:{animation:e.chatButtonBackgroundAnimationColor}},typography:{fontFamily:void 0,fontSize:void 0,lineHeight:void 0},borders:{radius:"4px",width:"1px"},animations:{chatButton:{type:e.chatButtonBackgroundAnimationType??"Ping",enabled:e.enableChatButtonBackgroundAnimation??!1}},branding:{visibility:{showBot:e.show_bot??!0,debalesBranding:e.debales_branding??!0},logo:{removeBackground:e.removeLogoBackground??!1}}});function an(){const e=sessionStorage.getItem("debalesSessionID");if(e)return e;const t=crypto.randomUUID();return sessionStorage.setItem("debalesSessionID",t),t}function gK(){return sessionStorage.getItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:window.DebalesChat.projectId}))}function Nr(){const e=localStorage.getItem(qt(jt.USER_INFO));return e?JSON.parse(e):null}function ua(e){localStorage.setItem(qt(jt.USER_INFO),JSON.stringify(e))}function ri(e){if(e.current){const t=e.current.lastElementChild;if(t)if(window.matchMedia("(max-width: 768px)").matches)e.current.scrollTop=e.current.scrollHeight,setTimeout(()=>{e.current&&(e.current.scrollTop=e.current.scrollHeight)},50);else{const r=e.current.scrollTop,i=t.getBoundingClientRect().bottom+e.current.scrollTop-e.current.clientHeight,o=300,a=performance.now(),u=c=>{const d=c-a,p=Math.min(d/o,1),h=p<.5?4*p*p*p:1-Math.pow(-2*p+2,3)/2;e.current.scrollTop=r+(i-r)*h,p<1&&requestAnimationFrame(u)};requestAnimationFrame(u)}}}function mK(){return window.location.pathname}function Xf(){const e=/test|demo|example|debales/i,t=Nr()??"";return!!(t&&e.test(t.email))}function Zg(e){const t=mK(),r=Array.from(new Set(e.map(o=>o.path))).filter(o=>new RegExp(`^${o}(/|$)`).test(t));if(r.length>0){r.sort((u,c)=>c.length-u.length);const o=r[0];return e.filter(u=>u.path===o&&u.enable!==!1).sort((u,c)=>(u.sortOrder??0)-(c.sortOrder??0))}return e.filter(o=>o.path==="/"&&o.enable!==!1).sort((o,a)=>(o.sortOrder??0)-(a.sortOrder??0))}const S3=new Set,Yg=e=>{const t=w3[e];if(!t)return console.warn("No Mixpanel token found"),null;if(S3.has(e))return ls;ls.init(t,{debug:!1,track_pageview:!0,persistence:"localStorage"}),console.log("Mixpanel initialized");const n=Nr();return n&&n.email&&ls.identify(n.email),S3.add(e),ls},vK=async(e,t)=>{if(Xf())return;const n=window.DebalesChat.projectId??t.projectId;if(!w3[n]){console.warn("No Mixpanel token found");return}ls.track(e,t)},yK=()=>{const e=localStorage.getItem("anonymousUserId");if(e)return e;const t=crypto.randomUUID();return localStorage.setItem("anonymousUserId",t),t};function ll(e){return e?e.split("<br>").filter(n=>n.trim().length>0).map(n=>n.trim()):[""]}const Br=e=>e.toLowerCase().includes("gaiabay")||e.toLowerCase().includes("debales-testing"),_K=e=>{const t=e.findIndex(o=>o.type==="dynamic");if(t===-1)return e;const n=e.filter(o=>o.type==="static"),r=e.filter(o=>o.type==="dynamic");return[...n.slice(0,t),r,...n.slice(t)]};function qt(e,t){return t!=null&&t.botId?`debales_${t.botId}_${e}`:`debales_${e}`}const C3=R.createContext(null),Jf=()=>{const e=R.useContext(C3);if(!e)throw new Error("useCart must be used within a CartProvider");return e};var bK="2.0.0",Ru="",E3="?",Wg="function",us="undefined",$u="object",uw="string",ed="major",Fe="model",Le="name",$e="type",Ge="vendor",Pe="version",Ei="architecture",Du="console",$t="mobile",Bn="tablet",ii="smarttv",td="wearable",cw="xr",fw="embedded",nd="inapp",k3="user-agent",dw=500,hw="brands",ul="formFactors",pw="fullVersionList",Lu="platform",gw="platformVersion",Kg="bitness",cs="sec-ch-ua",xK=cs+"-full-version-list",wK=cs+"-arch",SK=cs+"-"+Kg,CK=cs+"-form-factors",EK=cs+"-"+$t,kK=cs+"-"+Fe,A3=cs+"-"+Lu,AK=A3+"-version",I3=[hw,pw,$t,Fe,Lu,gw,Ei,ul,Kg],Li="browser",ca="cpu",No="device",fa="engine",Ji="os",Nu="result",Qg="Amazon",rd="Apple",T3="ASUS",M3="BlackBerry",cl="Google",O3="Huawei",R3="Lenovo",IK="Honor",mw="LG",Xg="Microsoft",$3="Motorola",id="Samsung",D3="Sharp",Jg="Sony",vw="Xiaomi",yw="Zebra",Bu="Mobile ",od=" Browser",L3="Chrome",fs="Chromecast",TK="Edge",ad="Firefox",sd="Opera",N3="Facebook",B3="Sogou",_w="Windows",MK=typeof window!==us,ki=MK&&window.navigator?window.navigator:void 0,ds=ki&&ki.userAgentData?ki.userAgentData:void 0,OK=function(e,t){var n={},r=t;if(!tm(t)){r={};for(var i in t)for(var o in t[i])r[o]=t[i][o].concat(r[o]?r[o]:[])}for(var a in e)n[a]=r[a]&&r[a].length%2===0?r[a].concat(e[a]):e[a];return n},em=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},bw=function(e,t){if(typeof e===$u&&e.length>0){for(var n in e)if(da(e[n])==da(t))return!0;return!1}return Pu(e)?da(t).indexOf(da(e))!==-1:!1},tm=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||(t?tm(e[n]):!1)},Pu=function(e){return typeof e===uw},xw=function(e){if(e){for(var t=[],n=fl(/\\?\"/g,e).split(","),r=0;r<n.length;r++)if(n[r].indexOf(";")>-1){var i=ud(n[r]).split(";v=");t[r]={brand:i[0],version:i[1]}}else t[r]=ud(n[r]);return t}},da=function(e){return Pu(e)?e.toLowerCase():e},ww=function(e){return Pu(e)?fl(/[^\d\.]/g,e).split(".")[0]:void 0},ha=function(e){for(var t in e){var n=e[t];typeof n==$u&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},fl=function(e,t){return Pu(t)?t.replace(e,Ru):t},ld=function(e){return fl(/\\?\"/g,e)},ud=function(e,t){if(Pu(e))return e=fl(/^\s\s*/,e),typeof t===us?e:e.substring(0,dw)},P3=function(e,t){if(!(!e||!t))for(var n=0,r,i,o,a,u,c;n<t.length&&!u;){var d=t[n],p=t[n+1];for(r=i=0;r<d.length&&!u&&d[r];)if(u=d[r++].exec(e),u)for(o=0;o<p.length;o++)c=u[++i],a=p[o],typeof a===$u&&a.length>0?a.length===2?typeof a[1]==Wg?this[a[0]]=a[1].call(this,c):this[a[0]]=a[1]:a.length===3?typeof a[1]===Wg&&!(a[1].exec&&a[1].test)?this[a[0]]=c?a[1].call(this,c,a[2]):void 0:this[a[0]]=c?c.replace(a[1],a[2]):void 0:a.length===4&&(this[a[0]]=c?a[3].call(this,c.replace(a[1],a[2])):void 0):this[a]=c||void 0;n+=2}},cd=function(e,t){for(var n in t)if(typeof t[n]===$u&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(bw(t[n][r],e))return n===E3?void 0:n}else if(bw(t[n],e))return n===E3?void 0:n;return t.hasOwnProperty("*")?t["*"]:e},F3={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},z3={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},U3={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[Pe,[Le,Bu+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[Pe,[Le,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[Le,Pe],[/opios[\/ ]+([\w\.]+)/i],[Pe,[Le,sd+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[Pe,[Le,sd+" GX"]],[/\bopr\/([\w\.]+)/i],[Pe,[Le,sd]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[Pe,[Le,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[Pe,[Le,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[Le,Pe],[/quark(?:pc)?\/([-\w\.]+)/i],[Pe,[Le,"Quark"]],[/\bddg\/([\w\.]+)/i],[Pe,[Le,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[Pe,[Le,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[Pe,[Le,"WeChat"]],[/konqueror\/([\w\.]+)/i],[Pe,[Le,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[Pe,[Le,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[Pe,[Le,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[Pe,[Le,"Smart "+R3+od]],[/(avast|avg)\/([\w\.]+)/i],[[Le,/(.+)/,"$1 Secure"+od],Pe],[/\bfocus\/([\w\.]+)/i],[Pe,[Le,ad+" Focus"]],[/\bopt\/([\w\.]+)/i],[Pe,[Le,sd+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[Pe,[Le,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[Pe,[Le,"Dolphin"]],[/coast\/([\w\.]+)/i],[Pe,[Le,sd+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[Pe,[Le,"MIUI"+od]],[/fxios\/([\w\.-]+)/i],[Pe,[Le,Bu+ad]],[/\bqihoobrowser\/?([\w\.]*)/i],[Pe,[Le,"360"]],[/\b(qq)\/([\w\.]+)/i],[[Le,/(.+)/,"$1Browser"],Pe],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[Le,/(.+)/,"$1"+od],Pe],[/samsungbrowser\/([\w\.]+)/i],[Pe,[Le,id+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[Pe,[Le,B3+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[Le,B3+" Mobile"],Pe],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[Le,Pe],[/(lbbrowser|rekonq)/i],[Le],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[Pe,Le],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[Le,N3],Pe,[$e,nd]],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat)[\/ ]([-\w\.]+)/i],[Le,Pe,[$e,nd]],[/\bgsa\/([\w\.]+) .*safari\//i],[Pe,[Le,"GSA"],[$e,nd]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[Pe,[Le,"TikTok"],[$e,nd]],[/\[(linkedin)app\]/i],[Le,[$e,nd]],[/(chromium)[\/ ]([-\w\.]+)/i],[Le,Pe],[/headlesschrome(?:\/([\w\.]+)| )/i],[Pe,[Le,L3+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[Le,L3+" WebView"],Pe],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[Pe,[Le,"Android"+od]],[/chrome\/([\w\.]+) mobile/i],[Pe,[Le,Bu+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[Le,Pe],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[Pe,[Le,Bu+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[Le,Bu+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[Pe,Le],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[Le,[Pe,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[Le,Pe],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[Le,Bu+ad],Pe],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[Le,"Netscape"],Pe],[/(wolvic|librewolf)\/([\w\.]+)/i],[Le,Pe],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[Pe,[Le,ad+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[Le,[Pe,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[Le,[Pe,/[^\d\.]+./,Ru]]],cpu:[[/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i],[[Ei,"amd64"]],[/(ia32(?=;))/i,/((?:i[346]|x)86)[;\)]/i],[[Ei,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[Ei,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[Ei,"armhf"]],[/windows (ce|mobile); ppc;/i],[[Ei,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[Ei,/ower/,Ru,da]],[/(sun4\w)[;\)]/i],[[Ei,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[Ei,da]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[Fe,[Ge,id],[$e,Bn]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[Fe,[Ge,id],[$e,$t]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[Fe,[Ge,rd],[$e,$t]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[Fe,[Ge,rd],[$e,Bn]],[/(macintosh);/i],[Fe,[Ge,rd]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[Fe,[Ge,D3],[$e,$t]],[/(?:honor)([-\w ]+)[;\)]/i],[Fe,[Ge,IK],[$e,$t]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[Fe,[Ge,O3],[$e,Bn]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[Fe,[Ge,O3],[$e,$t]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[Fe,/_/g," "],[Ge,vw],[$e,$t]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[Fe,/_/g," "],[Ge,vw],[$e,Bn]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[Fe,[Ge,"OPPO"],[$e,$t]],[/\b(opd2\d{3}a?) bui/i],[Fe,[Ge,"OPPO"],[$e,Bn]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[Fe,[Ge,"Vivo"],[$e,$t]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[Fe,[Ge,"Realme"],[$e,$t]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[Fe,[Ge,$3],[$e,$t]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[Fe,[Ge,$3],[$e,Bn]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[Fe,[Ge,mw],[$e,Bn]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[Fe,[Ge,mw],[$e,$t]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[Fe,[Ge,R3],[$e,Bn]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[Fe,/_/g," "],[Ge,"Nokia"],[$e,$t]],[/(pixel c)\b/i],[Fe,[Ge,cl],[$e,Bn]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[Fe,[Ge,cl],[$e,$t]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[Fe,[Ge,Jg],[$e,$t]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[Fe,"Xperia Tablet"],[Ge,Jg],[$e,Bn]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[Fe,[Ge,"OnePlus"],[$e,$t]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[Fe,[Ge,Qg],[$e,Bn]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[Fe,/(.+)/g,"Fire Phone $1"],[Ge,Qg],[$e,$t]],[/(playbook);[-\w\),; ]+(rim)/i],[Fe,Ge,[$e,Bn]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[Fe,[Ge,M3],[$e,$t]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[Fe,[Ge,T3],[$e,Bn]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[Fe,[Ge,T3],[$e,$t]],[/(nexus 9)/i],[Fe,[Ge,"HTC"],[$e,Bn]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[Ge,[Fe,/_/g," "],[$e,$t]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[Fe,[Ge,"TCL"],[$e,Bn]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[Fe,[Ge,"TCL"],[$e,$t]],[/(itel) ((\w+))/i],[[Ge,da],Fe,[$e,cd,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[Fe,[Ge,"Acer"],[$e,Bn]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[Fe,[Ge,"Meizu"],[$e,$t]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[Fe,[Ge,"Ulefone"],[$e,$t]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[Fe,[Ge,"Energizer"],[$e,$t]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[Fe,[Ge,"Cat"],[$e,$t]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[Fe,[Ge,"Smartfren"],[$e,$t]],[/droid.+; (a(?:015|06[35]|142p?))/i],[Fe,[Ge,"Nothing"],[$e,$t]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[Ge,Fe,[$e,$t]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[Ge,Fe,[$e,Bn]],[/(surface duo)/i],[Fe,[Ge,Xg],[$e,Bn]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[Fe,[Ge,"Fairphone"],[$e,$t]],[/(shield[\w ]+) b/i],[Fe,[Ge,"Nvidia"],[$e,Bn]],[/(sprint) (\w+)/i],[Ge,Fe,[$e,$t]],[/(kin\.[onetw]{3})/i],[[Fe,/\./g," "],[Ge,Xg],[$e,$t]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[Fe,[Ge,yw],[$e,Bn]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[Fe,[Ge,yw],[$e,$t]],[/smart-tv.+(samsung)/i],[Ge,[$e,ii]],[/hbbtv.+maple;(\d+)/i],[[Fe,/^/,"SmartTV"],[Ge,id],[$e,ii]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[Ge,mw],[$e,ii]],[/(apple) ?tv/i],[Ge,[Fe,rd+" TV"],[$e,ii]],[/crkey.*devicetype\/chromecast/i],[[Fe,fs+" Third Generation"],[Ge,cl],[$e,ii]],[/crkey.*devicetype\/([^/]*)/i],[[Fe,/^/,"Chromecast "],[Ge,cl],[$e,ii]],[/fuchsia.*crkey/i],[[Fe,fs+" Nest Hub"],[Ge,cl],[$e,ii]],[/crkey/i],[[Fe,fs],[Ge,cl],[$e,ii]],[/droid.+aft(\w+)( bui|\))/i],[Fe,[Ge,Qg],[$e,ii]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[Fe,[Ge,D3],[$e,ii]],[/(bravia[\w ]+)( bui|\))/i],[Fe,[Ge,Jg],[$e,ii]],[/(mitv-\w{5}) bui/i],[Fe,[Ge,vw],[$e,ii]],[/Hbbtv.*(technisat) (.*);/i],[Ge,Fe,[$e,ii]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[Ge,ud],[Fe,ud],[$e,ii]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[$e,ii]],[/(ouya)/i,/(nintendo) (\w+)/i],[Ge,Fe,[$e,Du]],[/droid.+; (shield) bui/i],[Fe,[Ge,"Nvidia"],[$e,Du]],[/(playstation \w+)/i],[Fe,[Ge,Jg],[$e,Du]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[Fe,[Ge,Xg],[$e,Du]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[Fe,[Ge,id],[$e,td]],[/((pebble))app/i],[Ge,Fe,[$e,td]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[Fe,[Ge,rd],[$e,td]],[/droid.+; (wt63?0{2,3})\)/i],[Fe,[Ge,yw],[$e,td]],[/droid.+; (glass) \d/i],[Fe,[Ge,cl],[$e,cw]],[/(pico) (4|neo3(?: link|pro)?)/i],[Ge,Fe,[$e,cw]],[/; (quest( \d| pro)?)/i],[Fe,[Ge,N3],[$e,cw]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[Ge,[$e,fw]],[/(aeobc)\b/i],[Fe,[Ge,Qg],[$e,fw]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[Fe,[$e,$t]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[Fe,[$e,Bn]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[$e,Bn]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[$e,$t]],[/(android[-\w\. ]{0,9});.+buil/i],[Fe,[Ge,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[Pe,[Le,TK+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[Le,Pe],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[Pe,[Le,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[Le,Pe],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[Pe,Le]],os:[[/microsoft (windows) (vista|xp)/i],[Le,Pe],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[Le,[Pe,cd,F3]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[Pe,cd,F3],[Le,_w]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[Pe,/_/g,"."],[Le,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[Le,"macOS"],[Pe,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[Pe,[Le,fs+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[Pe,[Le,fs+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[Pe,[Le,fs+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[Pe,[Le,fs+" Linux"]],[/crkey\/([\d\.]+)/i],[Pe,[Le,fs]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[Pe,Le],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[Le,Pe],[/\(bb(10);/i],[Pe,[Le,M3]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[Pe,[Le,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[Pe,[Le,ad+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[Pe,[Le,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[Pe,[Le,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[Le,"Chrome OS"],Pe],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[Le,Pe],[/(sunos) ?([\w\.\d]*)/i],[[Le,"Solaris"],Pe],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[Le,Pe]]},nm=function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return ha.call(e.init,[[Li,[Le,Pe,ed,$e]],[ca,[Ei]],[No,[$e,Fe,Ge]],[fa,[Le,Pe]],[Ji,[Le,Pe]]]),ha.call(e.isIgnore,[[Li,[Pe,ed]],[fa,[Pe]],[Ji,[Pe]]]),ha.call(e.isIgnoreRgx,[[Li,/ ?browser$/i],[Ji,/ ?os$/i]]),ha.call(e.toString,[[Li,[Le,Pe]],[ca,[Ei]],[No,[Ge,Fe]],[fa,[Le,Pe]],[Ji,[Le,Pe]]]),e}(),RK=function(e,t){var n=nm.init[t],r=nm.isIgnore[t]||0,i=nm.isIgnoreRgx[t]||0,o=nm.toString[t]||0;function a(){ha.call(this,n)}return a.prototype.getItem=function(){return e},a.prototype.withClientHints=function(){return ds?ds.getHighEntropyValues(I3).then(function(u){return e.setCH(new j3(u,!1)).parseCH().get()}):e.parseCH().get()},a.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=Nu&&(a.prototype.is=function(u){var c=!1;for(var d in this)if(this.hasOwnProperty(d)&&!bw(r,d)&&da(i?fl(i,this[d]):this[d])==da(i?fl(i,u):u)){if(c=!0,u!=us)break}else if(u==us&&c){c=!c;break}return c},a.prototype.toString=function(){var u=Ru;for(var c in o)typeof this[o[c]]!==us&&(u+=(u?" ":Ru)+this[o[c]]);return u||us}),ds||(a.prototype.then=function(u){var c=this,d=function(){for(var h in c)c.hasOwnProperty(h)&&(this[h]=c[h])};d.prototype={is:a.prototype.is,toString:a.prototype.toString};var p=new d;return u(p),p}),new a};function j3(e,t){if(e=e||{},ha.call(this,I3),t)ha.call(this,[[hw,xw(e[cs])],[pw,xw(e[xK])],[$t,/\?1/.test(e[EK])],[Fe,ld(e[kK])],[Lu,ld(e[A3])],[gw,ld(e[AK])],[Ei,ld(e[wK])],[ul,xw(e[CK])],[Kg,ld(e[SK])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==us&&(this[n]=e[n])}function q3(e,t,n,r){return this.get=function(i){return i?this.data.hasOwnProperty(i)?this.data[i]:void 0:this.data},this.set=function(i,o){return this.data[i]=o,this},this.setCH=function(i){return this.uaCH=i,this},this.detectFeature=function(){if(ki&&ki.userAgent==this.ua)switch(this.itemType){case Li:ki.brave&&typeof ki.brave.isBrave==Wg&&this.set(Le,"Brave");break;case No:!this.get($e)&&ds&&ds[$t]&&this.set($e,$t),this.get(Fe)=="Macintosh"&&ki&&typeof ki.standalone!==us&&ki.maxTouchPoints&&ki.maxTouchPoints>2&&this.set(Fe,"iPad").set($e,Bn);break;case Ji:!this.get(Le)&&ds&&ds[Lu]&&this.set(Le,ds[Lu]);break;case Nu:var i=this.data,o=function(a){return i[a].getItem().detectFeature().get()};this.set(Li,o(Li)).set(ca,o(ca)).set(No,o(No)).set(fa,o(fa)).set(Ji,o(Ji))}return this},this.parseUA=function(){return this.itemType!=Nu&&P3.call(this.data,this.ua,this.rgxMap),this.itemType==Li&&this.set(ed,ww(this.get(Pe))),this},this.parseCH=function(){var i=this.uaCH,o=this.rgxMap;switch(this.itemType){case Li:var a=i[pw]||i[hw],u;if(a)for(var c in a){var d=fl(/(Google|Microsoft) /,a[c].brand||a[c]),p=a[c].version;!/not.a.brand/i.test(d)&&(!u||/chrom/i.test(u)&&!/chromi/i.test(d))&&(this.set(Le,d).set(Pe,p).set(ed,ww(p)),u=d)}break;case ca:var h=i[Ei];h&&(h&&i[Kg]=="64"&&(h+="64"),P3.call(this.data,h+";",o));break;case No:if(i[$t]&&this.set($e,$t),i[Fe]&&this.set(Fe,i[Fe]),i[Fe]=="Xbox"&&this.set($e,Du).set(Ge,Xg),i[ul]){var m;if(typeof i[ul]!="string")for(var v=0;!m&&v<i[ul].length;)m=cd(i[ul][v++],z3);else m=cd(i[ul],z3);this.set($e,m)}break;case Ji:var _=i[Lu];if(_){var S=i[gw];_==_w&&(S=parseInt(ww(S),10)>=13?"11":"10"),this.set(Le,_).set(Pe,S)}this.get(Le)==_w&&i[Fe]=="Xbox"&&this.set(Le,"Xbox").set(Pe,void 0);break;case Nu:var x=this.data,b=function(C){return x[C].getItem().setCH(i).parseCH().get()};this.set(Li,b(Li)).set(ca,b(ca)).set(No,b(No)).set(fa,b(fa)).set(Ji,b(Ji))}return this},ha.call(this,[["itemType",e],["ua",t],["uaCH",r],["rgxMap",n],["data",RK(this,e)]]),this}function pa(e,t,n){if(typeof e===$u?(tm(e,!0)?(typeof t===$u&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e===uw&&!tm(t,!0)&&(n=t,t=void 0),n&&typeof n.append===Wg){var r={};n.forEach(function(c,d){r[d]=c}),n=r}if(!(this instanceof pa))return new pa(e,t,n).getResult();var i=typeof e===uw?e:n&&n[k3]?n[k3]:ki&&ki.userAgent?ki.userAgent:Ru,o=new j3(n,!0),a=t?OK(U3,t):U3,u=function(c){return c==Nu?function(){return new q3(c,i,a,o).set("ua",i).set(Li,this.getBrowser()).set(ca,this.getCPU()).set(No,this.getDevice()).set(fa,this.getEngine()).set(Ji,this.getOS()).get()}:function(){return new q3(c,i,a[c],o).parseUA().get()}};return ha.call(this,[["getBrowser",u(Li)],["getCPU",u(ca)],["getDevice",u(No)],["getEngine",u(fa)],["getOS",u(Ji)],["getResult",u(Nu)],["getUA",function(){return i}],["setUA",function(c){return Pu(c)&&(i=c.length>dw?ud(c,dw):c),this}]]).setUA(i),this}pa.VERSION=bK,pa.BROWSER=em([Le,Pe,ed,$e]),pa.CPU=em([Ei]),pa.DEVICE=em([Fe,Ge,$e,Du,$t,ii,Bn,td,fw]),pa.ENGINE=pa.OS=em([Le,Pe]);const to=class to{constructor(t){Cr(this,"config");Cr(this,"storedData");Cr(this,"deviceInfo");Cr(this,"localStorageKey","_dsjfs312313kj3debales_analytics_");this.config=t,this.deviceInfo=this.getDeviceInfo(),this.localStorageKey=t.localStorageKey||this.localStorageKey+this.config.projectName,this.config.testing=t.testing||(()=>!1);const n=localStorage.getItem(this.localStorageKey);if(n)this.storedData=JSON.parse(n),this.config.debug&&console.log("Using Existing Stored data:",this.storedData);else{const r=crypto.randomUUID();this.storedData={projectName:this.config.projectName,anonId:r,distinctId:r},this.config.debug&&console.log("Using New Stored data:",this.storedData),this.updateStorage()}this.config.debug&&console.log("Analytics initialized:",this.storedData)}static init(t){to.instance||(to.instance=new to(t))}static getInstance(){if(!to.instance)throw new Error("DebalesAnalytics is not initialized. Call init() first.");return to.instance}static async identify(t,n){return to.getInstance().identifyInternal(t,n)}static track(t,n){to.getInstance().trackInternal(t,n)}static getDistinctId(){return to.getInstance().storedData.distinctId}static getAnonId(){return to.getInstance().storedData.anonId}async identifyInternal(t,n){try{if(this.config.testing&&this.config.testing())return;let r,i,o;if(n){const{name:c,phone:d,...p}=n;r=c,i=d,o=p}const a={distinctId:this.storedData.distinctId,anonId:[this.storedData.anonId],projectName:this.config.projectName,email:t,name:r,phone:i,properties:o},u=await this.sendRequest("/api/analytic/identify",a);u&&u.success&&u.distinctId&&(this.config.debug&&console.log("identify success new distint id"),this.storedData.distinctId=u.distinctId,this.storedData.email=t,this.updateStorage(),u.isIdentified&&this.trackInternal("identify")),this.config.debug&&console.log("Identify event sent:",a)}catch(r){console.error("Failed to identify user:",r)}}trackInternal(t,n){if(this.config.testing&&this.config.testing())return;const r={projectName:this.config.projectName,distinctId:this.storedData.distinctId,anonId:this.storedData.anonId,eventName:t,osVersion:this.deviceInfo.osVersion,browserVersion:this.deviceInfo.browserVersion,operatingSystem:this.deviceInfo.os,browser:this.deviceInfo.browser,currentUrl:window.location.href,chatId:an()+this.config.projectName,properties:n};this.sendRequest("/api/analytic/track",r),this.config.debug&&console.log("Track event sent:",r)}updateStorage(){localStorage.setItem(this.localStorageKey,JSON.stringify(this.storedData))}async sendRequest(t,n){try{const r=await fetch(`${Zn}${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return await r.json()}catch(r){console.error("Failed to send analytics data:",r)}}getDeviceInfo(){const n=new pa().getResult();return{browser:n.browser.name,os:n.os.name,browserVersion:n.browser.version,osVersion:n.os.version}}};Cr(to,"instance",null);let Sw=to;const Bo=Sw;function $K(e){dT(e,[/\r?\n|\r/g,DK])}function DK(){return{type:"break"}}function rm(){return function(e){$K(e)}}const mt={OPEN_STATE_CHANGE:"open_state_change",CHAT_BUTTON_CLICKED:"Chat button clicked",USER_FORM_FILLED:"User form filled",ADD_BULK_ITEM:"Add bulk item",USER_FORM_CLOSE:"user_form_close",CHECKOUT_CLICKED:"Checkout Clicked",ADD_TO_CART_CLICKED:"add to cart clicked",SUGGESTED_QUESTION_CLICKED:"Suggested Question Clicked",INITIAL_LEADING_QUERY_SUGGESTED_QUESTION_CLICKED:"Initial Leading Query Suggested Question Clicked",LEADING_QUERY_CLICKED:"Leading Query Clicked",COLLECTION_VIDEO_CLICKED:"Collection Video Clicked",COLLECTION_IMAGE_CLICKED:"Collection Image Clicked",VIEW_PRODUCT_CLICKED:"view product clicked",PRODUCT_VIDEO_CLICKED:"Product Video Clicked",PRODUCT_IMAGE_CLICKED:"Product Image Clicked",SHOW_SIMILAR_CLICKED:"show similar clicked",CHAT_MESSAGE_SENT:"chat_message_sent",CHAT_MESSAGE_TYPING_STARTED:"chat_message_typing_started",CHAT_MESSAGE_TYPING_ENDED:"chat_message_typing_ended",DISCOUNT_VIEWED:"discount_viewed",SHOPIFY_LINK_CLICKED:"shopify_link_clicked"},hn={OPEN_STATE_CHANGE:"open_state_change"},im=e=>{window.DebalesChat||(window.DebalesChat={isOpen:!1,projectId:e,getSessionId:()=>an(),getChatId:()=>an()+"_"+e,getAnonId:()=>Bo.getAnonId(),isIdentified:()=>{if(Zi._isIdentified())return!0;const t=Nr();return!!(t&&t.email)},getIdentifiedUser:()=>Nr(),getDistinctId:()=>Zi.get_distinct_id(),getOldDistinctId:()=>Bo.getDistinctId(),debug:!1,identify:(t,n)=>{Zi._isIdentified()||Zi.identify(t,{...n,project:e}),Bo.identify(t,n),ua({email:t,name:n==null?void 0:n.name,phone:n==null?void 0:n.phone})},track:(t,n)=>{Bo.track(t,{...n,sessionId:window.DebalesChat.getSessionId()}),Zi.capture(t,{...n}),vK(t,{...n,sessionId:an(),projectId:e})},onOpenChange:t=>{const n=r=>{t(r.detail.isOpen)};return window.addEventListener(hn.OPEN_STATE_CHANGE,n),()=>window.removeEventListener(hn.OPEN_STATE_CHANGE,n)},removeOpenChangeListener:t=>{const n=r=>{t(r.detail.isOpen)};window.removeEventListener(hn.OPEN_STATE_CHANGE,n)},open:()=>{window.DebalesChat.isOpen||window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:!0,projectId:e}}))},close:()=>{window.DebalesChat.isOpen&&window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:!1,projectId:e}}))},toggle:()=>{window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:!window.DebalesChat.isOpen,projectId:e}}))}})};var Pr=(e=>(e.DEFAULT="DEFAULT",e.SHOPIFY="SHOPIFY",e.WOOCOMMERCE="WOOCOMMERCE",e.MAGENTO="MAGENTO",e.UNKNOWN="UNKNOWN",e))(Pr||{});class hs{static detect(){var t,n,r,i,o,a;if(typeof window<"u"&&window.Shopify!==void 0&&window.Shopify.routes!==void 0)return Pr.SHOPIFY;if(typeof window<"u"&&document.body.classList.contains("woocommerce"))return Pr.WOOCOMMERCE;if(typeof window<"u"){if(window.MAGENTO_VERSION!==void 0||window.MAGE!==void 0||window.Mage!==void 0||["page-wrapper","magento-theme","catalog-product-view","catalog-category-view"].some(h=>document.body.classList.contains(h)))return Pr.MAGENTO;const c=document.getElementsByTagName("script");for(const h of Array.from(c))if(h.src.includes("mage/")||h.src.includes("magento")||(t=h.textContent)!=null&&t.includes("Mage.")||(n=h.textContent)!=null&&n.includes("require(")||(r=h.getAttribute("data-requiremodule"))!=null&&r.startsWith("mage")||(i=h.getAttribute("data-requiremodule"))!=null&&i.startsWith("Magento"))return Pr.MAGENTO;if(document.cookie.split(";").some(h=>h.trim().startsWith("mage-")||h.trim().startsWith("form_key")))return Pr.MAGENTO;const p=document.getElementsByTagName("meta");for(const h of Array.from(p))if((o=h.getAttribute("content"))!=null&&o.includes("Magento")||(a=h.getAttribute("name"))!=null&&a.includes("magento"))return Pr.MAGENTO}return Pr.UNKNOWN}}const om=z.button`
140
140
  width: max-content;
141
141
  cursor: pointer;
142
142
  border-radius: 50px !important;
@@ -268,7 +268,7 @@ or you can use record.mirror to access the mirror instance during recording.`,qR
268
268
  font-size: 14px;
269
269
  font-weight: 500;
270
270
  }
271
- `,H2=(e,t)=>{const n=parseFloat(e.replace(/[^\d.]/g,""));let r=(t==null?void 0:t.money_format)||"${{amount}}";const i={amount:n.toFixed(2),amount_no_decimals:Math.round(n).toString(),amount_with_comma_separator:n.toFixed(2).replace(".",","),amount_no_decimals_with_comma_separator:Math.round(n).toString().replace(".",",")};for(const[o,a]of Object.entries(i)){const u=new RegExp(`\\{\\{\\s*${o}\\s*\\}\\}`);if(u.test(r)){r=r.replace(u,a);break}}return r},Cw=e=>{const t=e.replace(/[^0-9.]/g,"");return Math.round(parseFloat(t))||0},LK=e=>{const t=e.startsWith("http")?e:`https://${e}`,n=new URL(t);return`${n.protocol}//${n.hostname}/meta.json`},NK=async e=>{try{const t=e.startsWith("http")?e:`https://${e}`,n=new URL(t),r=qt(jt.SHOPIFY_META_DATA,{botId:window.DebalesChat.projectId}),i=sessionStorage.getItem(r+n.hostname);if(i)return JSON.parse(i);const o=LK(e),a=await fetch(o);if(!a.ok)throw new Error("Failed to fetch store meta");const u=await a.json(),c={currency:u.currency,money_format:u.money_format,name:u.name,domain:u.domain};return sessionStorage.setItem(r,JSON.stringify(c)),c}catch(t){return console.error("Error fetching store meta:",t),{currency:"USD",money_format:"${{amount}}",name:"",domain:e}}},sm=(e,t)=>{var n;return typeof window<"u"&&"Shopify"in window&&((n=window.Shopify)!=null&&n.locale)?Intl.NumberFormat(window.Shopify.locale,{style:"currency",currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(e):Intl.NumberFormat("en-US",{style:"currency",currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(e)},G2=R.createContext({}),lm=()=>{const e=R.useContext(G2);if(!e)throw new Error("useShadowDOM must be used within a ShadowDOMProvider");return e},V2=R.createContext(void 0),Fu=()=>{const e=R.useContext(V2);if(e===void 0)throw new Error("useDebales must be used within a DebalesProvider");return e};function BK(e){return Object.prototype.toString.call(e)==="[object Object]"}function Z2(e){return BK(e)||Array.isArray(e)}function PK(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Ew(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(a=>{const u=e[a],c=t[a];return typeof u=="function"?`${u}`==`${c}`:!Z2(u)||!Z2(c)?u===c:Ew(u,c)})}function Y2(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function FK(e,t){if(e.length!==t.length)return!1;const n=Y2(e),r=Y2(t);return n.every((i,o)=>{const a=r[o];return Ew(i,a)})}function kw(e){return typeof e=="number"}function Aw(e){return typeof e=="string"}function um(e){return typeof e=="boolean"}function W2(e){return Object.prototype.toString.call(e)==="[object Object]"}function zn(e){return Math.abs(e)}function Iw(e){return Math.sign(e)}function dd(e,t){return zn(e-t)}function zK(e,t){if(e===0||t===0||zn(e)<=zn(t))return 0;const n=dd(zn(e),zn(t));return zn(n/e)}function UK(e){return Math.round(e*100)/100}function hd(e){return gd(e).map(Number)}function bo(e){return e[pd(e)]}function pd(e){return Math.max(0,e.length-1)}function Tw(e,t){return t===pd(e)}function K2(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function gd(e){return Object.keys(e)}function Q2(e,t){return[e,t].reduce((n,r)=>(gd(r).forEach(i=>{const o=n[i],a=r[i],u=W2(o)&&W2(a);n[i]=u?Q2(o,a):a}),n),{})}function Mw(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function jK(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(c){return o(c)/2}function o(c){return t-c}function a(c,d){return Aw(e)?n[e](c):e(t,c,d)}return{measure:a}}function md(){let e=[];function t(i,o,a,u={passive:!0}){let c;if("addEventListener"in i)i.addEventListener(o,a,u),c=()=>i.removeEventListener(o,a,u);else{const d=i;d.addListener(a),c=()=>d.removeListener(a)}return e.push(c),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function qK(e,t,n,r){const i=md(),o=1e3/60;let a=null,u=0,c=0;function d(){i.add(e,"visibilitychange",()=>{e.hidden&&_()})}function p(){v(),i.clear()}function h(x){if(!c)return;a||(a=x,n(),n());const b=x-a;for(a=x,u+=b;u>=o;)n(),u-=o;const C=u/o;r(C),c&&(c=t.requestAnimationFrame(h))}function m(){c||(c=t.requestAnimationFrame(h))}function v(){t.cancelAnimationFrame(c),a=null,u=0,c=0}function _(){a=null,u=0}return{init:d,destroy:p,start:m,stop:v,update:n,render:r}}function HK(e,t){const n=t==="rtl",r=e==="y",i=r?"y":"x",o=r?"x":"y",a=!r&&n?-1:1,u=p(),c=h();function d(_){const{height:S,width:x}=_;return r?S:x}function p(){return r?"top":n?"right":"left"}function h(){return r?"bottom":n?"left":"right"}function m(_){return _*a}return{scroll:i,cross:o,startEdge:u,endEdge:c,measureSize:d,direction:m}}function dl(e=0,t=0){const n=zn(e-t);function r(d){return d<e}function i(d){return d>t}function o(d){return r(d)||i(d)}function a(d){return o(d)?r(d)?e:t:d}function u(d){return n?d-n*Math.ceil((d-t)/n):d}return{length:n,max:t,min:e,constrain:a,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:u}}function X2(e,t,n){const{constrain:r}=dl(0,e),i=e+1;let o=a(t);function a(m){return n?zn((i+m)%i):r(m)}function u(){return o}function c(m){return o=a(m),h}function d(m){return p().set(u()+m)}function p(){return X2(e,u(),n)}const h={get:u,set:c,add:d,clone:p};return h}function GK(e,t,n,r,i,o,a,u,c,d,p,h,m,v,_,S,x,b,C){const{cross:k,direction:A}=e,I=["INPUT","SELECT","TEXTAREA"],$={passive:!1},B=md(),U=md(),G=dl(50,225).constrain(v.measure(20)),P={mouse:300,touch:400},K={mouse:500,touch:600},re=_?43:25;let ue=!1,Z=0,ie=0,V=!1,Q=!1,ye=!1,Te=!1;function T(Se){if(!C)return;function Ye(ot){(um(C)||C(Se,ot))&&de(ot)}const Qe=t;B.add(Qe,"dragstart",ot=>ot.preventDefault(),$).add(Qe,"touchmove",()=>{},$).add(Qe,"touchend",()=>{}).add(Qe,"touchstart",Ye).add(Qe,"mousedown",Ye).add(Qe,"touchcancel",Ze).add(Qe,"contextmenu",Ze).add(Qe,"click",lt,!0)}function X(){B.clear(),U.clear()}function ve(){const Se=Te?n:t;U.add(Se,"touchmove",tt,$).add(Se,"touchend",Ze).add(Se,"mousemove",tt,$).add(Se,"mouseup",Ze)}function L(Se){const Ye=Se.nodeName||"";return I.includes(Ye)}function we(){return(_?K:P)[Te?"mouse":"touch"]}function Ue(Se,Ye){const Qe=h.add(Iw(Se)*-1),ot=p.byDistance(Se,!_).distance;return _||zn(Se)<G?ot:x&&Ye?ot*.5:p.byIndex(Qe.get(),0).distance}function de(Se){const Ye=Mw(Se,r);Te=Ye,ye=_&&Ye&&!Se.buttons&&ue,ue=dd(i.get(),a.get())>=2,!(Ye&&Se.button!==0)&&(L(Se.target)||(V=!0,o.pointerDown(Se),d.useFriction(0).useDuration(0),i.set(a),ve(),Z=o.readPoint(Se),ie=o.readPoint(Se,k),m.emit("pointerDown")))}function tt(Se){if(!Mw(Se,r)&&Se.touches.length>=2)return Ze(Se);const Qe=o.readPoint(Se),ot=o.readPoint(Se,k),et=dd(Qe,Z),He=dd(ot,ie);if(!Q&&!Te&&(!Se.cancelable||(Q=et>He,!Q)))return Ze(Se);const N=o.pointerMove(Se);et>S&&(ye=!0),d.useFriction(.3).useDuration(.75),u.start(),i.add(A(N)),Se.preventDefault()}function Ze(Se){const Qe=p.byDistance(0,!1).index!==h.get(),ot=o.pointerUp(Se)*we(),et=Ue(A(ot),Qe),He=zK(ot,et),N=re-10*He,F=b+He/50;Q=!1,V=!1,U.clear(),d.useDuration(N).useFriction(F),c.distance(et,!_),Te=!1,m.emit("pointerUp")}function lt(Se){ye&&(Se.stopPropagation(),Se.preventDefault(),ye=!1)}function gt(){return V}return{init:T,destroy:X,pointerDown:gt}}function VK(e,t){let r,i;function o(h){return h.timeStamp}function a(h,m){const _=`client${(m||e.scroll)==="x"?"X":"Y"}`;return(Mw(h,t)?h:h.touches[0])[_]}function u(h){return r=h,i=h,a(h)}function c(h){const m=a(h)-a(i),v=o(h)-o(r)>170;return i=h,v&&(r=h),m}function d(h){if(!r||!i)return 0;const m=a(i)-a(r),v=o(h)-o(r),_=o(h)-o(i)>170,S=m/v;return v&&!_&&zn(S)>.1?S:0}return{pointerDown:u,pointerMove:c,pointerUp:d,readPoint:a}}function ZK(){function e(n){const{offsetTop:r,offsetLeft:i,offsetWidth:o,offsetHeight:a}=n;return{top:r,right:i+o,bottom:r+a,left:i,width:o,height:a}}return{measure:e}}function YK(e){function t(r){return e*(r/100)}return{measure:t}}function WK(e,t,n,r,i,o,a){const u=[e].concat(r);let c,d,p=[],h=!1;function m(x){return i.measureSize(a.measure(x))}function v(x){if(!o)return;d=m(e),p=r.map(m);function b(C){for(const k of C){if(h)return;const A=k.target===e,I=r.indexOf(k.target),$=A?d:p[I],B=m(A?e:r[I]);if(zn(B-$)>=.5){x.reInit(),t.emit("resize");break}}}c=new ResizeObserver(C=>{(um(o)||o(x,C))&&b(C)}),n.requestAnimationFrame(()=>{u.forEach(C=>c.observe(C))})}function _(){h=!0,c&&c.disconnect()}return{init:v,destroy:_}}function KK(e,t,n,r,i,o){let a=0,u=0,c=i,d=o,p=e.get(),h=0;function m(){const $=r.get()-e.get(),B=!c;let U=0;return B?(a=0,n.set(r),e.set(r),U=$):(n.set(e),a+=$/c,a*=d,p+=a,e.add(a),U=p-h),u=Iw(U),h=p,I}function v(){const $=r.get()-t.get();return zn($)<.001}function _(){return c}function S(){return u}function x(){return a}function b(){return k(i)}function C(){return A(o)}function k($){return c=$,I}function A($){return d=$,I}const I={direction:S,duration:_,velocity:x,seek:m,settled:v,useBaseFriction:C,useBaseDuration:b,useFriction:A,useDuration:k};return I}function QK(e,t,n,r,i){const o=i.measure(10),a=i.measure(50),u=dl(.1,.99);let c=!1;function d(){return!(c||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function p(v){if(!d())return;const _=e.reachedMin(t.get())?"min":"max",S=zn(e[_]-t.get()),x=n.get()-t.get(),b=u.constrain(S/a);n.subtract(x*b),!v&&zn(x)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function h(v){c=!v}return{shouldConstrain:d,constrain:p,toggleActive:h}}function XK(e,t,n,r,i){const o=dl(-t+e,0),a=h(),u=p(),c=m();function d(_,S){return dd(_,S)<=1}function p(){const _=a[0],S=bo(a),x=a.lastIndexOf(_),b=a.indexOf(S)+1;return dl(x,b)}function h(){return n.map((_,S)=>{const{min:x,max:b}=o,C=o.constrain(_),k=!S,A=Tw(n,S);return k?b:A||d(x,C)?x:d(b,C)?b:C}).map(_=>parseFloat(_.toFixed(3)))}function m(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return a;const{min:_,max:S}=u;return a.slice(_,S)}return{snapsContained:c,scrollContainLimit:u}}function JK(e,t,n){const r=t[0],i=n?r-e:bo(t);return{limit:dl(i,r)}}function eQ(e,t,n,r){const o=t.min+.1,a=t.max+.1,{reachedMin:u,reachedMax:c}=dl(o,a);function d(m){return m===1?c(n.get()):m===-1?u(n.get()):!1}function p(m){if(!d(m))return;const v=e*(m*-1);r.forEach(_=>_.add(v))}return{loop:p}}function tQ(e){const{max:t,length:n}=e;function r(o){const a=o-t;return n?a/-n:0}return{get:r}}function nQ(e,t,n,r,i){const{startEdge:o,endEdge:a}=e,{groupSlides:u}=i,c=h().map(t.measure),d=m(),p=v();function h(){return u(r).map(S=>bo(S)[a]-S[0][o]).map(zn)}function m(){return r.map(S=>n[o]-S[o]).map(S=>-zn(S))}function v(){return u(d).map(S=>S[0]).map((S,x)=>S+c[x])}return{snaps:d,snapsAligned:p}}function rQ(e,t,n,r,i,o){const{groupSlides:a}=i,{min:u,max:c}=r,d=p();function p(){const m=a(o),v=!e||t==="keepSnaps";return n.length===1?[o]:v?m:m.slice(u,c).map((_,S,x)=>{const b=!S,C=Tw(x,S);if(b){const k=bo(x[0])+1;return K2(k)}if(C){const k=pd(o)-bo(x)[0]+1;return K2(k,bo(x)[0])}return _})}return{slideRegistry:d}}function iQ(e,t,n,r,i){const{reachedAny:o,removeOffset:a,constrain:u}=r;function c(_){return _.concat().sort((S,x)=>zn(S)-zn(x))[0]}function d(_){const S=e?a(_):u(_),x=t.map((C,k)=>({diff:p(C-S,0),index:k})).sort((C,k)=>zn(C.diff)-zn(k.diff)),{index:b}=x[0];return{index:b,distance:S}}function p(_,S){const x=[_,_+n,_-n];if(!e)return _;if(!S)return c(x);const b=x.filter(C=>Iw(C)===S);return b.length?c(b):bo(x)-n}function h(_,S){const x=t[_]-i.get(),b=p(x,S);return{index:_,distance:b}}function m(_,S){const x=i.get()+_,{index:b,distance:C}=d(x),k=!e&&o(x);if(!S||k)return{index:b,distance:_};const A=t[b]-C,I=_+p(A,0);return{index:b,distance:I}}return{byDistance:m,byIndex:h,shortcut:p}}function oQ(e,t,n,r,i,o,a){function u(h){const m=h.distance,v=h.index!==t.get();o.add(m),m&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),v&&(n.set(t.get()),t.set(h.index),a.emit("select"))}function c(h,m){const v=i.byDistance(h,m);u(v)}function d(h,m){const v=t.clone().set(h),_=i.byIndex(v.get(),m);u(_)}return{distance:c,index:d}}function aQ(e,t,n,r,i,o,a,u){const c={passive:!0,capture:!0};let d=0;function p(v){if(!u)return;function _(S){if(new Date().getTime()-d>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const C=n.findIndex(k=>k.includes(S));kw(C)&&(i.useDuration(0),r.index(C,0),a.emit("slideFocus"))}o.add(document,"keydown",h,!1),t.forEach((S,x)=>{o.add(S,"focus",b=>{(um(u)||u(v,b))&&_(x)},c)})}function h(v){v.code==="Tab"&&(d=new Date().getTime())}return{init:p}}function vd(e){let t=e;function n(){return t}function r(c){t=a(c)}function i(c){t+=a(c)}function o(c){t-=a(c)}function a(c){return kw(c)?c:c.get()}return{get:n,set:r,add:i,subtract:o}}function J2(e,t){const n=e.scroll==="x"?a:u,r=t.style;let i=null,o=!1;function a(m){return`translate3d(${m}px,0px,0px)`}function u(m){return`translate3d(0px,${m}px,0px)`}function c(m){if(o)return;const v=UK(e.direction(m));v!==i&&(r.transform=n(v),i=v)}function d(m){o=!m}function p(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:p,to:c,toggleActive:d}}function sQ(e,t,n,r,i,o,a,u,c){const p=hd(i),h=hd(i).reverse(),m=b().concat(C());function v(B,U){return B.reduce((G,P)=>G-i[P],U)}function _(B,U){return B.reduce((G,P)=>v(G,U)>0?G.concat([P]):G,[])}function S(B){return o.map((U,G)=>({start:U-r[G]+.5+B,end:U+t-.5+B}))}function x(B,U,G){const P=S(U);return B.map(K=>{const re=G?0:-n,ue=G?n:0,Z=G?"end":"start",ie=P[K][Z];return{index:K,loopPoint:ie,slideLocation:vd(-1),translate:J2(e,c[K]),target:()=>u.get()>ie?re:ue}})}function b(){const B=a[0],U=_(h,B);return x(U,n,!1)}function C(){const B=t-a[0]-1,U=_(p,B);return x(U,-n,!0)}function k(){return m.every(({index:B})=>{const U=p.filter(G=>G!==B);return v(U,t)<=.1})}function A(){m.forEach(B=>{const{target:U,translate:G,slideLocation:P}=B,K=U();K!==P.get()&&(G.to(K),P.set(K))})}function I(){m.forEach(B=>B.translate.clear())}return{canLoop:k,clear:I,loop:A,loopPoints:m}}function lQ(e,t,n){let r,i=!1;function o(c){if(!n)return;function d(p){for(const h of p)if(h.type==="childList"){c.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(p=>{i||(um(n)||n(c,p))&&d(p)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),i=!0}return{init:o,destroy:a}}function uQ(e,t,n,r){const i={};let o=null,a=null,u,c=!1;function d(){u=new IntersectionObserver(_=>{c||(_.forEach(S=>{const x=t.indexOf(S.target);i[x]=S}),o=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(_=>u.observe(_))}function p(){u&&u.disconnect(),c=!0}function h(_){return gd(i).reduce((S,x)=>{const b=parseInt(x),{isIntersecting:C}=i[b];return(_&&C||!_&&!C)&&S.push(b),S},[])}function m(_=!0){if(_&&o)return o;if(!_&&a)return a;const S=h(_);return _&&(o=S),_||(a=S),S}return{init:d,destroy:p,get:m}}function cQ(e,t,n,r,i,o){const{measureSize:a,startEdge:u,endEdge:c}=e,d=n[0]&&i,p=_(),h=S(),m=n.map(a),v=x();function _(){if(!d)return 0;const C=n[0];return zn(t[u]-C[u])}function S(){if(!d)return 0;const C=o.getComputedStyle(bo(r));return parseFloat(C.getPropertyValue(`margin-${c}`))}function x(){return n.map((C,k,A)=>{const I=!k,$=Tw(A,k);return I?m[k]+p:$?m[k]+h:A[k+1][u]-C[u]}).map(zn)}return{slideSizes:m,slideSizesWithGaps:v,startGap:p,endGap:h}}function fQ(e,t,n,r,i,o,a,u,c){const{startEdge:d,endEdge:p,direction:h}=e,m=kw(n);function v(b,C){return hd(b).filter(k=>k%C===0).map(k=>b.slice(k,k+C))}function _(b){return b.length?hd(b).reduce((C,k,A)=>{const I=bo(C)||0,$=I===0,B=k===pd(b),U=i[d]-o[I][d],G=i[d]-o[k][p],P=!r&&$?h(a):0,K=!r&&B?h(u):0,re=zn(G-K-(U+P));return A&&re>t+c&&C.push(k),B&&C.push(b.length),C},[]).map((C,k,A)=>{const I=Math.max(A[k-1]||0);return b.slice(I,C)}):[]}function S(b){return m?v(b,n):_(b)}return{groupSlides:S}}function dQ(e,t,n,r,i,o,a){const{align:u,axis:c,direction:d,startIndex:p,loop:h,duration:m,dragFree:v,dragThreshold:_,inViewThreshold:S,slidesToScroll:x,skipSnaps:b,containScroll:C,watchResize:k,watchSlides:A,watchDrag:I,watchFocus:$}=o,B=2,U=ZK(),G=U.measure(t),P=n.map(U.measure),K=HK(c,d),re=K.measureSize(G),ue=YK(re),Z=jK(u,re),ie=!h&&!!C,V=h||!!C,{slideSizes:Q,slideSizesWithGaps:ye,startGap:Te,endGap:T}=cQ(K,G,P,n,V,i),X=fQ(K,re,x,h,G,P,Te,T,B),{snaps:ve,snapsAligned:L}=nQ(K,Z,G,P,X),we=-bo(ve)+bo(ye),{snapsContained:Ue,scrollContainLimit:de}=XK(re,we,L,C,B),tt=ie?Ue:L,{limit:Ze}=JK(we,tt,h),lt=X2(pd(tt),p,h),gt=lt.clone(),je=hd(n),Se=({dragHandler:at,scrollBody:Tt,scrollBounds:Bt,options:{loop:Et}})=>{Et||Bt.constrain(at.pointerDown()),Tt.seek()},Ye=({scrollBody:at,translate:Tt,location:Bt,offsetLocation:Et,previousLocation:Yt,scrollLooper:ft,slideLooper:wt,dragHandler:Je,animation:yt,eventHandler:Yn,scrollBounds:pr,options:{loop:Wn}},Pn)=>{const Fr=at.settled(),pi=!pr.shouldConstrain(),oi=Wn?Fr:Fr&&pi,Ar=oi&&!Je.pointerDown();Ar&&yt.stop();const zr=Bt.get()*Pn+Yt.get()*(1-Pn);Et.set(zr),Wn&&(ft.loop(at.direction()),wt.loop()),Tt.to(Et.get()),Ar&&Yn.emit("settle"),oi||Yn.emit("scroll")},Qe=qK(r,i,()=>Se(Xe),at=>Ye(Xe,at)),ot=.68,et=tt[lt.get()],He=vd(et),N=vd(et),F=vd(et),Y=vd(et),ge=KK(He,F,N,Y,m,ot),_e=iQ(h,tt,we,Ze,Y),Ie=oQ(Qe,lt,gt,ge,_e,Y,a),We=tQ(Ze),nt=md(),ne=uQ(t,n,a,S),{slideRegistry:me}=rQ(ie,C,tt,de,X,je),qe=aQ(e,n,me,Ie,ge,nt,a,$),Xe={ownerDocument:r,ownerWindow:i,eventHandler:a,containerRect:G,slideRects:P,animation:Qe,axis:K,dragHandler:GK(K,e,r,i,Y,VK(K,i),He,Qe,Ie,ge,_e,lt,a,ue,v,_,b,ot,I),eventStore:nt,percentOfView:ue,index:lt,indexPrevious:gt,limit:Ze,location:He,offsetLocation:F,previousLocation:N,options:o,resizeHandler:WK(t,a,i,n,K,k,U),scrollBody:ge,scrollBounds:QK(Ze,F,Y,ge,ue),scrollLooper:eQ(we,Ze,F,[He,F,N,Y]),scrollProgress:We,scrollSnapList:tt.map(We.get),scrollSnaps:tt,scrollTarget:_e,scrollTo:Ie,slideLooper:sQ(K,re,we,Q,ye,ve,tt,F,n),slideFocus:qe,slidesHandler:lQ(t,a,A),slidesInView:ne,slideIndexes:je,slideRegistry:me,slidesToScroll:X,target:Y,translate:J2(K,t)};return Xe}function hQ(){let e={},t;function n(d){t=d}function r(d){return e[d]||[]}function i(d){return r(d).forEach(p=>p(t,d)),c}function o(d,p){return e[d]=r(d).concat([p]),c}function a(d,p){return e[d]=r(d).filter(h=>h!==p),c}function u(){e={}}const c={init:n,emit:i,off:a,on:o,clear:u};return c}const pQ={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function gQ(e){function t(o,a){return Q2(o,a||{})}function n(o){const a=o.breakpoints||{},u=gd(a).filter(c=>e.matchMedia(c).matches).map(c=>a[c]).reduce((c,d)=>t(c,d),{});return t(o,u)}function r(o){return o.map(a=>gd(a.breakpoints||{})).reduce((a,u)=>a.concat(u),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function mQ(e){let t=[];function n(o,a){return t=a.filter(({options:u})=>e.optionsAtMedia(u).active!==!1),t.forEach(u=>u.init(o,e)),a.reduce((u,c)=>Object.assign(u,{[c.name]:c}),{})}function r(){t=t.filter(o=>o.destroy())}return{init:n,destroy:r}}function cm(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=gQ(i),a=mQ(o),u=md(),c=hQ(),{mergeOptions:d,optionsAtMedia:p,optionsMediaQueries:h}=o,{on:m,off:v,emit:_}=c,S=K;let x=!1,b,C=d(pQ,cm.globalOptions),k=d(C),A=[],I,$,B;function U(){const{container:je,slides:Se}=k;$=(Aw(je)?e.querySelector(je):je)||e.children[0];const Qe=Aw(Se)?$.querySelectorAll(Se):Se;B=[].slice.call(Qe||$.children)}function G(je){const Se=dQ(e,$,B,r,i,je,c);if(je.loop&&!Se.slideLooper.canLoop()){const Ye=Object.assign({},je,{loop:!1});return G(Ye)}return Se}function P(je,Se){x||(C=d(C,je),k=p(C),A=Se||A,U(),b=G(k),h([C,...A.map(({options:Ye})=>Ye)]).forEach(Ye=>u.add(Ye,"change",K)),k.active&&(b.translate.to(b.location.get()),b.animation.init(),b.slidesInView.init(),b.slideFocus.init(gt),b.eventHandler.init(gt),b.resizeHandler.init(gt),b.slidesHandler.init(gt),b.options.loop&&b.slideLooper.loop(),$.offsetParent&&B.length&&b.dragHandler.init(gt),I=a.init(gt,A)))}function K(je,Se){const Ye=X();re(),P(d({startIndex:Ye},je),Se),c.emit("reInit")}function re(){b.dragHandler.destroy(),b.eventStore.clear(),b.translate.clear(),b.slideLooper.clear(),b.resizeHandler.destroy(),b.slidesHandler.destroy(),b.slidesInView.destroy(),b.animation.destroy(),a.destroy(),u.clear()}function ue(){x||(x=!0,u.clear(),re(),c.emit("destroy"),c.clear())}function Z(je,Se,Ye){!k.active||x||(b.scrollBody.useBaseFriction().useDuration(Se===!0?0:k.duration),b.scrollTo.index(je,Ye||0))}function ie(je){const Se=b.index.add(1).get();Z(Se,je,-1)}function V(je){const Se=b.index.add(-1).get();Z(Se,je,1)}function Q(){return b.index.add(1).get()!==X()}function ye(){return b.index.add(-1).get()!==X()}function Te(){return b.scrollSnapList}function T(){return b.scrollProgress.get(b.offsetLocation.get())}function X(){return b.index.get()}function ve(){return b.indexPrevious.get()}function L(){return b.slidesInView.get()}function we(){return b.slidesInView.get(!1)}function Ue(){return I}function de(){return b}function tt(){return e}function Ze(){return $}function lt(){return B}const gt={canScrollNext:Q,canScrollPrev:ye,containerNode:Ze,internalEngine:de,destroy:ue,off:v,on:m,emit:_,plugins:Ue,previousScrollSnap:ve,reInit:S,rootNode:tt,scrollNext:ie,scrollPrev:V,scrollProgress:T,scrollSnapList:Te,scrollTo:Z,selectedScrollSnap:X,slideNodes:lt,slidesInView:L,slidesNotInView:we};return P(t,n),setTimeout(()=>c.emit("init"),0),gt}cm.globalOptions=void 0;function fm(e={},t=[]){const n=R.useRef(e),r=R.useRef(t),[i,o]=R.useState(),[a,u]=R.useState(),c=R.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return R.useEffect(()=>{Ew(n.current,e)||(n.current=e,c())},[e,c]),R.useEffect(()=>{FK(r.current,t)||(r.current=t,c())},[t,c]),R.useEffect(()=>{if(PK()&&a){cm.globalOptions=fm.globalOptions;const d=cm(a,n.current,r.current);return o(d),()=>d.destroy()}else o(void 0)},[a,o]),[u,i]}fm.globalOptions=void 0;const e3=e=>E.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[E.jsx("rect",{x:"24",y:"24.4456",width:"18",height:"18",rx:"12",transform:"rotate(180 24 24.4456)"}),E.jsx("path",{d:"M13.6531 6.52895L14.6146 7.49041L10.1594 11.9456L14.6146 16.4008L13.6531 17.3623L8.23647 11.9456L13.6531 6.52895Z",fill:e.uiData.callToActionFontColor})]}),t3=e=>E.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[E.jsx("rect",{y:"0.445618",width:"18",height:"18",rx:"12"}),E.jsx("path",{d:"M10.3469 18.3623L9.38544 17.4008L13.8406 12.9456L9.38544 8.49041L10.3469 7.52895L15.7636 12.9456L10.3469 18.3623Z",fill:e.uiData.callToActionFontColor})]}),dm=e=>E.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:E.jsx("path",{d:"M14.1666 14.0001C14.6087 14.0001 15.0326 14.1757 15.3452 14.4882C15.6577 14.8008 15.8333 15.2247 15.8333 15.6667C15.8333 16.1088 15.6577 16.5327 15.3452 16.8453C15.0326 17.1578 14.6087 17.3334 14.1666 17.3334C13.7246 17.3334 13.3007 17.1578 12.9881 16.8453C12.6756 16.5327 12.5 16.1088 12.5 15.6667C12.5 14.7417 13.2416 14.0001 14.1666 14.0001ZM0.833313 0.666748H3.55831L4.34165 2.33341H16.6666C16.8877 2.33341 17.0996 2.42121 17.2559 2.57749C17.4122 2.73377 17.5 2.94573 17.5 3.16675C17.5 3.30841 17.4583 3.45008 17.4 3.58341L14.4166 8.97508C14.1333 9.48341 13.5833 9.83341 12.9583 9.83341H6.74998L5.99998 11.1917L5.97498 11.2917C5.97498 11.347 5.99693 11.4 6.036 11.4391C6.07507 11.4781 6.12806 11.5001 6.18331 11.5001H15.8333V13.1667H5.83331C5.39128 13.1667 4.96736 12.9912 4.6548 12.6786C4.34224 12.366 4.16665 11.9421 4.16665 11.5001C4.16665 11.2084 4.24165 10.9334 4.36665 10.7001L5.49998 8.65841L2.49998 2.33341H0.833313V0.666748ZM5.83331 14.0001C6.27534 14.0001 6.69926 14.1757 7.01182 14.4882C7.32438 14.8008 7.49998 15.2247 7.49998 15.6667C7.49998 16.1088 7.32438 16.5327 7.01182 16.8453C6.69926 17.1578 6.27534 17.3334 5.83331 17.3334C5.39128 17.3334 4.96736 17.1578 4.6548 16.8453C4.34224 16.5327 4.16665 16.1088 4.16665 15.6667C4.16665 14.7417 4.90831 14.0001 5.83331 14.0001ZM13.3333 8.16675L15.65 4.00008H5.11665L7.08331 8.16675H13.3333Z"})}),vQ=()=>E.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:E.jsx("path",{d:"M3.44333 11.3794L11.4433 3.37939M11.4433 3.37939H5.44333M11.4433 3.37939V9.37939",stroke:"black",strokeWidth:"1.20922",strokeLinecap:"round",strokeLinejoin:"round"})}),hm=()=>E.jsx("svg",{width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:E.jsx("circle",{cx:"5.48933",cy:"5.57722",r:"5.33543",fill:"#32D583"})}),yQ=()=>E.jsx("svg",{width:"20",height:"20",viewBox:"0 0 21 21",xmlns:"http://www.w3.org/2000/svg",children:E.jsxs("g",{fill:"none","fill-rule":"evenodd",stroke:"#fff","stroke-linecap":"round","stroke-linejoin":"round",transform:"translate(2 3)",children:[E.jsx("path",{d:"m5.5.5h6c1.1045695 0 2 .8954305 2 2v10c0 1.1045695-.8954305 2-2 2h-6c-1.1045695 0-2-.8954305-2-2v-10c0-1.1045695.8954305-2 2-2zm8 2.5h1c1.1045695 0 2 .8954305 2 2v5c0 1.1045695-.8954305 2-2 2h-1z"}),E.jsx("path",{d:"m.5 3h1c1.1045695 0 2 .8954305 2 2v5c0 1.1045695-.8954305 2-2 2h-1z",transform:"matrix(-1 0 0 1 4 0)"})]})}),pm=e=>E.jsx("svg",{width:"24",height:"24",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:E.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.2548 10.4155C19.9448 7.23549 18.0648 2.23547 12.2548 2.23547C6.4448 2.23547 4.56478 7.23549 4.2548 10.4155C3.1673 10.8282 2.44997 11.8723 2.4548 13.0355V14.4355C2.4548 15.9819 3.70842 17.2355 5.25478 17.2355C6.80119 17.2355 8.05481 15.9818 8.05481 14.4355V13.0355C8.04975 11.8974 7.35881 10.8748 6.30478 10.4455C6.5048 8.60546 7.48481 4.23549 12.2548 4.23549C17.0248 4.23549 17.9948 8.60546 18.1948 10.4455C17.1429 10.8757 16.4555 11.899 16.4548 13.0355V14.4355C16.457 14.9623 16.6072 15.478 16.8883 15.9236C17.1695 16.3692 17.5702 16.7267 18.0448 16.9555C17.6248 17.7455 16.5548 18.8155 13.9248 19.1355C13.3991 18.3372 12.3819 18.0225 11.4972 18.3844C10.6125 18.7463 10.1076 19.6836 10.2921 20.6215C10.4766 21.5594 11.2989 22.2355 12.2548 22.2355C12.6252 22.2334 12.9877 22.1285 13.302 21.9326C13.6163 21.7366 13.87 21.4572 14.0348 21.1255C18.3248 20.6355 19.6948 18.4255 20.1248 17.1255C21.2881 16.7486 22.0705 15.6582 22.0548 14.4355V13.0355C22.0596 11.8723 21.3423 10.8282 20.2548 10.4155ZM6.0548 14.4355C6.0548 14.8773 5.69663 15.2355 5.25478 15.2355C4.81294 15.2355 4.45481 14.8773 4.45481 14.4355V13.0355C4.454 12.9299 4.4741 12.8252 4.51394 12.7274C4.55378 12.6297 4.61258 12.5408 4.68695 12.4658C4.76131 12.3909 4.84978 12.3314 4.94724 12.2908C5.0447 12.2502 5.14923 12.2293 5.2548 12.2293C5.36038 12.2293 5.46491 12.2502 5.56237 12.2908C5.65983 12.3314 5.7483 12.3909 5.82266 12.4658C5.89703 12.5408 5.95583 12.6297 5.99567 12.7274C6.03551 12.8252 6.05561 12.9299 6.0548 13.0355V14.4355ZM18.4548 13.0355C18.4548 12.5936 18.813 12.2355 19.2548 12.2355C19.6966 12.2355 20.0548 12.5936 20.0548 13.0355V14.4355C20.0548 14.8773 19.6966 15.2355 19.2548 15.2355C18.813 15.2355 18.4548 14.8773 18.4548 14.4355V13.0355Z",fill:e.color||"#000"})}),zu=e=>E.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:E.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:e.botNameColor||"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),_Q=z.div`
271
+ `,H3=(e,t)=>{const n=parseFloat(e.replace(/[^\d.]/g,""));let r=(t==null?void 0:t.money_format)||"${{amount}}";const i={amount:n.toFixed(2),amount_no_decimals:Math.round(n).toString(),amount_with_comma_separator:n.toFixed(2).replace(".",","),amount_no_decimals_with_comma_separator:Math.round(n).toString().replace(".",",")};for(const[o,a]of Object.entries(i)){const u=new RegExp(`\\{\\{\\s*${o}\\s*\\}\\}`);if(u.test(r)){r=r.replace(u,a);break}}return r},Cw=e=>{const t=e.replace(/[^0-9.]/g,"");return Math.round(parseFloat(t))||0},LK=e=>{const t=e.startsWith("http")?e:`https://${e}`,n=new URL(t);return`${n.protocol}//${n.hostname}/meta.json`},NK=async e=>{try{const t=e.startsWith("http")?e:`https://${e}`,n=new URL(t),r=qt(jt.SHOPIFY_META_DATA,{botId:window.DebalesChat.projectId}),i=sessionStorage.getItem(r+n.hostname);if(i)return JSON.parse(i);const o=LK(e),a=await fetch(o);if(!a.ok)throw new Error("Failed to fetch store meta");const u=await a.json(),c={currency:u.currency,money_format:u.money_format,name:u.name,domain:u.domain};return sessionStorage.setItem(r,JSON.stringify(c)),c}catch(t){return console.error("Error fetching store meta:",t),{currency:"USD",money_format:"${{amount}}",name:"",domain:e}}},sm=(e,t)=>{var n;return typeof window<"u"&&"Shopify"in window&&((n=window.Shopify)!=null&&n.locale)?Intl.NumberFormat(window.Shopify.locale,{style:"currency",currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(e):Intl.NumberFormat("en-US",{style:"currency",currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(e)},G3=R.createContext({}),lm=()=>{const e=R.useContext(G3);if(!e)throw new Error("useShadowDOM must be used within a ShadowDOMProvider");return e},V3=R.createContext(void 0),Fu=()=>{const e=R.useContext(V3);if(e===void 0)throw new Error("useDebales must be used within a DebalesProvider");return e};function BK(e){return Object.prototype.toString.call(e)==="[object Object]"}function Z3(e){return BK(e)||Array.isArray(e)}function PK(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Ew(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(a=>{const u=e[a],c=t[a];return typeof u=="function"?`${u}`==`${c}`:!Z3(u)||!Z3(c)?u===c:Ew(u,c)})}function Y3(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function FK(e,t){if(e.length!==t.length)return!1;const n=Y3(e),r=Y3(t);return n.every((i,o)=>{const a=r[o];return Ew(i,a)})}function kw(e){return typeof e=="number"}function Aw(e){return typeof e=="string"}function um(e){return typeof e=="boolean"}function W3(e){return Object.prototype.toString.call(e)==="[object Object]"}function zn(e){return Math.abs(e)}function Iw(e){return Math.sign(e)}function dd(e,t){return zn(e-t)}function zK(e,t){if(e===0||t===0||zn(e)<=zn(t))return 0;const n=dd(zn(e),zn(t));return zn(n/e)}function UK(e){return Math.round(e*100)/100}function hd(e){return gd(e).map(Number)}function bo(e){return e[pd(e)]}function pd(e){return Math.max(0,e.length-1)}function Tw(e,t){return t===pd(e)}function K3(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function gd(e){return Object.keys(e)}function Q3(e,t){return[e,t].reduce((n,r)=>(gd(r).forEach(i=>{const o=n[i],a=r[i],u=W3(o)&&W3(a);n[i]=u?Q3(o,a):a}),n),{})}function Mw(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function jK(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(c){return o(c)/2}function o(c){return t-c}function a(c,d){return Aw(e)?n[e](c):e(t,c,d)}return{measure:a}}function md(){let e=[];function t(i,o,a,u={passive:!0}){let c;if("addEventListener"in i)i.addEventListener(o,a,u),c=()=>i.removeEventListener(o,a,u);else{const d=i;d.addListener(a),c=()=>d.removeListener(a)}return e.push(c),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function qK(e,t,n,r){const i=md(),o=1e3/60;let a=null,u=0,c=0;function d(){i.add(e,"visibilitychange",()=>{e.hidden&&_()})}function p(){v(),i.clear()}function h(x){if(!c)return;a||(a=x,n(),n());const b=x-a;for(a=x,u+=b;u>=o;)n(),u-=o;const C=u/o;r(C),c&&(c=t.requestAnimationFrame(h))}function m(){c||(c=t.requestAnimationFrame(h))}function v(){t.cancelAnimationFrame(c),a=null,u=0,c=0}function _(){a=null,u=0}return{init:d,destroy:p,start:m,stop:v,update:n,render:r}}function HK(e,t){const n=t==="rtl",r=e==="y",i=r?"y":"x",o=r?"x":"y",a=!r&&n?-1:1,u=p(),c=h();function d(_){const{height:S,width:x}=_;return r?S:x}function p(){return r?"top":n?"right":"left"}function h(){return r?"bottom":n?"left":"right"}function m(_){return _*a}return{scroll:i,cross:o,startEdge:u,endEdge:c,measureSize:d,direction:m}}function dl(e=0,t=0){const n=zn(e-t);function r(d){return d<e}function i(d){return d>t}function o(d){return r(d)||i(d)}function a(d){return o(d)?r(d)?e:t:d}function u(d){return n?d-n*Math.ceil((d-t)/n):d}return{length:n,max:t,min:e,constrain:a,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:u}}function X3(e,t,n){const{constrain:r}=dl(0,e),i=e+1;let o=a(t);function a(m){return n?zn((i+m)%i):r(m)}function u(){return o}function c(m){return o=a(m),h}function d(m){return p().set(u()+m)}function p(){return X3(e,u(),n)}const h={get:u,set:c,add:d,clone:p};return h}function GK(e,t,n,r,i,o,a,u,c,d,p,h,m,v,_,S,x,b,C){const{cross:k,direction:A}=e,I=["INPUT","SELECT","TEXTAREA"],$={passive:!1},B=md(),U=md(),G=dl(50,225).constrain(v.measure(20)),P={mouse:300,touch:400},K={mouse:500,touch:600},re=_?43:25;let ue=!1,Z=0,ie=0,V=!1,Q=!1,ye=!1,Te=!1;function T(Se){if(!C)return;function Ye(ot){(um(C)||C(Se,ot))&&de(ot)}const Qe=t;B.add(Qe,"dragstart",ot=>ot.preventDefault(),$).add(Qe,"touchmove",()=>{},$).add(Qe,"touchend",()=>{}).add(Qe,"touchstart",Ye).add(Qe,"mousedown",Ye).add(Qe,"touchcancel",Ze).add(Qe,"contextmenu",Ze).add(Qe,"click",lt,!0)}function X(){B.clear(),U.clear()}function ve(){const Se=Te?n:t;U.add(Se,"touchmove",tt,$).add(Se,"touchend",Ze).add(Se,"mousemove",tt,$).add(Se,"mouseup",Ze)}function L(Se){const Ye=Se.nodeName||"";return I.includes(Ye)}function we(){return(_?K:P)[Te?"mouse":"touch"]}function Ue(Se,Ye){const Qe=h.add(Iw(Se)*-1),ot=p.byDistance(Se,!_).distance;return _||zn(Se)<G?ot:x&&Ye?ot*.5:p.byIndex(Qe.get(),0).distance}function de(Se){const Ye=Mw(Se,r);Te=Ye,ye=_&&Ye&&!Se.buttons&&ue,ue=dd(i.get(),a.get())>=2,!(Ye&&Se.button!==0)&&(L(Se.target)||(V=!0,o.pointerDown(Se),d.useFriction(0).useDuration(0),i.set(a),ve(),Z=o.readPoint(Se),ie=o.readPoint(Se,k),m.emit("pointerDown")))}function tt(Se){if(!Mw(Se,r)&&Se.touches.length>=2)return Ze(Se);const Qe=o.readPoint(Se),ot=o.readPoint(Se,k),et=dd(Qe,Z),He=dd(ot,ie);if(!Q&&!Te&&(!Se.cancelable||(Q=et>He,!Q)))return Ze(Se);const N=o.pointerMove(Se);et>S&&(ye=!0),d.useFriction(.3).useDuration(.75),u.start(),i.add(A(N)),Se.preventDefault()}function Ze(Se){const Qe=p.byDistance(0,!1).index!==h.get(),ot=o.pointerUp(Se)*we(),et=Ue(A(ot),Qe),He=zK(ot,et),N=re-10*He,F=b+He/50;Q=!1,V=!1,U.clear(),d.useDuration(N).useFriction(F),c.distance(et,!_),Te=!1,m.emit("pointerUp")}function lt(Se){ye&&(Se.stopPropagation(),Se.preventDefault(),ye=!1)}function gt(){return V}return{init:T,destroy:X,pointerDown:gt}}function VK(e,t){let r,i;function o(h){return h.timeStamp}function a(h,m){const _=`client${(m||e.scroll)==="x"?"X":"Y"}`;return(Mw(h,t)?h:h.touches[0])[_]}function u(h){return r=h,i=h,a(h)}function c(h){const m=a(h)-a(i),v=o(h)-o(r)>170;return i=h,v&&(r=h),m}function d(h){if(!r||!i)return 0;const m=a(i)-a(r),v=o(h)-o(r),_=o(h)-o(i)>170,S=m/v;return v&&!_&&zn(S)>.1?S:0}return{pointerDown:u,pointerMove:c,pointerUp:d,readPoint:a}}function ZK(){function e(n){const{offsetTop:r,offsetLeft:i,offsetWidth:o,offsetHeight:a}=n;return{top:r,right:i+o,bottom:r+a,left:i,width:o,height:a}}return{measure:e}}function YK(e){function t(r){return e*(r/100)}return{measure:t}}function WK(e,t,n,r,i,o,a){const u=[e].concat(r);let c,d,p=[],h=!1;function m(x){return i.measureSize(a.measure(x))}function v(x){if(!o)return;d=m(e),p=r.map(m);function b(C){for(const k of C){if(h)return;const A=k.target===e,I=r.indexOf(k.target),$=A?d:p[I],B=m(A?e:r[I]);if(zn(B-$)>=.5){x.reInit(),t.emit("resize");break}}}c=new ResizeObserver(C=>{(um(o)||o(x,C))&&b(C)}),n.requestAnimationFrame(()=>{u.forEach(C=>c.observe(C))})}function _(){h=!0,c&&c.disconnect()}return{init:v,destroy:_}}function KK(e,t,n,r,i,o){let a=0,u=0,c=i,d=o,p=e.get(),h=0;function m(){const $=r.get()-e.get(),B=!c;let U=0;return B?(a=0,n.set(r),e.set(r),U=$):(n.set(e),a+=$/c,a*=d,p+=a,e.add(a),U=p-h),u=Iw(U),h=p,I}function v(){const $=r.get()-t.get();return zn($)<.001}function _(){return c}function S(){return u}function x(){return a}function b(){return k(i)}function C(){return A(o)}function k($){return c=$,I}function A($){return d=$,I}const I={direction:S,duration:_,velocity:x,seek:m,settled:v,useBaseFriction:C,useBaseDuration:b,useFriction:A,useDuration:k};return I}function QK(e,t,n,r,i){const o=i.measure(10),a=i.measure(50),u=dl(.1,.99);let c=!1;function d(){return!(c||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function p(v){if(!d())return;const _=e.reachedMin(t.get())?"min":"max",S=zn(e[_]-t.get()),x=n.get()-t.get(),b=u.constrain(S/a);n.subtract(x*b),!v&&zn(x)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function h(v){c=!v}return{shouldConstrain:d,constrain:p,toggleActive:h}}function XK(e,t,n,r,i){const o=dl(-t+e,0),a=h(),u=p(),c=m();function d(_,S){return dd(_,S)<=1}function p(){const _=a[0],S=bo(a),x=a.lastIndexOf(_),b=a.indexOf(S)+1;return dl(x,b)}function h(){return n.map((_,S)=>{const{min:x,max:b}=o,C=o.constrain(_),k=!S,A=Tw(n,S);return k?b:A||d(x,C)?x:d(b,C)?b:C}).map(_=>parseFloat(_.toFixed(3)))}function m(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return a;const{min:_,max:S}=u;return a.slice(_,S)}return{snapsContained:c,scrollContainLimit:u}}function JK(e,t,n){const r=t[0],i=n?r-e:bo(t);return{limit:dl(i,r)}}function eQ(e,t,n,r){const o=t.min+.1,a=t.max+.1,{reachedMin:u,reachedMax:c}=dl(o,a);function d(m){return m===1?c(n.get()):m===-1?u(n.get()):!1}function p(m){if(!d(m))return;const v=e*(m*-1);r.forEach(_=>_.add(v))}return{loop:p}}function tQ(e){const{max:t,length:n}=e;function r(o){const a=o-t;return n?a/-n:0}return{get:r}}function nQ(e,t,n,r,i){const{startEdge:o,endEdge:a}=e,{groupSlides:u}=i,c=h().map(t.measure),d=m(),p=v();function h(){return u(r).map(S=>bo(S)[a]-S[0][o]).map(zn)}function m(){return r.map(S=>n[o]-S[o]).map(S=>-zn(S))}function v(){return u(d).map(S=>S[0]).map((S,x)=>S+c[x])}return{snaps:d,snapsAligned:p}}function rQ(e,t,n,r,i,o){const{groupSlides:a}=i,{min:u,max:c}=r,d=p();function p(){const m=a(o),v=!e||t==="keepSnaps";return n.length===1?[o]:v?m:m.slice(u,c).map((_,S,x)=>{const b=!S,C=Tw(x,S);if(b){const k=bo(x[0])+1;return K3(k)}if(C){const k=pd(o)-bo(x)[0]+1;return K3(k,bo(x)[0])}return _})}return{slideRegistry:d}}function iQ(e,t,n,r,i){const{reachedAny:o,removeOffset:a,constrain:u}=r;function c(_){return _.concat().sort((S,x)=>zn(S)-zn(x))[0]}function d(_){const S=e?a(_):u(_),x=t.map((C,k)=>({diff:p(C-S,0),index:k})).sort((C,k)=>zn(C.diff)-zn(k.diff)),{index:b}=x[0];return{index:b,distance:S}}function p(_,S){const x=[_,_+n,_-n];if(!e)return _;if(!S)return c(x);const b=x.filter(C=>Iw(C)===S);return b.length?c(b):bo(x)-n}function h(_,S){const x=t[_]-i.get(),b=p(x,S);return{index:_,distance:b}}function m(_,S){const x=i.get()+_,{index:b,distance:C}=d(x),k=!e&&o(x);if(!S||k)return{index:b,distance:_};const A=t[b]-C,I=_+p(A,0);return{index:b,distance:I}}return{byDistance:m,byIndex:h,shortcut:p}}function oQ(e,t,n,r,i,o,a){function u(h){const m=h.distance,v=h.index!==t.get();o.add(m),m&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),v&&(n.set(t.get()),t.set(h.index),a.emit("select"))}function c(h,m){const v=i.byDistance(h,m);u(v)}function d(h,m){const v=t.clone().set(h),_=i.byIndex(v.get(),m);u(_)}return{distance:c,index:d}}function aQ(e,t,n,r,i,o,a,u){const c={passive:!0,capture:!0};let d=0;function p(v){if(!u)return;function _(S){if(new Date().getTime()-d>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const C=n.findIndex(k=>k.includes(S));kw(C)&&(i.useDuration(0),r.index(C,0),a.emit("slideFocus"))}o.add(document,"keydown",h,!1),t.forEach((S,x)=>{o.add(S,"focus",b=>{(um(u)||u(v,b))&&_(x)},c)})}function h(v){v.code==="Tab"&&(d=new Date().getTime())}return{init:p}}function vd(e){let t=e;function n(){return t}function r(c){t=a(c)}function i(c){t+=a(c)}function o(c){t-=a(c)}function a(c){return kw(c)?c:c.get()}return{get:n,set:r,add:i,subtract:o}}function J3(e,t){const n=e.scroll==="x"?a:u,r=t.style;let i=null,o=!1;function a(m){return`translate3d(${m}px,0px,0px)`}function u(m){return`translate3d(0px,${m}px,0px)`}function c(m){if(o)return;const v=UK(e.direction(m));v!==i&&(r.transform=n(v),i=v)}function d(m){o=!m}function p(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:p,to:c,toggleActive:d}}function sQ(e,t,n,r,i,o,a,u,c){const p=hd(i),h=hd(i).reverse(),m=b().concat(C());function v(B,U){return B.reduce((G,P)=>G-i[P],U)}function _(B,U){return B.reduce((G,P)=>v(G,U)>0?G.concat([P]):G,[])}function S(B){return o.map((U,G)=>({start:U-r[G]+.5+B,end:U+t-.5+B}))}function x(B,U,G){const P=S(U);return B.map(K=>{const re=G?0:-n,ue=G?n:0,Z=G?"end":"start",ie=P[K][Z];return{index:K,loopPoint:ie,slideLocation:vd(-1),translate:J3(e,c[K]),target:()=>u.get()>ie?re:ue}})}function b(){const B=a[0],U=_(h,B);return x(U,n,!1)}function C(){const B=t-a[0]-1,U=_(p,B);return x(U,-n,!0)}function k(){return m.every(({index:B})=>{const U=p.filter(G=>G!==B);return v(U,t)<=.1})}function A(){m.forEach(B=>{const{target:U,translate:G,slideLocation:P}=B,K=U();K!==P.get()&&(G.to(K),P.set(K))})}function I(){m.forEach(B=>B.translate.clear())}return{canLoop:k,clear:I,loop:A,loopPoints:m}}function lQ(e,t,n){let r,i=!1;function o(c){if(!n)return;function d(p){for(const h of p)if(h.type==="childList"){c.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(p=>{i||(um(n)||n(c,p))&&d(p)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),i=!0}return{init:o,destroy:a}}function uQ(e,t,n,r){const i={};let o=null,a=null,u,c=!1;function d(){u=new IntersectionObserver(_=>{c||(_.forEach(S=>{const x=t.indexOf(S.target);i[x]=S}),o=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(_=>u.observe(_))}function p(){u&&u.disconnect(),c=!0}function h(_){return gd(i).reduce((S,x)=>{const b=parseInt(x),{isIntersecting:C}=i[b];return(_&&C||!_&&!C)&&S.push(b),S},[])}function m(_=!0){if(_&&o)return o;if(!_&&a)return a;const S=h(_);return _&&(o=S),_||(a=S),S}return{init:d,destroy:p,get:m}}function cQ(e,t,n,r,i,o){const{measureSize:a,startEdge:u,endEdge:c}=e,d=n[0]&&i,p=_(),h=S(),m=n.map(a),v=x();function _(){if(!d)return 0;const C=n[0];return zn(t[u]-C[u])}function S(){if(!d)return 0;const C=o.getComputedStyle(bo(r));return parseFloat(C.getPropertyValue(`margin-${c}`))}function x(){return n.map((C,k,A)=>{const I=!k,$=Tw(A,k);return I?m[k]+p:$?m[k]+h:A[k+1][u]-C[u]}).map(zn)}return{slideSizes:m,slideSizesWithGaps:v,startGap:p,endGap:h}}function fQ(e,t,n,r,i,o,a,u,c){const{startEdge:d,endEdge:p,direction:h}=e,m=kw(n);function v(b,C){return hd(b).filter(k=>k%C===0).map(k=>b.slice(k,k+C))}function _(b){return b.length?hd(b).reduce((C,k,A)=>{const I=bo(C)||0,$=I===0,B=k===pd(b),U=i[d]-o[I][d],G=i[d]-o[k][p],P=!r&&$?h(a):0,K=!r&&B?h(u):0,re=zn(G-K-(U+P));return A&&re>t+c&&C.push(k),B&&C.push(b.length),C},[]).map((C,k,A)=>{const I=Math.max(A[k-1]||0);return b.slice(I,C)}):[]}function S(b){return m?v(b,n):_(b)}return{groupSlides:S}}function dQ(e,t,n,r,i,o,a){const{align:u,axis:c,direction:d,startIndex:p,loop:h,duration:m,dragFree:v,dragThreshold:_,inViewThreshold:S,slidesToScroll:x,skipSnaps:b,containScroll:C,watchResize:k,watchSlides:A,watchDrag:I,watchFocus:$}=o,B=2,U=ZK(),G=U.measure(t),P=n.map(U.measure),K=HK(c,d),re=K.measureSize(G),ue=YK(re),Z=jK(u,re),ie=!h&&!!C,V=h||!!C,{slideSizes:Q,slideSizesWithGaps:ye,startGap:Te,endGap:T}=cQ(K,G,P,n,V,i),X=fQ(K,re,x,h,G,P,Te,T,B),{snaps:ve,snapsAligned:L}=nQ(K,Z,G,P,X),we=-bo(ve)+bo(ye),{snapsContained:Ue,scrollContainLimit:de}=XK(re,we,L,C,B),tt=ie?Ue:L,{limit:Ze}=JK(we,tt,h),lt=X3(pd(tt),p,h),gt=lt.clone(),je=hd(n),Se=({dragHandler:at,scrollBody:Tt,scrollBounds:Bt,options:{loop:Et}})=>{Et||Bt.constrain(at.pointerDown()),Tt.seek()},Ye=({scrollBody:at,translate:Tt,location:Bt,offsetLocation:Et,previousLocation:Yt,scrollLooper:ft,slideLooper:wt,dragHandler:Je,animation:yt,eventHandler:Yn,scrollBounds:pr,options:{loop:Wn}},Pn)=>{const Fr=at.settled(),pi=!pr.shouldConstrain(),oi=Wn?Fr:Fr&&pi,Ar=oi&&!Je.pointerDown();Ar&&yt.stop();const zr=Bt.get()*Pn+Yt.get()*(1-Pn);Et.set(zr),Wn&&(ft.loop(at.direction()),wt.loop()),Tt.to(Et.get()),Ar&&Yn.emit("settle"),oi||Yn.emit("scroll")},Qe=qK(r,i,()=>Se(Xe),at=>Ye(Xe,at)),ot=.68,et=tt[lt.get()],He=vd(et),N=vd(et),F=vd(et),Y=vd(et),ge=KK(He,F,N,Y,m,ot),_e=iQ(h,tt,we,Ze,Y),Ie=oQ(Qe,lt,gt,ge,_e,Y,a),We=tQ(Ze),nt=md(),ne=uQ(t,n,a,S),{slideRegistry:me}=rQ(ie,C,tt,de,X,je),qe=aQ(e,n,me,Ie,ge,nt,a,$),Xe={ownerDocument:r,ownerWindow:i,eventHandler:a,containerRect:G,slideRects:P,animation:Qe,axis:K,dragHandler:GK(K,e,r,i,Y,VK(K,i),He,Qe,Ie,ge,_e,lt,a,ue,v,_,b,ot,I),eventStore:nt,percentOfView:ue,index:lt,indexPrevious:gt,limit:Ze,location:He,offsetLocation:F,previousLocation:N,options:o,resizeHandler:WK(t,a,i,n,K,k,U),scrollBody:ge,scrollBounds:QK(Ze,F,Y,ge,ue),scrollLooper:eQ(we,Ze,F,[He,F,N,Y]),scrollProgress:We,scrollSnapList:tt.map(We.get),scrollSnaps:tt,scrollTarget:_e,scrollTo:Ie,slideLooper:sQ(K,re,we,Q,ye,ve,tt,F,n),slideFocus:qe,slidesHandler:lQ(t,a,A),slidesInView:ne,slideIndexes:je,slideRegistry:me,slidesToScroll:X,target:Y,translate:J3(K,t)};return Xe}function hQ(){let e={},t;function n(d){t=d}function r(d){return e[d]||[]}function i(d){return r(d).forEach(p=>p(t,d)),c}function o(d,p){return e[d]=r(d).concat([p]),c}function a(d,p){return e[d]=r(d).filter(h=>h!==p),c}function u(){e={}}const c={init:n,emit:i,off:a,on:o,clear:u};return c}const pQ={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function gQ(e){function t(o,a){return Q3(o,a||{})}function n(o){const a=o.breakpoints||{},u=gd(a).filter(c=>e.matchMedia(c).matches).map(c=>a[c]).reduce((c,d)=>t(c,d),{});return t(o,u)}function r(o){return o.map(a=>gd(a.breakpoints||{})).reduce((a,u)=>a.concat(u),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function mQ(e){let t=[];function n(o,a){return t=a.filter(({options:u})=>e.optionsAtMedia(u).active!==!1),t.forEach(u=>u.init(o,e)),a.reduce((u,c)=>Object.assign(u,{[c.name]:c}),{})}function r(){t=t.filter(o=>o.destroy())}return{init:n,destroy:r}}function cm(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=gQ(i),a=mQ(o),u=md(),c=hQ(),{mergeOptions:d,optionsAtMedia:p,optionsMediaQueries:h}=o,{on:m,off:v,emit:_}=c,S=K;let x=!1,b,C=d(pQ,cm.globalOptions),k=d(C),A=[],I,$,B;function U(){const{container:je,slides:Se}=k;$=(Aw(je)?e.querySelector(je):je)||e.children[0];const Qe=Aw(Se)?$.querySelectorAll(Se):Se;B=[].slice.call(Qe||$.children)}function G(je){const Se=dQ(e,$,B,r,i,je,c);if(je.loop&&!Se.slideLooper.canLoop()){const Ye=Object.assign({},je,{loop:!1});return G(Ye)}return Se}function P(je,Se){x||(C=d(C,je),k=p(C),A=Se||A,U(),b=G(k),h([C,...A.map(({options:Ye})=>Ye)]).forEach(Ye=>u.add(Ye,"change",K)),k.active&&(b.translate.to(b.location.get()),b.animation.init(),b.slidesInView.init(),b.slideFocus.init(gt),b.eventHandler.init(gt),b.resizeHandler.init(gt),b.slidesHandler.init(gt),b.options.loop&&b.slideLooper.loop(),$.offsetParent&&B.length&&b.dragHandler.init(gt),I=a.init(gt,A)))}function K(je,Se){const Ye=X();re(),P(d({startIndex:Ye},je),Se),c.emit("reInit")}function re(){b.dragHandler.destroy(),b.eventStore.clear(),b.translate.clear(),b.slideLooper.clear(),b.resizeHandler.destroy(),b.slidesHandler.destroy(),b.slidesInView.destroy(),b.animation.destroy(),a.destroy(),u.clear()}function ue(){x||(x=!0,u.clear(),re(),c.emit("destroy"),c.clear())}function Z(je,Se,Ye){!k.active||x||(b.scrollBody.useBaseFriction().useDuration(Se===!0?0:k.duration),b.scrollTo.index(je,Ye||0))}function ie(je){const Se=b.index.add(1).get();Z(Se,je,-1)}function V(je){const Se=b.index.add(-1).get();Z(Se,je,1)}function Q(){return b.index.add(1).get()!==X()}function ye(){return b.index.add(-1).get()!==X()}function Te(){return b.scrollSnapList}function T(){return b.scrollProgress.get(b.offsetLocation.get())}function X(){return b.index.get()}function ve(){return b.indexPrevious.get()}function L(){return b.slidesInView.get()}function we(){return b.slidesInView.get(!1)}function Ue(){return I}function de(){return b}function tt(){return e}function Ze(){return $}function lt(){return B}const gt={canScrollNext:Q,canScrollPrev:ye,containerNode:Ze,internalEngine:de,destroy:ue,off:v,on:m,emit:_,plugins:Ue,previousScrollSnap:ve,reInit:S,rootNode:tt,scrollNext:ie,scrollPrev:V,scrollProgress:T,scrollSnapList:Te,scrollTo:Z,selectedScrollSnap:X,slideNodes:lt,slidesInView:L,slidesNotInView:we};return P(t,n),setTimeout(()=>c.emit("init"),0),gt}cm.globalOptions=void 0;function fm(e={},t=[]){const n=R.useRef(e),r=R.useRef(t),[i,o]=R.useState(),[a,u]=R.useState(),c=R.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return R.useEffect(()=>{Ew(n.current,e)||(n.current=e,c())},[e,c]),R.useEffect(()=>{FK(r.current,t)||(r.current=t,c())},[t,c]),R.useEffect(()=>{if(PK()&&a){cm.globalOptions=fm.globalOptions;const d=cm(a,n.current,r.current);return o(d),()=>d.destroy()}else o(void 0)},[a,o]),[u,i]}fm.globalOptions=void 0;const e2=e=>E.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[E.jsx("rect",{x:"24",y:"24.4456",width:"18",height:"18",rx:"12",transform:"rotate(180 24 24.4456)"}),E.jsx("path",{d:"M13.6531 6.52895L14.6146 7.49041L10.1594 11.9456L14.6146 16.4008L13.6531 17.3623L8.23647 11.9456L13.6531 6.52895Z",fill:e.uiData.callToActionFontColor})]}),t2=e=>E.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[E.jsx("rect",{y:"0.445618",width:"18",height:"18",rx:"12"}),E.jsx("path",{d:"M10.3469 18.3623L9.38544 17.4008L13.8406 12.9456L9.38544 8.49041L10.3469 7.52895L15.7636 12.9456L10.3469 18.3623Z",fill:e.uiData.callToActionFontColor})]}),dm=e=>E.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:E.jsx("path",{d:"M14.1666 14.0001C14.6087 14.0001 15.0326 14.1757 15.3452 14.4882C15.6577 14.8008 15.8333 15.2247 15.8333 15.6667C15.8333 16.1088 15.6577 16.5327 15.3452 16.8453C15.0326 17.1578 14.6087 17.3334 14.1666 17.3334C13.7246 17.3334 13.3007 17.1578 12.9881 16.8453C12.6756 16.5327 12.5 16.1088 12.5 15.6667C12.5 14.7417 13.2416 14.0001 14.1666 14.0001ZM0.833313 0.666748H3.55831L4.34165 2.33341H16.6666C16.8877 2.33341 17.0996 2.42121 17.2559 2.57749C17.4122 2.73377 17.5 2.94573 17.5 3.16675C17.5 3.30841 17.4583 3.45008 17.4 3.58341L14.4166 8.97508C14.1333 9.48341 13.5833 9.83341 12.9583 9.83341H6.74998L5.99998 11.1917L5.97498 11.2917C5.97498 11.347 5.99693 11.4 6.036 11.4391C6.07507 11.4781 6.12806 11.5001 6.18331 11.5001H15.8333V13.1667H5.83331C5.39128 13.1667 4.96736 12.9912 4.6548 12.6786C4.34224 12.366 4.16665 11.9421 4.16665 11.5001C4.16665 11.2084 4.24165 10.9334 4.36665 10.7001L5.49998 8.65841L2.49998 2.33341H0.833313V0.666748ZM5.83331 14.0001C6.27534 14.0001 6.69926 14.1757 7.01182 14.4882C7.32438 14.8008 7.49998 15.2247 7.49998 15.6667C7.49998 16.1088 7.32438 16.5327 7.01182 16.8453C6.69926 17.1578 6.27534 17.3334 5.83331 17.3334C5.39128 17.3334 4.96736 17.1578 4.6548 16.8453C4.34224 16.5327 4.16665 16.1088 4.16665 15.6667C4.16665 14.7417 4.90831 14.0001 5.83331 14.0001ZM13.3333 8.16675L15.65 4.00008H5.11665L7.08331 8.16675H13.3333Z"})}),vQ=()=>E.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:E.jsx("path",{d:"M3.44333 11.3794L11.4433 3.37939M11.4433 3.37939H5.44333M11.4433 3.37939V9.37939",stroke:"black",strokeWidth:"1.20922",strokeLinecap:"round",strokeLinejoin:"round"})}),hm=()=>E.jsx("svg",{width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:E.jsx("circle",{cx:"5.48933",cy:"5.57722",r:"5.33543",fill:"#32D583"})}),yQ=()=>E.jsx("svg",{width:"20",height:"20",viewBox:"0 0 21 21",xmlns:"http://www.w3.org/2000/svg",children:E.jsxs("g",{fill:"none","fill-rule":"evenodd",stroke:"#fff","stroke-linecap":"round","stroke-linejoin":"round",transform:"translate(2 3)",children:[E.jsx("path",{d:"m5.5.5h6c1.1045695 0 2 .8954305 2 2v10c0 1.1045695-.8954305 2-2 2h-6c-1.1045695 0-2-.8954305-2-2v-10c0-1.1045695.8954305-2 2-2zm8 2.5h1c1.1045695 0 2 .8954305 2 2v5c0 1.1045695-.8954305 2-2 2h-1z"}),E.jsx("path",{d:"m.5 3h1c1.1045695 0 2 .8954305 2 2v5c0 1.1045695-.8954305 2-2 2h-1z",transform:"matrix(-1 0 0 1 4 0)"})]})}),pm=e=>E.jsx("svg",{width:"24",height:"24",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:E.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.2548 10.4155C19.9448 7.23549 18.0648 2.23547 12.2548 2.23547C6.4448 2.23547 4.56478 7.23549 4.2548 10.4155C3.1673 10.8282 2.44997 11.8723 2.4548 13.0355V14.4355C2.4548 15.9819 3.70842 17.2355 5.25478 17.2355C6.80119 17.2355 8.05481 15.9818 8.05481 14.4355V13.0355C8.04975 11.8974 7.35881 10.8748 6.30478 10.4455C6.5048 8.60546 7.48481 4.23549 12.2548 4.23549C17.0248 4.23549 17.9948 8.60546 18.1948 10.4455C17.1429 10.8757 16.4555 11.899 16.4548 13.0355V14.4355C16.457 14.9623 16.6072 15.478 16.8883 15.9236C17.1695 16.3692 17.5702 16.7267 18.0448 16.9555C17.6248 17.7455 16.5548 18.8155 13.9248 19.1355C13.3991 18.3372 12.3819 18.0225 11.4972 18.3844C10.6125 18.7463 10.1076 19.6836 10.2921 20.6215C10.4766 21.5594 11.2989 22.2355 12.2548 22.2355C12.6252 22.2334 12.9877 22.1285 13.302 21.9326C13.6163 21.7366 13.87 21.4572 14.0348 21.1255C18.3248 20.6355 19.6948 18.4255 20.1248 17.1255C21.2881 16.7486 22.0705 15.6582 22.0548 14.4355V13.0355C22.0596 11.8723 21.3423 10.8282 20.2548 10.4155ZM6.0548 14.4355C6.0548 14.8773 5.69663 15.2355 5.25478 15.2355C4.81294 15.2355 4.45481 14.8773 4.45481 14.4355V13.0355C4.454 12.9299 4.4741 12.8252 4.51394 12.7274C4.55378 12.6297 4.61258 12.5408 4.68695 12.4658C4.76131 12.3909 4.84978 12.3314 4.94724 12.2908C5.0447 12.2502 5.14923 12.2293 5.2548 12.2293C5.36038 12.2293 5.46491 12.2502 5.56237 12.2908C5.65983 12.3314 5.7483 12.3909 5.82266 12.4658C5.89703 12.5408 5.95583 12.6297 5.99567 12.7274C6.03551 12.8252 6.05561 12.9299 6.0548 13.0355V14.4355ZM18.4548 13.0355C18.4548 12.5936 18.813 12.2355 19.2548 12.2355C19.6966 12.2355 20.0548 12.5936 20.0548 13.0355V14.4355C20.0548 14.8773 19.6966 15.2355 19.2548 15.2355C18.813 15.2355 18.4548 14.8773 18.4548 14.4355V13.0355Z",fill:e.color||"#000"})}),zu=e=>E.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:E.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:e.botNameColor||"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),_Q=z.div`
272
272
  position: relative;
273
273
  width: 100%;
274
274
  margin: 0;
@@ -345,7 +345,7 @@ or you can use record.mirror to access the mirror instance during recording.`,qR
345
345
  cursor: ${e=>e.$disabled?"default":"pointer"};
346
346
  border: 1px solid rgba(0, 0, 0, 0.1);
347
347
  overflow: hidden;
348
- `,n3=z.button`
348
+ `,n2=z.button`
349
349
  position: absolute;
350
350
  top: 50%;
351
351
  transform: translateY(-50%);
@@ -370,21 +370,21 @@ or you can use record.mirror to access the mirror instance during recording.`,qR
370
370
  opacity: 0.5;
371
371
  cursor: default;
372
372
  }
373
- `,AQ=z(n3)`
373
+ `,AQ=z(n2)`
374
374
  left: 5px;
375
375
 
376
376
  @media (max-width: 768px) {
377
377
  left: 10px;
378
378
  z-index: 110; /* Ensure it's above other elements */
379
379
  }
380
- `,IQ=z(n3)`
380
+ `,IQ=z(n2)`
381
381
  right: 5px;
382
382
 
383
383
  @media (max-width: 768px) {
384
384
  right: 10px;
385
385
  z-index: 110; /* Ensure it's above other elements */
386
386
  }
387
- `,gm=({message:e,uidata:t,onSendMessage:n,loading:r})=>{const[i,o]=fm({align:"center",containScroll:"trimSnaps",dragFree:!0}),[a,u]=R.useState(!1),[c,d]=R.useState(!0),[p,h]=R.useState(0),m=R.useRef([]),v=R.useRef(null),_=R.useCallback(()=>o&&o.scrollPrev(),[o]),S=R.useCallback(()=>o&&o.scrollNext(),[o]),x=R.useCallback(()=>{o&&(u(o.canScrollPrev()),d(o.canScrollNext()),h(o.selectedScrollSnap()))},[o]),b=R.useCallback(C=>{C.forEach(k=>{k.isIntersecting?m.current.forEach((A,I)=>{A&&(I===p?A.play():A.pause())}):m.current.forEach(A=>{A&&A.pause()})})},[p]);return R.useEffect(()=>{if(o)return o.on("select",x),x(),()=>{o.off("select",x)}},[o,x]),R.useEffect(()=>{if(!v.current)return;const C=new IntersectionObserver(b,{root:null,rootMargin:"0px",threshold:.6}),k=v.current;return C.observe(k),()=>{C.unobserve(k)}},[b]),!e.collections||e.collections.length<1?null:E.jsxs(_Q,{ref:v,children:[E.jsx(bQ,{ref:i,children:E.jsx(xQ,{children:e.collections.map((C,k)=>E.jsx(wQ,{children:E.jsxs(kQ,{$disabled:r,onClick:()=>{r||n("I'd like to explore "+C.name+" collection")},children:[E.jsx(SQ,{children:C!=null&&C.image&&(C.image.endsWith(".mp4")||C.image.endsWith(".webm"))?E.jsx("video",{ref:A=>{m.current[k]=A},style:{width:"100%",height:"auto",objectFit:"cover",aspectRatio:"1/1",margin:"0"},muted:!0,loop:!0,onClick:()=>{window.DebalesChat.track(mt.COLLECTION_VIDEO_CLICKED,{collectionName:C.name,message:e.conversationId})},src:C.image}):E.jsx("img",{style:{width:"100%",height:"auto",objectFit:"cover",aspectRatio:"1/1",margin:"0"},onClick:()=>{window.DebalesChat.track(mt.COLLECTION_IMAGE_CLICKED,{collectionName:C.name,message:e.conversationId})},src:C.image,alt:"Collection Image Not Available"})}),E.jsx(CQ,{children:E.jsx(EQ,{title:C.name,children:C.name})})]})},k))})}),e.collections&&e.collections.length>1&&E.jsxs(E.Fragment,{children:[E.jsx(AQ,{onClick:_,disabled:!a,style:{backgroundColor:t.callToActionBackgroundColor||"#F48722",color:t.callToActionFontColor||"#ffffff"},children:E.jsx(e3,{uiData:t})}),E.jsx(IQ,{onClick:S,disabled:!c,style:{backgroundColor:t.callToActionBackgroundColor||"#F48722",color:t.callToActionFontColor||"#ffffff"},children:E.jsx(t3,{uiData:t})})]})]})},TQ=z.div`
387
+ `,gm=({message:e,uidata:t,onSendMessage:n,loading:r})=>{const[i,o]=fm({align:"center",containScroll:"trimSnaps",dragFree:!0}),[a,u]=R.useState(!1),[c,d]=R.useState(!0),[p,h]=R.useState(0),m=R.useRef([]),v=R.useRef(null),_=R.useCallback(()=>o&&o.scrollPrev(),[o]),S=R.useCallback(()=>o&&o.scrollNext(),[o]),x=R.useCallback(()=>{o&&(u(o.canScrollPrev()),d(o.canScrollNext()),h(o.selectedScrollSnap()))},[o]),b=R.useCallback(C=>{C.forEach(k=>{k.isIntersecting?m.current.forEach((A,I)=>{A&&(I===p?A.play():A.pause())}):m.current.forEach(A=>{A&&A.pause()})})},[p]);return R.useEffect(()=>{if(o)return o.on("select",x),x(),()=>{o.off("select",x)}},[o,x]),R.useEffect(()=>{if(!v.current)return;const C=new IntersectionObserver(b,{root:null,rootMargin:"0px",threshold:.6}),k=v.current;return C.observe(k),()=>{C.unobserve(k)}},[b]),!e.collections||e.collections.length<1?null:E.jsxs(_Q,{ref:v,children:[E.jsx(bQ,{ref:i,children:E.jsx(xQ,{children:e.collections.map((C,k)=>E.jsx(wQ,{children:E.jsxs(kQ,{$disabled:r,onClick:()=>{r||n("I'd like to explore "+C.name+" collection")},children:[E.jsx(SQ,{children:C!=null&&C.image&&(C.image.endsWith(".mp4")||C.image.endsWith(".webm"))?E.jsx("video",{ref:A=>{m.current[k]=A},style:{width:"100%",height:"auto",objectFit:"cover",aspectRatio:"1/1",margin:"0"},muted:!0,loop:!0,onClick:()=>{window.DebalesChat.track(mt.COLLECTION_VIDEO_CLICKED,{collectionName:C.name,message:e.conversationId})},src:C.image}):E.jsx("img",{style:{width:"100%",height:"auto",objectFit:"cover",aspectRatio:"1/1",margin:"0"},onClick:()=>{window.DebalesChat.track(mt.COLLECTION_IMAGE_CLICKED,{collectionName:C.name,message:e.conversationId})},src:C.image,alt:"Collection Image Not Available"})}),E.jsx(CQ,{children:E.jsx(EQ,{title:C.name,children:C.name})})]})},k))})}),e.collections&&e.collections.length>1&&E.jsxs(E.Fragment,{children:[E.jsx(AQ,{onClick:_,disabled:!a,style:{backgroundColor:t.callToActionBackgroundColor||"#F48722",color:t.callToActionFontColor||"#ffffff"},children:E.jsx(e2,{uiData:t})}),E.jsx(IQ,{onClick:S,disabled:!c,style:{backgroundColor:t.callToActionBackgroundColor||"#F48722",color:t.callToActionFontColor||"#ffffff"},children:E.jsx(t2,{uiData:t})})]})]})},TQ=z.div`
388
388
  position: absolute;
389
389
  top: 0;
390
390
  left: 0;
@@ -712,7 +712,7 @@ or you can use record.mirror to access the mirror instance during recording.`,qR
712
712
  justify-content: space-between;
713
713
  width: 90%;
714
714
  margin-bottom: 24px;
715
- `,r3=z.span`
715
+ `,r2=z.span`
716
716
  font-size: 14px;
717
717
  color: #475467;
718
718
  `,XQ=z.button`
@@ -722,7 +722,7 @@ or you can use record.mirror to access the mirror instance during recording.`,qR
722
722
  padding: 2px 16px;
723
723
  font-size: 16px;
724
724
  cursor: pointer;
725
- `,ym=({setShowExitModal:e,handleCloseChatbot:t,chatId:n})=>{const[r,i]=R.useState("confirmation"),o=qt(jt.CHAT_RATING,{botId:window.DebalesChat.projectId}),[a,u]=R.useState(null),[c,d]=R.useState(!1),[p,h]=R.useState(!1);R.useEffect(()=>{if(n){const b=JSON.parse(sessionStorage.getItem(o)||"{}"),C=n in b;h(!C)}},[n,o]);const m=b=>{if(n){const C=JSON.parse(sessionStorage.getItem(o)||"{}");C[n]={rating:b,timestamp:Date.now()},sessionStorage.setItem(o,JSON.stringify(C))}},v=b=>{d(!0),setTimeout(()=>{b&&b(),d(!1),e(!1)},300)},_=()=>{p?i("rating"):v(()=>t(null))},S=b=>{u(b),m(b),setTimeout(()=>{d(!0),t(b)},1e3)},x=()=>{d(!0),m(null),setTimeout(()=>{t(null)},300)};return E.jsxs(E.Fragment,{children:[E.jsx(zQ,{$isClosing:c}),r==="confirmation"?E.jsxs(UQ,{$isClosing:c,children:[E.jsx(qQ,{children:"End Chat"}),E.jsx(HQ,{children:"Are you sure you want to end this chat?"}),E.jsx(GQ,{onClick:_,children:"Yes"}),E.jsx(VQ,{onClick:x,children:"Cancel"})]}):E.jsxs(jQ,{$isClosing:c,children:[E.jsx(ZQ,{children:"How would you rate your chat experience?*"}),E.jsx(YQ,{children:[1,2,3,4,5].map(b=>E.jsx(KQ,{$isSelected:a===b,$value:b,onClick:()=>S(b),children:b},b))}),E.jsxs(QQ,{children:[E.jsx(r3,{children:"Terrible"}),E.jsx(r3,{children:"Excellent"})]}),E.jsx(XQ,{onClick:x,children:"Skip and close"})]})]})},Po=({loading:e,loadingPhrases:t})=>{const[n,r]=R.useState(0),[i,o]=R.useState("");return R.useEffect(()=>{if(!e){r(0),o("");return}const u=t||["🧠 Let me think","🔍 Looking it up","✨ Working on it","⚡ Almost ready","🚀 Getting your answer","🌟 Hang in there"],c=u[n];let d=0;const p=setInterval(()=>{d<=c.length?(o(h=>h!==c.slice(0,d)?c.slice(0,d):h),d++):(clearInterval(p),n<u.length-1&&setTimeout(()=>{r(h=>h<u.length-1?h+1:h),o("")},500))},100);return()=>{clearInterval(p)}},[e,n,t]),E.jsxs("div",{children:[i,E.jsx("span",{className:"loading-dot",children:"."}),E.jsx("span",{className:"loading-dot",children:"."}),E.jsx("span",{className:"loading-dot",children:"."})]})},JQ=z.div`
725
+ `,ym=({setShowExitModal:e,handleCloseChatbot:t,chatId:n})=>{const[r,i]=R.useState("confirmation"),o=qt(jt.CHAT_RATING,{botId:window.DebalesChat.projectId}),[a,u]=R.useState(null),[c,d]=R.useState(!1),[p,h]=R.useState(!1);R.useEffect(()=>{if(n){const b=JSON.parse(sessionStorage.getItem(o)||"{}"),C=n in b;h(!C)}},[n,o]);const m=b=>{if(n){const C=JSON.parse(sessionStorage.getItem(o)||"{}");C[n]={rating:b,timestamp:Date.now()},sessionStorage.setItem(o,JSON.stringify(C))}},v=b=>{d(!0),setTimeout(()=>{b&&b(),d(!1),e(!1)},300)},_=()=>{p?i("rating"):v(()=>t(null))},S=b=>{u(b),m(b),setTimeout(()=>{d(!0),t(b)},1e3)},x=()=>{d(!0),m(null),setTimeout(()=>{t(null)},300)};return E.jsxs(E.Fragment,{children:[E.jsx(zQ,{$isClosing:c}),r==="confirmation"?E.jsxs(UQ,{$isClosing:c,children:[E.jsx(qQ,{children:"End Chat"}),E.jsx(HQ,{children:"Are you sure you want to end this chat?"}),E.jsx(GQ,{onClick:_,children:"Yes"}),E.jsx(VQ,{onClick:x,children:"Cancel"})]}):E.jsxs(jQ,{$isClosing:c,children:[E.jsx(ZQ,{children:"How would you rate your chat experience?*"}),E.jsx(YQ,{children:[1,2,3,4,5].map(b=>E.jsx(KQ,{$isSelected:a===b,$value:b,onClick:()=>S(b),children:b},b))}),E.jsxs(QQ,{children:[E.jsx(r2,{children:"Terrible"}),E.jsx(r2,{children:"Excellent"})]}),E.jsx(XQ,{onClick:x,children:"Skip and close"})]})]})},Po=({loading:e,loadingPhrases:t})=>{const[n,r]=R.useState(0),[i,o]=R.useState("");return R.useEffect(()=>{if(!e){r(0),o("");return}const u=t||["🧠 Let me think","🔍 Looking it up","✨ Working on it","⚡ Almost ready","🚀 Getting your answer","🌟 Hang in there"],c=u[n];let d=0;const p=setInterval(()=>{d<=c.length?(o(h=>h!==c.slice(0,d)?c.slice(0,d):h),d++):(clearInterval(p),n<u.length-1&&setTimeout(()=>{r(h=>h<u.length-1?h+1:h),o("")},500))},100);return()=>{clearInterval(p)}},[e,n,t]),E.jsxs("div",{children:[i,E.jsx("span",{className:"loading-dot",children:"."}),E.jsx("span",{className:"loading-dot",children:"."}),E.jsx("span",{className:"loading-dot",children:"."})]})},JQ=z.div`
726
726
  position: relative;
727
727
  width: 100%;
728
728
  overflow: hidden;
@@ -900,7 +900,7 @@ or you can use record.mirror to access the mirror instance during recording.`,qR
900
900
  display: flex;
901
901
  gap: 8px;
902
902
  align-items: start;
903
- `,i3=z.button`
903
+ `,i2=z.button`
904
904
  position: absolute;
905
905
  top: 50% !important;
906
906
  transform: translateY(-50%);
@@ -924,7 +924,7 @@ or you can use record.mirror to access the mirror instance during recording.`,qR
924
924
  opacity: 0.5;
925
925
  cursor: default;
926
926
  }
927
- `,gX=z(i3)`
927
+ `,gX=z(i2)`
928
928
  left: ${e=>Br(e.$botId||"")?"0px":"5px"};
929
929
  border-radius: ${e=>Br(e.$botId||"")?"0 50% 50% 0":"50%"} !important;
930
930
 
@@ -932,7 +932,7 @@ or you can use record.mirror to access the mirror instance during recording.`,qR
932
932
  left: ${e=>Br(e.$botId||"")?"0px":"10px"};
933
933
  z-index: 110; /* Ensure it's above other elements */
934
934
  }
935
- `,mX=z(i3)`
935
+ `,mX=z(i2)`
936
936
  right: ${e=>Br(e.$botId||"")?"0px":"5px"};
937
937
  border-radius: ${e=>Br(e.$botId||"")?"50% 0 0 50%":"50%"} !important;
938
938
 
@@ -940,13 +940,13 @@ or you can use record.mirror to access the mirror instance during recording.`,qR
940
940
  right: ${e=>Br(e.$botId||"")?"0px":"10px"};
941
941
  z-index: 110; /* Ensure it's above other elements */
942
942
  }
943
- `,_m=({message:e,botId:t,uidata:n,onSendMessage:r,loading:i,storeMetaData:o,platform:a,setShowVariantModel:u,setSelectedProduct:c,setCartVersion:d})=>{const[p,h]=fm({align:"center",containScroll:"trimSnaps",dragFree:!0}),[m,v]=R.useState(!1),[_,S]=R.useState(!0),[x,b]=R.useState(0),C=R.useRef([]),k=R.useRef(null),{addToCart:A,generateProductUrl:I,addCartAttributes:$,cart:B}=Jf(),U=R.useCallback(()=>h&&h.scrollPrev(),[h]),G=R.useCallback(()=>h&&h.scrollNext(),[h]),P=R.useCallback(()=>{h&&(v(h.canScrollPrev()),S(h.canScrollNext()),b(h.selectedScrollSnap()))},[h]),K=R.useCallback(Z=>{Z.forEach(ie=>{ie.isIntersecting?C.current.forEach((V,Q)=>{V&&(Q===x?V.play():V.pause())}):C.current.forEach(V=>{V&&V.pause()})})},[x]),re=R.useCallback(Z=>{if(!Z.compare_at_price||!Z.price)return null;const ie=parseFloat(Z.compare_at_price),V=parseFloat(Z.price);if(ie<=V)return null;const Q=(ie-V)/ie*100;return Q>0?Math.round(Q):null},[]);R.useEffect(()=>{if(h)return h.on("select",P),P(),()=>{h.off("select",P)}},[h,P]),R.useEffect(()=>{if(!k.current)return;const Z=new IntersectionObserver(K,{root:null,rootMargin:"0px",threshold:.6}),ie=k.current;return Z.observe(ie),()=>{Z.unobserve(ie)}},[K]),R.useEffect(()=>{if(!h)return;const Z=()=>{h.reInit()};return window.addEventListener("resize",Z),()=>{window.removeEventListener("resize",Z)}},[h]);const ue=(Z,ie,V)=>{let Q=Z.link;try{if(ie==="GTK-Restaurant"){const ye=Z.name.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-");Q=new URL(`/order/want-gtk-hoboken/item-${ye}_${Z.product_id}`,Q.replace("www.","")).toString()}else if(ie==="gtk-catering")Q=new URL(`https://${V}/catering/want-gtk-hoboken/items/add/${Z.handle}`).toString();else return I(V,Z);return Q}catch(ye){return console.error("Error formatting product URL:",ye),Q}};return!e.products||e.products.length===0?null:E.jsxs(JQ,{ref:k,children:[E.jsx(eX,{ref:p,$botId:t,children:E.jsx(tX,{children:e.products.map((Z,ie)=>{var V;return E.jsxs(nX,{$botId:t,children:[Z.compare_at_price&&re(Z)&&E.jsx(cX,{children:E.jsxs(fX,{children:[re(Z),"% OFF"]})}),E.jsxs(rX,{onClick:()=>{i||(t.toLowerCase().includes("gtk")?(window.open(ue(Z,t,n.shopifyShopDomain||""),"_blank"),window.DebalesChat.track(mt.VIEW_PRODUCT_CLICKED,{productName:Z.name,productPrice:Z.price?Cw(Z.price):void 0,productLink:Z.link,message:e.conversationId})):r("Tell me about "+Z.name+" product"))},$disabled:i,children:[E.jsx(iX,{$botId:t,children:(V=Z==null?void 0:Z.image)!=null&&V[0]&&(Z.image[0].endsWith(".mp4")||Z.image[0].endsWith(".webm"))?E.jsx("video",{ref:Q=>{C.current[ie]=Q},style:{width:"100%",height:"auto",objectFit:"cover",aspectRatio:"1/1",margin:"0"},muted:!0,loop:!0,onClick:()=>{window.DebalesChat.track(mt.PRODUCT_VIDEO_CLICKED,{product:Z,message:e.conversationId})},src:Z.image[0]}):E.jsx("img",{style:{width:"100%",height:"auto",objectFit:"cover",aspectRatio:"1/1",margin:"0"},onClick:()=>{window.DebalesChat.track(mt.PRODUCT_IMAGE_CLICKED,{product:Z,message:e.conversationId})},src:Z.image[0]==="No image available"?"https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg":Z.image[0],alt:"Product Image Not Available"})}),E.jsxs(oX,{children:[E.jsx(aX,{title:Z.name,children:Z.name}),Z.price&&E.jsxs(pX,{children:[E.jsx(sX,{dangerouslySetInnerHTML:{__html:H2(Z.price,o)}}),Z.compare_at_price&&re(Z)&&E.jsx(hX,{children:E.jsx(dX,{dangerouslySetInnerHTML:{__html:H2(Z.compare_at_price,o)}})})]}),a!==Pr.DEFAULT&&a!==Pr.UNKNOWN&&Z.price&&E.jsx(E.Fragment,{children:E.jsx(uX,{style:{backgroundColor:n.callToActionBackgroundColor||"#F48722",color:n.callToActionFontColor||"#ffffff"},onClick:Q=>{Q.stopPropagation(),a===Pr.SHOPIFY?(u(!0),c(Z)):(A(Z.product_id,1),window.DebalesChat.track(mt.ADD_TO_CART_CLICKED,{product:Z.name,price:Z.price?Cw(Z.price):void 0,link:Z.link,message:e.conversationId,currentCart:B})),d(ye=>ye+1)},children:"Add to Cart"})}),Z.price&&E.jsxs(lX,{$botId:t,$backgroundColor:n.callToActionBackgroundColor||"#F48722",title:"product-link",href:ue(Z,t,n.shopifyShopDomain||""),onClick:Q=>{Q.stopPropagation(),t.toLowerCase().includes("gtk")&&(Q.preventDefault(),r("Show products similar to "+Z.name)),window.DebalesChat.track(t.toLowerCase().includes("gtk")?mt.SHOW_SIMILAR_CLICKED:mt.VIEW_PRODUCT_CLICKED,{productName:Z.name,productPrice:Z.price?Cw(Z.price):void 0,productLink:Z.link,message:e.conversationId}),$({dbls_method:"view_product"})},children:[E.jsx("span",{style:{marginRight:"6px"},children:t.toLowerCase().includes("gtk")?"Show Similar":"View Product"}),t.toLowerCase().includes("gtk")?E.jsx(yQ,{}):E.jsx(vQ,{})]})]})]})]},ie)})})}),e.products.length>1&&E.jsxs(E.Fragment,{children:[E.jsx(gX,{onClick:U,disabled:!m,$botId:t,style:{backgroundColor:n.callToActionBackgroundColor||"#F48722",color:n.callToActionFontColor||"#ffffff"},children:E.jsx(e3,{uiData:n})}),E.jsx(mX,{onClick:G,disabled:!_,$botId:t,style:{backgroundColor:n.callToActionBackgroundColor||"#F48722",color:n.callToActionFontColor||"#ffffff"},children:E.jsx(t3,{uiData:n})})]})]})};var bm={exports:{}},xm={exports:{}},wm={exports:{}},o3;function Be(){return o3||(o3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function n(i){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},n(i)}function r(i){var o=typeof i=="string"||i instanceof String;if(!o){var a=n(i);throw i===null?a="null":a==="object"&&(a=i.constructor.name),new TypeError("Expected a string but received a ".concat(a))}}e.exports=t.default,e.exports.default=t.default}(wm,wm.exports)),wm.exports}var a3;function Ow(){return a3||(a3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o),o=Date.parse(o),isNaN(o)?null:new Date(o)}e.exports=t.default,e.exports.default=t.default}(xm,xm.exports)),xm.exports}var Sm={exports:{}},Uu={},Cm={exports:{}},s3;function l3(){return s3||(s3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r){return r==null}e.exports=t.default,e.exports.default=t.default}(Cm,Cm.exports)),Cm.exports}var ir={},u3;function _d(){if(u3)return ir;u3=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.farsiLocales=ir.englishLocales=ir.dotDecimal=ir.decimal=ir.commaDecimal=ir.bengaliLocales=ir.arabicLocales=ir.alphanumeric=ir.alpha=void 0;for(var e=ir.alpha={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ώ]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fa-IR":/^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,"fi-FI":/^[A-ZÅÄÖ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"kk-KZ":/^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๐\s]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[А-ЩЬЮЯЄIЇҐі]+$/i,"vi-VN":/^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,"ko-KR":/^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[א-ת]+$/,fa:/^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i,"si-LK":/^[\u0D80-\u0DFF]+$/},t=ir.alphanumeric={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[0-9А-Я]+$/i,"cs-CZ":/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[0-9A-ZÆØÅ]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"el-GR":/^[0-9Α-ω]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fi-FI":/^[0-9A-ZÅÄÖ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"hu-HU":/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"nb-NO":/^[0-9A-ZÆØÅ]+$/i,"nl-NL":/^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[0-9A-ZÆØÅ]+$/i,"pl-PL":/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁ]+$/i,"kk-KZ":/^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[0-9A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[0-9A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[0-9А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[0-9A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๙\s]+$/i,"tr-TR":/^[0-9A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,"ko-KR":/^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,"vi-VN":/^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[0-9א-ת]+$/,fa:/^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i,"si-LK":/^[0-9\u0D80-\u0DFF]+$/},n=ir.decimal={"en-US":".",ar:"٫"},r=ir.englishLocales=["AU","GB","HK","IN","NZ","ZA","ZM"],i,o=0;o<r.length;o++)i="en-".concat(r[o]),e[i]=e["en-US"],t[i]=t["en-US"],n[i]=n["en-US"];for(var a=ir.arabicLocales=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"],u,c=0;c<a.length;c++)u="ar-".concat(a[c]),e[u]=e.ar,t[u]=t.ar,n[u]=n.ar;for(var d=ir.farsiLocales=["IR","AF"],p,h=0;h<d.length;h++)p="fa-".concat(d[h]),t[p]=t.fa,n[p]=n.ar;for(var m=ir.bengaliLocales=["BD","IN"],v,_=0;_<m.length;_++)v="bn-".concat(m[_]),e[v]=e.bn,t[v]=t.bn,n[v]=n["en-US"];for(var S=ir.dotDecimal=["ar-EG","ar-LB","ar-LY"],x=ir.commaDecimal=["bg-BG","cs-CZ","da-DK","de-DE","el-GR","en-ZM","eo","es-ES","fr-CA","fr-FR","id-ID","it-IT","ku-IQ","hi-IN","hu-HU","nb-NO","nn-NO","nl-NL","pl-PL","pt-PT","ru-RU","kk-KZ","si-LK","sl-SI","sr-RS@latin","sr-RS","sv-SE","tr-TR","uk-UA","vi-VN"],b=0;b<S.length;b++)n[S[b]]=n["en-US"];for(var C=0;C<x.length;C++)n[x[C]]=",";return e["fr-CA"]=e["fr-FR"],t["fr-CA"]=t["fr-FR"],e["pt-BR"]=e["pt-PT"],t["pt-BR"]=t["pt-PT"],n["pt-BR"]=n["pt-PT"],e["pl-Pl"]=e["pl-PL"],t["pl-Pl"]=t["pl-PL"],n["pl-Pl"]=n["pl-PL"],e["fa-AF"]=e.fa,ir}var c3;function f3(){if(c3)return Uu;c3=1,Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.default=i,Uu.locales=void 0;var e=r(Be()),t=r(l3()),n=_d();function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){(0,e.default)(o),a=a||{};var u=new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(a.locale?n.decimal[a.locale]:".","[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));if(o===""||o==="."||o===","||o==="-"||o==="+")return!1;var c=parseFloat(o.replace(",","."));return u.test(o)&&(!a.hasOwnProperty("min")||(0,t.default)(a.min)||c>=a.min)&&(!a.hasOwnProperty("max")||(0,t.default)(a.max)||c<=a.max)&&(!a.hasOwnProperty("lt")||(0,t.default)(a.lt)||c<a.lt)&&(!a.hasOwnProperty("gt")||(0,t.default)(a.gt)||c>a.gt)}return Uu.locales=Object.keys(n.decimal),Uu}var d3;function h3(){return d3||(d3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(f3());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o)?parseFloat(o):NaN}e.exports=t.default,e.exports.default=t.default}(Sm,Sm.exports)),Sm.exports}var Em={exports:{}},p3;function vX(){return p3||(p3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){return(0,n.default)(o),parseInt(o,a||10)}e.exports=t.default,e.exports.default=t.default}(Em,Em.exports)),Em.exports}var km={exports:{}},g3;function yX(){return g3||(g3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){return(0,n.default)(o),a?o==="1"||/^true$/i.test(o):o!=="0"&&!/^false$/i.test(o)&&o!==""}e.exports=t.default,e.exports.default=t.default}(km,km.exports)),km.exports}var Am={exports:{}},m3;function _X(){return m3||(m3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){return(0,n.default)(o),o===a}e.exports=t.default,e.exports.default=t.default}(Am,Am.exports)),Am.exports}var Im={exports:{}},Tm={exports:{}},v3;function y3(){return v3||(v3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function n(i){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},n(i)}function r(i){return n(i)==="object"&&i!==null?typeof i.toString=="function"?i=i.toString():i="[object Object]":(i===null||typeof i>"u"||isNaN(i)&&!i.length)&&(i=""),String(i)}e.exports=t.default,e.exports.default=t.default}(Tm,Tm.exports)),Tm.exports}var Mm={exports:{}},_3;function hi(){return _3||(_3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;for(var o in i)typeof r[o]>"u"&&(r[o]=i[o]);return r}e.exports=t.default,e.exports.default=t.default}(Mm,Mm.exports)),Mm.exports}var b3;function bX(){return b3||(b3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=o(Be()),r=o(y3()),i=o(hi());function o(c){return c&&c.__esModule?c:{default:c}}var a={ignoreCase:!1,minOccurrences:1};function u(c,d,p){return(0,n.default)(c),p=(0,i.default)(p,a),p.ignoreCase?c.toLowerCase().split((0,r.default)(d).toLowerCase()).length>p.minOccurrences:c.split((0,r.default)(d)).length>p.minOccurrences}e.exports=t.default,e.exports.default=t.default}(Im,Im.exports)),Im.exports}var Om={exports:{}},x3;function xX(){return x3||(x3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a,u){return(0,n.default)(o),Object.prototype.toString.call(a)!=="[object RegExp]"&&(a=new RegExp(a,u)),!!o.match(a)}e.exports=t.default,e.exports.default=t.default}(Om,Om.exports)),Om.exports}var Rm={exports:{}},$m={exports:{}},w3;function S3(){return w3||(w3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function n(i){return Object.prototype.toString.call(i)==="[object RegExp]"}function r(i,o){for(var a=0;a<o.length;a++){var u=o[a];if(i===u||n(u)&&u.test(i))return!0}return!1}e.exports=t.default,e.exports.default=t.default}($m,$m.exports)),$m.exports}var Dm={exports:{}},C3;function E3(){return C3||(C3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}function i(a){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},i(a)}function o(a,u){(0,n.default)(a);var c,d;i(u)==="object"?(c=u.min||0,d=u.max):(c=arguments[1],d=arguments[2]);var p=encodeURI(a).split(/%..|./).length-1;return p>=c&&(typeof d>"u"||p<=d)}e.exports=t.default,e.exports.default=t.default}(Dm,Dm.exports)),Dm.exports}var Lm={exports:{}},k3;function Rw(){return k3||(k3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=i(hi());function i(u){return u&&u.__esModule?u:{default:u}}var o={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function a(u,c){(0,n.default)(u),c=(0,r.default)(c,o),c.allow_trailing_dot&&u[u.length-1]==="."&&(u=u.substring(0,u.length-1)),c.allow_wildcard===!0&&u.indexOf("*.")===0&&(u=u.substring(2));var d=u.split("."),p=d[d.length-1];return c.require_tld&&(d.length<2||!c.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(p)||/\s/.test(p))||!c.allow_numeric_tld&&/^\d+$/.test(p)?!1:d.every(function(h){return!(h.length>63&&!c.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(h)||/[\uff01-\uff5e]/.test(h)||/^-|-$/.test(h)||!c.allow_underscores&&/_/.test(h))})}e.exports=t.default,e.exports.default=t.default}(Lm,Lm.exports)),Lm.exports}var Nm={exports:{}},A3;function Bm(){return A3||(A3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var n=r(Be());function r(p){return p&&p.__esModule?p:{default:p}}var i="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",o="(".concat(i,"[.]){3}").concat(i),a=new RegExp("^".concat(o,"$")),u="(?:[0-9a-fA-F]{1,4})",c=new RegExp("^("+"(?:".concat(u,":){7}(?:").concat(u,"|:)|")+"(?:".concat(u,":){6}(?:").concat(o,"|:").concat(u,"|:)|")+"(?:".concat(u,":){5}(?::").concat(o,"|(:").concat(u,"){1,2}|:)|")+"(?:".concat(u,":){4}(?:(:").concat(u,"){0,1}:").concat(o,"|(:").concat(u,"){1,3}|:)|")+"(?:".concat(u,":){3}(?:(:").concat(u,"){0,2}:").concat(o,"|(:").concat(u,"){1,4}|:)|")+"(?:".concat(u,":){2}(?:(:").concat(u,"){0,3}:").concat(o,"|(:").concat(u,"){1,5}|:)|")+"(?:".concat(u,":){1}(?:(:").concat(u,"){0,4}:").concat(o,"|(:").concat(u,"){1,6}|:)|")+"(?::((?::".concat(u,"){0,5}:").concat(o,"|(?::").concat(u,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function d(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,n.default)(p),h=String(h),h?h==="4"?a.test(p):h==="6"?c.test(p):!1:d(p,4)||d(p,6)}e.exports=t.default,e.exports.default=t.default}(Nm,Nm.exports)),Nm.exports}var I3;function T3(){return I3||(I3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=C;var n=c(Be()),r=c(S3()),i=c(E3()),o=c(Rw()),a=c(Bm()),u=c(hi());function c(k){return k&&k.__esModule?k:{default:k}}var d={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},p=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,h=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,m=/^[a-z\d]+$/,v=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,_=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,S=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,x=254;function b(k){var A=k.replace(/^"(.+)"$/,"$1");if(!A.trim())return!1;var I=/[\.";<>]/.test(A);if(I){if(A===k)return!1;var $=A.split('"').length===A.split('\\"').length;if(!$)return!1}return!0}function C(k,A){if((0,n.default)(k),A=(0,u.default)(A,d),A.require_display_name||A.allow_display_name){var I=k.match(p);if(I){var $=I[1];if(k=k.replace($,"").replace(/(^<|>$)/g,""),$.endsWith(" ")&&($=$.slice(0,-1)),!b($))return!1}else if(A.require_display_name)return!1}if(!A.ignore_max_length&&k.length>x)return!1;var B=k.split("@"),U=B.pop(),G=U.toLowerCase();if(A.host_blacklist.length>0&&(0,r.default)(G,A.host_blacklist)||A.host_whitelist.length>0&&!(0,r.default)(G,A.host_whitelist))return!1;var P=B.join("@");if(A.domain_specific_validation&&(G==="gmail.com"||G==="googlemail.com")){P=P.toLowerCase();var K=P.split("+")[0];if(!(0,i.default)(K.replace(/\./g,""),{min:6,max:30}))return!1;for(var re=K.split("."),ue=0;ue<re.length;ue++)if(!m.test(re[ue]))return!1}if(A.ignore_max_length===!1&&(!(0,i.default)(P,{max:64})||!(0,i.default)(U,{max:254})))return!1;if(!(0,o.default)(U,{require_tld:A.require_tld,ignore_max_length:A.ignore_max_length,allow_underscores:A.allow_underscores})){if(!A.allow_ip_domain)return!1;if(!(0,a.default)(U)){if(!U.startsWith("[")||!U.endsWith("]"))return!1;var Z=U.slice(1,-1);if(Z.length===0||!(0,a.default)(Z))return!1}}if(A.blacklisted_chars&&P.search(new RegExp("[".concat(A.blacklisted_chars,"]+"),"g"))!==-1)return!1;if(P[0]==='"'&&P[P.length-1]==='"')return P=P.slice(1,P.length-1),A.allow_utf8_local_part?S.test(P):v.test(P);for(var ie=A.allow_utf8_local_part?_:h,V=P.split("."),Q=0;Q<V.length;Q++)if(!ie.test(V[Q]))return!1;return!0}e.exports=t.default,e.exports.default=t.default}(Rm,Rm.exports)),Rm.exports}var Pm={exports:{}},M3;function wX(){return M3||(M3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=x;var n=u(Be()),r=u(S3()),i=u(Rw()),o=u(Bm()),a=u(hi());function u(b){return b&&b.__esModule?b:{default:b}}function c(b,C){return v(b)||m(b,C)||p(b,C)||d()}function d(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
944
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p(b,C){if(b){if(typeof b=="string")return h(b,C);var k={}.toString.call(b).slice(8,-1);return k==="Object"&&b.constructor&&(k=b.constructor.name),k==="Map"||k==="Set"?Array.from(b):k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k)?h(b,C):void 0}}function h(b,C){(C==null||C>b.length)&&(C=b.length);for(var k=0,A=Array(C);k<C;k++)A[k]=b[k];return A}function m(b,C){var k=b==null?null:typeof Symbol<"u"&&b[Symbol.iterator]||b["@@iterator"];if(k!=null){var A,I,$,B,U=[],G=!0,P=!1;try{if($=(k=k.call(b)).next,C!==0)for(;!(G=(A=$.call(k)).done)&&(U.push(A.value),U.length!==C);G=!0);}catch(K){P=!0,I=K}finally{try{if(!G&&k.return!=null&&(B=k.return(),Object(B)!==B))return}finally{if(P)throw I}}return U}}function v(b){if(Array.isArray(b))return b}var _={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0,max_allowed_length:2084},S=/^\[([^\]]+)\](?::([0-9]+))?$/;function x(b,C){if((0,n.default)(b),!b||/[\s<>]/.test(b)||b.indexOf("mailto:")===0||(C=(0,a.default)(C,_),C.validate_length&&b.length>C.max_allowed_length)||!C.allow_fragments&&b.includes("#")||!C.allow_query_components&&(b.includes("?")||b.includes("&")))return!1;var k,A,I,$,B,U,G,P;if(G=b.split("#"),b=G.shift(),G=b.split("?"),b=G.shift(),G=b.split("://"),G.length>1){if(k=G.shift().toLowerCase(),C.require_valid_protocol&&C.protocols.indexOf(k)===-1)return!1}else{if(C.require_protocol)return!1;if(b.slice(0,2)==="//"){if(!C.allow_protocol_relative_urls)return!1;G[0]=b.slice(2)}}if(b=G.join("://"),b==="")return!1;if(G=b.split("/"),b=G.shift(),b===""&&!C.require_host)return!0;if(G=b.split("@"),G.length>1){if(C.disallow_auth||G[0]===""||(A=G.shift(),A.indexOf(":")>=0&&A.split(":").length>2))return!1;var K=A.split(":"),re=c(K,2),ue=re[0],Z=re[1];if(ue===""&&Z==="")return!1}$=G.join("@"),U=null,P=null;var ie=$.match(S);if(ie?(I="",P=ie[1],U=ie[2]||null):(G=$.split(":"),I=G.shift(),G.length&&(U=G.join(":"))),U!==null&&U.length>0){if(B=parseInt(U,10),!/^[0-9]+$/.test(U)||B<=0||B>65535)return!1}else if(C.require_port)return!1;return C.host_whitelist?(0,r.default)(I,C.host_whitelist):I===""&&!C.require_host?!0:!(!(0,o.default)(I)&&!(0,i.default)(I,C)&&(!P||!(0,o.default)(P,6))||(I=I||P,C.host_blacklist&&(0,r.default)(I,C.host_blacklist)))}e.exports=t.default,e.exports.default=t.default}(Pm,Pm.exports)),Pm.exports}var Fm={exports:{}},O3;function SX(){return O3||(O3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var n=r(Be());function r(h){return h&&h.__esModule?h:{default:h}}var i=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/,o=/^([0-9a-fA-F]){12}$/,a=/^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/,u=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/,c=/^([0-9a-fA-F]){16}$/,d=/^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/;function p(h,m){return(0,n.default)(h),m!=null&&m.eui&&(m.eui=String(m.eui)),m!=null&&m.no_colons||m!=null&&m.no_separators?m.eui==="48"?o.test(h):m.eui==="64"?c.test(h):o.test(h)||c.test(h):(m==null?void 0:m.eui)==="48"?i.test(h)||a.test(h):(m==null?void 0:m.eui)==="64"?u.test(h)||d.test(h):p(h,{eui:"48"})||p(h,{eui:"64"})}e.exports=t.default,e.exports.default=t.default}(Fm,Fm.exports)),Fm.exports}var zm={exports:{}},R3;function CX(){return R3||(R3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n=i(Be()),r=i(Bm());function i(d){return d&&d.__esModule?d:{default:d}}var o=/^\d{1,3}$/,a=32,u=128;function c(d){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(0,n.default)(d);var h=d.split("/");if(h.length!==2||!o.test(h[1])||h[1].length>1&&h[1].startsWith("0"))return!1;var m=(0,r.default)(h[0],p);if(!m)return!1;var v=null;switch(String(p)){case"4":v=a;break;case"6":v=u;break;default:v=(0,r.default)(h[0],"6")?u:a}return h[1]<=v&&h[1]>=0}e.exports=t.default,e.exports.default=t.default}(zm,zm.exports)),zm.exports}var Um={exports:{}},$3;function D3(){return $3||($3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=_;var n=r(hi());function r(S){return S&&S.__esModule?S:{default:S}}function i(S,x){return u(S)||a(S,x)||d(S,x)||o()}function o(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
943
+ `,_m=({message:e,botId:t,uidata:n,onSendMessage:r,loading:i,storeMetaData:o,platform:a,setShowVariantModel:u,setSelectedProduct:c,setCartVersion:d})=>{const[p,h]=fm({align:"center",containScroll:"trimSnaps",dragFree:!0}),[m,v]=R.useState(!1),[_,S]=R.useState(!0),[x,b]=R.useState(0),C=R.useRef([]),k=R.useRef(null),{addToCart:A,generateProductUrl:I,addCartAttributes:$,cart:B}=Jf(),U=R.useCallback(()=>h&&h.scrollPrev(),[h]),G=R.useCallback(()=>h&&h.scrollNext(),[h]),P=R.useCallback(()=>{h&&(v(h.canScrollPrev()),S(h.canScrollNext()),b(h.selectedScrollSnap()))},[h]),K=R.useCallback(Z=>{Z.forEach(ie=>{ie.isIntersecting?C.current.forEach((V,Q)=>{V&&(Q===x?V.play():V.pause())}):C.current.forEach(V=>{V&&V.pause()})})},[x]),re=R.useCallback(Z=>{if(!Z.compare_at_price||!Z.price)return null;const ie=parseFloat(Z.compare_at_price),V=parseFloat(Z.price);if(ie<=V)return null;const Q=(ie-V)/ie*100;return Q>0?Math.round(Q):null},[]);R.useEffect(()=>{if(h)return h.on("select",P),P(),()=>{h.off("select",P)}},[h,P]),R.useEffect(()=>{if(!k.current)return;const Z=new IntersectionObserver(K,{root:null,rootMargin:"0px",threshold:.6}),ie=k.current;return Z.observe(ie),()=>{Z.unobserve(ie)}},[K]),R.useEffect(()=>{if(!h)return;const Z=()=>{h.reInit()};return window.addEventListener("resize",Z),()=>{window.removeEventListener("resize",Z)}},[h]);const ue=(Z,ie,V)=>{let Q=Z.link;try{if(ie==="GTK-Restaurant"){const ye=Z.name.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-");Q=new URL(`/order/want-gtk-hoboken/item-${ye}_${Z.product_id}`,Q.replace("www.","")).toString()}else if(ie==="gtk-catering")Q=new URL(`https://${V}/catering/want-gtk-hoboken/items/add/${Z.handle}`).toString();else return I(V,Z);return Q}catch(ye){return console.error("Error formatting product URL:",ye),Q}};return!e.products||e.products.length===0?null:E.jsxs(JQ,{ref:k,children:[E.jsx(eX,{ref:p,$botId:t,children:E.jsx(tX,{children:e.products.map((Z,ie)=>{var V;return E.jsxs(nX,{$botId:t,children:[Z.compare_at_price&&re(Z)&&E.jsx(cX,{children:E.jsxs(fX,{children:[re(Z),"% OFF"]})}),E.jsxs(rX,{onClick:()=>{i||(t.toLowerCase().includes("gtk")?(window.open(ue(Z,t,n.shopifyShopDomain||""),"_blank"),window.DebalesChat.track(mt.VIEW_PRODUCT_CLICKED,{productName:Z.name,productPrice:Z.price?Cw(Z.price):void 0,productLink:Z.link,message:e.conversationId})):r("Tell me about "+Z.name+" product"))},$disabled:i,children:[E.jsx(iX,{$botId:t,children:(V=Z==null?void 0:Z.image)!=null&&V[0]&&(Z.image[0].endsWith(".mp4")||Z.image[0].endsWith(".webm"))?E.jsx("video",{ref:Q=>{C.current[ie]=Q},style:{width:"100%",height:"auto",objectFit:"cover",aspectRatio:"1/1",margin:"0"},muted:!0,loop:!0,onClick:()=>{window.DebalesChat.track(mt.PRODUCT_VIDEO_CLICKED,{product:Z,message:e.conversationId})},src:Z.image[0]}):E.jsx("img",{style:{width:"100%",height:"auto",objectFit:"cover",aspectRatio:"1/1",margin:"0"},onClick:()=>{window.DebalesChat.track(mt.PRODUCT_IMAGE_CLICKED,{product:Z,message:e.conversationId})},src:Z.image[0]==="No image available"?"https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg":Z.image[0],alt:"Product Image Not Available"})}),E.jsxs(oX,{children:[E.jsx(aX,{title:Z.name,children:Z.name}),Z.price&&E.jsxs(pX,{children:[E.jsx(sX,{dangerouslySetInnerHTML:{__html:H3(Z.price,o)}}),Z.compare_at_price&&re(Z)&&E.jsx(hX,{children:E.jsx(dX,{dangerouslySetInnerHTML:{__html:H3(Z.compare_at_price,o)}})})]}),a!==Pr.DEFAULT&&a!==Pr.UNKNOWN&&Z.price&&E.jsx(E.Fragment,{children:E.jsx(uX,{style:{backgroundColor:n.callToActionBackgroundColor||"#F48722",color:n.callToActionFontColor||"#ffffff"},onClick:Q=>{Q.stopPropagation(),a===Pr.SHOPIFY?(u(!0),c(Z)):(A(Z.product_id,1),window.DebalesChat.track(mt.ADD_TO_CART_CLICKED,{product:Z.name,price:Z.price?Cw(Z.price):void 0,link:Z.link,message:e.conversationId,currentCart:B})),d(ye=>ye+1)},children:"Add to Cart"})}),Z.price&&E.jsxs(lX,{$botId:t,$backgroundColor:n.callToActionBackgroundColor||"#F48722",title:"product-link",href:ue(Z,t,n.shopifyShopDomain||""),onClick:Q=>{Q.stopPropagation(),t.toLowerCase().includes("gtk")&&(Q.preventDefault(),r("Show products similar to "+Z.name)),window.DebalesChat.track(t.toLowerCase().includes("gtk")?mt.SHOW_SIMILAR_CLICKED:mt.VIEW_PRODUCT_CLICKED,{productName:Z.name,productPrice:Z.price?Cw(Z.price):void 0,productLink:Z.link,message:e.conversationId}),$({dbls_method:"view_product"})},children:[E.jsx("span",{style:{marginRight:"6px"},children:t.toLowerCase().includes("gtk")?"Show Similar":"View Product"}),t.toLowerCase().includes("gtk")?E.jsx(yQ,{}):E.jsx(vQ,{})]})]})]})]},ie)})})}),e.products.length>1&&E.jsxs(E.Fragment,{children:[E.jsx(gX,{onClick:U,disabled:!m,$botId:t,style:{backgroundColor:n.callToActionBackgroundColor||"#F48722",color:n.callToActionFontColor||"#ffffff"},children:E.jsx(e2,{uiData:n})}),E.jsx(mX,{onClick:G,disabled:!_,$botId:t,style:{backgroundColor:n.callToActionBackgroundColor||"#F48722",color:n.callToActionFontColor||"#ffffff"},children:E.jsx(t2,{uiData:n})})]})]})};var bm={exports:{}},xm={exports:{}},wm={exports:{}},o2;function Be(){return o2||(o2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function n(i){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},n(i)}function r(i){var o=typeof i=="string"||i instanceof String;if(!o){var a=n(i);throw i===null?a="null":a==="object"&&(a=i.constructor.name),new TypeError("Expected a string but received a ".concat(a))}}e.exports=t.default,e.exports.default=t.default}(wm,wm.exports)),wm.exports}var a2;function Ow(){return a2||(a2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o),o=Date.parse(o),isNaN(o)?null:new Date(o)}e.exports=t.default,e.exports.default=t.default}(xm,xm.exports)),xm.exports}var Sm={exports:{}},Uu={},Cm={exports:{}},s2;function l2(){return s2||(s2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r){return r==null}e.exports=t.default,e.exports.default=t.default}(Cm,Cm.exports)),Cm.exports}var ir={},u2;function _d(){if(u2)return ir;u2=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.farsiLocales=ir.englishLocales=ir.dotDecimal=ir.decimal=ir.commaDecimal=ir.bengaliLocales=ir.arabicLocales=ir.alphanumeric=ir.alpha=void 0;for(var e=ir.alpha={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ώ]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fa-IR":/^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,"fi-FI":/^[A-ZÅÄÖ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"kk-KZ":/^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๐\s]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[А-ЩЬЮЯЄIЇҐі]+$/i,"vi-VN":/^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,"ko-KR":/^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[א-ת]+$/,fa:/^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i,"si-LK":/^[\u0D80-\u0DFF]+$/},t=ir.alphanumeric={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[0-9А-Я]+$/i,"cs-CZ":/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[0-9A-ZÆØÅ]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"el-GR":/^[0-9Α-ω]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fi-FI":/^[0-9A-ZÅÄÖ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"hu-HU":/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"nb-NO":/^[0-9A-ZÆØÅ]+$/i,"nl-NL":/^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[0-9A-ZÆØÅ]+$/i,"pl-PL":/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁ]+$/i,"kk-KZ":/^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[0-9A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[0-9A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[0-9А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[0-9A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๙\s]+$/i,"tr-TR":/^[0-9A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,"ko-KR":/^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,"vi-VN":/^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[0-9א-ת]+$/,fa:/^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,eo:/^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i,"si-LK":/^[0-9\u0D80-\u0DFF]+$/},n=ir.decimal={"en-US":".",ar:"٫"},r=ir.englishLocales=["AU","GB","HK","IN","NZ","ZA","ZM"],i,o=0;o<r.length;o++)i="en-".concat(r[o]),e[i]=e["en-US"],t[i]=t["en-US"],n[i]=n["en-US"];for(var a=ir.arabicLocales=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"],u,c=0;c<a.length;c++)u="ar-".concat(a[c]),e[u]=e.ar,t[u]=t.ar,n[u]=n.ar;for(var d=ir.farsiLocales=["IR","AF"],p,h=0;h<d.length;h++)p="fa-".concat(d[h]),t[p]=t.fa,n[p]=n.ar;for(var m=ir.bengaliLocales=["BD","IN"],v,_=0;_<m.length;_++)v="bn-".concat(m[_]),e[v]=e.bn,t[v]=t.bn,n[v]=n["en-US"];for(var S=ir.dotDecimal=["ar-EG","ar-LB","ar-LY"],x=ir.commaDecimal=["bg-BG","cs-CZ","da-DK","de-DE","el-GR","en-ZM","eo","es-ES","fr-CA","fr-FR","id-ID","it-IT","ku-IQ","hi-IN","hu-HU","nb-NO","nn-NO","nl-NL","pl-PL","pt-PT","ru-RU","kk-KZ","si-LK","sl-SI","sr-RS@latin","sr-RS","sv-SE","tr-TR","uk-UA","vi-VN"],b=0;b<S.length;b++)n[S[b]]=n["en-US"];for(var C=0;C<x.length;C++)n[x[C]]=",";return e["fr-CA"]=e["fr-FR"],t["fr-CA"]=t["fr-FR"],e["pt-BR"]=e["pt-PT"],t["pt-BR"]=t["pt-PT"],n["pt-BR"]=n["pt-PT"],e["pl-Pl"]=e["pl-PL"],t["pl-Pl"]=t["pl-PL"],n["pl-Pl"]=n["pl-PL"],e["fa-AF"]=e.fa,ir}var c2;function f2(){if(c2)return Uu;c2=1,Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.default=i,Uu.locales=void 0;var e=r(Be()),t=r(l2()),n=_d();function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){(0,e.default)(o),a=a||{};var u=new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(a.locale?n.decimal[a.locale]:".","[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));if(o===""||o==="."||o===","||o==="-"||o==="+")return!1;var c=parseFloat(o.replace(",","."));return u.test(o)&&(!a.hasOwnProperty("min")||(0,t.default)(a.min)||c>=a.min)&&(!a.hasOwnProperty("max")||(0,t.default)(a.max)||c<=a.max)&&(!a.hasOwnProperty("lt")||(0,t.default)(a.lt)||c<a.lt)&&(!a.hasOwnProperty("gt")||(0,t.default)(a.gt)||c>a.gt)}return Uu.locales=Object.keys(n.decimal),Uu}var d2;function h2(){return d2||(d2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(f2());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o)?parseFloat(o):NaN}e.exports=t.default,e.exports.default=t.default}(Sm,Sm.exports)),Sm.exports}var Em={exports:{}},p2;function vX(){return p2||(p2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){return(0,n.default)(o),parseInt(o,a||10)}e.exports=t.default,e.exports.default=t.default}(Em,Em.exports)),Em.exports}var km={exports:{}},g2;function yX(){return g2||(g2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){return(0,n.default)(o),a?o==="1"||/^true$/i.test(o):o!=="0"&&!/^false$/i.test(o)&&o!==""}e.exports=t.default,e.exports.default=t.default}(km,km.exports)),km.exports}var Am={exports:{}},m2;function _X(){return m2||(m2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){return(0,n.default)(o),o===a}e.exports=t.default,e.exports.default=t.default}(Am,Am.exports)),Am.exports}var Im={exports:{}},Tm={exports:{}},v2;function y2(){return v2||(v2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function n(i){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},n(i)}function r(i){return n(i)==="object"&&i!==null?typeof i.toString=="function"?i=i.toString():i="[object Object]":(i===null||typeof i>"u"||isNaN(i)&&!i.length)&&(i=""),String(i)}e.exports=t.default,e.exports.default=t.default}(Tm,Tm.exports)),Tm.exports}var Mm={exports:{}},_2;function hi(){return _2||(_2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;for(var o in i)typeof r[o]>"u"&&(r[o]=i[o]);return r}e.exports=t.default,e.exports.default=t.default}(Mm,Mm.exports)),Mm.exports}var b2;function bX(){return b2||(b2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=o(Be()),r=o(y2()),i=o(hi());function o(c){return c&&c.__esModule?c:{default:c}}var a={ignoreCase:!1,minOccurrences:1};function u(c,d,p){return(0,n.default)(c),p=(0,i.default)(p,a),p.ignoreCase?c.toLowerCase().split((0,r.default)(d).toLowerCase()).length>p.minOccurrences:c.split((0,r.default)(d)).length>p.minOccurrences}e.exports=t.default,e.exports.default=t.default}(Im,Im.exports)),Im.exports}var Om={exports:{}},x2;function xX(){return x2||(x2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a,u){return(0,n.default)(o),Object.prototype.toString.call(a)!=="[object RegExp]"&&(a=new RegExp(a,u)),!!o.match(a)}e.exports=t.default,e.exports.default=t.default}(Om,Om.exports)),Om.exports}var Rm={exports:{}},$m={exports:{}},w2;function S2(){return w2||(w2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function n(i){return Object.prototype.toString.call(i)==="[object RegExp]"}function r(i,o){for(var a=0;a<o.length;a++){var u=o[a];if(i===u||n(u)&&u.test(i))return!0}return!1}e.exports=t.default,e.exports.default=t.default}($m,$m.exports)),$m.exports}var Dm={exports:{}},C2;function E2(){return C2||(C2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}function i(a){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},i(a)}function o(a,u){(0,n.default)(a);var c,d;i(u)==="object"?(c=u.min||0,d=u.max):(c=arguments[1],d=arguments[2]);var p=encodeURI(a).split(/%..|./).length-1;return p>=c&&(typeof d>"u"||p<=d)}e.exports=t.default,e.exports.default=t.default}(Dm,Dm.exports)),Dm.exports}var Lm={exports:{}},k2;function Rw(){return k2||(k2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=i(hi());function i(u){return u&&u.__esModule?u:{default:u}}var o={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function a(u,c){(0,n.default)(u),c=(0,r.default)(c,o),c.allow_trailing_dot&&u[u.length-1]==="."&&(u=u.substring(0,u.length-1)),c.allow_wildcard===!0&&u.indexOf("*.")===0&&(u=u.substring(2));var d=u.split("."),p=d[d.length-1];return c.require_tld&&(d.length<2||!c.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(p)||/\s/.test(p))||!c.allow_numeric_tld&&/^\d+$/.test(p)?!1:d.every(function(h){return!(h.length>63&&!c.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(h)||/[\uff01-\uff5e]/.test(h)||/^-|-$/.test(h)||!c.allow_underscores&&/_/.test(h))})}e.exports=t.default,e.exports.default=t.default}(Lm,Lm.exports)),Lm.exports}var Nm={exports:{}},A2;function Bm(){return A2||(A2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var n=r(Be());function r(p){return p&&p.__esModule?p:{default:p}}var i="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",o="(".concat(i,"[.]){3}").concat(i),a=new RegExp("^".concat(o,"$")),u="(?:[0-9a-fA-F]{1,4})",c=new RegExp("^("+"(?:".concat(u,":){7}(?:").concat(u,"|:)|")+"(?:".concat(u,":){6}(?:").concat(o,"|:").concat(u,"|:)|")+"(?:".concat(u,":){5}(?::").concat(o,"|(:").concat(u,"){1,2}|:)|")+"(?:".concat(u,":){4}(?:(:").concat(u,"){0,1}:").concat(o,"|(:").concat(u,"){1,3}|:)|")+"(?:".concat(u,":){3}(?:(:").concat(u,"){0,2}:").concat(o,"|(:").concat(u,"){1,4}|:)|")+"(?:".concat(u,":){2}(?:(:").concat(u,"){0,3}:").concat(o,"|(:").concat(u,"){1,5}|:)|")+"(?:".concat(u,":){1}(?:(:").concat(u,"){0,4}:").concat(o,"|(:").concat(u,"){1,6}|:)|")+"(?::((?::".concat(u,"){0,5}:").concat(o,"|(?::").concat(u,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function d(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,n.default)(p),h=String(h),h?h==="4"?a.test(p):h==="6"?c.test(p):!1:d(p,4)||d(p,6)}e.exports=t.default,e.exports.default=t.default}(Nm,Nm.exports)),Nm.exports}var I2;function T2(){return I2||(I2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=C;var n=c(Be()),r=c(S2()),i=c(E2()),o=c(Rw()),a=c(Bm()),u=c(hi());function c(k){return k&&k.__esModule?k:{default:k}}var d={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},p=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,h=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,m=/^[a-z\d]+$/,v=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,_=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,S=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,x=254;function b(k){var A=k.replace(/^"(.+)"$/,"$1");if(!A.trim())return!1;var I=/[\.";<>]/.test(A);if(I){if(A===k)return!1;var $=A.split('"').length===A.split('\\"').length;if(!$)return!1}return!0}function C(k,A){if((0,n.default)(k),A=(0,u.default)(A,d),A.require_display_name||A.allow_display_name){var I=k.match(p);if(I){var $=I[1];if(k=k.replace($,"").replace(/(^<|>$)/g,""),$.endsWith(" ")&&($=$.slice(0,-1)),!b($))return!1}else if(A.require_display_name)return!1}if(!A.ignore_max_length&&k.length>x)return!1;var B=k.split("@"),U=B.pop(),G=U.toLowerCase();if(A.host_blacklist.length>0&&(0,r.default)(G,A.host_blacklist)||A.host_whitelist.length>0&&!(0,r.default)(G,A.host_whitelist))return!1;var P=B.join("@");if(A.domain_specific_validation&&(G==="gmail.com"||G==="googlemail.com")){P=P.toLowerCase();var K=P.split("+")[0];if(!(0,i.default)(K.replace(/\./g,""),{min:6,max:30}))return!1;for(var re=K.split("."),ue=0;ue<re.length;ue++)if(!m.test(re[ue]))return!1}if(A.ignore_max_length===!1&&(!(0,i.default)(P,{max:64})||!(0,i.default)(U,{max:254})))return!1;if(!(0,o.default)(U,{require_tld:A.require_tld,ignore_max_length:A.ignore_max_length,allow_underscores:A.allow_underscores})){if(!A.allow_ip_domain)return!1;if(!(0,a.default)(U)){if(!U.startsWith("[")||!U.endsWith("]"))return!1;var Z=U.slice(1,-1);if(Z.length===0||!(0,a.default)(Z))return!1}}if(A.blacklisted_chars&&P.search(new RegExp("[".concat(A.blacklisted_chars,"]+"),"g"))!==-1)return!1;if(P[0]==='"'&&P[P.length-1]==='"')return P=P.slice(1,P.length-1),A.allow_utf8_local_part?S.test(P):v.test(P);for(var ie=A.allow_utf8_local_part?_:h,V=P.split("."),Q=0;Q<V.length;Q++)if(!ie.test(V[Q]))return!1;return!0}e.exports=t.default,e.exports.default=t.default}(Rm,Rm.exports)),Rm.exports}var Pm={exports:{}},M2;function wX(){return M2||(M2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=x;var n=u(Be()),r=u(S2()),i=u(Rw()),o=u(Bm()),a=u(hi());function u(b){return b&&b.__esModule?b:{default:b}}function c(b,C){return v(b)||m(b,C)||p(b,C)||d()}function d(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
944
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p(b,C){if(b){if(typeof b=="string")return h(b,C);var k={}.toString.call(b).slice(8,-1);return k==="Object"&&b.constructor&&(k=b.constructor.name),k==="Map"||k==="Set"?Array.from(b):k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k)?h(b,C):void 0}}function h(b,C){(C==null||C>b.length)&&(C=b.length);for(var k=0,A=Array(C);k<C;k++)A[k]=b[k];return A}function m(b,C){var k=b==null?null:typeof Symbol<"u"&&b[Symbol.iterator]||b["@@iterator"];if(k!=null){var A,I,$,B,U=[],G=!0,P=!1;try{if($=(k=k.call(b)).next,C!==0)for(;!(G=(A=$.call(k)).done)&&(U.push(A.value),U.length!==C);G=!0);}catch(K){P=!0,I=K}finally{try{if(!G&&k.return!=null&&(B=k.return(),Object(B)!==B))return}finally{if(P)throw I}}return U}}function v(b){if(Array.isArray(b))return b}var _={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0,max_allowed_length:2084},S=/^\[([^\]]+)\](?::([0-9]+))?$/;function x(b,C){if((0,n.default)(b),!b||/[\s<>]/.test(b)||b.indexOf("mailto:")===0||(C=(0,a.default)(C,_),C.validate_length&&b.length>C.max_allowed_length)||!C.allow_fragments&&b.includes("#")||!C.allow_query_components&&(b.includes("?")||b.includes("&")))return!1;var k,A,I,$,B,U,G,P;if(G=b.split("#"),b=G.shift(),G=b.split("?"),b=G.shift(),G=b.split("://"),G.length>1){if(k=G.shift().toLowerCase(),C.require_valid_protocol&&C.protocols.indexOf(k)===-1)return!1}else{if(C.require_protocol)return!1;if(b.slice(0,2)==="//"){if(!C.allow_protocol_relative_urls)return!1;G[0]=b.slice(2)}}if(b=G.join("://"),b==="")return!1;if(G=b.split("/"),b=G.shift(),b===""&&!C.require_host)return!0;if(G=b.split("@"),G.length>1){if(C.disallow_auth||G[0]===""||(A=G.shift(),A.indexOf(":")>=0&&A.split(":").length>2))return!1;var K=A.split(":"),re=c(K,2),ue=re[0],Z=re[1];if(ue===""&&Z==="")return!1}$=G.join("@"),U=null,P=null;var ie=$.match(S);if(ie?(I="",P=ie[1],U=ie[2]||null):(G=$.split(":"),I=G.shift(),G.length&&(U=G.join(":"))),U!==null&&U.length>0){if(B=parseInt(U,10),!/^[0-9]+$/.test(U)||B<=0||B>65535)return!1}else if(C.require_port)return!1;return C.host_whitelist?(0,r.default)(I,C.host_whitelist):I===""&&!C.require_host?!0:!(!(0,o.default)(I)&&!(0,i.default)(I,C)&&(!P||!(0,o.default)(P,6))||(I=I||P,C.host_blacklist&&(0,r.default)(I,C.host_blacklist)))}e.exports=t.default,e.exports.default=t.default}(Pm,Pm.exports)),Pm.exports}var Fm={exports:{}},O2;function SX(){return O2||(O2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var n=r(Be());function r(h){return h&&h.__esModule?h:{default:h}}var i=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/,o=/^([0-9a-fA-F]){12}$/,a=/^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/,u=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/,c=/^([0-9a-fA-F]){16}$/,d=/^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/;function p(h,m){return(0,n.default)(h),m!=null&&m.eui&&(m.eui=String(m.eui)),m!=null&&m.no_colons||m!=null&&m.no_separators?m.eui==="48"?o.test(h):m.eui==="64"?c.test(h):o.test(h)||c.test(h):(m==null?void 0:m.eui)==="48"?i.test(h)||a.test(h):(m==null?void 0:m.eui)==="64"?u.test(h)||d.test(h):p(h,{eui:"48"})||p(h,{eui:"64"})}e.exports=t.default,e.exports.default=t.default}(Fm,Fm.exports)),Fm.exports}var zm={exports:{}},R2;function CX(){return R2||(R2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n=i(Be()),r=i(Bm());function i(d){return d&&d.__esModule?d:{default:d}}var o=/^\d{1,3}$/,a=32,u=128;function c(d){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(0,n.default)(d);var h=d.split("/");if(h.length!==2||!o.test(h[1])||h[1].length>1&&h[1].startsWith("0"))return!1;var m=(0,r.default)(h[0],p);if(!m)return!1;var v=null;switch(String(p)){case"4":v=a;break;case"6":v=u;break;default:v=(0,r.default)(h[0],"6")?u:a}return h[1]<=v&&h[1]>=0}e.exports=t.default,e.exports.default=t.default}(zm,zm.exports)),zm.exports}var Um={exports:{}},$2;function D2(){return $2||($2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=_;var n=r(hi());function r(S){return S&&S.__esModule?S:{default:S}}function i(S,x){return u(S)||a(S,x)||d(S,x)||o()}function o(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
945
945
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(S,x){var b=S==null?null:typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(b!=null){var C,k,A,I,$=[],B=!0,U=!1;try{if(A=(b=b.call(S)).next,x!==0)for(;!(B=(C=A.call(b)).done)&&($.push(C.value),$.length!==x);B=!0);}catch(G){U=!0,k=G}finally{try{if(!B&&b.return!=null&&(I=b.return(),Object(I)!==I))return}finally{if(U)throw k}}return $}}function u(S){if(Array.isArray(S))return S}function c(S,x){var b=typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(!b){if(Array.isArray(S)||(b=d(S))||x){b&&(S=b);var C=0,k=function(){};return{s:k,n:function(){return C>=S.length?{done:!0}:{done:!1,value:S[C++]}},e:function(U){throw U},f:k}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
946
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var A,I=!0,$=!1;return{s:function(){b=b.call(S)},n:function(){var U=b.next();return I=U.done,U},e:function(U){$=!0,A=U},f:function(){try{I||b.return==null||b.return()}finally{if($)throw A}}}}function d(S,x){if(S){if(typeof S=="string")return p(S,x);var b={}.toString.call(S).slice(8,-1);return b==="Object"&&S.constructor&&(b=S.constructor.name),b==="Map"||b==="Set"?Array.from(S):b==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b)?p(S,x):void 0}}function p(S,x){(x==null||x>S.length)&&(x=S.length);for(var b=0,C=Array(x);b<x;b++)C[b]=S[b];return C}var h={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};function m(S){return/(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(S)}function v(S,x){for(var b=[],C=Math.max(S.length,x.length),k=0;k<C;k++)b.push([S[k],x[k]]);return b}function _(S,x){if(typeof x=="string"?x=(0,n.default)({format:x},h):x=(0,n.default)(x,h),typeof S=="string"&&m(x.format)){if(x.strictMode&&S.length!==x.format.length)return!1;var b=x.delimiters.find(function(ie){return x.format.indexOf(ie)!==-1}),C=x.strictMode?b:x.delimiters.find(function(ie){return S.indexOf(ie)!==-1}),k=v(S.split(C),x.format.toLowerCase().split(b)),A={},I=c(k),$;try{for(I.s();!($=I.n()).done;){var B=i($.value,2),U=B[0],G=B[1];if(!U||!G||U.length!==G.length)return!1;A[G.charAt(0)]=U}}catch(ie){I.e(ie)}finally{I.f()}var P=A.y;if(P.startsWith("-"))return!1;if(A.y.length===2){var K=parseInt(A.y,10);if(isNaN(K))return!1;var re=new Date().getFullYear()%100;K<re?P="20".concat(A.y):P="19".concat(A.y)}var ue=A.m;A.m.length===1&&(ue="0".concat(A.m));var Z=A.d;return A.d.length===1&&(Z="0".concat(A.d)),new Date("".concat(P,"-").concat(ue,"-").concat(Z,"T00:00:00.000Z")).getUTCDate()===+A.d}return x.strictMode?!1:Object.prototype.toString.call(S)==="[object Date]"&&isFinite(S)}e.exports=t.default,e.exports.default=t.default}(Um,Um.exports)),Um.exports}var jm={exports:{}},L3;function EX(){return L3||(L3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=r(hi());function r(u){return u&&u.__esModule?u:{default:u}}var i={hourFormat:"hour24",mode:"default"},o={hour24:{default:/^([01]?[0-9]|2[0-3]):([0-5][0-9])$/,withSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/},hour12:{default:/^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/,withSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/}};function a(u,c){return c=(0,n.default)(c,i),typeof u!="string"?!1:o[c.hourFormat][c.mode].test(u)}e.exports=t.default,e.exports.default=t.default}(jm,jm.exports)),jm.exports}var qm={exports:{}},N3;function kX(){return N3||(N3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=r(Be());function r(c){return c&&c.__esModule?c:{default:c}}var i={loose:!1},o=["true","false","1","0"],a=[].concat(o,["yes","no"]);function u(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return(0,n.default)(c),d.loose?a.includes(c.toLowerCase()):o.includes(c)}e.exports=t.default,e.exports.default=t.default}(qm,qm.exports)),qm.exports}var Hm={exports:{}},B3;function AX(){return B3||(B3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=C;var n=r(Be());function r(k){return k&&k.__esModule?k:{default:k}}var i="([A-Za-z]{3}(-[A-Za-z]{3}){0,2})",o="(([a-zA-Z]{2,3}(-".concat(i,")?)|([a-zA-Z]{5,8}))"),a="([A-Za-z]{4})",u="([A-Za-z]{2}|\\d{3})",c="([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))",d="(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])",p="(".concat(d,"(-[A-Za-z0-9]{2,8})+)"),h="(x(-[A-Za-z0-9]{1,8})+)",m="((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))",v="((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))",_="(".concat(m,"|").concat(v,")"),S="(-|_)",x="".concat(o,"(").concat(S).concat(a,")?(").concat(S).concat(u,")?(").concat(S).concat(c,")*(").concat(S).concat(p,")*(").concat(S).concat(h,")?"),b=new RegExp("(^".concat(h,"$)|(^").concat(_,"$)|(^").concat(x,"$)"));function C(k){return(0,n.default)(k),b.test(k)}e.exports=t.default,e.exports.default=t.default}(Hm,Hm.exports)),Hm.exports}var Gm={exports:{}},P3;function IX(){return P3||(P3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^(?!(1[3-9])|(20)|(3[3-9])|(4[0-9])|(5[0-9])|(60)|(7[3-9])|(8[1-9])|(9[0-2])|(9[3-9]))[0-9]{9}$/;function o(a){if((0,n.default)(a),!i.test(a))return!1;for(var u=0,c=0;c<a.length;c++)c%3===0?u+=a[c]*3:c%3===1?u+=a[c]*7:u+=a[c]*1;return u%10===0}e.exports=t.default,e.exports.default=t.default}(Gm,Gm.exports)),Gm.exports}var ju={},F3;function TX(){if(F3)return ju;F3=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.default=r,ju.locales=void 0;var e=n(Be()),t=_d();function n(i){return i&&i.__esModule?i:{default:i}}function r(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,e.default)(i);var u=i,c=a.ignore;if(c)if(c instanceof RegExp)u=u.replace(c,"");else if(typeof c=="string")u=u.replace(new RegExp("[".concat(c.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(o in t.alpha)return t.alpha[o].test(u);throw new Error("Invalid locale '".concat(o,"'"))}return ju.locales=Object.keys(t.alpha),ju}var qu={},z3;function MX(){if(z3)return qu;z3=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.default=r,qu.locales=void 0;var e=n(Be()),t=_d();function n(i){return i&&i.__esModule?i:{default:i}}function r(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,e.default)(i);var u=i,c=a.ignore;if(c)if(c instanceof RegExp)u=u.replace(c,"");else if(typeof c=="string")u=u.replace(new RegExp("[".concat(c.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(o in t.alphanumeric)return t.alphanumeric[o].test(u);throw new Error("Invalid locale '".concat(o,"'"))}return qu.locales=Object.keys(t.alphanumeric),qu}var Vm={exports:{}},U3;function OX(){return U3||(U3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=_d();function i(u){return u&&u.__esModule?u:{default:u}}var o=/^[0-9]+$/;function a(u,c){return(0,n.default)(u),c&&c.no_symbols?o.test(u):new RegExp("^[+-]?([0-9]*[".concat((c||{}).locale?r.decimal[c.locale]:".","])?[0-9]+$")).test(u)}e.exports=t.default,e.exports.default=t.default}(Vm,Vm.exports)),Vm.exports}var Hu={},j3;function RX(){if(j3)return Hu;j3=1,Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.default=r,Hu.locales=void 0;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n={AM:/^[A-Z]{2}\d{7}$/,AR:/^[A-Z]{3}\d{6}$/,AT:/^[A-Z]\d{7}$/,AU:/^[A-Z]\d{7}$/,AZ:/^[A-Z]{1}\d{8}$/,BE:/^[A-Z]{2}\d{6}$/,BG:/^\d{9}$/,BR:/^[A-Z]{2}\d{6}$/,BY:/^[A-Z]{2}\d{7}$/,CA:/^[A-Z]{2}\d{6}$/,CH:/^[A-Z]\d{7}$/,CN:/^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,CY:/^[A-Z](\d{6}|\d{8})$/,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,DK:/^\d{9}$/,DZ:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,FI:/^[A-Z]{2}\d{7}$/,FR:/^\d{2}[A-Z]{2}\d{5}$/,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/,IE:/^[A-Z0-9]{2}\d{7}$/,IN:/^[A-Z]{1}-?\d{7}$/,ID:/^[A-C]\d{7}$/,IR:/^[A-Z]\d{8}$/,IS:/^(A)\d{7}$/,IT:/^[A-Z0-9]{2}\d{7}$/,JM:/^[Aa]\d{7}$/,JP:/^[A-Z]{2}\d{7}$/,KR:/^[MS]\d{8}$/,KZ:/^[a-zA-Z]\d{7}$/,LI:/^[a-zA-Z]\d{5}$/,LT:/^[A-Z0-9]{8}$/,LU:/^[A-Z0-9]{8}$/,LV:/^[A-Z0-9]{2}\d{7}$/,LY:/^[A-Z0-9]{8}$/,MT:/^\d{7}$/,MZ:/^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,MY:/^[AHK]\d{8}$/,MX:/^\d{10,11}$/,NL:/^[A-Z]{2}[A-Z0-9]{6}\d$/,NZ:/^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/,PH:/^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/,PK:/^[A-Z]{2}\d{7}$/,PL:/^[A-Z]{2}\d{7}$/,PT:/^[A-Z]\d{6}$/,RO:/^\d{8,9}$/,RU:/^\d{9}$/,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/,SK:/^[0-9A-Z]\d{7}$/,TH:/^[A-Z]{1,2}\d{6,7}$/,TR:/^[A-Z]\d{8}$/,UA:/^[A-Z]{2}\d{6}$/,US:/^\d{9}$/,ZA:/^[TAMD]\d{8}$/};Hu.locales=Object.keys(n);function r(i,o){(0,e.default)(i);var a=i.replace(/\s/g,"").toUpperCase();return o.toUpperCase()in n&&n[o].test(a)}return Hu}var Zm={exports:{}},Ym={exports:{}},q3;function $w(){return q3||(q3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(Be()),r=i(l3());function i(c){return c&&c.__esModule?c:{default:c}}var o=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,a=/^[-+]?[0-9]+$/;function u(c,d){(0,n.default)(c),d=d||{};var p=d.allow_leading_zeroes===!1?o:a,h=!d.hasOwnProperty("min")||(0,r.default)(d.min)||c>=d.min,m=!d.hasOwnProperty("max")||(0,r.default)(d.max)||c<=d.max,v=!d.hasOwnProperty("lt")||(0,r.default)(d.lt)||c<d.lt,_=!d.hasOwnProperty("gt")||(0,r.default)(d.gt)||c>d.gt;return p.test(c)&&h&&m&&v&&_}e.exports=t.default,e.exports.default=t.default}(Ym,Ym.exports)),Ym.exports}var H3;function $X(){return H3||(H3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r($w());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o,{allow_leading_zeroes:!1,min:0,max:65535})}e.exports=t.default,e.exports.default=t.default}(Zm,Zm.exports)),Zm.exports}var Wm={exports:{}},G3;function DX(){return G3||(G3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o),o===o.toLowerCase()}e.exports=t.default,e.exports.default=t.default}(Wm,Wm.exports)),Wm.exports}var Km={exports:{}},V3;function LX(){return V3||(V3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o),o===o.toUpperCase()}e.exports=t.default,e.exports.default=t.default}(Km,Km.exports)),Km.exports}var Qm={exports:{}},Z3;function NX(){return Z3||(Z3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=r(Be());function r(u){return u&&u.__esModule?u:{default:u}}var i=/^[0-9]{15}$/,o=/^\d{2}-\d{6}-\d{6}-\d{1}$/;function a(u,c){(0,n.default)(u),c=c||{};var d=i;if(c.allow_hyphens&&(d=o),!d.test(u))return!1;u=u.replace(/-/g,"");for(var p=0,h=2,m=14,v=0;v<m;v++){var _=u.substring(m-v-1,m-v),S=parseInt(_,10)*h;S>=10?p+=S%10+1:p+=S,h===1?h+=1:h-=1}var x=(10-p%10)%10;return x===parseInt(u.substring(14,15),10)}e.exports=t.default,e.exports.default=t.default}(Qm,Qm.exports)),Qm.exports}var Xm={exports:{}},Y3;function BX(){return Y3||(Y3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^[\x00-\x7F]+$/;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(Xm,Xm.exports)),Xm.exports}var Gu={},W3;function K3(){if(W3)return Gu;W3=1,Object.defineProperty(Gu,"__esModule",{value:!0}),Gu.default=r,Gu.fullWidth=void 0;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n=Gu.fullWidth=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function r(i){return(0,e.default)(i),n.test(i)}return Gu}var Vu={},Q3;function X3(){if(Q3)return Vu;Q3=1,Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.default=r,Vu.halfWidth=void 0;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n=Vu.halfWidth=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function r(i){return(0,e.default)(i),n.test(i)}return Vu}var Jm={exports:{}},J3;function PX(){return J3||(J3=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(Be()),r=K3(),i=X3();function o(u){return u&&u.__esModule?u:{default:u}}function a(u){return(0,n.default)(u),r.fullWidth.test(u)&&i.halfWidth.test(u)}e.exports=t.default,e.exports.default=t.default}(Jm,Jm.exports)),Jm.exports}var ev={exports:{}},eD;function FX(){return eD||(eD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/[^\x00-\x7F]/;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(ev,ev.exports)),ev.exports}var tv={exports:{}},nv={exports:{}},tD;function zX(){return tD||(tD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r,i){var o=r.join("");return new RegExp(o,i)}e.exports=t.default,e.exports.default=t.default}(nv,nv.exports)),nv.exports}var nD;function UX(){return nD||(nD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=i(zX());function i(u){return u&&u.__esModule?u:{default:u}}var o=(0,r.default)(["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)","(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))","?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$"],"i");function a(u){return(0,n.default)(u),o.test(u)}e.exports=t.default,e.exports.default=t.default}(tv,tv.exports)),tv.exports}var rv={exports:{}},rD;function jX(){return rD||(rD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(rv,rv.exports)),rv.exports}var iv={exports:{}},ov={exports:{}},iD;function qX(){return iD||(iD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(i,o){return i.some(function(a){return o===a})};t.default=n,e.exports=t.default,e.exports.default=t.default}(ov,ov.exports)),ov.exports}var oD;function HX(){return oD||(oD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var n=a(hi()),r=a(Be()),i=a(qX()),o=_d();function a(h){return h&&h.__esModule?h:{default:h}}function u(h){var m=new RegExp("^[-+]?([0-9]+)?(\\".concat(o.decimal[h.locale],"[0-9]{").concat(h.decimal_digits,"})").concat(h.force_decimal?"":"?","$"));return m}var c={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},d=["","-","+"];function p(h,m){if((0,r.default)(h),m=(0,n.default)(m,c),m.locale in o.decimal)return!(0,i.default)(d,h.replace(/ /g,""))&&u(m).test(h);throw new Error("Invalid locale '".concat(m.locale,"'"))}e.exports=t.default,e.exports.default=t.default}(iv,iv.exports)),iv.exports}var av={exports:{}},aD;function sD(){return aD||(aD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^(0x|0h)?[0-9A-F]+$/i;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(av,av.exports)),av.exports}var sv={exports:{}},lD;function GX(){return lD||(lD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^(0o)?[0-7]+$/i;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(sv,sv.exports)),sv.exports}var lv={exports:{}},uD;function VX(){return uD||(uD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=i(Be()),r=i(h3());function i(a){return a&&a.__esModule?a:{default:a}}function o(a,u){return(0,n.default)(a),(0,r.default)(a)%parseInt(u,10)===0}e.exports=t.default,e.exports.default=t.default}(lv,lv.exports)),lv.exports}var uv={exports:{}},cD;function ZX(){return cD||(cD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(uv,uv.exports)),uv.exports}var cv={exports:{}},fD;function YX(){return fD||(fD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var n=r(Be());function r(h){return h&&h.__esModule?h:{default:h}}function i(h){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},i(h)}var o=/^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/,a=/^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/,u=/^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/,c=/^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/,d=/^rgba?/;function p(h,m){(0,n.default)(h);var v=!1,_=!0;if(i(m)!=="object"?arguments.length>=2&&(_=arguments[1]):(v=m.allowSpaces!==void 0?m.allowSpaces:v,_=m.includePercentValues!==void 0?m.includePercentValues:_),v){if(!d.test(h))return!1;h=h.replace(/\s/g,"")}return _?o.test(h)||a.test(h)||u.test(h)||c.test(h):o.test(h)||a.test(h)}e.exports=t.default,e.exports.default=t.default}(cv,cv.exports)),cv.exports}var fv={exports:{}},dD;function WX(){return dD||(dD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=r(Be());function r(u){return u&&u.__esModule?u:{default:u}}var i=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i,o=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i;function a(u){(0,n.default)(u);var c=u.replace(/\s+/g," ").replace(/\s?(hsla?\(|\)|,)\s?/ig,"$1");return c.indexOf(",")!==-1?i.test(c):o.test(c)}e.exports=t.default,e.exports.default=t.default}(fv,fv.exports)),fv.exports}var dv={exports:{}},hD;function KX(){return hD||(hD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(dv,dv.exports)),dv.exports}var Zu={},pD;function QX(){if(pD)return Zu;pD=1,Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.default=a,Zu.locales=void 0;var e=t(Be());function t(u){return u&&u.__esModule?u:{default:u}}var n={AD:/^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,AE:/^(AE[0-9]{2})\d{3}\d{16}$/,AL:/^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,AT:/^(AT[0-9]{2})\d{16}$/,AZ:/^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,BA:/^(BA[0-9]{2})\d{16}$/,BE:/^(BE[0-9]{2})\d{12}$/,BG:/^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,BH:/^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,BR:/^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,BY:/^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,CH:/^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,CR:/^(CR[0-9]{2})\d{18}$/,CY:/^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,CZ:/^(CZ[0-9]{2})\d{20}$/,DE:/^(DE[0-9]{2})\d{18}$/,DK:/^(DK[0-9]{2})\d{14}$/,DO:/^(DO[0-9]{2})[A-Z]{4}\d{20}$/,DZ:/^(DZ\d{24})$/,EE:/^(EE[0-9]{2})\d{16}$/,EG:/^(EG[0-9]{2})\d{25}$/,ES:/^(ES[0-9]{2})\d{20}$/,FI:/^(FI[0-9]{2})\d{14}$/,FO:/^(FO[0-9]{2})\d{14}$/,FR:/^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,GB:/^(GB[0-9]{2})[A-Z]{4}\d{14}$/,GE:/^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,GI:/^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,GL:/^(GL[0-9]{2})\d{14}$/,GR:/^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,GT:/^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,HR:/^(HR[0-9]{2})\d{17}$/,HU:/^(HU[0-9]{2})\d{24}$/,IE:/^(IE[0-9]{2})[A-Z]{4}\d{14}$/,IL:/^(IL[0-9]{2})\d{19}$/,IQ:/^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,IR:/^(IR[0-9]{2})0\d{2}0\d{18}$/,IS:/^(IS[0-9]{2})\d{22}$/,IT:/^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,JO:/^(JO[0-9]{2})[A-Z]{4}\d{22}$/,KW:/^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,KZ:/^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,LB:/^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,LC:/^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,LI:/^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,LT:/^(LT[0-9]{2})\d{16}$/,LU:/^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,LV:/^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,MA:/^(MA[0-9]{26})$/,MC:/^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,MD:/^(MD[0-9]{2})[A-Z0-9]{20}$/,ME:/^(ME[0-9]{2})\d{18}$/,MK:/^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,MR:/^(MR[0-9]{2})\d{23}$/,MT:/^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,MU:/^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,MZ:/^(MZ[0-9]{2})\d{21}$/,NL:/^(NL[0-9]{2})[A-Z]{4}\d{10}$/,NO:/^(NO[0-9]{2})\d{11}$/,PK:/^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,PL:/^(PL[0-9]{2})\d{24}$/,PS:/^(PS[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,PT:/^(PT[0-9]{2})\d{21}$/,QA:/^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,RO:/^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,RS:/^(RS[0-9]{2})\d{18}$/,SA:/^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,SC:/^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,SE:/^(SE[0-9]{2})\d{20}$/,SI:/^(SI[0-9]{2})\d{15}$/,SK:/^(SK[0-9]{2})\d{20}$/,SM:/^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,SV:/^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,TL:/^(TL[0-9]{2})\d{19}$/,TN:/^(TN[0-9]{2})\d{20}$/,TR:/^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,UA:/^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,VA:/^(VA[0-9]{2})\d{18}$/,VG:/^(VG[0-9]{2})[A-Z]{4}\d{16}$/,XK:/^(XK[0-9]{2})\d{16}$/};function r(u){var c=u.filter(function(d){return!(d in n)});return!(c.length>0)}function i(u,c){var d=u.replace(/[\s\-]+/gi,"").toUpperCase(),p=d.slice(0,2).toUpperCase(),h=p in n;if(c.whitelist){if(!r(c.whitelist))return!1;var m=c.whitelist.includes(p);if(!m)return!1}if(c.blacklist){var v=c.blacklist.includes(p);if(v)return!1}return h&&n[p].test(d)}function o(u){var c=u.replace(/[^A-Z0-9]+/gi,"").toUpperCase(),d=c.slice(4)+c.slice(0,4),p=d.replace(/[A-Z]/g,function(m){return m.charCodeAt(0)-55}),h=p.match(/\d{1,7}/g).reduce(function(m,v){return Number(m+v)%97},"");return h===1}function a(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,e.default)(u),i(u,c)&&o(u)}return Zu.locales=Object.keys(n),Zu}var hv={exports:{}},Yu={},gD;function mD(){if(gD)return Yu;gD=1,Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.CountryCodes=void 0,Yu.default=r;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n=new Set(["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]);function r(i){return(0,e.default)(i),n.has(i.toUpperCase())}return Yu.CountryCodes=n,Yu}var vD;function XX(){return vD||(vD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=mD();function i(u){return u&&u.__esModule?u:{default:u}}var o=/^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;function a(u){(0,n.default)(u);var c=u.slice(4,6).toUpperCase();return!r.CountryCodes.has(c)&&c!=="XK"?!1:o.test(u)}e.exports=t.default,e.exports.default=t.default}(hv,hv.exports)),hv.exports}var pv={exports:{}},yD;function JX(){return yD||(yD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^[a-f0-9]{32}$/;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(pv,pv.exports)),pv.exports}var gv={exports:{}},_D;function eJ(){return _D||(_D=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};function o(a,u){(0,n.default)(a);var c=new RegExp("^[a-fA-F0-9]{".concat(i[u],"}$"));return c.test(a)}e.exports=t.default,e.exports.default=t.default}(gv,gv.exports)),gv.exports}var mv={exports:{}},vv={exports:{}},bD;function xD(){return bD||(bD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n=i(Be()),r=i(hi());function i(d){return d&&d.__esModule?d:{default:d}}var o=/[^A-Z0-9+\/=]/i,a=/^[A-Z0-9_\-]*$/i,u={urlSafe:!1};function c(d,p){(0,n.default)(d),p=(0,r.default)(p,u);var h=d.length;if(p.urlSafe)return a.test(d);if(h%4!==0||o.test(d))return!1;var m=d.indexOf("=");return m===-1||m===h-1||m===h-2&&d[h-1]==="="}e.exports=t.default,e.exports.default=t.default}(vv,vv.exports)),vv.exports}var wD;function tJ(){return wD||(wD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=i(Be()),r=i(xD());function i(a){return a&&a.__esModule?a:{default:a}}function o(a){(0,n.default)(a);var u=a.split("."),c=u.length;return c!==3?!1:u.reduce(function(d,p){return d&&(0,r.default)(p,{urlSafe:!0})},!0)}e.exports=t.default,e.exports.default=t.default}(mv,mv.exports)),mv.exports}var yv={exports:{}},SD;function nJ(){return SD||(SD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(Be()),r=i(hi());function i(c){return c&&c.__esModule?c:{default:c}}function o(c){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},o(c)}var a={allow_primitives:!1};function u(c,d){(0,n.default)(c);try{d=(0,r.default)(d,a);var p=[];d.allow_primitives&&(p=[null,!1,!0]);var h=JSON.parse(c);return p.includes(h)||!!h&&o(h)==="object"}catch{}return!1}e.exports=t.default,e.exports.default=t.default}(yv,yv.exports)),yv.exports}var _v={exports:{}},CD;function rJ(){return CD||(CD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=i(hi());function i(u){return u&&u.__esModule?u:{default:u}}var o={ignore_whitespace:!1};function a(u,c){return(0,n.default)(u),c=(0,r.default)(c,o),(c.ignore_whitespace?u.trim().length:u.length)===0}e.exports=t.default,e.exports.default=t.default}(_v,_v.exports)),_v.exports}var bv={exports:{}},ED;function iJ(){return ED||(ED=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}function i(a){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},i(a)}function o(a,u){(0,n.default)(a);var c,d;i(u)==="object"?(c=u.min||0,d=u.max):(c=arguments[1]||0,d=arguments[2]);var p=a.match(/(\uFE0F|\uFE0E)/g)||[],h=a.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],m=a.length-p.length-h.length,v=m>=c&&(typeof d>"u"||m<=d);return v&&Array.isArray(u==null?void 0:u.discreteLengths)?u.discreteLengths.some(function(_){return _===m}):v}e.exports=t.default,e.exports.default=t.default}(bv,bv.exports)),bv.exports}var xv={exports:{}},kD;function oJ(){return kD||(kD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o),/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/i.test(o)}e.exports=t.default,e.exports.default=t.default}(xv,xv.exports)),xv.exports}var wv={exports:{}},AD;function aJ(){return AD||(AD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i={1:/^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,2:/^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,6:/^[0-9A-F]{8}-[0-9A-F]{4}-6[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,7:/^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,8:/^[0-9A-F]{8}-[0-9A-F]{4}-8[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,nil:/^00000000-0000-0000-0000-000000000000$/i,max:/^ffffffff-ffff-ffff-ffff-ffffffffffff$/i,all:/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i};function o(a,u){return(0,n.default)(a),u==null&&(u="all"),u in i?i[u].test(a):!1}e.exports=t.default,e.exports.default=t.default}(wv,wv.exports)),wv.exports}var Sv={exports:{}},ID;function sJ(){return ID||(ID=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=i(Be()),r=i(sD());function i(a){return a&&a.__esModule?a:{default:a}}function o(a){return(0,n.default)(a),(0,r.default)(a)&&a.length===24}e.exports=t.default,e.exports.default=t.default}(Sv,Sv.exports)),Sv.exports}var Cv={exports:{}},TD;function lJ(){return TD||(TD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Ow());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){var u=(a==null?void 0:a.comparisonDate)||a||Date().toString(),c=(0,n.default)(u),d=(0,n.default)(o);return!!(d&&c&&d>c)}e.exports=t.default,e.exports.default=t.default}(Cv,Cv.exports)),Cv.exports}var Ev={exports:{}},MD;function uJ(){return MD||(MD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=i(Be()),r=i(Ow());function i(a){return a&&a.__esModule?a:{default:a}}function o(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:String(new Date);(0,n.default)(a);var c=(0,r.default)(u),d=(0,r.default)(a);return!!(d&&c&&d<c)}e.exports=t.default,e.exports.default=t.default}(Ev,Ev.exports)),Ev.exports}var kv={exports:{}},OD;function cJ(){return OD||(OD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=i(y3());function i(u){return u&&u.__esModule?u:{default:u}}function o(u){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},o(u)}function a(u,c){(0,n.default)(u);var d;if(Object.prototype.toString.call(c)==="[object Array]"){var p=[];for(d in c)({}).hasOwnProperty.call(c,d)&&(p[d]=(0,r.default)(c[d]));return p.indexOf(u)>=0}else{if(o(c)==="object")return c.hasOwnProperty(u);if(c&&typeof c.indexOf=="function")return c.indexOf(u)>=0}return!1}e.exports=t.default,e.exports.default=t.default}(kv,kv.exports)),kv.exports}var Av={exports:{}},RD;function $D(){return RD||(RD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){(0,n.default)(o);for(var a=o.replace(/[- ]+/g,""),u=0,c,d,p,h=a.length-1;h>=0;h--)c=a.substring(h,h+1),d=parseInt(c,10),p?(d*=2,d>=10?u+=d%10+1:u+=d):u+=d,p=!p;return!!(u%10===0&&a)}e.exports=t.default,e.exports.default=t.default}(Av,Av.exports)),Av.exports}var Iv={exports:{}},DD;function fJ(){return DD||(DD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(Be()),r=i($D());function i(c){return c&&c.__esModule?c:{default:c}}var o={amex:/^3[47][0-9]{13}$/,dinersclub:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,discover:/^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,jcb:/^(?:2131|1800|35\d{3})\d{11}$/,mastercard:/^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,unionpay:/^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,visa:/^(?:4[0-9]{12})(?:[0-9]{3,6})?$/},a=function(){var c=[];for(var d in o)o.hasOwnProperty(d)&&c.push(o[d]);return c}();function u(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(c);var p=d.provider,h=c.replace(/[- ]+/g,"");if(p&&p.toLowerCase()in o){if(!o[p.toLowerCase()].test(h))return!1}else{if(p&&!(p.toLowerCase()in o))throw new Error("".concat(p," is not a valid credit card provider."));if(!a.some(function(m){return m.test(h)}))return!1}return(0,r.default)(c)}e.exports=t.default,e.exports.default=t.default}(Iv,Iv.exports)),Iv.exports}var Tv={exports:{}},LD;function dJ(){return LD||(LD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=i($w());function i(u){return u&&u.__esModule?u:{default:u}}var o={PL:function(c){(0,n.default)(c);var d={1:1,2:3,3:7,4:9,5:1,6:3,7:7,8:9,9:1,10:3,11:0};if(c!=null&&c.length===11&&(0,r.default)(c,{allow_leading_zeroes:!0})){var p=c.split("").slice(0,-1),h=p.reduce(function(_,S,x){return _+Number(S)*d[x+1]},0),m=h%10,v=Number(c.charAt(c.length-1));if(m===0&&v===0||v===10-m)return!0}return!1},ES:function(c){(0,n.default)(c);var d=/^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/,p={X:0,Y:1,Z:2},h=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"],m=c.trim().toUpperCase();if(!d.test(m))return!1;var v=m.slice(0,-1).replace(/[X,Y,Z]/g,function(_){return p[_]});return m.endsWith(h[v%23])},FI:function(c){if((0,n.default)(c),c.length!==11||!c.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/))return!1;var d="0123456789ABCDEFHJKLMNPRSTUVWXY",p=parseInt(c.slice(0,6),10)*1e3+parseInt(c.slice(7,10),10),h=p%31,m=d[h];return m===c.slice(10,11)},IN:function(c){var d=/^[1-9]\d{3}\s?\d{4}\s?\d{4}$/,p=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],h=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],m=c.trim();if(!d.test(m))return!1;var v=0,_=m.replace(/\s/g,"").split("").map(Number).reverse();return _.forEach(function(S,x){v=p[v][h[x%8][S]]}),v===0},IR:function(c){if(!c.match(/^\d{10}$/)||(c="0000".concat(c).slice(c.length-6),parseInt(c.slice(3,9),10)===0))return!1;for(var d=parseInt(c.slice(9,10),10),p=0,h=0;h<9;h++)p+=parseInt(c.slice(h,h+1),10)*(10-h);return p%=11,p<2&&d===p||p>=2&&d===11-p},IT:function(c){return c.length!==9||c==="CA00000AA"?!1:c.search(/C[A-Z]\d{5}[A-Z]{2}/i)>-1},NO:function(c){var d=c.trim();if(isNaN(Number(d))||d.length!==11||d==="00000000000")return!1;var p=d.split("").map(Number),h=(11-(3*p[0]+7*p[1]+6*p[2]+1*p[3]+8*p[4]+9*p[5]+4*p[6]+5*p[7]+2*p[8])%11)%11,m=(11-(5*p[0]+4*p[1]+3*p[2]+2*p[3]+7*p[4]+6*p[5]+5*p[6]+4*p[7]+3*p[8]+2*h)%11)%11;return!(h!==p[9]||m!==p[10])},TH:function(c){if(!c.match(/^[1-8]\d{12}$/))return!1;for(var d=0,p=0;p<12;p++)d+=parseInt(c[p],10)*(13-p);return c[12]===((11-d%11)%10).toString()},LK:function(c){var d=/^[1-9]\d{8}[vx]$/i,p=/^[1-9]\d{11}$/i;return c.length===10&&d.test(c)?!0:!!(c.length===12&&p.test(c))},"he-IL":function(c){var d=/^\d{9}$/,p=c.trim();if(!d.test(p))return!1;for(var h=p,m=0,v,_=0;_<h.length;_++)v=Number(h[_])*(_%2+1),m+=v>9?v-9:v;return m%10===0},"ar-LY":function(c){var d=/^(1|2)\d{11}$/,p=c.trim();return!!d.test(p)},"ar-TN":function(c){var d=/^\d{8}$/,p=c.trim();return!!d.test(p)},"zh-CN":function(c){var d=["11","12","13","14","15","21","22","23","31","32","33","34","35","36","37","41","42","43","44","45","46","50","51","52","53","54","61","62","63","64","65","71","81","82","91"],p=["7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"],h=["1","0","X","9","8","7","6","5","4","3","2"],m=function(A){return d.includes(A)},v=function(A){var I=parseInt(A.substring(0,4),10),$=parseInt(A.substring(4,6),10),B=parseInt(A.substring(6),10),U=new Date(I,$-1,B);return U>new Date?!1:U.getFullYear()===I&&U.getMonth()===$-1&&U.getDate()===B},_=function(A){for(var I=A.substring(0,17),$=0,B=0;B<17;B++)$+=parseInt(I.charAt(B),10)*parseInt(p[B],10);var U=$%11;return h[U]},S=function(A){return _(A)===A.charAt(17).toUpperCase()},x=function(A){var I=/^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(A);if(!I)return!1;var $=A.substring(0,2);if(I=m($),!I)return!1;var B="19".concat(A.substring(6,12));return I=v(B),!!I},b=function(A){var I=/^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(A);if(!I)return!1;var $=A.substring(0,2);if(I=m($),!I)return!1;var B=A.substring(6,14);return I=v(B),I?S(A):!1},C=function(A){var I=/^\d{15}|(\d{17}(\d|x|X))$/.test(A);return I?A.length===15?x(A):b(A):!1};return C(c)},"zh-HK":function(c){c=c.trim();var d=/^[A-Z]{1,2}[0-9]{6}((\([0-9A]\))|(\[[0-9A]\])|([0-9A]))$/,p=/^[0-9]$/;if(c=c.toUpperCase(),!d.test(c))return!1;c=c.replace(/\[|\]|\(|\)/g,""),c.length===8&&(c="3".concat(c));for(var h=0,m=0;m<=7;m++){var v=void 0;p.test(c[m])?v=c[m]:v=(c[m].charCodeAt(0)-55)%11,h+=v*(9-m)}h%=11;var _;return h===0?_="0":h===1?_="A":_=String(11-h),_===c[c.length-1]},"zh-TW":function(c){var d={A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:34,J:18,K:19,L:20,M:21,N:22,O:35,P:23,Q:24,R:25,S:26,T:27,U:28,V:29,W:32,X:30,Y:31,Z:33},p=c.trim().toUpperCase();return/^[A-Z][0-9]{9}$/.test(p)?Array.from(p).reduce(function(h,m,v){if(v===0){var _=d[m];return _%10*9+Math.floor(_/10)}return v===9?(10-h%10-Number(m))%10===0:h+Number(m)*(9-v)},0):!1},PK:function(c){var d=/^[1-7][0-9]{4}-[0-9]{7}-[1-9]$/,p=c.trim();return d.test(p)}};function a(u,c){if((0,n.default)(u),c in o)return o[c](u);if(c==="any"){for(var d in o)if(o.hasOwnProperty(d)){var p=o[d];if(p(u))return!0}return!1}throw new Error("Invalid locale '".concat(c,"'"))}e.exports=t.default,e.exports.default=t.default}(Tv,Tv.exports)),Tv.exports}var Mv={exports:{}},ND;function hJ(){return ND||(ND=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var n=r(Be());function r(p){return p&&p.__esModule?p:{default:p}}var i=8,o=14,a=/^(\d{8}|\d{13}|\d{14})$/;function u(p,h){return p===i||p===o?h%2===0?3:1:h%2===0?1:3}function c(p){var h=p.slice(0,-1).split("").map(function(v,_){return Number(v)*u(p.length,_)}).reduce(function(v,_){return v+_},0),m=10-h%10;return m<10?m:0}function d(p){(0,n.default)(p);var h=Number(p.slice(-1));return a.test(p)&&h===c(p)}e.exports=t.default,e.exports.default=t.default}(Mv,Mv.exports)),Mv.exports}var Ov={exports:{}},BD;function pJ(){return BD||(BD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;function o(a){if((0,n.default)(a),!i.test(a))return!1;for(var u=!0,c=0,d=a.length-2;d>=0;d--)if(a[d]>="A"&&a[d]<="Z")for(var p=a[d].charCodeAt(0)-55,h=p%10,m=Math.trunc(p/10),v=0,_=[h,m];v<_.length;v++){var S=_[v];u?S>=5?c+=1+(S-5)*2:c+=S*2:c+=S,u=!u}else{var x=a[d].charCodeAt(0)-48;u?x>=5?c+=1+(x-5)*2:c+=x*2:c+=x,u=!u}var b=Math.trunc((c+9)/10)*10-c;return+a[a.length-1]===b}e.exports=t.default,e.exports.default=t.default}(Ov,Ov.exports)),Ov.exports}var Rv={exports:{}},PD;function gJ(){return PD||(PD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=r(Be());function r(c){return c&&c.__esModule?c:{default:c}}var i=/^(?:[0-9]{9}X|[0-9]{10})$/,o=/^(?:[0-9]{13})$/,a=[1,3];function u(c,d){(0,n.default)(c);var p=String((d==null?void 0:d.version)||d);if(!(d!=null&&d.version||d))return u(c,{version:10})||u(c,{version:13});var h=c.replace(/[\s-]+/g,""),m=0;if(p==="10"){if(!i.test(h))return!1;for(var v=0;v<p-1;v++)m+=(v+1)*h.charAt(v);if(h.charAt(9)==="X"?m+=100:m+=10*h.charAt(9),m%11===0)return!0}else if(p==="13"){if(!o.test(h))return!1;for(var _=0;_<12;_++)m+=a[_%2]*h.charAt(_);if(h.charAt(12)-(10-m%10)%10===0)return!0}return!1}e.exports=t.default,e.exports.default=t.default}(Rv,Rv.exports)),Rv.exports}var $v={exports:{}},FD;function mJ(){return FD||(FD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i="^\\d{4}-?\\d{3}[\\dX]$";function o(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(a);var c=i;if(c=u.require_hyphen?c.replace("?",""):c,c=u.case_sensitive?new RegExp(c):new RegExp(c,"i"),!c.test(a))return!1;for(var d=a.replace("-","").toUpperCase(),p=0,h=0;h<d.length;h++){var m=d[h];p+=(m==="X"?10:+m)*(8-h)}return p%11===0}e.exports=t.default,e.exports.default=t.default}($v,$v.exports)),$v.exports}var Dv={exports:{}},hl={},zD;function UD(){if(zD)return hl;zD=1,Object.defineProperty(hl,"__esModule",{value:!0}),hl.iso7064Check=e,hl.luhnCheck=t,hl.reverseMultiplyAndSum=n,hl.verhoeffCheck=r;function e(i){for(var o=10,a=0;a<i.length-1;a++)o=(parseInt(i[a],10)+o)%10===0?9:(parseInt(i[a],10)+o)%10*2%11;return o=o===1?0:11-o,o===parseInt(i[10],10)}function t(i){for(var o=0,a=!1,u=i.length-1;u>=0;u--){if(a){var c=parseInt(i[u],10)*2;c>9?o+=c.toString().split("").map(function(d){return parseInt(d,10)}).reduce(function(d,p){return d+p},0):o+=c}else o+=parseInt(i[u],10);a=!a}return o%10===0}function n(i,o){for(var a=0,u=0;u<i.length;u++)a+=i[u]*(o-u);return a}function r(i){for(var o=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],a=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],u=i.split("").reverse().join(""),c=0,d=0;d<u.length;d++)c=o[c][a[d%8][parseInt(u[d],10)]];return c===0}return hl}var jD;function vJ(){return jD||(jD=1,function(e,t){function n(N){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},n(N)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=He;var r=c(Be()),i=u(UD()),o=c(D3());function a(N){if(typeof WeakMap!="function")return null;var F=new WeakMap,Y=new WeakMap;return(a=function(_e){return _e?Y:F})(N)}function u(N,F){if(N&&N.__esModule)return N;if(N===null||n(N)!="object"&&typeof N!="function")return{default:N};var Y=a(F);if(Y&&Y.has(N))return Y.get(N);var ge={__proto__:null},_e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ie in N)if(Ie!=="default"&&{}.hasOwnProperty.call(N,Ie)){var We=_e?Object.getOwnPropertyDescriptor(N,Ie):null;We&&(We.get||We.set)?Object.defineProperty(ge,Ie,We):ge[Ie]=N[Ie]}return ge.default=N,Y&&Y.set(N,ge),ge}function c(N){return N&&N.__esModule?N:{default:N}}function d(N){return v(N)||m(N)||h(N)||p()}function p(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
947
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h(N,F){if(N){if(typeof N=="string")return _(N,F);var Y={}.toString.call(N).slice(8,-1);return Y==="Object"&&N.constructor&&(Y=N.constructor.name),Y==="Map"||Y==="Set"?Array.from(N):Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y)?_(N,F):void 0}}function m(N){if(typeof Symbol<"u"&&N[Symbol.iterator]!=null||N["@@iterator"]!=null)return Array.from(N)}function v(N){if(Array.isArray(N))return _(N)}function _(N,F){(F==null||F>N.length)&&(F=N.length);for(var Y=0,ge=Array(F);Y<F;Y++)ge[Y]=N[Y];return ge}function S(N){var F=N.slice(0,2),Y=parseInt(N.slice(2,4),10);Y>40?(Y-=40,F="20".concat(F)):Y>20?(Y-=20,F="18".concat(F)):F="19".concat(F),Y<10&&(Y="0".concat(Y));var ge="".concat(F,"/").concat(Y,"/").concat(N.slice(4,6));if(!(0,o.default)(ge,"YYYY/MM/DD"))return!1;for(var _e=N.split("").map(function(ne){return parseInt(ne,10)}),Ie=[2,4,8,5,10,9,7,3,6],We=0,nt=0;nt<Ie.length;nt++)We+=_e[nt]*Ie[nt];return We=We%11===10?0:We%11,We===_e[9]}function x(N){var F=N.split(""),Y=F.filter(function(_e,Ie){return Ie%2}).map(function(_e){return Number(_e)*2}).join("").split(""),ge=F.filter(function(_e,Ie){return!(Ie%2)}).concat(Y).map(function(_e){return Number(_e)}).reduce(function(_e,Ie){return _e+Ie});return ge%10===0}function b(N){N=N.replace(/\W/,"");var F=parseInt(N.slice(0,2),10);if(N.length===10)F<54?F="20".concat(F):F="19".concat(F);else{if(N.slice(6)==="000")return!1;if(F<54)F="19".concat(F);else return!1}F.length===3&&(F=[F.slice(0,2),"0",F.slice(2)].join(""));var Y=parseInt(N.slice(2,4),10);if(Y>50&&(Y-=50),Y>20){if(parseInt(F,10)<2004)return!1;Y-=20}Y<10&&(Y="0".concat(Y));var ge="".concat(F,"/").concat(Y,"/").concat(N.slice(4,6));if(!(0,o.default)(ge,"YYYY/MM/DD"))return!1;if(N.length===10&&parseInt(N,10)%11!==0){var _e=parseInt(N.slice(0,9),10)%11;if(parseInt(F,10)<1986&&_e===10){if(parseInt(N.slice(9),10)!==0)return!1}else return!1}return!0}function C(N){return i.luhnCheck(N)}function k(N){for(var F=N.split("").map(function(ne){return parseInt(ne,10)}),Y=[],ge=0;ge<F.length-1;ge++){Y.push("");for(var _e=0;_e<F.length-1;_e++)F[ge]===F[_e]&&(Y[ge]+=_e)}if(Y=Y.filter(function(ne){return ne.length>1}),Y.length!==2&&Y.length!==3)return!1;if(Y[0].length===3){for(var Ie=Y[0].split("").map(function(ne){return parseInt(ne,10)}),We=0,nt=0;nt<Ie.length-1;nt++)Ie[nt]+1===Ie[nt+1]&&(We+=1);if(We===2)return!1}return i.iso7064Check(N)}function A(N){N=N.replace(/\W/,"");var F=parseInt(N.slice(4,6),10),Y=N.slice(6,7);switch(Y){case"0":case"1":case"2":case"3":F="19".concat(F);break;case"4":case"9":F<37?F="20".concat(F):F="19".concat(F);break;default:if(F<37)F="20".concat(F);else if(F>58)F="18".concat(F);else return!1;break}F.length===3&&(F=[F.slice(0,2),"0",F.slice(2)].join(""));var ge="".concat(F,"/").concat(N.slice(2,4),"/").concat(N.slice(0,2));if(!(0,o.default)(ge,"YYYY/MM/DD"))return!1;for(var _e=N.split("").map(function(ne){return parseInt(ne,10)}),Ie=0,We=4,nt=0;nt<9;nt++)Ie+=_e[nt]*We,We-=1,We===1&&(We=7);return Ie%=11,Ie===1?!1:Ie===0?_e[9]===0:_e[9]===11-Ie}function I(N){for(var F=N.slice(0,8).split("").map(function(Ie){return parseInt(Ie,10)}),Y=0,ge=1;ge<F.length;ge+=2)Y+=F[ge];for(var _e=0;_e<F.length;_e+=2)F[_e]<2?Y+=1-F[_e]:(Y+=2*(F[_e]-2)+5,F[_e]>4&&(Y+=2));return String.fromCharCode(Y%26+65)===N.charAt(8)}function $(N){for(var F=N.split("").map(function(_e){return parseInt(_e,10)}),Y=0,ge=0;ge<8;ge++)Y+=F[ge]*Math.pow(2,8-ge);return Y%11%10===F[8]}function B(N){var F=i.reverseMultiplyAndSum(N.split("").slice(0,7).map(function(Y){return parseInt(Y,10)}),8);return N.length===9&&N[8]!=="W"&&(F+=(N[8].charCodeAt(0)-64)*9),F%=23,F===0?N[7].toUpperCase()==="W":N[7].toUpperCase()===String.fromCharCode(64+F)}var U={andover:["10","12"],atlanta:["60","67"],austin:["50","53"],brookhaven:["01","02","03","04","05","06","11","13","14","16","21","22","23","25","34","51","52","54","55","56","57","58","59","65"],cincinnati:["30","32","35","36","37","38","61"],fresno:["15","24"],internet:["20","26","27","45","46","47"],kansas:["40","44"],memphis:["94","95"],ogden:["80","90"],philadelphia:["33","39","41","42","43","46","48","62","63","64","66","68","71","72","73","74","75","76","77","81","82","83","84","85","86","87","88","91","92","93","98","99"],sba:["31"]};function G(){var N=[];for(var F in U)U.hasOwnProperty(F)&&N.push.apply(N,d(U[F]));return N}function P(N){return G().indexOf(N.slice(0,2))!==-1}function K(N){for(var F=0,Y=N.split(""),ge=parseInt(Y.pop(),10),_e=0;_e<Y.length;_e++)F+=Y[9-_e]*(2+_e%6);var Ie=11-F%11;return Ie===11?Ie=0:Ie===10&&(Ie=9),ge===Ie}function re(N){var F=N.toUpperCase().split("");if(isNaN(parseInt(F[0],10))&&F.length>1){var Y=0;switch(F[0]){case"Y":Y=1;break;case"Z":Y=2;break}F.splice(0,1,Y)}else for(;F.length<9;)F.unshift(0);var ge=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"];F=F.join("");var _e=parseInt(F.slice(0,8),10)%23;return F[8]===ge[_e]}function ue(N){var F=N.slice(1,3),Y=N.slice(0,1);switch(Y){case"1":case"2":F="18".concat(F);break;case"3":case"4":F="19".concat(F);break;default:F="20".concat(F);break}var ge="".concat(F,"/").concat(N.slice(3,5),"/").concat(N.slice(5,7));if(!(0,o.default)(ge,"YYYY/MM/DD"))return!1;for(var _e=N.split("").map(function(me){return parseInt(me,10)}),Ie=0,We=1,nt=0;nt<10;nt++)Ie+=_e[nt]*We,We+=1,We===10&&(We=1);if(Ie%11===10){Ie=0,We=3;for(var ne=0;ne<10;ne++)Ie+=_e[ne]*We,We+=1,We===10&&(We=1);if(Ie%11===10)return _e[10]===0}return Ie%11===_e[10]}function Z(N){var F=N.slice(4,6),Y=N.slice(6,7);switch(Y){case"+":F="18".concat(F);break;case"-":F="19".concat(F);break;default:F="20".concat(F);break}var ge="".concat(F,"/").concat(N.slice(2,4),"/").concat(N.slice(0,2));if(!(0,o.default)(ge,"YYYY/MM/DD"))return!1;var _e=parseInt(N.slice(0,6)+N.slice(7,10),10)%31;if(_e<10)return _e===parseInt(N.slice(10),10);_e-=10;var Ie=["A","B","C","D","E","F","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y"];return Ie[_e]===N.slice(10)}function ie(N){if(N.slice(2,4)!=="00"||N.slice(4,6)!=="00"){var F="".concat(N.slice(0,2),"/").concat(N.slice(2,4),"/").concat(N.slice(4,6));if(!(0,o.default)(F,"YY/MM/DD"))return!1}var Y=97-parseInt(N.slice(0,9),10)%97,ge=parseInt(N.slice(9,11),10);return!(Y!==ge&&(Y=97-parseInt("2".concat(N.slice(0,9)),10)%97,Y!==ge))}function V(N){N=N.replace(/\s/g,"");var F=parseInt(N.slice(0,10),10)%511,Y=parseInt(N.slice(10,13),10);return F===Y}function Q(N){var F="".concat(N.slice(0,4),"/").concat(N.slice(4,6),"/").concat(N.slice(6,8));return!(0,o.default)(F,"YYYY/MM/DD")||!i.luhnCheck(N.slice(0,12))?!1:i.verhoeffCheck("".concat(N.slice(0,11)).concat(N[12]))}function ye(N){return i.iso7064Check(N)}function Te(N){for(var F=N.split("").map(function(_e){return parseInt(_e,10)}),Y=8,ge=1;ge<9;ge++)Y+=F[ge]*(ge+1);return Y%11===F[9]}function T(N){for(var F=!1,Y=!1,ge=0;ge<3;ge++)if(!F&&/[AEIOU]/.test(N[ge]))F=!0;else if(!Y&&F&&N[ge]==="X")Y=!0;else if(ge>0&&(F&&!Y&&!/[AEIOU]/.test(N[ge])||Y&&!/X/.test(N[ge])))return!1;return!0}function X(N){var F=N.toUpperCase().split("");if(!T(F.slice(0,3))||!T(F.slice(3,6)))return!1;for(var Y=[6,7,9,10,12,13,14],ge={L:"0",M:"1",N:"2",P:"3",Q:"4",R:"5",S:"6",T:"7",U:"8",V:"9"},_e=0,Ie=Y;_e<Ie.length;_e++){var We=Ie[_e];F[We]in ge&&F.splice(We,1,ge[F[We]])}var nt={A:"01",B:"02",C:"03",D:"04",E:"05",H:"06",L:"07",M:"08",P:"09",R:"10",S:"11",T:"12"},ne=nt[F[8]],me=parseInt(F[9]+F[10],10);me>40&&(me-=40),me<10&&(me="0".concat(me));var qe="".concat(F[6]).concat(F[7],"/").concat(ne,"/").concat(me);if(!(0,o.default)(qe,"YY/MM/DD"))return!1;for(var Xe=0,at=1;at<F.length-1;at+=2){var Tt=parseInt(F[at],10);isNaN(Tt)&&(Tt=F[at].charCodeAt(0)-65),Xe+=Tt}for(var Bt={A:1,B:0,C:5,D:7,E:9,F:13,G:15,H:17,I:19,J:21,K:2,L:4,M:18,N:20,O:11,P:3,Q:6,R:8,S:12,T:14,U:16,V:10,W:22,X:25,Y:24,Z:23,0:1,1:0},Et=0;Et<F.length-1;Et+=2){var Yt=0;if(F[Et]in Bt)Yt=Bt[F[Et]];else{var ft=parseInt(F[Et],10);Yt=2*ft+1,ft>4&&(Yt+=2)}Xe+=Yt}return String.fromCharCode(65+Xe%26)===F[15]}function ve(N){N=N.replace(/\W/,"");var F=N.slice(0,2);if(F!=="32"){var Y=N.slice(2,4);if(Y!=="00"){var ge=N.slice(4,6);switch(N[6]){case"0":ge="18".concat(ge);break;case"1":ge="19".concat(ge);break;default:ge="20".concat(ge);break}var _e="".concat(ge,"/").concat(N.slice(2,4),"/").concat(F);if(!(0,o.default)(_e,"YYYY/MM/DD"))return!1}for(var Ie=1101,We=[1,6,3,7,9,10,5,8,4,2],nt=0;nt<N.length-1;nt++)Ie-=parseInt(N[nt],10)*We[nt];return parseInt(N[10],10)===Ie%11}return!0}function L(N){if(N.length!==9){for(var F=N.toUpperCase().split("");F.length<8;)F.unshift(0);switch(N[7]){case"A":case"P":if(parseInt(F[6],10)===0)return!1;break;default:{var Y=parseInt(F.join("").slice(0,5),10);if(Y>32e3)return!1;var ge=parseInt(F.join("").slice(5,7),10);if(Y===ge)return!1}}}return!0}function we(N){return i.reverseMultiplyAndSum(N.split("").slice(0,8).map(function(F){return parseInt(F,10)}),9)%11===parseInt(N[8],10)}function Ue(N){if(N.length===10){for(var F=[6,5,7,2,3,4,5,6,7],Y=0,ge=0;ge<F.length;ge++)Y+=parseInt(N[ge],10)*F[ge];return Y%=11,Y===10?!1:Y===parseInt(N[9],10)}var _e=N.slice(0,2),Ie=parseInt(N.slice(2,4),10);Ie>80?(_e="18".concat(_e),Ie-=80):Ie>60?(_e="22".concat(_e),Ie-=60):Ie>40?(_e="21".concat(_e),Ie-=40):Ie>20?(_e="20".concat(_e),Ie-=20):_e="19".concat(_e),Ie<10&&(Ie="0".concat(Ie));var We="".concat(_e,"/").concat(Ie,"/").concat(N.slice(4,6));if(!(0,o.default)(We,"YYYY/MM/DD"))return!1;for(var nt=0,ne=1,me=0;me<N.length-1;me++)nt+=parseInt(N[me],10)*ne%10,ne+=2,ne>10?ne=1:ne===5&&(ne+=2);return nt=10-nt%10,nt===parseInt(N[10],10)}function de(N){if(N.length===11){var F,Y;if(F=0,N==="11111111111"||N==="22222222222"||N==="33333333333"||N==="44444444444"||N==="55555555555"||N==="66666666666"||N==="77777777777"||N==="88888888888"||N==="99999999999"||N==="00000000000")return!1;for(var ge=1;ge<=9;ge++)F+=parseInt(N.substring(ge-1,ge),10)*(11-ge);if(Y=F*10%11,Y===10&&(Y=0),Y!==parseInt(N.substring(9,10),10))return!1;F=0;for(var _e=1;_e<=10;_e++)F+=parseInt(N.substring(_e-1,_e),10)*(12-_e);return Y=F*10%11,Y===10&&(Y=0),Y===parseInt(N.substring(10,11),10)}if(N==="00000000000000"||N==="11111111111111"||N==="22222222222222"||N==="33333333333333"||N==="44444444444444"||N==="55555555555555"||N==="66666666666666"||N==="77777777777777"||N==="88888888888888"||N==="99999999999999")return!1;for(var Ie=N.length-2,We=N.substring(0,Ie),nt=N.substring(Ie),ne=0,me=Ie-7,qe=Ie;qe>=1;qe--)ne+=We.charAt(Ie-qe)*me,me-=1,me<2&&(me=9);var Xe=ne%11<2?0:11-ne%11;if(Xe!==parseInt(nt.charAt(0),10))return!1;Ie+=1,We=N.substring(0,Ie),ne=0,me=Ie-7;for(var at=Ie;at>=1;at--)ne+=We.charAt(Ie-at)*me,me-=1,me<2&&(me=9);return Xe=ne%11<2?0:11-ne%11,Xe===parseInt(nt.charAt(1),10)}function tt(N){var F=11-i.reverseMultiplyAndSum(N.split("").slice(0,8).map(function(Y){return parseInt(Y,10)}),9)%11;return F>9?parseInt(N[8],10)===0:F===parseInt(N[8],10)}function Ze(N){if(N.slice(0,4)!=="9000"){var F=N.slice(1,3);switch(N[0]){case"1":case"2":F="19".concat(F);break;case"3":case"4":F="18".concat(F);break;case"5":case"6":F="20".concat(F);break}var Y="".concat(F,"/").concat(N.slice(3,5),"/").concat(N.slice(5,7));if(Y.length===8){if(!(0,o.default)(Y,"YY/MM/DD"))return!1}else if(!(0,o.default)(Y,"YYYY/MM/DD"))return!1;for(var ge=N.split("").map(function(nt){return parseInt(nt,10)}),_e=[2,7,9,1,4,6,3,5,8,2,7,9],Ie=0,We=0;We<_e.length;We++)Ie+=ge[We]*_e[We];return Ie%11===10?ge[12]===1:ge[12]===Ie%11}return!0}function lt(N){if(N.length===9){if(N=N.replace(/\W/,""),N.slice(6)==="000")return!1;var F=parseInt(N.slice(0,2),10);if(F>53)return!1;F<10?F="190".concat(F):F="19".concat(F);var Y=parseInt(N.slice(2,4),10);Y>50&&(Y-=50),Y<10&&(Y="0".concat(Y));var ge="".concat(F,"/").concat(Y,"/").concat(N.slice(4,6));if(!(0,o.default)(ge,"YYYY/MM/DD"))return!1}return!0}function gt(N){var F=11-i.reverseMultiplyAndSum(N.split("").slice(0,7).map(function(Y){return parseInt(Y,10)}),8)%11;return F===10?parseInt(N[7],10)===0:F===parseInt(N[7],10)}function je(N){var F=N.slice(0);N.length>11&&(F=F.slice(2));var Y="",ge=F.slice(2,4),_e=parseInt(F.slice(4,6),10);if(N.length>11)Y=N.slice(0,4);else if(Y=N.slice(0,2),N.length===11&&_e<60){var Ie=new Date().getFullYear().toString(),We=parseInt(Ie.slice(0,2),10);if(Ie=parseInt(Ie,10),N[6]==="-")parseInt("".concat(We).concat(Y),10)>Ie?Y="".concat(We-1).concat(Y):Y="".concat(We).concat(Y);else if(Y="".concat(We-1).concat(Y),Ie-parseInt(Y,10)<100)return!1}_e>60&&(_e-=60),_e<10&&(_e="0".concat(_e));var nt="".concat(Y,"/").concat(ge,"/").concat(_e);if(nt.length===8){if(!(0,o.default)(nt,"YY/MM/DD"))return!1}else if(!(0,o.default)(nt,"YYYY/MM/DD"))return!1;return i.luhnCheck(N.replace(/\W/,""))}function Se(N){for(var F=N.split("").map(function(Ie){return parseInt(Ie,10)}),Y=[-1,5,7,9,4,6,10,5,7],ge=0,_e=0;_e<Y.length;_e++)ge+=F[_e]*Y[_e];return ge%11===10?F[9]===0:F[9]===ge%11}var Ye={"bg-BG":/^\d{10}$/,"cs-CZ":/^\d{6}\/{0,1}\d{3,4}$/,"de-AT":/^\d{9}$/,"de-DE":/^[1-9]\d{10}$/,"dk-DK":/^\d{6}-{0,1}\d{4}$/,"el-CY":/^[09]\d{7}[A-Z]$/,"el-GR":/^([0-4]|[7-9])\d{8}$/,"en-CA":/^\d{9}$/,"en-GB":/^\d{10}$|^(?!GB|NK|TN|ZZ)(?![DFIQUV])[A-Z](?![DFIQUVO])[A-Z]\d{6}[ABCD ]$/i,"en-IE":/^\d{7}[A-W][A-IW]{0,1}$/i,"en-US":/^\d{2}[- ]{0,1}\d{7}$/,"es-AR":/(20|23|24|27|30|33|34)[0-9]{8}[0-9]/,"es-ES":/^(\d{0,8}|[XYZKLM]\d{7})[A-HJ-NP-TV-Z]$/i,"et-EE":/^[1-6]\d{6}(00[1-9]|0[1-9][0-9]|[1-6][0-9]{2}|70[0-9]|710)\d$/,"fi-FI":/^\d{6}[-+A]\d{3}[0-9A-FHJ-NPR-Y]$/i,"fr-BE":/^\d{11}$/,"fr-FR":/^[0-3]\d{12}$|^[0-3]\d\s\d{2}(\s\d{3}){3}$/,"fr-LU":/^\d{13}$/,"hr-HR":/^\d{11}$/,"hu-HU":/^8\d{9}$/,"it-IT":/^[A-Z]{6}[L-NP-V0-9]{2}[A-EHLMPRST][L-NP-V0-9]{2}[A-ILMZ][L-NP-V0-9]{3}[A-Z]$/i,"lv-LV":/^\d{6}-{0,1}\d{5}$/,"mt-MT":/^\d{3,7}[APMGLHBZ]$|^([1-8])\1\d{7}$/i,"nl-NL":/^\d{9}$/,"pl-PL":/^\d{10,11}$/,"pt-BR":/(?:^\d{11}$)|(?:^\d{14}$)/,"pt-PT":/^\d{9}$/,"ro-RO":/^\d{13}$/,"sk-SK":/^\d{6}\/{0,1}\d{3,4}$/,"sl-SI":/^[1-9]\d{7}$/,"sv-SE":/^(\d{6}[-+]{0,1}\d{4}|(18|19|20)\d{6}[-+]{0,1}\d{4})$/,"uk-UA":/^\d{10}$/};Ye["lb-LU"]=Ye["fr-LU"],Ye["lt-LT"]=Ye["et-EE"],Ye["nl-BE"]=Ye["fr-BE"],Ye["fr-CA"]=Ye["en-CA"];var Qe={"bg-BG":S,"cs-CZ":b,"de-AT":C,"de-DE":k,"dk-DK":A,"el-CY":I,"el-GR":$,"en-CA":x,"en-IE":B,"en-US":P,"es-AR":K,"es-ES":re,"et-EE":ue,"fi-FI":Z,"fr-BE":ie,"fr-FR":V,"fr-LU":Q,"hr-HR":ye,"hu-HU":Te,"it-IT":X,"lv-LV":ve,"mt-MT":L,"nl-NL":we,"pl-PL":Ue,"pt-BR":de,"pt-PT":tt,"ro-RO":Ze,"sk-SK":lt,"sl-SI":gt,"sv-SE":je,"uk-UA":Se};Qe["lb-LU"]=Qe["fr-LU"],Qe["lt-LT"]=Qe["et-EE"],Qe["nl-BE"]=Qe["fr-BE"],Qe["fr-CA"]=Qe["en-CA"];var ot=/[-\\\/!@#$%\^&\*\(\)\+\=\[\]]+/g,et={"de-AT":ot,"de-DE":/[\/\\]/g,"fr-BE":ot};et["nl-BE"]=et["fr-BE"];function He(N){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US";(0,r.default)(N);var Y=N.slice(0);if(F in Ye)return F in et&&(Y=Y.replace(et[F],"")),Ye[F].test(Y)?F in Qe?Qe[F](Y):!0:!1;throw new Error("Invalid locale '".concat(F,"'"))}e.exports=t.default,e.exports.default=t.default}(Dv,Dv.exports)),Dv.exports}var Wu={},qD;function yJ(){if(qD)return Wu;qD=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.default=r,Wu.locales=void 0;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n={"am-AM":/^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)([569]\d{7}|41\d{6})$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?(9[1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SD":/^((\+?249)|0)?(9[012369]|1[012])\d{7}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,"el-GR":/^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,"el-CY":/^(\+?357?)?(9(9|6)\d{6})$/,"en-AI":/^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-AG":/^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,"en-BS":/^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,"en-GB":/^(\+?44|0)7[1-9]\d{8}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|53|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-JM":/^(\+?876)?\d{7}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"fr-CF":/^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/,"en-SS":/^(\+?211|0)(9[1257])\d{7}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-KN":/^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,"en-LS":/^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-MW":/^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PG":/^(\+?675|0)?(7\d|8[18])\d{6}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?0[79][567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}$/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8|3|2]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-GT":/^(\+?502)?[2|6|7]\d{7}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-NI":/^(\+?505)\d{7,8}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-BJ":/^(\+229)\d{8}$/,"fr-CD":/^(\+?243|0)?(8|9)\d{8}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"fr-WF":/^(\+681)?\d{6}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"ir-IR":/^(\+98|0)?9\d{9}$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(79\d{7}|5\d{8})$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"ky-KG":/^(\+996\s?)?(22[0-9]|50[0-9]|55[0-9]|70[0-9]|75[0-9]|77[0-9]|880|990|995|996|997|998)\s?\d{3}\s?\d{3}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"mg-MG":/^((\+?261|0)(2|3)\d)?\d{7}$/,"mn-MN":/^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,"my-MM":/^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,"ms-MY":/^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nl-AW":/^(\+)?297(56|59|64|73|74|99)\d{5}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+244)\d{9}$/,"ro-MD":/^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,"ro-RO":/^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"so-SO":/^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/,"sq-AL":/^(\+355|0)6[2-9]\d{7}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38)?0(50|6[36-8]|7[357]|9[1-9])\d{7}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/,"ar-YE":/^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,"ar-EH":/^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,"fa-AF":/^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/,"mk-MK":/^(\+?389|0)?((?:2[2-9]\d{6}|(?:3[1-4]|4[2-8])\d{6}|500\d{5}|5[2-9]\d{6}|7[0-9][2-9]\d{5}|8[1-9]\d{6}|800\d{5}|8009\d{4}))$/};n["en-CA"]=n["en-US"],n["fr-CA"]=n["en-CA"],n["fr-BE"]=n["nl-BE"],n["zh-HK"]=n["en-HK"],n["zh-MO"]=n["en-MO"],n["ga-IE"]=n["en-IE"],n["fr-CH"]=n["de-CH"],n["it-CH"]=n["fr-CH"];function r(i,o,a){if((0,e.default)(i),a&&a.strictMode&&!i.startsWith("+"))return!1;if(Array.isArray(o))return o.some(function(d){if(n.hasOwnProperty(d)){var p=n[d];if(p.test(i))return!0}return!1});if(o in n)return n[o].test(i);if(!o||o==="any"){for(var u in n)if(n.hasOwnProperty(u)){var c=n[u];if(c.test(i))return!0}return!1}throw new Error("Invalid locale '".concat(o,"'"))}return Wu.locales=Object.keys(n),Wu}var Lv={exports:{}},HD;function _J(){return HD||(HD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^(0x)[0-9a-f]{40}$/i;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(Lv,Lv.exports)),Lv.exports}var Nv={exports:{}},GD;function bJ(){return GD||(GD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(hi()),r=i(Be());function i(c){return c&&c.__esModule?c:{default:c}}function o(c){var d="\\d{".concat(c.digits_after_decimal[0],"}");c.digits_after_decimal.forEach(function(C,k){k!==0&&(d="".concat(d,"|\\d{").concat(C,"}"))});var p="(".concat(c.symbol.replace(/\W/,function(C){return"\\".concat(C)}),")").concat(c.require_symbol?"":"?"),h="-?",m="[1-9]\\d*",v="[1-9]\\d{0,2}(\\".concat(c.thousands_separator,"\\d{3})*"),_=["0",m,v],S="(".concat(_.join("|"),")?"),x="(\\".concat(c.decimal_separator,"(").concat(d,"))").concat(c.require_decimal?"":"?"),b=S+(c.allow_decimal||c.require_decimal?x:"");return c.allow_negatives&&!c.parens_for_negatives&&(c.negative_sign_after_digits?b+=h:c.negative_sign_before_digits&&(b=h+b)),c.allow_negative_sign_placeholder?b="( (?!\\-))?".concat(b):c.allow_space_after_symbol?b=" ?".concat(b):c.allow_space_after_digits&&(b+="( (?!$))?"),c.symbol_after_digits?b+=p:b=p+b,c.allow_negatives&&(c.parens_for_negatives?b="(\\(".concat(b,"\\)|").concat(b,")"):c.negative_sign_before_digits||c.negative_sign_after_digits||(b=h+b)),new RegExp("^(?!-? )(?=.*\\d)".concat(b,"$"))}var a={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};function u(c,d){return(0,r.default)(c),d=(0,n.default)(d,a),o(d).test(c)}e.exports=t.default,e.exports.default=t.default}(Nv,Nv.exports)),Nv.exports}var Bv={exports:{}},VD;function xJ(){return VD||(VD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=r(Be());function r(u){return u&&u.__esModule?u:{default:u}}var i=/^(bc1|tb1|bc1p|tb1p)[ac-hj-np-z02-9]{39,58}$/,o=/^(1|2|3|m)[A-HJ-NP-Za-km-z1-9]{25,39}$/;function a(u){return(0,n.default)(u),i.test(u)||o.test(u)}e.exports=t.default,e.exports.default=t.default}(Bv,Bv.exports)),Bv.exports}var Ku={},ZD;function wJ(){if(ZD)return Ku;ZD=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.isFreightContainerID=void 0,Ku.isISO6346=i;var e=t(Be());function t(o){return o&&o.__esModule?o:{default:o}}var n=/^[A-Z]{3}(U[0-9]{7})|([J,Z][0-9]{6,7})$/,r=/^[0-9]$/;function i(o){if((0,e.default)(o),o=o.toUpperCase(),!n.test(o))return!1;if(o.length===11){for(var a=0,u=0;u<o.length-1;u++)if(r.test(o[u]))a+=o[u]*Math.pow(2,u);else{var c=void 0,d=o.charCodeAt(u)-55;d<11?c=d:d>=11&&d<=20?c=12+d%11:d>=21&&d<=30?c=23+d%21:c=34+d%31,a+=c*Math.pow(2,u)}var p=a%11;return p===10&&(p=0),Number(o[o.length-1])===p}return!0}return Ku.isFreightContainerID=i,Ku}var Pv={exports:{}},YD;function SJ(){return YD||(YD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=new Set(["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"]);function o(a){return(0,n.default)(a),i.has(a)}e.exports=t.default,e.exports.default=t.default}(Pv,Pv.exports)),Pv.exports}var Fv={exports:{}},WD;function CJ(){return WD||(WD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=r(Be());function r(c){return c&&c.__esModule?c:{default:c}}var i=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,o=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,a=function(d){var p=d.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(p){var h=Number(p[1]),m=Number(p[2]);return h%4===0&&h%100!==0||h%400===0?m<=366:m<=365}var v=d.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),_=v[1],S=v[2],x=v[3],b=S&&"0".concat(S).slice(-2),C=x&&"0".concat(x).slice(-2),k=new Date("".concat(_,"-").concat(b||"01","-").concat(C||"01"));return S&&x?k.getUTCFullYear()===_&&k.getUTCMonth()+1===S&&k.getUTCDate()===x:!0};function u(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(c);var p=d.strictSeparator?o.test(c):i.test(c);return p&&d.strict?a(c):p}e.exports=t.default,e.exports.default=t.default}(Fv,Fv.exports)),Fv.exports}var zv={exports:{}},KD;function EJ(){return KD||(KD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=b;var n=r(Be());function r(C){return C&&C.__esModule?C:{default:C}}var i=/[0-9]{4}/,o=/(0[1-9]|1[0-2])/,a=/([12]\d|0[1-9]|3[01])/,u=/([01][0-9]|2[0-3])/,c=/[0-5][0-9]/,d=/([0-5][0-9]|60)/,p=/(\.[0-9]+)?/,h=new RegExp("[-+]".concat(u.source,":").concat(c.source)),m=new RegExp("([zZ]|".concat(h.source,")")),v=new RegExp("".concat(u.source,":").concat(c.source,":").concat(d.source).concat(p.source)),_=new RegExp("".concat(i.source,"-").concat(o.source,"-").concat(a.source)),S=new RegExp("".concat(v.source).concat(m.source)),x=new RegExp("^".concat(_.source,"[ tT]").concat(S.source,"$"));function b(C){return(0,n.default)(C),x.test(C)}e.exports=t.default,e.exports.default=t.default}(zv,zv.exports)),zv.exports}var Qu={},QD;function kJ(){if(QD)return Qu;QD=1,Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.ScriptCodes=void 0,Qu.default=r;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n=new Set(["Adlm","Afak","Aghb","Ahom","Arab","Aran","Armi","Armn","Avst","Bali","Bamu","Bass","Batk","Beng","Bhks","Blis","Bopo","Brah","Brai","Bugi","Buhd","Cakm","Cans","Cari","Cham","Cher","Chis","Chrs","Cirt","Copt","Cpmn","Cprt","Cyrl","Cyrs","Deva","Diak","Dogr","Dsrt","Dupl","Egyd","Egyh","Egyp","Elba","Elym","Ethi","Gara","Geok","Geor","Glag","Gong","Gonm","Goth","Gran","Grek","Gujr","Gukh","Guru","Hanb","Hang","Hani","Hano","Hans","Hant","Hatr","Hebr","Hira","Hluw","Hmng","Hmnp","Hrkt","Hung","Inds","Ital","Jamo","Java","Jpan","Jurc","Kali","Kana","Kawi","Khar","Khmr","Khoj","Kitl","Kits","Knda","Kore","Kpel","Krai","Kthi","Lana","Laoo","Latf","Latg","Latn","Leke","Lepc","Limb","Lina","Linb","Lisu","Loma","Lyci","Lydi","Mahj","Maka","Mand","Mani","Marc","Maya","Medf","Mend","Merc","Mero","Mlym","Modi","Mong","Moon","Mroo","Mtei","Mult","Mymr","Nagm","Nand","Narb","Nbat","Newa","Nkdb","Nkgb","Nkoo","Nshu","Ogam","Olck","Onao","Orkh","Orya","Osge","Osma","Ougr","Palm","Pauc","Pcun","Pelm","Perm","Phag","Phli","Phlp","Phlv","Phnx","Plrd","Piqd","Prti","Psin","Qaaa","Qaab","Qaac","Qaad","Qaae","Qaaf","Qaag","Qaah","Qaai","Qaaj","Qaak","Qaal","Qaam","Qaan","Qaao","Qaap","Qaaq","Qaar","Qaas","Qaat","Qaau","Qaav","Qaaw","Qaax","Qaay","Qaaz","Qaba","Qabb","Qabc","Qabd","Qabe","Qabf","Qabg","Qabh","Qabi","Qabj","Qabk","Qabl","Qabm","Qabn","Qabo","Qabp","Qabq","Qabr","Qabs","Qabt","Qabu","Qabv","Qabw","Qabx","Ranj","Rjng","Rohg","Roro","Runr","Samr","Sara","Sarb","Saur","Sgnw","Shaw","Shrd","Shui","Sidd","Sidt","Sind","Sinh","Sogd","Sogo","Sora","Soyo","Sund","Sunu","Sylo","Syrc","Syre","Syrj","Syrn","Tagb","Takr","Tale","Talu","Taml","Tang","Tavt","Tayo","Telu","Teng","Tfng","Tglg","Thaa","Thai","Tibt","Tirh","Tnsa","Todr","Tols","Toto","Tutg","Ugar","Vaii","Visp","Vith","Wara","Wcho","Wole","Xpeo","Xsux","Yezi","Yiii","Zanb","Zinh","Zmth","Zsye","Zsym","Zxxx","Zyyy","Zzzz"]);function r(i){return(0,e.default)(i),n.has(i)}return Qu.ScriptCodes=n,Qu}var Uv={exports:{}},XD;function AJ(){return XD||(XD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=new Set(["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"]);function o(a){return(0,n.default)(a),i.has(a.toUpperCase())}e.exports=t.default,e.exports.default=t.default}(Uv,Uv.exports)),Uv.exports}var jv={exports:{}},JD;function IJ(){return JD||(JD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=new Set(["004","008","010","012","016","020","024","028","031","032","036","040","044","048","050","051","052","056","060","064","068","070","072","074","076","084","086","090","092","096","100","104","108","112","116","120","124","132","136","140","144","148","152","156","158","162","166","170","174","175","178","180","184","188","191","192","196","203","204","208","212","214","218","222","226","231","232","233","234","238","239","242","246","248","250","254","258","260","262","266","268","270","275","276","288","292","296","300","304","308","312","316","320","324","328","332","334","336","340","344","348","352","356","360","364","368","372","376","380","384","388","392","398","400","404","408","410","414","417","418","422","426","428","430","434","438","440","442","446","450","454","458","462","466","470","474","478","480","484","492","496","498","499","500","504","508","512","516","520","524","528","531","533","534","535","540","548","554","558","562","566","570","574","578","580","581","583","584","585","586","591","598","600","604","608","612","616","620","624","626","630","634","638","642","643","646","652","654","659","660","662","663","666","670","674","678","682","686","688","690","694","702","703","704","705","706","710","716","724","728","729","732","740","744","748","752","756","760","762","764","768","772","776","780","784","788","792","795","796","798","800","804","807","818","826","831","832","833","834","840","850","854","858","860","862","876","882","887","894"]);function o(a){return(0,n.default)(a),i.has(a)}e.exports=t.default,e.exports.default=t.default}(jv,jv.exports)),jv.exports}var Xu={},e4;function TJ(){if(e4)return Xu;e4=1,Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.CurrencyCodes=void 0,Xu.default=r;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n=new Set(["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"]);function r(i){return(0,e.default)(i),n.has(i.toUpperCase())}return Xu.CurrencyCodes=n,Xu}var qv={exports:{}},t4;function MJ(){return t4||(t4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n=i(Be()),r=i(hi());function i(d){return d&&d.__esModule?d:{default:d}}var o=/^[A-Z2-7]+=*$/,a=/^[A-HJKMNP-TV-Z0-9]+$/,u={crockford:!1};function c(d,p){if((0,n.default)(d),p=(0,r.default)(p,u),p.crockford)return a.test(d);var h=d.length;return!!(h%8===0&&o.test(d))}e.exports=t.default,e.exports.default=t.default}(qv,qv.exports)),qv.exports}var Hv={exports:{}},n4;function OJ(){return n4||(n4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^[A-HJ-NP-Za-km-z1-9]*$/;function o(a){return(0,n.default)(a),!!i.test(a)}e.exports=t.default,e.exports.default=t.default}(Hv,Hv.exports)),Hv.exports}var Gv={exports:{}},r4;function RJ(){return r4||(r4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=r(Be());function r(c){return c&&c.__esModule?c:{default:c}}var i=/^[a-z]+\/[a-z0-9\-\+\._]+$/i,o=/^[a-z\-]+=[a-z0-9\-]+$/i,a=/^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;function u(c){(0,n.default)(c);var d=c.split(",");if(d.length<2)return!1;var p=d.shift().trim().split(";"),h=p.shift();if(h.slice(0,5)!=="data:")return!1;var m=h.slice(5);if(m!==""&&!i.test(m))return!1;for(var v=0;v<p.length;v++)if(!(v===p.length-1&&p[v].toLowerCase()==="base64")&&!o.test(p[v]))return!1;for(var _=0;_<d.length;_++)if(!a.test(d[_]))return!1;return!0}e.exports=t.default,e.exports.default=t.default}(Gv,Gv.exports)),Gv.exports}var Vv={exports:{}},i4;function $J(){return i4||(i4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i;function o(a){return(0,n.default)(a),a.indexOf("magnet:?")!==0?!1:i.test(a)}e.exports=t.default,e.exports.default=t.default}(Vv,Vv.exports)),Vv.exports}var Zv={exports:{}},Yv={exports:{}},Wv={exports:{}},o4;function a4(){return o4||(o4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){if((0,n.default)(o),a){var u=new RegExp("[".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+$"),"g");return o.replace(u,"")}for(var c=o.length-1;/\s/.test(o.charAt(c));)c-=1;return o.slice(0,c+1)}e.exports=t.default,e.exports.default=t.default}(Wv,Wv.exports)),Wv.exports}var Kv={exports:{}},s4;function l4(){return s4||(s4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){(0,n.default)(o);var u=a?new RegExp("^[".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+"),"g"):/^\s+/g;return o.replace(u,"")}e.exports=t.default,e.exports.default=t.default}(Kv,Kv.exports)),Kv.exports}var u4;function c4(){return u4||(u4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=i(a4()),r=i(l4());function i(a){return a&&a.__esModule?a:{default:a}}function o(a,u){return(0,n.default)((0,r.default)(a,u),u)}e.exports=t.default,e.exports.default=t.default}(Yv,Yv.exports)),Yv.exports}var f4;function DJ(){return f4||(f4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=_;var n=o(c4()),r=o(T3()),i=o(Be());function o(S){return S&&S.__esModule?S:{default:S}}function a(S,x){return d(S)||c(S,x)||h(S,x)||u()}function u(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
946
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var A,I=!0,$=!1;return{s:function(){b=b.call(S)},n:function(){var U=b.next();return I=U.done,U},e:function(U){$=!0,A=U},f:function(){try{I||b.return==null||b.return()}finally{if($)throw A}}}}function d(S,x){if(S){if(typeof S=="string")return p(S,x);var b={}.toString.call(S).slice(8,-1);return b==="Object"&&S.constructor&&(b=S.constructor.name),b==="Map"||b==="Set"?Array.from(S):b==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b)?p(S,x):void 0}}function p(S,x){(x==null||x>S.length)&&(x=S.length);for(var b=0,C=Array(x);b<x;b++)C[b]=S[b];return C}var h={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};function m(S){return/(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(S)}function v(S,x){for(var b=[],C=Math.max(S.length,x.length),k=0;k<C;k++)b.push([S[k],x[k]]);return b}function _(S,x){if(typeof x=="string"?x=(0,n.default)({format:x},h):x=(0,n.default)(x,h),typeof S=="string"&&m(x.format)){if(x.strictMode&&S.length!==x.format.length)return!1;var b=x.delimiters.find(function(ie){return x.format.indexOf(ie)!==-1}),C=x.strictMode?b:x.delimiters.find(function(ie){return S.indexOf(ie)!==-1}),k=v(S.split(C),x.format.toLowerCase().split(b)),A={},I=c(k),$;try{for(I.s();!($=I.n()).done;){var B=i($.value,2),U=B[0],G=B[1];if(!U||!G||U.length!==G.length)return!1;A[G.charAt(0)]=U}}catch(ie){I.e(ie)}finally{I.f()}var P=A.y;if(P.startsWith("-"))return!1;if(A.y.length===2){var K=parseInt(A.y,10);if(isNaN(K))return!1;var re=new Date().getFullYear()%100;K<re?P="20".concat(A.y):P="19".concat(A.y)}var ue=A.m;A.m.length===1&&(ue="0".concat(A.m));var Z=A.d;return A.d.length===1&&(Z="0".concat(A.d)),new Date("".concat(P,"-").concat(ue,"-").concat(Z,"T00:00:00.000Z")).getUTCDate()===+A.d}return x.strictMode?!1:Object.prototype.toString.call(S)==="[object Date]"&&isFinite(S)}e.exports=t.default,e.exports.default=t.default}(Um,Um.exports)),Um.exports}var jm={exports:{}},L2;function EX(){return L2||(L2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=r(hi());function r(u){return u&&u.__esModule?u:{default:u}}var i={hourFormat:"hour24",mode:"default"},o={hour24:{default:/^([01]?[0-9]|2[0-3]):([0-5][0-9])$/,withSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/},hour12:{default:/^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/,withSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/}};function a(u,c){return c=(0,n.default)(c,i),typeof u!="string"?!1:o[c.hourFormat][c.mode].test(u)}e.exports=t.default,e.exports.default=t.default}(jm,jm.exports)),jm.exports}var qm={exports:{}},N2;function kX(){return N2||(N2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=r(Be());function r(c){return c&&c.__esModule?c:{default:c}}var i={loose:!1},o=["true","false","1","0"],a=[].concat(o,["yes","no"]);function u(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return(0,n.default)(c),d.loose?a.includes(c.toLowerCase()):o.includes(c)}e.exports=t.default,e.exports.default=t.default}(qm,qm.exports)),qm.exports}var Hm={exports:{}},B2;function AX(){return B2||(B2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=C;var n=r(Be());function r(k){return k&&k.__esModule?k:{default:k}}var i="([A-Za-z]{3}(-[A-Za-z]{3}){0,2})",o="(([a-zA-Z]{2,3}(-".concat(i,")?)|([a-zA-Z]{5,8}))"),a="([A-Za-z]{4})",u="([A-Za-z]{2}|\\d{3})",c="([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))",d="(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])",p="(".concat(d,"(-[A-Za-z0-9]{2,8})+)"),h="(x(-[A-Za-z0-9]{1,8})+)",m="((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))",v="((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))",_="(".concat(m,"|").concat(v,")"),S="(-|_)",x="".concat(o,"(").concat(S).concat(a,")?(").concat(S).concat(u,")?(").concat(S).concat(c,")*(").concat(S).concat(p,")*(").concat(S).concat(h,")?"),b=new RegExp("(^".concat(h,"$)|(^").concat(_,"$)|(^").concat(x,"$)"));function C(k){return(0,n.default)(k),b.test(k)}e.exports=t.default,e.exports.default=t.default}(Hm,Hm.exports)),Hm.exports}var Gm={exports:{}},P2;function IX(){return P2||(P2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^(?!(1[3-9])|(20)|(3[3-9])|(4[0-9])|(5[0-9])|(60)|(7[3-9])|(8[1-9])|(9[0-2])|(9[3-9]))[0-9]{9}$/;function o(a){if((0,n.default)(a),!i.test(a))return!1;for(var u=0,c=0;c<a.length;c++)c%3===0?u+=a[c]*3:c%3===1?u+=a[c]*7:u+=a[c]*1;return u%10===0}e.exports=t.default,e.exports.default=t.default}(Gm,Gm.exports)),Gm.exports}var ju={},F2;function TX(){if(F2)return ju;F2=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.default=r,ju.locales=void 0;var e=n(Be()),t=_d();function n(i){return i&&i.__esModule?i:{default:i}}function r(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,e.default)(i);var u=i,c=a.ignore;if(c)if(c instanceof RegExp)u=u.replace(c,"");else if(typeof c=="string")u=u.replace(new RegExp("[".concat(c.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(o in t.alpha)return t.alpha[o].test(u);throw new Error("Invalid locale '".concat(o,"'"))}return ju.locales=Object.keys(t.alpha),ju}var qu={},z2;function MX(){if(z2)return qu;z2=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.default=r,qu.locales=void 0;var e=n(Be()),t=_d();function n(i){return i&&i.__esModule?i:{default:i}}function r(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};(0,e.default)(i);var u=i,c=a.ignore;if(c)if(c instanceof RegExp)u=u.replace(c,"");else if(typeof c=="string")u=u.replace(new RegExp("[".concat(c.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(o in t.alphanumeric)return t.alphanumeric[o].test(u);throw new Error("Invalid locale '".concat(o,"'"))}return qu.locales=Object.keys(t.alphanumeric),qu}var Vm={exports:{}},U2;function OX(){return U2||(U2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=_d();function i(u){return u&&u.__esModule?u:{default:u}}var o=/^[0-9]+$/;function a(u,c){return(0,n.default)(u),c&&c.no_symbols?o.test(u):new RegExp("^[+-]?([0-9]*[".concat((c||{}).locale?r.decimal[c.locale]:".","])?[0-9]+$")).test(u)}e.exports=t.default,e.exports.default=t.default}(Vm,Vm.exports)),Vm.exports}var Hu={},j2;function RX(){if(j2)return Hu;j2=1,Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.default=r,Hu.locales=void 0;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n={AM:/^[A-Z]{2}\d{7}$/,AR:/^[A-Z]{3}\d{6}$/,AT:/^[A-Z]\d{7}$/,AU:/^[A-Z]\d{7}$/,AZ:/^[A-Z]{1}\d{8}$/,BE:/^[A-Z]{2}\d{6}$/,BG:/^\d{9}$/,BR:/^[A-Z]{2}\d{6}$/,BY:/^[A-Z]{2}\d{7}$/,CA:/^[A-Z]{2}\d{6}$/,CH:/^[A-Z]\d{7}$/,CN:/^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,CY:/^[A-Z](\d{6}|\d{8})$/,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,DK:/^\d{9}$/,DZ:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,FI:/^[A-Z]{2}\d{7}$/,FR:/^\d{2}[A-Z]{2}\d{5}$/,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/,IE:/^[A-Z0-9]{2}\d{7}$/,IN:/^[A-Z]{1}-?\d{7}$/,ID:/^[A-C]\d{7}$/,IR:/^[A-Z]\d{8}$/,IS:/^(A)\d{7}$/,IT:/^[A-Z0-9]{2}\d{7}$/,JM:/^[Aa]\d{7}$/,JP:/^[A-Z]{2}\d{7}$/,KR:/^[MS]\d{8}$/,KZ:/^[a-zA-Z]\d{7}$/,LI:/^[a-zA-Z]\d{5}$/,LT:/^[A-Z0-9]{8}$/,LU:/^[A-Z0-9]{8}$/,LV:/^[A-Z0-9]{2}\d{7}$/,LY:/^[A-Z0-9]{8}$/,MT:/^\d{7}$/,MZ:/^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,MY:/^[AHK]\d{8}$/,MX:/^\d{10,11}$/,NL:/^[A-Z]{2}[A-Z0-9]{6}\d$/,NZ:/^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/,PH:/^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/,PK:/^[A-Z]{2}\d{7}$/,PL:/^[A-Z]{2}\d{7}$/,PT:/^[A-Z]\d{6}$/,RO:/^\d{8,9}$/,RU:/^\d{9}$/,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/,SK:/^[0-9A-Z]\d{7}$/,TH:/^[A-Z]{1,2}\d{6,7}$/,TR:/^[A-Z]\d{8}$/,UA:/^[A-Z]{2}\d{6}$/,US:/^\d{9}$/,ZA:/^[TAMD]\d{8}$/};Hu.locales=Object.keys(n);function r(i,o){(0,e.default)(i);var a=i.replace(/\s/g,"").toUpperCase();return o.toUpperCase()in n&&n[o].test(a)}return Hu}var Zm={exports:{}},Ym={exports:{}},q2;function $w(){return q2||(q2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(Be()),r=i(l2());function i(c){return c&&c.__esModule?c:{default:c}}var o=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,a=/^[-+]?[0-9]+$/;function u(c,d){(0,n.default)(c),d=d||{};var p=d.allow_leading_zeroes===!1?o:a,h=!d.hasOwnProperty("min")||(0,r.default)(d.min)||c>=d.min,m=!d.hasOwnProperty("max")||(0,r.default)(d.max)||c<=d.max,v=!d.hasOwnProperty("lt")||(0,r.default)(d.lt)||c<d.lt,_=!d.hasOwnProperty("gt")||(0,r.default)(d.gt)||c>d.gt;return p.test(c)&&h&&m&&v&&_}e.exports=t.default,e.exports.default=t.default}(Ym,Ym.exports)),Ym.exports}var H2;function $X(){return H2||(H2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r($w());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o,{allow_leading_zeroes:!1,min:0,max:65535})}e.exports=t.default,e.exports.default=t.default}(Zm,Zm.exports)),Zm.exports}var Wm={exports:{}},G2;function DX(){return G2||(G2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o),o===o.toLowerCase()}e.exports=t.default,e.exports.default=t.default}(Wm,Wm.exports)),Wm.exports}var Km={exports:{}},V2;function LX(){return V2||(V2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o),o===o.toUpperCase()}e.exports=t.default,e.exports.default=t.default}(Km,Km.exports)),Km.exports}var Qm={exports:{}},Z2;function NX(){return Z2||(Z2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=r(Be());function r(u){return u&&u.__esModule?u:{default:u}}var i=/^[0-9]{15}$/,o=/^\d{2}-\d{6}-\d{6}-\d{1}$/;function a(u,c){(0,n.default)(u),c=c||{};var d=i;if(c.allow_hyphens&&(d=o),!d.test(u))return!1;u=u.replace(/-/g,"");for(var p=0,h=2,m=14,v=0;v<m;v++){var _=u.substring(m-v-1,m-v),S=parseInt(_,10)*h;S>=10?p+=S%10+1:p+=S,h===1?h+=1:h-=1}var x=(10-p%10)%10;return x===parseInt(u.substring(14,15),10)}e.exports=t.default,e.exports.default=t.default}(Qm,Qm.exports)),Qm.exports}var Xm={exports:{}},Y2;function BX(){return Y2||(Y2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^[\x00-\x7F]+$/;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(Xm,Xm.exports)),Xm.exports}var Gu={},W2;function K2(){if(W2)return Gu;W2=1,Object.defineProperty(Gu,"__esModule",{value:!0}),Gu.default=r,Gu.fullWidth=void 0;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n=Gu.fullWidth=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function r(i){return(0,e.default)(i),n.test(i)}return Gu}var Vu={},Q2;function X2(){if(Q2)return Vu;Q2=1,Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.default=r,Vu.halfWidth=void 0;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n=Vu.halfWidth=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;function r(i){return(0,e.default)(i),n.test(i)}return Vu}var Jm={exports:{}},J2;function PX(){return J2||(J2=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=o(Be()),r=K2(),i=X2();function o(u){return u&&u.__esModule?u:{default:u}}function a(u){return(0,n.default)(u),r.fullWidth.test(u)&&i.halfWidth.test(u)}e.exports=t.default,e.exports.default=t.default}(Jm,Jm.exports)),Jm.exports}var ev={exports:{}},eD;function FX(){return eD||(eD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/[^\x00-\x7F]/;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(ev,ev.exports)),ev.exports}var tv={exports:{}},nv={exports:{}},tD;function zX(){return tD||(tD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r,i){var o=r.join("");return new RegExp(o,i)}e.exports=t.default,e.exports.default=t.default}(nv,nv.exports)),nv.exports}var nD;function UX(){return nD||(nD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=i(zX());function i(u){return u&&u.__esModule?u:{default:u}}var o=(0,r.default)(["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)","(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))","?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$"],"i");function a(u){return(0,n.default)(u),o.test(u)}e.exports=t.default,e.exports.default=t.default}(tv,tv.exports)),tv.exports}var rv={exports:{}},rD;function jX(){return rD||(rD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(rv,rv.exports)),rv.exports}var iv={exports:{}},ov={exports:{}},iD;function qX(){return iD||(iD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(i,o){return i.some(function(a){return o===a})};t.default=n,e.exports=t.default,e.exports.default=t.default}(ov,ov.exports)),ov.exports}var oD;function HX(){return oD||(oD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var n=a(hi()),r=a(Be()),i=a(qX()),o=_d();function a(h){return h&&h.__esModule?h:{default:h}}function u(h){var m=new RegExp("^[-+]?([0-9]+)?(\\".concat(o.decimal[h.locale],"[0-9]{").concat(h.decimal_digits,"})").concat(h.force_decimal?"":"?","$"));return m}var c={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},d=["","-","+"];function p(h,m){if((0,r.default)(h),m=(0,n.default)(m,c),m.locale in o.decimal)return!(0,i.default)(d,h.replace(/ /g,""))&&u(m).test(h);throw new Error("Invalid locale '".concat(m.locale,"'"))}e.exports=t.default,e.exports.default=t.default}(iv,iv.exports)),iv.exports}var av={exports:{}},aD;function sD(){return aD||(aD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^(0x|0h)?[0-9A-F]+$/i;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(av,av.exports)),av.exports}var sv={exports:{}},lD;function GX(){return lD||(lD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^(0o)?[0-7]+$/i;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(sv,sv.exports)),sv.exports}var lv={exports:{}},uD;function VX(){return uD||(uD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=i(Be()),r=i(h2());function i(a){return a&&a.__esModule?a:{default:a}}function o(a,u){return(0,n.default)(a),(0,r.default)(a)%parseInt(u,10)===0}e.exports=t.default,e.exports.default=t.default}(lv,lv.exports)),lv.exports}var uv={exports:{}},cD;function ZX(){return cD||(cD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(uv,uv.exports)),uv.exports}var cv={exports:{}},fD;function YX(){return fD||(fD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var n=r(Be());function r(h){return h&&h.__esModule?h:{default:h}}function i(h){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},i(h)}var o=/^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/,a=/^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/,u=/^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/,c=/^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/,d=/^rgba?/;function p(h,m){(0,n.default)(h);var v=!1,_=!0;if(i(m)!=="object"?arguments.length>=2&&(_=arguments[1]):(v=m.allowSpaces!==void 0?m.allowSpaces:v,_=m.includePercentValues!==void 0?m.includePercentValues:_),v){if(!d.test(h))return!1;h=h.replace(/\s/g,"")}return _?o.test(h)||a.test(h)||u.test(h)||c.test(h):o.test(h)||a.test(h)}e.exports=t.default,e.exports.default=t.default}(cv,cv.exports)),cv.exports}var fv={exports:{}},dD;function WX(){return dD||(dD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=r(Be());function r(u){return u&&u.__esModule?u:{default:u}}var i=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i,o=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i;function a(u){(0,n.default)(u);var c=u.replace(/\s+/g," ").replace(/\s?(hsla?\(|\)|,)\s?/ig,"$1");return c.indexOf(",")!==-1?i.test(c):o.test(c)}e.exports=t.default,e.exports.default=t.default}(fv,fv.exports)),fv.exports}var dv={exports:{}},hD;function KX(){return hD||(hD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(dv,dv.exports)),dv.exports}var Zu={},pD;function QX(){if(pD)return Zu;pD=1,Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.default=a,Zu.locales=void 0;var e=t(Be());function t(u){return u&&u.__esModule?u:{default:u}}var n={AD:/^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,AE:/^(AE[0-9]{2})\d{3}\d{16}$/,AL:/^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,AT:/^(AT[0-9]{2})\d{16}$/,AZ:/^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,BA:/^(BA[0-9]{2})\d{16}$/,BE:/^(BE[0-9]{2})\d{12}$/,BG:/^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,BH:/^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,BR:/^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,BY:/^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,CH:/^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,CR:/^(CR[0-9]{2})\d{18}$/,CY:/^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,CZ:/^(CZ[0-9]{2})\d{20}$/,DE:/^(DE[0-9]{2})\d{18}$/,DK:/^(DK[0-9]{2})\d{14}$/,DO:/^(DO[0-9]{2})[A-Z]{4}\d{20}$/,DZ:/^(DZ\d{24})$/,EE:/^(EE[0-9]{2})\d{16}$/,EG:/^(EG[0-9]{2})\d{25}$/,ES:/^(ES[0-9]{2})\d{20}$/,FI:/^(FI[0-9]{2})\d{14}$/,FO:/^(FO[0-9]{2})\d{14}$/,FR:/^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,GB:/^(GB[0-9]{2})[A-Z]{4}\d{14}$/,GE:/^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,GI:/^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,GL:/^(GL[0-9]{2})\d{14}$/,GR:/^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,GT:/^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,HR:/^(HR[0-9]{2})\d{17}$/,HU:/^(HU[0-9]{2})\d{24}$/,IE:/^(IE[0-9]{2})[A-Z]{4}\d{14}$/,IL:/^(IL[0-9]{2})\d{19}$/,IQ:/^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,IR:/^(IR[0-9]{2})0\d{2}0\d{18}$/,IS:/^(IS[0-9]{2})\d{22}$/,IT:/^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,JO:/^(JO[0-9]{2})[A-Z]{4}\d{22}$/,KW:/^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,KZ:/^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,LB:/^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,LC:/^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,LI:/^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,LT:/^(LT[0-9]{2})\d{16}$/,LU:/^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,LV:/^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,MA:/^(MA[0-9]{26})$/,MC:/^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,MD:/^(MD[0-9]{2})[A-Z0-9]{20}$/,ME:/^(ME[0-9]{2})\d{18}$/,MK:/^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,MR:/^(MR[0-9]{2})\d{23}$/,MT:/^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,MU:/^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,MZ:/^(MZ[0-9]{2})\d{21}$/,NL:/^(NL[0-9]{2})[A-Z]{4}\d{10}$/,NO:/^(NO[0-9]{2})\d{11}$/,PK:/^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,PL:/^(PL[0-9]{2})\d{24}$/,PS:/^(PS[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,PT:/^(PT[0-9]{2})\d{21}$/,QA:/^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,RO:/^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,RS:/^(RS[0-9]{2})\d{18}$/,SA:/^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,SC:/^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,SE:/^(SE[0-9]{2})\d{20}$/,SI:/^(SI[0-9]{2})\d{15}$/,SK:/^(SK[0-9]{2})\d{20}$/,SM:/^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,SV:/^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,TL:/^(TL[0-9]{2})\d{19}$/,TN:/^(TN[0-9]{2})\d{20}$/,TR:/^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,UA:/^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,VA:/^(VA[0-9]{2})\d{18}$/,VG:/^(VG[0-9]{2})[A-Z]{4}\d{16}$/,XK:/^(XK[0-9]{2})\d{16}$/};function r(u){var c=u.filter(function(d){return!(d in n)});return!(c.length>0)}function i(u,c){var d=u.replace(/[\s\-]+/gi,"").toUpperCase(),p=d.slice(0,2).toUpperCase(),h=p in n;if(c.whitelist){if(!r(c.whitelist))return!1;var m=c.whitelist.includes(p);if(!m)return!1}if(c.blacklist){var v=c.blacklist.includes(p);if(v)return!1}return h&&n[p].test(d)}function o(u){var c=u.replace(/[^A-Z0-9]+/gi,"").toUpperCase(),d=c.slice(4)+c.slice(0,4),p=d.replace(/[A-Z]/g,function(m){return m.charCodeAt(0)-55}),h=p.match(/\d{1,7}/g).reduce(function(m,v){return Number(m+v)%97},"");return h===1}function a(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(0,e.default)(u),i(u,c)&&o(u)}return Zu.locales=Object.keys(n),Zu}var hv={exports:{}},Yu={},gD;function mD(){if(gD)return Yu;gD=1,Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.CountryCodes=void 0,Yu.default=r;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n=new Set(["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]);function r(i){return(0,e.default)(i),n.has(i.toUpperCase())}return Yu.CountryCodes=n,Yu}var vD;function XX(){return vD||(vD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=mD();function i(u){return u&&u.__esModule?u:{default:u}}var o=/^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;function a(u){(0,n.default)(u);var c=u.slice(4,6).toUpperCase();return!r.CountryCodes.has(c)&&c!=="XK"?!1:o.test(u)}e.exports=t.default,e.exports.default=t.default}(hv,hv.exports)),hv.exports}var pv={exports:{}},yD;function JX(){return yD||(yD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^[a-f0-9]{32}$/;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(pv,pv.exports)),pv.exports}var gv={exports:{}},_D;function eJ(){return _D||(_D=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};function o(a,u){(0,n.default)(a);var c=new RegExp("^[a-fA-F0-9]{".concat(i[u],"}$"));return c.test(a)}e.exports=t.default,e.exports.default=t.default}(gv,gv.exports)),gv.exports}var mv={exports:{}},vv={exports:{}},bD;function xD(){return bD||(bD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n=i(Be()),r=i(hi());function i(d){return d&&d.__esModule?d:{default:d}}var o=/[^A-Z0-9+\/=]/i,a=/^[A-Z0-9_\-]*$/i,u={urlSafe:!1};function c(d,p){(0,n.default)(d),p=(0,r.default)(p,u);var h=d.length;if(p.urlSafe)return a.test(d);if(h%4!==0||o.test(d))return!1;var m=d.indexOf("=");return m===-1||m===h-1||m===h-2&&d[h-1]==="="}e.exports=t.default,e.exports.default=t.default}(vv,vv.exports)),vv.exports}var wD;function tJ(){return wD||(wD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=i(Be()),r=i(xD());function i(a){return a&&a.__esModule?a:{default:a}}function o(a){(0,n.default)(a);var u=a.split("."),c=u.length;return c!==3?!1:u.reduce(function(d,p){return d&&(0,r.default)(p,{urlSafe:!0})},!0)}e.exports=t.default,e.exports.default=t.default}(mv,mv.exports)),mv.exports}var yv={exports:{}},SD;function nJ(){return SD||(SD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(Be()),r=i(hi());function i(c){return c&&c.__esModule?c:{default:c}}function o(c){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},o(c)}var a={allow_primitives:!1};function u(c,d){(0,n.default)(c);try{d=(0,r.default)(d,a);var p=[];d.allow_primitives&&(p=[null,!1,!0]);var h=JSON.parse(c);return p.includes(h)||!!h&&o(h)==="object"}catch{}return!1}e.exports=t.default,e.exports.default=t.default}(yv,yv.exports)),yv.exports}var _v={exports:{}},CD;function rJ(){return CD||(CD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=i(hi());function i(u){return u&&u.__esModule?u:{default:u}}var o={ignore_whitespace:!1};function a(u,c){return(0,n.default)(u),c=(0,r.default)(c,o),(c.ignore_whitespace?u.trim().length:u.length)===0}e.exports=t.default,e.exports.default=t.default}(_v,_v.exports)),_v.exports}var bv={exports:{}},ED;function iJ(){return ED||(ED=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}function i(a){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},i(a)}function o(a,u){(0,n.default)(a);var c,d;i(u)==="object"?(c=u.min||0,d=u.max):(c=arguments[1]||0,d=arguments[2]);var p=a.match(/(\uFE0F|\uFE0E)/g)||[],h=a.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],m=a.length-p.length-h.length,v=m>=c&&(typeof d>"u"||m<=d);return v&&Array.isArray(u==null?void 0:u.discreteLengths)?u.discreteLengths.some(function(_){return _===m}):v}e.exports=t.default,e.exports.default=t.default}(bv,bv.exports)),bv.exports}var xv={exports:{}},kD;function oJ(){return kD||(kD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o),/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/i.test(o)}e.exports=t.default,e.exports.default=t.default}(xv,xv.exports)),xv.exports}var wv={exports:{}},AD;function aJ(){return AD||(AD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i={1:/^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,2:/^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,6:/^[0-9A-F]{8}-[0-9A-F]{4}-6[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,7:/^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,8:/^[0-9A-F]{8}-[0-9A-F]{4}-8[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,nil:/^00000000-0000-0000-0000-000000000000$/i,max:/^ffffffff-ffff-ffff-ffff-ffffffffffff$/i,all:/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i};function o(a,u){return(0,n.default)(a),u==null&&(u="all"),u in i?i[u].test(a):!1}e.exports=t.default,e.exports.default=t.default}(wv,wv.exports)),wv.exports}var Sv={exports:{}},ID;function sJ(){return ID||(ID=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=i(Be()),r=i(sD());function i(a){return a&&a.__esModule?a:{default:a}}function o(a){return(0,n.default)(a),(0,r.default)(a)&&a.length===24}e.exports=t.default,e.exports.default=t.default}(Sv,Sv.exports)),Sv.exports}var Cv={exports:{}},TD;function lJ(){return TD||(TD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Ow());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){var u=(a==null?void 0:a.comparisonDate)||a||Date().toString(),c=(0,n.default)(u),d=(0,n.default)(o);return!!(d&&c&&d>c)}e.exports=t.default,e.exports.default=t.default}(Cv,Cv.exports)),Cv.exports}var Ev={exports:{}},MD;function uJ(){return MD||(MD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=i(Be()),r=i(Ow());function i(a){return a&&a.__esModule?a:{default:a}}function o(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:String(new Date);(0,n.default)(a);var c=(0,r.default)(u),d=(0,r.default)(a);return!!(d&&c&&d<c)}e.exports=t.default,e.exports.default=t.default}(Ev,Ev.exports)),Ev.exports}var kv={exports:{}},OD;function cJ(){return OD||(OD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=i(y2());function i(u){return u&&u.__esModule?u:{default:u}}function o(u){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},o(u)}function a(u,c){(0,n.default)(u);var d;if(Object.prototype.toString.call(c)==="[object Array]"){var p=[];for(d in c)({}).hasOwnProperty.call(c,d)&&(p[d]=(0,r.default)(c[d]));return p.indexOf(u)>=0}else{if(o(c)==="object")return c.hasOwnProperty(u);if(c&&typeof c.indexOf=="function")return c.indexOf(u)>=0}return!1}e.exports=t.default,e.exports.default=t.default}(kv,kv.exports)),kv.exports}var Av={exports:{}},RD;function $D(){return RD||(RD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){(0,n.default)(o);for(var a=o.replace(/[- ]+/g,""),u=0,c,d,p,h=a.length-1;h>=0;h--)c=a.substring(h,h+1),d=parseInt(c,10),p?(d*=2,d>=10?u+=d%10+1:u+=d):u+=d,p=!p;return!!(u%10===0&&a)}e.exports=t.default,e.exports.default=t.default}(Av,Av.exports)),Av.exports}var Iv={exports:{}},DD;function fJ(){return DD||(DD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(Be()),r=i($D());function i(c){return c&&c.__esModule?c:{default:c}}var o={amex:/^3[47][0-9]{13}$/,dinersclub:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,discover:/^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,jcb:/^(?:2131|1800|35\d{3})\d{11}$/,mastercard:/^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,unionpay:/^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,visa:/^(?:4[0-9]{12})(?:[0-9]{3,6})?$/},a=function(){var c=[];for(var d in o)o.hasOwnProperty(d)&&c.push(o[d]);return c}();function u(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(c);var p=d.provider,h=c.replace(/[- ]+/g,"");if(p&&p.toLowerCase()in o){if(!o[p.toLowerCase()].test(h))return!1}else{if(p&&!(p.toLowerCase()in o))throw new Error("".concat(p," is not a valid credit card provider."));if(!a.some(function(m){return m.test(h)}))return!1}return(0,r.default)(c)}e.exports=t.default,e.exports.default=t.default}(Iv,Iv.exports)),Iv.exports}var Tv={exports:{}},LD;function dJ(){return LD||(LD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=i(Be()),r=i($w());function i(u){return u&&u.__esModule?u:{default:u}}var o={PL:function(c){(0,n.default)(c);var d={1:1,2:3,3:7,4:9,5:1,6:3,7:7,8:9,9:1,10:3,11:0};if(c!=null&&c.length===11&&(0,r.default)(c,{allow_leading_zeroes:!0})){var p=c.split("").slice(0,-1),h=p.reduce(function(_,S,x){return _+Number(S)*d[x+1]},0),m=h%10,v=Number(c.charAt(c.length-1));if(m===0&&v===0||v===10-m)return!0}return!1},ES:function(c){(0,n.default)(c);var d=/^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/,p={X:0,Y:1,Z:2},h=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"],m=c.trim().toUpperCase();if(!d.test(m))return!1;var v=m.slice(0,-1).replace(/[X,Y,Z]/g,function(_){return p[_]});return m.endsWith(h[v%23])},FI:function(c){if((0,n.default)(c),c.length!==11||!c.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/))return!1;var d="0123456789ABCDEFHJKLMNPRSTUVWXY",p=parseInt(c.slice(0,6),10)*1e3+parseInt(c.slice(7,10),10),h=p%31,m=d[h];return m===c.slice(10,11)},IN:function(c){var d=/^[1-9]\d{3}\s?\d{4}\s?\d{4}$/,p=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],h=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],m=c.trim();if(!d.test(m))return!1;var v=0,_=m.replace(/\s/g,"").split("").map(Number).reverse();return _.forEach(function(S,x){v=p[v][h[x%8][S]]}),v===0},IR:function(c){if(!c.match(/^\d{10}$/)||(c="0000".concat(c).slice(c.length-6),parseInt(c.slice(3,9),10)===0))return!1;for(var d=parseInt(c.slice(9,10),10),p=0,h=0;h<9;h++)p+=parseInt(c.slice(h,h+1),10)*(10-h);return p%=11,p<2&&d===p||p>=2&&d===11-p},IT:function(c){return c.length!==9||c==="CA00000AA"?!1:c.search(/C[A-Z]\d{5}[A-Z]{2}/i)>-1},NO:function(c){var d=c.trim();if(isNaN(Number(d))||d.length!==11||d==="00000000000")return!1;var p=d.split("").map(Number),h=(11-(3*p[0]+7*p[1]+6*p[2]+1*p[3]+8*p[4]+9*p[5]+4*p[6]+5*p[7]+2*p[8])%11)%11,m=(11-(5*p[0]+4*p[1]+3*p[2]+2*p[3]+7*p[4]+6*p[5]+5*p[6]+4*p[7]+3*p[8]+2*h)%11)%11;return!(h!==p[9]||m!==p[10])},TH:function(c){if(!c.match(/^[1-8]\d{12}$/))return!1;for(var d=0,p=0;p<12;p++)d+=parseInt(c[p],10)*(13-p);return c[12]===((11-d%11)%10).toString()},LK:function(c){var d=/^[1-9]\d{8}[vx]$/i,p=/^[1-9]\d{11}$/i;return c.length===10&&d.test(c)?!0:!!(c.length===12&&p.test(c))},"he-IL":function(c){var d=/^\d{9}$/,p=c.trim();if(!d.test(p))return!1;for(var h=p,m=0,v,_=0;_<h.length;_++)v=Number(h[_])*(_%2+1),m+=v>9?v-9:v;return m%10===0},"ar-LY":function(c){var d=/^(1|2)\d{11}$/,p=c.trim();return!!d.test(p)},"ar-TN":function(c){var d=/^\d{8}$/,p=c.trim();return!!d.test(p)},"zh-CN":function(c){var d=["11","12","13","14","15","21","22","23","31","32","33","34","35","36","37","41","42","43","44","45","46","50","51","52","53","54","61","62","63","64","65","71","81","82","91"],p=["7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"],h=["1","0","X","9","8","7","6","5","4","3","2"],m=function(A){return d.includes(A)},v=function(A){var I=parseInt(A.substring(0,4),10),$=parseInt(A.substring(4,6),10),B=parseInt(A.substring(6),10),U=new Date(I,$-1,B);return U>new Date?!1:U.getFullYear()===I&&U.getMonth()===$-1&&U.getDate()===B},_=function(A){for(var I=A.substring(0,17),$=0,B=0;B<17;B++)$+=parseInt(I.charAt(B),10)*parseInt(p[B],10);var U=$%11;return h[U]},S=function(A){return _(A)===A.charAt(17).toUpperCase()},x=function(A){var I=/^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(A);if(!I)return!1;var $=A.substring(0,2);if(I=m($),!I)return!1;var B="19".concat(A.substring(6,12));return I=v(B),!!I},b=function(A){var I=/^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(A);if(!I)return!1;var $=A.substring(0,2);if(I=m($),!I)return!1;var B=A.substring(6,14);return I=v(B),I?S(A):!1},C=function(A){var I=/^\d{15}|(\d{17}(\d|x|X))$/.test(A);return I?A.length===15?x(A):b(A):!1};return C(c)},"zh-HK":function(c){c=c.trim();var d=/^[A-Z]{1,2}[0-9]{6}((\([0-9A]\))|(\[[0-9A]\])|([0-9A]))$/,p=/^[0-9]$/;if(c=c.toUpperCase(),!d.test(c))return!1;c=c.replace(/\[|\]|\(|\)/g,""),c.length===8&&(c="3".concat(c));for(var h=0,m=0;m<=7;m++){var v=void 0;p.test(c[m])?v=c[m]:v=(c[m].charCodeAt(0)-55)%11,h+=v*(9-m)}h%=11;var _;return h===0?_="0":h===1?_="A":_=String(11-h),_===c[c.length-1]},"zh-TW":function(c){var d={A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:34,J:18,K:19,L:20,M:21,N:22,O:35,P:23,Q:24,R:25,S:26,T:27,U:28,V:29,W:32,X:30,Y:31,Z:33},p=c.trim().toUpperCase();return/^[A-Z][0-9]{9}$/.test(p)?Array.from(p).reduce(function(h,m,v){if(v===0){var _=d[m];return _%10*9+Math.floor(_/10)}return v===9?(10-h%10-Number(m))%10===0:h+Number(m)*(9-v)},0):!1},PK:function(c){var d=/^[1-7][0-9]{4}-[0-9]{7}-[1-9]$/,p=c.trim();return d.test(p)}};function a(u,c){if((0,n.default)(u),c in o)return o[c](u);if(c==="any"){for(var d in o)if(o.hasOwnProperty(d)){var p=o[d];if(p(u))return!0}return!1}throw new Error("Invalid locale '".concat(c,"'"))}e.exports=t.default,e.exports.default=t.default}(Tv,Tv.exports)),Tv.exports}var Mv={exports:{}},ND;function hJ(){return ND||(ND=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var n=r(Be());function r(p){return p&&p.__esModule?p:{default:p}}var i=8,o=14,a=/^(\d{8}|\d{13}|\d{14})$/;function u(p,h){return p===i||p===o?h%2===0?3:1:h%2===0?1:3}function c(p){var h=p.slice(0,-1).split("").map(function(v,_){return Number(v)*u(p.length,_)}).reduce(function(v,_){return v+_},0),m=10-h%10;return m<10?m:0}function d(p){(0,n.default)(p);var h=Number(p.slice(-1));return a.test(p)&&h===c(p)}e.exports=t.default,e.exports.default=t.default}(Mv,Mv.exports)),Mv.exports}var Ov={exports:{}},BD;function pJ(){return BD||(BD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;function o(a){if((0,n.default)(a),!i.test(a))return!1;for(var u=!0,c=0,d=a.length-2;d>=0;d--)if(a[d]>="A"&&a[d]<="Z")for(var p=a[d].charCodeAt(0)-55,h=p%10,m=Math.trunc(p/10),v=0,_=[h,m];v<_.length;v++){var S=_[v];u?S>=5?c+=1+(S-5)*2:c+=S*2:c+=S,u=!u}else{var x=a[d].charCodeAt(0)-48;u?x>=5?c+=1+(x-5)*2:c+=x*2:c+=x,u=!u}var b=Math.trunc((c+9)/10)*10-c;return+a[a.length-1]===b}e.exports=t.default,e.exports.default=t.default}(Ov,Ov.exports)),Ov.exports}var Rv={exports:{}},PD;function gJ(){return PD||(PD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=r(Be());function r(c){return c&&c.__esModule?c:{default:c}}var i=/^(?:[0-9]{9}X|[0-9]{10})$/,o=/^(?:[0-9]{13})$/,a=[1,3];function u(c,d){(0,n.default)(c);var p=String((d==null?void 0:d.version)||d);if(!(d!=null&&d.version||d))return u(c,{version:10})||u(c,{version:13});var h=c.replace(/[\s-]+/g,""),m=0;if(p==="10"){if(!i.test(h))return!1;for(var v=0;v<p-1;v++)m+=(v+1)*h.charAt(v);if(h.charAt(9)==="X"?m+=100:m+=10*h.charAt(9),m%11===0)return!0}else if(p==="13"){if(!o.test(h))return!1;for(var _=0;_<12;_++)m+=a[_%2]*h.charAt(_);if(h.charAt(12)-(10-m%10)%10===0)return!0}return!1}e.exports=t.default,e.exports.default=t.default}(Rv,Rv.exports)),Rv.exports}var $v={exports:{}},FD;function mJ(){return FD||(FD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i="^\\d{4}-?\\d{3}[\\dX]$";function o(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(a);var c=i;if(c=u.require_hyphen?c.replace("?",""):c,c=u.case_sensitive?new RegExp(c):new RegExp(c,"i"),!c.test(a))return!1;for(var d=a.replace("-","").toUpperCase(),p=0,h=0;h<d.length;h++){var m=d[h];p+=(m==="X"?10:+m)*(8-h)}return p%11===0}e.exports=t.default,e.exports.default=t.default}($v,$v.exports)),$v.exports}var Dv={exports:{}},hl={},zD;function UD(){if(zD)return hl;zD=1,Object.defineProperty(hl,"__esModule",{value:!0}),hl.iso7064Check=e,hl.luhnCheck=t,hl.reverseMultiplyAndSum=n,hl.verhoeffCheck=r;function e(i){for(var o=10,a=0;a<i.length-1;a++)o=(parseInt(i[a],10)+o)%10===0?9:(parseInt(i[a],10)+o)%10*2%11;return o=o===1?0:11-o,o===parseInt(i[10],10)}function t(i){for(var o=0,a=!1,u=i.length-1;u>=0;u--){if(a){var c=parseInt(i[u],10)*2;c>9?o+=c.toString().split("").map(function(d){return parseInt(d,10)}).reduce(function(d,p){return d+p},0):o+=c}else o+=parseInt(i[u],10);a=!a}return o%10===0}function n(i,o){for(var a=0,u=0;u<i.length;u++)a+=i[u]*(o-u);return a}function r(i){for(var o=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],a=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],u=i.split("").reverse().join(""),c=0,d=0;d<u.length;d++)c=o[c][a[d%8][parseInt(u[d],10)]];return c===0}return hl}var jD;function vJ(){return jD||(jD=1,function(e,t){function n(N){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},n(N)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=He;var r=c(Be()),i=u(UD()),o=c(D2());function a(N){if(typeof WeakMap!="function")return null;var F=new WeakMap,Y=new WeakMap;return(a=function(_e){return _e?Y:F})(N)}function u(N,F){if(N&&N.__esModule)return N;if(N===null||n(N)!="object"&&typeof N!="function")return{default:N};var Y=a(F);if(Y&&Y.has(N))return Y.get(N);var ge={__proto__:null},_e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ie in N)if(Ie!=="default"&&{}.hasOwnProperty.call(N,Ie)){var We=_e?Object.getOwnPropertyDescriptor(N,Ie):null;We&&(We.get||We.set)?Object.defineProperty(ge,Ie,We):ge[Ie]=N[Ie]}return ge.default=N,Y&&Y.set(N,ge),ge}function c(N){return N&&N.__esModule?N:{default:N}}function d(N){return v(N)||m(N)||h(N)||p()}function p(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
947
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h(N,F){if(N){if(typeof N=="string")return _(N,F);var Y={}.toString.call(N).slice(8,-1);return Y==="Object"&&N.constructor&&(Y=N.constructor.name),Y==="Map"||Y==="Set"?Array.from(N):Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y)?_(N,F):void 0}}function m(N){if(typeof Symbol<"u"&&N[Symbol.iterator]!=null||N["@@iterator"]!=null)return Array.from(N)}function v(N){if(Array.isArray(N))return _(N)}function _(N,F){(F==null||F>N.length)&&(F=N.length);for(var Y=0,ge=Array(F);Y<F;Y++)ge[Y]=N[Y];return ge}function S(N){var F=N.slice(0,2),Y=parseInt(N.slice(2,4),10);Y>40?(Y-=40,F="20".concat(F)):Y>20?(Y-=20,F="18".concat(F)):F="19".concat(F),Y<10&&(Y="0".concat(Y));var ge="".concat(F,"/").concat(Y,"/").concat(N.slice(4,6));if(!(0,o.default)(ge,"YYYY/MM/DD"))return!1;for(var _e=N.split("").map(function(ne){return parseInt(ne,10)}),Ie=[2,4,8,5,10,9,7,3,6],We=0,nt=0;nt<Ie.length;nt++)We+=_e[nt]*Ie[nt];return We=We%11===10?0:We%11,We===_e[9]}function x(N){var F=N.split(""),Y=F.filter(function(_e,Ie){return Ie%2}).map(function(_e){return Number(_e)*2}).join("").split(""),ge=F.filter(function(_e,Ie){return!(Ie%2)}).concat(Y).map(function(_e){return Number(_e)}).reduce(function(_e,Ie){return _e+Ie});return ge%10===0}function b(N){N=N.replace(/\W/,"");var F=parseInt(N.slice(0,2),10);if(N.length===10)F<54?F="20".concat(F):F="19".concat(F);else{if(N.slice(6)==="000")return!1;if(F<54)F="19".concat(F);else return!1}F.length===3&&(F=[F.slice(0,2),"0",F.slice(2)].join(""));var Y=parseInt(N.slice(2,4),10);if(Y>50&&(Y-=50),Y>20){if(parseInt(F,10)<2004)return!1;Y-=20}Y<10&&(Y="0".concat(Y));var ge="".concat(F,"/").concat(Y,"/").concat(N.slice(4,6));if(!(0,o.default)(ge,"YYYY/MM/DD"))return!1;if(N.length===10&&parseInt(N,10)%11!==0){var _e=parseInt(N.slice(0,9),10)%11;if(parseInt(F,10)<1986&&_e===10){if(parseInt(N.slice(9),10)!==0)return!1}else return!1}return!0}function C(N){return i.luhnCheck(N)}function k(N){for(var F=N.split("").map(function(ne){return parseInt(ne,10)}),Y=[],ge=0;ge<F.length-1;ge++){Y.push("");for(var _e=0;_e<F.length-1;_e++)F[ge]===F[_e]&&(Y[ge]+=_e)}if(Y=Y.filter(function(ne){return ne.length>1}),Y.length!==2&&Y.length!==3)return!1;if(Y[0].length===3){for(var Ie=Y[0].split("").map(function(ne){return parseInt(ne,10)}),We=0,nt=0;nt<Ie.length-1;nt++)Ie[nt]+1===Ie[nt+1]&&(We+=1);if(We===2)return!1}return i.iso7064Check(N)}function A(N){N=N.replace(/\W/,"");var F=parseInt(N.slice(4,6),10),Y=N.slice(6,7);switch(Y){case"0":case"1":case"2":case"3":F="19".concat(F);break;case"4":case"9":F<37?F="20".concat(F):F="19".concat(F);break;default:if(F<37)F="20".concat(F);else if(F>58)F="18".concat(F);else return!1;break}F.length===3&&(F=[F.slice(0,2),"0",F.slice(2)].join(""));var ge="".concat(F,"/").concat(N.slice(2,4),"/").concat(N.slice(0,2));if(!(0,o.default)(ge,"YYYY/MM/DD"))return!1;for(var _e=N.split("").map(function(ne){return parseInt(ne,10)}),Ie=0,We=4,nt=0;nt<9;nt++)Ie+=_e[nt]*We,We-=1,We===1&&(We=7);return Ie%=11,Ie===1?!1:Ie===0?_e[9]===0:_e[9]===11-Ie}function I(N){for(var F=N.slice(0,8).split("").map(function(Ie){return parseInt(Ie,10)}),Y=0,ge=1;ge<F.length;ge+=2)Y+=F[ge];for(var _e=0;_e<F.length;_e+=2)F[_e]<2?Y+=1-F[_e]:(Y+=2*(F[_e]-2)+5,F[_e]>4&&(Y+=2));return String.fromCharCode(Y%26+65)===N.charAt(8)}function $(N){for(var F=N.split("").map(function(_e){return parseInt(_e,10)}),Y=0,ge=0;ge<8;ge++)Y+=F[ge]*Math.pow(2,8-ge);return Y%11%10===F[8]}function B(N){var F=i.reverseMultiplyAndSum(N.split("").slice(0,7).map(function(Y){return parseInt(Y,10)}),8);return N.length===9&&N[8]!=="W"&&(F+=(N[8].charCodeAt(0)-64)*9),F%=23,F===0?N[7].toUpperCase()==="W":N[7].toUpperCase()===String.fromCharCode(64+F)}var U={andover:["10","12"],atlanta:["60","67"],austin:["50","53"],brookhaven:["01","02","03","04","05","06","11","13","14","16","21","22","23","25","34","51","52","54","55","56","57","58","59","65"],cincinnati:["30","32","35","36","37","38","61"],fresno:["15","24"],internet:["20","26","27","45","46","47"],kansas:["40","44"],memphis:["94","95"],ogden:["80","90"],philadelphia:["33","39","41","42","43","46","48","62","63","64","66","68","71","72","73","74","75","76","77","81","82","83","84","85","86","87","88","91","92","93","98","99"],sba:["31"]};function G(){var N=[];for(var F in U)U.hasOwnProperty(F)&&N.push.apply(N,d(U[F]));return N}function P(N){return G().indexOf(N.slice(0,2))!==-1}function K(N){for(var F=0,Y=N.split(""),ge=parseInt(Y.pop(),10),_e=0;_e<Y.length;_e++)F+=Y[9-_e]*(2+_e%6);var Ie=11-F%11;return Ie===11?Ie=0:Ie===10&&(Ie=9),ge===Ie}function re(N){var F=N.toUpperCase().split("");if(isNaN(parseInt(F[0],10))&&F.length>1){var Y=0;switch(F[0]){case"Y":Y=1;break;case"Z":Y=2;break}F.splice(0,1,Y)}else for(;F.length<9;)F.unshift(0);var ge=["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"];F=F.join("");var _e=parseInt(F.slice(0,8),10)%23;return F[8]===ge[_e]}function ue(N){var F=N.slice(1,3),Y=N.slice(0,1);switch(Y){case"1":case"2":F="18".concat(F);break;case"3":case"4":F="19".concat(F);break;default:F="20".concat(F);break}var ge="".concat(F,"/").concat(N.slice(3,5),"/").concat(N.slice(5,7));if(!(0,o.default)(ge,"YYYY/MM/DD"))return!1;for(var _e=N.split("").map(function(me){return parseInt(me,10)}),Ie=0,We=1,nt=0;nt<10;nt++)Ie+=_e[nt]*We,We+=1,We===10&&(We=1);if(Ie%11===10){Ie=0,We=3;for(var ne=0;ne<10;ne++)Ie+=_e[ne]*We,We+=1,We===10&&(We=1);if(Ie%11===10)return _e[10]===0}return Ie%11===_e[10]}function Z(N){var F=N.slice(4,6),Y=N.slice(6,7);switch(Y){case"+":F="18".concat(F);break;case"-":F="19".concat(F);break;default:F="20".concat(F);break}var ge="".concat(F,"/").concat(N.slice(2,4),"/").concat(N.slice(0,2));if(!(0,o.default)(ge,"YYYY/MM/DD"))return!1;var _e=parseInt(N.slice(0,6)+N.slice(7,10),10)%31;if(_e<10)return _e===parseInt(N.slice(10),10);_e-=10;var Ie=["A","B","C","D","E","F","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y"];return Ie[_e]===N.slice(10)}function ie(N){if(N.slice(2,4)!=="00"||N.slice(4,6)!=="00"){var F="".concat(N.slice(0,2),"/").concat(N.slice(2,4),"/").concat(N.slice(4,6));if(!(0,o.default)(F,"YY/MM/DD"))return!1}var Y=97-parseInt(N.slice(0,9),10)%97,ge=parseInt(N.slice(9,11),10);return!(Y!==ge&&(Y=97-parseInt("2".concat(N.slice(0,9)),10)%97,Y!==ge))}function V(N){N=N.replace(/\s/g,"");var F=parseInt(N.slice(0,10),10)%511,Y=parseInt(N.slice(10,13),10);return F===Y}function Q(N){var F="".concat(N.slice(0,4),"/").concat(N.slice(4,6),"/").concat(N.slice(6,8));return!(0,o.default)(F,"YYYY/MM/DD")||!i.luhnCheck(N.slice(0,12))?!1:i.verhoeffCheck("".concat(N.slice(0,11)).concat(N[12]))}function ye(N){return i.iso7064Check(N)}function Te(N){for(var F=N.split("").map(function(_e){return parseInt(_e,10)}),Y=8,ge=1;ge<9;ge++)Y+=F[ge]*(ge+1);return Y%11===F[9]}function T(N){for(var F=!1,Y=!1,ge=0;ge<3;ge++)if(!F&&/[AEIOU]/.test(N[ge]))F=!0;else if(!Y&&F&&N[ge]==="X")Y=!0;else if(ge>0&&(F&&!Y&&!/[AEIOU]/.test(N[ge])||Y&&!/X/.test(N[ge])))return!1;return!0}function X(N){var F=N.toUpperCase().split("");if(!T(F.slice(0,3))||!T(F.slice(3,6)))return!1;for(var Y=[6,7,9,10,12,13,14],ge={L:"0",M:"1",N:"2",P:"3",Q:"4",R:"5",S:"6",T:"7",U:"8",V:"9"},_e=0,Ie=Y;_e<Ie.length;_e++){var We=Ie[_e];F[We]in ge&&F.splice(We,1,ge[F[We]])}var nt={A:"01",B:"02",C:"03",D:"04",E:"05",H:"06",L:"07",M:"08",P:"09",R:"10",S:"11",T:"12"},ne=nt[F[8]],me=parseInt(F[9]+F[10],10);me>40&&(me-=40),me<10&&(me="0".concat(me));var qe="".concat(F[6]).concat(F[7],"/").concat(ne,"/").concat(me);if(!(0,o.default)(qe,"YY/MM/DD"))return!1;for(var Xe=0,at=1;at<F.length-1;at+=2){var Tt=parseInt(F[at],10);isNaN(Tt)&&(Tt=F[at].charCodeAt(0)-65),Xe+=Tt}for(var Bt={A:1,B:0,C:5,D:7,E:9,F:13,G:15,H:17,I:19,J:21,K:2,L:4,M:18,N:20,O:11,P:3,Q:6,R:8,S:12,T:14,U:16,V:10,W:22,X:25,Y:24,Z:23,0:1,1:0},Et=0;Et<F.length-1;Et+=2){var Yt=0;if(F[Et]in Bt)Yt=Bt[F[Et]];else{var ft=parseInt(F[Et],10);Yt=2*ft+1,ft>4&&(Yt+=2)}Xe+=Yt}return String.fromCharCode(65+Xe%26)===F[15]}function ve(N){N=N.replace(/\W/,"");var F=N.slice(0,2);if(F!=="32"){var Y=N.slice(2,4);if(Y!=="00"){var ge=N.slice(4,6);switch(N[6]){case"0":ge="18".concat(ge);break;case"1":ge="19".concat(ge);break;default:ge="20".concat(ge);break}var _e="".concat(ge,"/").concat(N.slice(2,4),"/").concat(F);if(!(0,o.default)(_e,"YYYY/MM/DD"))return!1}for(var Ie=1101,We=[1,6,3,7,9,10,5,8,4,2],nt=0;nt<N.length-1;nt++)Ie-=parseInt(N[nt],10)*We[nt];return parseInt(N[10],10)===Ie%11}return!0}function L(N){if(N.length!==9){for(var F=N.toUpperCase().split("");F.length<8;)F.unshift(0);switch(N[7]){case"A":case"P":if(parseInt(F[6],10)===0)return!1;break;default:{var Y=parseInt(F.join("").slice(0,5),10);if(Y>32e3)return!1;var ge=parseInt(F.join("").slice(5,7),10);if(Y===ge)return!1}}}return!0}function we(N){return i.reverseMultiplyAndSum(N.split("").slice(0,8).map(function(F){return parseInt(F,10)}),9)%11===parseInt(N[8],10)}function Ue(N){if(N.length===10){for(var F=[6,5,7,2,3,4,5,6,7],Y=0,ge=0;ge<F.length;ge++)Y+=parseInt(N[ge],10)*F[ge];return Y%=11,Y===10?!1:Y===parseInt(N[9],10)}var _e=N.slice(0,2),Ie=parseInt(N.slice(2,4),10);Ie>80?(_e="18".concat(_e),Ie-=80):Ie>60?(_e="22".concat(_e),Ie-=60):Ie>40?(_e="21".concat(_e),Ie-=40):Ie>20?(_e="20".concat(_e),Ie-=20):_e="19".concat(_e),Ie<10&&(Ie="0".concat(Ie));var We="".concat(_e,"/").concat(Ie,"/").concat(N.slice(4,6));if(!(0,o.default)(We,"YYYY/MM/DD"))return!1;for(var nt=0,ne=1,me=0;me<N.length-1;me++)nt+=parseInt(N[me],10)*ne%10,ne+=2,ne>10?ne=1:ne===5&&(ne+=2);return nt=10-nt%10,nt===parseInt(N[10],10)}function de(N){if(N.length===11){var F,Y;if(F=0,N==="11111111111"||N==="22222222222"||N==="33333333333"||N==="44444444444"||N==="55555555555"||N==="66666666666"||N==="77777777777"||N==="88888888888"||N==="99999999999"||N==="00000000000")return!1;for(var ge=1;ge<=9;ge++)F+=parseInt(N.substring(ge-1,ge),10)*(11-ge);if(Y=F*10%11,Y===10&&(Y=0),Y!==parseInt(N.substring(9,10),10))return!1;F=0;for(var _e=1;_e<=10;_e++)F+=parseInt(N.substring(_e-1,_e),10)*(12-_e);return Y=F*10%11,Y===10&&(Y=0),Y===parseInt(N.substring(10,11),10)}if(N==="00000000000000"||N==="11111111111111"||N==="22222222222222"||N==="33333333333333"||N==="44444444444444"||N==="55555555555555"||N==="66666666666666"||N==="77777777777777"||N==="88888888888888"||N==="99999999999999")return!1;for(var Ie=N.length-2,We=N.substring(0,Ie),nt=N.substring(Ie),ne=0,me=Ie-7,qe=Ie;qe>=1;qe--)ne+=We.charAt(Ie-qe)*me,me-=1,me<2&&(me=9);var Xe=ne%11<2?0:11-ne%11;if(Xe!==parseInt(nt.charAt(0),10))return!1;Ie+=1,We=N.substring(0,Ie),ne=0,me=Ie-7;for(var at=Ie;at>=1;at--)ne+=We.charAt(Ie-at)*me,me-=1,me<2&&(me=9);return Xe=ne%11<2?0:11-ne%11,Xe===parseInt(nt.charAt(1),10)}function tt(N){var F=11-i.reverseMultiplyAndSum(N.split("").slice(0,8).map(function(Y){return parseInt(Y,10)}),9)%11;return F>9?parseInt(N[8],10)===0:F===parseInt(N[8],10)}function Ze(N){if(N.slice(0,4)!=="9000"){var F=N.slice(1,3);switch(N[0]){case"1":case"2":F="19".concat(F);break;case"3":case"4":F="18".concat(F);break;case"5":case"6":F="20".concat(F);break}var Y="".concat(F,"/").concat(N.slice(3,5),"/").concat(N.slice(5,7));if(Y.length===8){if(!(0,o.default)(Y,"YY/MM/DD"))return!1}else if(!(0,o.default)(Y,"YYYY/MM/DD"))return!1;for(var ge=N.split("").map(function(nt){return parseInt(nt,10)}),_e=[2,7,9,1,4,6,3,5,8,2,7,9],Ie=0,We=0;We<_e.length;We++)Ie+=ge[We]*_e[We];return Ie%11===10?ge[12]===1:ge[12]===Ie%11}return!0}function lt(N){if(N.length===9){if(N=N.replace(/\W/,""),N.slice(6)==="000")return!1;var F=parseInt(N.slice(0,2),10);if(F>53)return!1;F<10?F="190".concat(F):F="19".concat(F);var Y=parseInt(N.slice(2,4),10);Y>50&&(Y-=50),Y<10&&(Y="0".concat(Y));var ge="".concat(F,"/").concat(Y,"/").concat(N.slice(4,6));if(!(0,o.default)(ge,"YYYY/MM/DD"))return!1}return!0}function gt(N){var F=11-i.reverseMultiplyAndSum(N.split("").slice(0,7).map(function(Y){return parseInt(Y,10)}),8)%11;return F===10?parseInt(N[7],10)===0:F===parseInt(N[7],10)}function je(N){var F=N.slice(0);N.length>11&&(F=F.slice(2));var Y="",ge=F.slice(2,4),_e=parseInt(F.slice(4,6),10);if(N.length>11)Y=N.slice(0,4);else if(Y=N.slice(0,2),N.length===11&&_e<60){var Ie=new Date().getFullYear().toString(),We=parseInt(Ie.slice(0,2),10);if(Ie=parseInt(Ie,10),N[6]==="-")parseInt("".concat(We).concat(Y),10)>Ie?Y="".concat(We-1).concat(Y):Y="".concat(We).concat(Y);else if(Y="".concat(We-1).concat(Y),Ie-parseInt(Y,10)<100)return!1}_e>60&&(_e-=60),_e<10&&(_e="0".concat(_e));var nt="".concat(Y,"/").concat(ge,"/").concat(_e);if(nt.length===8){if(!(0,o.default)(nt,"YY/MM/DD"))return!1}else if(!(0,o.default)(nt,"YYYY/MM/DD"))return!1;return i.luhnCheck(N.replace(/\W/,""))}function Se(N){for(var F=N.split("").map(function(Ie){return parseInt(Ie,10)}),Y=[-1,5,7,9,4,6,10,5,7],ge=0,_e=0;_e<Y.length;_e++)ge+=F[_e]*Y[_e];return ge%11===10?F[9]===0:F[9]===ge%11}var Ye={"bg-BG":/^\d{10}$/,"cs-CZ":/^\d{6}\/{0,1}\d{3,4}$/,"de-AT":/^\d{9}$/,"de-DE":/^[1-9]\d{10}$/,"dk-DK":/^\d{6}-{0,1}\d{4}$/,"el-CY":/^[09]\d{7}[A-Z]$/,"el-GR":/^([0-4]|[7-9])\d{8}$/,"en-CA":/^\d{9}$/,"en-GB":/^\d{10}$|^(?!GB|NK|TN|ZZ)(?![DFIQUV])[A-Z](?![DFIQUVO])[A-Z]\d{6}[ABCD ]$/i,"en-IE":/^\d{7}[A-W][A-IW]{0,1}$/i,"en-US":/^\d{2}[- ]{0,1}\d{7}$/,"es-AR":/(20|23|24|27|30|33|34)[0-9]{8}[0-9]/,"es-ES":/^(\d{0,8}|[XYZKLM]\d{7})[A-HJ-NP-TV-Z]$/i,"et-EE":/^[1-6]\d{6}(00[1-9]|0[1-9][0-9]|[1-6][0-9]{2}|70[0-9]|710)\d$/,"fi-FI":/^\d{6}[-+A]\d{3}[0-9A-FHJ-NPR-Y]$/i,"fr-BE":/^\d{11}$/,"fr-FR":/^[0-3]\d{12}$|^[0-3]\d\s\d{2}(\s\d{3}){3}$/,"fr-LU":/^\d{13}$/,"hr-HR":/^\d{11}$/,"hu-HU":/^8\d{9}$/,"it-IT":/^[A-Z]{6}[L-NP-V0-9]{2}[A-EHLMPRST][L-NP-V0-9]{2}[A-ILMZ][L-NP-V0-9]{3}[A-Z]$/i,"lv-LV":/^\d{6}-{0,1}\d{5}$/,"mt-MT":/^\d{3,7}[APMGLHBZ]$|^([1-8])\1\d{7}$/i,"nl-NL":/^\d{9}$/,"pl-PL":/^\d{10,11}$/,"pt-BR":/(?:^\d{11}$)|(?:^\d{14}$)/,"pt-PT":/^\d{9}$/,"ro-RO":/^\d{13}$/,"sk-SK":/^\d{6}\/{0,1}\d{3,4}$/,"sl-SI":/^[1-9]\d{7}$/,"sv-SE":/^(\d{6}[-+]{0,1}\d{4}|(18|19|20)\d{6}[-+]{0,1}\d{4})$/,"uk-UA":/^\d{10}$/};Ye["lb-LU"]=Ye["fr-LU"],Ye["lt-LT"]=Ye["et-EE"],Ye["nl-BE"]=Ye["fr-BE"],Ye["fr-CA"]=Ye["en-CA"];var Qe={"bg-BG":S,"cs-CZ":b,"de-AT":C,"de-DE":k,"dk-DK":A,"el-CY":I,"el-GR":$,"en-CA":x,"en-IE":B,"en-US":P,"es-AR":K,"es-ES":re,"et-EE":ue,"fi-FI":Z,"fr-BE":ie,"fr-FR":V,"fr-LU":Q,"hr-HR":ye,"hu-HU":Te,"it-IT":X,"lv-LV":ve,"mt-MT":L,"nl-NL":we,"pl-PL":Ue,"pt-BR":de,"pt-PT":tt,"ro-RO":Ze,"sk-SK":lt,"sl-SI":gt,"sv-SE":je,"uk-UA":Se};Qe["lb-LU"]=Qe["fr-LU"],Qe["lt-LT"]=Qe["et-EE"],Qe["nl-BE"]=Qe["fr-BE"],Qe["fr-CA"]=Qe["en-CA"];var ot=/[-\\\/!@#$%\^&\*\(\)\+\=\[\]]+/g,et={"de-AT":ot,"de-DE":/[\/\\]/g,"fr-BE":ot};et["nl-BE"]=et["fr-BE"];function He(N){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US";(0,r.default)(N);var Y=N.slice(0);if(F in Ye)return F in et&&(Y=Y.replace(et[F],"")),Ye[F].test(Y)?F in Qe?Qe[F](Y):!0:!1;throw new Error("Invalid locale '".concat(F,"'"))}e.exports=t.default,e.exports.default=t.default}(Dv,Dv.exports)),Dv.exports}var Wu={},qD;function yJ(){if(qD)return Wu;qD=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.default=r,Wu.locales=void 0;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n={"am-AM":/^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)([569]\d{7}|41\d{6})$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?(9[1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SD":/^((\+?249)|0)?(9[012369]|1[012])\d{7}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,"el-GR":/^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,"el-CY":/^(\+?357?)?(9(9|6)\d{6})$/,"en-AI":/^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-AG":/^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,"en-BS":/^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,"en-GB":/^(\+?44|0)7[1-9]\d{8}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|53|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-JM":/^(\+?876)?\d{7}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"fr-CF":/^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/,"en-SS":/^(\+?211|0)(9[1257])\d{7}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-KN":/^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,"en-LS":/^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-MW":/^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PG":/^(\+?675|0)?(7\d|8[18])\d{6}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?0[79][567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}$/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8|3|2]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-GT":/^(\+?502)?[2|6|7]\d{7}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-NI":/^(\+?505)\d{7,8}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-BJ":/^(\+229)\d{8}$/,"fr-CD":/^(\+?243|0)?(8|9)\d{8}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"fr-WF":/^(\+681)?\d{6}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"ir-IR":/^(\+98|0)?9\d{9}$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(79\d{7}|5\d{8})$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"ky-KG":/^(\+996\s?)?(22[0-9]|50[0-9]|55[0-9]|70[0-9]|75[0-9]|77[0-9]|880|990|995|996|997|998)\s?\d{3}\s?\d{3}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"mg-MG":/^((\+?261|0)(2|3)\d)?\d{7}$/,"mn-MN":/^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,"my-MM":/^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,"ms-MY":/^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nl-AW":/^(\+)?297(56|59|64|73|74|99)\d{5}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+244)\d{9}$/,"ro-MD":/^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,"ro-RO":/^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"so-SO":/^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/,"sq-AL":/^(\+355|0)6[2-9]\d{7}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38)?0(50|6[36-8]|7[357]|9[1-9])\d{7}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/,"ar-YE":/^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,"ar-EH":/^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,"fa-AF":/^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/,"mk-MK":/^(\+?389|0)?((?:2[2-9]\d{6}|(?:3[1-4]|4[2-8])\d{6}|500\d{5}|5[2-9]\d{6}|7[0-9][2-9]\d{5}|8[1-9]\d{6}|800\d{5}|8009\d{4}))$/};n["en-CA"]=n["en-US"],n["fr-CA"]=n["en-CA"],n["fr-BE"]=n["nl-BE"],n["zh-HK"]=n["en-HK"],n["zh-MO"]=n["en-MO"],n["ga-IE"]=n["en-IE"],n["fr-CH"]=n["de-CH"],n["it-CH"]=n["fr-CH"];function r(i,o,a){if((0,e.default)(i),a&&a.strictMode&&!i.startsWith("+"))return!1;if(Array.isArray(o))return o.some(function(d){if(n.hasOwnProperty(d)){var p=n[d];if(p.test(i))return!0}return!1});if(o in n)return n[o].test(i);if(!o||o==="any"){for(var u in n)if(n.hasOwnProperty(u)){var c=n[u];if(c.test(i))return!0}return!1}throw new Error("Invalid locale '".concat(o,"'"))}return Wu.locales=Object.keys(n),Wu}var Lv={exports:{}},HD;function _J(){return HD||(HD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^(0x)[0-9a-f]{40}$/i;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(Lv,Lv.exports)),Lv.exports}var Nv={exports:{}},GD;function bJ(){return GD||(GD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=i(hi()),r=i(Be());function i(c){return c&&c.__esModule?c:{default:c}}function o(c){var d="\\d{".concat(c.digits_after_decimal[0],"}");c.digits_after_decimal.forEach(function(C,k){k!==0&&(d="".concat(d,"|\\d{").concat(C,"}"))});var p="(".concat(c.symbol.replace(/\W/,function(C){return"\\".concat(C)}),")").concat(c.require_symbol?"":"?"),h="-?",m="[1-9]\\d*",v="[1-9]\\d{0,2}(\\".concat(c.thousands_separator,"\\d{3})*"),_=["0",m,v],S="(".concat(_.join("|"),")?"),x="(\\".concat(c.decimal_separator,"(").concat(d,"))").concat(c.require_decimal?"":"?"),b=S+(c.allow_decimal||c.require_decimal?x:"");return c.allow_negatives&&!c.parens_for_negatives&&(c.negative_sign_after_digits?b+=h:c.negative_sign_before_digits&&(b=h+b)),c.allow_negative_sign_placeholder?b="( (?!\\-))?".concat(b):c.allow_space_after_symbol?b=" ?".concat(b):c.allow_space_after_digits&&(b+="( (?!$))?"),c.symbol_after_digits?b+=p:b=p+b,c.allow_negatives&&(c.parens_for_negatives?b="(\\(".concat(b,"\\)|").concat(b,")"):c.negative_sign_before_digits||c.negative_sign_after_digits||(b=h+b)),new RegExp("^(?!-? )(?=.*\\d)".concat(b,"$"))}var a={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};function u(c,d){return(0,r.default)(c),d=(0,n.default)(d,a),o(d).test(c)}e.exports=t.default,e.exports.default=t.default}(Nv,Nv.exports)),Nv.exports}var Bv={exports:{}},VD;function xJ(){return VD||(VD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=r(Be());function r(u){return u&&u.__esModule?u:{default:u}}var i=/^(bc1|tb1|bc1p|tb1p)[ac-hj-np-z02-9]{39,58}$/,o=/^(1|2|3|m)[A-HJ-NP-Za-km-z1-9]{25,39}$/;function a(u){return(0,n.default)(u),i.test(u)||o.test(u)}e.exports=t.default,e.exports.default=t.default}(Bv,Bv.exports)),Bv.exports}var Ku={},ZD;function wJ(){if(ZD)return Ku;ZD=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.isFreightContainerID=void 0,Ku.isISO6346=i;var e=t(Be());function t(o){return o&&o.__esModule?o:{default:o}}var n=/^[A-Z]{3}(U[0-9]{7})|([J,Z][0-9]{6,7})$/,r=/^[0-9]$/;function i(o){if((0,e.default)(o),o=o.toUpperCase(),!n.test(o))return!1;if(o.length===11){for(var a=0,u=0;u<o.length-1;u++)if(r.test(o[u]))a+=o[u]*Math.pow(2,u);else{var c=void 0,d=o.charCodeAt(u)-55;d<11?c=d:d>=11&&d<=20?c=12+d%11:d>=21&&d<=30?c=23+d%21:c=34+d%31,a+=c*Math.pow(2,u)}var p=a%11;return p===10&&(p=0),Number(o[o.length-1])===p}return!0}return Ku.isFreightContainerID=i,Ku}var Pv={exports:{}},YD;function SJ(){return YD||(YD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=new Set(["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"]);function o(a){return(0,n.default)(a),i.has(a)}e.exports=t.default,e.exports.default=t.default}(Pv,Pv.exports)),Pv.exports}var Fv={exports:{}},WD;function CJ(){return WD||(WD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=r(Be());function r(c){return c&&c.__esModule?c:{default:c}}var i=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,o=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,a=function(d){var p=d.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(p){var h=Number(p[1]),m=Number(p[2]);return h%4===0&&h%100!==0||h%400===0?m<=366:m<=365}var v=d.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),_=v[1],S=v[2],x=v[3],b=S&&"0".concat(S).slice(-2),C=x&&"0".concat(x).slice(-2),k=new Date("".concat(_,"-").concat(b||"01","-").concat(C||"01"));return S&&x?k.getUTCFullYear()===_&&k.getUTCMonth()+1===S&&k.getUTCDate()===x:!0};function u(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(c);var p=d.strictSeparator?o.test(c):i.test(c);return p&&d.strict?a(c):p}e.exports=t.default,e.exports.default=t.default}(Fv,Fv.exports)),Fv.exports}var zv={exports:{}},KD;function EJ(){return KD||(KD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=b;var n=r(Be());function r(C){return C&&C.__esModule?C:{default:C}}var i=/[0-9]{4}/,o=/(0[1-9]|1[0-2])/,a=/([12]\d|0[1-9]|3[01])/,u=/([01][0-9]|2[0-3])/,c=/[0-5][0-9]/,d=/([0-5][0-9]|60)/,p=/(\.[0-9]+)?/,h=new RegExp("[-+]".concat(u.source,":").concat(c.source)),m=new RegExp("([zZ]|".concat(h.source,")")),v=new RegExp("".concat(u.source,":").concat(c.source,":").concat(d.source).concat(p.source)),_=new RegExp("".concat(i.source,"-").concat(o.source,"-").concat(a.source)),S=new RegExp("".concat(v.source).concat(m.source)),x=new RegExp("^".concat(_.source,"[ tT]").concat(S.source,"$"));function b(C){return(0,n.default)(C),x.test(C)}e.exports=t.default,e.exports.default=t.default}(zv,zv.exports)),zv.exports}var Qu={},QD;function kJ(){if(QD)return Qu;QD=1,Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.ScriptCodes=void 0,Qu.default=r;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n=new Set(["Adlm","Afak","Aghb","Ahom","Arab","Aran","Armi","Armn","Avst","Bali","Bamu","Bass","Batk","Beng","Bhks","Blis","Bopo","Brah","Brai","Bugi","Buhd","Cakm","Cans","Cari","Cham","Cher","Chis","Chrs","Cirt","Copt","Cpmn","Cprt","Cyrl","Cyrs","Deva","Diak","Dogr","Dsrt","Dupl","Egyd","Egyh","Egyp","Elba","Elym","Ethi","Gara","Geok","Geor","Glag","Gong","Gonm","Goth","Gran","Grek","Gujr","Gukh","Guru","Hanb","Hang","Hani","Hano","Hans","Hant","Hatr","Hebr","Hira","Hluw","Hmng","Hmnp","Hrkt","Hung","Inds","Ital","Jamo","Java","Jpan","Jurc","Kali","Kana","Kawi","Khar","Khmr","Khoj","Kitl","Kits","Knda","Kore","Kpel","Krai","Kthi","Lana","Laoo","Latf","Latg","Latn","Leke","Lepc","Limb","Lina","Linb","Lisu","Loma","Lyci","Lydi","Mahj","Maka","Mand","Mani","Marc","Maya","Medf","Mend","Merc","Mero","Mlym","Modi","Mong","Moon","Mroo","Mtei","Mult","Mymr","Nagm","Nand","Narb","Nbat","Newa","Nkdb","Nkgb","Nkoo","Nshu","Ogam","Olck","Onao","Orkh","Orya","Osge","Osma","Ougr","Palm","Pauc","Pcun","Pelm","Perm","Phag","Phli","Phlp","Phlv","Phnx","Plrd","Piqd","Prti","Psin","Qaaa","Qaab","Qaac","Qaad","Qaae","Qaaf","Qaag","Qaah","Qaai","Qaaj","Qaak","Qaal","Qaam","Qaan","Qaao","Qaap","Qaaq","Qaar","Qaas","Qaat","Qaau","Qaav","Qaaw","Qaax","Qaay","Qaaz","Qaba","Qabb","Qabc","Qabd","Qabe","Qabf","Qabg","Qabh","Qabi","Qabj","Qabk","Qabl","Qabm","Qabn","Qabo","Qabp","Qabq","Qabr","Qabs","Qabt","Qabu","Qabv","Qabw","Qabx","Ranj","Rjng","Rohg","Roro","Runr","Samr","Sara","Sarb","Saur","Sgnw","Shaw","Shrd","Shui","Sidd","Sidt","Sind","Sinh","Sogd","Sogo","Sora","Soyo","Sund","Sunu","Sylo","Syrc","Syre","Syrj","Syrn","Tagb","Takr","Tale","Talu","Taml","Tang","Tavt","Tayo","Telu","Teng","Tfng","Tglg","Thaa","Thai","Tibt","Tirh","Tnsa","Todr","Tols","Toto","Tutg","Ugar","Vaii","Visp","Vith","Wara","Wcho","Wole","Xpeo","Xsux","Yezi","Yiii","Zanb","Zinh","Zmth","Zsye","Zsym","Zxxx","Zyyy","Zzzz"]);function r(i){return(0,e.default)(i),n.has(i)}return Qu.ScriptCodes=n,Qu}var Uv={exports:{}},XD;function AJ(){return XD||(XD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=new Set(["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"]);function o(a){return(0,n.default)(a),i.has(a.toUpperCase())}e.exports=t.default,e.exports.default=t.default}(Uv,Uv.exports)),Uv.exports}var jv={exports:{}},JD;function IJ(){return JD||(JD=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=new Set(["004","008","010","012","016","020","024","028","031","032","036","040","044","048","050","051","052","056","060","064","068","070","072","074","076","084","086","090","092","096","100","104","108","112","116","120","124","132","136","140","144","148","152","156","158","162","166","170","174","175","178","180","184","188","191","192","196","203","204","208","212","214","218","222","226","231","232","233","234","238","239","242","246","248","250","254","258","260","262","266","268","270","275","276","288","292","296","300","304","308","312","316","320","324","328","332","334","336","340","344","348","352","356","360","364","368","372","376","380","384","388","392","398","400","404","408","410","414","417","418","422","426","428","430","434","438","440","442","446","450","454","458","462","466","470","474","478","480","484","492","496","498","499","500","504","508","512","516","520","524","528","531","533","534","535","540","548","554","558","562","566","570","574","578","580","581","583","584","585","586","591","598","600","604","608","612","616","620","624","626","630","634","638","642","643","646","652","654","659","660","662","663","666","670","674","678","682","686","688","690","694","702","703","704","705","706","710","716","724","728","729","732","740","744","748","752","756","760","762","764","768","772","776","780","784","788","792","795","796","798","800","804","807","818","826","831","832","833","834","840","850","854","858","860","862","876","882","887","894"]);function o(a){return(0,n.default)(a),i.has(a)}e.exports=t.default,e.exports.default=t.default}(jv,jv.exports)),jv.exports}var Xu={},e4;function TJ(){if(e4)return Xu;e4=1,Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.CurrencyCodes=void 0,Xu.default=r;var e=t(Be());function t(i){return i&&i.__esModule?i:{default:i}}var n=new Set(["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"]);function r(i){return(0,e.default)(i),n.has(i.toUpperCase())}return Xu.CurrencyCodes=n,Xu}var qv={exports:{}},t4;function MJ(){return t4||(t4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var n=i(Be()),r=i(hi());function i(d){return d&&d.__esModule?d:{default:d}}var o=/^[A-Z2-7]+=*$/,a=/^[A-HJKMNP-TV-Z0-9]+$/,u={crockford:!1};function c(d,p){if((0,n.default)(d),p=(0,r.default)(p,u),p.crockford)return a.test(d);var h=d.length;return!!(h%8===0&&o.test(d))}e.exports=t.default,e.exports.default=t.default}(qv,qv.exports)),qv.exports}var Hv={exports:{}},n4;function OJ(){return n4||(n4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^[A-HJ-NP-Za-km-z1-9]*$/;function o(a){return(0,n.default)(a),!!i.test(a)}e.exports=t.default,e.exports.default=t.default}(Hv,Hv.exports)),Hv.exports}var Gv={exports:{}},r4;function RJ(){return r4||(r4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=r(Be());function r(c){return c&&c.__esModule?c:{default:c}}var i=/^[a-z]+\/[a-z0-9\-\+\._]+$/i,o=/^[a-z\-]+=[a-z0-9\-]+$/i,a=/^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;function u(c){(0,n.default)(c);var d=c.split(",");if(d.length<2)return!1;var p=d.shift().trim().split(";"),h=p.shift();if(h.slice(0,5)!=="data:")return!1;var m=h.slice(5);if(m!==""&&!i.test(m))return!1;for(var v=0;v<p.length;v++)if(!(v===p.length-1&&p[v].toLowerCase()==="base64")&&!o.test(p[v]))return!1;for(var _=0;_<d.length;_++)if(!a.test(d[_]))return!1;return!0}e.exports=t.default,e.exports.default=t.default}(Gv,Gv.exports)),Gv.exports}var Vv={exports:{}},i4;function $J(){return i4||(i4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i;function o(a){return(0,n.default)(a),a.indexOf("magnet:?")!==0?!1:i.test(a)}e.exports=t.default,e.exports.default=t.default}(Vv,Vv.exports)),Vv.exports}var Zv={exports:{}},Yv={exports:{}},Wv={exports:{}},o4;function a4(){return o4||(o4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){if((0,n.default)(o),a){var u=new RegExp("[".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+$"),"g");return o.replace(u,"")}for(var c=o.length-1;/\s/.test(o.charAt(c));)c-=1;return o.slice(0,c+1)}e.exports=t.default,e.exports.default=t.default}(Wv,Wv.exports)),Wv.exports}var Kv={exports:{}},s4;function l4(){return s4||(s4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){(0,n.default)(o);var u=a?new RegExp("^[".concat(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+"),"g"):/^\s+/g;return o.replace(u,"")}e.exports=t.default,e.exports.default=t.default}(Kv,Kv.exports)),Kv.exports}var u4;function c4(){return u4||(u4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=i(a4()),r=i(l4());function i(a){return a&&a.__esModule?a:{default:a}}function o(a,u){return(0,n.default)((0,r.default)(a,u),u)}e.exports=t.default,e.exports.default=t.default}(Yv,Yv.exports)),Yv.exports}var f4;function DJ(){return f4||(f4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=_;var n=o(c4()),r=o(T2()),i=o(Be());function o(S){return S&&S.__esModule?S:{default:S}}function a(S,x){return d(S)||c(S,x)||h(S,x)||u()}function u(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
948
948
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(S,x){var b=S==null?null:typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(b!=null){var C,k,A,I,$=[],B=!0,U=!1;try{if(A=(b=b.call(S)).next,x!==0)for(;!(B=(C=A.call(b)).done)&&($.push(C.value),$.length!==x);B=!0);}catch(G){U=!0,k=G}finally{try{if(!B&&b.return!=null&&(I=b.return(),Object(I)!==I))return}finally{if(U)throw k}}return $}}function d(S){if(Array.isArray(S))return S}function p(S,x){var b=typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(!b){if(Array.isArray(S)||(b=h(S))||x){b&&(S=b);var C=0,k=function(){};return{s:k,n:function(){return C>=S.length?{done:!0}:{done:!1,value:S[C++]}},e:function(U){throw U},f:k}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
949
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var A,I=!0,$=!1;return{s:function(){b=b.call(S)},n:function(){var U=b.next();return I=U.done,U},e:function(U){$=!0,A=U},f:function(){try{I||b.return==null||b.return()}finally{if($)throw A}}}}function h(S,x){if(S){if(typeof S=="string")return m(S,x);var b={}.toString.call(S).slice(8,-1);return b==="Object"&&S.constructor&&(b=S.constructor.name),b==="Map"||b==="Set"?Array.from(S):b==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b)?m(S,x):void 0}}function m(S,x){(x==null||x>S.length)&&(x=S.length);for(var b=0,C=Array(x);b<x;b++)C[b]=S[b];return C}function v(S){var x=new Set(["subject","body","cc","bcc"]),b={cc:"",bcc:""},C=!1,k=S.split("&");if(k.length>4)return!1;var A=p(k),I;try{for(A.s();!(I=A.n()).done;){var $=I.value,B=$.split("="),U=a(B,2),G=U[0],P=U[1];if(G&&!x.has(G)){C=!0;break}P&&(G==="cc"||G==="bcc")&&(b[G]=P),G&&x.delete(G)}}catch(K){A.e(K)}finally{A.f()}return C?!1:b}function _(S,x){if((0,i.default)(S),S.indexOf("mailto:")!==0)return!1;var b=S.replace("mailto:","").split("?"),C=a(b,2),k=C[0],A=C[1],I=A===void 0?"":A;if(!k&&!I)return!0;var $=v(I);return $?"".concat(k,",").concat($.cc,",").concat($.bcc).split(",").every(function(B){return B=(0,n.default)(B," "),B?(0,r.default)(B,x):!0}):!1}e.exports=t.default,e.exports.default=t.default}(Zv,Zv.exports)),Zv.exports}var Qv={exports:{}},d4;function LJ(){return d4||(d4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=r(Be());function r(c){return c&&c.__esModule?c:{default:c}}var i=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i,o=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,a=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;function u(c){return(0,n.default)(c),i.test(c)||o.test(c)||a.test(c)}e.exports=t.default,e.exports.default=t.default}(Qv,Qv.exports)),Qv.exports}var Xv={exports:{}},h4;function NJ(){return h4||(h4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var n=i(Be()),r=i(hi());function i(h){return h&&h.__esModule?h:{default:h}}var o=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,a=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,u=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,c=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,d={checkDMS:!1};function p(h,m){if((0,n.default)(h),m=(0,r.default)(m,d),!h.includes(","))return!1;var v=h.split(",");return v[0].startsWith("(")&&!v[1].endsWith(")")||v[1].endsWith(")")&&!v[0].startsWith("(")?!1:m.checkDMS?u.test(v[0])&&c.test(v[1]):o.test(v[0])&&a.test(v[1])}e.exports=t.default,e.exports.default=t.default}(Xv,Xv.exports)),Xv.exports}var Ju={},p4;function BJ(){if(p4)return Ju;p4=1,Object.defineProperty(Ju,"__esModule",{value:!0}),Ju.default=u,Ju.locales=void 0;var e=t(Be());function t(c){return c&&c.__esModule?c:{default:c}}var n=/^\d{3}$/,r=/^\d{4}$/,i=/^\d{5}$/,o=/^\d{6}$/,a={AD:/^AD\d{3}$/,AT:r,AU:r,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BE:r,BG:r,BR:/^\d{5}-?\d{3}$/,BY:/^2[1-4]\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:r,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CO:/^(05|08|11|13|15|17|18|19|20|23|25|27|41|44|47|50|52|54|63|66|68|70|73|76|81|85|86|88|91|94|95|97|99)(\d{4})$/,CZ:/^\d{3}\s?\d{2}$/,DE:i,DK:r,DO:i,DZ:i,EE:i,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:i,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:r,ID:i,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/,IS:n,IT:i,JP:/^\d{3}\-\d{4}$/,KE:i,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:r,LV:/^LV\-\d{4}$/,LK:i,MG:n,MX:i,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:i,NL:/^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i,NO:r,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:r,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:o,RU:o,SA:i,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:o,SI:r,SK:/^\d{3}\s?\d{2}$/,TH:i,TN:r,TW:/^\d{3}(\d{2})?$/,UA:i,US:/^\d{5}(-\d{4})?$/,ZA:r,ZM:i};Ju.locales=Object.keys(a);function u(c,d){if((0,e.default)(c),d in a)return a[d].test(c);if(d==="any"){for(var p in a)if(a.hasOwnProperty(p)){var h=a[p];if(h.test(c))return!0}return!1}throw new Error("Invalid locale '".concat(d,"'"))}return Ju}var Jv={exports:{}},g4;function PJ(){return g4||(g4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o),o.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\//g,"&#x2F;").replace(/\\/g,"&#x5C;").replace(/`/g,"&#96;")}e.exports=t.default,e.exports.default=t.default}(Jv,Jv.exports)),Jv.exports}var e0={exports:{}},m4;function FJ(){return m4||(m4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o),o.replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#x2F;/g,"/").replace(/&#x5C;/g,"\\").replace(/&#96;/g,"`").replace(/&amp;/g,"&")}e.exports=t.default,e.exports.default=t.default}(e0,e0.exports)),e0.exports}var t0={exports:{}},n0={exports:{}},v4;function y4(){return v4||(v4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){return(0,n.default)(o),o.replace(new RegExp("[".concat(a,"]+"),"g"),"")}e.exports=t.default,e.exports.default=t.default}(n0,n0.exports)),n0.exports}var _4;function zJ(){return _4||(_4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=i(Be()),r=i(y4());function i(a){return a&&a.__esModule?a:{default:a}}function o(a,u){(0,n.default)(a);var c=u?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return(0,r.default)(a,c)}e.exports=t.default,e.exports.default=t.default}(t0,t0.exports)),t0.exports}var r0={exports:{}},b4;function UJ(){return b4||(b4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){return(0,n.default)(o),o.replace(new RegExp("[^".concat(a,"]+"),"g"),"")}e.exports=t.default,e.exports.default=t.default}(r0,r0.exports)),r0.exports}var i0={exports:{}},x4;function jJ(){return x4||(x4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){(0,n.default)(o);for(var u=o.length-1;u>=0;u--)if(a.indexOf(o[u])===-1)return!1;return!0}e.exports=t.default,e.exports.default=t.default}(i0,i0.exports)),i0.exports}var o0={exports:{}},w4;function qJ(){return w4||(w4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var n=r(hi());function r(h){return h&&h.__esModule?h:{default:h}}var i={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,yandex_lowercase:!0,yandex_convert_yandexru:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},o=["icloud.com","me.com"],a=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],u=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],c=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];function d(h){return h.length>1?h:""}function p(h,m){m=(0,n.default)(m,i);var v=h.split("@"),_=v.pop(),S=v.join("@"),x=[S,_];if(x[1]=x[1].toLowerCase(),x[1]==="gmail.com"||x[1]==="googlemail.com"){if(m.gmail_remove_subaddress&&(x[0]=x[0].split("+")[0]),m.gmail_remove_dots&&(x[0]=x[0].replace(/\.+/g,d)),!x[0].length)return!1;(m.all_lowercase||m.gmail_lowercase)&&(x[0]=x[0].toLowerCase()),x[1]=m.gmail_convert_googlemaildotcom?"gmail.com":x[1]}else if(o.indexOf(x[1])>=0){if(m.icloud_remove_subaddress&&(x[0]=x[0].split("+")[0]),!x[0].length)return!1;(m.all_lowercase||m.icloud_lowercase)&&(x[0]=x[0].toLowerCase())}else if(a.indexOf(x[1])>=0){if(m.outlookdotcom_remove_subaddress&&(x[0]=x[0].split("+")[0]),!x[0].length)return!1;(m.all_lowercase||m.outlookdotcom_lowercase)&&(x[0]=x[0].toLowerCase())}else if(u.indexOf(x[1])>=0){if(m.yahoo_remove_subaddress){var b=x[0].split("-");x[0]=b.length>1?b.slice(0,-1).join("-"):b[0]}if(!x[0].length)return!1;(m.all_lowercase||m.yahoo_lowercase)&&(x[0]=x[0].toLowerCase())}else c.indexOf(x[1])>=0?((m.all_lowercase||m.yandex_lowercase)&&(x[0]=x[0].toLowerCase()),x[1]=m.yandex_convert_yandexru?"yandex.ru":x[1]):m.all_lowercase&&(x[0]=x[0].toLowerCase());return x.join("@")}e.exports=t.default,e.exports.default=t.default}(o0,o0.exports)),o0.exports}var a0={exports:{}},S4;function HJ(){return S4||(S4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(a0,a0.exports)),a0.exports}var s0={exports:{}},C4;function GJ(){return C4||(C4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i={"cs-CZ":function(u){return/^(([ABCDEFHIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(u)},"de-DE":function(u){return/^((A|AA|AB|AC|AE|AH|AK|AM|AN|AÖ|AP|AS|AT|AU|AW|AZ|B|BA|BB|BC|BE|BF|BH|BI|BK|BL|BM|BN|BO|BÖ|BS|BT|BZ|C|CA|CB|CE|CO|CR|CW|D|DA|DD|DE|DH|DI|DL|DM|DN|DO|DU|DW|DZ|E|EA|EB|ED|EE|EF|EG|EH|EI|EL|EM|EN|ER|ES|EU|EW|F|FB|FD|FF|FG|FI|FL|FN|FO|FR|FS|FT|FÜ|FW|FZ|G|GA|GC|GD|GE|GF|GG|GI|GK|GL|GM|GN|GÖ|GP|GR|GS|GT|GÜ|GV|GW|GZ|H|HA|HB|HC|HD|HE|HF|HG|HH|HI|HK|HL|HM|HN|HO|HP|HR|HS|HU|HV|HX|HY|HZ|IK|IL|IN|IZ|J|JE|JL|K|KA|KB|KC|KE|KF|KG|KH|KI|KK|KL|KM|KN|KO|KR|KS|KT|KU|KW|KY|L|LA|LB|LC|LD|LF|LG|LH|LI|LL|LM|LN|LÖ|LP|LR|LU|M|MA|MB|MC|MD|ME|MG|MH|MI|MK|ML|MM|MN|MO|MQ|MR|MS|MÜ|MW|MY|MZ|N|NB|ND|NE|NF|NH|NI|NK|NM|NÖ|NP|NR|NT|NU|NW|NY|NZ|OA|OB|OC|OD|OE|OF|OG|OH|OK|OL|OP|OS|OZ|P|PA|PB|PE|PF|PI|PL|PM|PN|PR|PS|PW|PZ|R|RA|RC|RD|RE|RG|RH|RI|RL|RM|RN|RO|RP|RS|RT|RU|RV|RW|RZ|S|SB|SC|SE|SG|SI|SK|SL|SM|SN|SO|SP|SR|ST|SU|SW|SY|SZ|TE|TF|TG|TO|TP|TR|TS|TT|TÜ|ÜB|UE|UH|UL|UM|UN|V|VB|VG|VK|VR|VS|W|WA|WB|WE|WF|WI|WK|WL|WM|WN|WO|WR|WS|WT|WÜ|WW|WZ|Z|ZE|ZI|ZP|ZR|ZW|ZZ)[- ]?[A-Z]{1,2}[- ]?\d{1,4}|(ABG|ABI|AIB|AIC|ALF|ALZ|ANA|ANG|ANK|APD|ARN|ART|ASL|ASZ|AUR|AZE|BAD|BAR|BBG|BCH|BED|BER|BGD|BGL|BID|BIN|BIR|BIT|BIW|BKS|BLB|BLK|BNA|BOG|BOH|BOR|BOT|BRA|BRB|BRG|BRK|BRL|BRV|BSB|BSK|BTF|BÜD|BUL|BÜR|BÜS|BÜZ|CAS|CHA|CLP|CLZ|COC|COE|CUX|DAH|DAN|DAU|DBR|DEG|DEL|DGF|DIL|DIN|DIZ|DKB|DLG|DON|DUD|DÜW|EBE|EBN|EBS|ECK|EIC|EIL|EIN|EIS|EMD|EMS|ERB|ERH|ERK|ERZ|ESB|ESW|FDB|FDS|FEU|FFB|FKB|FLÖ|FOR|FRG|FRI|FRW|FTL|FÜS|GAN|GAP|GDB|GEL|GEO|GER|GHA|GHC|GLA|GMN|GNT|GOA|GOH|GRA|GRH|GRI|GRM|GRZ|GTH|GUB|GUN|GVM|HAB|HAL|HAM|HAS|HBN|HBS|HCH|HDH|HDL|HEB|HEF|HEI|HER|HET|HGN|HGW|HHM|HIG|HIP|HMÜ|HOG|HOH|HOL|HOM|HOR|HÖS|HOT|HRO|HSK|HST|HVL|HWI|IGB|ILL|JÜL|KEH|KEL|KEM|KIB|KLE|KLZ|KÖN|KÖT|KÖZ|KRU|KÜN|KUS|KYF|LAN|LAU|LBS|LBZ|LDK|LDS|LEO|LER|LEV|LIB|LIF|LIP|LÖB|LOS|LRO|LSZ|LÜN|LUP|LWL|MAB|MAI|MAK|MAL|MED|MEG|MEI|MEK|MEL|MER|MET|MGH|MGN|MHL|MIL|MKK|MOD|MOL|MON|MOS|MSE|MSH|MSP|MST|MTK|MTL|MÜB|MÜR|MYK|MZG|NAB|NAI|NAU|NDH|NEA|NEB|NEC|NEN|NES|NEW|NMB|NMS|NOH|NOL|NOM|NOR|NVP|NWM|OAL|OBB|OBG|OCH|OHA|ÖHR|OHV|OHZ|OPR|OSL|OVI|OVL|OVP|PAF|PAN|PAR|PCH|PEG|PIR|PLÖ|PRÜ|QFT|QLB|RDG|REG|REH|REI|RID|RIE|ROD|ROF|ROK|ROL|ROS|ROT|ROW|RSL|RÜD|RÜG|SAB|SAD|SAN|SAW|SBG|SBK|SCZ|SDH|SDL|SDT|SEB|SEE|SEF|SEL|SFB|SFT|SGH|SHA|SHG|SHK|SHL|SIG|SIM|SLE|SLF|SLK|SLN|SLS|SLÜ|SLZ|SMÜ|SOB|SOG|SOK|SÖM|SON|SPB|SPN|SRB|SRO|STA|STB|STD|STE|STL|SUL|SÜW|SWA|SZB|TBB|TDO|TET|TIR|TÖL|TUT|UEM|UER|UFF|USI|VAI|VEC|VER|VIB|VIE|VIT|VOH|WAF|WAK|WAN|WAR|WAT|WBS|WDA|WEL|WEN|WER|WES|WHV|WIL|WIS|WIT|WIZ|WLG|WMS|WND|WOB|WOH|WOL|WOR|WOS|WRN|WSF|WST|WSW|WTL|WTM|WUG|WÜM|WUN|WUR|WZL|ZEL|ZIG)[- ]?(([A-Z][- ]?\d{1,4})|([A-Z]{2}[- ]?\d{1,3})))[- ]?(E|H)?$/.test(u)},"de-LI":function(u){return/^FL[- ]?\d{1,5}[UZ]?$/.test(u)},"en-IN":function(u){return/^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(u)},"en-SG":function(u){return/^[A-Z]{3}[ -]?[\d]{4}[ -]?[A-Z]{1}$/.test(u)},"es-AR":function(u){return/^(([A-Z]{2} ?[0-9]{3} ?[A-Z]{2})|([A-Z]{3} ?[0-9]{3}))$/.test(u)},"fi-FI":function(u){return/^(?=.{4,7})(([A-Z]{1,3}|[0-9]{1,3})[\s-]?([A-Z]{1,3}|[0-9]{1,5}))$/.test(u)},"hu-HU":function(u){return/^((((?!AAA)(([A-NPRSTVZWXY]{1})([A-PR-Z]{1})([A-HJ-NPR-Z]))|(A[ABC]I)|A[ABC]O|A[A-W]Q|BPI|BPO|UCO|UDO|XAO)-(?!000)\d{3})|(M\d{6})|((CK|DT|CD|HC|H[ABEFIKLMNPRSTVX]|MA|OT|R[A-Z]) \d{2}-\d{2})|(CD \d{3}-\d{3})|(C-(C|X) \d{4})|(X-(A|B|C) \d{4})|(([EPVZ]-\d{5}))|(S A[A-Z]{2} \d{2})|(SP \d{2}-\d{2}))$/.test(u)},"pt-BR":function(u){return/^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(u)},"pt-PT":function(u){return/^([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})$/.test(u)},"sq-AL":function(u){return/^[A-Z]{2}[- ]?((\d{3}[- ]?(([A-Z]{2})|T))|(R[- ]?\d{3}))$/.test(u)},"sv-SE":function(u){return/^[A-HJ-PR-UW-Z]{3} ?[\d]{2}[A-HJ-PR-UW-Z1-9]$|(^[A-ZÅÄÖ ]{2,7}$)/.test(u.trim())},"en-PK":function(u){return/(^[A-Z]{2}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{3}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{4}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]((\s|-){0,1})[0-9]{4}((\s|-)[0-9]{2}){0,1}$)/.test(u.trim())}};function o(a,u){if((0,n.default)(a),u in i)return i[u](a);if(u==="any"){for(var c in i){var d=i[c];if(d(a))return!0}return!1}throw new Error("Invalid locale '".concat(u,"'"))}e.exports=t.default,e.exports.default=t.default}(s0,s0.exports)),s0.exports}var l0={exports:{}},E4;function VJ(){return E4||(E4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=v;var n=i(hi()),r=i(Be());function i(_){return _&&_.__esModule?_:{default:_}}var o=/^[A-Z]$/,a=/^[a-z]$/,u=/^[0-9]$/,c=/^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/,d={minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1,returnScore:!1,pointsPerUnique:1,pointsPerRepeat:.5,pointsForContainingLower:10,pointsForContainingUpper:10,pointsForContainingNumber:10,pointsForContainingSymbol:10};function p(_){var S={};return Array.from(_).forEach(function(x){var b=S[x];b?S[x]+=1:S[x]=1}),S}function h(_){var S=p(_),x={length:_.length,uniqueChars:Object.keys(S).length,uppercaseCount:0,lowercaseCount:0,numberCount:0,symbolCount:0};return Object.keys(S).forEach(function(b){o.test(b)?x.uppercaseCount+=S[b]:a.test(b)?x.lowercaseCount+=S[b]:u.test(b)?x.numberCount+=S[b]:c.test(b)&&(x.symbolCount+=S[b])}),x}function m(_,S){var x=0;return x+=_.uniqueChars*S.pointsPerUnique,x+=(_.length-_.uniqueChars)*S.pointsPerRepeat,_.lowercaseCount>0&&(x+=S.pointsForContainingLower),_.uppercaseCount>0&&(x+=S.pointsForContainingUpper),_.numberCount>0&&(x+=S.pointsForContainingNumber),_.symbolCount>0&&(x+=S.pointsForContainingSymbol),x}function v(_){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;(0,r.default)(_);var x=h(_);return S=(0,n.default)(S||{},d),S.returnScore?m(x,S):x.length>=S.minLength&&x.lowercaseCount>=S.minLowercase&&x.uppercaseCount>=S.minUppercase&&x.numberCount>=S.minNumbers&&x.symbolCount>=S.minSymbols}e.exports=t.default,e.exports.default=t.default}(l0,l0.exports)),l0.exports}var ec={},k4;function ZJ(){if(k4)return ec;k4=1;function e(h){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},e(h)}Object.defineProperty(ec,"__esModule",{value:!0}),ec.default=p,ec.vatMatchers=void 0;var t=o(Be()),n=i(UD());function r(h){if(typeof WeakMap!="function")return null;var m=new WeakMap,v=new WeakMap;return(r=function(S){return S?v:m})(h)}function i(h,m){if(h&&h.__esModule)return h;if(h===null||e(h)!="object"&&typeof h!="function")return{default:h};var v=r(m);if(v&&v.has(h))return v.get(h);var _={__proto__:null},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in h)if(x!=="default"&&{}.hasOwnProperty.call(h,x)){var b=S?Object.getOwnPropertyDescriptor(h,x):null;b&&(b.get||b.set)?Object.defineProperty(_,x,b):_[x]=h[x]}return _.default=h,v&&v.set(h,_),_}function o(h){return h&&h.__esModule?h:{default:h}}var a=function(m){var v=m.match(/^(AU)?(\d{11})$/);if(!v)return!1;var _=[10,1,3,5,7,9,11,13,15,17,19];m=m.replace(/^AU/,"");for(var S=(parseInt(m.slice(0,1),10)-1).toString()+m.slice(1),x=0,b=0;b<11;b++)x+=_[b]*S.charAt(b);return x!==0&&x%89===0},u=function(m){var v=function(S){var x=S.pop(),b=[5,4,3,2,7,6,5,4],C=(11-S.reduce(function(k,A,I){return k+A*b[I]},0)%11)%11;return x===C};return/^(CHE[- ]?)?(\d{9}|(\d{3}\.\d{3}\.\d{3})|(\d{3} \d{3} \d{3})) ?(TVA|MWST|IVA)?$/.test(m)&&v(m.match(/\d/g).map(function(_){return+_}))},c=function(m){var v=m.match(/^(PT)?(\d{9})$/);if(!v)return!1;var _=v[2],S=11-n.reverseMultiplyAndSum(_.split("").slice(0,8).map(function(x){return parseInt(x,10)}),9)%11;return S>9?parseInt(_[8],10)===0:S===parseInt(_[8],10)},d=ec.vatMatchers={AT:function(m){return/^(AT)?U\d{8}$/.test(m)},BE:function(m){return/^(BE)?\d{10}$/.test(m)},BG:function(m){return/^(BG)?\d{9,10}$/.test(m)},HR:function(m){return/^(HR)?\d{11}$/.test(m)},CY:function(m){return/^(CY)?\w{9}$/.test(m)},CZ:function(m){return/^(CZ)?\d{8,10}$/.test(m)},DK:function(m){return/^(DK)?\d{8}$/.test(m)},EE:function(m){return/^(EE)?\d{9}$/.test(m)},FI:function(m){return/^(FI)?\d{8}$/.test(m)},FR:function(m){return/^(FR)?\w{2}\d{9}$/.test(m)},DE:function(m){return/^(DE)?\d{9}$/.test(m)},EL:function(m){return/^(EL)?\d{9}$/.test(m)},HU:function(m){return/^(HU)?\d{8}$/.test(m)},IE:function(m){return/^(IE)?\d{7}\w{1}(W)?$/.test(m)},IT:function(m){return/^(IT)?\d{11}$/.test(m)},LV:function(m){return/^(LV)?\d{11}$/.test(m)},LT:function(m){return/^(LT)?\d{9,12}$/.test(m)},LU:function(m){return/^(LU)?\d{8}$/.test(m)},MT:function(m){return/^(MT)?\d{8}$/.test(m)},NL:function(m){return/^(NL)?\d{9}B\d{2}$/.test(m)},PL:function(m){return/^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(m)},PT:c,RO:function(m){return/^(RO)?\d{2,10}$/.test(m)},SK:function(m){return/^(SK)?\d{10}$/.test(m)},SI:function(m){return/^(SI)?\d{8}$/.test(m)},ES:function(m){return/^(ES)?\w\d{7}[A-Z]$/.test(m)},SE:function(m){return/^(SE)?\d{12}$/.test(m)},AL:function(m){return/^(AL)?\w{9}[A-Z]$/.test(m)},MK:function(m){return/^(MK)?\d{13}$/.test(m)},AU:a,BY:function(m){return/^(УНП )?\d{9}$/.test(m)},CA:function(m){return/^(CA)?\d{9}$/.test(m)},IS:function(m){return/^(IS)?\d{5,6}$/.test(m)},IN:function(m){return/^(IN)?\d{15}$/.test(m)},ID:function(m){return/^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(m)},IL:function(m){return/^(IL)?\d{9}$/.test(m)},KZ:function(m){return/^(KZ)?\d{12}$/.test(m)},NZ:function(m){return/^(NZ)?\d{9}$/.test(m)},NG:function(m){return/^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(m)},NO:function(m){return/^(NO)?\d{9}MVA$/.test(m)},PH:function(m){return/^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(m)},RU:function(m){return/^(RU)?(\d{10}|\d{12})$/.test(m)},SM:function(m){return/^(SM)?\d{5}$/.test(m)},SA:function(m){return/^(SA)?\d{15}$/.test(m)},RS:function(m){return/^(RS)?\d{9}$/.test(m)},CH:u,TR:function(m){return/^(TR)?\d{10}$/.test(m)},UA:function(m){return/^(UA)?\d{12}$/.test(m)},GB:function(m){return/^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(m)},UZ:function(m){return/^(UZ)?\d{9}$/.test(m)},AR:function(m){return/^(AR)?\d{11}$/.test(m)},BO:function(m){return/^(BO)?\d{7}$/.test(m)},BR:function(m){return/^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(m)},CL:function(m){return/^(CL)?\d{8}-\d{1}$/.test(m)},CO:function(m){return/^(CO)?\d{10}$/.test(m)},CR:function(m){return/^(CR)?\d{9,12}$/.test(m)},EC:function(m){return/^(EC)?\d{13}$/.test(m)},SV:function(m){return/^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(m)},GT:function(m){return/^(GT)?\d{7}-\d{1}$/.test(m)},HN:function(m){return/^(HN)?$/.test(m)},MX:function(m){return/^(MX)?\w{3,4}\d{6}\w{3}$/.test(m)},NI:function(m){return/^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(m)},PA:function(m){return/^(PA)?$/.test(m)},PY:function(m){return/^(PY)?\d{6,8}-\d{1}$/.test(m)},PE:function(m){return/^(PE)?\d{11}$/.test(m)},DO:function(m){return/^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(m)},UY:function(m){return/^(UY)?\d{12}$/.test(m)},VE:function(m){return/^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(m)}};function p(h,m){if((0,t.default)(h),(0,t.default)(m),m in d)return d[m](h);throw new Error("Invalid country code: '".concat(m,"'"))}return ec}var A4;function YJ(){return A4||(A4=1,function(e,t){function n(De){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ct){return typeof ct}:function(ct){return ct&&typeof Symbol=="function"&&ct.constructor===Symbol&&ct!==Symbol.prototype?"symbol":typeof ct},n(De)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=J(Ow()),i=J(h3()),o=J(vX()),a=J(yX()),u=J(_X()),c=J(bX()),d=J(xX()),p=J(T3()),h=J(wX()),m=J(SX()),v=J(Bm()),_=J(CX()),S=J(Rw()),x=J(D3()),b=J(EX()),C=J(kX()),k=J(AX()),A=J(IX()),I=pe(TX()),$=pe(MX()),B=J(OX()),U=pe(RX()),G=J($X()),P=J(DX()),K=J(LX()),re=J(NX()),ue=J(BX()),Z=J(K3()),ie=J(X3()),V=J(PX()),Q=J(FX()),ye=J(UX()),Te=J(jX()),T=J($w()),X=pe(f3()),ve=J(HX()),L=J(sD()),we=J(GX()),Ue=J(VX()),de=J(ZX()),tt=J(YX()),Ze=J(WX()),lt=J(KX()),gt=pe(QX()),je=J(XX()),Se=J(JX()),Ye=J(eJ()),Qe=J(tJ()),ot=J(nJ()),et=J(rJ()),He=J(iJ()),N=J(E3()),F=J(oJ()),Y=J(aJ()),ge=J(sJ()),_e=J(lJ()),Ie=J(uJ()),We=J(cJ()),nt=J($D()),ne=J(fJ()),me=J(dJ()),qe=J(hJ()),Xe=J(pJ()),at=J(gJ()),Tt=J(mJ()),Bt=J(vJ()),Et=pe(yJ()),Yt=J(_J()),ft=J(bJ()),wt=J(xJ()),Je=wJ(),yt=J(SJ()),Yn=J(CJ()),pr=J(EJ()),Wn=J(kJ()),Pn=J(mD()),Fr=J(AJ()),pi=J(IJ()),oi=J(TJ()),Ar=J(MJ()),zr=J(OJ()),no=J(xD()),ai=J(RJ()),gr=J($J()),Cn=J(DJ()),Jt=J(LJ()),Un=J(NJ()),Kn=pe(BJ()),en=J(l4()),tn=J(a4()),gi=J(c4()),Qn=J(PJ()),xr=J(FJ()),ae=J(zJ()),j=J(UJ()),xe=J(y4()),Ne=J(jJ()),he=J(qJ()),Ce=J(HJ()),ut=J(GJ()),bt=J(VJ()),ee=J(ZJ());function q(De){if(typeof WeakMap!="function")return null;var ct=new WeakMap,Pt=new WeakMap;return(q=function(jr){return jr?Pt:ct})(De)}function pe(De,ct){if(De&&De.__esModule)return De;if(De===null||n(De)!="object"&&typeof De!="function")return{default:De};var Pt=q(ct);if(Pt&&Pt.has(De))return Pt.get(De);var Ur={__proto__:null},jr=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ir in De)if(Ir!=="default"&&{}.hasOwnProperty.call(De,Ir)){var mi=jr?Object.getOwnPropertyDescriptor(De,Ir):null;mi&&(mi.get||mi.set)?Object.defineProperty(Ur,Ir,mi):Ur[Ir]=De[Ir]}return Ur.default=De,Pt&&Pt.set(De,Ur),Ur}function J(De){return De&&De.__esModule?De:{default:De}}var Re="13.15.0",Oe={version:Re,toDate:r.default,toFloat:i.default,toInt:o.default,toBoolean:a.default,equals:u.default,contains:c.default,matches:d.default,isEmail:p.default,isURL:h.default,isMACAddress:m.default,isIP:v.default,isIPRange:_.default,isFQDN:S.default,isBoolean:C.default,isIBAN:gt.default,isBIC:je.default,isAbaRouting:A.default,isAlpha:I.default,isAlphaLocales:I.locales,isAlphanumeric:$.default,isAlphanumericLocales:$.locales,isNumeric:B.default,isPassportNumber:U.default,passportNumberLocales:U.locales,isPort:G.default,isLowercase:P.default,isUppercase:K.default,isAscii:ue.default,isFullWidth:Z.default,isHalfWidth:ie.default,isVariableWidth:V.default,isMultibyte:Q.default,isSemVer:ye.default,isSurrogatePair:Te.default,isInt:T.default,isIMEI:re.default,isFloat:X.default,isFloatLocales:X.locales,isDecimal:ve.default,isHexadecimal:L.default,isOctal:we.default,isDivisibleBy:Ue.default,isHexColor:de.default,isRgbColor:tt.default,isHSL:Ze.default,isISRC:lt.default,isMD5:Se.default,isHash:Ye.default,isJWT:Qe.default,isJSON:ot.default,isEmpty:et.default,isLength:He.default,isLocale:k.default,isByteLength:N.default,isULID:F.default,isUUID:Y.default,isMongoId:ge.default,isAfter:_e.default,isBefore:Ie.default,isIn:We.default,isLuhnNumber:nt.default,isCreditCard:ne.default,isIdentityCard:me.default,isEAN:qe.default,isISIN:Xe.default,isISBN:at.default,isISSN:Tt.default,isMobilePhone:Et.default,isMobilePhoneLocales:Et.locales,isPostalCode:Kn.default,isPostalCodeLocales:Kn.locales,isEthereumAddress:Yt.default,isCurrency:ft.default,isBtcAddress:wt.default,isISO6346:Je.isISO6346,isFreightContainerID:Je.isFreightContainerID,isISO6391:yt.default,isISO8601:Yn.default,isISO15924:Wn.default,isRFC3339:pr.default,isISO31661Alpha2:Pn.default,isISO31661Alpha3:Fr.default,isISO31661Numeric:pi.default,isISO4217:oi.default,isBase32:Ar.default,isBase58:zr.default,isBase64:no.default,isDataURI:ai.default,isMagnetURI:gr.default,isMailtoURI:Cn.default,isMimeType:Jt.default,isLatLong:Un.default,ltrim:en.default,rtrim:tn.default,trim:gi.default,escape:Qn.default,unescape:xr.default,stripLow:ae.default,whitelist:j.default,blacklist:xe.default,isWhitelisted:Ne.default,normalizeEmail:he.default,toString,isSlug:Ce.default,isStrongPassword:bt.default,isTaxID:Bt.default,isDate:x.default,isTime:b.default,isLicensePlate:ut.default,isVAT:ee.default,ibanLocales:gt.locales};t.default=Oe,e.exports=t.default,e.exports.default=t.default}(bm,bm.exports)),bm.exports}var WJ=YJ();const KJ=z.div`
949
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var A,I=!0,$=!1;return{s:function(){b=b.call(S)},n:function(){var U=b.next();return I=U.done,U},e:function(U){$=!0,A=U},f:function(){try{I||b.return==null||b.return()}finally{if($)throw A}}}}function h(S,x){if(S){if(typeof S=="string")return m(S,x);var b={}.toString.call(S).slice(8,-1);return b==="Object"&&S.constructor&&(b=S.constructor.name),b==="Map"||b==="Set"?Array.from(S):b==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b)?m(S,x):void 0}}function m(S,x){(x==null||x>S.length)&&(x=S.length);for(var b=0,C=Array(x);b<x;b++)C[b]=S[b];return C}function v(S){var x=new Set(["subject","body","cc","bcc"]),b={cc:"",bcc:""},C=!1,k=S.split("&");if(k.length>4)return!1;var A=p(k),I;try{for(A.s();!(I=A.n()).done;){var $=I.value,B=$.split("="),U=a(B,2),G=U[0],P=U[1];if(G&&!x.has(G)){C=!0;break}P&&(G==="cc"||G==="bcc")&&(b[G]=P),G&&x.delete(G)}}catch(K){A.e(K)}finally{A.f()}return C?!1:b}function _(S,x){if((0,i.default)(S),S.indexOf("mailto:")!==0)return!1;var b=S.replace("mailto:","").split("?"),C=a(b,2),k=C[0],A=C[1],I=A===void 0?"":A;if(!k&&!I)return!0;var $=v(I);return $?"".concat(k,",").concat($.cc,",").concat($.bcc).split(",").every(function(B){return B=(0,n.default)(B," "),B?(0,r.default)(B,x):!0}):!1}e.exports=t.default,e.exports.default=t.default}(Zv,Zv.exports)),Zv.exports}var Qv={exports:{}},d4;function LJ(){return d4||(d4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var n=r(Be());function r(c){return c&&c.__esModule?c:{default:c}}var i=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i,o=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,a=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;function u(c){return(0,n.default)(c),i.test(c)||o.test(c)||a.test(c)}e.exports=t.default,e.exports.default=t.default}(Qv,Qv.exports)),Qv.exports}var Xv={exports:{}},h4;function NJ(){return h4||(h4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var n=i(Be()),r=i(hi());function i(h){return h&&h.__esModule?h:{default:h}}var o=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,a=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,u=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,c=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,d={checkDMS:!1};function p(h,m){if((0,n.default)(h),m=(0,r.default)(m,d),!h.includes(","))return!1;var v=h.split(",");return v[0].startsWith("(")&&!v[1].endsWith(")")||v[1].endsWith(")")&&!v[0].startsWith("(")?!1:m.checkDMS?u.test(v[0])&&c.test(v[1]):o.test(v[0])&&a.test(v[1])}e.exports=t.default,e.exports.default=t.default}(Xv,Xv.exports)),Xv.exports}var Ju={},p4;function BJ(){if(p4)return Ju;p4=1,Object.defineProperty(Ju,"__esModule",{value:!0}),Ju.default=u,Ju.locales=void 0;var e=t(Be());function t(c){return c&&c.__esModule?c:{default:c}}var n=/^\d{3}$/,r=/^\d{4}$/,i=/^\d{5}$/,o=/^\d{6}$/,a={AD:/^AD\d{3}$/,AT:r,AU:r,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BE:r,BG:r,BR:/^\d{5}-?\d{3}$/,BY:/^2[1-4]\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:r,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CO:/^(05|08|11|13|15|17|18|19|20|23|25|27|41|44|47|50|52|54|63|66|68|70|73|76|81|85|86|88|91|94|95|97|99)(\d{4})$/,CZ:/^\d{3}\s?\d{2}$/,DE:i,DK:r,DO:i,DZ:i,EE:i,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:i,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:r,ID:i,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/,IS:n,IT:i,JP:/^\d{3}\-\d{4}$/,KE:i,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:r,LV:/^LV\-\d{4}$/,LK:i,MG:n,MX:i,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:i,NL:/^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i,NO:r,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:r,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:o,RU:o,SA:i,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:o,SI:r,SK:/^\d{3}\s?\d{2}$/,TH:i,TN:r,TW:/^\d{3}(\d{2})?$/,UA:i,US:/^\d{5}(-\d{4})?$/,ZA:r,ZM:i};Ju.locales=Object.keys(a);function u(c,d){if((0,e.default)(c),d in a)return a[d].test(c);if(d==="any"){for(var p in a)if(a.hasOwnProperty(p)){var h=a[p];if(h.test(c))return!0}return!1}throw new Error("Invalid locale '".concat(d,"'"))}return Ju}var Jv={exports:{}},g4;function PJ(){return g4||(g4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o),o.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\//g,"&#x2F;").replace(/\\/g,"&#x5C;").replace(/`/g,"&#96;")}e.exports=t.default,e.exports.default=t.default}(Jv,Jv.exports)),Jv.exports}var e0={exports:{}},m4;function FJ(){return m4||(m4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o){return(0,n.default)(o),o.replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#x2F;/g,"/").replace(/&#x5C;/g,"\\").replace(/&#96;/g,"`").replace(/&amp;/g,"&")}e.exports=t.default,e.exports.default=t.default}(e0,e0.exports)),e0.exports}var t0={exports:{}},n0={exports:{}},v4;function y4(){return v4||(v4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){return(0,n.default)(o),o.replace(new RegExp("[".concat(a,"]+"),"g"),"")}e.exports=t.default,e.exports.default=t.default}(n0,n0.exports)),n0.exports}var _4;function zJ(){return _4||(_4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=i(Be()),r=i(y4());function i(a){return a&&a.__esModule?a:{default:a}}function o(a,u){(0,n.default)(a);var c=u?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return(0,r.default)(a,c)}e.exports=t.default,e.exports.default=t.default}(t0,t0.exports)),t0.exports}var r0={exports:{}},b4;function UJ(){return b4||(b4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){return(0,n.default)(o),o.replace(new RegExp("[^".concat(a,"]+"),"g"),"")}e.exports=t.default,e.exports.default=t.default}(r0,r0.exports)),r0.exports}var i0={exports:{}},x4;function jJ(){return x4||(x4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=r(Be());function r(o){return o&&o.__esModule?o:{default:o}}function i(o,a){(0,n.default)(o);for(var u=o.length-1;u>=0;u--)if(a.indexOf(o[u])===-1)return!1;return!0}e.exports=t.default,e.exports.default=t.default}(i0,i0.exports)),i0.exports}var o0={exports:{}},w4;function qJ(){return w4||(w4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var n=r(hi());function r(h){return h&&h.__esModule?h:{default:h}}var i={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,yandex_lowercase:!0,yandex_convert_yandexru:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},o=["icloud.com","me.com"],a=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],u=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],c=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];function d(h){return h.length>1?h:""}function p(h,m){m=(0,n.default)(m,i);var v=h.split("@"),_=v.pop(),S=v.join("@"),x=[S,_];if(x[1]=x[1].toLowerCase(),x[1]==="gmail.com"||x[1]==="googlemail.com"){if(m.gmail_remove_subaddress&&(x[0]=x[0].split("+")[0]),m.gmail_remove_dots&&(x[0]=x[0].replace(/\.+/g,d)),!x[0].length)return!1;(m.all_lowercase||m.gmail_lowercase)&&(x[0]=x[0].toLowerCase()),x[1]=m.gmail_convert_googlemaildotcom?"gmail.com":x[1]}else if(o.indexOf(x[1])>=0){if(m.icloud_remove_subaddress&&(x[0]=x[0].split("+")[0]),!x[0].length)return!1;(m.all_lowercase||m.icloud_lowercase)&&(x[0]=x[0].toLowerCase())}else if(a.indexOf(x[1])>=0){if(m.outlookdotcom_remove_subaddress&&(x[0]=x[0].split("+")[0]),!x[0].length)return!1;(m.all_lowercase||m.outlookdotcom_lowercase)&&(x[0]=x[0].toLowerCase())}else if(u.indexOf(x[1])>=0){if(m.yahoo_remove_subaddress){var b=x[0].split("-");x[0]=b.length>1?b.slice(0,-1).join("-"):b[0]}if(!x[0].length)return!1;(m.all_lowercase||m.yahoo_lowercase)&&(x[0]=x[0].toLowerCase())}else c.indexOf(x[1])>=0?((m.all_lowercase||m.yandex_lowercase)&&(x[0]=x[0].toLowerCase()),x[1]=m.yandex_convert_yandexru?"yandex.ru":x[1]):m.all_lowercase&&(x[0]=x[0].toLowerCase());return x.join("@")}e.exports=t.default,e.exports.default=t.default}(o0,o0.exports)),o0.exports}var a0={exports:{}},S4;function HJ(){return S4||(S4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i=/^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;function o(a){return(0,n.default)(a),i.test(a)}e.exports=t.default,e.exports.default=t.default}(a0,a0.exports)),a0.exports}var s0={exports:{}},C4;function GJ(){return C4||(C4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=r(Be());function r(a){return a&&a.__esModule?a:{default:a}}var i={"cs-CZ":function(u){return/^(([ABCDEFHIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(u)},"de-DE":function(u){return/^((A|AA|AB|AC|AE|AH|AK|AM|AN|AÖ|AP|AS|AT|AU|AW|AZ|B|BA|BB|BC|BE|BF|BH|BI|BK|BL|BM|BN|BO|BÖ|BS|BT|BZ|C|CA|CB|CE|CO|CR|CW|D|DA|DD|DE|DH|DI|DL|DM|DN|DO|DU|DW|DZ|E|EA|EB|ED|EE|EF|EG|EH|EI|EL|EM|EN|ER|ES|EU|EW|F|FB|FD|FF|FG|FI|FL|FN|FO|FR|FS|FT|FÜ|FW|FZ|G|GA|GC|GD|GE|GF|GG|GI|GK|GL|GM|GN|GÖ|GP|GR|GS|GT|GÜ|GV|GW|GZ|H|HA|HB|HC|HD|HE|HF|HG|HH|HI|HK|HL|HM|HN|HO|HP|HR|HS|HU|HV|HX|HY|HZ|IK|IL|IN|IZ|J|JE|JL|K|KA|KB|KC|KE|KF|KG|KH|KI|KK|KL|KM|KN|KO|KR|KS|KT|KU|KW|KY|L|LA|LB|LC|LD|LF|LG|LH|LI|LL|LM|LN|LÖ|LP|LR|LU|M|MA|MB|MC|MD|ME|MG|MH|MI|MK|ML|MM|MN|MO|MQ|MR|MS|MÜ|MW|MY|MZ|N|NB|ND|NE|NF|NH|NI|NK|NM|NÖ|NP|NR|NT|NU|NW|NY|NZ|OA|OB|OC|OD|OE|OF|OG|OH|OK|OL|OP|OS|OZ|P|PA|PB|PE|PF|PI|PL|PM|PN|PR|PS|PW|PZ|R|RA|RC|RD|RE|RG|RH|RI|RL|RM|RN|RO|RP|RS|RT|RU|RV|RW|RZ|S|SB|SC|SE|SG|SI|SK|SL|SM|SN|SO|SP|SR|ST|SU|SW|SY|SZ|TE|TF|TG|TO|TP|TR|TS|TT|TÜ|ÜB|UE|UH|UL|UM|UN|V|VB|VG|VK|VR|VS|W|WA|WB|WE|WF|WI|WK|WL|WM|WN|WO|WR|WS|WT|WÜ|WW|WZ|Z|ZE|ZI|ZP|ZR|ZW|ZZ)[- ]?[A-Z]{1,2}[- ]?\d{1,4}|(ABG|ABI|AIB|AIC|ALF|ALZ|ANA|ANG|ANK|APD|ARN|ART|ASL|ASZ|AUR|AZE|BAD|BAR|BBG|BCH|BED|BER|BGD|BGL|BID|BIN|BIR|BIT|BIW|BKS|BLB|BLK|BNA|BOG|BOH|BOR|BOT|BRA|BRB|BRG|BRK|BRL|BRV|BSB|BSK|BTF|BÜD|BUL|BÜR|BÜS|BÜZ|CAS|CHA|CLP|CLZ|COC|COE|CUX|DAH|DAN|DAU|DBR|DEG|DEL|DGF|DIL|DIN|DIZ|DKB|DLG|DON|DUD|DÜW|EBE|EBN|EBS|ECK|EIC|EIL|EIN|EIS|EMD|EMS|ERB|ERH|ERK|ERZ|ESB|ESW|FDB|FDS|FEU|FFB|FKB|FLÖ|FOR|FRG|FRI|FRW|FTL|FÜS|GAN|GAP|GDB|GEL|GEO|GER|GHA|GHC|GLA|GMN|GNT|GOA|GOH|GRA|GRH|GRI|GRM|GRZ|GTH|GUB|GUN|GVM|HAB|HAL|HAM|HAS|HBN|HBS|HCH|HDH|HDL|HEB|HEF|HEI|HER|HET|HGN|HGW|HHM|HIG|HIP|HMÜ|HOG|HOH|HOL|HOM|HOR|HÖS|HOT|HRO|HSK|HST|HVL|HWI|IGB|ILL|JÜL|KEH|KEL|KEM|KIB|KLE|KLZ|KÖN|KÖT|KÖZ|KRU|KÜN|KUS|KYF|LAN|LAU|LBS|LBZ|LDK|LDS|LEO|LER|LEV|LIB|LIF|LIP|LÖB|LOS|LRO|LSZ|LÜN|LUP|LWL|MAB|MAI|MAK|MAL|MED|MEG|MEI|MEK|MEL|MER|MET|MGH|MGN|MHL|MIL|MKK|MOD|MOL|MON|MOS|MSE|MSH|MSP|MST|MTK|MTL|MÜB|MÜR|MYK|MZG|NAB|NAI|NAU|NDH|NEA|NEB|NEC|NEN|NES|NEW|NMB|NMS|NOH|NOL|NOM|NOR|NVP|NWM|OAL|OBB|OBG|OCH|OHA|ÖHR|OHV|OHZ|OPR|OSL|OVI|OVL|OVP|PAF|PAN|PAR|PCH|PEG|PIR|PLÖ|PRÜ|QFT|QLB|RDG|REG|REH|REI|RID|RIE|ROD|ROF|ROK|ROL|ROS|ROT|ROW|RSL|RÜD|RÜG|SAB|SAD|SAN|SAW|SBG|SBK|SCZ|SDH|SDL|SDT|SEB|SEE|SEF|SEL|SFB|SFT|SGH|SHA|SHG|SHK|SHL|SIG|SIM|SLE|SLF|SLK|SLN|SLS|SLÜ|SLZ|SMÜ|SOB|SOG|SOK|SÖM|SON|SPB|SPN|SRB|SRO|STA|STB|STD|STE|STL|SUL|SÜW|SWA|SZB|TBB|TDO|TET|TIR|TÖL|TUT|UEM|UER|UFF|USI|VAI|VEC|VER|VIB|VIE|VIT|VOH|WAF|WAK|WAN|WAR|WAT|WBS|WDA|WEL|WEN|WER|WES|WHV|WIL|WIS|WIT|WIZ|WLG|WMS|WND|WOB|WOH|WOL|WOR|WOS|WRN|WSF|WST|WSW|WTL|WTM|WUG|WÜM|WUN|WUR|WZL|ZEL|ZIG)[- ]?(([A-Z][- ]?\d{1,4})|([A-Z]{2}[- ]?\d{1,3})))[- ]?(E|H)?$/.test(u)},"de-LI":function(u){return/^FL[- ]?\d{1,5}[UZ]?$/.test(u)},"en-IN":function(u){return/^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(u)},"en-SG":function(u){return/^[A-Z]{3}[ -]?[\d]{4}[ -]?[A-Z]{1}$/.test(u)},"es-AR":function(u){return/^(([A-Z]{2} ?[0-9]{3} ?[A-Z]{2})|([A-Z]{3} ?[0-9]{3}))$/.test(u)},"fi-FI":function(u){return/^(?=.{4,7})(([A-Z]{1,3}|[0-9]{1,3})[\s-]?([A-Z]{1,3}|[0-9]{1,5}))$/.test(u)},"hu-HU":function(u){return/^((((?!AAA)(([A-NPRSTVZWXY]{1})([A-PR-Z]{1})([A-HJ-NPR-Z]))|(A[ABC]I)|A[ABC]O|A[A-W]Q|BPI|BPO|UCO|UDO|XAO)-(?!000)\d{3})|(M\d{6})|((CK|DT|CD|HC|H[ABEFIKLMNPRSTVX]|MA|OT|R[A-Z]) \d{2}-\d{2})|(CD \d{3}-\d{3})|(C-(C|X) \d{4})|(X-(A|B|C) \d{4})|(([EPVZ]-\d{5}))|(S A[A-Z]{2} \d{2})|(SP \d{2}-\d{2}))$/.test(u)},"pt-BR":function(u){return/^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(u)},"pt-PT":function(u){return/^([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})$/.test(u)},"sq-AL":function(u){return/^[A-Z]{2}[- ]?((\d{3}[- ]?(([A-Z]{2})|T))|(R[- ]?\d{3}))$/.test(u)},"sv-SE":function(u){return/^[A-HJ-PR-UW-Z]{3} ?[\d]{2}[A-HJ-PR-UW-Z1-9]$|(^[A-ZÅÄÖ ]{2,7}$)/.test(u.trim())},"en-PK":function(u){return/(^[A-Z]{2}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{3}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]{4}((\s|-){0,1})[0-9]{3,4}((\s|-)[0-9]{2}){0,1}$)|(^[A-Z]((\s|-){0,1})[0-9]{4}((\s|-)[0-9]{2}){0,1}$)/.test(u.trim())}};function o(a,u){if((0,n.default)(a),u in i)return i[u](a);if(u==="any"){for(var c in i){var d=i[c];if(d(a))return!0}return!1}throw new Error("Invalid locale '".concat(u,"'"))}e.exports=t.default,e.exports.default=t.default}(s0,s0.exports)),s0.exports}var l0={exports:{}},E4;function VJ(){return E4||(E4=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=v;var n=i(hi()),r=i(Be());function i(_){return _&&_.__esModule?_:{default:_}}var o=/^[A-Z]$/,a=/^[a-z]$/,u=/^[0-9]$/,c=/^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/\\ ]$/,d={minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1,returnScore:!1,pointsPerUnique:1,pointsPerRepeat:.5,pointsForContainingLower:10,pointsForContainingUpper:10,pointsForContainingNumber:10,pointsForContainingSymbol:10};function p(_){var S={};return Array.from(_).forEach(function(x){var b=S[x];b?S[x]+=1:S[x]=1}),S}function h(_){var S=p(_),x={length:_.length,uniqueChars:Object.keys(S).length,uppercaseCount:0,lowercaseCount:0,numberCount:0,symbolCount:0};return Object.keys(S).forEach(function(b){o.test(b)?x.uppercaseCount+=S[b]:a.test(b)?x.lowercaseCount+=S[b]:u.test(b)?x.numberCount+=S[b]:c.test(b)&&(x.symbolCount+=S[b])}),x}function m(_,S){var x=0;return x+=_.uniqueChars*S.pointsPerUnique,x+=(_.length-_.uniqueChars)*S.pointsPerRepeat,_.lowercaseCount>0&&(x+=S.pointsForContainingLower),_.uppercaseCount>0&&(x+=S.pointsForContainingUpper),_.numberCount>0&&(x+=S.pointsForContainingNumber),_.symbolCount>0&&(x+=S.pointsForContainingSymbol),x}function v(_){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;(0,r.default)(_);var x=h(_);return S=(0,n.default)(S||{},d),S.returnScore?m(x,S):x.length>=S.minLength&&x.lowercaseCount>=S.minLowercase&&x.uppercaseCount>=S.minUppercase&&x.numberCount>=S.minNumbers&&x.symbolCount>=S.minSymbols}e.exports=t.default,e.exports.default=t.default}(l0,l0.exports)),l0.exports}var ec={},k4;function ZJ(){if(k4)return ec;k4=1;function e(h){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},e(h)}Object.defineProperty(ec,"__esModule",{value:!0}),ec.default=p,ec.vatMatchers=void 0;var t=o(Be()),n=i(UD());function r(h){if(typeof WeakMap!="function")return null;var m=new WeakMap,v=new WeakMap;return(r=function(S){return S?v:m})(h)}function i(h,m){if(h&&h.__esModule)return h;if(h===null||e(h)!="object"&&typeof h!="function")return{default:h};var v=r(m);if(v&&v.has(h))return v.get(h);var _={__proto__:null},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in h)if(x!=="default"&&{}.hasOwnProperty.call(h,x)){var b=S?Object.getOwnPropertyDescriptor(h,x):null;b&&(b.get||b.set)?Object.defineProperty(_,x,b):_[x]=h[x]}return _.default=h,v&&v.set(h,_),_}function o(h){return h&&h.__esModule?h:{default:h}}var a=function(m){var v=m.match(/^(AU)?(\d{11})$/);if(!v)return!1;var _=[10,1,3,5,7,9,11,13,15,17,19];m=m.replace(/^AU/,"");for(var S=(parseInt(m.slice(0,1),10)-1).toString()+m.slice(1),x=0,b=0;b<11;b++)x+=_[b]*S.charAt(b);return x!==0&&x%89===0},u=function(m){var v=function(S){var x=S.pop(),b=[5,4,3,2,7,6,5,4],C=(11-S.reduce(function(k,A,I){return k+A*b[I]},0)%11)%11;return x===C};return/^(CHE[- ]?)?(\d{9}|(\d{3}\.\d{3}\.\d{3})|(\d{3} \d{3} \d{3})) ?(TVA|MWST|IVA)?$/.test(m)&&v(m.match(/\d/g).map(function(_){return+_}))},c=function(m){var v=m.match(/^(PT)?(\d{9})$/);if(!v)return!1;var _=v[2],S=11-n.reverseMultiplyAndSum(_.split("").slice(0,8).map(function(x){return parseInt(x,10)}),9)%11;return S>9?parseInt(_[8],10)===0:S===parseInt(_[8],10)},d=ec.vatMatchers={AT:function(m){return/^(AT)?U\d{8}$/.test(m)},BE:function(m){return/^(BE)?\d{10}$/.test(m)},BG:function(m){return/^(BG)?\d{9,10}$/.test(m)},HR:function(m){return/^(HR)?\d{11}$/.test(m)},CY:function(m){return/^(CY)?\w{9}$/.test(m)},CZ:function(m){return/^(CZ)?\d{8,10}$/.test(m)},DK:function(m){return/^(DK)?\d{8}$/.test(m)},EE:function(m){return/^(EE)?\d{9}$/.test(m)},FI:function(m){return/^(FI)?\d{8}$/.test(m)},FR:function(m){return/^(FR)?\w{2}\d{9}$/.test(m)},DE:function(m){return/^(DE)?\d{9}$/.test(m)},EL:function(m){return/^(EL)?\d{9}$/.test(m)},HU:function(m){return/^(HU)?\d{8}$/.test(m)},IE:function(m){return/^(IE)?\d{7}\w{1}(W)?$/.test(m)},IT:function(m){return/^(IT)?\d{11}$/.test(m)},LV:function(m){return/^(LV)?\d{11}$/.test(m)},LT:function(m){return/^(LT)?\d{9,12}$/.test(m)},LU:function(m){return/^(LU)?\d{8}$/.test(m)},MT:function(m){return/^(MT)?\d{8}$/.test(m)},NL:function(m){return/^(NL)?\d{9}B\d{2}$/.test(m)},PL:function(m){return/^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(m)},PT:c,RO:function(m){return/^(RO)?\d{2,10}$/.test(m)},SK:function(m){return/^(SK)?\d{10}$/.test(m)},SI:function(m){return/^(SI)?\d{8}$/.test(m)},ES:function(m){return/^(ES)?\w\d{7}[A-Z]$/.test(m)},SE:function(m){return/^(SE)?\d{12}$/.test(m)},AL:function(m){return/^(AL)?\w{9}[A-Z]$/.test(m)},MK:function(m){return/^(MK)?\d{13}$/.test(m)},AU:a,BY:function(m){return/^(УНП )?\d{9}$/.test(m)},CA:function(m){return/^(CA)?\d{9}$/.test(m)},IS:function(m){return/^(IS)?\d{5,6}$/.test(m)},IN:function(m){return/^(IN)?\d{15}$/.test(m)},ID:function(m){return/^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(m)},IL:function(m){return/^(IL)?\d{9}$/.test(m)},KZ:function(m){return/^(KZ)?\d{12}$/.test(m)},NZ:function(m){return/^(NZ)?\d{9}$/.test(m)},NG:function(m){return/^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(m)},NO:function(m){return/^(NO)?\d{9}MVA$/.test(m)},PH:function(m){return/^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(m)},RU:function(m){return/^(RU)?(\d{10}|\d{12})$/.test(m)},SM:function(m){return/^(SM)?\d{5}$/.test(m)},SA:function(m){return/^(SA)?\d{15}$/.test(m)},RS:function(m){return/^(RS)?\d{9}$/.test(m)},CH:u,TR:function(m){return/^(TR)?\d{10}$/.test(m)},UA:function(m){return/^(UA)?\d{12}$/.test(m)},GB:function(m){return/^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(m)},UZ:function(m){return/^(UZ)?\d{9}$/.test(m)},AR:function(m){return/^(AR)?\d{11}$/.test(m)},BO:function(m){return/^(BO)?\d{7}$/.test(m)},BR:function(m){return/^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(m)},CL:function(m){return/^(CL)?\d{8}-\d{1}$/.test(m)},CO:function(m){return/^(CO)?\d{10}$/.test(m)},CR:function(m){return/^(CR)?\d{9,12}$/.test(m)},EC:function(m){return/^(EC)?\d{13}$/.test(m)},SV:function(m){return/^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(m)},GT:function(m){return/^(GT)?\d{7}-\d{1}$/.test(m)},HN:function(m){return/^(HN)?$/.test(m)},MX:function(m){return/^(MX)?\w{3,4}\d{6}\w{3}$/.test(m)},NI:function(m){return/^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(m)},PA:function(m){return/^(PA)?$/.test(m)},PY:function(m){return/^(PY)?\d{6,8}-\d{1}$/.test(m)},PE:function(m){return/^(PE)?\d{11}$/.test(m)},DO:function(m){return/^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(m)},UY:function(m){return/^(UY)?\d{12}$/.test(m)},VE:function(m){return/^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(m)}};function p(h,m){if((0,t.default)(h),(0,t.default)(m),m in d)return d[m](h);throw new Error("Invalid country code: '".concat(m,"'"))}return ec}var A4;function YJ(){return A4||(A4=1,function(e,t){function n(De){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ct){return typeof ct}:function(ct){return ct&&typeof Symbol=="function"&&ct.constructor===Symbol&&ct!==Symbol.prototype?"symbol":typeof ct},n(De)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=J(Ow()),i=J(h2()),o=J(vX()),a=J(yX()),u=J(_X()),c=J(bX()),d=J(xX()),p=J(T2()),h=J(wX()),m=J(SX()),v=J(Bm()),_=J(CX()),S=J(Rw()),x=J(D2()),b=J(EX()),C=J(kX()),k=J(AX()),A=J(IX()),I=pe(TX()),$=pe(MX()),B=J(OX()),U=pe(RX()),G=J($X()),P=J(DX()),K=J(LX()),re=J(NX()),ue=J(BX()),Z=J(K2()),ie=J(X2()),V=J(PX()),Q=J(FX()),ye=J(UX()),Te=J(jX()),T=J($w()),X=pe(f2()),ve=J(HX()),L=J(sD()),we=J(GX()),Ue=J(VX()),de=J(ZX()),tt=J(YX()),Ze=J(WX()),lt=J(KX()),gt=pe(QX()),je=J(XX()),Se=J(JX()),Ye=J(eJ()),Qe=J(tJ()),ot=J(nJ()),et=J(rJ()),He=J(iJ()),N=J(E2()),F=J(oJ()),Y=J(aJ()),ge=J(sJ()),_e=J(lJ()),Ie=J(uJ()),We=J(cJ()),nt=J($D()),ne=J(fJ()),me=J(dJ()),qe=J(hJ()),Xe=J(pJ()),at=J(gJ()),Tt=J(mJ()),Bt=J(vJ()),Et=pe(yJ()),Yt=J(_J()),ft=J(bJ()),wt=J(xJ()),Je=wJ(),yt=J(SJ()),Yn=J(CJ()),pr=J(EJ()),Wn=J(kJ()),Pn=J(mD()),Fr=J(AJ()),pi=J(IJ()),oi=J(TJ()),Ar=J(MJ()),zr=J(OJ()),no=J(xD()),ai=J(RJ()),gr=J($J()),Cn=J(DJ()),Jt=J(LJ()),Un=J(NJ()),Kn=pe(BJ()),en=J(l4()),tn=J(a4()),gi=J(c4()),Qn=J(PJ()),xr=J(FJ()),ae=J(zJ()),j=J(UJ()),xe=J(y4()),Ne=J(jJ()),he=J(qJ()),Ce=J(HJ()),ut=J(GJ()),bt=J(VJ()),ee=J(ZJ());function q(De){if(typeof WeakMap!="function")return null;var ct=new WeakMap,Pt=new WeakMap;return(q=function(jr){return jr?Pt:ct})(De)}function pe(De,ct){if(De&&De.__esModule)return De;if(De===null||n(De)!="object"&&typeof De!="function")return{default:De};var Pt=q(ct);if(Pt&&Pt.has(De))return Pt.get(De);var Ur={__proto__:null},jr=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ir in De)if(Ir!=="default"&&{}.hasOwnProperty.call(De,Ir)){var mi=jr?Object.getOwnPropertyDescriptor(De,Ir):null;mi&&(mi.get||mi.set)?Object.defineProperty(Ur,Ir,mi):Ur[Ir]=De[Ir]}return Ur.default=De,Pt&&Pt.set(De,Ur),Ur}function J(De){return De&&De.__esModule?De:{default:De}}var Re="13.15.0",Oe={version:Re,toDate:r.default,toFloat:i.default,toInt:o.default,toBoolean:a.default,equals:u.default,contains:c.default,matches:d.default,isEmail:p.default,isURL:h.default,isMACAddress:m.default,isIP:v.default,isIPRange:_.default,isFQDN:S.default,isBoolean:C.default,isIBAN:gt.default,isBIC:je.default,isAbaRouting:A.default,isAlpha:I.default,isAlphaLocales:I.locales,isAlphanumeric:$.default,isAlphanumericLocales:$.locales,isNumeric:B.default,isPassportNumber:U.default,passportNumberLocales:U.locales,isPort:G.default,isLowercase:P.default,isUppercase:K.default,isAscii:ue.default,isFullWidth:Z.default,isHalfWidth:ie.default,isVariableWidth:V.default,isMultibyte:Q.default,isSemVer:ye.default,isSurrogatePair:Te.default,isInt:T.default,isIMEI:re.default,isFloat:X.default,isFloatLocales:X.locales,isDecimal:ve.default,isHexadecimal:L.default,isOctal:we.default,isDivisibleBy:Ue.default,isHexColor:de.default,isRgbColor:tt.default,isHSL:Ze.default,isISRC:lt.default,isMD5:Se.default,isHash:Ye.default,isJWT:Qe.default,isJSON:ot.default,isEmpty:et.default,isLength:He.default,isLocale:k.default,isByteLength:N.default,isULID:F.default,isUUID:Y.default,isMongoId:ge.default,isAfter:_e.default,isBefore:Ie.default,isIn:We.default,isLuhnNumber:nt.default,isCreditCard:ne.default,isIdentityCard:me.default,isEAN:qe.default,isISIN:Xe.default,isISBN:at.default,isISSN:Tt.default,isMobilePhone:Et.default,isMobilePhoneLocales:Et.locales,isPostalCode:Kn.default,isPostalCodeLocales:Kn.locales,isEthereumAddress:Yt.default,isCurrency:ft.default,isBtcAddress:wt.default,isISO6346:Je.isISO6346,isFreightContainerID:Je.isFreightContainerID,isISO6391:yt.default,isISO8601:Yn.default,isISO15924:Wn.default,isRFC3339:pr.default,isISO31661Alpha2:Pn.default,isISO31661Alpha3:Fr.default,isISO31661Numeric:pi.default,isISO4217:oi.default,isBase32:Ar.default,isBase58:zr.default,isBase64:no.default,isDataURI:ai.default,isMagnetURI:gr.default,isMailtoURI:Cn.default,isMimeType:Jt.default,isLatLong:Un.default,ltrim:en.default,rtrim:tn.default,trim:gi.default,escape:Qn.default,unescape:xr.default,stripLow:ae.default,whitelist:j.default,blacklist:xe.default,isWhitelisted:Ne.default,normalizeEmail:he.default,toString,isSlug:Ce.default,isStrongPassword:bt.default,isTaxID:Bt.default,isDate:x.default,isTime:b.default,isLicensePlate:ut.default,isVAT:ee.default,ibanLocales:gt.locales};t.default=Oe,e.exports=t.default,e.exports.default=t.default}(bm,bm.exports)),bm.exports}var WJ=YJ();const KJ=z.div`
950
950
  display: flex;
951
951
  flex-direction: column;
952
952
  gap: 4px;
@@ -2328,7 +2328,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2328
2328
  margin-top: 16px;
2329
2329
  display: flex;
2330
2330
  justify-content: flex-end;
2331
- `,G4=({botId:e})=>{var xr,ae;const{uiData:t,storeMetaData:n,onSendMessage:r,isKlaviyoMessage:i,isLoading:o,lastedBotmessageId:a,setLastedBotmessageId:u,messages:c,isMessageLoading:d,setIsMessageLoading:p,setMessages:h,saveConversation:m,changeDisplayModel:v,loadConversation:_,suggestedQuestions:S,setSuggestedQuestions:x,showUserInfoModel:b,setShowUserInfoModel:C,isUserInfoNeeded:k,setPendingQuestion:A}=Fu(),{cart:I,addToCart:$,generateCartUrl:B,addCartAttributes:U}=Jf(),G=Ys("use-chatbot-icon-size"),P=hs.detect(),K=t==null?void 0:t.isLeft,re=lm(),ue=t==null?void 0:t.heightOption,[Z,ie]=R.useState(!1);R.useEffect(()=>{const j=()=>{ie(window.matchMedia("(max-width: 768px)").matches)};return j(),window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[]);const[V,Q]=R.useState(!1),[ye,Te]=R.useState(!1),[T,X]=R.useState(""),[ve,L]=R.useState(""),[,we]=R.useState(0);R.useEffect(()=>{e&&im(e)},[e]),R.useEffect(()=>{Yg(e)},[e]),R.useEffect(()=>{let j=Nr();if(!j&&window.Thinkific){const xe=window.Thinkific.current_user;xe&&(j={name:xe.full_name,email:xe.email},ua(j))}Bo.init({projectName:e,debug:!0,testing:Xf}),j&&j.email&&(window.DebalesChat.identify(j.email,{name:j.name,phone:j.phone,email:j.email}),t!=null&&t.KlaviyoIntegration&&window.klaviyo&&window.klaviyo.identify({email:j.email,first_name:j.name,phone:j.phone,from:"Debales-Chatbot"}))},[e,t==null?void 0:t.KlaviyoIntegration]);const Ue=R.useRef(null),de=qt(jt.CLICKED_QUESTIONS,{botId:e}),[tt,Ze]=R.useState(()=>{try{const j=sessionStorage.getItem(de);return j?new Set(JSON.parse(j)):new Set}catch{return new Set}});R.useEffect(()=>{try{sessionStorage.setItem(de,JSON.stringify(Array.from(tt)))}catch(j){console.error("Failed to save to sessionStorage:",j)}},[tt]);const lt=R.useCallback((j,xe)=>{j?(window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:j,source:xe,projectId:e}})),setTimeout(()=>{Te(!0)},50)):(Te(!1),window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:j,source:xe,projectId:e}})))},[]);R.useEffect(()=>{const j=xe=>{Q(xe.detail.isOpen),xe.detail.isOpen&&setTimeout(()=>Te(!0),50),window.DebalesChat.isOpen=xe.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:xe.detail.isOpen,source:xe.detail.source})};return window.addEventListener(hn.OPEN_STATE_CHANGE,j),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,j)}},[]),R.useEffect(()=>{const j=xe=>{Q(xe.detail.isOpen),window.DebalesChat.isOpen=xe.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:xe.detail.isOpen})};return window.addEventListener(hn.OPEN_STATE_CHANGE,j),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,j)}},[]);const[gt,je]=R.useState(!1),[Se,Ye]=R.useState(()=>{const j=qt(jt.PENDING_BULK_ITEMS,{botId:e}),xe=sessionStorage.getItem(j);return xe?JSON.parse(xe):[]});R.useEffect(()=>{const j=qt(jt.PENDING_BULK_ITEMS,{botId:e});sessionStorage.setItem(j,JSON.stringify(Se))},[Se,e]);const[Qe,ot]=R.useState(!1),[et,He]=R.useState({name:"",email:"",message:""}),N=ja("exit_model"),[F,Y]=R.useState({text:!0,leadingQueries:!0,collections:!0,products:!0,variants:!0,cartSummary:!0,bulkItems:!0}),[ge,_e]=R.useState({suggestions:!1,products:!1,collections:!1,leadingQueries:!1,initialMessage:!1,cartSummary:!1,bulkItems:!1}),[Ie,We]=R.useState(!1),[nt,ne]=R.useState(!0),[me,qe]=R.useState(!1),[Xe,at]=R.useState(!1),Tt=2e3,Bt=R.useCallback(j=>{const xe=j.target,Ne=xe.scrollHeight-xe.scrollTop<=xe.clientHeight+0;ne(Ne)},[]);R.useEffect(()=>{var j,xe,Ne,he,Ce,ut;if(c.length>0&&!d){const bt=c[c.length-1],ee=sessionStorage.getItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e})),q=bt.isBot&&bt.conversationId===a&&bt.conversationId!==ee,pe=(I==null?void 0:I.itemCount)&&(I==null?void 0:I.itemCount)>0&&bt.conversationId===a;if(q){We(!0),_e(De=>({...De,initialMessage:!0})),sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),bt.conversationId||""),Y({text:!0,leadingQueries:!1,collections:!1,products:!1,variants:!1,cartSummary:!1,bulkItems:!1});const J=1600;let Re=J;const Oe=[{type:"collections",condition:((j=bt.collections)==null?void 0:j.length)&&((xe=bt.collections)==null?void 0:xe.length)>0},{type:"products",condition:((Ne=bt.products)==null?void 0:Ne.length)&&((he=bt.products)==null?void 0:he.length)>0},{type:"leadingQueries",condition:c.length>=1&&((Ce=bt.leading_queries)==null?void 0:Ce.length)&&((ut=bt.leading_queries)==null?void 0:ut.length)>0},{type:"cartSummary",condition:(I==null?void 0:I.itemCount)&&(I==null?void 0:I.itemCount)>0},{type:"bulkItems",condition:(Se==null?void 0:Se.length)>0}].filter(De=>De.condition);if(Oe.length===0){We(!1),_e(De=>({...De,initialMessage:!1,leadingQueries:!1}));return}Oe.forEach(({type:De},ct)=>{setTimeout(()=>{if(_e(Pt=>({...Pt,[De]:!0})),Y(Pt=>({...Pt,[De]:!0})),nt&&Ue.current){const Pt=Ue.current;Pt.scrollHeight-Pt.scrollTop<=Pt.clientHeight&&ri(Ue)}ct===Oe.length-1&&We(!1)},Re),Re+=J})}else pe&&Y(J=>({...J,cartSummary:!0}))}},[c,d,a,I==null?void 0:I.itemCount,Se==null?void 0:Se.length,nt,e,F]),R.useEffect(()=>{if(!i&&c.length>0){const j=Ue.current;j&&nt&&j.scrollHeight-j.scrollTop<=j.clientHeight+100&&setTimeout(()=>ri(Ue),100)}},[c.length,i,nt]),R.useEffect(()=>{const j=document.querySelector('meta[name="viewport"]'),xe=j==null?void 0:j.content;if(V){let Ne=j;const he=window.matchMedia("(max-width: 768px)").matches;Ne?Ne.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no":(Ne=document.createElement("meta"),Ne.name="viewport",Ne.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no",document.head.appendChild(Ne)),he&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="hidden");const Ce=Ne;return()=>{xe&&Ce&&(Ce.content=xe),he&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}}return()=>{window.matchMedia("(max-width: 768px)").matches&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}},[V,t==null?void 0:t.mobileDisplayMode]),R.useEffect(()=>{const j=setTimeout(()=>{je(!0)},1e3);return()=>clearTimeout(j)},[]),R.useEffect(()=>{i||setTimeout(()=>ri(Ue),100)},[c.length,i]),R.useEffect(()=>{I!=null&&I.itemCount&&I.itemCount===0&&!i&&setTimeout(()=>ri(Ue),100)},[I==null?void 0:I.itemCount,i]),R.useEffect(()=>{a&&sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),a)},[a,e]);const Et=R.useRef(Date.now()),Yt=R.useRef(0),ft=R.useRef(window.location.pathname),wt=R.useRef(S),Je=R.useRef(!1),yt=ja("acquisition_agent");R.useEffect(()=>{wt.current=S},[S]);const Yn=R.useCallback(async()=>{const j=Date.now();if(j-Et.current>=6e3&&j-Yt.current>=6e4&&!Je.current)try{Je.current=!0,console.log("fetching acquisition data");const he=await fetch(`${Zn}/api/wordpress/acquisition`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:new Date().toISOString(),page_information:window.location.href.split("?")[0],botid:e})});if(he.ok){const Ce=await he.json(),bt=[...wt.current.filter(ee=>ee.path!==ft.current),{question:Ce.Popup_Message,answer:"",path:ft.current,nameSpace:e,type:"dynamic",Follow_up_Question:Ce.Follow_up_Question}];x(bt)}Yt.current=j}catch(he){console.error("Error fetching acquisition data:",he)}finally{Je.current=!1}},[e]);R.useEffect(()=>{if(!yt||(t==null?void 0:t.show_bot)===!1)return;const j=()=>{Et.current=Date.now()};document.addEventListener("mousemove",j),document.addEventListener("mousedown",j),document.addEventListener("keypress",j),document.addEventListener("scroll",j),document.addEventListener("touchstart",j),document.addEventListener("touchmove",j);const xe=setInterval(Yn,1e3),Ne=()=>{const Ce=window.location.pathname.split("?")[0],ut=ft.current.split("?")[0];(()=>{const ee=ut.split("/").filter(Boolean),q=Ce.split("/").filter(Boolean);return ee.length!==q.length?!0:ee.length===0&&q.length===0?!1:Ce!==ut})()&&(ft.current=Ce,Et.current=Date.now())};return window.addEventListener("popstate",Ne),()=>{document.removeEventListener("mousemove",j),document.removeEventListener("mousedown",j),document.removeEventListener("keypress",j),document.removeEventListener("scroll",j),document.removeEventListener("touchstart",j),document.removeEventListener("touchmove",j),window.removeEventListener("popstate",Ne),clearInterval(xe)}},[yt,Yn,t==null?void 0:t.show_bot]);const[pr,Wn]=R.useState(!1),[Pn,Fr]=R.useState(!1),[pi,oi]=R.useState(null),Ar=async j=>{const xe=an();if(Te(!1),j&&c.length>1)try{(await fetch(`${Zn}/api/wordpress/userRating`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:xe,userRating:j,nameSpace:e})})).ok||console.error("Error submitting rating")}catch(Ne){console.error("Error submitting rating:",Ne)}setTimeout(()=>{Fr(!1),lt(!1,"close_button_clicked")},1e3)},zr=j=>{p(!0),Se.forEach(Ne=>{$(Ne.id,Ne.quantity)}),window.DebalesChat.track(mt.ADD_BULK_ITEM,{products:Se,message:j});const xe=[...c,{text:"🎉 Bulk items added to cart successfully.",leading_queries:["Get GST Invoice for the order","Explore more products"],conversationId:j,isBot:!0}];h(xe),m(xe),u(j),Ye([]),p(!1)},no=()=>{var j;switch(e){case"minature":case"bodytales":case"imemyselfcare-com":if(window.triggerGokwikCustomCheckout)return window.triggerGokwikCustomCheckout(),!0;break;case"athflex":if((j=window.shiprocketCheckoutEvents)!=null&&j.buyCart)return window.shiprocketCheckoutEvents.buyCart(),!0;break;case"www":if(window.openRzpCheckout)return window.openRzpCheckout(),!0;break;default:return window.location.href=B((t==null?void 0:t.shopifyShopDomain)??""),!1}return window.location.href=B((t==null?void 0:t.shopifyShopDomain)??""),!1},ai=async j=>{j.preventDefault(),window.DebalesChat.track(mt.CHECKOUT_CLICKED,{chatId:an()+e,cartValue:Number(I==null?void 0:I.total),cart:I}),U({dbls_method:"checkout_clicked"}),no()&&lt(!1,"checkout_clicked")},[gr,Cn]=R.useState([]);R.useEffect(()=>{const j=_K(Zg(S));Cn(j)},[S]);const Jt=R.useMemo(()=>gr.map(j=>{if(Array.isArray(j)){const xe=j.filter(he=>!tt.has(he.question));if(xe.length===0)return null;const Ne={isHighlighted:j[0].isHighlighted,enable:j[0].enable,type:j[0].type};return xe.map(he=>({...he,...Ne}))}else return tt.has(j.question)?null:j}).filter(Boolean),[gr,tt]);R.useEffect(()=>{const j=he=>{const Ce=he.detail.formId;switch(he.detail.type){case"open":case"embedOpen":setTimeout(()=>{const bt=xe(Ce);bt&&X(bt)},800);break;case"close":T&&(t==null?void 0:t.KlaviyoFormIntegration)===!0&&setTimeout(()=>{lt(!0,"klaviyo_form_closed"),L(Ce),r(T,void 0,void 0,!0,void 0,void 0)},1e4);break}},xe=he=>{const Ce=document.querySelector(`[data-testid="klaviyo-form-${he}"]`);if(console.log(`formElement text ${he} =>`,Ce==null?void 0:Ce.innerText,Ce==null?void 0:Ce.textContent),Ce instanceof HTMLElement){const ut=Ce.innerText||Ce.textContent;if(ut)return console.log("Found form text:",ut),`=> Klaviyo form content:
2331
+ `,G4=({botId:e})=>{var xr,ae;const{uiData:t,storeMetaData:n,onSendMessage:r,isKlaviyoMessage:i,isLoading:o,lastedBotmessageId:a,setLastedBotmessageId:u,messages:c,isMessageLoading:d,setIsMessageLoading:p,setMessages:h,saveConversation:m,changeDisplayModel:v,loadConversation:_,suggestedQuestions:S,setSuggestedQuestions:x,showUserInfoModel:b,setShowUserInfoModel:C,isUserInfoNeeded:k,setPendingQuestion:A}=Fu(),{cart:I,addToCart:$,generateCartUrl:B,addCartAttributes:U}=Jf(),G=Ys("use-chatbot-icon-size"),P=hs.detect(),K=t==null?void 0:t.isLeft,re=lm(),ue=t==null?void 0:t.heightOption,[Z,ie]=R.useState(!1);R.useEffect(()=>{const j=()=>{ie(window.matchMedia("(max-width: 768px)").matches)};return j(),window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[]);const[V,Q]=R.useState(!1),[ye,Te]=R.useState(!1),[T,X]=R.useState(""),[ve,L]=R.useState(""),[,we]=R.useState(0);R.useEffect(()=>{e&&im(e)},[e]),R.useEffect(()=>{Yg(e)},[e]),R.useEffect(()=>{let j=Nr();if(!j&&window.Thinkific){const xe=window.Thinkific.current_user;xe&&(j={name:xe.full_name,email:xe.email},ua(j))}Bo.init({projectName:e,debug:!1,testing:Xf}),j&&j.email&&(window.DebalesChat.identify(j.email,{name:j.name,phone:j.phone,email:j.email}),t!=null&&t.KlaviyoIntegration&&window.klaviyo&&window.klaviyo.identify({email:j.email,first_name:j.name,phone:j.phone,from:"Debales-Chatbot"}))},[e,t==null?void 0:t.KlaviyoIntegration]);const Ue=R.useRef(null),de=qt(jt.CLICKED_QUESTIONS,{botId:e}),[tt,Ze]=R.useState(()=>{try{const j=sessionStorage.getItem(de);return j?new Set(JSON.parse(j)):new Set}catch{return new Set}});R.useEffect(()=>{try{sessionStorage.setItem(de,JSON.stringify(Array.from(tt)))}catch(j){console.error("Failed to save to sessionStorage:",j)}},[tt]);const lt=R.useCallback((j,xe)=>{j?(window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:j,source:xe,projectId:e}})),setTimeout(()=>{Te(!0)},50)):(Te(!1),window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:j,source:xe,projectId:e}})))},[]);R.useEffect(()=>{const j=xe=>{Q(xe.detail.isOpen),xe.detail.isOpen&&setTimeout(()=>Te(!0),50),window.DebalesChat.isOpen=xe.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:xe.detail.isOpen,source:xe.detail.source})};return window.addEventListener(hn.OPEN_STATE_CHANGE,j),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,j)}},[]),R.useEffect(()=>{const j=xe=>{Q(xe.detail.isOpen),window.DebalesChat.isOpen=xe.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:xe.detail.isOpen})};return window.addEventListener(hn.OPEN_STATE_CHANGE,j),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,j)}},[]);const[gt,je]=R.useState(!1),[Se,Ye]=R.useState(()=>{const j=qt(jt.PENDING_BULK_ITEMS,{botId:e}),xe=sessionStorage.getItem(j);return xe?JSON.parse(xe):[]});R.useEffect(()=>{const j=qt(jt.PENDING_BULK_ITEMS,{botId:e});sessionStorage.setItem(j,JSON.stringify(Se))},[Se,e]);const[Qe,ot]=R.useState(!1),[et,He]=R.useState({name:"",email:"",message:""}),N=ja("exit_model"),[F,Y]=R.useState({text:!0,leadingQueries:!0,collections:!0,products:!0,variants:!0,cartSummary:!0,bulkItems:!0}),[ge,_e]=R.useState({suggestions:!1,products:!1,collections:!1,leadingQueries:!1,initialMessage:!1,cartSummary:!1,bulkItems:!1}),[Ie,We]=R.useState(!1),[nt,ne]=R.useState(!0),[me,qe]=R.useState(!1),[Xe,at]=R.useState(!1),Tt=2e3,Bt=R.useCallback(j=>{const xe=j.target,Ne=xe.scrollHeight-xe.scrollTop<=xe.clientHeight+0;ne(Ne)},[]);R.useEffect(()=>{var j,xe,Ne,he,Ce,ut;if(c.length>0&&!d){const bt=c[c.length-1],ee=sessionStorage.getItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e})),q=bt.isBot&&bt.conversationId===a&&bt.conversationId!==ee,pe=(I==null?void 0:I.itemCount)&&(I==null?void 0:I.itemCount)>0&&bt.conversationId===a;if(q){We(!0),_e(De=>({...De,initialMessage:!0})),sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),bt.conversationId||""),Y({text:!0,leadingQueries:!1,collections:!1,products:!1,variants:!1,cartSummary:!1,bulkItems:!1});const J=1600;let Re=J;const Oe=[{type:"collections",condition:((j=bt.collections)==null?void 0:j.length)&&((xe=bt.collections)==null?void 0:xe.length)>0},{type:"products",condition:((Ne=bt.products)==null?void 0:Ne.length)&&((he=bt.products)==null?void 0:he.length)>0},{type:"leadingQueries",condition:c.length>=1&&((Ce=bt.leading_queries)==null?void 0:Ce.length)&&((ut=bt.leading_queries)==null?void 0:ut.length)>0},{type:"cartSummary",condition:(I==null?void 0:I.itemCount)&&(I==null?void 0:I.itemCount)>0},{type:"bulkItems",condition:(Se==null?void 0:Se.length)>0}].filter(De=>De.condition);if(Oe.length===0){We(!1),_e(De=>({...De,initialMessage:!1,leadingQueries:!1}));return}Oe.forEach(({type:De},ct)=>{setTimeout(()=>{if(_e(Pt=>({...Pt,[De]:!0})),Y(Pt=>({...Pt,[De]:!0})),nt&&Ue.current){const Pt=Ue.current;Pt.scrollHeight-Pt.scrollTop<=Pt.clientHeight&&ri(Ue)}ct===Oe.length-1&&We(!1)},Re),Re+=J})}else pe&&Y(J=>({...J,cartSummary:!0}))}},[c,d,a,I==null?void 0:I.itemCount,Se==null?void 0:Se.length,nt,e,F]),R.useEffect(()=>{if(!i&&c.length>0){const j=Ue.current;j&&nt&&j.scrollHeight-j.scrollTop<=j.clientHeight+100&&setTimeout(()=>ri(Ue),100)}},[c.length,i,nt]),R.useEffect(()=>{const j=document.querySelector('meta[name="viewport"]'),xe=j==null?void 0:j.content;if(V){let Ne=j;const he=window.matchMedia("(max-width: 768px)").matches;Ne?Ne.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no":(Ne=document.createElement("meta"),Ne.name="viewport",Ne.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no",document.head.appendChild(Ne)),he&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="hidden");const Ce=Ne;return()=>{xe&&Ce&&(Ce.content=xe),he&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}}return()=>{window.matchMedia("(max-width: 768px)").matches&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}},[V,t==null?void 0:t.mobileDisplayMode]),R.useEffect(()=>{const j=setTimeout(()=>{je(!0)},1e3);return()=>clearTimeout(j)},[]),R.useEffect(()=>{i||setTimeout(()=>ri(Ue),100)},[c.length,i]),R.useEffect(()=>{I!=null&&I.itemCount&&I.itemCount===0&&!i&&setTimeout(()=>ri(Ue),100)},[I==null?void 0:I.itemCount,i]),R.useEffect(()=>{a&&sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),a)},[a,e]);const Et=R.useRef(Date.now()),Yt=R.useRef(0),ft=R.useRef(window.location.pathname),wt=R.useRef(S),Je=R.useRef(!1),yt=ja("acquisition_agent");R.useEffect(()=>{wt.current=S},[S]);const Yn=R.useCallback(async()=>{const j=Date.now();if(j-Et.current>=6e3&&j-Yt.current>=6e4&&!Je.current)try{Je.current=!0,console.log("fetching acquisition data");const he=await fetch(`${Zn}/api/wordpress/acquisition`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:new Date().toISOString(),page_information:window.location.href.split("?")[0],botid:e})});if(he.ok){const Ce=await he.json(),bt=[...wt.current.filter(ee=>ee.path!==ft.current),{question:Ce.Popup_Message,answer:"",path:ft.current,nameSpace:e,type:"dynamic",Follow_up_Question:Ce.Follow_up_Question}];x(bt)}Yt.current=j}catch(he){console.error("Error fetching acquisition data:",he)}finally{Je.current=!1}},[e]);R.useEffect(()=>{if(!yt||(t==null?void 0:t.show_bot)===!1)return;const j=()=>{Et.current=Date.now()};document.addEventListener("mousemove",j),document.addEventListener("mousedown",j),document.addEventListener("keypress",j),document.addEventListener("scroll",j),document.addEventListener("touchstart",j),document.addEventListener("touchmove",j);const xe=setInterval(Yn,1e3),Ne=()=>{const Ce=window.location.pathname.split("?")[0],ut=ft.current.split("?")[0];(()=>{const ee=ut.split("/").filter(Boolean),q=Ce.split("/").filter(Boolean);return ee.length!==q.length?!0:ee.length===0&&q.length===0?!1:Ce!==ut})()&&(ft.current=Ce,Et.current=Date.now())};return window.addEventListener("popstate",Ne),()=>{document.removeEventListener("mousemove",j),document.removeEventListener("mousedown",j),document.removeEventListener("keypress",j),document.removeEventListener("scroll",j),document.removeEventListener("touchstart",j),document.removeEventListener("touchmove",j),window.removeEventListener("popstate",Ne),clearInterval(xe)}},[yt,Yn,t==null?void 0:t.show_bot]);const[pr,Wn]=R.useState(!1),[Pn,Fr]=R.useState(!1),[pi,oi]=R.useState(null),Ar=async j=>{const xe=an();if(Te(!1),j&&c.length>1)try{(await fetch(`${Zn}/api/wordpress/userRating`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:xe,userRating:j,nameSpace:e})})).ok||console.error("Error submitting rating")}catch(Ne){console.error("Error submitting rating:",Ne)}setTimeout(()=>{Fr(!1),lt(!1,"close_button_clicked")},1e3)},zr=j=>{p(!0),Se.forEach(Ne=>{$(Ne.id,Ne.quantity)}),window.DebalesChat.track(mt.ADD_BULK_ITEM,{products:Se,message:j});const xe=[...c,{text:"🎉 Bulk items added to cart successfully.",leading_queries:["Get GST Invoice for the order","Explore more products"],conversationId:j,isBot:!0}];h(xe),m(xe),u(j),Ye([]),p(!1)},no=()=>{var j;switch(e){case"minature":case"bodytales":case"imemyselfcare-com":if(window.triggerGokwikCustomCheckout)return window.triggerGokwikCustomCheckout(),!0;break;case"athflex":if((j=window.shiprocketCheckoutEvents)!=null&&j.buyCart)return window.shiprocketCheckoutEvents.buyCart(),!0;break;case"www":if(window.openRzpCheckout)return window.openRzpCheckout(),!0;break;default:return window.location.href=B((t==null?void 0:t.shopifyShopDomain)??""),!1}return window.location.href=B((t==null?void 0:t.shopifyShopDomain)??""),!1},ai=async j=>{j.preventDefault(),window.DebalesChat.track(mt.CHECKOUT_CLICKED,{chatId:an()+e,cartValue:Number(I==null?void 0:I.total),cart:I}),U({dbls_method:"checkout_clicked"}),no()&&lt(!1,"checkout_clicked")},[gr,Cn]=R.useState([]);R.useEffect(()=>{const j=_K(Zg(S));Cn(j)},[S]);const Jt=R.useMemo(()=>gr.map(j=>{if(Array.isArray(j)){const xe=j.filter(he=>!tt.has(he.question));if(xe.length===0)return null;const Ne={isHighlighted:j[0].isHighlighted,enable:j[0].enable,type:j[0].type};return xe.map(he=>({...he,...Ne}))}else return tt.has(j.question)?null:j}).filter(Boolean),[gr,tt]);R.useEffect(()=>{const j=he=>{const Ce=he.detail.formId;switch(he.detail.type){case"open":case"embedOpen":setTimeout(()=>{const bt=xe(Ce);bt&&X(bt)},800);break;case"close":T&&(t==null?void 0:t.KlaviyoFormIntegration)===!0&&setTimeout(()=>{lt(!0,"klaviyo_form_closed"),L(Ce),r(T,void 0,void 0,!0,void 0,void 0)},1e4);break}},xe=he=>{const Ce=document.querySelector(`[data-testid="klaviyo-form-${he}"]`);if(console.log(`formElement text ${he} =>`,Ce==null?void 0:Ce.innerText,Ce==null?void 0:Ce.textContent),Ce instanceof HTMLElement){const ut=Ce.innerText||Ce.textContent;if(ut)return console.log("Found form text:",ut),`=> Klaviyo form content:
2332
2332
 
2333
2333
  `+ut+`
2334
2334
 
@@ -3174,7 +3174,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
3174
3174
  margin-top: 16px;
3175
3175
  display: flex;
3176
3176
  justify-content: flex-end;
3177
- `,Xte=({botId:e})=>{var Qn,xr;const{uiData:t,storeMetaData:n,onSendMessage:r,isKlaviyoMessage:i,isLoading:o,lastedBotmessageId:a,setLastedBotmessageId:u,messages:c,isMessageLoading:d,setIsMessageLoading:p,setMessages:h,saveConversation:m,changeDisplayModel:v,loadConversation:_,suggestedQuestions:S,showUserInfoModel:x,setShowUserInfoModel:b,isUserInfoNeeded:C,setPendingQuestion:k}=Fu(),{cart:A,addToCart:I,generateCartUrl:$,addCartAttributes:B}=Jf(),U=Ys("use-chatbot-icon-size"),G=hs.detect(),P=t==null?void 0:t.isLeft,K=lm(),re=t==null?void 0:t.heightOption,Z=Ys("new-suggested-question-design"),[ie,V]=R.useState(!1),[Q,ye]=R.useState(!1),[Te,T]=R.useState(!1),[X,ve]=R.useState([]),L=R.useCallback(async()=>{try{const ae=await fetch(`${Zn}/api/wordpress/acquisition`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:new Date().toISOString(),page_information:window.location.href.split("?")[0],botid:e})});if(ae.ok){const j=await ae.json(),xe=window.location.pathname,Ne=3,he=[...X],Ce={question:j.Popup_Message,answer:"",path:xe,nameSpace:e,type:"dynamic",Follow_up_Question:j.Follow_up_Question};he.length>=Ne&&he.shift(),he.push(Ce),ve(he),console.log("updated quesitons",he)}else console.error("Failed to fetch new acquisition question")}catch(ae){console.error("Error fetching new acquisition question:",ae)}},[e,X]);R.useEffect(()=>{if(!Z)return;let ae,j,xe,Ne;const he=()=>{ae=setTimeout(()=>{V(!0),j=setTimeout(()=>{T(!0),ye(!0),xe=setTimeout(async()=>{T(!1),ye(!1),await L(),Ne=setTimeout(()=>{T(!0),V(!0),ye(!0),he()},Z.hide_timing||4e3)},Z.show_for||44324)},Z.showing_delay||2e3)},Z.showing_delay||2e3)};return he(),()=>{console.log("[Debug] Cleaning up timers"),clearTimeout(ae),clearTimeout(j),clearTimeout(xe),clearTimeout(Ne)}},[Z,L]);const[we,Ue]=R.useState(!1);R.useEffect(()=>{const ae=()=>{Ue(window.matchMedia("(max-width: 768px)").matches)};return ae(),window.addEventListener("resize",ae),()=>window.removeEventListener("resize",ae)},[]);const[de,tt]=R.useState(!1),[Ze,lt]=R.useState(!1),[gt,je]=R.useState(""),[Se,Ye]=R.useState(""),[,Qe]=R.useState(0);R.useEffect(()=>{e&&im(e)},[e]),R.useEffect(()=>{Yg(e)},[e]),R.useEffect(()=>{let ae=Nr();if(!ae&&window.Thinkific){const j=window.Thinkific.current_user;j&&(ae={name:j.full_name,email:j.email},ua(ae))}Bo.init({projectName:e,debug:!0,testing:Xf}),ae&&ae.email&&(window.DebalesChat.identify(ae.email,{name:ae.name,phone:ae.phone,email:ae.email}),t!=null&&t.KlaviyoIntegration&&window.klaviyo&&window.klaviyo.identify({email:ae.email,first_name:ae.name,phone:ae.phone,from:"Debales-Chatbot"}))},[e,t==null?void 0:t.KlaviyoIntegration]);const ot=R.useRef(null),et=qt(jt.CLICKED_QUESTIONS,{botId:e}),[He,N]=R.useState(()=>{try{const ae=sessionStorage.getItem(et);return ae?new Set(JSON.parse(ae)):new Set}catch{return new Set}});R.useEffect(()=>{try{sessionStorage.setItem(et,JSON.stringify(Array.from(He)))}catch(ae){console.error("Failed to save to sessionStorage:",ae)}},[He]);const F=R.useCallback((ae,j)=>{ae?(window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:ae,source:j,projectId:e}})),setTimeout(()=>{lt(!0)},50)):(lt(!1),window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:ae,source:j,projectId:e}})))},[]);R.useEffect(()=>{const ae=j=>{tt(j.detail.isOpen),j.detail.isOpen&&setTimeout(()=>lt(!0),50),window.DebalesChat.isOpen=j.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:j.detail.isOpen,source:j.detail.source})};return window.addEventListener(hn.OPEN_STATE_CHANGE,ae),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,ae)}},[]),R.useEffect(()=>{const ae=j=>{tt(j.detail.isOpen),window.DebalesChat.isOpen=j.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:j.detail.isOpen})};return window.addEventListener(hn.OPEN_STATE_CHANGE,ae),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,ae)}},[]);const[Y,ge]=R.useState(()=>{const ae=qt(jt.PENDING_BULK_ITEMS,{botId:e}),j=sessionStorage.getItem(ae);return j?JSON.parse(j):[]});R.useEffect(()=>{const ae=qt(jt.PENDING_BULK_ITEMS,{botId:e});sessionStorage.setItem(ae,JSON.stringify(Y))},[Y,e]);const[_e,Ie]=R.useState(!1),[We,nt]=R.useState({name:"",email:"",message:""}),ne=ja("exit_model"),[me,qe]=R.useState({text:!0,leadingQueries:!0,collections:!0,products:!0,variants:!0,cartSummary:!0,bulkItems:!0}),[Xe,at]=R.useState(!1),[Tt,Bt]=R.useState(!0),[Et,Yt]=R.useState(!1),[ft,wt]=R.useState(!1),Je=500,yt=R.useCallback(ae=>{const j=ae.target,xe=j.scrollHeight-j.scrollTop<=j.clientHeight+0;Bt(xe)},[]);R.useEffect(()=>{var ae,j,xe,Ne,he,Ce;if(c.length>0&&!d){const ut=c[c.length-1],bt=sessionStorage.getItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e})),ee=ut.isBot&&ut.conversationId===a&&ut.conversationId!==bt,q=(A==null?void 0:A.itemCount)&&(A==null?void 0:A.itemCount)>0&&ut.conversationId===a;if(ee){at(!0),sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),ut.conversationId||""),qe({text:!0,leadingQueries:!1,collections:!1,products:!1,variants:!1,cartSummary:!1,bulkItems:!1});const pe=1600;let J=pe;const Re=[{type:"collections",condition:((ae=ut.collections)==null?void 0:ae.length)&&((j=ut.collections)==null?void 0:j.length)>0},{type:"products",condition:((xe=ut.products)==null?void 0:xe.length)&&((Ne=ut.products)==null?void 0:Ne.length)>0},{type:"leadingQueries",condition:((he=ut.leading_queries)==null?void 0:he.length)&&((Ce=ut.leading_queries)==null?void 0:Ce.length)>0},{type:"cartSummary",condition:(A==null?void 0:A.itemCount)&&(A==null?void 0:A.itemCount)>0},{type:"bulkItems",condition:(Y==null?void 0:Y.length)>0}].filter(Oe=>Oe.condition);if(Re.length===0){at(!1);return}Re.forEach(({type:Oe},De)=>{setTimeout(()=>{if(qe(ct=>({...ct,[Oe]:!0})),Tt&&ot.current){const ct=ot.current;ct.scrollHeight-ct.scrollTop<=ct.clientHeight&&ri(ot)}De===Re.length-1&&at(!1)},J),J+=pe})}else q&&qe(pe=>({...pe,cartSummary:!0}))}},[c,d,a,A==null?void 0:A.itemCount,Y==null?void 0:Y.length,Tt,e]),R.useEffect(()=>{if(!i&&c.length>0){const ae=ot.current;ae&&Tt&&ae.scrollHeight-ae.scrollTop<=ae.clientHeight+100&&setTimeout(()=>ri(ot),100)}},[c.length,i,Tt]),R.useEffect(()=>{const ae=document.querySelector('meta[name="viewport"]'),j=ae==null?void 0:ae.content;if(de){let xe=ae;const Ne=window.matchMedia("(max-width: 768px)").matches;xe?xe.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no":(xe=document.createElement("meta"),xe.name="viewport",xe.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no",document.head.appendChild(xe)),Ne&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="hidden");const he=xe;return()=>{j&&he&&(he.content=j),Ne&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}}return()=>{window.matchMedia("(max-width: 768px)").matches&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}},[de,t==null?void 0:t.mobileDisplayMode]),R.useEffect(()=>{i||setTimeout(()=>ri(ot),100)},[c.length,i]),R.useEffect(()=>{A!=null&&A.itemCount&&A.itemCount===0&&!i&&setTimeout(()=>ri(ot),100)},[A==null?void 0:A.itemCount,i]),R.useEffect(()=>{a&&sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),a)},[a,e]);const[Yn,pr]=R.useState(!1),[Wn,Pn]=R.useState(!1),[Fr,pi]=R.useState(null),oi=async ae=>{const j=an();if(lt(!1),ae&&c.length>1)try{(await fetch(`${Zn}/api/wordpress/userRating`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:j,userRating:ae,nameSpace:e})})).ok||console.error("Error submitting rating")}catch(xe){console.error("Error submitting rating:",xe)}setTimeout(()=>{Pn(!1),F(!1,"close_button_clicked")},1e3)},Ar=ae=>{p(!0),Y.forEach(xe=>{I(xe.id,xe.quantity)}),window.DebalesChat.track(mt.ADD_BULK_ITEM,{products:Y,message:ae});const j=[...c,{text:"🎉 Bulk items added to cart successfully.",leading_queries:["Get GST Invoice for the order","Explore more products"],conversationId:ae,isBot:!0}];h(j),m(j),u(ae),ge([]),p(!1)},zr=()=>{var ae;switch(e){case"minature":case"bodytales":case"imemyselfcare-com":if(window.triggerGokwikCustomCheckout)return window.triggerGokwikCustomCheckout(),!0;break;case"athflex":if((ae=window.shiprocketCheckoutEvents)!=null&&ae.buyCart)return window.shiprocketCheckoutEvents.buyCart(),!0;break;case"www":if(window.openRzpCheckout)return window.openRzpCheckout(),!0;break;default:return window.location.href=$((t==null?void 0:t.shopifyShopDomain)??""),!1}return window.location.href=$((t==null?void 0:t.shopifyShopDomain)??""),!1},no=async ae=>{ae.preventDefault(),window.DebalesChat.track(mt.CHECKOUT_CLICKED,{chatId:an()+e,cartValue:Number(A==null?void 0:A.total),cart:A}),B({dbls_method:"checkout_clicked"}),zr()&&F(!1,"checkout_clicked")};R.useEffect(()=>{const ae=Zg(S);ve(j=>[...ae.filter(Ne=>!j.some(he=>he.question===Ne.question))])},[S]);const ai=R.useMemo(()=>X.map(ae=>({...ae,isClicked:He.has(ae.question)})),[X,He]);R.useEffect(()=>{const ae=Ne=>{const he=Ne.detail.formId;switch(Ne.detail.type){case"open":case"embedOpen":setTimeout(()=>{const ut=j(he);ut&&je(ut)},800);break;case"close":gt&&(t==null?void 0:t.KlaviyoFormIntegration)===!0&&setTimeout(()=>{F(!0,"klaviyo_form_closed"),Ye(he),r(gt,void 0,void 0,!0)},1e4);break}},j=Ne=>{const he=document.querySelector(`[data-testid="klaviyo-form-${Ne}"]`);if(console.log(`formElement text ${Ne} =>`,he==null?void 0:he.innerText,he==null?void 0:he.textContent),he instanceof HTMLElement){const Ce=he.innerText||he.textContent;if(Ce)return console.log("Found form text:",Ce),`=> Klaviyo form content:
3177
+ `,Xte=({botId:e})=>{var Qn,xr;const{uiData:t,storeMetaData:n,onSendMessage:r,isKlaviyoMessage:i,isLoading:o,lastedBotmessageId:a,setLastedBotmessageId:u,messages:c,isMessageLoading:d,setIsMessageLoading:p,setMessages:h,saveConversation:m,changeDisplayModel:v,loadConversation:_,suggestedQuestions:S,showUserInfoModel:x,setShowUserInfoModel:b,isUserInfoNeeded:C,setPendingQuestion:k}=Fu(),{cart:A,addToCart:I,generateCartUrl:$,addCartAttributes:B}=Jf(),U=Ys("use-chatbot-icon-size"),G=hs.detect(),P=t==null?void 0:t.isLeft,K=lm(),re=t==null?void 0:t.heightOption,Z=Ys("new-suggested-question-design"),[ie,V]=R.useState(!1),[Q,ye]=R.useState(!1),[Te,T]=R.useState(!1),[X,ve]=R.useState([]),L=R.useCallback(async()=>{try{const ae=await fetch(`${Zn}/api/wordpress/acquisition`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:new Date().toISOString(),page_information:window.location.href.split("?")[0],botid:e})});if(ae.ok){const j=await ae.json(),xe=window.location.pathname,Ne=3,he=[...X],Ce={question:j.Popup_Message,answer:"",path:xe,nameSpace:e,type:"dynamic",Follow_up_Question:j.Follow_up_Question};he.length>=Ne&&he.shift(),he.push(Ce),ve(he),console.log("updated quesitons",he)}else console.error("Failed to fetch new acquisition question")}catch(ae){console.error("Error fetching new acquisition question:",ae)}},[e,X]);R.useEffect(()=>{if(!Z)return;let ae,j,xe,Ne;const he=()=>{ae=setTimeout(()=>{V(!0),j=setTimeout(()=>{T(!0),ye(!0),xe=setTimeout(async()=>{T(!1),ye(!1),await L(),Ne=setTimeout(()=>{T(!0),V(!0),ye(!0),he()},Z.hide_timing||4e3)},Z.show_for||44324)},Z.showing_delay||2e3)},Z.showing_delay||2e3)};return he(),()=>{console.log("[Debug] Cleaning up timers"),clearTimeout(ae),clearTimeout(j),clearTimeout(xe),clearTimeout(Ne)}},[Z,L]);const[we,Ue]=R.useState(!1);R.useEffect(()=>{const ae=()=>{Ue(window.matchMedia("(max-width: 768px)").matches)};return ae(),window.addEventListener("resize",ae),()=>window.removeEventListener("resize",ae)},[]);const[de,tt]=R.useState(!1),[Ze,lt]=R.useState(!1),[gt,je]=R.useState(""),[Se,Ye]=R.useState(""),[,Qe]=R.useState(0);R.useEffect(()=>{e&&im(e)},[e]),R.useEffect(()=>{Yg(e)},[e]),R.useEffect(()=>{let ae=Nr();if(!ae&&window.Thinkific){const j=window.Thinkific.current_user;j&&(ae={name:j.full_name,email:j.email},ua(ae))}Bo.init({projectName:e,debug:!1,testing:Xf}),ae&&ae.email&&(window.DebalesChat.identify(ae.email,{name:ae.name,phone:ae.phone,email:ae.email}),t!=null&&t.KlaviyoIntegration&&window.klaviyo&&window.klaviyo.identify({email:ae.email,first_name:ae.name,phone:ae.phone,from:"Debales-Chatbot"}))},[e,t==null?void 0:t.KlaviyoIntegration]);const ot=R.useRef(null),et=qt(jt.CLICKED_QUESTIONS,{botId:e}),[He,N]=R.useState(()=>{try{const ae=sessionStorage.getItem(et);return ae?new Set(JSON.parse(ae)):new Set}catch{return new Set}});R.useEffect(()=>{try{sessionStorage.setItem(et,JSON.stringify(Array.from(He)))}catch(ae){console.error("Failed to save to sessionStorage:",ae)}},[He]);const F=R.useCallback((ae,j)=>{ae?(window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:ae,source:j,projectId:e}})),setTimeout(()=>{lt(!0)},50)):(lt(!1),window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:ae,source:j,projectId:e}})))},[]);R.useEffect(()=>{const ae=j=>{tt(j.detail.isOpen),j.detail.isOpen&&setTimeout(()=>lt(!0),50),window.DebalesChat.isOpen=j.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:j.detail.isOpen,source:j.detail.source})};return window.addEventListener(hn.OPEN_STATE_CHANGE,ae),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,ae)}},[]),R.useEffect(()=>{const ae=j=>{tt(j.detail.isOpen),window.DebalesChat.isOpen=j.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:j.detail.isOpen})};return window.addEventListener(hn.OPEN_STATE_CHANGE,ae),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,ae)}},[]);const[Y,ge]=R.useState(()=>{const ae=qt(jt.PENDING_BULK_ITEMS,{botId:e}),j=sessionStorage.getItem(ae);return j?JSON.parse(j):[]});R.useEffect(()=>{const ae=qt(jt.PENDING_BULK_ITEMS,{botId:e});sessionStorage.setItem(ae,JSON.stringify(Y))},[Y,e]);const[_e,Ie]=R.useState(!1),[We,nt]=R.useState({name:"",email:"",message:""}),ne=ja("exit_model"),[me,qe]=R.useState({text:!0,leadingQueries:!0,collections:!0,products:!0,variants:!0,cartSummary:!0,bulkItems:!0}),[Xe,at]=R.useState(!1),[Tt,Bt]=R.useState(!0),[Et,Yt]=R.useState(!1),[ft,wt]=R.useState(!1),Je=500,yt=R.useCallback(ae=>{const j=ae.target,xe=j.scrollHeight-j.scrollTop<=j.clientHeight+0;Bt(xe)},[]);R.useEffect(()=>{var ae,j,xe,Ne,he,Ce;if(c.length>0&&!d){const ut=c[c.length-1],bt=sessionStorage.getItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e})),ee=ut.isBot&&ut.conversationId===a&&ut.conversationId!==bt,q=(A==null?void 0:A.itemCount)&&(A==null?void 0:A.itemCount)>0&&ut.conversationId===a;if(ee){at(!0),sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),ut.conversationId||""),qe({text:!0,leadingQueries:!1,collections:!1,products:!1,variants:!1,cartSummary:!1,bulkItems:!1});const pe=1600;let J=pe;const Re=[{type:"collections",condition:((ae=ut.collections)==null?void 0:ae.length)&&((j=ut.collections)==null?void 0:j.length)>0},{type:"products",condition:((xe=ut.products)==null?void 0:xe.length)&&((Ne=ut.products)==null?void 0:Ne.length)>0},{type:"leadingQueries",condition:((he=ut.leading_queries)==null?void 0:he.length)&&((Ce=ut.leading_queries)==null?void 0:Ce.length)>0},{type:"cartSummary",condition:(A==null?void 0:A.itemCount)&&(A==null?void 0:A.itemCount)>0},{type:"bulkItems",condition:(Y==null?void 0:Y.length)>0}].filter(Oe=>Oe.condition);if(Re.length===0){at(!1);return}Re.forEach(({type:Oe},De)=>{setTimeout(()=>{if(qe(ct=>({...ct,[Oe]:!0})),Tt&&ot.current){const ct=ot.current;ct.scrollHeight-ct.scrollTop<=ct.clientHeight&&ri(ot)}De===Re.length-1&&at(!1)},J),J+=pe})}else q&&qe(pe=>({...pe,cartSummary:!0}))}},[c,d,a,A==null?void 0:A.itemCount,Y==null?void 0:Y.length,Tt,e]),R.useEffect(()=>{if(!i&&c.length>0){const ae=ot.current;ae&&Tt&&ae.scrollHeight-ae.scrollTop<=ae.clientHeight+100&&setTimeout(()=>ri(ot),100)}},[c.length,i,Tt]),R.useEffect(()=>{const ae=document.querySelector('meta[name="viewport"]'),j=ae==null?void 0:ae.content;if(de){let xe=ae;const Ne=window.matchMedia("(max-width: 768px)").matches;xe?xe.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no":(xe=document.createElement("meta"),xe.name="viewport",xe.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no",document.head.appendChild(xe)),Ne&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="hidden");const he=xe;return()=>{j&&he&&(he.content=j),Ne&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}}return()=>{window.matchMedia("(max-width: 768px)").matches&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}},[de,t==null?void 0:t.mobileDisplayMode]),R.useEffect(()=>{i||setTimeout(()=>ri(ot),100)},[c.length,i]),R.useEffect(()=>{A!=null&&A.itemCount&&A.itemCount===0&&!i&&setTimeout(()=>ri(ot),100)},[A==null?void 0:A.itemCount,i]),R.useEffect(()=>{a&&sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),a)},[a,e]);const[Yn,pr]=R.useState(!1),[Wn,Pn]=R.useState(!1),[Fr,pi]=R.useState(null),oi=async ae=>{const j=an();if(lt(!1),ae&&c.length>1)try{(await fetch(`${Zn}/api/wordpress/userRating`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:j,userRating:ae,nameSpace:e})})).ok||console.error("Error submitting rating")}catch(xe){console.error("Error submitting rating:",xe)}setTimeout(()=>{Pn(!1),F(!1,"close_button_clicked")},1e3)},Ar=ae=>{p(!0),Y.forEach(xe=>{I(xe.id,xe.quantity)}),window.DebalesChat.track(mt.ADD_BULK_ITEM,{products:Y,message:ae});const j=[...c,{text:"🎉 Bulk items added to cart successfully.",leading_queries:["Get GST Invoice for the order","Explore more products"],conversationId:ae,isBot:!0}];h(j),m(j),u(ae),ge([]),p(!1)},zr=()=>{var ae;switch(e){case"minature":case"bodytales":case"imemyselfcare-com":if(window.triggerGokwikCustomCheckout)return window.triggerGokwikCustomCheckout(),!0;break;case"athflex":if((ae=window.shiprocketCheckoutEvents)!=null&&ae.buyCart)return window.shiprocketCheckoutEvents.buyCart(),!0;break;case"www":if(window.openRzpCheckout)return window.openRzpCheckout(),!0;break;default:return window.location.href=$((t==null?void 0:t.shopifyShopDomain)??""),!1}return window.location.href=$((t==null?void 0:t.shopifyShopDomain)??""),!1},no=async ae=>{ae.preventDefault(),window.DebalesChat.track(mt.CHECKOUT_CLICKED,{chatId:an()+e,cartValue:Number(A==null?void 0:A.total),cart:A}),B({dbls_method:"checkout_clicked"}),zr()&&F(!1,"checkout_clicked")};R.useEffect(()=>{const ae=Zg(S);ve(j=>[...ae.filter(Ne=>!j.some(he=>he.question===Ne.question))])},[S]);const ai=R.useMemo(()=>X.map(ae=>({...ae,isClicked:He.has(ae.question)})),[X,He]);R.useEffect(()=>{const ae=Ne=>{const he=Ne.detail.formId;switch(Ne.detail.type){case"open":case"embedOpen":setTimeout(()=>{const ut=j(he);ut&&je(ut)},800);break;case"close":gt&&(t==null?void 0:t.KlaviyoFormIntegration)===!0&&setTimeout(()=>{F(!0,"klaviyo_form_closed"),Ye(he),r(gt,void 0,void 0,!0)},1e4);break}},j=Ne=>{const he=document.querySelector(`[data-testid="klaviyo-form-${Ne}"]`);if(console.log(`formElement text ${Ne} =>`,he==null?void 0:he.innerText,he==null?void 0:he.textContent),he instanceof HTMLElement){const Ce=he.innerText||he.textContent;if(Ce)return console.log("Found form text:",Ce),`=> Klaviyo form content:
3178
3178
 
3179
3179
  `+Ce+`
3180
3180
 
@@ -4000,7 +4000,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
4000
4000
  margin-top: 16px;
4001
4001
  display: flex;
4002
4002
  justify-content: flex-end;
4003
- `,$ne=({botId:e})=>{var bt,ee;const{uiData:t,storeMetaData:n,onSendMessage:r,isKlaviyoMessage:i,isLoading:o,lastedBotmessageId:a,setLastedBotmessageId:u,messages:c,isMessageLoading:d,setIsMessageLoading:p,setMessages:h,saveConversation:m,changeDisplayModel:v,loadConversation:_,suggestedQuestions:S,setSuggestedQuestions:x,showUserInfoModel:b,setShowUserInfoModel:C,isUserInfoNeeded:k,setPendingQuestion:A}=Fu(),{cart:I,addToCart:$,generateCartUrl:B,addCartAttributes:U}=Jf(),G=Ys("use-chatbot-icon-size"),P=hs.detect(),K=t==null?void 0:t.isLeft,re=lm(),ue=t==null?void 0:t.heightOption,ie=Ys("new-suggested-question-design"),[V,Q]=R.useState(!1),[ye,Te]=R.useState(!1),[T,X]=R.useState(!1);R.useEffect(()=>{if(!ie)return;const q=setTimeout(()=>{Q(!0);const pe=setTimeout(()=>{X(!0),Te(!0);const J=setTimeout(()=>{X(!1),Q(!1),Te(!1);const Re=setTimeout(()=>{X(!0),Q(!0),Te(!0)},ie.hide_timing||4e3);return()=>clearTimeout(Re)},ie.show_for||44324);return()=>clearTimeout(J)},ie.showing_delay||2e3);return()=>clearTimeout(pe)},ie.showing_delay||2e3);return()=>clearTimeout(q)},[ie]);const[ve,L]=R.useState(!1);R.useEffect(()=>{const q=()=>{L(window.matchMedia("(max-width: 768px)").matches)};return q(),window.addEventListener("resize",q),()=>window.removeEventListener("resize",q)},[]);const[we,Ue]=R.useState(!1),[de,tt]=R.useState(!1),[Ze,lt]=R.useState(""),[gt,je]=R.useState(""),[,Se]=R.useState(0);R.useEffect(()=>{e&&im(e)},[e]),R.useEffect(()=>{Yg(e)},[e]),R.useEffect(()=>{let q=Nr();if(!q&&window.Thinkific){const pe=window.Thinkific.current_user;pe&&(q={name:pe.full_name,email:pe.email},ua(q))}Bo.init({projectName:e,debug:!0,testing:Xf}),q&&q.email&&(window.DebalesChat.identify(q.email,{name:q.name,phone:q.phone,email:q.email}),t!=null&&t.KlaviyoIntegration&&window.klaviyo&&window.klaviyo.identify({email:q.email,first_name:q.name,phone:q.phone,from:"Debales-Chatbot"}))},[e,t==null?void 0:t.KlaviyoIntegration]);const Ye=R.useRef(null),Qe=qt(jt.CLICKED_QUESTIONS,{botId:e}),[ot,et]=R.useState(()=>{try{const q=sessionStorage.getItem(Qe);return q?new Set(JSON.parse(q)):new Set}catch{return new Set}});R.useEffect(()=>{try{sessionStorage.setItem(Qe,JSON.stringify(Array.from(ot)))}catch(q){console.error("Failed to save to sessionStorage:",q)}},[ot]);const He=R.useCallback((q,pe)=>{q?(window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:q,source:pe,projectId:e}})),setTimeout(()=>{tt(!0)},50)):(tt(!1),window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:q,source:pe,projectId:e}})))},[]);R.useEffect(()=>{const q=pe=>{Ue(pe.detail.isOpen),pe.detail.isOpen&&setTimeout(()=>tt(!0),50),window.DebalesChat.isOpen=pe.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:pe.detail.isOpen,source:pe.detail.source})};return window.addEventListener(hn.OPEN_STATE_CHANGE,q),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,q)}},[]),R.useEffect(()=>{const q=pe=>{Ue(pe.detail.isOpen),window.DebalesChat.isOpen=pe.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:pe.detail.isOpen})};return window.addEventListener(hn.OPEN_STATE_CHANGE,q),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,q)}},[]);const[N,F]=R.useState(()=>{const q=qt(jt.PENDING_BULK_ITEMS,{botId:e}),pe=sessionStorage.getItem(q);return pe?JSON.parse(pe):[]});R.useEffect(()=>{const q=qt(jt.PENDING_BULK_ITEMS,{botId:e});sessionStorage.setItem(q,JSON.stringify(N))},[N,e]);const[Y,ge]=R.useState(!1),[_e,Ie]=R.useState({name:"",email:"",message:""}),We=ja("exit_model"),[nt,ne]=R.useState({text:!0,leadingQueries:!0,collections:!0,products:!0,variants:!0,cartSummary:!0,bulkItems:!0}),[me,qe]=R.useState(!1),[Xe,at]=R.useState(!0),[Tt,Bt]=R.useState(!1),[Et,Yt]=R.useState(!1),ft=500,wt=R.useCallback(q=>{const pe=q.target,J=pe.scrollHeight-pe.scrollTop<=pe.clientHeight+0;at(J)},[]);R.useEffect(()=>{var q,pe,J,Re,Oe,De;if(c.length>0&&!d){const ct=c[c.length-1],Pt=sessionStorage.getItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e})),Ur=ct.isBot&&ct.conversationId===a&&ct.conversationId!==Pt,jr=(I==null?void 0:I.itemCount)&&(I==null?void 0:I.itemCount)>0&&ct.conversationId===a;if(Ur){qe(!0),sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),ct.conversationId||""),ne({text:!0,leadingQueries:!1,collections:!1,products:!1,variants:!1,cartSummary:!1,bulkItems:!1});const Ir=1600;let mi=Ir;const ma=[{type:"collections",condition:((q=ct.collections)==null?void 0:q.length)&&((pe=ct.collections)==null?void 0:pe.length)>0},{type:"products",condition:((J=ct.products)==null?void 0:J.length)&&((Re=ct.products)==null?void 0:Re.length)>0},{type:"leadingQueries",condition:((Oe=ct.leading_queries)==null?void 0:Oe.length)&&((De=ct.leading_queries)==null?void 0:De.length)>0},{type:"cartSummary",condition:(I==null?void 0:I.itemCount)&&(I==null?void 0:I.itemCount)>0},{type:"bulkItems",condition:(N==null?void 0:N.length)>0}].filter(gs=>gs.condition);if(ma.length===0){qe(!1);return}ma.forEach(({type:gs},mr)=>{setTimeout(()=>{if(ne(va=>({...va,[gs]:!0})),Xe&&Ye.current){const va=Ye.current;va.scrollHeight-va.scrollTop<=va.clientHeight&&ri(Ye)}mr===ma.length-1&&qe(!1)},mi),mi+=Ir})}else jr&&ne(Ir=>({...Ir,cartSummary:!0}))}},[c,d,a,I==null?void 0:I.itemCount,N==null?void 0:N.length,Xe,e]),R.useEffect(()=>{if(!i&&c.length>0){const q=Ye.current;q&&Xe&&q.scrollHeight-q.scrollTop<=q.clientHeight+100&&setTimeout(()=>ri(Ye),100)}},[c.length,i,Xe]),R.useEffect(()=>{const q=document.querySelector('meta[name="viewport"]'),pe=q==null?void 0:q.content;if(we){let J=q;const Re=window.matchMedia("(max-width: 768px)").matches;J?J.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no":(J=document.createElement("meta"),J.name="viewport",J.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no",document.head.appendChild(J)),Re&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="hidden");const Oe=J;return()=>{pe&&Oe&&(Oe.content=pe),Re&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}}return()=>{window.matchMedia("(max-width: 768px)").matches&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}},[we,t==null?void 0:t.mobileDisplayMode]),R.useEffect(()=>{i||setTimeout(()=>ri(Ye),100)},[c.length,i]),R.useEffect(()=>{I!=null&&I.itemCount&&I.itemCount===0&&!i&&setTimeout(()=>ri(Ye),100)},[I==null?void 0:I.itemCount,i]),R.useEffect(()=>{a&&sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),a)},[a,e]);const Je=R.useRef(Date.now()),yt=R.useRef(0),Yn=R.useRef(window.location.pathname),pr=R.useRef(S),Wn=R.useRef(!1),Pn=ja("acquisition_agent");R.useEffect(()=>{pr.current=S},[S]);const Fr=R.useCallback(async()=>{const q=Date.now();if(q-Je.current>=6e3&&q-yt.current>=6e4&&!Wn.current)try{Wn.current=!0,console.log("fetching acquisition data");const Re=await fetch(`${Zn}/api/wordpress/acquisition`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:new Date().toISOString(),page_information:window.location.href.split("?")[0],botid:e})});if(Re.ok){const Oe=await Re.json(),ct=[...pr.current.filter(Pt=>Pt.path!==Yn.current),{question:Oe.Popup_Message,answer:"",path:Yn.current,nameSpace:e,type:"dynamic",Follow_up_Question:Oe.Follow_up_Question}];x(ct)}yt.current=q}catch(Re){console.error("Error fetching acquisition data:",Re)}finally{Wn.current=!1}},[e]);R.useEffect(()=>{if(!Pn||(t==null?void 0:t.show_bot)===!1)return;const q=()=>{Je.current=Date.now()};document.addEventListener("mousemove",q),document.addEventListener("mousedown",q),document.addEventListener("keypress",q),document.addEventListener("scroll",q),document.addEventListener("touchstart",q),document.addEventListener("touchmove",q);const pe=setInterval(Fr,1e3),J=()=>{const Oe=window.location.pathname.split("?")[0],De=Yn.current.split("?")[0];(()=>{const Pt=De.split("/").filter(Boolean),Ur=Oe.split("/").filter(Boolean);return Pt.length!==Ur.length?!0:Pt.length===0&&Ur.length===0?!1:Oe!==De})()&&(Yn.current=Oe,Je.current=Date.now())};return window.addEventListener("popstate",J),()=>{document.removeEventListener("mousemove",q),document.removeEventListener("mousedown",q),document.removeEventListener("keypress",q),document.removeEventListener("scroll",q),document.removeEventListener("touchstart",q),document.removeEventListener("touchmove",q),window.removeEventListener("popstate",J),clearInterval(pe)}},[Pn,Fr,t==null?void 0:t.show_bot]);const[pi,oi]=R.useState(!1),[Ar,zr]=R.useState(!1),[no,ai]=R.useState(null),gr=async q=>{const pe=an();if(tt(!1),q&&c.length>1)try{(await fetch(`${Zn}/api/wordpress/userRating`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:pe,userRating:q,nameSpace:e})})).ok||console.error("Error submitting rating")}catch(J){console.error("Error submitting rating:",J)}setTimeout(()=>{zr(!1),He(!1,"close_button_clicked")},1e3)},Cn=q=>{p(!0),N.forEach(J=>{$(J.id,J.quantity)}),window.DebalesChat.track(mt.ADD_BULK_ITEM,{products:N,message:q});const pe=[...c,{text:"🎉 Bulk items added to cart successfully.",leading_queries:["Get GST Invoice for the order","Explore more products"],conversationId:q,isBot:!0}];h(pe),m(pe),u(q),F([]),p(!1)},Jt=()=>{var q;switch(e){case"minature":case"bodytales":case"imemyselfcare-com":if(window.triggerGokwikCustomCheckout)return window.triggerGokwikCustomCheckout(),!0;break;case"athflex":if((q=window.shiprocketCheckoutEvents)!=null&&q.buyCart)return window.shiprocketCheckoutEvents.buyCart(),!0;break;case"www":if(window.openRzpCheckout)return window.openRzpCheckout(),!0;break;default:return window.location.href=B((t==null?void 0:t.shopifyShopDomain)??""),!1}return window.location.href=B((t==null?void 0:t.shopifyShopDomain)??""),!1},Un=async q=>{q.preventDefault(),window.DebalesChat.track(mt.CHECKOUT_CLICKED,{chatId:an()+e,cartValue:Number(I==null?void 0:I.total),cart:I}),U({dbls_method:"checkout_clicked"}),Jt()&&He(!1,"checkout_clicked")},[Kn,en]=R.useState([]);R.useEffect(()=>{const q=Zg(S);en(pe=>{const J=q.filter(Re=>!pe.some(Oe=>Oe.question===Re.question));return[...pe,...J]})},[S]);const tn=R.useMemo(()=>Kn.map(q=>({...q,isClicked:ot.has(q.question)})),[Kn,ot]);console.log(Kn),R.useEffect(()=>{const q=Re=>{const Oe=Re.detail.formId;switch(Re.detail.type){case"open":case"embedOpen":setTimeout(()=>{const ct=pe(Oe);ct&&lt(ct)},800);break;case"close":Ze&&(t==null?void 0:t.KlaviyoFormIntegration)===!0&&setTimeout(()=>{He(!0,"klaviyo_form_closed"),je(Oe),r(Ze,void 0,void 0,!0)},1e4);break}},pe=Re=>{const Oe=document.querySelector(`[data-testid="klaviyo-form-${Re}"]`);if(console.log(`formElement text ${Re} =>`,Oe==null?void 0:Oe.innerText,Oe==null?void 0:Oe.textContent),Oe instanceof HTMLElement){const De=Oe.innerText||Oe.textContent;if(De)return console.log("Found form text:",De),`=> Klaviyo form content:
4003
+ `,$ne=({botId:e})=>{var bt,ee;const{uiData:t,storeMetaData:n,onSendMessage:r,isKlaviyoMessage:i,isLoading:o,lastedBotmessageId:a,setLastedBotmessageId:u,messages:c,isMessageLoading:d,setIsMessageLoading:p,setMessages:h,saveConversation:m,changeDisplayModel:v,loadConversation:_,suggestedQuestions:S,setSuggestedQuestions:x,showUserInfoModel:b,setShowUserInfoModel:C,isUserInfoNeeded:k,setPendingQuestion:A}=Fu(),{cart:I,addToCart:$,generateCartUrl:B,addCartAttributes:U}=Jf(),G=Ys("use-chatbot-icon-size"),P=hs.detect(),K=t==null?void 0:t.isLeft,re=lm(),ue=t==null?void 0:t.heightOption,ie=Ys("new-suggested-question-design"),[V,Q]=R.useState(!1),[ye,Te]=R.useState(!1),[T,X]=R.useState(!1);R.useEffect(()=>{if(!ie)return;const q=setTimeout(()=>{Q(!0);const pe=setTimeout(()=>{X(!0),Te(!0);const J=setTimeout(()=>{X(!1),Q(!1),Te(!1);const Re=setTimeout(()=>{X(!0),Q(!0),Te(!0)},ie.hide_timing||4e3);return()=>clearTimeout(Re)},ie.show_for||44324);return()=>clearTimeout(J)},ie.showing_delay||2e3);return()=>clearTimeout(pe)},ie.showing_delay||2e3);return()=>clearTimeout(q)},[ie]);const[ve,L]=R.useState(!1);R.useEffect(()=>{const q=()=>{L(window.matchMedia("(max-width: 768px)").matches)};return q(),window.addEventListener("resize",q),()=>window.removeEventListener("resize",q)},[]);const[we,Ue]=R.useState(!1),[de,tt]=R.useState(!1),[Ze,lt]=R.useState(""),[gt,je]=R.useState(""),[,Se]=R.useState(0);R.useEffect(()=>{e&&im(e)},[e]),R.useEffect(()=>{Yg(e)},[e]),R.useEffect(()=>{let q=Nr();if(!q&&window.Thinkific){const pe=window.Thinkific.current_user;pe&&(q={name:pe.full_name,email:pe.email},ua(q))}Bo.init({projectName:e,debug:!1,testing:Xf}),q&&q.email&&(window.DebalesChat.identify(q.email,{name:q.name,phone:q.phone,email:q.email}),t!=null&&t.KlaviyoIntegration&&window.klaviyo&&window.klaviyo.identify({email:q.email,first_name:q.name,phone:q.phone,from:"Debales-Chatbot"}))},[e,t==null?void 0:t.KlaviyoIntegration]);const Ye=R.useRef(null),Qe=qt(jt.CLICKED_QUESTIONS,{botId:e}),[ot,et]=R.useState(()=>{try{const q=sessionStorage.getItem(Qe);return q?new Set(JSON.parse(q)):new Set}catch{return new Set}});R.useEffect(()=>{try{sessionStorage.setItem(Qe,JSON.stringify(Array.from(ot)))}catch(q){console.error("Failed to save to sessionStorage:",q)}},[ot]);const He=R.useCallback((q,pe)=>{q?(window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:q,source:pe,projectId:e}})),setTimeout(()=>{tt(!0)},50)):(tt(!1),window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:q,source:pe,projectId:e}})))},[]);R.useEffect(()=>{const q=pe=>{Ue(pe.detail.isOpen),pe.detail.isOpen&&setTimeout(()=>tt(!0),50),window.DebalesChat.isOpen=pe.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:pe.detail.isOpen,source:pe.detail.source})};return window.addEventListener(hn.OPEN_STATE_CHANGE,q),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,q)}},[]),R.useEffect(()=>{const q=pe=>{Ue(pe.detail.isOpen),window.DebalesChat.isOpen=pe.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:pe.detail.isOpen})};return window.addEventListener(hn.OPEN_STATE_CHANGE,q),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,q)}},[]);const[N,F]=R.useState(()=>{const q=qt(jt.PENDING_BULK_ITEMS,{botId:e}),pe=sessionStorage.getItem(q);return pe?JSON.parse(pe):[]});R.useEffect(()=>{const q=qt(jt.PENDING_BULK_ITEMS,{botId:e});sessionStorage.setItem(q,JSON.stringify(N))},[N,e]);const[Y,ge]=R.useState(!1),[_e,Ie]=R.useState({name:"",email:"",message:""}),We=ja("exit_model"),[nt,ne]=R.useState({text:!0,leadingQueries:!0,collections:!0,products:!0,variants:!0,cartSummary:!0,bulkItems:!0}),[me,qe]=R.useState(!1),[Xe,at]=R.useState(!0),[Tt,Bt]=R.useState(!1),[Et,Yt]=R.useState(!1),ft=500,wt=R.useCallback(q=>{const pe=q.target,J=pe.scrollHeight-pe.scrollTop<=pe.clientHeight+0;at(J)},[]);R.useEffect(()=>{var q,pe,J,Re,Oe,De;if(c.length>0&&!d){const ct=c[c.length-1],Pt=sessionStorage.getItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e})),Ur=ct.isBot&&ct.conversationId===a&&ct.conversationId!==Pt,jr=(I==null?void 0:I.itemCount)&&(I==null?void 0:I.itemCount)>0&&ct.conversationId===a;if(Ur){qe(!0),sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),ct.conversationId||""),ne({text:!0,leadingQueries:!1,collections:!1,products:!1,variants:!1,cartSummary:!1,bulkItems:!1});const Ir=1600;let mi=Ir;const ma=[{type:"collections",condition:((q=ct.collections)==null?void 0:q.length)&&((pe=ct.collections)==null?void 0:pe.length)>0},{type:"products",condition:((J=ct.products)==null?void 0:J.length)&&((Re=ct.products)==null?void 0:Re.length)>0},{type:"leadingQueries",condition:((Oe=ct.leading_queries)==null?void 0:Oe.length)&&((De=ct.leading_queries)==null?void 0:De.length)>0},{type:"cartSummary",condition:(I==null?void 0:I.itemCount)&&(I==null?void 0:I.itemCount)>0},{type:"bulkItems",condition:(N==null?void 0:N.length)>0}].filter(gs=>gs.condition);if(ma.length===0){qe(!1);return}ma.forEach(({type:gs},mr)=>{setTimeout(()=>{if(ne(va=>({...va,[gs]:!0})),Xe&&Ye.current){const va=Ye.current;va.scrollHeight-va.scrollTop<=va.clientHeight&&ri(Ye)}mr===ma.length-1&&qe(!1)},mi),mi+=Ir})}else jr&&ne(Ir=>({...Ir,cartSummary:!0}))}},[c,d,a,I==null?void 0:I.itemCount,N==null?void 0:N.length,Xe,e]),R.useEffect(()=>{if(!i&&c.length>0){const q=Ye.current;q&&Xe&&q.scrollHeight-q.scrollTop<=q.clientHeight+100&&setTimeout(()=>ri(Ye),100)}},[c.length,i,Xe]),R.useEffect(()=>{const q=document.querySelector('meta[name="viewport"]'),pe=q==null?void 0:q.content;if(we){let J=q;const Re=window.matchMedia("(max-width: 768px)").matches;J?J.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no":(J=document.createElement("meta"),J.name="viewport",J.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no",document.head.appendChild(J)),Re&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="hidden");const Oe=J;return()=>{pe&&Oe&&(Oe.content=pe),Re&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}}return()=>{window.matchMedia("(max-width: 768px)").matches&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}},[we,t==null?void 0:t.mobileDisplayMode]),R.useEffect(()=>{i||setTimeout(()=>ri(Ye),100)},[c.length,i]),R.useEffect(()=>{I!=null&&I.itemCount&&I.itemCount===0&&!i&&setTimeout(()=>ri(Ye),100)},[I==null?void 0:I.itemCount,i]),R.useEffect(()=>{a&&sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),a)},[a,e]);const Je=R.useRef(Date.now()),yt=R.useRef(0),Yn=R.useRef(window.location.pathname),pr=R.useRef(S),Wn=R.useRef(!1),Pn=ja("acquisition_agent");R.useEffect(()=>{pr.current=S},[S]);const Fr=R.useCallback(async()=>{const q=Date.now();if(q-Je.current>=6e3&&q-yt.current>=6e4&&!Wn.current)try{Wn.current=!0,console.log("fetching acquisition data");const Re=await fetch(`${Zn}/api/wordpress/acquisition`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:new Date().toISOString(),page_information:window.location.href.split("?")[0],botid:e})});if(Re.ok){const Oe=await Re.json(),ct=[...pr.current.filter(Pt=>Pt.path!==Yn.current),{question:Oe.Popup_Message,answer:"",path:Yn.current,nameSpace:e,type:"dynamic",Follow_up_Question:Oe.Follow_up_Question}];x(ct)}yt.current=q}catch(Re){console.error("Error fetching acquisition data:",Re)}finally{Wn.current=!1}},[e]);R.useEffect(()=>{if(!Pn||(t==null?void 0:t.show_bot)===!1)return;const q=()=>{Je.current=Date.now()};document.addEventListener("mousemove",q),document.addEventListener("mousedown",q),document.addEventListener("keypress",q),document.addEventListener("scroll",q),document.addEventListener("touchstart",q),document.addEventListener("touchmove",q);const pe=setInterval(Fr,1e3),J=()=>{const Oe=window.location.pathname.split("?")[0],De=Yn.current.split("?")[0];(()=>{const Pt=De.split("/").filter(Boolean),Ur=Oe.split("/").filter(Boolean);return Pt.length!==Ur.length?!0:Pt.length===0&&Ur.length===0?!1:Oe!==De})()&&(Yn.current=Oe,Je.current=Date.now())};return window.addEventListener("popstate",J),()=>{document.removeEventListener("mousemove",q),document.removeEventListener("mousedown",q),document.removeEventListener("keypress",q),document.removeEventListener("scroll",q),document.removeEventListener("touchstart",q),document.removeEventListener("touchmove",q),window.removeEventListener("popstate",J),clearInterval(pe)}},[Pn,Fr,t==null?void 0:t.show_bot]);const[pi,oi]=R.useState(!1),[Ar,zr]=R.useState(!1),[no,ai]=R.useState(null),gr=async q=>{const pe=an();if(tt(!1),q&&c.length>1)try{(await fetch(`${Zn}/api/wordpress/userRating`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:pe,userRating:q,nameSpace:e})})).ok||console.error("Error submitting rating")}catch(J){console.error("Error submitting rating:",J)}setTimeout(()=>{zr(!1),He(!1,"close_button_clicked")},1e3)},Cn=q=>{p(!0),N.forEach(J=>{$(J.id,J.quantity)}),window.DebalesChat.track(mt.ADD_BULK_ITEM,{products:N,message:q});const pe=[...c,{text:"🎉 Bulk items added to cart successfully.",leading_queries:["Get GST Invoice for the order","Explore more products"],conversationId:q,isBot:!0}];h(pe),m(pe),u(q),F([]),p(!1)},Jt=()=>{var q;switch(e){case"minature":case"bodytales":case"imemyselfcare-com":if(window.triggerGokwikCustomCheckout)return window.triggerGokwikCustomCheckout(),!0;break;case"athflex":if((q=window.shiprocketCheckoutEvents)!=null&&q.buyCart)return window.shiprocketCheckoutEvents.buyCart(),!0;break;case"www":if(window.openRzpCheckout)return window.openRzpCheckout(),!0;break;default:return window.location.href=B((t==null?void 0:t.shopifyShopDomain)??""),!1}return window.location.href=B((t==null?void 0:t.shopifyShopDomain)??""),!1},Un=async q=>{q.preventDefault(),window.DebalesChat.track(mt.CHECKOUT_CLICKED,{chatId:an()+e,cartValue:Number(I==null?void 0:I.total),cart:I}),U({dbls_method:"checkout_clicked"}),Jt()&&He(!1,"checkout_clicked")},[Kn,en]=R.useState([]);R.useEffect(()=>{const q=Zg(S);en(pe=>{const J=q.filter(Re=>!pe.some(Oe=>Oe.question===Re.question));return[...pe,...J]})},[S]);const tn=R.useMemo(()=>Kn.map(q=>({...q,isClicked:ot.has(q.question)})),[Kn,ot]);console.log(Kn),R.useEffect(()=>{const q=Re=>{const Oe=Re.detail.formId;switch(Re.detail.type){case"open":case"embedOpen":setTimeout(()=>{const ct=pe(Oe);ct&&lt(ct)},800);break;case"close":Ze&&(t==null?void 0:t.KlaviyoFormIntegration)===!0&&setTimeout(()=>{He(!0,"klaviyo_form_closed"),je(Oe),r(Ze,void 0,void 0,!0)},1e4);break}},pe=Re=>{const Oe=document.querySelector(`[data-testid="klaviyo-form-${Re}"]`);if(console.log(`formElement text ${Re} =>`,Oe==null?void 0:Oe.innerText,Oe==null?void 0:Oe.textContent),Oe instanceof HTMLElement){const De=Oe.innerText||Oe.textContent;if(De)return console.log("Found form text:",De),`=> Klaviyo form content:
4004
4004
 
4005
4005
  `+De+`
4006
4006
 
@@ -4850,8 +4850,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
4850
4850
  margin-top: 16px;
4851
4851
  display: flex;
4852
4852
  justify-content: flex-end;
4853
- `,gre=({botId:e})=>{var ut,bt;const{uiData:t,storeMetaData:n,onSendMessage:r,isKlaviyoMessage:i,isLoading:o,lastedBotmessageId:a,setLastedBotmessageId:u,messages:c,isMessageLoading:d,setIsMessageLoading:p,setMessages:h,saveConversation:m,changeDisplayModel:v,loadConversation:_,suggestedQuestions:S,setSuggestedQuestions:x,showUserInfoModel:b,setShowUserInfoModel:C,isUserInfoNeeded:k,setPendingQuestion:A}=Fu(),{cart:I,addToCart:$,generateCartUrl:B,addCartAttributes:U}=Jf(),G=Ys("use-chatbot-icon-size"),P=hs.detect(),K=lm(),re=t==null?void 0:t.heightOption,Z=Ys("new-suggested-question-design"),[ie,V]=R.useState(!1),[Q,ye]=R.useState(!1),[Te,T]=R.useState(!1);R.useEffect(()=>{if(!Z)return;const ee=setTimeout(()=>{V(!0);const q=setTimeout(()=>{T(!0),ye(!0);const pe=setTimeout(()=>{T(!1),V(!1),ye(!1);const J=setTimeout(()=>{T(!0),V(!0),ye(!0)},Z.hide_timing||4e3);return()=>clearTimeout(J)},Z.show_for||44324);return()=>clearTimeout(pe)},Z.showing_delay||2e3);return()=>clearTimeout(q)},Z.showing_delay||2e3);return()=>clearTimeout(ee)},[Z]);const[X,ve]=R.useState(!1);R.useEffect(()=>{const ee=()=>{ve(window.matchMedia("(max-width: 768px)").matches)};return ee(),window.addEventListener("resize",ee),()=>window.removeEventListener("resize",ee)},[]);const[L,we]=R.useState(!1),[Ue,de]=R.useState(!1),[tt,Ze]=R.useState(""),[lt,gt]=R.useState(""),[,je]=R.useState(0);R.useEffect(()=>{e&&im(e)},[e]),R.useEffect(()=>{Yg(e)},[e]),R.useEffect(()=>{let ee=Nr();if(!ee&&window.Thinkific){const q=window.Thinkific.current_user;q&&(ee={name:q.full_name,email:q.email},ua(ee))}Bo.init({projectName:e,debug:!0,testing:Xf}),ee&&ee.email&&(window.DebalesChat.identify(ee.email,{name:ee.name,phone:ee.phone,email:ee.email}),t!=null&&t.KlaviyoIntegration&&window.klaviyo&&window.klaviyo.identify({email:ee.email,first_name:ee.name,phone:ee.phone,from:"Debales-Chatbot"}))},[e,t==null?void 0:t.KlaviyoIntegration]);const Se=R.useRef(null),Ye=qt(jt.CLICKED_QUESTIONS,{botId:e}),[Qe,ot]=R.useState(()=>{try{const ee=sessionStorage.getItem(Ye);return ee?new Set(JSON.parse(ee)):new Set}catch{return new Set}});R.useEffect(()=>{try{sessionStorage.setItem(Ye,JSON.stringify(Array.from(Qe)))}catch(ee){console.error("Failed to save to sessionStorage:",ee)}},[Qe]);const et=R.useCallback((ee,q)=>{ee?(window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:ee,source:q,projectId:e}})),setTimeout(()=>{de(!0)},50)):(de(!1),window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:ee,source:q,projectId:e}})))},[]);R.useEffect(()=>{const ee=q=>{we(q.detail.isOpen),q.detail.isOpen&&setTimeout(()=>de(!0),50),window.DebalesChat.isOpen=q.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:q.detail.isOpen,source:q.detail.source})};return window.addEventListener(hn.OPEN_STATE_CHANGE,ee),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,ee)}},[]),R.useEffect(()=>{const ee=q=>{we(q.detail.isOpen),window.DebalesChat.isOpen=q.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:q.detail.isOpen})};return window.addEventListener(hn.OPEN_STATE_CHANGE,ee),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,ee)}},[]);const[He,N]=R.useState(()=>{const ee=qt(jt.PENDING_BULK_ITEMS,{botId:e}),q=sessionStorage.getItem(ee);return q?JSON.parse(q):[]});R.useEffect(()=>{const ee=qt(jt.PENDING_BULK_ITEMS,{botId:e});sessionStorage.setItem(ee,JSON.stringify(He))},[He,e]);const[F,Y]=R.useState(!1),[ge,_e]=R.useState({name:"",email:"",message:""}),Ie=ja("exit_model"),[We,nt]=R.useState({text:!0,leadingQueries:!0,collections:!0,products:!0,variants:!0,cartSummary:!0,bulkItems:!0}),[ne,me]=R.useState(!1),[qe,Xe]=R.useState(!0),[at,Tt]=R.useState(!1),[Bt,Et]=R.useState(!1),Yt=500,ft=R.useCallback(ee=>{const q=ee.target,pe=q.scrollHeight-q.scrollTop<=q.clientHeight+0;Xe(pe)},[]);R.useEffect(()=>{var ee,q,pe,J,Re,Oe;if(c.length>0&&!d){const De=c[c.length-1],ct=sessionStorage.getItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e})),Pt=De.isBot&&De.conversationId===a&&De.conversationId!==ct,Ur=(I==null?void 0:I.itemCount)&&(I==null?void 0:I.itemCount)>0&&De.conversationId===a;if(Pt){me(!0),sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),De.conversationId||""),nt({text:!0,leadingQueries:!1,collections:!1,products:!1,variants:!1,cartSummary:!1,bulkItems:!1});const jr=1600;let Ir=jr;const mi=[{type:"collections",condition:((ee=De.collections)==null?void 0:ee.length)&&((q=De.collections)==null?void 0:q.length)>0},{type:"products",condition:((pe=De.products)==null?void 0:pe.length)&&((J=De.products)==null?void 0:J.length)>0},{type:"leadingQueries",condition:((Re=De.leading_queries)==null?void 0:Re.length)&&((Oe=De.leading_queries)==null?void 0:Oe.length)>0},{type:"cartSummary",condition:(I==null?void 0:I.itemCount)&&(I==null?void 0:I.itemCount)>0},{type:"bulkItems",condition:(He==null?void 0:He.length)>0}].filter(ma=>ma.condition);if(mi.length===0){me(!1);return}mi.forEach(({type:ma},gs)=>{setTimeout(()=>{if(nt(mr=>({...mr,[ma]:!0})),qe&&Se.current){const mr=Se.current;mr.scrollHeight-mr.scrollTop<=mr.clientHeight&&ri(Se)}gs===mi.length-1&&me(!1)},Ir),Ir+=jr})}else Ur&&nt(jr=>({...jr,cartSummary:!0}))}},[c,d,a,I==null?void 0:I.itemCount,He==null?void 0:He.length,qe,e]),R.useEffect(()=>{if(!i&&c.length>0){const ee=Se.current;ee&&qe&&ee.scrollHeight-ee.scrollTop<=ee.clientHeight+100&&setTimeout(()=>ri(Se),100)}},[c.length,i,qe]),R.useEffect(()=>{const ee=document.querySelector('meta[name="viewport"]'),q=ee==null?void 0:ee.content;if(L){let pe=ee;const J=window.matchMedia("(max-width: 768px)").matches;pe?pe.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no":(pe=document.createElement("meta"),pe.name="viewport",pe.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no",document.head.appendChild(pe)),J&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="hidden");const Re=pe;return()=>{q&&Re&&(Re.content=q),J&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}}return()=>{window.matchMedia("(max-width: 768px)").matches&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}},[L,t==null?void 0:t.mobileDisplayMode]),R.useEffect(()=>{i||setTimeout(()=>ri(Se),100)},[c.length,i]),R.useEffect(()=>{I!=null&&I.itemCount&&I.itemCount===0&&!i&&setTimeout(()=>ri(Se),100)},[I==null?void 0:I.itemCount,i]),R.useEffect(()=>{a&&sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),a)},[a,e]);const wt=R.useRef(Date.now()),Je=R.useRef(0),yt=R.useRef(window.location.pathname),Yn=R.useRef(S),pr=R.useRef(!1),Wn=ja("acquisition_agent");R.useEffect(()=>{Yn.current=S},[S]);const Pn=R.useCallback(async()=>{const ee=Date.now();if(ee-wt.current>=6e3&&ee-Je.current>=6e4&&!pr.current)try{pr.current=!0,console.log("fetching acquisition data");const J=await fetch(`${Zn}/api/wordpress/acquisition`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:new Date().toISOString(),page_information:window.location.href.split("?")[0],botid:e})});if(J.ok){const Re=await J.json(),De=[...Yn.current.filter(ct=>ct.path!==yt.current),{question:Re.Popup_Message,answer:"",path:yt.current,nameSpace:e,type:"dynamic",Follow_up_Question:Re.Follow_up_Question}];x(De)}Je.current=ee}catch(J){console.error("Error fetching acquisition data:",J)}finally{pr.current=!1}},[e]);R.useEffect(()=>{if(!Wn||(t==null?void 0:t.show_bot)===!1)return;const ee=()=>{wt.current=Date.now()};document.addEventListener("mousemove",ee),document.addEventListener("mousedown",ee),document.addEventListener("keypress",ee),document.addEventListener("scroll",ee),document.addEventListener("touchstart",ee),document.addEventListener("touchmove",ee);const q=setInterval(Pn,1e3),pe=()=>{const Re=window.location.pathname.split("?")[0],Oe=yt.current.split("?")[0];(()=>{const ct=Oe.split("/").filter(Boolean),Pt=Re.split("/").filter(Boolean);return ct.length!==Pt.length?!0:ct.length===0&&Pt.length===0?!1:Re!==Oe})()&&(yt.current=Re,wt.current=Date.now())};return window.addEventListener("popstate",pe),()=>{document.removeEventListener("mousemove",ee),document.removeEventListener("mousedown",ee),document.removeEventListener("keypress",ee),document.removeEventListener("scroll",ee),document.removeEventListener("touchstart",ee),document.removeEventListener("touchmove",ee),window.removeEventListener("popstate",pe),clearInterval(q)}},[Wn,Pn,t==null?void 0:t.show_bot]);const[Fr,pi]=R.useState(!1),[oi,Ar]=R.useState(!1),[zr,no]=R.useState(null),ai=async ee=>{const q=an();if(de(!1),ee&&c.length>1)try{(await fetch(`${Zn}/api/wordpress/userRating`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:q,userRating:ee,nameSpace:e})})).ok||console.error("Error submitting rating")}catch(pe){console.error("Error submitting rating:",pe)}setTimeout(()=>{Ar(!1),et(!1,"close_button_clicked")},1e3)},gr=ee=>{p(!0),He.forEach(pe=>{$(pe.id,pe.quantity)}),window.DebalesChat.track(mt.ADD_BULK_ITEM,{products:He,message:ee});const q=[...c,{text:"🎉 Bulk items added to cart successfully.",leading_queries:["Get GST Invoice for the order","Explore more products"],conversationId:ee,isBot:!0}];h(q),m(q),u(ee),N([]),p(!1)},Cn=()=>{var ee;switch(e){case"minature":case"bodytales":case"imemyselfcare-com":if(window.triggerGokwikCustomCheckout)return window.triggerGokwikCustomCheckout(),!0;break;case"athflex":if((ee=window.shiprocketCheckoutEvents)!=null&&ee.buyCart)return window.shiprocketCheckoutEvents.buyCart(),!0;break;case"www":if(window.openRzpCheckout)return window.openRzpCheckout(),!0;break;default:return window.location.href=B((t==null?void 0:t.shopifyShopDomain)??""),!1}return window.location.href=B((t==null?void 0:t.shopifyShopDomain)??""),!1},Jt=async ee=>{ee.preventDefault(),window.DebalesChat.track(mt.CHECKOUT_CLICKED,{chatId:an()+e,cartValue:Number(I==null?void 0:I.total),cart:I}),U({dbls_method:"checkout_clicked"}),Cn()&&et(!1,"checkout_clicked")},[Un,Kn]=R.useState([]);R.useEffect(()=>{const ee=Zg(S);Kn(q=>{const pe=ee.filter(J=>!q.some(Re=>Re.question===J.question));return[...q,...pe]})},[S]);const en=R.useMemo(()=>Un.map(ee=>({...ee,isClicked:Qe.has(ee.question)})),[Un,Qe]);console.log(Un),R.useEffect(()=>{const ee=J=>{const Re=J.detail.formId;switch(J.detail.type){case"open":case"embedOpen":setTimeout(()=>{const De=q(Re);De&&Ze(De)},800);break;case"close":tt&&(t==null?void 0:t.KlaviyoFormIntegration)===!0&&setTimeout(()=>{et(!0,"klaviyo_form_closed"),gt(Re),r(tt,void 0,void 0,!0)},1e4);break}},q=J=>{const Re=document.querySelector(`[data-testid="klaviyo-form-${J}"]`);if(console.log(`formElement text ${J} =>`,Re==null?void 0:Re.innerText,Re==null?void 0:Re.textContent),Re instanceof HTMLElement){const Oe=Re.innerText||Re.textContent;if(Oe)return console.log("Found form text:",Oe),`=> Klaviyo form content:
4853
+ `,gre=({botId:e})=>{var ut,bt;const{uiData:t,storeMetaData:n,onSendMessage:r,isKlaviyoMessage:i,isLoading:o,lastedBotmessageId:a,setLastedBotmessageId:u,messages:c,isMessageLoading:d,setIsMessageLoading:p,setMessages:h,saveConversation:m,changeDisplayModel:v,loadConversation:_,suggestedQuestions:S,setSuggestedQuestions:x,showUserInfoModel:b,setShowUserInfoModel:C,isUserInfoNeeded:k,setPendingQuestion:A}=Fu(),{cart:I,addToCart:$,generateCartUrl:B,addCartAttributes:U}=Jf(),G=Ys("use-chatbot-icon-size"),P=hs.detect(),K=lm(),re=t==null?void 0:t.heightOption,Z=Ys("new-suggested-question-design"),[ie,V]=R.useState(!1),[Q,ye]=R.useState(!1),[Te,T]=R.useState(!1);R.useEffect(()=>{if(!Z)return;const ee=setTimeout(()=>{V(!0);const q=setTimeout(()=>{T(!0),ye(!0);const pe=setTimeout(()=>{T(!1),V(!1),ye(!1);const J=setTimeout(()=>{T(!0),V(!0),ye(!0)},Z.hide_timing||4e3);return()=>clearTimeout(J)},Z.show_for||44324);return()=>clearTimeout(pe)},Z.showing_delay||2e3);return()=>clearTimeout(q)},Z.showing_delay||2e3);return()=>clearTimeout(ee)},[Z]);const[X,ve]=R.useState(!1);R.useEffect(()=>{const ee=()=>{ve(window.matchMedia("(max-width: 768px)").matches)};return ee(),window.addEventListener("resize",ee),()=>window.removeEventListener("resize",ee)},[]);const[L,we]=R.useState(!1),[Ue,de]=R.useState(!1),[tt,Ze]=R.useState(""),[lt,gt]=R.useState(""),[,je]=R.useState(0);R.useEffect(()=>{e&&im(e)},[e]),R.useEffect(()=>{Yg(e)},[e]),R.useEffect(()=>{let ee=Nr();if(!ee&&window.Thinkific){const q=window.Thinkific.current_user;q&&(ee={name:q.full_name,email:q.email},ua(ee))}Bo.init({projectName:e,debug:!1,testing:Xf}),ee&&ee.email&&(window.DebalesChat.identify(ee.email,{name:ee.name,phone:ee.phone,email:ee.email}),t!=null&&t.KlaviyoIntegration&&window.klaviyo&&window.klaviyo.identify({email:ee.email,first_name:ee.name,phone:ee.phone,from:"Debales-Chatbot"}))},[e,t==null?void 0:t.KlaviyoIntegration]);const Se=R.useRef(null),Ye=qt(jt.CLICKED_QUESTIONS,{botId:e}),[Qe,ot]=R.useState(()=>{try{const ee=sessionStorage.getItem(Ye);return ee?new Set(JSON.parse(ee)):new Set}catch{return new Set}});R.useEffect(()=>{try{sessionStorage.setItem(Ye,JSON.stringify(Array.from(Qe)))}catch(ee){console.error("Failed to save to sessionStorage:",ee)}},[Qe]);const et=R.useCallback((ee,q)=>{ee?(window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:ee,source:q,projectId:e}})),setTimeout(()=>{de(!0)},50)):(de(!1),window.dispatchEvent(new CustomEvent(hn.OPEN_STATE_CHANGE,{detail:{isOpen:ee,source:q,projectId:e}})))},[]);R.useEffect(()=>{const ee=q=>{we(q.detail.isOpen),q.detail.isOpen&&setTimeout(()=>de(!0),50),window.DebalesChat.isOpen=q.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:q.detail.isOpen,source:q.detail.source})};return window.addEventListener(hn.OPEN_STATE_CHANGE,ee),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,ee)}},[]),R.useEffect(()=>{const ee=q=>{we(q.detail.isOpen),window.DebalesChat.isOpen=q.detail.isOpen,window.DebalesChat.track(mt.OPEN_STATE_CHANGE,{isOpen:q.detail.isOpen})};return window.addEventListener(hn.OPEN_STATE_CHANGE,ee),()=>{window.removeEventListener(hn.OPEN_STATE_CHANGE,ee)}},[]);const[He,N]=R.useState(()=>{const ee=qt(jt.PENDING_BULK_ITEMS,{botId:e}),q=sessionStorage.getItem(ee);return q?JSON.parse(q):[]});R.useEffect(()=>{const ee=qt(jt.PENDING_BULK_ITEMS,{botId:e});sessionStorage.setItem(ee,JSON.stringify(He))},[He,e]);const[F,Y]=R.useState(!1),[ge,_e]=R.useState({name:"",email:"",message:""}),Ie=ja("exit_model"),[We,nt]=R.useState({text:!0,leadingQueries:!0,collections:!0,products:!0,variants:!0,cartSummary:!0,bulkItems:!0}),[ne,me]=R.useState(!1),[qe,Xe]=R.useState(!0),[at,Tt]=R.useState(!1),[Bt,Et]=R.useState(!1),Yt=500,ft=R.useCallback(ee=>{const q=ee.target,pe=q.scrollHeight-q.scrollTop<=q.clientHeight+0;Xe(pe)},[]);R.useEffect(()=>{var ee,q,pe,J,Re,Oe;if(c.length>0&&!d){const De=c[c.length-1],ct=sessionStorage.getItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e})),Pt=De.isBot&&De.conversationId===a&&De.conversationId!==ct,Ur=(I==null?void 0:I.itemCount)&&(I==null?void 0:I.itemCount)>0&&De.conversationId===a;if(Pt){me(!0),sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),De.conversationId||""),nt({text:!0,leadingQueries:!1,collections:!1,products:!1,variants:!1,cartSummary:!1,bulkItems:!1});const jr=1600;let Ir=jr;const mi=[{type:"collections",condition:((ee=De.collections)==null?void 0:ee.length)&&((q=De.collections)==null?void 0:q.length)>0},{type:"products",condition:((pe=De.products)==null?void 0:pe.length)&&((J=De.products)==null?void 0:J.length)>0},{type:"leadingQueries",condition:((Re=De.leading_queries)==null?void 0:Re.length)&&((Oe=De.leading_queries)==null?void 0:Oe.length)>0},{type:"cartSummary",condition:(I==null?void 0:I.itemCount)&&(I==null?void 0:I.itemCount)>0},{type:"bulkItems",condition:(He==null?void 0:He.length)>0}].filter(ma=>ma.condition);if(mi.length===0){me(!1);return}mi.forEach(({type:ma},gs)=>{setTimeout(()=>{if(nt(mr=>({...mr,[ma]:!0})),qe&&Se.current){const mr=Se.current;mr.scrollHeight-mr.scrollTop<=mr.clientHeight&&ri(Se)}gs===mi.length-1&&me(!1)},Ir),Ir+=jr})}else Ur&&nt(jr=>({...jr,cartSummary:!0}))}},[c,d,a,I==null?void 0:I.itemCount,He==null?void 0:He.length,qe,e]),R.useEffect(()=>{if(!i&&c.length>0){const ee=Se.current;ee&&qe&&ee.scrollHeight-ee.scrollTop<=ee.clientHeight+100&&setTimeout(()=>ri(Se),100)}},[c.length,i,qe]),R.useEffect(()=>{const ee=document.querySelector('meta[name="viewport"]'),q=ee==null?void 0:ee.content;if(L){let pe=ee;const J=window.matchMedia("(max-width: 768px)").matches;pe?pe.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no":(pe=document.createElement("meta"),pe.name="viewport",pe.content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no",document.head.appendChild(pe)),J&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="hidden");const Re=pe;return()=>{q&&Re&&(Re.content=q),J&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}}return()=>{window.matchMedia("(max-width: 768px)").matches&&(t==null?void 0:t.mobileDisplayMode)==="full-screen"&&(document.body.style.overflow="")}},[L,t==null?void 0:t.mobileDisplayMode]),R.useEffect(()=>{i||setTimeout(()=>ri(Se),100)},[c.length,i]),R.useEffect(()=>{I!=null&&I.itemCount&&I.itemCount===0&&!i&&setTimeout(()=>ri(Se),100)},[I==null?void 0:I.itemCount,i]),R.useEffect(()=>{a&&sessionStorage.setItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:e}),a)},[a,e]);const wt=R.useRef(Date.now()),Je=R.useRef(0),yt=R.useRef(window.location.pathname),Yn=R.useRef(S),pr=R.useRef(!1),Wn=ja("acquisition_agent");R.useEffect(()=>{Yn.current=S},[S]);const Pn=R.useCallback(async()=>{const ee=Date.now();if(ee-wt.current>=6e3&&ee-Je.current>=6e4&&!pr.current)try{pr.current=!0,console.log("fetching acquisition data");const J=await fetch(`${Zn}/api/wordpress/acquisition`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:new Date().toISOString(),page_information:window.location.href.split("?")[0],botid:e})});if(J.ok){const Re=await J.json(),De=[...Yn.current.filter(ct=>ct.path!==yt.current),{question:Re.Popup_Message,answer:"",path:yt.current,nameSpace:e,type:"dynamic",Follow_up_Question:Re.Follow_up_Question}];x(De)}Je.current=ee}catch(J){console.error("Error fetching acquisition data:",J)}finally{pr.current=!1}},[e]);R.useEffect(()=>{if(!Wn||(t==null?void 0:t.show_bot)===!1)return;const ee=()=>{wt.current=Date.now()};document.addEventListener("mousemove",ee),document.addEventListener("mousedown",ee),document.addEventListener("keypress",ee),document.addEventListener("scroll",ee),document.addEventListener("touchstart",ee),document.addEventListener("touchmove",ee);const q=setInterval(Pn,1e3),pe=()=>{const Re=window.location.pathname.split("?")[0],Oe=yt.current.split("?")[0];(()=>{const ct=Oe.split("/").filter(Boolean),Pt=Re.split("/").filter(Boolean);return ct.length!==Pt.length?!0:ct.length===0&&Pt.length===0?!1:Re!==Oe})()&&(yt.current=Re,wt.current=Date.now())};return window.addEventListener("popstate",pe),()=>{document.removeEventListener("mousemove",ee),document.removeEventListener("mousedown",ee),document.removeEventListener("keypress",ee),document.removeEventListener("scroll",ee),document.removeEventListener("touchstart",ee),document.removeEventListener("touchmove",ee),window.removeEventListener("popstate",pe),clearInterval(q)}},[Wn,Pn,t==null?void 0:t.show_bot]);const[Fr,pi]=R.useState(!1),[oi,Ar]=R.useState(!1),[zr,no]=R.useState(null),ai=async ee=>{const q=an();if(de(!1),ee&&c.length>1)try{(await fetch(`${Zn}/api/wordpress/userRating`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:q,userRating:ee,nameSpace:e})})).ok||console.error("Error submitting rating")}catch(pe){console.error("Error submitting rating:",pe)}setTimeout(()=>{Ar(!1),et(!1,"close_button_clicked")},1e3)},gr=ee=>{p(!0),He.forEach(pe=>{$(pe.id,pe.quantity)}),window.DebalesChat.track(mt.ADD_BULK_ITEM,{products:He,message:ee});const q=[...c,{text:"🎉 Bulk items added to cart successfully.",leading_queries:["Get GST Invoice for the order","Explore more products"],conversationId:ee,isBot:!0}];h(q),m(q),u(ee),N([]),p(!1)},Cn=()=>{var ee;switch(e){case"minature":case"bodytales":case"imemyselfcare-com":if(window.triggerGokwikCustomCheckout)return window.triggerGokwikCustomCheckout(),!0;break;case"athflex":if((ee=window.shiprocketCheckoutEvents)!=null&&ee.buyCart)return window.shiprocketCheckoutEvents.buyCart(),!0;break;case"www":if(window.openRzpCheckout)return window.openRzpCheckout(),!0;break;default:return window.location.href=B((t==null?void 0:t.shopifyShopDomain)??""),!1}return window.location.href=B((t==null?void 0:t.shopifyShopDomain)??""),!1},Jt=async ee=>{ee.preventDefault(),window.DebalesChat.track(mt.CHECKOUT_CLICKED,{chatId:an()+e,cartValue:Number(I==null?void 0:I.total),cart:I}),U({dbls_method:"checkout_clicked"}),Cn()&&et(!1,"checkout_clicked")},[Un,Kn]=R.useState([]);R.useEffect(()=>{const ee=Zg(S);Kn(q=>{const pe=ee.filter(J=>!q.some(Re=>Re.question===J.question));return[...q,...pe]})},[S]);const en=R.useMemo(()=>Un.map(ee=>({...ee,isClicked:Qe.has(ee.question)})),[Un,Qe]);console.log(Un),R.useEffect(()=>{const ee=J=>{const Re=J.detail.formId;switch(J.detail.type){case"open":case"embedOpen":setTimeout(()=>{const De=q(Re);De&&Ze(De)},800);break;case"close":tt&&(t==null?void 0:t.KlaviyoFormIntegration)===!0&&setTimeout(()=>{et(!0,"klaviyo_form_closed"),gt(Re),r(tt,void 0,void 0,!0)},1e4);break}},q=J=>{const Re=document.querySelector(`[data-testid="klaviyo-form-${J}"]`);if(console.log(`formElement text ${J} =>`,Re==null?void 0:Re.innerText,Re==null?void 0:Re.textContent),Re instanceof HTMLElement){const Oe=Re.innerText||Re.textContent;if(Oe)return console.log("Found form text:",Oe),`=> Klaviyo form content:
4854
4854
 
4855
4855
  `+Oe+`
4856
4856
 
4857
- => User Action: Klaviyo form closed`}return""},pe=J=>{J instanceof CustomEvent&&ee(J)};return window.addEventListener("klaviyoForms",pe),()=>{window.removeEventListener("klaviyoForms",pe)}},[tt,t,r]),R.useEffect(()=>{const ee=Se.current;return ee?(ee.addEventListener("scroll",ft),()=>ee.removeEventListener("scroll",ft)):()=>{}},[ft]);const[tn,gi]=R.useState(!1),Qn=re==="Highest"?"120px":re==="Higher"?"60px":"15px",xr=async()=>{try{const ee=await fetch(`${Zn}/api/wordpress/support`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({chatid:an()+e,nameSpace:e,userName:ge.name,userEmail:ge.email,userMessage:ge.message,tag:"support"})});if(ee.ok)h(q=>[...q,{text:"Thanks for reaching out! Our support team has received your request and will get back to you within 24 hours.<br>In the meantime, feel free to continue chatting with me - I'll do my best to help!",isBot:!0}]),console.log("Connected to support with existing user info:",Nr());else{const q=await ee.json();console.error("Failed to connect to support:",q),h(pe=>[...pe,{text:"Sorry, we couldn't connect you to support at the moment.<br>Please try again later.",isBot:!0}])}}catch{h(q=>[...q,{text:"Sorry, we couldn't connect you to support at the moment.<br>Please try again later.",isBot:!0}])}},ae=()=>{const ee=Nr();ee&&ee.name&&ee.email&&_e({name:ee==null?void 0:ee.name,email:ee==null?void 0:ee.email,message:""}),h(q=>[...q,{text:"Please provide your name, email and message to connect with support.",isBot:!0}]),Y(!0)},j=async ee=>{ee.preventDefault(),ua({name:ge.name,email:ge.email}),Y(!1),h(q=>q.slice(0,-1)),await xr()},[xe,Ne]=R.useState({});R.useEffect(()=>{Bt&&(c.forEach((ee,q)=>{if(!ee.isBot)return;const pe=ll(ee.text);if(!(q in xe)||xe[q]<pe.length){let J;const Re=Oe=>{Oe<pe.length&&(J=setTimeout(()=>{Ne(De=>({...De,[q]:Oe+1})),Re(Oe+1)},Yt))};return q in xe?Re(xe[q]):(Ne(Oe=>({...Oe,[q]:1})),Re(1)),()=>clearTimeout(J)}}),Ne(ee=>{const q={};return c.forEach((pe,J)=>{ee[J]!==void 0&&(q[J]=ee[J])}),q}))},[c,Bt]);const[he,Ce]=R.useState(0);return R.useEffect(()=>{if(en.length===0)return;const ee=setInterval(()=>{Ce(q=>(q+1)%en.length)},7e3);return()=>clearInterval(ee)},[en.length]),R.useEffect(()=>{Ce(0)},[en.length]),!t||t.show_bot===!1||o?null:E.jsxs(Op,{theme:Vg(t),children:[E.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),E.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),E.jsx("link",{href:"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap",rel:"stylesheet"}),E.jsx(sre,{}),E.jsxs(Fne,{$topOffset:Qn,children:[!L&&!Q&&E.jsxs(zne,{$topOffset:Qn,$removeLogoBackground:t.removeLogoBackground,children:[E.jsx(Une,{$showAnimation:t.enableChatButtonBackgroundAnimation??!1,$animationType:"Ping",$animationColor:t.chatButtonBackgroundAnimationColor||"#f48722",$backgroundColor:t.backgroundColor||"#fff",$removeLogoBackground:t.removeLogoBackground,$topOffset:Qn,$iconSize:G}),E.jsxs(jne,{$backgroundColor:t.removeLogoBackground?"transparent":t.backgroundColor||"#fff",$botId:e,$iconSize:G,$removeLogoBackground:t.removeLogoBackground,topOffset:Qn,$showAnimation:t.enableChatButtonBackgroundAnimation,$animationType:"Ping",$animationColor:t.chatButtonBackgroundAnimationColor||"#f48722",id:"debales-chat-button",onClick:()=>{if(window.DebalesChat.track(mt.CHAT_BUTTON_CLICKED),et(!L,"chat_button_clicked"),!L){const ee=_();ee.length>0?(h(ee),Tt(!1),Et(!0)):(Tt(!0),Et(!1),setTimeout(()=>{Tt(!1),Et(!0);const q={text:(t==null?void 0:t.initialMessage)||"Hi, I am an AI chatbot, how can I help you today?",isBot:!0};h([q])},(Z==null?void 0:Z.showing_delay)||2e3))}},"aria-label":"Chat",children:[E.jsx(qne,{$botId:e,$removeLogoBackground:t.removeLogoBackground,"aria-hidden":"true",src:t.bot_logo,alt:"Chat Bot Icon"}),(Un==null?void 0:Un.length)>0&&!L&&ie&&E.jsx("div",{style:{position:"absolute",top:"0",left:"100%",transform:"translate(-50%, -50%)",backgroundColor:"#f44336",color:"white",borderRadius:"50%",width:"20px",height:"20px",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"12px",fontWeight:"bold",zIndex:2,opacity:ie?1:0,transition:"opacity 0.3s ease-in-out"},children:Un.length})]})]}),!L&&(en==null?void 0:en.length)!==0&&Q&&E.jsx(ore,{className:Te?"visible":"",$botId:e,$iconSize:G,$removeLogoBackground:t.removeLogoBackground,topOffset:Qn,style:{display:"flex",flexDirection:"column",alignItems:"center",marginLeft:X?"60px":"85px",marginRight:X?"60px":"85px",opacity:Te?1:0,transition:"opacity 0.3s ease-in-out"},children:en.length>0&&E.jsx(are,{$index:he,$totalCount:en.length,children:E.jsx(Nne,{messages:[{question:en[he].question,isHighlighted:en[he].isHighlighted??!1}],botId:e,uiData:t,onClose:()=>{ot(ee=>{const q=new Set(ee);return q.add(en[he].question),q})},onClick:()=>{et(!0,"suggested_question_clicked"),ot(ee=>{const q=new Set(ee);return q.add(en[he].question),q}),window.DebalesChat.track(mt.SUGGESTED_QUESTION_CLICKED,{suggested_question:en[he]}),k?(C(!0),A(en[he])):r(en[he].Follow_up_Question??en[he].question,en[he].answer,en[he].products,!1,en[he].leading_queries)}})},he)})]}),L&&Kh.createPortal(E.jsx(E.Fragment,{children:E.jsxs(Wne,{$backgroundColor:t.backgroundColor||"#fff",$fullScreenOnMobile:t.fullScreenOnMobile,$headerFontColor:t.headerFontColor||"#1C1C1C",$topOffset:Qn,$mobileDisplayMode:t.mobileDisplayMode,$isVisible:Ue,children:[E.jsxs(Kne,{$backgroundColor:t.backgroundColor||"#fff",style:{color:t.headerFontColor},children:[E.jsxs("div",{style:{display:"flex",columnGap:"10px",flex:"1 1 0%",alignItems:"center"},children:[E.jsx(Hne,{"aria-hidden":"true",src:t.bot_logo,alt:"Chat Bot Icon"}),E.jsxs(Gne,{$botNameColor:t.headerFontColor,children:[E.jsxs("div",{style:{fontWeight:"700",wordBreak:"break-word"},children:[t.chatbotName,e==="catch-org-ai"&&E.jsx(Zne,{$backgroundColor:t.callToActionBackgroundColor,$fontColor:t.callToActionFontColor,children:"Beta"})]}),E.jsx(Vne,{children:E.jsx(hm,{})})]})]}),E.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[E.jsxs(lre,{children:[E.jsxs(ure,{onClick:ae,children:[E.jsx(pm,{color:t.headerFontColor}),E.jsx(cre,{children:"Support"})]}),E.jsx(s6,{children:"Need more help? I'll connect you with a support agent."})]}),(t.mobileDisplayMode==="half-screen"||t.mobileDisplayMode==="full-screen")&&X&&E.jsx("button",{onClick:()=>{const ee=t.mobileDisplayMode==="full-screen"?"half-screen":"full-screen";v(ee)},style:{background:"none",border:"none",cursor:"pointer",padding:"0",marginRight:"10px",display:"flex",alignItems:"center"},"aria-label":t.mobileDisplayMode==="full-screen"?"Switch to half screen":"Switch to full screen",children:t.mobileDisplayMode==="full-screen"?E.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:E.jsx("path",{d:"M4.5 15.75V13.5H2.25V12H6V15.75H4.5ZM12 15.75V12H15.75V13.5H13.5V15.75H12ZM2.25 6V4.5H4.5V2.25H6V6H2.25ZM12 6V2.25H13.5V4.5H15.75V6H12Z",fill:"black"})}):E.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:E.jsx("path",{d:"M10 3.75H16.25V10H14.5833V6.595L6.595 14.5833H10V16.25H3.75V10H5.41667V13.405L13.405 5.41667H10V3.75Z",fill:"black"})})}),E.jsx(Yne,{onClick:()=>{Ie?Ar(!0):et(!1,"close_button_clicked")},id:"debales-minimize-button","aria-label":"Minimize",children:E.jsx(zu,{botNameColor:t.headerFontColor})})]})]}),E.jsxs(Xne,{$backgroundColor:t.botBackgroundColor||"#fff",$mobileDisplayMode:t.mobileDisplayMode,children:[tn&&((bt=(ut=t.pluginConfig)==null?void 0:ut.collectedUserInfo)==null?void 0:bt.discount)&&E.jsx(mm,{discount:t.pluginConfig.collectedUserInfo.discount,uiData:t,onClose:()=>{gi(!1),window.DebalesChat.track(mt.DISCOUNT_VIEWED,{discount:t.pluginConfig.collectedUserInfo.discount})}}),E.jsx(f0,{uidata:t,product:zr,showModel:Fr,setShowModel:pi,onVariantSelect:ee=>{$(ee.id,1),window.DebalesChat.track(mt.ADD_TO_CART_CLICKED,{product:ee.title,price:Number(ee.price),link:`https://${t.shopifyShopDomain}/variants/${ee.id}`,message:a,chatId:an()+e})}}),oi&&E.jsx(ym,{setShowExitModal:Ar,handleCloseChatbot:ai,chatId:an()+e}),E.jsxs(Qne,{id:"debales-conversation-group",$botBackgroundColor:t.botBackgroundColor||"#fff",ref:Se,$mobileDisplayMode:t.mobileDisplayMode,children:[Bt&&c.map((ee,q)=>{const pe=ee.isBot,J=ll(ee.text);return ee.hideConfirmation?null:E.jsxs(R.Fragment,{children:[pe&&E.jsxs(i6,{$fontColor:t.botFontColor||"#000",$botMessageColor:t.botBackgroundColor||"#fff",children:[E.jsx("img",{src:pe?t.bot_logo:t.userMessage_logo,alt:"Chat User Icon"}),E.jsxs(a6,{children:[J.slice(0,xe[q]||0).map((Re,Oe)=>E.jsx("div",{children:E.jsx(wd,{$botMessageColor:pe?t.botMessageColor||"#fff":t.userMessageColor||"#fff",style:{color:t.botFontColor},children:E.jsx(Ga,{remarkPlugins:[fp,rm],children:Re})})},Oe)),ee.collections&&a===ee.conversationId&&We.collections&&E.jsx(gm,{message:ee,botId:e,uidata:t,onSendMessage:r,loading:d}),ee.products&&a===ee.conversationId&&We.products&&E.jsx(_m,{message:ee,botId:e,uidata:t,onSendMessage:r,loading:d,storeMetaData:n,platform:P,setShowVariantModel:pi,setSelectedProduct:no,setCartVersion:je}),i&&E.jsx(qw,{children:E.jsx(fd,{onClick:()=>{window._klOnsite&&(window._klOnsite.push(["openForm",lt]),et(!1,"klaviyo_grab_deal_button"))},children:"🚀 Grab Deal Now!"})}),c.length==1&&q==0&&!b&&E.jsx(qw,{children:Un.map((Re,Oe)=>E.jsx(o6,{style:{backgroundColor:t.callToActionBackgroundColor,color:t.callToActionFontColor,opacity:Qe.has(Re.question)?.5:1},onClick:()=>{k?(C(!0),A({question:Re.question,answer:Re.answer,products:Re.products,path:"/",nameSpace:window.DebalesChat.projectId})):r(Re.question,Re.answer,Re.products),ot(De=>{const ct=new Set(De);return ct.add(Re.question),ct}),window.DebalesChat.track(mt.INITIAL_LEADING_QUERY_SUGGESTED_QUESTION_CLICKED,{question:Re.question})},disabled:d,$disabled:d,children:Re.question},Oe))}),ee.leading_queries&&ee.leading_queries.length>0&&a===ee.conversationId&&We.leadingQueries&&!i&&!b&&E.jsx(qw,{children:ee.leading_queries.map((Re,Oe)=>E.jsx(o6,{style:{backgroundColor:t.callToActionBackgroundColor,color:t.callToActionFontColor},onClick:()=>{k?(C(!0),A({question:Re,path:"/",nameSpace:window.DebalesChat.projectId})):r(Re),window.DebalesChat.track(mt.LEADING_QUERY_CLICKED,{query:Re})},disabled:d,$disabled:d,children:Re},Oe))}),I&&I.itemCount>0&&a===ee.conversationId&&We.cartSummary&&E.jsxs(nre,{children:[E.jsx(wd,{$botMessageColor:t.botMessageColor,style:{width:"max-content",color:t.botFontColor},dangerouslySetInnerHTML:{__html:`<span style="display: flex; align-items: center; justify-content: center;">Total Price: ${sm((I==null?void 0:I.total)??0,(I==null?void 0:I.currency)??"USD")} </span>`}}),E.jsxs(am,{href:B(t.shopifyShopDomain??""),onClick:Jt,children:[E.jsx("span",{children:"Checkout"}),E.jsx(dm,{style:{width:"20px",fill:t.callToActionFontColor}})]})]}),He&&He.length>0&&a===ee.conversationId&&We.bulkItems&&E.jsx(om,{onClick:()=>gr(ee.conversationId),children:"Add Bulk Items to Cart"}),b&&c.indexOf(ee)===c.length-1&&E.jsx(E.Fragment,{children:E.jsx(u0,{setShowModel:Re=>{var De,ct;const Oe=typeof Re=="function"?Re(b):Re;C(Oe),!Oe&&((ct=(De=t.pluginConfig)==null?void 0:De.collectedUserInfo)!=null&&ct.discount)&&gi(!0)},inChat:!0,showFormInstructions:!1})}),F&&c.indexOf(ee)===c.length-1&&E.jsxs(fre,{onSubmit:j,children:[E.jsxs(Hw,{children:[E.jsxs(Gw,{children:["Name",E.jsx("span",{children:"*"})]}),E.jsx(l6,{type:"text",required:!0,value:ge.name,onChange:Re=>_e(Oe=>({...Oe,name:Re.target.value})),placeholder:"John"})]}),E.jsxs(Hw,{children:[E.jsxs(Gw,{children:["Email",E.jsx("span",{children:"*"})]}),E.jsx(l6,{type:"email",required:!0,value:ge.email,onChange:Re=>_e(Oe=>({...Oe,email:Re.target.value})),placeholder:"olivia@untitledui.com"})]}),E.jsxs(Hw,{children:[E.jsxs(Gw,{children:["Message",E.jsx("span",{children:"*"})]}),E.jsx(dre,{required:!0,value:ge.message,onChange:Re=>_e(Oe=>({...Oe,message:Re.target.value})),placeholder:"I need help with..."})]}),E.jsx(pre,{children:E.jsx(hre,{type:"submit",children:"Submit"})})]}),ne&&!d&&a===ee.conversationId&&E.jsx(wd,{$botMessageColor:t.botMessageColor,style:{color:t.botFontColor},children:E.jsx(Po,{loading:ne,loadingPhrases:["🎨 Loading","✨ Almost","🚀 Ready"]})})]})]}),!pe&&E.jsx(rre,{$fontColor:t.userFontColor||"#000",$botMessageColor:t.botBackgroundColor||"#fff",children:E.jsx(wd,{$botMessageColor:pe?t.botMessageColor||"#fff":t.userMessageColor||"#fff",children:E.jsx(Ga,{children:ee.text})})})]},q)}),(d||at)&&E.jsxs(i6,{$fontColor:t.botFontColor||"#000",$botMessageColor:t.botBackgroundColor||"#fff",children:[E.jsx("img",{src:t.bot_logo,alt:"Chat User Icon"}),E.jsx(a6,{children:E.jsx(wd,{$botMessageColor:t.botMessageColor||"#fff",style:{backgroundColor:"transparent",padding:"0px"},children:E.jsx("div",{style:{display:"flex",alignItems:"center",gap:"4px",animation:"fadeIn 0.3s ease-in-out"},children:E.jsx(Po,{loading:d||at})})})})]})]}),E.jsxs("div",{className:"debales-footer-container",style:{width:"calc(100%-24px)",backgroundColor:t.footerBackgroundColor||"#fff",color:t.fontColor||"#000"},children:[e==="catch-org-ai"&&E.jsx(tre,{children:E.jsx("span",{children:'"Catch org AI" can make mistakes.'})}),E.jsx("div",{children:E.jsx(d0,{disabled:d,inputState:!1})}),(t.debales_branding??!0)&&E.jsxs(Jne,{href:"https://debales.ai/?open=true",target:"_blank",title:"debales-link",style:{color:t.fontColor?t.fontColor:"fff",marginTop:e==="catch-org-ai"?"0":"9px"},children:[E.jsx("p",{children:"Powered by"}),E.jsxs(ere,{children:[E.jsx("img",{src:`${Zn}/images/debales_logo_d.png`,alt:"Debales logo"}),E.jsx("p",{children:"DEBALES"})]})]})]})]})]})}),K.shadowRoot)]})},mre=({botId:e})=>{const t=kB("new-suggested-question-design");console.log(t);let n;return t==="variant-1"?n=Xte:t==="variant-2"?n=$ne:t==="variant-3"?n=gre:n=G4,E.jsx(n,{botId:e})},u6="debales-ai-assistant",c6="debales-chatbot-container",vre=R.forwardRef(({children:e,globalStyles:t="",containerStyles:n={},onReady:r},i)=>{const o=R.useRef(null),[a,u]=R.useState(null),c=R.useRef(null),d=R.useRef(null),p=R.useRef({get shadowRoot(){return c.current},get container(){return a},querySelector:h=>{var m;return((m=c.current)==null?void 0:m.querySelector(h))||null},querySelectorAll:h=>{var m;return((m=c.current)==null?void 0:m.querySelectorAll(h))||null}});return R.useImperativeHandle(i,()=>p.current,[]),R.useEffect(()=>{const h=document.getElementById(u6);if(h?o.current=h:o.current&&(o.current.id=u6),o.current&&(o.current.style.cssText="position: absolute; top: 0; left: 0; width: 0; height: 0;"),o.current){if(o.current.shadowRoot){c.current=o.current.shadowRoot;const _=c.current.querySelector(`#${c6}`);_&&u(_);return}const m=o.current.attachShadow({mode:"open"});if(c.current=m,t){const _=document.createElement("style");_.textContent=t,m.appendChild(_)}const v=document.createElement("div");v.id=c6,v.style.cssText="position: absolute; top: 0; left: 0; width: 0; height: 0;",m.appendChild(v),u(v),r&&r(m,v)}},[t,r]),R.useEffect(()=>(a&&!d.current&&(d.current=xE.createRoot(a)),d.current&&a&&d.current.render(E.jsx(Nq,{target:a,children:E.jsx(G2,{value:p.current,children:e})})),()=>{d.current&&d.current.unmount()}),[a,e]),E.jsx("div",{ref:o,style:n})});class Vw{isSupported(){return hs.detect()===this.platform}createSuccessResult(t,n){return{success:!0,data:t,message:n}}createErrorResult(t){return{success:!1,error:t}}}class yre extends Vw{constructor(){super(...arguments);Cr(this,"platform",Pr.DEFAULT)}async fetchCart(){return console.log("DefaultCartAdapter: fetchCart called"),this.createSuccessResult({items:[],total:0,itemCount:0,currency:"USD",token:"default-token"},"Default cart fetched")}async addToCart(n,r=1,i){return console.log("DefaultCartAdapter: addToCart called",{variantId:n,quantity:r,properties:i}),this.createSuccessResult(void 0,"Item added to cart (mock)")}async removeFromCart(n){return console.log("DefaultCartAdapter: removeFromCart called",{itemId:n}),this.createSuccessResult(void 0,"Item removed from cart (mock)")}async updateQuantity(n){return console.log("DefaultCartAdapter: updateQuantity called",{cartItem:n}),this.createSuccessResult(void 0,"Item quantity updated (mock)")}async clearCart(){return console.log("DefaultCartAdapter: clearCart called"),this.createSuccessResult(void 0,"Cart cleared (mock)")}generateCartUrl(n){const r=n.replace(/^https?:\/\//,"");return console.log("DefaultCartAdapter: generateCartUrl called",{domain:n,sanitizedDomain:r}),`https://${r}/cart`}generateProductUrl(n,r){if(r.handle){const i=new URL(`https://${n}/products/${r.handle}`);return i.searchParams.append("variant",r.product_id),pl(i.toString())}else return pl(r.link)}async addCartAttributes(n={}){return console.log("MethodNotImplemented: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}}class _re extends Vw{constructor(){var n,r;super();Cr(this,"platform",Pr.SHOPIFY);Cr(this,"cartEndpoint");Cr(this,"localCartKey","debales_track_cart");this.cartEndpoint=((r=(n=window.Shopify)==null?void 0:n.routes)==null?void 0:r.root)||"/"}normalizeCartData(n){return{items:n.items.map(r=>({id:r.id,variant_id:r.variant_id,quantity:r.quantity,title:r.title,price:r.price,properties:r.properties})),total:n.total_price/100,itemCount:n.item_count,currency:n.currency,token:n.token.split("?")[0]}}generateProductUrl(n,r){const i=c0(n);if(!i.isValid)return"";if(r.handle){const o=new URL(`/products/${r.handle}`,i.url);return o.searchParams.append("variant",r.product_id),pl(o.toString())}else return pl(r.link)}updateTrackCart({cartToken:n,sessionId:r=an()}){localStorage.setItem(this.localCartKey,JSON.stringify({sessionId:r,cartToken:n}))}async fetchCart(){try{const n=await fetch(`${this.cartEndpoint}cart.js`),r=await n.json();if(!n.ok){const o=r;return this.createErrorResult(o.description||`Failed to fetch cart: ${n.status}`)}const i=r;return this.createSuccessResult(this.normalizeCartData(i),"Cart fetched successfully")}catch(n){return this.createErrorResult(n instanceof Error?`Error fetching cart: ${n.message}`:"Unknown error occurred while fetching cart")}}async addToCart(n,r=1,i){try{const o=await fetch(`${this.cartEndpoint}cart/add.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:[{id:n,quantity:r,properties:i}],attributes:{dbls_order_source:"direct_recommendation",dbls_session_id:an(),dbls_method:"add_to_cart"}})}),a=await o.json();if(!o.ok){const u=a;return this.createErrorResult(u.description||`Failed to add item to cart: ${o.status}`)}return this.fetchCart().then(u=>{u.success&&this.updateTrackCart({cartToken:u==null?void 0:u.data.token})}),this.createSuccessResult(void 0,`Successfully added ${r} item(s) to cart`)}catch(o){return this.createErrorResult(o instanceof Error?`Error adding to cart: ${o.message}`:"Unknown error occurred while adding to cart")}}async removeFromCart(n){return this.updateQuantity({id:n,quantity:0})}async updateQuantity(n){try{const r=await fetch(`${this.cartEndpoint}cart/change.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:n.id,quantity:n.quantity})}),i=await r.json();if(!r.ok){const o=i;return this.createErrorResult(o.description||`Failed to update item quantity: ${r.status}`)}return this.fetchCart().then(o=>{o.success&&this.updateTrackCart({cartToken:o==null?void 0:o.data.token})}),this.createSuccessResult(void 0,n.quantity===0?"Item removed from cart":`Quantity updated to ${n.quantity}`)}catch(r){return this.createErrorResult(r instanceof Error?`Error updating quantity: ${r.message}`:"Unknown error occurred while updating quantity")}}async clearCart(){try{const n=await fetch(`${this.cartEndpoint}cart/clear.js`,{method:"POST"});if(!n.ok){const r=await n.json();return this.createErrorResult(r.description||`Failed to clear cart: ${n.status}`)}return this.createSuccessResult(void 0,"Cart cleared successfully")}catch(n){return this.createErrorResult(n instanceof Error?`Error clearing cart: ${n.message}`:"Unknown error occurred while clearing cart")}}async addCartAttributes(n={}){try{const r=await fetch(`${this.cartEndpoint}cart/update.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:{dbls_order_source:"direct_recommendation",dbls_session_id:an(),...n}})});if(!r.ok){const i=await r.json();return this.createErrorResult(i.description||`Failed to update cart attributes: ${r.status}`)}return this.createSuccessResult(void 0,"Cart attributes updated successfully")}catch(r){return this.createErrorResult(r instanceof Error?`Error updating cart attributes: ${r.message}`:"Unknown error occurred while updating cart attributes")}}generateCartUrl(n){const r=c0(n);if(!r.isValid)return"";const i=new URL("/cart",r.url);return i.searchParams.append("ref",`debales-ai-${new Date().toISOString()}`),i.searchParams.append("attributes[from]","debales-ai-chatbot"),i.searchParams.append("attributes[through]","add-to-cart"),i.searchParams.append("attributes[dbls_session_id]",an()),i.searchParams.append("timestamp",Date.now().toString()),pl(i.toString())}}class bre extends Vw{constructor(){var n,r;super();Cr(this,"platform",Pr.MAGENTO);Cr(this,"checkoutEndpoint");Cr(this,"baseUrl");this.checkoutEndpoint=((n=window.checkout)==null?void 0:n.checkoutUrl)||"/",this.baseUrl=((r=window.checkout)==null?void 0:r.baseUrl)||"/"}normalizeCartData(n){return{items:n.items.map(r=>({id:parseInt(r.item_id),variant_id:parseInt(r.product_id),quantity:r.qty,title:r.product_name,price:r.product_price_value,properties:{name:r.product_name}})),total:parseFloat(n.subtotalAmount),itemCount:n.summary_count,currency:"USD",token:n.data_id.toString()}}async fetchCart(){try{const n=await fetch(`${this.baseUrl}customer/section/load/?sections=cart&update_section_id=false`),r=await n.json();if(!n.ok)return this.createErrorResult(`Failed to fetch cart: ${n.status}`);const i=r.cart;return this.createSuccessResult(this.normalizeCartData(i),"Cart fetched successfully")}catch(n){return this.createErrorResult(n instanceof Error?`Error fetching cart: ${n.message}`:"Unknown error occurred while fetching cart")}}async addToCart(n,r=1){var i;try{const o=(i=document.querySelector('input[name="form_key"]'))==null?void 0:i.value;if(!o)return this.createErrorResult("Form key not found");const a=await fetch(`${this.checkoutEndpoint}cart/add`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({product:n,qty:r.toString(),form_key:o})});if(!a.ok)return this.createErrorResult(`Failed to add item to cart: ${a.status}`);try{window.require(["Magento_Customer/js/customer-data"],u=>u.reload(["cart"],!0))}catch(u){console.warn("Failed to reload cart data:",u)}return this.createSuccessResult(void 0,`Successfully added ${r} item(s) to cart`)}catch(o){return this.createErrorResult(o instanceof Error?`Error adding to cart: ${o.message}`:"Unknown error occurred while adding to cart")}}async removeFromCart(n){return console.log("MethodNotImplemented: removeFromCart called",{itemId:n}),this.createSuccessResult(void 0,"Item removed from cart (mock)")}async updateQuantity(n){return console.log("MethodNotImplemented: updateQuantity called",{cartItem:n}),this.createSuccessResult(void 0,"Item quantity updated (mock)")}async clearCart(){return console.log("MethodNotImplemented: clearCart called"),this.createSuccessResult(void 0,"Cart cleared (mock)")}generateCartUrl(n){const r=new URL(`https://${n}/checkout/cart?ref=debales-ai-${new Date().toISOString()}&attributes[from]=debales-ai-chatbot&attributes[through]=add-to-cart`);return r.searchParams.append("timestamp",Date.now().toString()),r.toString()}generateProductUrl(n,r){const i=c0(n);if(!i.isValid)return"";if(r.handle){const o=new URL(`/${r.handle}.html`,i.url);return pl(o.toString())}else return pl(r.link)}async addCartAttributes(n={}){return console.log("MethodNotImplemented: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}}const ml=class ml{constructor(){Cr(this,"adapterCache");this.adapterCache=new Map}static getInstance(){return ml.instance||(ml.instance=new ml),ml.instance}getAdapter(t){const n=t||hs.detect(),r=this.adapterCache.get(n);if(r)return r;let i;switch(n){case Pr.SHOPIFY:i=new _re;break;case Pr.MAGENTO:i=new bre;break;default:console.warn(`No specific adapter found for platform ${n}, using default adapter`),i=new yre}return this.adapterCache.set(n,i),i}clearCache(){this.adapterCache.clear()}};Cr(ml,"instance");let Zw=ml;const xre=({adapter:e,children:t,autoFetch:n=!0})=>{const[r,i]=R.useState(!1),[o,a]=R.useState(null),[u,c]=R.useState(null),d=R.useCallback(async()=>{try{i(!0),a(null);const C=await e.fetchCart();C.success?c(C.data):a(C.error)}catch(C){a(C instanceof Error?C.message:"Failed to fetch cart")}finally{i(!1)}},[e]),p=async(C,k,A)=>{try{a(null);const I=await e.addToCart(C,k,A);return I.success&&await d(),I}catch(I){return{success:!1,error:I instanceof Error?I.message:"Failed to add item to cart"}}},h=async C=>{try{a(null);const k=await e.removeFromCart(C);return k.success&&await d(),k}catch(k){return{success:!1,error:k instanceof Error?k.message:"Failed to remove item from cart"}}},m=async C=>{try{a(null);const k=await e.updateQuantity(C);return k.success&&await d(),k}catch(k){return{success:!1,error:k instanceof Error?k.message:"Failed to update quantity"}}},v=async()=>{try{a(null);const C=await e.clearCart();return C.success&&await d(),C}catch(C){return{success:!1,error:C instanceof Error?C.message:"Failed to clear cart"}}},_=C=>e.generateCartUrl(C),S=(C,k)=>e.generateProductUrl(C,k),x=async C=>e.addCartAttributes(C);R.useEffect(()=>{n&&d()},[n,d]);const b={isLoading:r,error:o,cart:u,fetchCart:d,addToCart:p,removeFromCart:h,updateQuantity:m,clearCart:v,generateCartUrl:_,generateProductUrl:S,addCartAttributes:x};return E.jsx(C2.Provider,{value:b,children:t})},Fo=Object.create(null);Fo.open="0",Fo.close="1",Fo.ping="2",Fo.pong="3",Fo.message="4",Fo.upgrade="5",Fo.noop="6";const h0=Object.create(null);Object.keys(Fo).forEach(e=>{h0[Fo[e]]=e});const Yw={type:"error",data:"parser error"},f6=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",d6=typeof ArrayBuffer=="function",h6=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ww=({type:e,data:t},n,r)=>f6&&t instanceof Blob?n?r(t):p6(t,r):d6&&(t instanceof ArrayBuffer||h6(t))?n?r(t):p6(new Blob([t]),r):r(Fo[e]+(t||"")),p6=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function g6(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Kw;function wre(e,t){if(f6&&e.data instanceof Blob)return e.data.arrayBuffer().then(g6).then(t);if(d6&&(e.data instanceof ArrayBuffer||h6(e.data)))return t(g6(e.data));Ww(e,!1,n=>{Kw||(Kw=new TextEncoder),t(Kw.encode(n))})}const m6="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sd=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<m6.length;e++)Sd[m6.charCodeAt(e)]=e;const Sre=e=>{let t=e.length*.75,n=e.length,r,i=0,o,a,u,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const d=new ArrayBuffer(t),p=new Uint8Array(d);for(r=0;r<n;r+=4)o=Sd[e.charCodeAt(r)],a=Sd[e.charCodeAt(r+1)],u=Sd[e.charCodeAt(r+2)],c=Sd[e.charCodeAt(r+3)],p[i++]=o<<2|a>>4,p[i++]=(a&15)<<4|u>>2,p[i++]=(u&3)<<6|c&63;return d},Cre=typeof ArrayBuffer=="function",Qw=(e,t)=>{if(typeof e!="string")return{type:"message",data:v6(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Ere(e.substring(1),t)}:h0[n]?e.length>1?{type:h0[n],data:e.substring(1)}:{type:h0[n]}:Yw},Ere=(e,t)=>{if(Cre){const n=Sre(e);return v6(n,t)}else return{base64:!0,data:e}},v6=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},y6="",kre=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{Ww(o,!1,u=>{r[a]=u,++i===n&&t(r.join(y6))})})},Are=(e,t)=>{const n=e.split(y6),r=[];for(let i=0;i<n.length;i++){const o=Qw(n[i],t);if(r.push(o),o.type==="error")break}return r};function Ire(){return new TransformStream({transform(e,t){wre(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Xw;function p0(e){return e.reduce((t,n)=>t+n.length,0)}function g0(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Tre(e,t){Xw||(Xw=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(a,u){for(n.push(a);;){if(r===0){if(p0(n)<1)break;const c=g0(n,1);o=(c[0]&128)===128,i=c[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(p0(n)<2)break;const c=g0(n,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(p0(n)<8)break;const c=g0(n,8),d=new DataView(c.buffer,c.byteOffset,c.length),p=d.getUint32(0);if(p>Math.pow(2,21)-1){u.enqueue(Yw);break}i=p*Math.pow(2,32)+d.getUint32(4),r=3}else{if(p0(n)<i)break;const c=g0(n,i);u.enqueue(Qw(o?c:Xw.decode(c),t)),r=0}if(i===0||i>e){u.enqueue(Yw);break}}}})}const _6=4;function hr(e){if(e)return Mre(e)}function Mre(e){for(var t in hr.prototype)e[t]=hr.prototype[t];return e}hr.prototype.on=hr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},hr.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},hr.prototype.off=hr.prototype.removeListener=hr.prototype.removeAllListeners=hr.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this},hr.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},hr.prototype.emitReserved=hr.prototype.emit,hr.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},hr.prototype.hasListeners=function(e){return!!this.listeners(e).length};const m0=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),eo=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ore="arraybuffer";function Vae(){}function b6(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Rre=eo.setTimeout,$re=eo.clearTimeout;function v0(e,t){t.useNativeTimers?(e.setTimeoutFn=Rre.bind(eo),e.clearTimeoutFn=$re.bind(eo)):(e.setTimeoutFn=eo.setTimeout.bind(eo),e.clearTimeoutFn=eo.clearTimeout.bind(eo))}const Dre=1.33;function Lre(e){return typeof e=="string"?Nre(e):Math.ceil((e.byteLength||e.size)*Dre)}function Nre(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function x6(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Bre(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Pre(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class Fre extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Jw extends hr{constructor(t){super(),this.writable=!1,v0(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Fre(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Qw(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Bre(t);return n.length?"?"+n:""}}class zre extends Jw{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Are(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,kre(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=x6()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let w6=!1;try{w6=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Ure=w6;function jre(){}class qre extends zre{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class zo extends hr{constructor(t,n,r){super(),this.createRequest=t,v0(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=b6(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=zo.requestsCount++,zo.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=jre,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete zo.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(zo.requestsCount=0,zo.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",S6);else if(typeof addEventListener=="function"){const e="onpagehide"in eo?"pagehide":"unload";addEventListener(e,S6,!1)}}function S6(){for(let e in zo.requests)zo.requests.hasOwnProperty(e)&&zo.requests[e].abort()}const Hre=function(){const e=C6({xdomain:!1});return e&&e.responseType!==null}();class Gre extends qre{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Hre&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new zo(C6,this.uri(),t)}}function C6(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ure))return new XMLHttpRequest}catch{}if(!t)try{return new eo[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const E6=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Vre extends Jw{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=E6?{}:b6(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Ww(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}i&&m0(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=x6()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const eS=eo.WebSocket||eo.MozWebSocket;class Zre extends Vre{createSocket(t,n,r){return E6?new eS(t,n,r):n?new eS(t,n):new eS(t)}doWrite(t,n){this.ws.send(n)}}class Yre extends Jw{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Tre(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=Ire();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const o=()=>{r.read().then(({done:u,value:c})=>{u||(this.onPacket(c),o())}).catch(u=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&m0(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Wre={websocket:Zre,webtransport:Yre,polling:Gre},Kre=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Qre=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function tS(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=Kre.exec(e||""),o={},a=14;for(;a--;)o[Qre[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=Xre(o,o.path),o.queryKey=Jre(o,o.query),o}function Xre(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Jre(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}const nS=typeof addEventListener=="function"&&typeof removeEventListener=="function",y0=[];nS&&addEventListener("offline",()=>{y0.forEach(e=>e())},!1);class ps extends hr{constructor(t,n){if(super(),this.binaryType=Ore,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=tS(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=tS(n.host).host);v0(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Pre(this.opts.query)),nS&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},y0.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=_6,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ps.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ps.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Lre(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,m0(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(ps.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),nS&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=y0.indexOf(this._offlineEventListener);r!==-1&&y0.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ps.protocol=_6;class eie extends ps{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;ps.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ps.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(p(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,p(),n.close(),n=null)}const a=h=>{const m=new Error("probe error: "+h);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function u(){a("transport closed")}function c(){a("socket closed")}function d(h){n&&h.name!==n.name&&o()}const p=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",u),this.off("close",c),this.off("upgrading",d)};n.once("open",i),n.once("error",a),n.once("close",u),this.once("close",c),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let tie=class extends eie{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>Wre[i]).filter(i=>!!i)),super(t,r)}};function nie(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=tS(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const rie=typeof ArrayBuffer=="function",iie=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,k6=Object.prototype.toString,oie=typeof Blob=="function"||typeof Blob<"u"&&k6.call(Blob)==="[object BlobConstructor]",aie=typeof File=="function"||typeof File<"u"&&k6.call(File)==="[object FileConstructor]";function rS(e){return rie&&(e instanceof ArrayBuffer||iie(e))||oie&&e instanceof Blob||aie&&e instanceof File}function _0(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(_0(e[n]))return!0;return!1}if(rS(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return _0(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&_0(e[n]))return!0;return!1}function sie(e){const t=[],n=e.data,r=e;return r.data=iS(n,t),r.attachments=t.length,{packet:r,buffers:t}}function iS(e,t){if(!e)return e;if(rS(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=iS(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=iS(e[r],t));return n}return e}function lie(e,t){return e.data=oS(e.data,t),delete e.attachments,e}function oS(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=oS(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=oS(e[n],t));return e}const uie=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],cie=5;var Kt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Kt||(Kt={}));class fie{constructor(t){this.replacer=t}encode(t){return(t.type===Kt.EVENT||t.type===Kt.ACK)&&_0(t)?this.encodeAsBinary({type:t.type===Kt.EVENT?Kt.BINARY_EVENT:Kt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Kt.BINARY_EVENT||t.type===Kt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=sie(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function A6(e){return Object.prototype.toString.call(e)==="[object Object]"}class aS extends hr{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Kt.BINARY_EVENT;r||n.type===Kt.BINARY_ACK?(n.type=r?Kt.EVENT:Kt.ACK,this.reconstructor=new die(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(rS(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Kt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Kt.BINARY_EVENT||r.type===Kt.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(aS.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Kt.CONNECT:return A6(n);case Kt.DISCONNECT:return n===void 0;case Kt.CONNECT_ERROR:return typeof n=="string"||A6(n);case Kt.EVENT:case Kt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&uie.indexOf(n[0])===-1);case Kt.ACK:case Kt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class die{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=lie(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const hie=Object.freeze(Object.defineProperty({__proto__:null,Decoder:aS,Encoder:fie,get PacketType(){return Kt},protocol:cie},Symbol.toStringTag,{value:"Module"}));function xo(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const pie=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class I6 extends hr{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[xo(t,"open",this.onopen.bind(this)),xo(t,"packet",this.onpacket.bind(this)),xo(t,"error",this.onerror.bind(this)),xo(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,o;if(pie.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const a={type:Kt.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const p=this.ids++,h=n.pop();this._registerAckCallback(p,h),a.id=p}const u=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!u||(c?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let u=0;u<this.sendBuffer.length;u++)this.sendBuffer[u].id===t&&this.sendBuffer.splice(u,1);n.call(this,new Error("operation has timed out"))},i),a=(...u)=>{this.io.clearTimeoutFn(o),n.apply(this,u)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,i)=>{const o=(a,u)=>a?i(a):r(u);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Kt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Kt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Kt.EVENT:case Kt.BINARY_EVENT:this.onevent(t);break;case Kt.ACK:case Kt.BINARY_ACK:this.onack(t);break;case Kt.DISCONNECT:this.ondisconnect();break;case Kt.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Kt.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Kt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function tc(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}tc.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0},tc.prototype.reset=function(){this.attempts=0},tc.prototype.setMin=function(e){this.ms=e},tc.prototype.setMax=function(e){this.max=e},tc.prototype.setJitter=function(e){this.jitter=e};class sS extends hr{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,v0(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new tc({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||hie;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new tie(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=xo(n,"open",function(){r.onopen(),t&&t()}),o=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),t?t(u):this.maybeReconnectOnOpen()},a=xo(n,"error",o);if(this._timeout!==!1){const u=this._timeout,c=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},u);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(xo(t,"ping",this.onping.bind(this)),xo(t,"data",this.ondata.bind(this)),xo(t,"error",this.onerror.bind(this)),xo(t,"close",this.onclose.bind(this)),xo(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){m0(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new I6(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Cd={};function b0(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=nie(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=Cd[i]&&o in Cd[i].nsps,u=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let c;return u?c=new sS(r,t):(Cd[i]||(Cd[i]=new sS(r,t)),c=Cd[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(b0,{Manager:sS,Socket:I6,io:b0,connect:b0});const vl=class vl{constructor(){Cr(this,"socket",null);Cr(this,"isConnected",!1);Cr(this,"eventListeners",new Map)}static getInstance(){return vl.instance||(vl.instance=new vl),vl.instance}connect(t){return this.socket?this.socket:(this.socket=b0(`${hK}${t}`,{transports:["websocket"]}),this.socket.on("connect",()=>{this.isConnected=!0,this.emitEvent("connect")}),this.socket.on("disconnect",()=>{this.isConnected=!1,this.emitEvent("disconnect")}),this.socket)}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null,this.isConnected=!1,this.eventListeners.clear())}getSocket(){return this.socket}getIsConnected(){return this.isConnected}on(t,n){var r,i;this.eventListeners.has(t)||this.eventListeners.set(t,[]),(r=this.eventListeners.get(t))==null||r.push(n),(i=this.socket)==null||i.on(t,n)}off(t,n){var i;const r=this.eventListeners.get(t);if(r){const o=r.indexOf(n);o>-1&&r.splice(o,1),(i=this.socket)==null||i.off(t,n)}}emit(t,...n){var r;(r=this.socket)==null||r.emit(t,...n)}emitEvent(t,...n){const r=this.eventListeners.get(t);r&&r.forEach(i=>i(...n))}};Cr(vl,"instance");let lS=vl;const Uo=lS.getInstance();var gie={MESSAGE:"MESSAGE"},mie={USER:"USER"};function x0(e,t){window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:t}))}const T6=(e,t)=>{const n=JSON.stringify(t);window.localStorage.setItem(e,n),x0(e,n)},vie=e=>{window.localStorage.removeItem(e),x0(e,null)},M6=e=>window.localStorage.getItem(e),yie=e=>(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)),_ie=()=>{throw Error("useLocalStorage is a client-only hook")};function bie(e,t){const n=()=>M6(e),r=R.useSyncExternalStore(yie,n,_ie),i=R.useCallback(o=>{try{const a=typeof o=="function"?o(JSON.parse(r)):o;a==null?vie(e):T6(e,a)}catch(a){console.warn(a)}},[e,r]);return R.useEffect(()=>{M6(e)===null&&T6(e,t)},[e,t]),[r?JSON.parse(r):t,i]}const O6=(e,t)=>{const n=JSON.stringify(t);window.sessionStorage.setItem(e,n),x0(e,n)},xie=e=>{window.sessionStorage.removeItem(e),x0(e,null)},R6=e=>window.sessionStorage.getItem(e),wie=e=>(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)),Sie=()=>{throw Error("useSessionStorage is a client-only hook")};function Cie(e,t){const n=()=>R6(e),r=R.useSyncExternalStore(wie,n,Sie),i=R.useCallback(o=>{try{const a=typeof o=="function"?o(JSON.parse(r)):o;a==null?xie(e):O6(e,a)}catch(a){console.warn(a)}},[e,r]);return R.useEffect(()=>{R6(e)===null&&O6(e,t)},[e,t]),[r?JSON.parse(r):t,i]}const Eie=({children:e,nameSpace:t})=>{const[n,r]=R.useState(""),[i,o]=R.useState([]),[a,u]=R.useState(!1),[c,d]=R.useState(!1),[p,h]=R.useState([]),[m,v]=R.useState(!1),[_,S]=R.useState(!1),[x,b]=R.useState([]),[C,k]=bie(qt(jt.USER_INFO),null),[A,I]=Cie(qt(jt.IS_FORM_CLOSED_BY_USER),!1),[$,B]=er.useState(null),U=ja("web-socket"),[G,P]=er.useState([]),[K,re]=R.useState(null),[ue,Z]=R.useState(!1),[ie,V]=R.useState(sessionStorage.getItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:t}))),Q=yK(),ye=an(),[Te,T]=er.useState(null),[X,ve]=R.useState(null);R.useEffect(()=>{if(U){const je=Uo.connect("/api/v1/chat");re(je);const Se=()=>{console.debug("connected to websocket"),Z(!0)},Ye=()=>{console.debug("disconnected from websocket"),Z(!1)},Qe=et=>{console.debug("response from websocket",et);const He=et.conversationId??crypto.randomUUID().toString();V(He),et.Variants_quantity&&b(F=>[...F,...et.Variants_quantity]);const N=[...i,{text:et.response,products:et.products,conversationId:He,rating:"neutral",leading_queries:et.leading_queries,collections:et.collections,variants:et.variants,shop:et.shop,Variants_quantity:et.Variants_quantity,monthlyChatLimitReached:et.monthlyChatLimitReached,isBot:!0}];o(N),L(N),h(F=>[...F,[i[i.length-1].text,et.response]]),d(!1)},ot=et=>{if(et.event==="error"){const He={text:"I am facing some network issues. Can you please check your network and try again?",isBot:!0},N=[...i,He];o(N),L(N),d(!1)}};return Uo.on("connect",Se),Uo.on("disconnect",Ye),Uo.on("response",Qe),Uo.on("system",ot),()=>{Uo.off("connect",Se),Uo.off("disconnect",Ye),Uo.off("response",Qe),Uo.off("system",ot)}}},[U,i]);const L=je=>{sessionStorage.setItem(qt(jt.CHAT_HISTORY,{botId:window.DebalesChat.projectId}),JSON.stringify(je))},we=()=>{const je=sessionStorage.getItem(qt(jt.CHAT_HISTORY,{botId:window.DebalesChat.projectId}));return je?JSON.parse(je):[]},Ue=R.useCallback(async()=>{if(t)try{u(!0);const je=await fetch(`${Zn}/api/wordpress/UiData?value=${t}`),Se=await je.json();if(!je.ok)throw new Error("failed to fetch data"+Se.error);const Ye=document.getElementById("debales-ai-assistant");Ye&&(Ye.style.zIndex=String(Se.zIndex??2031483602)),ve(Se),Se!=null&&Se.shopifyShopDomain&&NK(Se.shopifyShopDomain).then(ot=>{T(ot)}),P(Se.suggestedQuestions);const Qe=we();if(Qe.length>0)o(Qe);else{const ot={text:Se.initialMessage||"Hi, I am an AI Assistant. How can I help you?",isBot:!0};o([ot])}}catch(je){console.error(je)}finally{u(!1)}},[t]);R.useEffect(()=>{Ue()},[Ue]);const de=R.useMemo(()=>{var je;return!!(!A&&((je=X==null?void 0:X.pluginConfig)!=null&&je.collectedUserInfo)&&(X.pluginConfig.collectedUserInfo.name||X.pluginConfig.collectedUserInfo.email||X.pluginConfig.collectedUserInfo.phone)&&!C)},[X,C,A]),tt=R.useCallback(async(je,Se,Ye,Qe,ot,et)=>{if(!je||je.trim()===""||c&&!Ye)return;let He=[...i];Qe?Qe&&i.length<=2?(v(!0),He=[]):v(!1):(He.push({text:je,isBot:!1}),v(!1));const N=an();d(!0);try{o(He),L(He);const F=await fetch(`${Zn}/api/wordpress/ChatWithBot`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:N,userMessage:je,nameSpace:t,chat_history:p,leading_queries:ot,answer:Se,products:Ye,userInfo:JSON.stringify(C),anonymousUserId:Q,distinctId:Bo.getDistinctId(),timestamp:new Date().toISOString(),timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,followUpQuestion:et})});if(!F.ok)throw new Error("Network response was not ok");const Y=await F.json(),ge=Y.conversationId??crypto.randomUUID().toString();V(ge),Y.Variants_quantity&&b(Ie=>[...Ie,...Y.Variants_quantity]);const _e=[...He,{text:Y.response,products:Y.products,conversationId:ge,rating:"neutral",leading_queries:Y.leading_queries,collections:Y.collections,variants:Y.variants,shop:Y.shop,Variants_quantity:Y.Variants_quantity,monthlyChatLimitReached:Y.monthlyChatLimitReached,isBot:!0}];o(_e),L(_e),h(Ie=>[...Ie,[je,Y.response]])}catch(F){console.error(F);const Y={text:"I am facing some network issues. Can you please check your network and try again?",isBot:!0},ge=[...He,Y];Qe||(o(ge),L(ge))}finally{d(!1)}},[i,c,p,t,Q,C]),Ze=R.useCallback(je=>{X&&ve(Se=>Se?{...Se,mobileDisplayMode:je}:null)},[X]),lt=R.useCallback(async(je,Se,Ye,Qe,ot,et)=>{if(!je||je.trim()===""||c&&!Ye)return;let He=[...i];if(Qe?Qe&&i.length<=2?(v(!0),He=[]):v(!1):(He.push({text:je,isBot:!1}),v(!1)),d(!0),o(He),L(He),K&&ue){const N={type:gie.MESSAGE,role:mie.USER,query:je,nameSpace:t,leadingQueries:ot,answer:Se,products:Ye,userInfo:C,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:new Date().toISOString(),sessionId:ye,anonymousUserId:Q,distinctId:Bo.getDistinctId(),followUpQuestion:et};Uo.emit("chat",N)}else tt(je,Se,Ye,Qe,ot,et)},[i,c,t,Q,K,ue,ye,tt,C]),gt={sessionId:ye,messages:i,isLoading:a,isMessageLoading:c,isKlaviyoMessage:m,showUserInfoModel:_,pendingBulkItems:x,lastedBotmessageId:ie,uiData:X,storeMetaData:Te,suggestedQuestions:G,isUserInfoNeeded:de,input:n,pendingQuestion:$,userInfo:C,isFormClosedByUser:A,onSendMessage:U?lt:tt,setMessages:o,setIsLoading:u,setIsMessageLoading:d,setIsKlaviyoMessage:v,setShowUserInfoModel:S,setPendingBulkItems:b,setLastedBotmessageId:V,fetchUiInfo:Ue,changeDisplayModel:Ze,saveConversation:L,loadConversation:we,setSuggestedQuestions:P,setUserInfo:k,setInput:r,setPendingQuestion:B,setIsFormClosedByUser:I};return E.jsx(V2.Provider,{value:gt,children:e})};function kie(e){const t=Zw.getInstance().getAdapter();return E.jsx(Eie,{nameSpace:e.botId,children:E.jsx(EB,{apiKey:pK,options:{capture_pageview:e.botId!=="burgerbaeclothing",capture_pageleave:e.botId!=="burgerbaeclothing",api_host:Zn+"/ingest",ui_host:"https://us.posthog.com",loaded:n=>{n.register({platform:hs.detect(),project:e.botId,sessionId:an()}),n.group("project",e.botId,{platform:hs.detect()});const r=Nr();r&&r.email&&!n._isIdentified()&&n.identify(r.email,{name:r.name,phone:r.phone,email:r.email,project:e.botId})},debug:!0},children:E.jsx(xre,{adapter:t,children:e.children})})})}function Aie(e){return E.jsx(vre,{children:E.jsx(kie,{botId:e.botId,children:E.jsx(mre,{...e})})})}const ga=new Map;function w0(e){const{botId:t}=e;if(ga.has(t))return console.warn(`Chatbot with botId "${t}" is already initialized. Skipping duplicate initialization.`),ga.get(t);const n=e.containerId||`debales-chatbot-${t}`;let r=document.getElementById(n);r||(r=document.createElement("div"),r.id=n,document.body.appendChild(r));const i=xE.createRoot(r);i.render(er.createElement(Aie,{botId:e.botId}));const o={container:r,unmount:()=>{if(i.unmount(),ga.delete(t),r&&r.parentNode&&document.body.contains(r))try{r.parentNode.removeChild(r)}catch(a){console.warn("Error removing chatbot container:",a)}}};return ga.set(t,o),o}typeof window<"u"&&(window.DebalesChatbotBrowser={init:w0,destroy:e=>{const t=ga.get(e);return t?(t.unmount(),!0):!1},isInitialized:e=>ga.has(e),getInitializedBots:()=>Array.from(ga.keys())});function $6(){document.querySelectorAll('[id="debales-ai-assistant"][data-bot-id]').forEach(n=>{const r=n.getAttribute("data-bot-id");r&&!ga.has(r)&&w0({botId:r,containerId:n.id})}),document.querySelectorAll('script[src*="ai-assistant.min.js"][data-bot-id]').forEach(n=>{const r=n.getAttribute("data-bot-id");r&&!ga.has(r)&&w0({botId:r})})}return typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",$6):$6()),Zo.initDebalesChatbot=w0,Object.defineProperty(Zo,Symbol.toStringTag,{value:"Module"}),Zo}({});
4857
+ => User Action: Klaviyo form closed`}return""},pe=J=>{J instanceof CustomEvent&&ee(J)};return window.addEventListener("klaviyoForms",pe),()=>{window.removeEventListener("klaviyoForms",pe)}},[tt,t,r]),R.useEffect(()=>{const ee=Se.current;return ee?(ee.addEventListener("scroll",ft),()=>ee.removeEventListener("scroll",ft)):()=>{}},[ft]);const[tn,gi]=R.useState(!1),Qn=re==="Highest"?"120px":re==="Higher"?"60px":"15px",xr=async()=>{try{const ee=await fetch(`${Zn}/api/wordpress/support`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({chatid:an()+e,nameSpace:e,userName:ge.name,userEmail:ge.email,userMessage:ge.message,tag:"support"})});if(ee.ok)h(q=>[...q,{text:"Thanks for reaching out! Our support team has received your request and will get back to you within 24 hours.<br>In the meantime, feel free to continue chatting with me - I'll do my best to help!",isBot:!0}]),console.log("Connected to support with existing user info:",Nr());else{const q=await ee.json();console.error("Failed to connect to support:",q),h(pe=>[...pe,{text:"Sorry, we couldn't connect you to support at the moment.<br>Please try again later.",isBot:!0}])}}catch{h(q=>[...q,{text:"Sorry, we couldn't connect you to support at the moment.<br>Please try again later.",isBot:!0}])}},ae=()=>{const ee=Nr();ee&&ee.name&&ee.email&&_e({name:ee==null?void 0:ee.name,email:ee==null?void 0:ee.email,message:""}),h(q=>[...q,{text:"Please provide your name, email and message to connect with support.",isBot:!0}]),Y(!0)},j=async ee=>{ee.preventDefault(),ua({name:ge.name,email:ge.email}),Y(!1),h(q=>q.slice(0,-1)),await xr()},[xe,Ne]=R.useState({});R.useEffect(()=>{Bt&&(c.forEach((ee,q)=>{if(!ee.isBot)return;const pe=ll(ee.text);if(!(q in xe)||xe[q]<pe.length){let J;const Re=Oe=>{Oe<pe.length&&(J=setTimeout(()=>{Ne(De=>({...De,[q]:Oe+1})),Re(Oe+1)},Yt))};return q in xe?Re(xe[q]):(Ne(Oe=>({...Oe,[q]:1})),Re(1)),()=>clearTimeout(J)}}),Ne(ee=>{const q={};return c.forEach((pe,J)=>{ee[J]!==void 0&&(q[J]=ee[J])}),q}))},[c,Bt]);const[he,Ce]=R.useState(0);return R.useEffect(()=>{if(en.length===0)return;const ee=setInterval(()=>{Ce(q=>(q+1)%en.length)},7e3);return()=>clearInterval(ee)},[en.length]),R.useEffect(()=>{Ce(0)},[en.length]),!t||t.show_bot===!1||o?null:E.jsxs(Op,{theme:Vg(t),children:[E.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),E.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),E.jsx("link",{href:"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap",rel:"stylesheet"}),E.jsx(sre,{}),E.jsxs(Fne,{$topOffset:Qn,children:[!L&&!Q&&E.jsxs(zne,{$topOffset:Qn,$removeLogoBackground:t.removeLogoBackground,children:[E.jsx(Une,{$showAnimation:t.enableChatButtonBackgroundAnimation??!1,$animationType:"Ping",$animationColor:t.chatButtonBackgroundAnimationColor||"#f48722",$backgroundColor:t.backgroundColor||"#fff",$removeLogoBackground:t.removeLogoBackground,$topOffset:Qn,$iconSize:G}),E.jsxs(jne,{$backgroundColor:t.removeLogoBackground?"transparent":t.backgroundColor||"#fff",$botId:e,$iconSize:G,$removeLogoBackground:t.removeLogoBackground,topOffset:Qn,$showAnimation:t.enableChatButtonBackgroundAnimation,$animationType:"Ping",$animationColor:t.chatButtonBackgroundAnimationColor||"#f48722",id:"debales-chat-button",onClick:()=>{if(window.DebalesChat.track(mt.CHAT_BUTTON_CLICKED),et(!L,"chat_button_clicked"),!L){const ee=_();ee.length>0?(h(ee),Tt(!1),Et(!0)):(Tt(!0),Et(!1),setTimeout(()=>{Tt(!1),Et(!0);const q={text:(t==null?void 0:t.initialMessage)||"Hi, I am an AI chatbot, how can I help you today?",isBot:!0};h([q])},(Z==null?void 0:Z.showing_delay)||2e3))}},"aria-label":"Chat",children:[E.jsx(qne,{$botId:e,$removeLogoBackground:t.removeLogoBackground,"aria-hidden":"true",src:t.bot_logo,alt:"Chat Bot Icon"}),(Un==null?void 0:Un.length)>0&&!L&&ie&&E.jsx("div",{style:{position:"absolute",top:"0",left:"100%",transform:"translate(-50%, -50%)",backgroundColor:"#f44336",color:"white",borderRadius:"50%",width:"20px",height:"20px",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"12px",fontWeight:"bold",zIndex:2,opacity:ie?1:0,transition:"opacity 0.3s ease-in-out"},children:Un.length})]})]}),!L&&(en==null?void 0:en.length)!==0&&Q&&E.jsx(ore,{className:Te?"visible":"",$botId:e,$iconSize:G,$removeLogoBackground:t.removeLogoBackground,topOffset:Qn,style:{display:"flex",flexDirection:"column",alignItems:"center",marginLeft:X?"60px":"85px",marginRight:X?"60px":"85px",opacity:Te?1:0,transition:"opacity 0.3s ease-in-out"},children:en.length>0&&E.jsx(are,{$index:he,$totalCount:en.length,children:E.jsx(Nne,{messages:[{question:en[he].question,isHighlighted:en[he].isHighlighted??!1}],botId:e,uiData:t,onClose:()=>{ot(ee=>{const q=new Set(ee);return q.add(en[he].question),q})},onClick:()=>{et(!0,"suggested_question_clicked"),ot(ee=>{const q=new Set(ee);return q.add(en[he].question),q}),window.DebalesChat.track(mt.SUGGESTED_QUESTION_CLICKED,{suggested_question:en[he]}),k?(C(!0),A(en[he])):r(en[he].Follow_up_Question??en[he].question,en[he].answer,en[he].products,!1,en[he].leading_queries)}})},he)})]}),L&&Kh.createPortal(E.jsx(E.Fragment,{children:E.jsxs(Wne,{$backgroundColor:t.backgroundColor||"#fff",$fullScreenOnMobile:t.fullScreenOnMobile,$headerFontColor:t.headerFontColor||"#1C1C1C",$topOffset:Qn,$mobileDisplayMode:t.mobileDisplayMode,$isVisible:Ue,children:[E.jsxs(Kne,{$backgroundColor:t.backgroundColor||"#fff",style:{color:t.headerFontColor},children:[E.jsxs("div",{style:{display:"flex",columnGap:"10px",flex:"1 1 0%",alignItems:"center"},children:[E.jsx(Hne,{"aria-hidden":"true",src:t.bot_logo,alt:"Chat Bot Icon"}),E.jsxs(Gne,{$botNameColor:t.headerFontColor,children:[E.jsxs("div",{style:{fontWeight:"700",wordBreak:"break-word"},children:[t.chatbotName,e==="catch-org-ai"&&E.jsx(Zne,{$backgroundColor:t.callToActionBackgroundColor,$fontColor:t.callToActionFontColor,children:"Beta"})]}),E.jsx(Vne,{children:E.jsx(hm,{})})]})]}),E.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[E.jsxs(lre,{children:[E.jsxs(ure,{onClick:ae,children:[E.jsx(pm,{color:t.headerFontColor}),E.jsx(cre,{children:"Support"})]}),E.jsx(s6,{children:"Need more help? I'll connect you with a support agent."})]}),(t.mobileDisplayMode==="half-screen"||t.mobileDisplayMode==="full-screen")&&X&&E.jsx("button",{onClick:()=>{const ee=t.mobileDisplayMode==="full-screen"?"half-screen":"full-screen";v(ee)},style:{background:"none",border:"none",cursor:"pointer",padding:"0",marginRight:"10px",display:"flex",alignItems:"center"},"aria-label":t.mobileDisplayMode==="full-screen"?"Switch to half screen":"Switch to full screen",children:t.mobileDisplayMode==="full-screen"?E.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:E.jsx("path",{d:"M4.5 15.75V13.5H2.25V12H6V15.75H4.5ZM12 15.75V12H15.75V13.5H13.5V15.75H12ZM2.25 6V4.5H4.5V2.25H6V6H2.25ZM12 6V2.25H13.5V4.5H15.75V6H12Z",fill:"black"})}):E.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:E.jsx("path",{d:"M10 3.75H16.25V10H14.5833V6.595L6.595 14.5833H10V16.25H3.75V10H5.41667V13.405L13.405 5.41667H10V3.75Z",fill:"black"})})}),E.jsx(Yne,{onClick:()=>{Ie?Ar(!0):et(!1,"close_button_clicked")},id:"debales-minimize-button","aria-label":"Minimize",children:E.jsx(zu,{botNameColor:t.headerFontColor})})]})]}),E.jsxs(Xne,{$backgroundColor:t.botBackgroundColor||"#fff",$mobileDisplayMode:t.mobileDisplayMode,children:[tn&&((bt=(ut=t.pluginConfig)==null?void 0:ut.collectedUserInfo)==null?void 0:bt.discount)&&E.jsx(mm,{discount:t.pluginConfig.collectedUserInfo.discount,uiData:t,onClose:()=>{gi(!1),window.DebalesChat.track(mt.DISCOUNT_VIEWED,{discount:t.pluginConfig.collectedUserInfo.discount})}}),E.jsx(f0,{uidata:t,product:zr,showModel:Fr,setShowModel:pi,onVariantSelect:ee=>{$(ee.id,1),window.DebalesChat.track(mt.ADD_TO_CART_CLICKED,{product:ee.title,price:Number(ee.price),link:`https://${t.shopifyShopDomain}/variants/${ee.id}`,message:a,chatId:an()+e})}}),oi&&E.jsx(ym,{setShowExitModal:Ar,handleCloseChatbot:ai,chatId:an()+e}),E.jsxs(Qne,{id:"debales-conversation-group",$botBackgroundColor:t.botBackgroundColor||"#fff",ref:Se,$mobileDisplayMode:t.mobileDisplayMode,children:[Bt&&c.map((ee,q)=>{const pe=ee.isBot,J=ll(ee.text);return ee.hideConfirmation?null:E.jsxs(R.Fragment,{children:[pe&&E.jsxs(i6,{$fontColor:t.botFontColor||"#000",$botMessageColor:t.botBackgroundColor||"#fff",children:[E.jsx("img",{src:pe?t.bot_logo:t.userMessage_logo,alt:"Chat User Icon"}),E.jsxs(a6,{children:[J.slice(0,xe[q]||0).map((Re,Oe)=>E.jsx("div",{children:E.jsx(wd,{$botMessageColor:pe?t.botMessageColor||"#fff":t.userMessageColor||"#fff",style:{color:t.botFontColor},children:E.jsx(Ga,{remarkPlugins:[fp,rm],children:Re})})},Oe)),ee.collections&&a===ee.conversationId&&We.collections&&E.jsx(gm,{message:ee,botId:e,uidata:t,onSendMessage:r,loading:d}),ee.products&&a===ee.conversationId&&We.products&&E.jsx(_m,{message:ee,botId:e,uidata:t,onSendMessage:r,loading:d,storeMetaData:n,platform:P,setShowVariantModel:pi,setSelectedProduct:no,setCartVersion:je}),i&&E.jsx(qw,{children:E.jsx(fd,{onClick:()=>{window._klOnsite&&(window._klOnsite.push(["openForm",lt]),et(!1,"klaviyo_grab_deal_button"))},children:"🚀 Grab Deal Now!"})}),c.length==1&&q==0&&!b&&E.jsx(qw,{children:Un.map((Re,Oe)=>E.jsx(o6,{style:{backgroundColor:t.callToActionBackgroundColor,color:t.callToActionFontColor,opacity:Qe.has(Re.question)?.5:1},onClick:()=>{k?(C(!0),A({question:Re.question,answer:Re.answer,products:Re.products,path:"/",nameSpace:window.DebalesChat.projectId})):r(Re.question,Re.answer,Re.products),ot(De=>{const ct=new Set(De);return ct.add(Re.question),ct}),window.DebalesChat.track(mt.INITIAL_LEADING_QUERY_SUGGESTED_QUESTION_CLICKED,{question:Re.question})},disabled:d,$disabled:d,children:Re.question},Oe))}),ee.leading_queries&&ee.leading_queries.length>0&&a===ee.conversationId&&We.leadingQueries&&!i&&!b&&E.jsx(qw,{children:ee.leading_queries.map((Re,Oe)=>E.jsx(o6,{style:{backgroundColor:t.callToActionBackgroundColor,color:t.callToActionFontColor},onClick:()=>{k?(C(!0),A({question:Re,path:"/",nameSpace:window.DebalesChat.projectId})):r(Re),window.DebalesChat.track(mt.LEADING_QUERY_CLICKED,{query:Re})},disabled:d,$disabled:d,children:Re},Oe))}),I&&I.itemCount>0&&a===ee.conversationId&&We.cartSummary&&E.jsxs(nre,{children:[E.jsx(wd,{$botMessageColor:t.botMessageColor,style:{width:"max-content",color:t.botFontColor},dangerouslySetInnerHTML:{__html:`<span style="display: flex; align-items: center; justify-content: center;">Total Price: ${sm((I==null?void 0:I.total)??0,(I==null?void 0:I.currency)??"USD")} </span>`}}),E.jsxs(am,{href:B(t.shopifyShopDomain??""),onClick:Jt,children:[E.jsx("span",{children:"Checkout"}),E.jsx(dm,{style:{width:"20px",fill:t.callToActionFontColor}})]})]}),He&&He.length>0&&a===ee.conversationId&&We.bulkItems&&E.jsx(om,{onClick:()=>gr(ee.conversationId),children:"Add Bulk Items to Cart"}),b&&c.indexOf(ee)===c.length-1&&E.jsx(E.Fragment,{children:E.jsx(u0,{setShowModel:Re=>{var De,ct;const Oe=typeof Re=="function"?Re(b):Re;C(Oe),!Oe&&((ct=(De=t.pluginConfig)==null?void 0:De.collectedUserInfo)!=null&&ct.discount)&&gi(!0)},inChat:!0,showFormInstructions:!1})}),F&&c.indexOf(ee)===c.length-1&&E.jsxs(fre,{onSubmit:j,children:[E.jsxs(Hw,{children:[E.jsxs(Gw,{children:["Name",E.jsx("span",{children:"*"})]}),E.jsx(l6,{type:"text",required:!0,value:ge.name,onChange:Re=>_e(Oe=>({...Oe,name:Re.target.value})),placeholder:"John"})]}),E.jsxs(Hw,{children:[E.jsxs(Gw,{children:["Email",E.jsx("span",{children:"*"})]}),E.jsx(l6,{type:"email",required:!0,value:ge.email,onChange:Re=>_e(Oe=>({...Oe,email:Re.target.value})),placeholder:"olivia@untitledui.com"})]}),E.jsxs(Hw,{children:[E.jsxs(Gw,{children:["Message",E.jsx("span",{children:"*"})]}),E.jsx(dre,{required:!0,value:ge.message,onChange:Re=>_e(Oe=>({...Oe,message:Re.target.value})),placeholder:"I need help with..."})]}),E.jsx(pre,{children:E.jsx(hre,{type:"submit",children:"Submit"})})]}),ne&&!d&&a===ee.conversationId&&E.jsx(wd,{$botMessageColor:t.botMessageColor,style:{color:t.botFontColor},children:E.jsx(Po,{loading:ne,loadingPhrases:["🎨 Loading","✨ Almost","🚀 Ready"]})})]})]}),!pe&&E.jsx(rre,{$fontColor:t.userFontColor||"#000",$botMessageColor:t.botBackgroundColor||"#fff",children:E.jsx(wd,{$botMessageColor:pe?t.botMessageColor||"#fff":t.userMessageColor||"#fff",children:E.jsx(Ga,{children:ee.text})})})]},q)}),(d||at)&&E.jsxs(i6,{$fontColor:t.botFontColor||"#000",$botMessageColor:t.botBackgroundColor||"#fff",children:[E.jsx("img",{src:t.bot_logo,alt:"Chat User Icon"}),E.jsx(a6,{children:E.jsx(wd,{$botMessageColor:t.botMessageColor||"#fff",style:{backgroundColor:"transparent",padding:"0px"},children:E.jsx("div",{style:{display:"flex",alignItems:"center",gap:"4px",animation:"fadeIn 0.3s ease-in-out"},children:E.jsx(Po,{loading:d||at})})})})]})]}),E.jsxs("div",{className:"debales-footer-container",style:{width:"calc(100%-24px)",backgroundColor:t.footerBackgroundColor||"#fff",color:t.fontColor||"#000"},children:[e==="catch-org-ai"&&E.jsx(tre,{children:E.jsx("span",{children:'"Catch org AI" can make mistakes.'})}),E.jsx("div",{children:E.jsx(d0,{disabled:d,inputState:!1})}),(t.debales_branding??!0)&&E.jsxs(Jne,{href:"https://debales.ai/?open=true",target:"_blank",title:"debales-link",style:{color:t.fontColor?t.fontColor:"fff",marginTop:e==="catch-org-ai"?"0":"9px"},children:[E.jsx("p",{children:"Powered by"}),E.jsxs(ere,{children:[E.jsx("img",{src:`${Zn}/images/debales_logo_d.png`,alt:"Debales logo"}),E.jsx("p",{children:"DEBALES"})]})]})]})]})]})}),K.shadowRoot)]})},mre=({botId:e})=>{const t=k8("new-suggested-question-design");console.log(t);let n;return t==="variant-1"?n=Xte:t==="variant-2"?n=$ne:t==="variant-3"?n=gre:n=G4,E.jsx(n,{botId:e})},u6="debales-ai-assistant",c6="debales-chatbot-container",vre=R.forwardRef(({children:e,globalStyles:t="",containerStyles:n={},onReady:r},i)=>{const o=R.useRef(null),[a,u]=R.useState(null),c=R.useRef(null),d=R.useRef(null),p=R.useRef({get shadowRoot(){return c.current},get container(){return a},querySelector:h=>{var m;return((m=c.current)==null?void 0:m.querySelector(h))||null},querySelectorAll:h=>{var m;return((m=c.current)==null?void 0:m.querySelectorAll(h))||null}});return R.useImperativeHandle(i,()=>p.current,[]),R.useEffect(()=>{const h=document.getElementById(u6);if(h?o.current=h:o.current&&(o.current.id=u6),o.current&&(o.current.style.cssText="position: absolute; top: 0; left: 0; width: 0; height: 0;"),o.current){if(o.current.shadowRoot){c.current=o.current.shadowRoot;const _=c.current.querySelector(`#${c6}`);_&&u(_);return}const m=o.current.attachShadow({mode:"open"});if(c.current=m,t){const _=document.createElement("style");_.textContent=t,m.appendChild(_)}const v=document.createElement("div");v.id=c6,v.style.cssText="position: absolute; top: 0; left: 0; width: 0; height: 0;",m.appendChild(v),u(v),r&&r(m,v)}},[t,r]),R.useEffect(()=>(a&&!d.current&&(d.current=xE.createRoot(a)),d.current&&a&&d.current.render(E.jsx(Nq,{target:a,children:E.jsx(G3,{value:p.current,children:e})})),()=>{d.current&&d.current.unmount()}),[a,e]),E.jsx("div",{ref:o,style:n})});class Vw{isSupported(){return hs.detect()===this.platform}createSuccessResult(t,n){return{success:!0,data:t,message:n}}createErrorResult(t){return{success:!1,error:t}}}class yre extends Vw{constructor(){super(...arguments);Cr(this,"platform",Pr.DEFAULT)}async fetchCart(){return console.log("DefaultCartAdapter: fetchCart called"),this.createSuccessResult({items:[],total:0,itemCount:0,currency:"USD",token:"default-token"},"Default cart fetched")}async addToCart(n,r=1,i){return console.log("DefaultCartAdapter: addToCart called",{variantId:n,quantity:r,properties:i}),this.createSuccessResult(void 0,"Item added to cart (mock)")}async removeFromCart(n){return console.log("DefaultCartAdapter: removeFromCart called",{itemId:n}),this.createSuccessResult(void 0,"Item removed from cart (mock)")}async updateQuantity(n){return console.log("DefaultCartAdapter: updateQuantity called",{cartItem:n}),this.createSuccessResult(void 0,"Item quantity updated (mock)")}async clearCart(){return console.log("DefaultCartAdapter: clearCart called"),this.createSuccessResult(void 0,"Cart cleared (mock)")}generateCartUrl(n){const r=n.replace(/^https?:\/\//,"");return console.log("DefaultCartAdapter: generateCartUrl called",{domain:n,sanitizedDomain:r}),`https://${r}/cart`}generateProductUrl(n,r){if(r.handle){const i=new URL(`https://${n}/products/${r.handle}`);return i.searchParams.append("variant",r.product_id),pl(i.toString())}else return pl(r.link)}async addCartAttributes(n={}){return console.log("MethodNotImplemented: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}}class _re extends Vw{constructor(){var n,r;super();Cr(this,"platform",Pr.SHOPIFY);Cr(this,"cartEndpoint");Cr(this,"localCartKey","debales_track_cart");this.cartEndpoint=((r=(n=window.Shopify)==null?void 0:n.routes)==null?void 0:r.root)||"/"}normalizeCartData(n){return{items:n.items.map(r=>({id:r.id,variant_id:r.variant_id,quantity:r.quantity,title:r.title,price:r.price,properties:r.properties})),total:n.total_price/100,itemCount:n.item_count,currency:n.currency,token:n.token.split("?")[0]}}generateProductUrl(n,r){const i=c0(n);if(!i.isValid)return"";if(r.handle){const o=new URL(`/products/${r.handle}`,i.url);return o.searchParams.append("variant",r.product_id),pl(o.toString())}else return pl(r.link)}updateTrackCart({cartToken:n,sessionId:r=an()}){localStorage.setItem(this.localCartKey,JSON.stringify({sessionId:r,cartToken:n}))}async fetchCart(){try{const n=await fetch(`${this.cartEndpoint}cart.js`),r=await n.json();if(!n.ok){const o=r;return this.createErrorResult(o.description||`Failed to fetch cart: ${n.status}`)}const i=r;return this.createSuccessResult(this.normalizeCartData(i),"Cart fetched successfully")}catch(n){return this.createErrorResult(n instanceof Error?`Error fetching cart: ${n.message}`:"Unknown error occurred while fetching cart")}}async addToCart(n,r=1,i){try{const o=await fetch(`${this.cartEndpoint}cart/add.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:[{id:n,quantity:r,properties:i}],attributes:{dbls_order_source:"direct_recommendation",dbls_session_id:an(),dbls_method:"add_to_cart"}})}),a=await o.json();if(!o.ok){const u=a;return this.createErrorResult(u.description||`Failed to add item to cart: ${o.status}`)}return this.fetchCart().then(u=>{u.success&&this.updateTrackCart({cartToken:u==null?void 0:u.data.token})}),this.createSuccessResult(void 0,`Successfully added ${r} item(s) to cart`)}catch(o){return this.createErrorResult(o instanceof Error?`Error adding to cart: ${o.message}`:"Unknown error occurred while adding to cart")}}async removeFromCart(n){return this.updateQuantity({id:n,quantity:0})}async updateQuantity(n){try{const r=await fetch(`${this.cartEndpoint}cart/change.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:n.id,quantity:n.quantity})}),i=await r.json();if(!r.ok){const o=i;return this.createErrorResult(o.description||`Failed to update item quantity: ${r.status}`)}return this.fetchCart().then(o=>{o.success&&this.updateTrackCart({cartToken:o==null?void 0:o.data.token})}),this.createSuccessResult(void 0,n.quantity===0?"Item removed from cart":`Quantity updated to ${n.quantity}`)}catch(r){return this.createErrorResult(r instanceof Error?`Error updating quantity: ${r.message}`:"Unknown error occurred while updating quantity")}}async clearCart(){try{const n=await fetch(`${this.cartEndpoint}cart/clear.js`,{method:"POST"});if(!n.ok){const r=await n.json();return this.createErrorResult(r.description||`Failed to clear cart: ${n.status}`)}return this.createSuccessResult(void 0,"Cart cleared successfully")}catch(n){return this.createErrorResult(n instanceof Error?`Error clearing cart: ${n.message}`:"Unknown error occurred while clearing cart")}}async addCartAttributes(n={}){try{const r=await fetch(`${this.cartEndpoint}cart/update.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:{dbls_order_source:"direct_recommendation",dbls_session_id:an(),...n}})});if(!r.ok){const i=await r.json();return this.createErrorResult(i.description||`Failed to update cart attributes: ${r.status}`)}return this.createSuccessResult(void 0,"Cart attributes updated successfully")}catch(r){return this.createErrorResult(r instanceof Error?`Error updating cart attributes: ${r.message}`:"Unknown error occurred while updating cart attributes")}}generateCartUrl(n){const r=c0(n);if(!r.isValid)return"";const i=new URL("/cart",r.url);return i.searchParams.append("ref",`debales-ai-${new Date().toISOString()}`),i.searchParams.append("attributes[from]","debales-ai-chatbot"),i.searchParams.append("attributes[through]","add-to-cart"),i.searchParams.append("attributes[dbls_session_id]",an()),i.searchParams.append("timestamp",Date.now().toString()),pl(i.toString())}}class bre extends Vw{constructor(){var n,r;super();Cr(this,"platform",Pr.MAGENTO);Cr(this,"checkoutEndpoint");Cr(this,"baseUrl");this.checkoutEndpoint=((n=window.checkout)==null?void 0:n.checkoutUrl)||"/",this.baseUrl=((r=window.checkout)==null?void 0:r.baseUrl)||"/"}normalizeCartData(n){return{items:n.items.map(r=>({id:parseInt(r.item_id),variant_id:parseInt(r.product_id),quantity:r.qty,title:r.product_name,price:r.product_price_value,properties:{name:r.product_name}})),total:parseFloat(n.subtotalAmount),itemCount:n.summary_count,currency:"USD",token:n.data_id.toString()}}async fetchCart(){try{const n=await fetch(`${this.baseUrl}customer/section/load/?sections=cart&update_section_id=false`),r=await n.json();if(!n.ok)return this.createErrorResult(`Failed to fetch cart: ${n.status}`);const i=r.cart;return this.createSuccessResult(this.normalizeCartData(i),"Cart fetched successfully")}catch(n){return this.createErrorResult(n instanceof Error?`Error fetching cart: ${n.message}`:"Unknown error occurred while fetching cart")}}async addToCart(n,r=1){var i;try{const o=(i=document.querySelector('input[name="form_key"]'))==null?void 0:i.value;if(!o)return this.createErrorResult("Form key not found");const a=await fetch(`${this.checkoutEndpoint}cart/add`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({product:n,qty:r.toString(),form_key:o})});if(!a.ok)return this.createErrorResult(`Failed to add item to cart: ${a.status}`);try{window.require(["Magento_Customer/js/customer-data"],u=>u.reload(["cart"],!0))}catch(u){console.warn("Failed to reload cart data:",u)}return this.createSuccessResult(void 0,`Successfully added ${r} item(s) to cart`)}catch(o){return this.createErrorResult(o instanceof Error?`Error adding to cart: ${o.message}`:"Unknown error occurred while adding to cart")}}async removeFromCart(n){return console.log("MethodNotImplemented: removeFromCart called",{itemId:n}),this.createSuccessResult(void 0,"Item removed from cart (mock)")}async updateQuantity(n){return console.log("MethodNotImplemented: updateQuantity called",{cartItem:n}),this.createSuccessResult(void 0,"Item quantity updated (mock)")}async clearCart(){return console.log("MethodNotImplemented: clearCart called"),this.createSuccessResult(void 0,"Cart cleared (mock)")}generateCartUrl(n){const r=new URL(`https://${n}/checkout/cart?ref=debales-ai-${new Date().toISOString()}&attributes[from]=debales-ai-chatbot&attributes[through]=add-to-cart`);return r.searchParams.append("timestamp",Date.now().toString()),r.toString()}generateProductUrl(n,r){const i=c0(n);if(!i.isValid)return"";if(r.handle){const o=new URL(`/${r.handle}.html`,i.url);return pl(o.toString())}else return pl(r.link)}async addCartAttributes(n={}){return console.log("MethodNotImplemented: addCartAttributes called",{attributes:n}),this.createSuccessResult(void 0,"Cart attributes added (mock)")}}const ml=class ml{constructor(){Cr(this,"adapterCache");this.adapterCache=new Map}static getInstance(){return ml.instance||(ml.instance=new ml),ml.instance}getAdapter(t){const n=t||hs.detect(),r=this.adapterCache.get(n);if(r)return r;let i;switch(n){case Pr.SHOPIFY:i=new _re;break;case Pr.MAGENTO:i=new bre;break;default:console.warn(`No specific adapter found for platform ${n}, using default adapter`),i=new yre}return this.adapterCache.set(n,i),i}clearCache(){this.adapterCache.clear()}};Cr(ml,"instance");let Zw=ml;const xre=({adapter:e,children:t,autoFetch:n=!0})=>{const[r,i]=R.useState(!1),[o,a]=R.useState(null),[u,c]=R.useState(null),d=R.useCallback(async()=>{try{i(!0),a(null);const C=await e.fetchCart();C.success?c(C.data):a(C.error)}catch(C){a(C instanceof Error?C.message:"Failed to fetch cart")}finally{i(!1)}},[e]),p=async(C,k,A)=>{try{a(null);const I=await e.addToCart(C,k,A);return I.success&&await d(),I}catch(I){return{success:!1,error:I instanceof Error?I.message:"Failed to add item to cart"}}},h=async C=>{try{a(null);const k=await e.removeFromCart(C);return k.success&&await d(),k}catch(k){return{success:!1,error:k instanceof Error?k.message:"Failed to remove item from cart"}}},m=async C=>{try{a(null);const k=await e.updateQuantity(C);return k.success&&await d(),k}catch(k){return{success:!1,error:k instanceof Error?k.message:"Failed to update quantity"}}},v=async()=>{try{a(null);const C=await e.clearCart();return C.success&&await d(),C}catch(C){return{success:!1,error:C instanceof Error?C.message:"Failed to clear cart"}}},_=C=>e.generateCartUrl(C),S=(C,k)=>e.generateProductUrl(C,k),x=async C=>e.addCartAttributes(C);R.useEffect(()=>{n&&d()},[n,d]);const b={isLoading:r,error:o,cart:u,fetchCart:d,addToCart:p,removeFromCart:h,updateQuantity:m,clearCart:v,generateCartUrl:_,generateProductUrl:S,addCartAttributes:x};return E.jsx(C3.Provider,{value:b,children:t})},Fo=Object.create(null);Fo.open="0",Fo.close="1",Fo.ping="2",Fo.pong="3",Fo.message="4",Fo.upgrade="5",Fo.noop="6";const h0=Object.create(null);Object.keys(Fo).forEach(e=>{h0[Fo[e]]=e});const Yw={type:"error",data:"parser error"},f6=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",d6=typeof ArrayBuffer=="function",h6=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ww=({type:e,data:t},n,r)=>f6&&t instanceof Blob?n?r(t):p6(t,r):d6&&(t instanceof ArrayBuffer||h6(t))?n?r(t):p6(new Blob([t]),r):r(Fo[e]+(t||"")),p6=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function g6(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Kw;function wre(e,t){if(f6&&e.data instanceof Blob)return e.data.arrayBuffer().then(g6).then(t);if(d6&&(e.data instanceof ArrayBuffer||h6(e.data)))return t(g6(e.data));Ww(e,!1,n=>{Kw||(Kw=new TextEncoder),t(Kw.encode(n))})}const m6="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sd=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<m6.length;e++)Sd[m6.charCodeAt(e)]=e;const Sre=e=>{let t=e.length*.75,n=e.length,r,i=0,o,a,u,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const d=new ArrayBuffer(t),p=new Uint8Array(d);for(r=0;r<n;r+=4)o=Sd[e.charCodeAt(r)],a=Sd[e.charCodeAt(r+1)],u=Sd[e.charCodeAt(r+2)],c=Sd[e.charCodeAt(r+3)],p[i++]=o<<2|a>>4,p[i++]=(a&15)<<4|u>>2,p[i++]=(u&3)<<6|c&63;return d},Cre=typeof ArrayBuffer=="function",Qw=(e,t)=>{if(typeof e!="string")return{type:"message",data:v6(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Ere(e.substring(1),t)}:h0[n]?e.length>1?{type:h0[n],data:e.substring(1)}:{type:h0[n]}:Yw},Ere=(e,t)=>{if(Cre){const n=Sre(e);return v6(n,t)}else return{base64:!0,data:e}},v6=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},y6="",kre=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{Ww(o,!1,u=>{r[a]=u,++i===n&&t(r.join(y6))})})},Are=(e,t)=>{const n=e.split(y6),r=[];for(let i=0;i<n.length;i++){const o=Qw(n[i],t);if(r.push(o),o.type==="error")break}return r};function Ire(){return new TransformStream({transform(e,t){wre(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Xw;function p0(e){return e.reduce((t,n)=>t+n.length,0)}function g0(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Tre(e,t){Xw||(Xw=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(a,u){for(n.push(a);;){if(r===0){if(p0(n)<1)break;const c=g0(n,1);o=(c[0]&128)===128,i=c[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(p0(n)<2)break;const c=g0(n,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(p0(n)<8)break;const c=g0(n,8),d=new DataView(c.buffer,c.byteOffset,c.length),p=d.getUint32(0);if(p>Math.pow(2,21)-1){u.enqueue(Yw);break}i=p*Math.pow(2,32)+d.getUint32(4),r=3}else{if(p0(n)<i)break;const c=g0(n,i);u.enqueue(Qw(o?c:Xw.decode(c),t)),r=0}if(i===0||i>e){u.enqueue(Yw);break}}}})}const _6=4;function hr(e){if(e)return Mre(e)}function Mre(e){for(var t in hr.prototype)e[t]=hr.prototype[t];return e}hr.prototype.on=hr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},hr.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},hr.prototype.off=hr.prototype.removeListener=hr.prototype.removeAllListeners=hr.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this},hr.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},hr.prototype.emitReserved=hr.prototype.emit,hr.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},hr.prototype.hasListeners=function(e){return!!this.listeners(e).length};const m0=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),eo=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ore="arraybuffer";function Vae(){}function b6(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Rre=eo.setTimeout,$re=eo.clearTimeout;function v0(e,t){t.useNativeTimers?(e.setTimeoutFn=Rre.bind(eo),e.clearTimeoutFn=$re.bind(eo)):(e.setTimeoutFn=eo.setTimeout.bind(eo),e.clearTimeoutFn=eo.clearTimeout.bind(eo))}const Dre=1.33;function Lre(e){return typeof e=="string"?Nre(e):Math.ceil((e.byteLength||e.size)*Dre)}function Nre(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function x6(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Bre(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Pre(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class Fre extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Jw extends hr{constructor(t){super(),this.writable=!1,v0(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Fre(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Qw(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Bre(t);return n.length?"?"+n:""}}class zre extends Jw{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Are(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,kre(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=x6()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let w6=!1;try{w6=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Ure=w6;function jre(){}class qre extends zre{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class zo extends hr{constructor(t,n,r){super(),this.createRequest=t,v0(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=b6(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=zo.requestsCount++,zo.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=jre,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete zo.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(zo.requestsCount=0,zo.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",S6);else if(typeof addEventListener=="function"){const e="onpagehide"in eo?"pagehide":"unload";addEventListener(e,S6,!1)}}function S6(){for(let e in zo.requests)zo.requests.hasOwnProperty(e)&&zo.requests[e].abort()}const Hre=function(){const e=C6({xdomain:!1});return e&&e.responseType!==null}();class Gre extends qre{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Hre&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new zo(C6,this.uri(),t)}}function C6(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ure))return new XMLHttpRequest}catch{}if(!t)try{return new eo[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const E6=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Vre extends Jw{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=E6?{}:b6(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Ww(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}i&&m0(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=x6()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const eS=eo.WebSocket||eo.MozWebSocket;class Zre extends Vre{createSocket(t,n,r){return E6?new eS(t,n,r):n?new eS(t,n):new eS(t)}doWrite(t,n){this.ws.send(n)}}class Yre extends Jw{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Tre(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=Ire();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const o=()=>{r.read().then(({done:u,value:c})=>{u||(this.onPacket(c),o())}).catch(u=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&m0(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Wre={websocket:Zre,webtransport:Yre,polling:Gre},Kre=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Qre=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function tS(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=Kre.exec(e||""),o={},a=14;for(;a--;)o[Qre[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=Xre(o,o.path),o.queryKey=Jre(o,o.query),o}function Xre(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Jre(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}const nS=typeof addEventListener=="function"&&typeof removeEventListener=="function",y0=[];nS&&addEventListener("offline",()=>{y0.forEach(e=>e())},!1);class ps extends hr{constructor(t,n){if(super(),this.binaryType=Ore,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=tS(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=tS(n.host).host);v0(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Pre(this.opts.query)),nS&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},y0.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=_6,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ps.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ps.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Lre(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,m0(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(ps.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),nS&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=y0.indexOf(this._offlineEventListener);r!==-1&&y0.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ps.protocol=_6;class eie extends ps{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;ps.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ps.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(p(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,p(),n.close(),n=null)}const a=h=>{const m=new Error("probe error: "+h);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function u(){a("transport closed")}function c(){a("socket closed")}function d(h){n&&h.name!==n.name&&o()}const p=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",u),this.off("close",c),this.off("upgrading",d)};n.once("open",i),n.once("error",a),n.once("close",u),this.once("close",c),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let tie=class extends eie{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>Wre[i]).filter(i=>!!i)),super(t,r)}};function nie(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=tS(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const rie=typeof ArrayBuffer=="function",iie=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,k6=Object.prototype.toString,oie=typeof Blob=="function"||typeof Blob<"u"&&k6.call(Blob)==="[object BlobConstructor]",aie=typeof File=="function"||typeof File<"u"&&k6.call(File)==="[object FileConstructor]";function rS(e){return rie&&(e instanceof ArrayBuffer||iie(e))||oie&&e instanceof Blob||aie&&e instanceof File}function _0(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(_0(e[n]))return!0;return!1}if(rS(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return _0(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&_0(e[n]))return!0;return!1}function sie(e){const t=[],n=e.data,r=e;return r.data=iS(n,t),r.attachments=t.length,{packet:r,buffers:t}}function iS(e,t){if(!e)return e;if(rS(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=iS(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=iS(e[r],t));return n}return e}function lie(e,t){return e.data=oS(e.data,t),delete e.attachments,e}function oS(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=oS(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=oS(e[n],t));return e}const uie=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],cie=5;var Kt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Kt||(Kt={}));class fie{constructor(t){this.replacer=t}encode(t){return(t.type===Kt.EVENT||t.type===Kt.ACK)&&_0(t)?this.encodeAsBinary({type:t.type===Kt.EVENT?Kt.BINARY_EVENT:Kt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Kt.BINARY_EVENT||t.type===Kt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=sie(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function A6(e){return Object.prototype.toString.call(e)==="[object Object]"}class aS extends hr{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Kt.BINARY_EVENT;r||n.type===Kt.BINARY_ACK?(n.type=r?Kt.EVENT:Kt.ACK,this.reconstructor=new die(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(rS(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Kt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Kt.BINARY_EVENT||r.type===Kt.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(aS.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Kt.CONNECT:return A6(n);case Kt.DISCONNECT:return n===void 0;case Kt.CONNECT_ERROR:return typeof n=="string"||A6(n);case Kt.EVENT:case Kt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&uie.indexOf(n[0])===-1);case Kt.ACK:case Kt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class die{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=lie(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const hie=Object.freeze(Object.defineProperty({__proto__:null,Decoder:aS,Encoder:fie,get PacketType(){return Kt},protocol:cie},Symbol.toStringTag,{value:"Module"}));function xo(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const pie=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class I6 extends hr{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[xo(t,"open",this.onopen.bind(this)),xo(t,"packet",this.onpacket.bind(this)),xo(t,"error",this.onerror.bind(this)),xo(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,o;if(pie.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const a={type:Kt.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const p=this.ids++,h=n.pop();this._registerAckCallback(p,h),a.id=p}const u=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!u||(c?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let u=0;u<this.sendBuffer.length;u++)this.sendBuffer[u].id===t&&this.sendBuffer.splice(u,1);n.call(this,new Error("operation has timed out"))},i),a=(...u)=>{this.io.clearTimeoutFn(o),n.apply(this,u)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,i)=>{const o=(a,u)=>a?i(a):r(u);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Kt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Kt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Kt.EVENT:case Kt.BINARY_EVENT:this.onevent(t);break;case Kt.ACK:case Kt.BINARY_ACK:this.onack(t);break;case Kt.DISCONNECT:this.ondisconnect();break;case Kt.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Kt.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Kt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function tc(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}tc.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0},tc.prototype.reset=function(){this.attempts=0},tc.prototype.setMin=function(e){this.ms=e},tc.prototype.setMax=function(e){this.max=e},tc.prototype.setJitter=function(e){this.jitter=e};class sS extends hr{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,v0(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new tc({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||hie;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new tie(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=xo(n,"open",function(){r.onopen(),t&&t()}),o=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),t?t(u):this.maybeReconnectOnOpen()},a=xo(n,"error",o);if(this._timeout!==!1){const u=this._timeout,c=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},u);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(xo(t,"ping",this.onping.bind(this)),xo(t,"data",this.ondata.bind(this)),xo(t,"error",this.onerror.bind(this)),xo(t,"close",this.onclose.bind(this)),xo(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){m0(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new I6(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Cd={};function b0(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=nie(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=Cd[i]&&o in Cd[i].nsps,u=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let c;return u?c=new sS(r,t):(Cd[i]||(Cd[i]=new sS(r,t)),c=Cd[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(b0,{Manager:sS,Socket:I6,io:b0,connect:b0});const vl=class vl{constructor(){Cr(this,"socket",null);Cr(this,"isConnected",!1);Cr(this,"eventListeners",new Map)}static getInstance(){return vl.instance||(vl.instance=new vl),vl.instance}connect(t){return this.socket?this.socket:(this.socket=b0(`${hK}${t}`,{transports:["websocket"]}),this.socket.on("connect",()=>{this.isConnected=!0,this.emitEvent("connect")}),this.socket.on("disconnect",()=>{this.isConnected=!1,this.emitEvent("disconnect")}),this.socket)}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null,this.isConnected=!1,this.eventListeners.clear())}getSocket(){return this.socket}getIsConnected(){return this.isConnected}on(t,n){var r,i;this.eventListeners.has(t)||this.eventListeners.set(t,[]),(r=this.eventListeners.get(t))==null||r.push(n),(i=this.socket)==null||i.on(t,n)}off(t,n){var i;const r=this.eventListeners.get(t);if(r){const o=r.indexOf(n);o>-1&&r.splice(o,1),(i=this.socket)==null||i.off(t,n)}}emit(t,...n){var r;(r=this.socket)==null||r.emit(t,...n)}emitEvent(t,...n){const r=this.eventListeners.get(t);r&&r.forEach(i=>i(...n))}};Cr(vl,"instance");let lS=vl;const Uo=lS.getInstance();var gie={MESSAGE:"MESSAGE"},mie={USER:"USER"};function x0(e,t){window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:t}))}const T6=(e,t)=>{const n=JSON.stringify(t);window.localStorage.setItem(e,n),x0(e,n)},vie=e=>{window.localStorage.removeItem(e),x0(e,null)},M6=e=>window.localStorage.getItem(e),yie=e=>(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)),_ie=()=>{throw Error("useLocalStorage is a client-only hook")};function bie(e,t){const n=()=>M6(e),r=R.useSyncExternalStore(yie,n,_ie),i=R.useCallback(o=>{try{const a=typeof o=="function"?o(JSON.parse(r)):o;a==null?vie(e):T6(e,a)}catch(a){console.warn(a)}},[e,r]);return R.useEffect(()=>{M6(e)===null&&T6(e,t)},[e,t]),[r?JSON.parse(r):t,i]}const O6=(e,t)=>{const n=JSON.stringify(t);window.sessionStorage.setItem(e,n),x0(e,n)},xie=e=>{window.sessionStorage.removeItem(e),x0(e,null)},R6=e=>window.sessionStorage.getItem(e),wie=e=>(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)),Sie=()=>{throw Error("useSessionStorage is a client-only hook")};function Cie(e,t){const n=()=>R6(e),r=R.useSyncExternalStore(wie,n,Sie),i=R.useCallback(o=>{try{const a=typeof o=="function"?o(JSON.parse(r)):o;a==null?xie(e):O6(e,a)}catch(a){console.warn(a)}},[e,r]);return R.useEffect(()=>{R6(e)===null&&O6(e,t)},[e,t]),[r?JSON.parse(r):t,i]}const Eie=({children:e,nameSpace:t})=>{const[n,r]=R.useState(""),[i,o]=R.useState([]),[a,u]=R.useState(!1),[c,d]=R.useState(!1),[p,h]=R.useState([]),[m,v]=R.useState(!1),[_,S]=R.useState(!1),[x,b]=R.useState([]),[C,k]=bie(qt(jt.USER_INFO),null),[A,I]=Cie(qt(jt.IS_FORM_CLOSED_BY_USER),!1),[$,B]=er.useState(null),U=ja("web-socket"),[G,P]=er.useState([]),[K,re]=R.useState(null),[ue,Z]=R.useState(!1),[ie,V]=R.useState(sessionStorage.getItem(qt(jt.LAST_SHOWN_MESSAGE_ID,{botId:t}))),Q=yK(),ye=an(),[Te,T]=er.useState(null),[X,ve]=R.useState(null);R.useEffect(()=>{if(U){const je=Uo.connect("/api/v1/chat");re(je);const Se=()=>{console.debug("connected to websocket"),Z(!0)},Ye=()=>{console.debug("disconnected from websocket"),Z(!1)},Qe=et=>{console.debug("response from websocket",et);const He=et.conversationId??crypto.randomUUID().toString();V(He),et.Variants_quantity&&b(F=>[...F,...et.Variants_quantity]);const N=[...i,{text:et.response,products:et.products,conversationId:He,rating:"neutral",leading_queries:et.leading_queries,collections:et.collections,variants:et.variants,shop:et.shop,Variants_quantity:et.Variants_quantity,monthlyChatLimitReached:et.monthlyChatLimitReached,isBot:!0}];o(N),L(N),h(F=>[...F,[i[i.length-1].text,et.response]]),d(!1)},ot=et=>{if(et.event==="error"){const He={text:"I am facing some network issues. Can you please check your network and try again?",isBot:!0},N=[...i,He];o(N),L(N),d(!1)}};return Uo.on("connect",Se),Uo.on("disconnect",Ye),Uo.on("response",Qe),Uo.on("system",ot),()=>{Uo.off("connect",Se),Uo.off("disconnect",Ye),Uo.off("response",Qe),Uo.off("system",ot)}}},[U,i]);const L=je=>{sessionStorage.setItem(qt(jt.CHAT_HISTORY,{botId:window.DebalesChat.projectId}),JSON.stringify(je))},we=()=>{const je=sessionStorage.getItem(qt(jt.CHAT_HISTORY,{botId:window.DebalesChat.projectId}));return je?JSON.parse(je):[]},Ue=R.useCallback(async()=>{if(t)try{u(!0);const je=await fetch(`${Zn}/api/wordpress/UiData?value=${t}`),Se=await je.json();if(!je.ok)throw new Error("failed to fetch data"+Se.error);const Ye=document.getElementById("debales-ai-assistant");Ye&&(Ye.style.zIndex=String(Se.zIndex??2031483602)),ve(Se),Se!=null&&Se.shopifyShopDomain&&NK(Se.shopifyShopDomain).then(ot=>{T(ot)}),P(Se.suggestedQuestions);const Qe=we();if(Qe.length>0)o(Qe);else{const ot={text:Se.initialMessage||"Hi, I am an AI Assistant. How can I help you?",isBot:!0};o([ot])}}catch(je){console.error(je)}finally{u(!1)}},[t]);R.useEffect(()=>{Ue()},[Ue]);const de=R.useMemo(()=>{var je;return!!(!A&&((je=X==null?void 0:X.pluginConfig)!=null&&je.collectedUserInfo)&&(X.pluginConfig.collectedUserInfo.name||X.pluginConfig.collectedUserInfo.email||X.pluginConfig.collectedUserInfo.phone)&&!C)},[X,C,A]),tt=R.useCallback(async(je,Se,Ye,Qe,ot,et)=>{if(!je||je.trim()===""||c&&!Ye)return;let He=[...i];Qe?Qe&&i.length<=2?(v(!0),He=[]):v(!1):(He.push({text:je,isBot:!1}),v(!1));const N=an();d(!0);try{o(He),L(He);const F=await fetch(`${Zn}/api/wordpress/ChatWithBot`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:N,userMessage:je,nameSpace:t,chat_history:p,leading_queries:ot,answer:Se,products:Ye,userInfo:JSON.stringify(C),anonymousUserId:Q,distinctId:Bo.getDistinctId(),timestamp:new Date().toISOString(),timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,followUpQuestion:et})});if(!F.ok)throw new Error("Network response was not ok");const Y=await F.json(),ge=Y.conversationId??crypto.randomUUID().toString();V(ge),Y.Variants_quantity&&b(Ie=>[...Ie,...Y.Variants_quantity]);const _e=[...He,{text:Y.response,products:Y.products,conversationId:ge,rating:"neutral",leading_queries:Y.leading_queries,collections:Y.collections,variants:Y.variants,shop:Y.shop,Variants_quantity:Y.Variants_quantity,monthlyChatLimitReached:Y.monthlyChatLimitReached,isBot:!0}];o(_e),L(_e),h(Ie=>[...Ie,[je,Y.response]])}catch(F){console.error(F);const Y={text:"I am facing some network issues. Can you please check your network and try again?",isBot:!0},ge=[...He,Y];Qe||(o(ge),L(ge))}finally{d(!1)}},[i,c,p,t,Q,C]),Ze=R.useCallback(je=>{X&&ve(Se=>Se?{...Se,mobileDisplayMode:je}:null)},[X]),lt=R.useCallback(async(je,Se,Ye,Qe,ot,et)=>{if(!je||je.trim()===""||c&&!Ye)return;let He=[...i];if(Qe?Qe&&i.length<=2?(v(!0),He=[]):v(!1):(He.push({text:je,isBot:!1}),v(!1)),d(!0),o(He),L(He),K&&ue){const N={type:gie.MESSAGE,role:mie.USER,query:je,nameSpace:t,leadingQueries:ot,answer:Se,products:Ye,userInfo:C,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,timestamp:new Date().toISOString(),sessionId:ye,anonymousUserId:Q,distinctId:Bo.getDistinctId(),followUpQuestion:et};Uo.emit("chat",N)}else tt(je,Se,Ye,Qe,ot,et)},[i,c,t,Q,K,ue,ye,tt,C]),gt={sessionId:ye,messages:i,isLoading:a,isMessageLoading:c,isKlaviyoMessage:m,showUserInfoModel:_,pendingBulkItems:x,lastedBotmessageId:ie,uiData:X,storeMetaData:Te,suggestedQuestions:G,isUserInfoNeeded:de,input:n,pendingQuestion:$,userInfo:C,isFormClosedByUser:A,onSendMessage:U?lt:tt,setMessages:o,setIsLoading:u,setIsMessageLoading:d,setIsKlaviyoMessage:v,setShowUserInfoModel:S,setPendingBulkItems:b,setLastedBotmessageId:V,fetchUiInfo:Ue,changeDisplayModel:Ze,saveConversation:L,loadConversation:we,setSuggestedQuestions:P,setUserInfo:k,setInput:r,setPendingQuestion:B,setIsFormClosedByUser:I};return E.jsx(V3.Provider,{value:gt,children:e})};function kie(e){const t=Zw.getInstance().getAdapter();return E.jsx(Eie,{nameSpace:e.botId,children:E.jsx(E8,{apiKey:pK,options:{capture_pageview:e.botId!=="burgerbaeclothing",capture_pageleave:e.botId!=="burgerbaeclothing",api_host:Zn+"/ingest",ui_host:"https://us.posthog.com",loaded:n=>{n.register({platform:hs.detect(),project:e.botId,sessionId:an()}),n.group("project",e.botId,{platform:hs.detect()});const r=Nr();r&&r.email&&!n._isIdentified()&&n.identify(r.email,{name:r.name,phone:r.phone,email:r.email,project:e.botId})},debug:!1},children:E.jsx(xre,{adapter:t,children:e.children})})})}function Aie(e){return E.jsx(vre,{children:E.jsx(kie,{botId:e.botId,children:E.jsx(mre,{...e})})})}const ga=new Map;function w0(e){const{botId:t}=e;if(ga.has(t))return console.warn(`Chatbot with botId "${t}" is already initialized. Skipping duplicate initialization.`),ga.get(t);const n=e.containerId||`debales-chatbot-${t}`;let r=document.getElementById(n);r||(r=document.createElement("div"),r.id=n,document.body.appendChild(r));const i=xE.createRoot(r);i.render(er.createElement(Aie,{botId:e.botId}));const o={container:r,unmount:()=>{if(i.unmount(),ga.delete(t),r&&r.parentNode&&document.body.contains(r))try{r.parentNode.removeChild(r)}catch(a){console.warn("Error removing chatbot container:",a)}}};return ga.set(t,o),o}typeof window<"u"&&(window.DebalesChatbotBrowser={init:w0,destroy:e=>{const t=ga.get(e);return t?(t.unmount(),!0):!1},isInitialized:e=>ga.has(e),getInitializedBots:()=>Array.from(ga.keys())});function $6(){document.querySelectorAll('[id="debales-ai-assistant"][data-bot-id]').forEach(n=>{const r=n.getAttribute("data-bot-id");r&&!ga.has(r)&&w0({botId:r,containerId:n.id})}),document.querySelectorAll('script[src*="ai-assistant.min.js"][data-bot-id]').forEach(n=>{const r=n.getAttribute("data-bot-id");r&&!ga.has(r)&&w0({botId:r})})}return typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",$6):$6()),Zo.initDebalesChatbot=w0,Object.defineProperty(Zo,Symbol.toStringTag,{value:"Module"}),Zo}({});