@tagadapay/plugin-sdk 3.1.11 → 3.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1129 -1129
- package/build-cdn.js +113 -228
- package/dist/external-tracker.js +2 -3
- package/dist/external-tracker.min.js +2 -2
- package/dist/external-tracker.min.js.map +3 -3
- package/dist/react/hooks/useShippingRates.d.ts +6 -0
- package/dist/react/hooks/useShippingRates.js +38 -0
- package/dist/react/providers/TagadaProvider.js +5 -5
- package/dist/react/services/apiService.d.ts +21 -0
- package/dist/react/services/apiService.js +10 -0
- package/dist/v2/core/funnelClient.d.ts +14 -15
- package/dist/v2/core/funnelClient.js +1 -1
- package/dist/v2/core/resources/shippingRates.d.ts +15 -0
- package/dist/v2/core/resources/shippingRates.js +11 -0
- package/dist/v2/core/utils/currency.d.ts +0 -14
- package/dist/v2/core/utils/currency.js +0 -40
- package/dist/v2/core/utils/index.d.ts +0 -1
- package/dist/v2/core/utils/index.js +0 -2
- package/dist/v2/core/utils/pluginConfig.d.ts +0 -8
- package/dist/v2/core/utils/pluginConfig.js +0 -28
- package/dist/v2/core/utils/previewModeIndicator.js +101 -101
- package/dist/v2/index.d.ts +1 -1
- package/dist/v2/react/components/ApplePayButton.js +13 -4
- package/dist/v2/react/components/FunnelScriptInjector.js +30 -30
- package/dist/v2/react/hooks/useFunnel.d.ts +1 -2
- package/dist/v2/react/hooks/useGoogleAutocomplete.js +82 -33
- package/dist/v2/react/hooks/usePixelTracking.d.ts +5 -0
- package/dist/v2/react/hooks/usePixelTracking.js +108 -0
- package/dist/v2/react/hooks/useShippingRatesQuery.d.ts +6 -0
- package/dist/v2/react/hooks/useShippingRatesQuery.js +36 -1
- package/dist/v2/react/hooks/useStepConfig.d.ts +2 -8
- package/dist/v2/react/hooks/useStepConfig.js +1 -1
- package/dist/v2/react/providers/TagadaProvider.js +5 -5
- package/dist/v2/standalone/index.js +1 -1
- package/package.json +112 -112
- package/dist/tagada-sdk.js +0 -10166
- package/dist/tagada-sdk.min.js +0 -48
- package/dist/tagada-sdk.min.js.map +0 -7
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TagadaPay External Tracker v3.1.
|
|
2
|
+
* TagadaPay External Tracker v3.1.12
|
|
3
3
|
* CDN Bundle - Standalone tracking for external pages
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
"use strict";var TagadaTrackerBundle=(()=>{var Gt=Object.defineProperty,Or=Object.defineProperties,Rr=Object.getOwnPropertyDescriptor,vr=Object.getOwnPropertyDescriptors,Pr=Object.getOwnPropertyNames,Li=Object.getOwnPropertySymbols;var Di=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable;var De=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),xr=t=>{throw TypeError(t)};var _i=(t,e,n)=>e in t?Gt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,v=(t,e)=>{for(var n in e||(e={}))Di.call(e,n)&&_i(t,n,e[n]);if(Li)for(var n of Li(e))Nr.call(e,n)&&_i(t,n,e[n]);return t},z=(t,e)=>Or(t,vr(e));var Ie=(t,e)=>()=>(t&&(e=t(t=0)),e);var yn=(t,e)=>{for(var n in e)Gt(t,n,{get:e[n],enumerable:!0})},kr=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Pr(e))!Di.call(t,o)&&o!==n&&Gt(t,o,{get:()=>e[o],enumerable:!(i=Rr(e,o))||i.enumerable});return t};var Lr=t=>kr(Gt({},"__esModule",{value:!0}),t);var ve=function(t,e){this[0]=t,this[1]=e},On=(t,e,n)=>{var i=(s,a,l,u)=>{try{var d=n[s](a),p=(a=d.value)instanceof ve,S=d.done;Promise.resolve(p?a[0]:a).then(w=>p?i(s==="return"?s:"next",a[1]?{done:w.done,value:w.value}:w,l,u):l({value:w,done:S})).catch(w=>i("throw",w,l,u))}catch(w){u(w)}},o=s=>r[s]=a=>new Promise((l,u)=>i(s,a,l,u)),r={};return n=n.apply(t,e),r[De("asyncIterator")]=()=>r,o("next"),o("throw"),o("return"),r},Rn=t=>{var e=t[De("asyncIterator")],n=!1,i,o={};return e==null?(e=t[De("iterator")](),i=r=>o[r]=s=>e[r](s)):(e=e.call(t),i=r=>o[r]=s=>{if(n){if(n=!1,r==="throw")throw s;return s}return n=!0,{done:!1,value:new ve(new Promise(a=>{var l=e[r](s);l instanceof Object||xr("Object expected"),a(l)}),1)}}),o[De("iterator")]=()=>o,i("next"),"throw"in e?i("throw"):o.throw=r=>{throw r},"return"in e&&i("return"),o},Bi=(t,e,n)=>(e=t[De("asyncIterator")])?e.call(t):(t=t[De("iterator")](),e={},n=(i,o)=>(o=t[i])&&(e[i]=r=>new Promise((s,a,l)=>(r=o.call(t,r),l=r.done,Promise.resolve(r.value).then(u=>s({value:u,done:l}),a)))),n("next"),n("return"),e);function Ui(t){var i;if(typeof document=="undefined")return null;let n="; ".concat(document.cookie).split("; ".concat(t,"="));return n.length===2&&((i=n.pop())==null?void 0:i.split(";").shift())||null}function Fi(t="local"){let e=Mi[t];if(!e)return console.warn("Unknown environment: ".concat(t,". Falling back to local.")),{environment:"local",apiConfig:Mi.local};let n=null;if(typeof window!="undefined"&&(n=new URLSearchParams(window.location.search).get("tagadaClientBaseUrl"),!n))try{n=localStorage.getItem("tgd_client_base_url")||Ui("tgd_client_base_url")}catch(o){}return n?(console.log("[SDK] Using custom API base URL override: ".concat(n)),{environment:t,apiConfig:z(v({},e),{baseUrl:n})}):{environment:t,apiConfig:e}}function ot(){var o;if(console.log("[SDK] detectEnvironment() called"),typeof window=="undefined")return"local";let e=new URLSearchParams(window.location.search).get("tagadaClientEnv");if(e&&(e==="production"||e==="development"||e==="local"))return console.log("[SDK] Using explicit environment override: ".concat(e)),e;try{let r=localStorage.getItem("tgd_client_env")||Ui("tgd_client_env");if(r&&(r==="production"||r==="development"||r==="local"))return console.log("[SDK] Using persisted environment override: ".concat(r)),r}catch(r){}let n=window.location.hostname,i=window.location.href;if(console.log('[SDK] detectEnvironment() - hostname: "'.concat(n,'"')),n==="localhost"||n.startsWith("127.")||n.startsWith("192.168.")||n.startsWith("10.")||n.includes(".local")||n===""||n==="0.0.0.0"||n.includes("ngrok-free.dev")||n.includes("ngrok-free.app")||n.includes("ngrok.io")||n.includes("ngrok.app")){if(console.log("[SDK] detectEnvironment() - returning LOCAL"),typeof window!="undefined"&&((o=window==null?void 0:window.__TAGADA_ENV__)!=null&&o.TAGADA_ENVIRONMENT)){let r=window.__TAGADA_ENV__.TAGADA_ENVIRONMENT.toLowerCase();if(r==="production"||r==="development"||r==="local")return console.log("[SDK] Local override detected: ".concat(r)),r}return"local"}return n==="app.tagadapay.com"||n.includes("tagadapay.com")||n.includes("yourproductiondomain.com")?"production":n==="app.tagadapay.dev"||n.includes("tagadapay.dev")||n.includes("vercel.app")||n.includes("netlify.app")||n.includes("surge.sh")||n.includes("github.io")||n.includes("herokuapp.com")||n.includes("railway.app")||i.includes("?env=dev")||i.includes("?dev=true")||i.includes("#dev")?"development":(console.warn("[SDK] Unknown domain: ".concat(n,", defaulting to production")),"production")}function rt(t=!1){return ot()!=="local"?!1:t&&typeof window!="undefined"?!window.location.hostname.includes(".cdn."):!0}var Mi,Vt=Ie(()=>{"use strict";Mi={production:{baseUrl:"https://app.tagadapay.com",endpoints:{checkout:{sessionInit:"/api/v1/checkout/session/init",sessionInitAsync:"/api/v1/checkout/session/init-async",sessionStatus:"/api/v1/checkout/session/status",asyncStatus:"/api/public/v1/checkout/async-status"},customer:{profile:"/api/v1/customer/profile",session:"/api/v1/customer/session"},store:{config:"/api/v1/store/config"}}},development:{baseUrl:"https://app.tagadapay.dev",endpoints:{checkout:{sessionInit:"/api/v1/checkout/session/init",sessionInitAsync:"/api/v1/checkout/session/init-async",sessionStatus:"/api/v1/checkout/session/status",asyncStatus:"/api/public/v1/checkout/async-status"},customer:{profile:"/api/v1/customer/profile",session:"/api/v1/customer/session"},store:{config:"/api/v1/store/config"}}},local:{baseUrl:"http://app.localhost:3000",endpoints:{checkout:{sessionInit:"/api/v1/checkout/session/init",sessionInitAsync:"/api/v1/checkout/session/init-async",sessionStatus:"/api/v1/checkout/session/status",asyncStatus:"/api/public/v1/checkout/async-status"},customer:{profile:"/api/v1/customer/profile",session:"/api/v1/customer/session"},store:{config:"/api/v1/store/config"}}}}});var Kt,vn=Ie(()=>{"use strict";Kt=class{constructor(e){this.apiClient=e}async initialize(e){return this.apiClient.post("/api/v1/funnel/initialize",e)}async navigate(e){return this.apiClient.post("/api/v1/funnel/navigate",e)}async updateContext(e,n){return this.apiClient.patch("/api/v1/funnel/context/".concat(e),n)}async endSession(e){return this.apiClient.delete("/api/v1/funnel/session/".concat(e))}async getSession(e,n,i){let o=new URLSearchParams;n&&o.append("currentUrl",n),i&&o.append("includeDebugData","true");let r="/api/v1/funnel/session/".concat(e).concat(o.toString()?"?".concat(o):"");return this.apiClient.get(r)}}});var Be,Pn=Ie(()=>{"use strict";Be=class{constructor(){this.listeners=new Set}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){this.listeners.forEach(n=>{try{n(e)}catch(i){console.error("Error in event listener:",i)}})}clear(){this.listeners.clear()}}});function ne(t){if(typeof window!="undefined")try{let n=localStorage.getItem(Wt)!==t;localStorage.setItem(Wt,t),n&&window.dispatchEvent(new Event("storage"))}catch(e){console.error("Failed to save token to localStorage:",e)}}function st(){if(typeof window!="undefined")try{return localStorage.getItem(Wt)}catch(t){return console.error("Failed to get token from localStorage:",t),null}return null}function Me(){if(typeof window!="undefined")try{localStorage.removeItem(Wt)}catch(t){console.error("Failed to clear token from localStorage:",t)}}var Wt,Ue=Ie(()=>{"use strict";Wt="cms_token"});function Hi(t){typeof document!="undefined"&&(document.cookie="".concat(Nn,"=").concat(t,"; path=/; max-age=2592000; SameSite=Lax"))}function Gi(){if(typeof document=="undefined")return;let t=document.cookie.split("; ").find(e=>e.startsWith("".concat(Nn,"=")));return t?t.split("=")[1]:void 0}function zt(){typeof document!="undefined"&&(document.cookie="".concat(Nn,"=; path=/; max-age=0"))}var Nn,at=Ie(()=>{"use strict";Nn="tgd-funnel-session-id"});function Fe(t){if(typeof window=="undefined")return null;try{return localStorage.getItem(t)}catch(e){return null}}function Yt(t,e){if(typeof window!="undefined")try{localStorage.setItem(t,e)}catch(n){}}function lt(t){var i;if(typeof document=="undefined")return null;let n=document.cookie.split(";").find(o=>o.trim().startsWith("".concat(t,"=")));return n?(i=n.split("=")[1])==null?void 0:i.trim():null}function xn(t,e,n=86400){if(typeof document!="undefined"){if(t==="tgd_draft"||t==="tgd-draft"){console.warn("\u{1F6E1}\uFE0F [SDK] Blocked attempt to set ".concat(t," as cookie - this should only be in localStorage"));return}document.cookie="".concat(t,"=").concat(e,"; path=/; max-age=").concat(n)}}function Ki(t){typeof document!="undefined"&&(document.cookie="".concat(t,"=; path=/; max-age=0"))}function Pe(){if(typeof window=="undefined")return{};let t=new URLSearchParams(window.location.search),e,n=t.get("draft");if(n!==null)e=n==="true";else{let y=Fe(B.DRAFT);y!==null&&(e=y==="true")}let i,o=t.get("funnelTracking");if(o!==null)i=o!=="false";else{let y=Fe(B.FUNNEL_TRACKING)||lt(B.FUNNEL_TRACKING);y!==null&&(i=y!=="false")}let r=t.get("token")||st()||null,s=t.get("funnelSessionId")||null,a=t.get("funnelId")||null,l,u=t.get("funnelEnv");u&&(u==="staging"||u==="production")&&(l=u);let d=t.get("forceReset")==="true",p,S=t.get("tagadaClientEnv");if(S&&(S==="production"||S==="development"||S==="local"))p=S;else{let y=Fe(B.CLIENT_ENV)||lt(B.CLIENT_ENV);y&&(y==="production"||y==="development"||y==="local")&&(p=y)}let w,f=t.get("tagadaClientBaseUrl");if(f)w=f;else{let y=Fe(B.CLIENT_BASE_URL)||lt(B.CLIENT_BASE_URL);y&&(w=y)}let C,b=t.get("currency");if(b)C=b;else{let y=Fe(B.CURRENCY)||lt(B.CURRENCY);y&&(C=y)}let R,L=t.get("locale");if(L)R=L;else{let y=Fe(B.LOCALE)||lt(B.LOCALE);y&&(R=y)}return{forceReset:d,token:r,funnelSessionId:s,funnelId:a,draft:e,funnelTracking:i,funnelEnv:l,tagadaClientEnv:p,tagadaClientBaseUrl:w,currency:C,locale:R}}function ct(){var e;return(e=Pe().draft)!=null?e:!1}function kn(t){if(typeof window!="undefined")if(t)Yt(B.DRAFT,"true");else try{localStorage.removeItem(B.DRAFT)}catch(e){}}function Wi(t=!1){let e=null;typeof window!="undefined"&&(e=new URLSearchParams(window.location.search).get("token"));let n=Pe(),i=n.forceReset||!1;if(!i&&!n.token)return Vi(),!1;t&&(console.log("[SDK] Detected params:",n),console.log("[SDK] URL token (direct read):",e?e.substring(0,20)+"...":"none")),i&&(t&&console.log("[SDK] Force reset: Clearing all stored state"),Me(),zt(),typeof window!="undefined"&&window.localStorage&&Object.keys(localStorage).forEach(s=>{(s.startsWith("tagadapay_")||s.startsWith("tgd_"))&&(t&&console.log("[SDK] Clearing localStorage: ".concat(s)),localStorage.removeItem(s))}));let o=e||n.token;return o!=null?(t&&console.log("[SDK] Setting token from URL:",o.substring(0,20)+"..."),o===""||o==="null"?Me():(ne(o),t&&console.log("[SDK] \u2705 Token set in localStorage immediately after clear"))):i&&(t&&console.log("[SDK] Force reset mode (no token in URL)"),Me()),Vi(),n.funnelSessionId&&t&&console.log("[SDK] Using funnelSessionId from URL:",n.funnelSessionId),i}function Vi(){if(typeof window=="undefined")return;let t=new URLSearchParams(window.location.search),e=t.get("draft");e!==null&&kn(e==="true");let n=t.get("funnelTracking");n!==null&&_r(n!=="false");let i=t.get("tagadaClientEnv");i&&(i==="production"||i==="development"||i==="local")&&Dr(i);let o=t.get("tagadaClientBaseUrl");o&&Br(o)}function _r(t){if(typeof window=="undefined")return;let e=t?"true":"false";Yt(B.FUNNEL_TRACKING,e),xn(B.FUNNEL_TRACKING,e,86400)}function Dr(t){typeof window!="undefined"&&(Yt(B.CLIENT_ENV,t),xn(B.CLIENT_ENV,t,86400))}function zi(){if(typeof window!="undefined")try{localStorage.removeItem(B.CLIENT_ENV),Ki(B.CLIENT_ENV)}catch(t){}}function Br(t){typeof window!="undefined"&&(Yt(B.CLIENT_BASE_URL,t),xn(B.CLIENT_BASE_URL,t,86400))}function Yi(){if(typeof window!="undefined")try{localStorage.removeItem(B.CLIENT_BASE_URL),Ki(B.CLIENT_BASE_URL)}catch(t){}}function ji(){var e;return(e=Pe().funnelTracking)!=null?e:!0}var B,jt=Ie(()=>{"use strict";Ue();at();B={DRAFT:"tgd_draft",FUNNEL_TRACKING:"tgd_funnel_tracking",FORCE_RESET:"tgd_force_reset",CLIENT_ENV:"tgd_client_env",CLIENT_BASE_URL:"tgd_client_base_url",CURRENCY:"tgd_currency",LOCALE:"tgd_locale"}});function Ln(t){if(typeof window=="undefined"||typeof document=="undefined")return;let e=window.location.hostname,n=e.split("."),i=["",e,"."+e];for(let a=1;a<n.length;a++){let l=n.slice(a).join(".");i.push(l),i.push("."+l)}let o=window.location.pathname.split("/").filter(a=>a),r=["/"],s="";o.forEach(a=>{s+="/"+a,r.push(s)}),i.forEach(a=>{r.forEach(l=>{let u="".concat(t,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=").concat(l),d=a?"; domain=".concat(a):"";document.cookie=u+d,document.cookie=u+d+"; secure",document.cookie=u+d+"; SameSite=None; secure",document.cookie=u+d+"; SameSite=Lax",document.cookie=u+d+"; SameSite=Strict"})})}function Ur(){if(typeof window=="undefined"||!confirm("\u{1F6AA} Leave Preview Mode?\n\nThis will clear ALL cookies and localStorage (including Shopify session, cart, and preview settings) and reload the page.\n\nAre you sure?"))return;let e=new URL(window.location.href);["draft","funnelEnv","funnelTracking","tagadaClientEnv","tagadaClientBaseUrl","forceReset","funnelId","funnelSessionId","token"].forEach(r=>e.searchParams.delete(r)),window.history.replaceState({},"",e.href);try{let r=Object.getOwnPropertyDescriptor(Document.prototype,"cookie")||Object.getOwnPropertyDescriptor(HTMLDocument.prototype,"cookie");r&&r.set&&Object.defineProperty(document,"cookie",{configurable:!0,enumerable:!0,get:function(){return r.get?r.get.call(this):""},set:function(s){if(typeof s=="string"){let a=s.toLowerCase();if(a.includes("tgd_draft")||a.includes("tgd-draft")||a.includes("tgd.draft")||a.includes("tgddraft")){if(a.includes("max-age=0")||a.includes("expires=thu, 01 jan 1970")){r.set&&r.set.call(this,s);return}console.warn("\u{1F6E1}\uFE0F [TagadaPay] BLOCKED: tgd_draft should never be a cookie");return}}r.set&&r.set.call(this,s)}})}catch(r){console.warn("[TagadaPay] Could not install cookie blocker:",r)}if(window.localStorage)try{localStorage.removeItem("tgd_draft"),localStorage.removeItem("tgd_funnel_tracking"),localStorage.removeItem("tgd_client_env"),localStorage.removeItem("tgd_client_base_url"),localStorage.removeItem("cms_token")}catch(r){console.warn("[TagadaPay] Failed to clear some localStorage keys:",r)}Me(),zt(),zi(),Yi(),window.localStorage&&localStorage.clear(),window.sessionStorage&&sessionStorage.clear(),["tgd-funnel-session-id","tgd_draft","tgd_funnel_tracking","tgd_client_env","tgd_client_base_url","cms_token","tagadapay_session"].forEach(r=>Ln(r)),["tgd-draft","tgd_draft","tgd.draft","tgddraft"].forEach(r=>Ln(r)),document.cookie&&document.cookie.split(";").forEach(s=>{let a=s.split("=")[0].trim();if(!a)return;let l=window.location.hostname,u=l.split("."),d=["",l,"."+l];for(let f=1;f<u.length;f++){let C=u.slice(f).join(".");d.push(C),d.push("."+C)}let p=window.location.pathname.split("/").filter(f=>f),S=["/"],w="";p.forEach(f=>{w+="/"+f,S.push(w)}),d.forEach(f=>{S.forEach(C=>{let b="".concat(a,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=").concat(C),R=f?"; domain=".concat(f):"";document.cookie=b+R,document.cookie=b+R+"; secure",document.cookie=b+R+"; SameSite=None; secure",document.cookie=b+R+"; SameSite=Lax",document.cookie=b+R+"; SameSite=Strict",document.cookie=b+R+"; secure; SameSite=None",document.cookie=b+R+"; secure; SameSite=Lax",document.cookie=b+R+"; secure; SameSite=Strict"})})}),setTimeout(()=>{window.localStorage&&localStorage.length>0&&localStorage.clear(),Ln("tgd_draft"),typeof window.stop=="function"&&window.stop(),window.location.replace(e.href)},10)}function _n(){if($i||typeof window=="undefined"||typeof document=="undefined")return;let t=Pe(),e=ct(),n=!ji(),i=!!(t.tagadaClientEnv||t.tagadaClientBaseUrl);if(!e&&!n&&!i)return;let o=document.createElement("div");o.id="tgd-preview-indicator",o.style.cssText='\n position: fixed;\n bottom: 16px;\n right: 16px;\n z-index: 999999;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n ';let r=document.createElement("div");r.style.cssText="\n background: ".concat(e?"#ff9500":"#007aff",";\n color: white;\n padding: 8px 12px;\n border-radius: 8px;\n font-size: 13px;\n font-weight: 600;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n transition: all 0.2s ease;\n display: flex;\n align-items: center;\n gap: 6px;\n "),r.innerHTML='\n <span style="font-size: 16px;">\u{1F50D}</span>\n <span>'.concat(e?"Preview Mode":"Dev Mode","</span>\n ");let s=document.createElement("div");s.style.cssText="\n position: absolute;\n bottom: calc(100% + 8px);\n right: 0;\n background: white;\n border: 1px solid #e5e5e5;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n padding: 12px;\n min-width: 250px;\n font-size: 12px;\n line-height: 1.5;\n display: none;\n ",s.style.paddingTop="20px";let a=document.createElement("div");a.style.cssText="\n position: absolute;\n bottom: 100%;\n left: 0;\n right: 0;\n height: 8px;\n display: none;\n ";let l='<div style="margin-bottom: 8px; font-weight: 600; color: #1d1d1f;">Current Environment</div>';l+='<div style="display: flex; flex-direction: column; gap: 6px;">',e&&(l+='\n <div style="display: flex; justify-content: space-between; color: #86868b;">\n <span>Draft Mode:</span>\n <span style="color: #ff9500; font-weight: 600;">ON</span>\n </div>\n '),n&&(l+='\n <div style="display: flex; justify-content: space-between; color: #86868b;">\n <span>Tracking:</span>\n <span style="color: #ff3b30; font-weight: 600;">DISABLED</span>\n </div>\n '),t.funnelEnv&&(l+='\n <div style="display: flex; justify-content: space-between; color: #86868b;">\n <span>Funnel Env:</span>\n <span style="color: #1d1d1f; font-weight: 600; font-family: monospace; font-size: 11px;">\n '.concat(t.funnelEnv,"\n </span>\n </div>\n ")),t.tagadaClientEnv&&(l+='\n <div style="display: flex; justify-content: space-between; color: #86868b;">\n <span>API Env:</span>\n <span style="color: #1d1d1f; font-weight: 600; font-family: monospace; font-size: 11px;">\n '.concat(t.tagadaClientEnv,"\n </span>\n </div>\n ")),t.tagadaClientBaseUrl&&(l+='\n <div style="color: #86868b;">\n <div style="margin-bottom: 4px;">API URL:</div>\n <div style="color: #1d1d1f; font-weight: 600; font-family: monospace; font-size: 10px; word-break: break-all; background: #f5f5f7; padding: 4px 6px; border-radius: 4px;">\n '.concat(t.tagadaClientBaseUrl,"\n </div>\n </div>\n ")),t.funnelId&&(l+='\n <div style="color: #86868b; margin-top: 4px; padding-top: 8px; border-top: 1px solid #e5e5e5;">\n <div style="margin-bottom: 4px;">Funnel ID:</div>\n <div style="color: #1d1d1f; font-family: monospace; font-size: 10px; word-break: break-all; background: #f5f5f7; padding: 4px 6px; border-radius: 4px;">\n '.concat(t.funnelId,"\n </div>\n </div>\n ")),l+="</div>",l+='\n <div style="margin-top: 12px; padding-top: 8px; border-top: 1px solid #e5e5e5; font-size: 11px; color: #86868b; text-align: center;">\n Add <code style="background: #f5f5f7; padding: 2px 4px; border-radius: 3px;">?forceReset=true</code> to reset\n </div>\n ',l+='\n <div style="margin-top: 12px; padding-top: 8px; border-top: 1px solid #e5e5e5;">\n <button id="tgd-leave-preview" style="\n background: #ff3b30;\n color: white;\n border: none;\n border-radius: 6px;\n padding: 10px 12px;\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n transition: opacity 0.2s;\n width: 100%;\n ">\n \u{1F6AA} Leave Preview Mode\n </button>\n </div>\n ',s.innerHTML=l;let u=!1,d=()=>{u=!0,s.style.display="block",a.style.display="block"},p=()=>{u=!1,setTimeout(()=>{u||(s.style.display="none",a.style.display="none")},100)};r.addEventListener("mouseenter",d),r.addEventListener("mouseleave",p),a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",p),s.addEventListener("mouseenter",d),s.addEventListener("mouseleave",p);let S=s.querySelector("#tgd-leave-preview");S&&(S.addEventListener("mouseenter",()=>{S.style.opacity="0.8"}),S.addEventListener("mouseleave",()=>{S.style.opacity="1"}),S.addEventListener("click",w=>{w.stopPropagation(),Ur()})),o.appendChild(r),o.appendChild(a),o.appendChild(s),document.body.appendChild(o),Mr=o,$i=!0}var Mr,$i,qi=Ie(()=>{"use strict";jt();Ue();at();Mr=null,$i=!1});var Qi={};yn(Qi,{FunnelClient:()=>dt,TrackingProvider:()=>Ji,getAssignedPaymentFlowId:()=>Wr,getAssignedPixels:()=>jr,getAssignedScripts:()=>Yr,getAssignedStaticResources:()=>zr,getAssignedStepConfig:()=>ft,getLocalFunnelConfig:()=>Zi,loadLocalFunnelConfig:()=>Vr});function Hr(){if(typeof window!="undefined"){if(window.__TGD_FUNNEL_ID__)return window.__TGD_FUNNEL_ID__;if(typeof document!="undefined"){let t=document.querySelector('meta[name="x-funnel-id"]');return(t==null?void 0:t.getAttribute("content"))||void 0}}}function $t(){if(typeof window!="undefined"){if(window.__TGD_FUNNEL_VARIANT_ID__)return window.__TGD_FUNNEL_VARIANT_ID__;if(typeof document!="undefined"){let t=document.querySelector('meta[name="x-funnel-variant-id"]');return(t==null?void 0:t.getAttribute("content"))||void 0}}}function ut(){if(typeof window!="undefined"){if(window.__TGD_FUNNEL_STEP_ID__)return window.__TGD_FUNNEL_STEP_ID__;if(typeof document!="undefined"){let t=document.querySelector('meta[name="x-funnel-step-id"]');return(t==null?void 0:t.getAttribute("content"))||void 0}}}function Xi(t){if(!t||typeof t!="string")return;let e=t.trim();if(!e)return;let n=[()=>JSON.parse(e),()=>JSON.parse(decodeURIComponent(e)),()=>JSON.parse(decodeURIComponent(decodeURIComponent(e)))];for(let i of n)try{let o=i();if(o&&typeof o=="object")return o}catch(o){}typeof console!="undefined"&&console.warn("[SDK] Failed to parse stepConfig:",e.substring(0,100))}function Gr(){if(typeof window=="undefined")return!1;let t=window.location.hostname;return t==="localhost"||t==="127.0.0.1"||t.endsWith(".localhost")&&!t.includes(".cdn.")}async function Vr(){if(!Gr())return null;if(ie!==void 0)return ie;if(Dn)return await new Promise(t=>setTimeout(t,100)),ie!=null?ie:null;Dn=!0;try{console.log("\u{1F6E0}\uFE0F [SDK] Loading local funnel config from /config/funnel.local.json...");let t=await fetch("/config/funnel.local.json");if(!t.ok)return console.log("\u{1F6E0}\uFE0F [SDK] funnel.local.json not found (this is fine in production)"),ie=null,null;let e=await t.json();return console.log("\u{1F6E0}\uFE0F [SDK] \u2705 Loaded local funnel config:",e),ie=e,e}catch(t){return console.log("\u{1F6E0}\uFE0F [SDK] funnel.local.json not available:",t),ie=null,null}finally{Dn=!1}}function Zi(){return ie!=null?ie:null}function Kr(t){return{payment:t.paymentFlowId?{paymentFlowId:t.paymentFlowId}:void 0,staticResources:t.staticResources,scripts:t.scripts,pixels:t.pixels}}function ft(){if(typeof window=="undefined")return;let t=Zi();if(t)return console.log("\u{1F6E0}\uFE0F [SDK] Using local funnel.local.json (overrides injected)"),Kr(t);let e=window.__TGD_STEP_CONFIG__;if(e){let n=Xi(e);if(n)return n}if(typeof document!="undefined"){let n=document.querySelector('meta[name="x-step-config"]'),i=n==null?void 0:n.getAttribute("content");if(i){let o=Xi(i);if(o)return o}}}function Wr(){var e;let t=ft();if((e=t==null?void 0:t.payment)!=null&&e.paymentFlowId)return t.payment.paymentFlowId;if(typeof window!="undefined"){if(window.__TGD_PAYMENT_FLOW_ID__)return window.__TGD_PAYMENT_FLOW_ID__;if(typeof document!="undefined"){let n=document.querySelector('meta[name="x-payment-flow-id"]');return(n==null?void 0:n.getAttribute("content"))||void 0}}}function zr(){let t=ft();return t==null?void 0:t.staticResources}function Yr(t){let e=ft();if(!(e!=null&&e.scripts))return;let n=e.scripts.filter(i=>i.enabled);return t&&(n=n.filter(i=>i.position===t||!i.position&&t==="head-end")),n.length>0?n:void 0}function jr(){let t=ft(),e=t==null?void 0:t.pixels;if(!e||typeof e!="object")return;let n={};for(let[i,o]of Object.entries(e))o&&(Array.isArray(o)?n[i]=o:typeof o=="object"&&(n[i]=[o]));return Object.keys(n).length>0?n:void 0}var Ji,ie,Dn,dt,Bn=Ie(()=>{"use strict";Vt();vn();Pn();jt();qi();at();Ji=(r=>(r.FACEBOOK="facebook",r.TIKTOK="tiktok",r.SNAPCHAT="snapchat",r.META_CONVERSION="meta_conversion",r.GTM="gtm",r))(Ji||{});Dn=!1;dt=class{constructor(e){this.eventDispatcher=new Be;this.isInitializing=!1;this.initializationAttempted=!1;this.config=e,this.resource=new Kt(e.apiClient),this.state={context:null,isLoading:!1,isInitialized:!1,isNavigating:!1,error:null,sessionError:null}}setConfig(e){this.config=v(v({},this.config),e)}subscribe(e){return this.eventDispatcher.subscribe(e)}getState(){return this.state}getDetectedSessionId(){var i;if((i=this.state.context)!=null&&i.sessionId)return this.state.context.sessionId;if(typeof window=="undefined")return null;let n=new URLSearchParams(window.location.search).get("funnelSessionId");return n||Gi()||null}resetInitialization(){this.initializationAttempted=!1,this.isInitializing=!1,this.updateState({context:null,isInitialized:!1})}async autoInitialize(e,n,i){if(this.state.context)return this.state.context;if(this.isInitializing||this.initializationAttempted)return null;this.initializationAttempted=!0,this.isInitializing=!0,this.updateState({isLoading:!0,error:null});try{let o=this.getDetectedSessionId(),a=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("funnelId")||i,l=Hr(),u=$t(),d=ut(),p=Pe(),S=this.config.funnelId||l||a,w=this.config.stepId||d,f=typeof window!="undefined"?new URLSearchParams(window.location.search):null,C=f==null?void 0:f.get("funnelEnv");this.config.debugMode&&console.log("\u{1F680} [FunnelClient] Auto-initializing...",{existingSessionId:o,effectiveFunnelId:S,funnelVariantId:u,funnelStepId:w,draft:p.draft,funnelTracking:p.funnelTracking,funnelEnv:C,tagadaClientEnv:p.tagadaClientEnv,tagadaClientBaseUrl:p.tagadaClientBaseUrl,source:{funnelId:this.config.funnelId?"config":l?"injected":a?"url/prop":"none",stepId:this.config.stepId?"config":d?"injected":"none"}});let b=await this.resource.initialize({cmsSession:{customerId:e.customerId,sessionId:e.sessionId,storeId:n.id,accountId:n.accountId},funnelId:S,existingSessionId:o||void 0,currentUrl:typeof window!="undefined"?window.location.href:void 0,funnelVariantId:u,funnelStepId:w,draft:p.draft,funnelTracking:p.funnelTracking,funnelEnv:C||void 0,tagadaClientEnv:p.tagadaClientEnv,tagadaClientBaseUrl:p.tagadaClientBaseUrl,currency:p.currency,locale:p.locale});if(b.success&&b.context){let R=this.enrichContext(b.context);return this.handleSessionSuccess(R),_n(),R}else throw new Error(b.error||"Failed to initialize funnel session")}catch(o){let r=o instanceof Error?o:new Error(String(o));throw this.updateState({error:r,isLoading:!1}),this.config.debugMode&&console.error("\u274C [FunnelClient] Init failed:",r),r}finally{this.isInitializing=!1}}async initialize(e,n,i,o){this.updateState({isLoading:!0,error:null});try{let r=$t(),s=ut();this.config.debugMode&&(r&&console.log("\u{1F3AF} [FunnelClient] Detected A/B test variant:",r),s&&console.log("\u{1F3AF} [FunnelClient] Detected step ID:",s));let a=await this.resource.initialize({cmsSession:{customerId:e.customerId,sessionId:e.sessionId,storeId:n.id,accountId:n.accountId},funnelId:i,entryStepId:o,currentUrl:typeof window!="undefined"?window.location.href:void 0,funnelVariantId:r,funnelStepId:s});if(a.success&&a.context){let l=this.enrichContext(a.context);return this.handleSessionSuccess(l),_n(),l}else throw new Error(a.error||"Failed to initialize")}catch(r){let s=r instanceof Error?r:new Error(String(r));throw this.updateState({error:s,isLoading:!1}),s}}async navigate(e,n){var i,o,r,s,a,l;if(n!=null&&n.waitForSession&&!((i=this.state.context)!=null&&i.sessionId)){this.config.debugMode&&console.log("\u23F3 [FunnelClient] Waiting for session before navigation...");let u=5e3,d=Date.now();for(;!((o=this.state.context)!=null&&o.sessionId)&&Date.now()-d<u;)await new Promise(p=>setTimeout(p,100));(r=this.state.context)!=null&&r.sessionId&&this.config.debugMode&&console.log("\u2705 [FunnelClient] Session ready, proceeding with navigation")}if(!((s=this.state.context)!=null&&s.sessionId))throw new Error("No active session");this.updateState({isNavigating:!0,isLoading:!0});try{let u=$t(),d=ut(),p=typeof window!="undefined"?window.location.href:void 0;!d&&this.config.stepId&&(d=this.config.stepId,this.config.debugMode&&console.log("\u{1F50D} [FunnelClient.navigate] Using stepId from config (no injection):",d)),!u&&this.config.variantId&&(u=this.config.variantId,this.config.debugMode&&console.log("\u{1F50D} [FunnelClient.navigate] Using variantId from config (no injection):",u)),this.config.debugMode&&console.log("\u{1F50D} [FunnelClient.navigate] Sending to backend:",{sessionId:this.state.context.sessionId,currentUrl:p,funnelStepId:d||"(not found)",funnelVariantId:u||"(not found)",hasInjectedStepId:!!ut(),hasInjectedVariantId:!!$t(),usedConfigFallback:!ut()&&!!this.config.stepId,customerTags:(n==null?void 0:n.customerTags)||"(none)",deviceId:(n==null?void 0:n.deviceId)||"(none)"});let S=(n==null?void 0:n.fireAndForget)||!1,w=await this.resource.navigate({sessionId:this.state.context.sessionId,event:e,currentUrl:p,funnelStepId:d,funnelVariantId:u,fireAndForget:S,customerTags:n==null?void 0:n.customerTags,deviceId:n==null?void 0:n.deviceId});if(!w.success||!w.result)throw new Error(w.error||"Navigation failed");let f=w.result;if(f.queued)return this.updateState({isNavigating:!1,isLoading:!1}),f.sessionId&&f.sessionId!==((a=this.state.context)==null?void 0:a.sessionId)&&(this.config.debugMode&&console.log("\u{1F525} [FunnelClient] Session ID updated: ".concat((l=this.state.context)==null?void 0:l.sessionId," \u2192 ").concat(f.sessionId)),this.state.context&&(this.state.context.sessionId=f.sessionId)),this.config.debugMode&&console.log("\u{1F525} [FunnelClient] Navigation queued (fire-and-forget mode)"),f;let C=(n==null?void 0:n.autoRedirect)!==void 0?n.autoRedirect:this.config.autoRedirect!==!1;return C||(this.config.debugMode&&console.log("\u{1F504} [FunnelClient] Refreshing session (no auto-redirect)"),await this.refreshSession()),this.updateState({isNavigating:!1,isLoading:!1}),C&&(f!=null&&f.url)&&typeof window!="undefined"&&(this.config.debugMode&&console.log("\u{1F680} [FunnelClient] Auto-redirecting to:",f.url,"(skipped session refresh - next page will initialize)"),window.location.href=f.url),f}catch(u){let d=u instanceof Error?u:new Error(String(u));throw this.updateState({error:d,isNavigating:!1,isLoading:!1}),d}}async goToStep(e,n){return this.navigate({type:"direct_navigation",data:{targetStepId:e}},n)}async refreshSession(){var e;if((e=this.state.context)!=null&&e.sessionId)try{let n=await this.resource.getSession(this.state.context.sessionId);if(n.success&&n.context){let i=this.enrichContext(n.context);return this.updateState({context:i,sessionError:null}),i}}catch(n){this.updateState({sessionError:n instanceof Error?n:new Error(String(n))})}}async updateContext(e){var n;if(!((n=this.state.context)!=null&&n.sessionId))throw new Error("No active session");this.updateState({isLoading:!0});try{let i=await this.resource.updateContext(this.state.context.sessionId,{contextUpdates:e});if(i.success)await this.refreshSession();else throw new Error(i.error||"Failed to update context")}finally{this.updateState({isLoading:!1})}}async endSession(){var e;if((e=this.state.context)!=null&&e.sessionId)try{await this.resource.endSession(this.state.context.sessionId)}finally{this.state.context=null,this.updateState({context:null,isInitialized:!1})}}updateState(e){this.state=v(v({},this.state),e),this.eventDispatcher.notify(this.state)}handleSessionSuccess(e){Hi(e.sessionId),this.updateState({context:e,isLoading:!1,isInitialized:!0,error:null,sessionError:null})}enrichContext(e){var s,a;if((((s=this.config.environment)==null?void 0:s.environment)||ot())!=="local")return e;let i=((a=this.config.pluginConfig)==null?void 0:a.staticResources)||{};if(Object.keys(i).length===0)return e;let o=e.static||{};return Object.keys(i).every(l=>o[l]===i[l])&&Object.keys(o).length===Object.keys(i).length?e:z(v({},e),{static:v(v({},i),o)})}}});var Ma={};yn(Ma,{TagadaExternalTracker:()=>Ft,TagadaTracker:()=>vi});Vt();Bn();function pt(t,e){return function(){return t.apply(e,arguments)}}var{toString:$r}=Object.prototype,{getPrototypeOf:Un}=Object,{iterator:Xt,toStringTag:to}=Symbol,Jt=(t=>e=>{let n=$r.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),oe=t=>(t=t.toLowerCase(),e=>Jt(e)===t),Zt=t=>e=>typeof e===t,{isArray:Ge}=Array,He=Zt("undefined");function gt(t){return t!==null&&!He(t)&&t.constructor!==null&&!He(t.constructor)&&X(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var no=oe("ArrayBuffer");function qr(t){let e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&no(t.buffer),e}var Xr=Zt("string"),X=Zt("function"),io=Zt("number"),mt=t=>t!==null&&typeof t=="object",Jr=t=>t===!0||t===!1,qt=t=>{if(Jt(t)!=="object")return!1;let e=Un(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(to in t)&&!(Xt in t)},Zr=t=>{if(!mt(t)||gt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch(e){return!1}},Qr=oe("Date"),es=oe("File"),ts=oe("Blob"),ns=oe("FileList"),is=t=>mt(t)&&X(t.pipe),os=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||X(t.append)&&((e=Jt(t))==="formdata"||e==="object"&&X(t.toString)&&t.toString()==="[object FormData]"))},rs=oe("URLSearchParams"),[ss,as,ls,cs]=["ReadableStream","Request","Response","Headers"].map(oe),us=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ht(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t=="undefined")return;let i,o;if(typeof t!="object"&&(t=[t]),Ge(t))for(i=0,o=t.length;i<o;i++)e.call(null,t[i],i,t);else{if(gt(t))return;let r=n?Object.getOwnPropertyNames(t):Object.keys(t),s=r.length,a;for(i=0;i<s;i++)a=r[i],e.call(null,t[a],a,t)}}function oo(t,e){if(gt(t))return null;e=e.toLowerCase();let n=Object.keys(t),i=n.length,o;for(;i-- >0;)if(o=n[i],e===o.toLowerCase())return o;return null}var Ne=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,ro=t=>!He(t)&&t!==Ne;function Mn(){let{caseless:t,skipUndefined:e}=ro(this)&&this||{},n={},i=(o,r)=>{let s=t&&oo(n,r)||r;qt(n[s])&&qt(o)?n[s]=Mn(n[s],o):qt(o)?n[s]=Mn({},o):Ge(o)?n[s]=o.slice():(!e||!He(o))&&(n[s]=o)};for(let o=0,r=arguments.length;o<r;o++)arguments[o]&&ht(arguments[o],i);return n}var ds=(t,e,n,{allOwnKeys:i}={})=>(ht(e,(o,r)=>{n&&X(o)?t[r]=pt(o,n):t[r]=o},{allOwnKeys:i}),t),fs=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ps=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},gs=(t,e,n,i)=>{let o,r,s,a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),r=o.length;r-- >0;)s=o[r],(!i||i(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&Un(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},ms=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;let i=t.indexOf(e,n);return i!==-1&&i===n},hs=t=>{if(!t)return null;if(Ge(t))return t;let e=t.length;if(!io(e))return null;let n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Es=(t=>e=>t&&e instanceof t)(typeof Uint8Array!="undefined"&&Un(Uint8Array)),As=(t,e)=>{let i=(t&&t[Xt]).call(t),o;for(;(o=i.next())&&!o.done;){let r=o.value;e.call(t,r[0],r[1])}},bs=(t,e)=>{let n,i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},ws=oe("HTMLFormElement"),Is=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,o){return i.toUpperCase()+o}),eo=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Ss=oe("RegExp"),so=(t,e)=>{let n=Object.getOwnPropertyDescriptors(t),i={};ht(n,(o,r)=>{let s;(s=e(o,r,t))!==!1&&(i[r]=s||o)}),Object.defineProperties(t,i)},Cs=t=>{so(t,(e,n)=>{if(X(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let i=t[n];if(X(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ts=(t,e)=>{let n={},i=o=>{o.forEach(r=>{n[r]=!0})};return Ge(t)?i(t):i(String(t).split(e)),n},ys=()=>{},Os=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Rs(t){return!!(t&&X(t.append)&&t[to]==="FormData"&&t[Xt])}var vs=t=>{let e=new Array(10),n=(i,o)=>{if(mt(i)){if(e.indexOf(i)>=0)return;if(gt(i))return i;if(!("toJSON"in i)){e[o]=i;let r=Ge(i)?[]:{};return ht(i,(s,a)=>{let l=n(s,o+1);!He(l)&&(r[a]=l)}),e[o]=void 0,r}}return i};return n(t,0)},Ps=oe("AsyncFunction"),Ns=t=>t&&(mt(t)||X(t))&&X(t.then)&&X(t.catch),ao=((t,e)=>t?setImmediate:e?((n,i)=>(Ne.addEventListener("message",({source:o,data:r})=>{o===Ne&&r===n&&i.length&&i.shift()()},!1),o=>{i.push(o),Ne.postMessage(n,"*")}))("axios@".concat(Math.random()),[]):n=>setTimeout(n))(typeof setImmediate=="function",X(Ne.postMessage)),xs=typeof queueMicrotask!="undefined"?queueMicrotask.bind(Ne):typeof process!="undefined"&&process.nextTick||ao,ks=t=>t!=null&&X(t[Xt]),c={isArray:Ge,isArrayBuffer:no,isBuffer:gt,isFormData:os,isArrayBufferView:qr,isString:Xr,isNumber:io,isBoolean:Jr,isObject:mt,isPlainObject:qt,isEmptyObject:Zr,isReadableStream:ss,isRequest:as,isResponse:ls,isHeaders:cs,isUndefined:He,isDate:Qr,isFile:es,isBlob:ts,isRegExp:Ss,isFunction:X,isStream:is,isURLSearchParams:rs,isTypedArray:Es,isFileList:ns,forEach:ht,merge:Mn,extend:ds,trim:us,stripBOM:fs,inherits:ps,toFlatObject:gs,kindOf:Jt,kindOfTest:oe,endsWith:ms,toArray:hs,forEachEntry:As,matchAll:bs,isHTMLForm:ws,hasOwnProperty:eo,hasOwnProp:eo,reduceDescriptors:so,freezeMethods:Cs,toObjectSet:Ts,toCamelCase:Is,noop:ys,toFiniteNumber:Os,findKey:oo,global:Ne,isContextDefined:ro,isSpecCompliantForm:Rs,toJSONObject:vs,isAsyncFn:Ps,isThenable:Ns,setImmediate:ao,asap:xs,isIterable:ks};function Ve(t,e,n,i,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),i&&(this.request=i),o&&(this.response=o,this.status=o.status?o.status:null)}c.inherits(Ve,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});var lo=Ve.prototype,co={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{co[t]={value:t}});Object.defineProperties(Ve,co);Object.defineProperty(lo,"isAxiosError",{value:!0});Ve.from=(t,e,n,i,o,r)=>{let s=Object.create(lo);c.toFlatObject(t,s,function(d){return d!==Error.prototype},u=>u!=="isAxiosError");let a=t&&t.message?t.message:"Error",l=e==null&&t?t.code:e;return Ve.call(s,a,l,n,i,o),t&&s.cause==null&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",r&&Object.assign(s,r),s};var T=Ve;var Qt=null;function Fn(t){return c.isPlainObject(t)||c.isArray(t)}function fo(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function uo(t,e,n){return t?t.concat(e).map(function(o,r){return o=fo(o),!n&&r?"["+o+"]":o}).join(n?".":""):e}function Ls(t){return c.isArray(t)&&!t.some(Fn)}var _s=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function Ds(t,e,n){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new(Qt||FormData),n=c.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,b){return!c.isUndefined(b[C])});let i=n.metaTokens,o=n.visitor||d,r=n.dots,s=n.indexes,l=(n.Blob||typeof Blob!="undefined"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(o))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(c.isDate(f))return f.toISOString();if(c.isBoolean(f))return f.toString();if(!l&&c.isBlob(f))throw new T("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(f)||c.isTypedArray(f)?l&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function d(f,C,b){let R=f;if(f&&!b&&typeof f=="object"){if(c.endsWith(C,"{}"))C=i?C:C.slice(0,-2),f=JSON.stringify(f);else if(c.isArray(f)&&Ls(f)||(c.isFileList(f)||c.endsWith(C,"[]"))&&(R=c.toArray(f)))return C=fo(C),R.forEach(function(y,N){!(c.isUndefined(y)||y===null)&&e.append(s===!0?uo([C],N,r):s===null?C:C+"[]",u(y))}),!1}return Fn(f)?!0:(e.append(uo(b,C,r),u(f)),!1)}let p=[],S=Object.assign(_s,{defaultVisitor:d,convertValue:u,isVisitable:Fn});function w(f,C){if(!c.isUndefined(f)){if(p.indexOf(f)!==-1)throw Error("Circular reference detected in "+C.join("."));p.push(f),c.forEach(f,function(R,L){(!(c.isUndefined(R)||R===null)&&o.call(e,R,c.isString(L)?L.trim():L,C,S))===!0&&w(R,C?C.concat(L):[L])}),p.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return w(t),e}var Se=Ds;function po(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function go(t,e){this._pairs=[],t&&Se(t,this,e)}var mo=go.prototype;mo.append=function(e,n){this._pairs.push([e,n])};mo.toString=function(e){let n=e?function(i){return e.call(this,i,po)}:po;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};var en=go;function Bs(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Et(t,e,n){if(!e)return t;let i=n&&n.encode||Bs;c.isFunction(n)&&(n={serialize:n});let o=n&&n.serialize,r;if(o?r=o(e,n):r=c.isURLSearchParams(e)?e.toString():new en(e,n).toString(i),r){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+r}return t}var Hn=class{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(i){i!==null&&e(i)})}},Gn=Hn;var tn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var ho=typeof URLSearchParams!="undefined"?URLSearchParams:en;var Eo=typeof FormData!="undefined"?FormData:null;var Ao=typeof Blob!="undefined"?Blob:null;var bo={isBrowser:!0,classes:{URLSearchParams:ho,FormData:Eo,Blob:Ao},protocols:["http","https","file","blob","url","data"]};var Wn={};yn(Wn,{hasBrowserEnv:()=>Kn,hasStandardBrowserEnv:()=>Ms,hasStandardBrowserWebWorkerEnv:()=>Us,navigator:()=>Vn,origin:()=>Fs});var Kn=typeof window!="undefined"&&typeof document!="undefined",Vn=typeof navigator=="object"&&navigator||void 0,Ms=Kn&&(!Vn||["ReactNative","NativeScript","NS"].indexOf(Vn.product)<0),Us=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Fs=Kn&&window.location.href||"http://localhost";var M=v(v({},Wn),bo);function zn(t,e){return Se(t,new M.classes.URLSearchParams,v({visitor:function(n,i,o,r){return M.isNode&&c.isBuffer(n)?(this.append(i,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}function Hs(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Gs(t){let e={},n=Object.keys(t),i,o=n.length,r;for(i=0;i<o;i++)r=n[i],e[r]=t[r];return e}function Vs(t){function e(n,i,o,r){let s=n[r++];if(s==="__proto__")return!0;let a=Number.isFinite(+s),l=r>=n.length;return s=!s&&c.isArray(o)?o.length:s,l?(c.hasOwnProp(o,s)?o[s]=[o[s],i]:o[s]=i,!a):((!o[s]||!c.isObject(o[s]))&&(o[s]=[]),e(n,i,o[s],r)&&c.isArray(o[s])&&(o[s]=Gs(o[s])),!a)}if(c.isFormData(t)&&c.isFunction(t.entries)){let n={};return c.forEachEntry(t,(i,o)=>{e(Hs(i),o,n,0)}),n}return null}var nn=Vs;function Ks(t,e,n){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(t)}var Yn={transitional:tn,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){let i=n.getContentType()||"",o=i.indexOf("application/json")>-1,r=c.isObject(e);if(r&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return o?JSON.stringify(nn(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(r){if(i.indexOf("application/x-www-form-urlencoded")>-1)return zn(e,this.formSerializer).toString();if((a=c.isFileList(e))||i.indexOf("multipart/form-data")>-1){let l=this.env&&this.env.FormData;return Se(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return r||o?(n.setContentType("application/json",!1),Ks(e)):e}],transformResponse:[function(e){let n=this.transitional||Yn.transitional,i=n&&n.forcedJSONParsing,o=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(i&&!this.responseType||o)){let s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e,this.parseReviver)}catch(a){if(s)throw a.name==="SyntaxError"?T.from(a,T.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:M.classes.FormData,Blob:M.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{Yn.headers[t]={}});var Ke=Yn;var Ws=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),wo=t=>{let e={},n,i,o;return t&&t.split("\n").forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),i=s.substring(o+1).trim(),!(!n||e[n]&&Ws[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e};var Io=Symbol("internals");function At(t){return t&&String(t).trim().toLowerCase()}function on(t){return t===!1||t==null?t:c.isArray(t)?t.map(on):String(t)}function zs(t){let e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}var Ys=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function jn(t,e,n,i,o){if(c.isFunction(i))return i.call(this,e,n);if(o&&(e=n),!!c.isString(e)){if(c.isString(i))return e.indexOf(i)!==-1;if(c.isRegExp(i))return i.test(e)}}function js(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function $s(t,e){let n=c.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(o,r,s){return this[i].call(this,e,o,r,s)},configurable:!0})})}var We=class{constructor(e){e&&this.set(e)}set(e,n,i){let o=this;function r(a,l,u){let d=At(l);if(!d)throw new Error("header name must be a non-empty string");let p=c.findKey(o,d);(!p||o[p]===void 0||u===!0||u===void 0&&o[p]!==!1)&&(o[p||l]=on(a))}let s=(a,l)=>c.forEach(a,(u,d)=>r(u,d,l));if(c.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(c.isString(e)&&(e=e.trim())&&!Ys(e))s(wo(e),n);else if(c.isObject(e)&&c.isIterable(e)){let a={},l,u;for(let d of e){if(!c.isArray(d))throw TypeError("Object iterator must return a key-value pair");a[u=d[0]]=(l=a[u])?c.isArray(l)?[...l,d[1]]:[l,d[1]]:d[1]}s(a,n)}else e!=null&&r(n,e,i);return this}get(e,n){if(e=At(e),e){let i=c.findKey(this,e);if(i){let o=this[i];if(!n)return o;if(n===!0)return zs(o);if(c.isFunction(n))return n.call(this,o,i);if(c.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=At(e),e){let i=c.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||jn(this,this[i],i,n)))}return!1}delete(e,n){let i=this,o=!1;function r(s){if(s=At(s),s){let a=c.findKey(i,s);a&&(!n||jn(i,i[a],a,n))&&(delete i[a],o=!0)}}return c.isArray(e)?e.forEach(r):r(e),o}clear(e){let n=Object.keys(this),i=n.length,o=!1;for(;i--;){let r=n[i];(!e||jn(this,this[r],r,e,!0))&&(delete this[r],o=!0)}return o}normalize(e){let n=this,i={};return c.forEach(this,(o,r)=>{let s=c.findKey(i,r);if(s){n[s]=on(o),delete n[r];return}let a=e?js(r):String(r).trim();a!==r&&delete n[r],n[a]=on(o),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let n=Object.create(null);return c.forEach(this,(i,o)=>{i!=null&&i!==!1&&(n[o]=e&&c.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){let i=new this(e);return n.forEach(o=>i.set(o)),i}static accessor(e){let i=(this[Io]=this[Io]={accessors:{}}).accessors,o=this.prototype;function r(s){let a=At(s);i[a]||($s(o,s),i[a]=!0)}return c.isArray(e)?e.forEach(r):r(e),this}};We.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(We.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}});c.freezeMethods(We);var V=We;function bt(t,e){let n=this||Ke,i=e||n,o=V.from(i.headers),r=i.data;return c.forEach(t,function(a){r=a.call(n,r,o.normalize(),e?e.status:void 0)}),o.normalize(),r}function wt(t){return!!(t&&t.__CANCEL__)}function So(t,e,n){T.call(this,t==null?"canceled":t,T.ERR_CANCELED,e,n),this.name="CanceledError"}c.inherits(So,T,{__CANCEL__:!0});var ce=So;function It(t,e,n){let i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new T("Request failed with status code "+n.status,[T.ERR_BAD_REQUEST,T.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function $n(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function qs(t,e){t=t||10;let n=new Array(t),i=new Array(t),o=0,r=0,s;return e=e!==void 0?e:1e3,function(l){let u=Date.now(),d=i[r];s||(s=u),n[o]=l,i[o]=u;let p=r,S=0;for(;p!==o;)S+=n[p++],p=p%t;if(o=(o+1)%t,o===r&&(r=(r+1)%t),u-s<e)return;let w=d&&u-d;return w?Math.round(S*1e3/w):void 0}}var Co=qs;function Xs(t,e){let n=0,i=1e3/e,o,r,s=(u,d=Date.now())=>{n=d,o=null,r&&(clearTimeout(r),r=null),t(...u)};return[(...u)=>{let d=Date.now(),p=d-n;p>=i?s(u,d):(o=u,r||(r=setTimeout(()=>{r=null,s(o)},i-p)))},()=>o&&s(o)]}var To=Xs;var ze=(t,e,n=3)=>{let i=0,o=Co(50,250);return To(r=>{let s=r.loaded,a=r.lengthComputable?r.total:void 0,l=s-i,u=o(l),d=s<=a;i=s;let p={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&d?(a-s)/u:void 0,event:r,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(p)},n)},qn=(t,e)=>{let n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},Xn=t=>(...e)=>c.asap(()=>t(...e));var yo=M.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,M.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(M.origin),M.navigator&&/(msie|trident)/i.test(M.navigator.userAgent)):()=>!0;var Oo=M.hasStandardBrowserEnv?{write(t,e,n,i,o,r,s){if(typeof document=="undefined")return;let a=["".concat(t,"=").concat(encodeURIComponent(e))];c.isNumber(n)&&a.push("expires=".concat(new Date(n).toUTCString())),c.isString(i)&&a.push("path=".concat(i)),c.isString(o)&&a.push("domain=".concat(o)),r===!0&&a.push("secure"),c.isString(s)&&a.push("SameSite=".concat(s)),document.cookie=a.join("; ")},read(t){if(typeof document=="undefined")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Jn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Zn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function St(t,e,n){let i=!Jn(e);return t&&(i||n==!1)?Zn(t,e):e}var Ro=t=>t instanceof V?v({},t):t;function re(t,e){e=e||{};let n={};function i(u,d,p,S){return c.isPlainObject(u)&&c.isPlainObject(d)?c.merge.call({caseless:S},u,d):c.isPlainObject(d)?c.merge({},d):c.isArray(d)?d.slice():d}function o(u,d,p,S){if(c.isUndefined(d)){if(!c.isUndefined(u))return i(void 0,u,p,S)}else return i(u,d,p,S)}function r(u,d){if(!c.isUndefined(d))return i(void 0,d)}function s(u,d){if(c.isUndefined(d)){if(!c.isUndefined(u))return i(void 0,u)}else return i(void 0,d)}function a(u,d,p){if(p in e)return i(u,d);if(p in t)return i(void 0,u)}let l={url:r,method:r,data:r,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,d,p)=>o(Ro(u),Ro(d),p,!0)};return c.forEach(Object.keys(v(v({},t),e)),function(d){let p=l[d]||o,S=p(t[d],e[d],d);c.isUndefined(S)&&p!==a||(n[d]=S)}),n}var rn=t=>{let e=re({},t),{data:n,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:r,headers:s,auth:a}=e;if(e.headers=s=V.from(s),e.url=Et(St(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(n)){if(M.hasStandardBrowserEnv||M.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(c.isFunction(n.getHeaders)){let l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([d,p])=>{u.includes(d.toLowerCase())&&s.set(d,p)})}}if(M.hasStandardBrowserEnv&&(i&&c.isFunction(i)&&(i=i(e)),i||i!==!1&&yo(e.url))){let l=o&&r&&Oo.read(r);l&&s.set(o,l)}return e};var Js=typeof XMLHttpRequest!="undefined",vo=Js&&function(t){return new Promise(function(n,i){let o=rn(t),r=o.data,s=V.from(o.headers).normalize(),{responseType:a,onUploadProgress:l,onDownloadProgress:u}=o,d,p,S,w,f;function C(){w&&w(),f&&f(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function R(){if(!b)return;let y=V.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),K={data:!a||a==="text"||a==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:y,config:t,request:b};It(function(W){n(W),C()},function(W){i(W),C()},K),b=null}"onloadend"in b?b.onloadend=R:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(R)},b.onabort=function(){b&&(i(new T("Request aborted",T.ECONNABORTED,t,b)),b=null)},b.onerror=function(N){let K=N&&N.message?N.message:"Network Error",_=new T(K,T.ERR_NETWORK,t,b);_.event=N||null,i(_),b=null},b.ontimeout=function(){let N=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",K=o.transitional||tn;o.timeoutErrorMessage&&(N=o.timeoutErrorMessage),i(new T(N,K.clarifyTimeoutError?T.ETIMEDOUT:T.ECONNABORTED,t,b)),b=null},r===void 0&&s.setContentType(null),"setRequestHeader"in b&&c.forEach(s.toJSON(),function(N,K){b.setRequestHeader(K,N)}),c.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),a&&a!=="json"&&(b.responseType=o.responseType),u&&([S,f]=ze(u,!0),b.addEventListener("progress",S)),l&&b.upload&&([p,w]=ze(l),b.upload.addEventListener("progress",p),b.upload.addEventListener("loadend",w)),(o.cancelToken||o.signal)&&(d=y=>{b&&(i(!y||y.type?new ce(null,t,b):y),b.abort(),b=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));let L=$n(o.url);if(L&&M.protocols.indexOf(L)===-1){i(new T("Unsupported protocol "+L+":",T.ERR_BAD_REQUEST,t));return}b.send(r||null)})};var Zs=(t,e)=>{let{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,o,r=function(u){if(!o){o=!0,a();let d=u instanceof Error?u:this.reason;i.abort(d instanceof T?d:new ce(d instanceof Error?d.message:d))}},s=e&&setTimeout(()=>{s=null,r(new T("timeout ".concat(e," of ms exceeded"),T.ETIMEDOUT))},e),a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(r):u.removeEventListener("abort",r)}),t=null)};t.forEach(u=>u.addEventListener("abort",r));let{signal:l}=i;return l.unsubscribe=()=>c.asap(a),l}},Po=Zs;var Qs=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let i=0,o;for(;i<n;)o=i+e,yield t.slice(i,o),i=o},ea=function(t,e){return On(this,null,function*(){try{for(var n=Bi(ta(t)),i,o,r;i=!(o=yield new ve(n.next())).done;i=!1){let s=o.value;yield*Rn(Qs(s,e))}}catch(o){r=[o]}finally{try{i&&(o=n.return)&&(yield new ve(o.call(n)))}finally{if(r)throw r[0]}}})},ta=function(t){return On(this,null,function*(){if(t[Symbol.asyncIterator]){yield*Rn(t);return}let e=t.getReader();try{for(;;){let{done:n,value:i}=yield new ve(e.read());if(n)break;yield i}}finally{yield new ve(e.cancel())}})},Qn=(t,e,n,i)=>{let o=ea(t,e),r=0,s,a=l=>{s||(s=!0,i&&i(l))};return new ReadableStream({async pull(l){try{let{done:u,value:d}=await o.next();if(u){a(),l.close();return}let p=d.byteLength;if(n){let S=r+=p;n(S)}l.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(l){return a(l),o.return()}},{highWaterMark:2})};var No=64*1024,{isFunction:sn}=c,na=(({Request:t,Response:e})=>({Request:t,Response:e}))(c.global),{ReadableStream:xo,TextEncoder:ko}=c.global,Lo=(t,...e)=>{try{return!!t(...e)}catch(n){return!1}},ia=t=>{t=c.merge.call({skipUndefined:!0},na,t);let{fetch:e,Request:n,Response:i}=t,o=e?sn(e):typeof fetch=="function",r=sn(n),s=sn(i);if(!o)return!1;let a=o&&sn(xo),l=o&&(typeof ko=="function"?(f=>C=>f.encode(C))(new ko):async f=>new Uint8Array(await new n(f).arrayBuffer())),u=r&&a&&Lo(()=>{let f=!1,C=new n(M.origin,{body:new xo,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!C}),d=s&&a&&Lo(()=>c.isReadableStream(new i("").body)),p={stream:d&&(f=>f.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!p[f]&&(p[f]=(C,b)=>{let R=C&&C[f];if(R)return R.call(C);throw new T("Response type '".concat(f,"' is not supported"),T.ERR_NOT_SUPPORT,b)})});let S=async f=>{if(f==null)return 0;if(c.isBlob(f))return f.size;if(c.isSpecCompliantForm(f))return(await new n(M.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(c.isArrayBufferView(f)||c.isArrayBuffer(f))return f.byteLength;if(c.isURLSearchParams(f)&&(f=f+""),c.isString(f))return(await l(f)).byteLength},w=async(f,C)=>{let b=c.toFiniteNumber(f.getContentLength());return b==null?S(C):b};return async f=>{let{url:C,method:b,data:R,signal:L,cancelToken:y,timeout:N,onDownloadProgress:K,onUploadProgress:_,responseType:W,headers:ae,withCredentials:nt="same-origin",fetchOptions:te}=rn(f),Ae=e||fetch;W=W?(W+"").toLowerCase():"text";let j=Po([L,y&&y.toAbortSignal()],N),it=null,Re=j&&j.unsubscribe&&(()=>{j.unsubscribe()}),Pi;try{if(_&&u&&b!=="get"&&b!=="head"&&(Pi=await w(ae,R))!==0){let we=new n(C,{method:"POST",body:R,duplex:"half"}),_e;if(c.isFormData(R)&&(_e=we.headers.get("content-type"))&&ae.setContentType(_e),we.body){let[Tn,Ht]=qn(Pi,ze(Xn(_)));R=Qn(we.body,No,Tn,Ht)}}c.isString(nt)||(nt=nt?"include":"omit");let le=r&&"credentials"in n.prototype,Ni=z(v({},te),{signal:j,method:b.toUpperCase(),headers:ae.normalize().toJSON(),body:R,duplex:"half",credentials:le?nt:void 0});it=r&&new n(C,Ni);let be=await(r?Ae(it,te):Ae(C,Ni)),xi=d&&(W==="stream"||W==="response");if(d&&(K||xi&&Re)){let we={};["status","statusText","headers"].forEach(ki=>{we[ki]=be[ki]});let _e=c.toFiniteNumber(be.headers.get("content-length")),[Tn,Ht]=K&&qn(_e,ze(Xn(K),!0))||[];be=new i(Qn(be.body,No,Tn,()=>{Ht&&Ht(),Re&&Re()}),we)}W=W||"text";let yr=await p[c.findKey(p,W)||"text"](be,f);return!xi&&Re&&Re(),await new Promise((we,_e)=>{It(we,_e,{data:yr,headers:V.from(be.headers),status:be.status,statusText:be.statusText,config:f,request:it})})}catch(le){throw Re&&Re(),le&&le.name==="TypeError"&&/Load failed|fetch/i.test(le.message)?Object.assign(new T("Network Error",T.ERR_NETWORK,f,it),{cause:le.cause||le}):T.from(le,le&&le.code,f,it)}}},oa=new Map,ei=t=>{let e=t&&t.env||{},{fetch:n,Request:i,Response:o}=e,r=[i,o,n],s=r.length,a=s,l,u,d=oa;for(;a--;)l=r[a],u=d.get(l),u===void 0&&d.set(l,u=a?new Map:ia(e)),d=u;return u},Eu=ei();var ti={http:Qt,xhr:vo,fetch:{get:ei}};c.forEach(ti,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(n){}Object.defineProperty(t,"adapterName",{value:e})}});var _o=t=>"- ".concat(t),sa=t=>c.isFunction(t)||t===null||t===!1;function aa(t,e){t=c.isArray(t)?t:[t];let{length:n}=t,i,o,r={};for(let s=0;s<n;s++){i=t[s];let a;if(o=i,!sa(i)&&(o=ti[(a=String(i)).toLowerCase()],o===void 0))throw new T("Unknown adapter '".concat(a,"'"));if(o&&(c.isFunction(o)||(o=o.get(e))))break;r[a||"#"+s]=o}if(!o){let s=Object.entries(r).map(([l,u])=>"adapter ".concat(l," ")+(u===!1?"is not supported by the environment":"is not available in the build")),a=n?s.length>1?"since :\n"+s.map(_o).join("\n"):" "+_o(s[0]):"as no adapter specified";throw new T("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}var an={getAdapter:aa,adapters:ti};function ni(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ce(null,t)}function ln(t){return ni(t),t.headers=V.from(t.headers),t.data=bt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),an.getAdapter(t.adapter||Ke.adapter,t)(t).then(function(i){return ni(t),i.data=bt.call(t,t.transformResponse,i),i.headers=V.from(i.headers),i},function(i){return wt(i)||(ni(t),i&&i.response&&(i.response.data=bt.call(t,t.transformResponse,i.response),i.response.headers=V.from(i.response.headers))),Promise.reject(i)})}var cn="1.13.2";var un={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{un[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});var Do={};un.transitional=function(e,n,i){function o(r,s){return"[Axios v"+cn+"] Transitional option '"+r+"'"+s+(i?". "+i:"")}return(r,s,a)=>{if(e===!1)throw new T(o(s," has been removed"+(n?" in "+n:"")),T.ERR_DEPRECATED);return n&&!Do[s]&&(Do[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(r,s,a):!0}};un.spelling=function(e){return(n,i)=>(console.warn("".concat(i," is likely a misspelling of ").concat(e)),!0)};function la(t,e,n){if(typeof t!="object")throw new T("options must be an object",T.ERR_BAD_OPTION_VALUE);let i=Object.keys(t),o=i.length;for(;o-- >0;){let r=i[o],s=e[r];if(s){let a=t[r],l=a===void 0||s(a,r,t);if(l!==!0)throw new T("option "+r+" must be "+l,T.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new T("Unknown option "+r,T.ERR_BAD_OPTION)}}var Ct={assertOptions:la,validators:un};var ue=Ct.validators,Ye=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Gn,response:new Gn}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;let r=o.stack?o.stack.replace(/^.+\n/,""):"";try{i.stack?r&&!String(i.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(i.stack+="\n"+r):i.stack=r}catch(s){}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=re(this.defaults,n);let{transitional:i,paramsSerializer:o,headers:r}=n;i!==void 0&&Ct.assertOptions(i,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean)},!1),o!=null&&(c.isFunction(o)?n.paramsSerializer={serialize:o}:Ct.assertOptions(o,{encode:ue.function,serialize:ue.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Ct.assertOptions(n,{baseUrl:ue.spelling("baseURL"),withXsrfToken:ue.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=r&&c.merge(r.common,r[n.method]);r&&c.forEach(["delete","get","head","post","put","patch","common"],f=>{delete r[f]}),n.headers=V.concat(s,r);let a=[],l=!0;this.interceptors.request.forEach(function(C){typeof C.runWhen=="function"&&C.runWhen(n)===!1||(l=l&&C.synchronous,a.unshift(C.fulfilled,C.rejected))});let u=[];this.interceptors.response.forEach(function(C){u.push(C.fulfilled,C.rejected)});let d,p=0,S;if(!l){let f=[ln.bind(this),void 0];for(f.unshift(...a),f.push(...u),S=f.length,d=Promise.resolve(n);p<S;)d=d.then(f[p++],f[p++]);return d}S=a.length;let w=n;for(;p<S;){let f=a[p++],C=a[p++];try{w=f(w)}catch(b){C.call(this,b);break}}try{d=ln.call(this,w)}catch(f){return Promise.reject(f)}for(p=0,S=u.length;p<S;)d=d.then(u[p++],u[p++]);return d}getUri(e){e=re(this.defaults,e);let n=St(e.baseURL,e.url,e.allowAbsoluteUrls);return Et(n,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){Ye.prototype[e]=function(n,i){return this.request(re(i||{},{method:e,url:n,data:(i||{}).data}))}});c.forEach(["post","put","patch"],function(e){function n(i){return function(r,s,a){return this.request(re(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:r,data:s}))}}Ye.prototype[e]=n(),Ye.prototype[e+"Form"]=n(!0)});var Tt=Ye;var ii=class t{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});let i=this;this.promise.then(o=>{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](o);i._listeners=null}),this.promise.then=o=>{let r,s=new Promise(a=>{i.subscribe(a),r=a}).then(o);return s.cancel=function(){i.unsubscribe(r)},s},e(function(r,s,a){i.reason||(i.reason=new ce(r,s,a),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){let e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new t(function(o){e=o}),cancel:e}}},Bo=ii;function oi(t){return function(n){return t.apply(null,n)}}function ri(t){return c.isObject(t)&&t.isAxiosError===!0}var si={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(si).forEach(([t,e])=>{si[e]=t});var Mo=si;function Uo(t){let e=new Tt(t),n=pt(Tt.prototype.request,e);return c.extend(n,Tt.prototype,e,{allOwnKeys:!0}),c.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return Uo(re(t,o))},n}var H=Uo(Ke);H.Axios=Tt;H.CanceledError=ce;H.CancelToken=Bo;H.isCancel=wt;H.VERSION=cn;H.toFormData=Se;H.AxiosError=T;H.Cancel=H.CanceledError;H.all=function(e){return Promise.all(e)};H.spread=oi;H.isAxiosError=ri;H.mergeConfig=re;H.AxiosHeaders=V;H.formToJSON=t=>nn(c.isHTMLForm(t)?new FormData(t):t);H.getAdapter=an.getAdapter;H.HttpStatusCode=Mo;H.default=H;var dn=H;var{Axios:md,AxiosError:hd,CanceledError:Ed,isCancel:Ad,CancelToken:bd,VERSION:wd,all:Id,Cancel:Sd,isAxiosError:Cd,spread:Td,toFormData:yd,AxiosHeaders:Od,HttpStatusCode:Rd,formToJSON:vd,getAdapter:Pd,mergeConfig:Nd}=dn;var yt=class{constructor(e){this.currentToken=null;this.tokenProvider=null;this.requestHistory=new Map;this.WINDOW_MS=5e3;this.MAX_REQUESTS=30;this.axios=dn.create({baseURL:e.baseURL,timeout:e.timeout||6e4,headers:v({"Content-Type":"application/json"},e.headers)}),typeof setInterval!="undefined"&&setInterval(()=>this.cleanupHistory(),1e4),this.axios.interceptors.request.use(async n=>{var i,o;if(n.url)try{this.checkRequestLimit("".concat((i=n.method)==null?void 0:i.toUpperCase(),":").concat(n.url))}catch(r){return console.error("[SDK] \u{1F6D1} Request blocked by Circuit Breaker:",r),Promise.reject(r)}if(!n.skipAuth&&!this.currentToken&&this.tokenProvider)try{console.log("[SDK] Waiting for token...");let r=await this.tokenProvider();r&&(this.updateToken(r),n.headers["x-cms-token"]=r)}catch(r){console.error("[SDK] Failed to get token from provider:",r)}return!n.skipAuth&&this.currentToken&&(n.headers["x-cms-token"]=this.currentToken),console.log("[SDK] Making ".concat((o=n.method)==null?void 0:o.toUpperCase()," request to: ").concat(n.baseURL||"").concat(n.url)),n},n=>(console.error("[SDK] Request error:",n),Promise.reject(n instanceof Error?n:new Error(String(n))))),this.axios.interceptors.response.use(n=>n,n=>(console.error("[SDK] Response error:",n.message),Promise.reject(n instanceof Error?n:new Error(String(n)))))}setTokenProvider(e){this.tokenProvider=e}async get(e,n){return(await this.axios.get(e,n)).data}async post(e,n,i){return(await this.axios.post(e,n,i)).data}async put(e,n,i){return(await this.axios.put(e,n,i)).data}async patch(e,n,i){return(await this.axios.patch(e,n,i)).data}async delete(e,n){return(await this.axios.delete(e,n)).data}setHeader(e,n){this.axios.defaults.headers.common[e]=n}removeHeader(e){delete this.axios.defaults.headers.common[e]}updateToken(e){this.currentToken=e,e?this.setHeader("x-cms-token",e):(this.removeHeader("x-cms-token"),console.log("[SDK] Token removed from ApiClient"))}getCurrentToken(){return this.currentToken}updateConfig(e){e.baseURL&&(this.axios.defaults.baseURL=e.baseURL),e.timeout&&(this.axios.defaults.timeout=e.timeout),e.headers&&Object.assign(this.axios.defaults.headers.common,e.headers),console.log("[SDK] ApiClient configuration updated")}checkRequestLimit(e){let n=Date.now(),i=this.requestHistory.get(e);if(!i){this.requestHistory.set(e,{count:1,firstRequestTime:n});return}if(n-i.firstRequestTime>this.WINDOW_MS){this.requestHistory.set(e,{count:1,firstRequestTime:n});return}if(i.count++,i.count>this.MAX_REQUESTS){let o=new Error("Circuit Breaker: Too many requests to ".concat(e," (").concat(i.count," in ").concat(this.WINDOW_MS,"ms)"));throw o.isCircuitBreaker=!0,o}}cleanupHistory(){let e=Date.now();for(let[n,i]of this.requestHistory.entries())e-i.firstRequestTime>this.WINDOW_MS&&this.requestHistory.delete(n)}};var ca="2.0.6",ua=500,Fo="user-agent",Ze="",Ho="?",U={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},J="browser",ge="cpu",pe="device",se="engine",Q="os",Xe="result",h="name",g="type",E="vendor",A="version",$="architecture",_t="major",m="model",kt="console",O="mobile",x="tablet",G="smarttv",de="wearable",fn="xr",Lt="embedded",je="inapp",wi="brands",ke="formFactors",Ii="fullVersionList",Je="platform",Si="platformVersion",bn="bitness",Oe="sec-ch-ua",da=Oe+"-full-version-list",fa=Oe+"-arch",pa=Oe+"-"+bn,ga=Oe+"-form-factors",ma=Oe+"-"+O,ha=Oe+"-"+m,er=Oe+"-"+Je,Ea=er+"-version",tr=[wi,Ii,O,m,Je,Si,$,ke,bn],pn="Amazon",$e="Apple",Go="ASUS",Vo="BlackBerry",xe="Google",Ko="Huawei",ai="Lenovo",Wo="Honor",gn="LG",li="Microsoft",ci="Motorola",ui="Nvidia",zo="OnePlus",di="OPPO",Ot="Samsung",Yo="Sharp",Rt="Sony",fi="Xiaomi",pi="Zebra",jo="Chrome",$o="Chromium",Ce="Chromecast",hn="Edge",vt="Firefox",Pt="Opera",gi="Facebook",qo="Sogou",qe="Mobile ",Nt=" Browser",Ai="Windows",Aa=typeof window!==U.UNDEFINED,Z=Aa&&window.navigator?window.navigator:void 0,Te=Z&&Z.userAgentData?Z.userAgentData:void 0,ba=function(t,e){var n={},i=e;if(!En(e)){i={};for(var o in e)for(var r in e[o])i[r]=e[o][r].concat(i[r]?i[r]:[])}for(var s in t)n[s]=i[s]&&i[s].length%2===0?i[s].concat(t[s]):t[s];return n},wn=function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e},bi=function(t,e){if(typeof t===U.OBJECT&&t.length>0){for(var n in t)if(ye(e)==ye(t[n]))return!0;return!1}return Dt(t)?ye(e)==ye(t):!1},En=function(t,e){for(var n in t)return/^(browser|cpu|device|engine|os)$/.test(n)||(e?En(t[n]):!1)},Dt=function(t){return typeof t===U.STRING},mi=function(t){if(t){for(var e=[],n=Qe(/\\?\"/g,t).split(","),i=0;i<n.length;i++)if(n[i].indexOf(";")>-1){var o=An(n[i]).split(";v=");e[i]={brand:o[0],version:o[1]}}else e[i]=An(n[i]);return e}},ye=function(t){return Dt(t)?t.toLowerCase():t},hi=function(t){return Dt(t)?Qe(/[^\d\.]/g,t).split(".")[0]:void 0},me=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];typeof n==U.OBJECT&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},Qe=function(t,e){return Dt(e)?e.replace(t,Ze):e},xt=function(t){return Qe(/\\?\"/g,t)},An=function(t,e){return t=Qe(/^\s\s*/,String(t)),typeof e===U.UNDEFINED?t:t.substring(0,e)},Ei=function(t,e){if(!(!t||!e))for(var n=0,i,o,r,s,a,l;n<e.length&&!a;){var u=e[n],d=e[n+1];for(i=o=0;i<u.length&&!a&&u[i];)if(a=u[i++].exec(t),a)for(r=0;r<d.length;r++)l=a[++o],s=d[r],typeof s===U.OBJECT&&s.length>0?s.length===2?typeof s[1]==U.FUNCTION?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===U.FUNCTION&&!(s[1].exec&&s[1].test)?s.length>3?this[s[0]]=l?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=l?s[1].call(this,l,s[2]):void 0:s.length==3?this[s[0]]=l?l.replace(s[1],s[2]):void 0:s.length==4?this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=l?s[3].apply(this,[l.replace(s[1],s[2])].concat(s.slice(4))):void 0)):this[s]=l||void 0;n+=2}},fe=function(t,e){for(var n in e)if(typeof e[n]===U.OBJECT&&e[n].length>0){for(var i=0;i<e[n].length;i++)if(bi(e[n][i],t))return n===Ho?void 0:n}else if(bi(e[n],t))return n===Ho?void 0:n;return e.hasOwnProperty("*")?e["*"]:t},Xo={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},Jo={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},wa={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Zo={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[A,[h,qe+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[A,[h,hn+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[A,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,A],[/opios[\/ ]+([\w\.]+)/i],[A,[h,Pt+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[A,[h,Pt+" GX"]],[/\bopr\/([\w\.]+)/i],[A,[h,Pt]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[A,[h,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[A,[h,"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|otter|dooble|(?:lg |qute)browser|palemoon)\/([-\w\.]+)/i,/(heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[h,A],[/quark(?:pc)?\/([-\w\.]+)/i],[A,[h,"Quark"]],[/\bddg\/([\w\.]+)/i],[A,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[A,[h,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[A,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[A,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[A,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[A,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[A,[h,"Smart "+ai+Nt]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure"+Nt],A],[/\bfocus\/([\w\.]+)/i],[A,[h,vt+" Focus"]],[/\bopt\/([\w\.]+)/i],[A,[h,Pt+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[A,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[A,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[A,[h,Pt+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[A,[h,"MIUI"+Nt]],[/fxios\/([\w\.-]+)/i],[A,[h,qe+vt]],[/\bqihoobrowser\/?([\w\.]*)/i],[A,[h,"360"]],[/\b(qq)\/([\w\.]+)/i],[[h,/(.+)/,"$1Browser"],A],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1"+Nt],A],[/samsungbrowser\/([\w\.]+)/i],[A,[h,Ot+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[A,[h,qo+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,qo+" Mobile"],A],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[h,A],[/(lbbrowser|rekonq)/i],[h],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[A,h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,gi],A,[g,je]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[h,A,[g,je]],[/\bgsa\/([\w\.]+) .*safari\//i],[A,[h,"GSA"],[g,je]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[A,[h,"TikTok"],[g,je]],[/\[(linkedin)app\]/i],[h,[g,je]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[h,/(.+)/,"Zalo"],A,[g,je]],[/(chromium)[\/ ]([-\w\.]+)/i],[h,A],[/headlesschrome(?:\/([\w\.]+)| )/i],[A,[h,jo+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[A,[h,hn+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,jo+" WebView"],A],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[A,[h,"Android"+Nt]],[/chrome\/([\w\.]+) mobile/i],[A,[h,qe+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,A],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[A,[h,qe+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[h,qe+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[A,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[A,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[h,A],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[h,qe+vt],A],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],A],[/(wolvic|librewolf)\/([\w\.]+)/i],[h,A],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[A,[h,vt+" 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|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[h,[A,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[h,[A,/[^\d\.]+./,Ze]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[$,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[$,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[$,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[$,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[$,"arm"]],[/ sun4\w[;\)]/i],[[$,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[$,/ower/,Ze,ye]],[/mc680.0/i],[[$,"68k"]],[/winnt.+\[axp/i],[[$,"alpha"]]],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],[m,[E,Ot],[g,x]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[m,[E,Ot],[g,O]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[m,[E,$e],[g,O]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[m,[E,$e],[g,x]],[/(macintosh);/i],[m,[E,$e]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[m,[E,Yo],[g,O]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[m,[E,Wo],[g,x]],[/honor([-\w ]+)[;\)]/i],[m,[E,Wo],[g,O]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[m,[E,Ko],[g,x]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[m,[E,Ko],[g,O]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[m,/_/g," "],[E,fi],[g,x]],[/\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|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[m,/_/g," "],[E,fi],[g,O]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[m,[E,zo],[g,O]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[m,[E,di],[g,O]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[m,[E,fe,{OnePlus:["203","304","403","404","413","415"],"*":di}],[g,x]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[m,[E,"BLU"],[g,O]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[m,[E,"Vivo"],[g,O]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[m,[E,"Realme"],[g,O]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[m,[E,ai],[g,x]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[m,[E,ai],[g,O]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[m,[E,ci],[g,O]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[m,[E,ci],[g,x]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[m,[E,gn],[g,x]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[m,[E,gn],[g,O]],[/(nokia) (t[12][01])/i],[E,m,[g,x]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[m,/_/g," "],[g,O],[E,"Nokia"]],[/(pixel (c|tablet))\b/i],[m,[E,xe],[g,x]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[m,[E,xe],[g,O]],[/(google) (pixelbook( go)?)/i],[E,m],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[m,[E,Rt],[g,O]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[m,"Xperia Tablet"],[E,Rt],[g,x]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[m,[E,pn],[g,x]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[m,/(.+)/g,"Fire Phone $1"],[E,pn],[g,O]],[/(playbook);[-\w\),; ]+(rim)/i],[m,E,[g,x]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[m,[E,Vo],[g,O]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[m,[E,Go],[g,x]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[m,[E,Go],[g,O]],[/(nexus 9)/i],[m,[E,"HTC"],[g,x]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[E,[m,/_/g," "],[g,O]],[/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],[m,[E,"TCL"],[g,x]],[/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],[m,[E,"TCL"],[g,O]],[/(itel) ((\w+))/i],[[E,ye],m,[g,fe,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[m,[E,"Acer"],[g,x]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[m,[E,"Meizu"],[g,O]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[m,[E,"Ulefone"],[g,O]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[m,[E,"Energizer"],[g,O]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[m,[E,"Cat"],[g,O]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[m,[E,"Smartfren"],[g,O]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[m,[E,"Nothing"],[g,O]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[m,[E,"Archos"],[g,x]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[m,[E,"Archos"],[g,O]],[/; (n159v)/i],[m,[E,"HMD"],[g,O]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[E,m,[g,x]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[E,m,[g,O]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[E,m,[g,x]],[/(surface duo)/i],[m,[E,li],[g,x]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[m,[E,"Fairphone"],[g,O]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[m,[E,ui],[g,x]],[/(sprint) (\w+)/i],[E,m,[g,O]],[/(kin\.[onetw]{3})/i],[[m,/\./g," "],[E,li],[g,O]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[m,[E,pi],[g,x]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[m,[E,pi],[g,O]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[E,[g,G]],[/hbbtv.+maple;(\d+)/i],[[m,/^/,"SmartTV"],[E,Ot],[g,G]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[E,m,[g,G]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[E,gn],[g,G]],[/(apple) ?tv/i],[E,[m,$e+" TV"],[g,G]],[/crkey.*devicetype\/chromecast/i],[[m,Ce+" Third Generation"],[E,xe],[g,G]],[/crkey.*devicetype\/([^/]*)/i],[[m,/^/,"Chromecast "],[E,xe],[g,G]],[/fuchsia.*crkey/i],[[m,Ce+" Nest Hub"],[E,xe],[g,G]],[/crkey/i],[[m,Ce],[E,xe],[g,G]],[/(portaltv)/i],[m,[E,gi],[g,G]],[/droid.+aft(\w+)( bui|\))/i],[m,[E,pn],[g,G]],[/(shield \w+ tv)/i],[m,[E,ui],[g,G]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[m,[E,Yo],[g,G]],[/(bravia[\w ]+)( bui|\))/i],[m,[E,Rt],[g,G]],[/(mi(tv|box)-?\w+) bui/i],[m,[E,fi],[g,G]],[/Hbbtv.*(technisat) (.*);/i],[E,m,[g,G]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[E,/.+\/(\w+)/,"$1",fe,{LG:"lge"}],[m,An],[g,G]],[/(playstation \w+)/i],[m,[E,Rt],[g,kt]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[m,[E,li],[g,kt]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[E,m,[g,kt]],[/droid.+; (shield)( bui|\))/i],[m,[E,ui],[g,kt]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[m,[E,Ot],[g,de]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[E,m,[g,de]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[m,[E,di],[g,de]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[m,[E,$e],[g,de]],[/(opwwe\d{3})/i],[m,[E,zo],[g,de]],[/(moto 360)/i],[m,[E,ci],[g,de]],[/(smartwatch 3)/i],[m,[E,Rt],[g,de]],[/(g watch r)/i],[m,[E,gn],[g,de]],[/droid.+; (wt63?0{2,3})\)/i],[m,[E,pi],[g,de]],[/droid.+; (glass) \d/i],[m,[E,xe],[g,fn]],[/(pico) ([\w ]+) os\d/i],[E,m,[g,fn]],[/(quest( \d| pro)?s?).+vr/i],[m,[E,gi],[g,fn]],[/mobile vr; rv.+firefox/i],[[g,fn]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[E,[g,Lt]],[/(aeobc)\b/i],[m,[E,pn],[g,Lt]],[/(homepod).+mac os/i],[m,[E,$e],[g,Lt]],[/windows iot/i],[[g,Lt]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[m,[g,G]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[g,G]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[m,[g,fe,{mobile:"Mobile",xr:"VR","*":x}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[g,x]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[g,O]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[m,[E,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[A,[h,hn+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[h,A],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[A,[h,"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],[h,A],[/ladybird\//i],[[h,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[A,h]],os:[[/(windows nt) (6\.[23]); arm/i],[[h,/N/,"R"],[A,fe,Xo]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[h,A],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[A,/(;|\))/g,"",fe,Xo],[h,Ai]],[/(windows ce)\/?([\d\.]*)/i],[h,A],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[A,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[h,"macOS"],[A,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[A,[h,Ce+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[A,[h,Ce+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[A,[h,Ce+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[A,[h,Ce+" Linux"]],[/crkey\/([\d\.]+)/i],[A,[h,Ce]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[A,h],[/(ubuntu) ([\w\.]+) like android/i],[[h,/(.+)/,"$1 Touch"],A],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[h,A],[/\(bb(10);/i],[A,[h,Vo]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[A,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[A,[h,vt+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[A,[h,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[A,fe,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[A,[h,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,"Chrome OS"],A],[/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,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[h,A],[/(sunos) ?([\d\.]*)/i],[[h,"Solaris"],A],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,A]]},mn=function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return me.call(t.init,[[J,[h,A,_t,g]],[ge,[$]],[pe,[g,m,E]],[se,[h,A]],[Q,[h,A]]]),me.call(t.isIgnore,[[J,[A,_t]],[se,[A]],[Q,[A]]]),me.call(t.isIgnoreRgx,[[J,/ ?browser$/i],[Q,/ ?os$/i]]),me.call(t.toString,[[J,[h,A]],[ge,[$]],[pe,[E,m]],[se,[h,A]],[Q,[h,A]]]),t}(),Ia=function(t,e){var n=mn.init[e],i=mn.isIgnore[e]||0,o=mn.isIgnoreRgx[e]||0,r=mn.toString[e]||0;function s(){me.call(this,n)}return s.prototype.getItem=function(){return t},s.prototype.withClientHints=function(){return Te?Te.getHighEntropyValues(tr).then(function(a){return t.setCH(new nr(a,!1)).parseCH().get()}):t.parseCH().get()},s.prototype.withFeatureCheck=function(){return t.detectFeature().get()},e!=Xe&&(s.prototype.is=function(a){var l=!1;for(var u in this)if(this.hasOwnProperty(u)&&!bi(i,u)&&ye(o?Qe(o,this[u]):this[u])==ye(o?Qe(o,a):a)){if(l=!0,a!=U.UNDEFINED)break}else if(a==U.UNDEFINED&&l){l=!l;break}return l},s.prototype.toString=function(){var a=Ze;for(var l in r)typeof this[r[l]]!==U.UNDEFINED&&(a+=(a?" ":Ze)+this[r[l]]);return a||U.UNDEFINED}),Te||(s.prototype.then=function(a){var l=this,u=function(){for(var p in l)l.hasOwnProperty(p)&&(this[p]=l[p])};u.prototype={is:s.prototype.is,toString:s.prototype.toString};var d=new u;return a(d),d}),new s};function nr(t,e){if(t=t||{},me.call(this,tr),e)me.call(this,[[wi,mi(t[Oe])],[Ii,mi(t[da])],[O,/\?1/.test(t[ma])],[m,xt(t[ha])],[Je,xt(t[er])],[Si,xt(t[Ea])],[$,xt(t[fa])],[ke,mi(t[ga])],[bn,xt(t[pa])]]);else for(var n in t)this.hasOwnProperty(n)&&typeof t[n]!==U.UNDEFINED&&(this[n]=t[n])}function Qo(t,e,n,i){return this.get=function(o){return o?this.data.hasOwnProperty(o)?this.data[o]:void 0:this.data},this.set=function(o,r){return this.data[o]=r,this},this.setCH=function(o){return this.uaCH=o,this},this.detectFeature=function(){if(Z&&Z.userAgent==this.ua)switch(this.itemType){case J:Z.brave&&typeof Z.brave.isBrave==U.FUNCTION&&this.set(h,"Brave");break;case pe:!this.get(g)&&Te&&Te[O]&&this.set(g,O),this.get(m)=="Macintosh"&&Z&&typeof Z.standalone!==U.UNDEFINED&&Z.maxTouchPoints&&Z.maxTouchPoints>2&&this.set(m,"iPad").set(g,x);break;case Q:!this.get(h)&&Te&&Te[Je]&&this.set(h,Te[Je]);break;case Xe:var o=this.data,r=function(s){return o[s].getItem().detectFeature().get()};this.set(J,r(J)).set(ge,r(ge)).set(pe,r(pe)).set(se,r(se)).set(Q,r(Q))}return this},this.parseUA=function(){switch(this.itemType!=Xe&&Ei.call(this.data,this.ua,this.rgxMap),this.itemType){case J:this.set(_t,hi(this.get(A)));break;case Q:if(this.get(h)=="iOS"&&this.get(A)=="18.6"){var o=/\) Version\/([\d\.]+)/.exec(this.ua);o&&parseInt(o[1].substring(0,2),10)>=26&&this.set(A,o[1])}break}return this},this.parseCH=function(){var o=this.uaCH,r=this.rgxMap;switch(this.itemType){case J:case se:var s=o[Ii]||o[wi],a;if(s)for(var l=0;l<s.length;l++){var u=s[l].brand||s[l],d=s[l].version;this.itemType==J&&!/not.a.brand/i.test(u)&&(!a||/Chrom/.test(a)&&u!=$o||a==hn&&/WebView2/.test(u))&&(u=fe(u,wa),a=this.get(h),a&&!/Chrom/.test(a)&&/Chrom/.test(u)||this.set(h,u).set(A,d).set(_t,hi(d)),a=u),this.itemType==se&&u==$o&&this.set(A,d)}break;case ge:var p=o[$];p&&(p&&o[bn]=="64"&&(p+="64"),Ei.call(this.data,p+";",r));break;case pe:if(o[O]&&this.set(g,O),o[m]&&(this.set(m,o[m]),!this.get(g)||!this.get(E))){var S={};Ei.call(S,"droid 9; "+o[m]+")",r),!this.get(g)&&S.type&&this.set(g,S.type),!this.get(E)&&S.vendor&&this.set(E,S.vendor)}if(o[ke]){var w;if(typeof o[ke]!="string")for(var f=0;!w&&f<o[ke].length;)w=fe(o[ke][f++],Jo);else w=fe(o[ke],Jo);this.set(g,w)}break;case Q:var C=o[Je];if(C){var b=o[Si];C==Ai&&(b=parseInt(hi(b),10)>=13?"11":"10"),this.set(h,C).set(A,b)}this.get(h)==Ai&&o[m]=="Xbox"&&this.set(h,"Xbox").set(A,void 0);break;case Xe:var R=this.data,L=function(y){return R[y].getItem().setCH(o).parseCH().get()};this.set(J,L(J)).set(ge,L(ge)).set(pe,L(pe)).set(se,L(se)).set(Q,L(Q))}return this},me.call(this,[["itemType",t],["ua",e],["uaCH",i],["rgxMap",n],["data",Ia(this,t)]]),this}function ee(t,e,n){if(typeof t===U.OBJECT?(En(t,!0)?(typeof e===U.OBJECT&&(n=e),e=t):(n=t,e=void 0),t=void 0):typeof t===U.STRING&&!En(e,!0)&&(n=e,e=void 0),n)if(typeof n.append===U.FUNCTION){var i={};n.forEach(function(d,p){i[String(p).toLowerCase()]=d}),n=i}else{var o={};for(var r in n)n.hasOwnProperty(r)&&(o[String(r).toLowerCase()]=n[r]);n=o}if(!(this instanceof ee))return new ee(t,e,n).getResult();var s=typeof t===U.STRING?t:n&&n[Fo]?n[Fo]:Z&&Z.userAgent?Z.userAgent:Ze,a=new nr(n,!0),l=e?ba(Zo,e):Zo,u=function(d){return d==Xe?function(){return new Qo(d,s,l,a).set("ua",s).set(J,this.getBrowser()).set(ge,this.getCPU()).set(pe,this.getDevice()).set(se,this.getEngine()).set(Q,this.getOS()).get()}:function(){return new Qo(d,s,l[d],a).parseUA().get()}};return me.call(this,[["getBrowser",u(J)],["getCPU",u(ge)],["getDevice",u(pe)],["getEngine",u(se)],["getOS",u(Q)],["getResult",u(Xe)],["getUA",function(){return s}],["setUA",function(d){return Dt(d)&&(s=An(d,ua)),this}]]).setUA(s),this}ee.VERSION=ca;ee.BROWSER=wn([h,A,_t,g]);ee.CPU=wn([$]);ee.DEVICE=wn([m,E,g,kt,O,G,x,de,Lt]);ee.ENGINE=ee.OS=wn([h,A]);var Fd=Object.freeze({115:"115",2345:"2345",360:"360",ALIPAY:"Alipay",AMAYA:"Amaya",ANDROID:"Android Browser",ARORA:"Arora",AVANT:"Avant",AVAST:"Avast Secure Browser",AVG:"AVG Secure Browser",BAIDU:"Baidu Browser",BASILISK:"Basilisk",BING:"Bing",BLAZER:"Blazer",BOLT:"Bolt",BOWSER:"Bowser",BRAVE:"Brave",CAMINO:"Camino",CHIMERA:"Chimera",CHROME:"Chrome",CHROME_HEADLESS:"Chrome Headless",CHROME_MOBILE:"Mobile Chrome",CHROME_WEBVIEW:"Chrome WebView",CHROMIUM:"Chromium",COBALT:"Cobalt",COC_COC:"Coc Coc",CONKEROR:"Conkeror",DAUM:"Daum",DILLO:"Dillo",DOLPHIN:"Dolphin",DOOBLE:"Dooble",DORIS:"Doris",DRAGON:"Dragon",DUCKDUCKGO:"DuckDuckGo",ECOSIA:"Ecosia",EDGE:"Edge",EDGE_WEBVIEW:"Edge WebView",EDGE_WEBVIEW2:"Edge WebView2",EPIPHANY:"Epiphany",FACEBOOK:"Facebook",FALKON:"Falkon",FIREBIRD:"Firebird",FIREFOX:"Firefox",FIREFOX_FOCUS:"Firefox Focus",FIREFOX_MOBILE:"Mobile Firefox",FIREFOX_REALITY:"Firefox Reality",FENNEC:"Fennec",FLOCK:"Flock",FLOW:"Flow",GO:"GoBrowser",GOOGLE_SEARCH:"GSA",HELIO:"Helio",HEYTAP:"HeyTap",HONOR:"Honor",HUAWEI:"Huawei Browser",ICAB:"iCab",ICE:"ICE Browser",ICEAPE:"IceApe",ICECAT:"IceCat",ICEDRAGON:"IceDragon",ICEWEASEL:"IceWeasel",IE:"IE",INSTAGRAM:"Instagram",IRIDIUM:"Iridium",IRON:"Iron",JASMINE:"Jasmine",KONQUEROR:"Konqueror",KAKAO:"KakaoTalk",KHTML:"KHTML",K_MELEON:"K-Meleon",KLAR:"Klar",KLARNA:"Klarna",KINDLE:"Kindle",LENOVO:"Smart Lenovo Browser",LADYBIRD:"Ladybird",LG:"LG Browser",LIBREWOLF:"LibreWolf",LIEBAO:"LBBROWSER",LINE:"Line",LINKEDIN:"LinkedIn",LINKS:"Links",LUNASCAPE:"Lunascape",LYNX:"Lynx",MAEMO:"Maemo Browser",MAXTHON:"Maxthon",MIDORI:"Midori",MINIMO:"Minimo",MIUI:"MIUI Browser",MOZILLA:"Mozilla",MOSAIC:"Mosaic",NAVER:"Naver",NETFRONT:"NetFront",NETSCAPE:"Netscape",NETSURF:"Netsurf",NOKIA:"Nokia Browser",OBIGO:"Obigo",OCULUS:"Oculus Browser",OMNIWEB:"OmniWeb",OPERA:"Opera",OPERA_COAST:"Opera Coast",OPERA_GX:"Opera GX",OPERA_MINI:"Opera Mini",OPERA_MOBI:"Opera Mobi",OPERA_TABLET:"Opera Tablet",OPERA_TOUCH:"Opera Touch",OTTER:"Otter",OVI:"OviBrowser",PALEMOON:"PaleMoon",PHANTOMJS:"PhantomJS",PHOENIX:"Phoenix",PICOBROWSER:"Pico Browser",POLARIS:"Polaris",PUFFIN:"Puffin",QQ:"QQBrowser",QQ_LITE:"QQBrowserLite",QUARK:"Quark",QUPZILLA:"QupZilla",QUTEBROWSER:"qutebrowser",QWANT:"Qwant",REKONQ:"rekonq",ROCKMELT:"Rockmelt",SAFARI:"Safari",SAFARI_MOBILE:"Mobile Safari",SAILFISH:"Sailfish Browser",SAMSUNG:"Samsung Internet",SEAMONKEY:"SeaMonkey",SILK:"Silk",SKYFIRE:"Skyfire",SLEIPNIR:"Sleipnir",SLIMBOAT:"SlimBoat",SLIMBROWSER:"SlimBrowser",SLIMJET:"Slimjet",SNAPCHAT:"Snapchat",SOGOU_EXPLORER:"Sogou Explorer",SOGOU_MOBILE:"Sogou Mobile",SURF:"Surf",SWIFTFOX:"Swiftfox",TESLA:"Tesla",TIKTOK:"TikTok",TIZEN:"Tizen Browser",TWITTER:"Twitter",UC:"UCBrowser",UP:"UP.Browser",VIVALDI:"Vivaldi",VIVO:"Vivo Browser",W3M:"w3m",WATERFOX:"Waterfox",WEBKIT:"WebKit",WECHAT:"WeChat",WEIBO:"Weibo",WHALE:"Whale",WOLVIC:"Wolvic",YANDEX:"Yandex",ZALO:"Zalo"});var Bt=Object.freeze({CRAWLER:"crawler",CLI:"cli",EMAIL:"email",FETCHER:"fetcher",INAPP:"inapp",MEDIAPLAYER:"mediaplayer",LIBRARY:"library"}),ir=Object.freeze({"68K":"68k",ALPHA:"alpha",ARM:"arm",ARM_64:"arm64",ARM_HF:"armhf",AVR:"avr",AVR_32:"avr32",IA64:"ia64",IRIX:"irix",IRIX_64:"irix64",MIPS:"mips",MIPS_64:"mips64",PA_RISC:"pa-risc",PPC:"ppc",SPARC:"sparc",SPARC_64:"sparc64",X86:"ia32",X86_64:"amd64"});var Hd=Object.freeze({CONSOLE:"console",DESKTOP:"desktop",EMBEDDED:"embedded",MOBILE:"mobile",SMARTTV:"smarttv",TABLET:"tablet",WEARABLE:"wearable",XR:"xr"});var Gd=Object.freeze({ACER:"Acer",ADVAN:"Advan",ALCATEL:"Alcatel",APPLE:"Apple",AMAZON:"Amazon",ARCHOS:"Archos",ASUS:"ASUS",ATT:"AT&T",BENQ:"BenQ",BLACKBERRY:"BlackBerry",BLU:"BLU",CAT:"Cat",DELL:"Dell",ENERGIZER:"Energizer",ESSENTIAL:"Essential",FACEBOOK:"Facebook",FAIRPHONE:"Fairphone",GEEKSPHONE:"GeeksPhone",GENERIC:"Generic",GOOGLE:"Google",HISENSE:"Hisense",HMD:"HMD",HP:"HP",HTC:"HTC",HUAWEI:"Huawei",IMO:"IMO",INFINIX:"Infinix",ITEL:"itel",JOLLA:"Jolla",KOBO:"Kobo",LAVA:"Lava",LENOVO:"Lenovo",LG:"LG",MEIZU:"Meizu",MICROMAX:"Micromax",MICROSOFT:"Microsoft",MOTOROLA:"Motorola",NEXIAN:"Nexian",NINTENDO:"Nintendo",NOKIA:"Nokia",NOTHING:"Nothing",NVIDIA:"Nvidia",ONEPLUS:"OnePlus",OPPO:"OPPO",OUYA:"Ouya",PALM:"Palm",PANASONIC:"Panasonic",PEBBLE:"Pebble",PHILIPS:"Philips",PICO:"Pico",POLYTRON:"Polytron",REALME:"Realme",RETROID:"Retroid",RIM:"RIM",ROKU:"Roku",SAMSUNG:"Samsung",SHARP:"Sharp",SIEMENS:"Siemens",SMARTFREN:"Smartfren",SONY:"Sony",SPRINT:"Sprint",TCL:"TCL",TECHNISAT:"TechniSAT",TECNO:"TECNO",TESLA:"Tesla",ULEFONE:"Ulefone",VIVO:"Vivo",VIZIO:"Vizio",VODAFONE:"Vodafone",WIKO:"Wiko",XBOX:"Xbox",XIAOMI:"Xiaomi",ZEBRA:"Zebra",ZTE:"ZTE"});var or=Object.freeze({AMAYA:"Amaya",ARKWEB:"ArkWeb",BLINK:"Blink",EDGEHTML:"EdgeHTML",FLOW:"Flow",GECKO:"Gecko",GOANNA:"Goanna",ICAB:"iCab",KHTML:"KHTML",LIBWEB:"LibWeb",LINKS:"Links",LYNX:"Lynx",NETFRONT:"NetFront",NETSURF:"NetSurf",PRESTO:"Presto",SERVO:"Servo",TASMAN:"Tasman",TRIDENT:"Trident",W3M:"w3m",WEBKIT:"WebKit"});var rr=Object.freeze({AIX:"AIX",AMIGA_OS:"Amiga OS",ANDROID:"Android",ANDROID_X86:"Android-x86",ARCAOS:"ArcaOS",ARCH:"Arch",BADA:"Bada",BEOS:"BeOS",BLACKBERRY:"BlackBerry",CENTOS:"CentOS",CHROME_OS:"Chrome OS",CHROMECAST:"Chromecast",CHROMECAST_ANDROID:"Chromecast Android",CHROMECAST_FUCHSIA:"Chromecast Fuchsia",CHROMECAST_LINUX:"Chromecast Linux",CHROMECAST_SMARTSPEAKER:"Chromecast SmartSpeaker",CONTIKI:"Contiki",DEBIAN:"Debian",DEEPIN:"Deepin",DRAGONFLY:"DragonFly",ELEMENTARY_OS:"elementary OS",FEDORA:"Fedora",FIREFOX_OS:"Firefox OS",FREEBSD:"FreeBSD",FUCHSIA:"Fuchsia",GENTOO:"Gentoo",GHOSTBSD:"GhostBSD",GNU:"GNU",HAIKU:"Haiku",HARMONYOS:"HarmonyOS",HP_UX:"HP-UX",HURD:"Hurd",IOS:"iOS",JOLI:"Joli",KAIOS:"KaiOS",KNOPPIX:"Knoppix",KUBUNTU:"Kubuntu",LINPUS:"Linpus",LINSPIRE:"Linspire",LINUX:"Linux",MACOS:"macOS",MAEMO:"Maemo",MAGEIA:"Mageia",MANDRIVA:"Mandriva",MANJARO:"Manjaro",MEEGO:"MeeGo",MINIX:"Minix",MINT:"Mint",MORPH_OS:"Morph OS",NETBSD:"NetBSD",NETRANGE:"NetRange",NETTV:"NetTV",NINTENDO:"Nintendo",OPENHARMONY:"OpenHarmony",OPENBSD:"OpenBSD",OPENVMS:"OpenVMS",OS2:"OS/2",PALM:"Palm",PC_BSD:"PC-BSD",PCLINUXOS:"PCLinuxOS",PICO:"Pico",PLAN9:"Plan9",PLAYSTATION:"PlayStation",QNX:"QNX",RASPBIAN:"Raspbian",REDHAT:"RedHat",RIM_TABLET_OS:"RIM Tablet OS",RISC_OS:"RISC OS",SABAYON:"Sabayon",SAILFISH:"Sailfish",SERENITYOS:"SerenityOS",SERIES40:"Series40",SLACKWARE:"Slackware",SOLARIS:"Solaris",SUSE:"SUSE",SYMBIAN:"Symbian",TIZEN:"Tizen",UBUNTU:"Ubuntu",UBUNTU_TOUCH:"Ubuntu Touch",UNIX:"Unix",VECTORLINUX:"VectorLinux",WATCHOS:"watchOS",WEBOS:"WebOS",WINDOWS:"Windows",WINDOWS_CE:"Windows CE",WINDOWS_IOT:"Windows IoT",WINDOWS_MOBILE:"Windows Mobile",WINDOWS_PHONE:"Windows Phone",WINDOWS_RT:"Windows RT",XBOX:"Xbox",XUBUNTU:"Xubuntu",ZENWALK:"Zenwalk"});var sr=Object.freeze({BrowserName:{CLI:{CURL:"curl",ELINKS:"ELinks",HTTPIE:"HTTPie",LYNX:"Lynx",WGET:"Wget"},Crawler:{AHREFS_BOT:"AhrefsBot",AI2_BOT:"AI2Bot",AIHIT_BOT:"aiHitBot",ALGOLIA_CRAWLER:"Algolia Crawler",APPLE_BOT:"Applebot",APPLE_BOT_EXTENDED:"Applebot-Extended",ASK_TEOMA:"Teoma",AMAZON_BOT:"Amazonbot",AMAZON_CONTXBOT:"contxbot",ANTHROPIC_AI:"anthropic-ai",ANTHROPIC_CLAUDE_BOT:"ClaudeBot",ANTHROPIC_CLAUDE_SEARCHBOT:"Claude-SearchBot",ANTHROPIC_CLAUDE_WEB:"Claude-Web",ARCHIVEORG_BOT:"archive.org_bot",BAIDU_ADS:"Baidu-ADS",BAIDU_SPIDER:"Baiduspider",BAIDU_SPIDER_ADS:"Baiduspider-ads",BAIDU_SPIDER_CPRO:"Baiduspider-cpro",BAIDU_SPIDER_FAVO:"Baiduspider-favo",BAIDU_SPIDER_IMAGE:"Baiduspider-image",BAIDU_SPIDER_NEWS:"Baiduspider-news",BAIDU_SPIDER_RENDER:"Baiduspider-render",BAIDU_SPIDER_VIDEO:"Baiduspider-video",BLEX_BOT:"BLEXBot",BOTIFY:"botify",BRAVE_BOT:"Bravebot",BYTEDANCE_BYTESPIDER:"Bytespider",BYTEDANCE_TIKTOKSPIDER:"TikTokSpider",COMMON_CRAWL_CCBOT:"CCBot",COCCOC_BOT_WEB:"coccocbot-web",COCCOC_BOT_IMAGE:"coccocbot-image",COHERE_TRAINING_DATA_CRAWLER:"cohere-training-data-crawler",COTOYOGI:"Cotoyogi",COVEO_BOT:"Coveobot",CRITEO_BOT:"CriteoBot",DATAFORSEO_BOT:"DataForSeoBot",DAUM:"Daum",DAUM_DAUMOA:"Daumoa",DAUM_DAUMOA_IMAGE:"Daumoa-image",DEEPSEEK_BOT:"DeepSeekBot",DIFFBOT:"Diffbot",DUCKDUCKGO_BOT:"DuckDuckBot",DUCKDUCKGO_FAVICONS_BOT:"DuckDuckGo-Favicons-Bot",ELASTIC:"Elastic",ELASTIC_SWIFTYPE_BOT:"Swiftbot",EXALEAD_EXABOT:"Exabot",FIRECRAWL_AGENT:"FirecrawlAgent",FREESPOKE:"Freespoke",GOOGLE_ADSBOT:"AdsBot-Google",GOOGLE_ADSBOT_MOBILE:"Adsbot-Google-Mobile",GOOGLE_ADSENSE:"AdSense",GOOGLE_APIS:"APIs-Google",GOOGLE_BOT:"Googlebot",GOOGLE_BOT_IMAGE:"Googlebot-Image",GOOGLE_BOT_NEWS:"Googlebot-News",GOOGLE_BOT_VIDEO:"Googlebot-Video",GOOGLE_CLOUDVERTEXBOT:"Google-CloudVertexBot",GOOGLE_EXTENDED:"Google-Extended",GOOGLE_INSPECTIONTOOL:"Google-InspectionTool",GOOGLE_OTHER:"GoogleOther",GOOGLE_OTHER_IMAGE:"GoogleOther-Image",GOOGLE_OTHER_VIDEO:"GoogleOther-Video",GOOGLE_SAFETY:"Google-Safety",GOOGLE_STOREBOT:"Storebot-Google",HIVE_IMAGESIFTBOT:"ImagesiftBot",HUAWEI_PANGUBOT:"PanguBot",HUAWEI_PETALBOT:"PetalBot",HUGGINGFACE_BOT:"HuggingFace-Bot",HUNTER_VELENPUBLICWEBCRAWLER:"VelenPublicWebCrawler",IA_ARCHIVER:"ia_archiver",IASK_BOT:"iAskBot",KAGI_BOT:"Kagibot",KANGAROO_BOT:"Kangaroo Bot",LINE_SPIDER:"Linespider",LINKEDIN_BOT:"LinkedInBot",MAGPIE_CRAWLER:"magpie-crawler",MARGINALIA:"marginalia",META_EXTERNALAGENT:"meta-externalagent",META_FACEBOOKBOT:"FacebookBot",META_FACEBOOKCATALOG:"facebookcatalog",META_FACEBOOKEXTERNALHIT:"facebookexternalhit",MAJESTIC_MJ12BOT:"MJ12bot",MICROSOFT_BINGBOT:"Bingbot",MICROSOFT_MSNBOT:"msnbot",MICROSOFT_ADIDXBOT:"adidxbot",MOJEEK_BOT:"MojeekBot",MOZ_DOTBOT:"DotBot",ONCRAWL:"OnCrawl",ONESPOT_SCRAPERBOT:"Onespot-ScraperBot",OPENAI_GPTBOT:"GPTBot",OPENAI_SEARCH_BOT:"OAI-SearchBot",PERPLEXITY_BOT:"PerplexityBot",QIHOO_360_SPIDER:"360Spider",QWANT_BOT:"Qwantbot",QWANT_BOT_NEWS:"Qwantbot-news",REPLICATE_BOT:"Replicate-Bot",RUNPOD_BOT:"RunPod-Bot",SB_INTUITIONS_BOT:"SBIntuitionsBot",SEEKPORT_BOT:"SeekportBot",SEMRUSH_BOT:"SemrushBot",SEMRUSH_BOT_BACKLINK:"SemrushBot-BA",SEMRUSH_BOT_CONTENTSHAKE:"SemrushBot-OCOB",SEMRUSH_BOT_SEO_CHECKER:"SemrushBot-SI",SEZNAM_BOT:"SeznamBot",SITEIMPROVE:"Siteimprove",SOGOU_PIC_SPIDER:"Sogou Pic Spider",SOGOU_WEB_SPIDER:"Sogou web spider",STARTPAGE:"Startpage",SURLY_BOT:"SurdotlyBot",TIMPI_BOT:"Timpibot",TOGETHER_BOT:"Together-Bot",TURNITIN_BOT:"TurnitinBot",TWIN_AGENT:"TwinAgent",VERCEL_V0BOT:"v0bot",WEBZIO:"webzio",WEBZIO_EXTENDED:"Webzio-Extended",WEBZIO_OMGILI:"omgili",WEBZIO_OMGILI_BOT:"omgilibot",XAI_BOT:"xAI-Bot",YAHOO_JAPAN:"Y!J-BRW",YAHOO_SLURP:"Yahoo! Slurp",YANDEX_ACCESSIBILITY_BOT:"YandexAccessibilityBot",YANDEX_ADDITIONAL_BOT:"YandexAdditionalBot",YANDEX_ADNET:"YandexAdNet",YANDEX_BLOGS:"YandexBlogs",YANDEX_BOT:"YandexBot",YANDEX_BOT_MIRRORDETECTOR:"YandexBot MirrorDetector",YANDEX_COMBOT:"YandexComBot",YANDEX_FAVICONS:"YandexFavicons",YANDEX_IMAGE_RESIZER:"YandexImageResizer",YANDEX_IMAGES:"YandexImages",YANDEX_MARKET:"YandexMarket",YANDEX_MEDIA:"YandexMedia",YANDEX_METRIKA:"YandexMetrika",YANDEX_MOBILE_BOT:"YandexMobileBot",YANDEX_MOBILE_SCREENSHOT_BOT:"YandexMobileScreenShotBot",YANDEX_NEWS:"YandexNews",YANDEX_ONTODB:"YandexOntoDB",YANDEX_ONTODB_API:"YandexOntoDBAPI",YANDEX_PARTNER:"YandexPartner",YANDEX_RCA:"YandexRCA",YANDEX_RENDERRESOURCES_BOT:"YandexRenderResourcesBot",YANDEX_SCREENSHOT_BOT:"YandexScreenshotBot",YANDEX_SPRAV_BOT:"YandexSpravBot",YANDEX_TRACKER:"YandexTracker",YANDEX_VERTICALS:"YandexVerticals",YANDEX_VERTIS:"YandexVertis",YANDEX_VIDEO:"YandexVideo",YANDEX_VIDEO_PARSER:"YandexVideoParser",YANDEX_WEBMASTER:"YandexWebmaster",YEP_BOT:"YepBot",YETI:"Yeti",YISOU_SPIDER:"YisouSpider",YOU_BOT:"YouBot",ZHIPU_CHATGLM_SPIDER:"ChatGLM-Spider",ZUM_BOT:"ZumBot"},Email:{AIRMAIL:"Airmail",APPLE_MAIL:"Mail",BLUEMAIL:"BlueMail",DAUM_MAIL:"DaumMail",EVOLUTION:"Evolution",EM_CLIENT:"eM Client",FOXMAIL:"Foxmail",KMAIL:"KMail",KMAIL2:"kmail2",KONTACT:"Kontact",MICROSOFT_OUTLOOK:"Microsoft Outlook",MICROSOFT_OUTLOOK_MAC:"MacOutlook",NAVER_MAILAPP:"NaverMailApp",POLYMAIL:"Polymail",PROTON_MAIL:"ProtonMail",SPARK_MAIL:"SparkDesktop",SPARROW:"Sparrow",THUNDERBIRD:"Thunderbird",YAHOO_MAIL:"Yahoo",ZIMBRA:"Zimbra",ZOHO_MAIL:"ZohoMail-Desktop"},Fetcher:{AHREFS_SITEAUDIT:"AhrefsSiteAudit",ANTHROPIC_CLAUDE_USER:"Claude-User",ASANA:"Asana",BETTER_UPTIME_BOT:"Better Uptime Bot",BITLY_BOT:"bitlybot",BLUESKY:"Bluesky",BUFFER_LINKPREVIEWBOT:"BufferLinkPreviewBot",COHERE_AI:"Cohere-AI",DISCORD_BOT:"Discordbot",DUCKDUCKGO_ASSISTBOT:"DuckAssistBot",GOOGLE_CHROME_LIGHTHOUSE:"Chrome-Lighthouse",GOOGLE_FEEDFETCHER:"FeedFetcher-Google",GOOGLE_GEMINI_DEEP_RESEARCH:"Gemini-Deep-Research",GOOGLE_IMAGEPROXY:"GoogleImageProxy",GOOGLE_PAGERENDERER:"Google-PageRenderer",GOOGLE_READ_ALOUD:"Google-Read-Aloud",GOOGLE_PRODUCER:"GoogleProducer",GOOGLE_SITE_VERIFICATION:"Google-Site-Verification",HUBSPOT_PAGE_FETCHER:"HubSpot Page Fetcher",IFRAMELY:"Iframely",KAKAOTALK_SCRAP:"kakaotalk-scrap",KEYBASE_BOT:"KeybaseBot",META_EXTERNALFETCHER:"meta-externalfetcher",META_WHATSAPP:"WhatsApp",MICROSOFT_BINGPREVIEW:"BingPreview",MICROSOFT_PREVIEW:"MicrosoftPreview",MISTRALAI_USER:"MistralAI-User",NAVER_BLUENO:"Blueno",ONCRAWL_ROGERBOT:"rogerbot",OPENAI_CHATGPT_USER:"ChatGPT-User",PERPLEXITY_USER:"Perplexity-User",PINTEREST_BOT:"Pinterestbot",SEMRUSH_SITEAUDITBOT:"SiteAuditBot",SLACK_BOT:"Slackbot",SLACK_BOT_LINKEXPANDING:"Slackbot-LinkExpanding",SLACK_IMGPROXY:"Slack-ImgProxy",SNAP_URL_PREVIEW:"Snap URL Preview",SKYPE_URIPREVIEW:"SkypeUriPreview",TELEGRAM_BOT:"TelegramBot",UPTIMEROBOT:"UptimeRobot",VERCEL_FAVICON_BOT:"vercel-favicon-bot",VERCEL_SCREENSHOT_BOT:"vercel-screenshot-bot",VERCEL_BOT:"Vercelbot",VERCEL_FLAGS:"vercelflags",VERCEL_TRACING:"verceltracing",X_TWITTERBOT:"Twitterbot",YANDEX_CALENDAR:"YandexCalendar",YANDEX_DIRECT:"YandexDirect",YANDEX_DIRECTDYN:"YandexDirectDyn",YANDEX_DIRECTFETCHER:"YaDirectFetcher",YANDEX_FORDOMAIN:"YandexForDomain",YANDEX_PAGECHECKER:"YandexPagechecker",YANDEX_SEARCHSHOP:"YandexSearchShop",YANDEX_SITELINKS:"YandexSitelinks",YANDEX_USERPROXY:"YandexUserproxy",ZOOMINFO_BOT:"Zoombot"},InApp:{DISCORD:"Discord",EVERNOTE:"Evernote",FIGMA:"Figma",FLIPBOARD:"Flipboard",MATTERMOST:"Mattermost",TEAMS:"Teams",NOTION:"Notion",POSTMAN:"Postman",RAMBOX:"Rambox",ROCKETCHAT:"Rocket.Chat",SLACK:"Slack",TIKTOK_LITE:"TikTok Lite",VSCODE:"VS Code",YAHOO_JAPAN:"Yahoo! Japan"},Library:{ADOBE_AIR:"AdobeAIR",AIOHTTP:"aiohttp",APACHE_HTTPCLIENT:"Apache-HttpClient",AXIOS:"axios",GO_HTTP_CLIENT:"go-http-client",GOT:"got",GUZZLEHTTP:"GuzzleHttp",JAVA:"Java",JAVA_HTTPCLIENT:"Java-http-client",JSDOM:"jsdom",LIBWWW_PERL:"libwww-perl",LUA_RESTY_HTTP:"lua-resty-http",NEEDLE:"Needle",NUTCH:"Nutch",OKHTTP:"OkHttp",NODE_FETCH:"node-fetch",NODE_SUPERAGENT:"node-superagent",PHP_SOAP:"PHP-SOAP",POSTMAN_RUNTIME:"PostmanRuntime",PYTHON_HTTPX:"python-httpx",PYTHON_URLLIB:"python-urllib",PYTHON_URLLIB3:"python-urllib3",PYTHON_REQUESTS:"python-requests",SCRAPY:"Scrapy"}},DeviceVendor:{Vehicle:{BMW:"BMW",BYD:"BYD",JEEP:"Jeep",RIVIAN:"Rivian",TESLA:"Tesla",VOLVO:"Volvo"}}});var D="model",F="name",P="type",k="vendor",Y="version",Le="mobile",q="tablet",Ci="crawler",Sa="cli",ar="email",lr="fetcher",et="inapp",Mt="mediaplayer",Ca="library",Ta=Object.freeze({browser:[[/(wget|curl|lynx|elinks|httpie)[\/ ]\(?([\w\.-]+)/i],[F,Y,[P,Sa]]]}),ur=Object.freeze({browser:[[/((?:adidx|ahrefs|amazon|bing|brave|cc|contx|coveo|criteo|dot|duckduck(?:go-favicons-)?|exa|facebook|gpt|iask|kagi|kangaroo |linkedin|mj12|mojeek|oai-search|onespot-scraper|perplexity|sbintuitions|semrush|seznam|surdotly|swift|yep)bot)\/([\w\.-]+)/i,/(algolia crawler(?: renderscript)?)\/?([\w\.]*)/i,/(applebot(?:-extended)?)\/?([\w\.]*)/i,/(baiduspider[-imagevdonwsfcpr]{0,7})\/?([\w\.]*)/i,/(claude(?:bot|-searchbot|-web)|anthropic-ai)\/?([\w\.]*)/i,/(coccocbot-(?:image|web))\/([\w\.]+)/i,/(daum(?:oa)?(?:-image)?)[ \/]([\w\.]+)/i,/(facebook(?:externalhit|catalog)|meta-externalagent)\/([\w\.]+)/i,/(google(?:bot|other|-inspectiontool)(?:-image|-video|-news)?|storebot-google)\/?([\w\.]*)/i,/(ia_archiver|archive\.org_bot)\/?([\w\.]*)/i,/(oncrawl) mobile\/([\w\.]+)/i,/(qwantbot(?:-news)?)[-\w]*\/?([\w\.]*)/i,/((?:semrush|splitsignal)bot[-abcfimostw]*)\/?([\w\.-]*)/i,/(sogou (?:pic|head|web|orion|news) spider)\/([\w\.]+)/i,/(y!?j-(?:asr|br[uw]|dscv|mmp|vsidx|wsc))\/([\w\.]+)/i,/(yandex(?:(?:mobile)?(?:accessibility|additional|com|renderresources|screenshot|sprav)?bot(?!.+mirror)|image(?:s|resizer)|adnet|blogs|favicons|market|media|metrika|news|ontodb(?:api)?|partner|rca|tracker|turbo|verti(?:cal)?s|webmaster|video(?:parser)?))\/([\w\.]+)/i,/(yeti)\/([\w\.]+)/i,/((?:aihit|blex|diff|huggingface-|msn|pangu|replicate-|runpod-|timpi|together-|xai-|you|zum)bot|(?:magpie-|velenpublicweb)crawler|(?:chatglm-|line|screaming frog seo |yisou)spider|cotoyogi|firecrawlagent|freespoke|omgili(?:bot)?|openai image downloader|startpageprivateimageproxy|twinagent|webzio-extended)\/?([\w\.]*)/i],[F,Y,[P,Ci]],[/(yandexbot\/([\w\.]+); mirrordetector)/i],[[F,/\/.+;/ig,""],Y,[P,Ci]],[/((?:adsbot|apis|mediapartners)-google(?:-mobile)?|google-?(?:other|cloudvertexbot|extended|safety))/i,/\b((ai2|aspiegel|dataforseo|deepseek|imagesift|petal|seekport|turnitin|v0)bot|360spider-?(image|video)?|baidu-ads|botify|(byte|tiktok)spider|cohere-training-data-crawler|elastic(?=\/s)|marginalia|siteimprove(?=bot|\.com)|teoma|webzio|yahoo! slurp)/i],[F,[P,Ci]]]}),Kd=Object.freeze({device:[[/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[k,D,[P,q]],[/(u304aa)/i],[D,[k,"AT&T"],[P,Le]],[/\bsie-(\w*)/i],[D,[k,"Siemens"],[P,Le]],[/\b(rct\w+) b/i],[D,[k,"RCA"],[P,q]],[/\b(venue[\d ]{2,7}) b/i],[D,[k,"Dell"],[P,q]],[/\b(q(?:mv|ta)\w+) b/i],[D,[k,"Verizon"],[P,q]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[D,[k,"Barnes & Noble"],[P,q]],[/\b(tm\d{3}\w+) b/i],[D,[k,"NuVision"],[P,q]],[/\b(k88) b/i],[D,[k,"ZTE"],[P,q]],[/\b(nx\d{3}j) b/i],[D,[k,"ZTE"],[P,Le]],[/\b(gen\d{3}) b.+49h/i],[D,[k,"Swiss"],[P,Le]],[/\b(zur\d{3}) b/i],[D,[k,"Swiss"],[P,q]],[/^((zeki)?tb.*\b) b/i],[D,[k,"Zeki"],[P,q]],[/\b([yr]\d{2}) b/i,/\b(?:dragon[- ]+touch |dt)(\w{5}) b/i],[D,[k,"Dragon Touch"],[P,q]],[/\b(ns-?\w{0,9}) b/i],[D,[k,"Insignia"],[P,q]],[/\b((nxa|next)-?\w{0,9}) b/i],[D,[k,"NextBook"],[P,q]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[k,"Voice"],D,[P,Le]],[/\b(lvtel\-)?(v1[12]) b/i],[[k,"LvTel"],D,[P,Le]],[/\b(ph-1) /i],[D,[k,"Essential"],[P,Le]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[D,[k,"Envizen"],[P,q]],[/\b(trio[-\w\. ]+) b/i],[D,[k,"MachSpeed"],[P,q]],[/\btu_(1491) b/i],[D,[k,"Rotor"],[P,q]]]}),Wd=Object.freeze({browser:[[/((?:air|blue|daum|fox|poly|proton)mail|emclient|evolution|kmail2?|kontact|(?:microsoft |mac)?outlook(?:-express)?|navermailapp|(?!chrom.+)sparrow|sparkdesktop|thunderbird|yahoo|zohomail-desktop)(?:m.+ail; |[\/ ])([\w\.]+)/i,/(mail)\/([\w\.]+) cf/i],[F,Y,[P,ar]],[/zdesktop\/([\w\.]+)/i],[Y,[F,"Zimbra"],[P,ar]]]}),cr=Object.freeze({browser:[[/(asana|ahrefssiteaudit|(?:bing|microsoft)preview|blueno|(?:chatgpt|claude|mistralai|perplexity)-user|cohere-ai|hubspot page fetcher|mastodon|(?:bitly|bufferlinkpreview|discord|duckassist|linkedin|pinterest|reddit|roger|siteaudit|twitter|uptimero|zoom)bot|google-site-verification|iframely|kakaotalk-scrap|meta-externalfetcher|y!?j-dlc|yandex(?:calendar|direct(?:dyn)?|fordomain|pagechecker|searchshop)|yadirectfetcher)\/([\w\.]+)/i,/(bluesky) cardyb\/([\w\.]+)/i,/(skypeuripreview) preview\/([\w\.]+)/i,/(slack(?:bot)?(?:-imgproxy|-linkexpanding)?) ([\w\.]+)/i,/(whatsapp)\/([\w\.]+)/i],[F,Y,[P,lr]],[/((?:better uptime |keybase|telegram|vercel)bot|chrome-lighthouse|feedfetcher-google|gemini-deep-research|google(?:imageproxy|-read-aloud|-pagerenderer|producer)|snap url preview|vercel(flags|tracing|-(favicon|screenshot)-bot)|yandex(?:sitelinks|userproxy))/i],[F,[P,lr]]],os:[[/whatsapp\/[\d\.]+ (a|i)/i],[[F,t=>t=="A"?"Android":"iOS"]]]}),zd=Object.freeze({browser:[[/\b(discord|figma|mattermost|notion|postman|rambox|rocket.chat|slack|teams)\/([\w\.]+).+(electron\/|; ios)/i,/(flipboard)\/([\w\.]+)/i],[F,Y,[P,et]],[/(evernote) win/i,/(teams)mobile-(ios|and)/i],[F,[P,et]],[/chatlyio\/([\d\.]+)/i],[Y,[F,"Slack"],[P,et]],[/ultralite app_version\/([\w\.]+)/i],[Y,[F,"TikTok Lite"],[P,et]],[/\) code\/([\d\.]+).+electron\//i],[Y,[F,"VS Code"],[P,et]],[/jp\.co\.yahoo\.(?:android\.yjtop|ipn\.appli)\/([\d\.]+)/i],[Y,[F,"Yahoo! Japan"],[P,et]]]}),Yd=Object.freeze({browser:[[/(apple(?:coremedia|tv))\/([\w\._]+)/i,/(coremedia) v([\w\._]+)/i,/(ares|clementine|music player daemon|nexplayer|ossproxy) ([\w\.-]+)/i,/^(aqualung|audacious|audimusicstream|amarok|bass|bsplayer|core|gnomemplayer|gvfs|irapp|lyssna|music on console|nero (?:home|scout)|nokia\d+|nsplayer|psp-internetradioplayer|quicktime|rma|radioapp|radioclientapplication|soundtap|stagefright|streamium|totem|videos|xbmc|xine|xmms)\/([\w\.-]+)/i,/(lg player|nexplayer) ([\d\.]+)/i,/player\/(nexplayer|lg player) ([\w\.-]+)/i,/(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i,/(htc streaming player) [\w_]+ \/ ([\d\.]+)/i,/(lavf)([\d\.]+)/i,/(mplayer)(?: |\/)(?:(?:sherpya-){0,1}svn)(?:-| )(r\d+(?:-\d+[\w\.-]+))/i,/ (songbird)\/([\w\.-]+)/i,/(winamp)(?:3 version|mpeg| ) ([\w\.-]+)/i,/(vlc)(?:\/| media player - version )([\w\.-]+)/i,/^(foobar2000|itunes|smp)\/([\d\.]+)/i,/com\.(riseupradioalarm)\/([\d\.]*)/i,/(mplayer)(?:\s|\/| unknown-)([\w\.\-]+)/i,/(windows)\/([\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ home media server/i],[F,Y,[P,Mt]],[/(flrp)\/([\w\.-]+)/i],[[F,"Flip Player"],Y,[P,Mt]],[/(fstream|media player classic|inlight radio|mplayer|nativehost|nero showtime|ocms-bot|queryseekspider|tapinradio|tunein radio|winamp|yourmuze)/i],[F,[P,Mt]],[/(htc_one_s|windows-media-player|wmplayer)\/([\w\.-]+)/i],[[F,/[_-]/g," "],Y,[P,Mt]],[/(rad.io|radio.(?:de|at|fr)) ([\d\.]+)/i],[[F,"rad.io"],Y,[P,Mt]]]}),ya=Object.freeze({browser:[[/^(apache-httpclient|axios|(?:go|java)-http-client|got|guzzlehttp|java|libwww-perl|lua-resty-http|needle|node-(?:fetch|superagent)|okhttp|php-soap|postmanruntime|python-(?:httpx|urllib[23]?|requests)|scrapy)\/([\w\.]+)/i,/(adobeair|aiohttp|jsdom)\/([\w\.]+)/i,/(nutch)-([\w\.-]+)(\(|$)/i,/\((java)\/([\w\.]+)/i],[F,Y,[P,Ca]]]}),jd=Object.freeze({device:[[/aftlbt962e2/i],[[k,"BMW"]],[/dilink.+(byd) auto/i],[k],[/aftlft962x3/i],[[k,"Jeep"],[D,"Wagooner"]],[/(rivian) (r1t)/i],[k,D],[/vcc.+netfront/i],[[k,"Volvo"]]]}),dr=Object.freeze({browser:[...Ta.browser,...cr.browser,...ur.browser,...ya.browser],os:[...cr.os]});var I={ANDORRA:{ANDORRA:"Europe/Andorra"},AUSTRIA:{VIENNA:"Europe/Vienna"},BELGIUM:{BRUSSELS:"Europe/Brussels"},BULGARIA:{SOFIA:"Europe/Sofia"},CROATIA:{ZAGREB:"Europe/Zagreb"},CYPRUS:{NICOSIA_EUROPE:"Europe/Nicosia",NICOSIA_ASIA:"Asia/Nicosia",FAMAGUSTA:"Asia/Famagusta"},CZECHIA:{PRAGUE:"Europe/Prague"},DENMARK:{COPENHAGEN:"Europe/Copenhagen",FAROE:"Atlantic/Faroe"},ESTONIA:{TALLINN:"Europe/Tallinn"},FINLAND:{HELSINKI:"Europe/Helsinki",MARIEHAMN:"Europe/Mariehamn"},FRANCE:{PARIS:"Europe/Paris",CAYENNE:"America/Cayenne",GUADELOUPE:"America/Guadeloupe",MARIGOT:"America/Marigot",MARTINIQUE:"America/Martinique",MAYOTTE:"Indian/Mayotte",REUNION:"Indian/Reunion"},GERMANY:{BERLIN:"Europe/Berlin",BUSINGEN:"Europe/Busingen"},GREECE:{ATHENS:"Europe/Athens"},HUNGARY:{BUDAPEST:"Europe/Budapest"},ICELAND:{REYKJAVIK:"Atlantic/Reykjavik"},IRELAND:{DUBLIN:"Europe/Dublin"},ITALY:{ROME:"Europe/Rome"},LATVIA:{RIGA:"Europe/Riga"},LIECHTENSTEIN:{VADUZ:"Europe/Vaduz"},LITHUANIA:{VILNIUS:"Europe/Vilnius"},LUXEMBOURG:{LUXEMBOURG:"Europe/Luxembourg"},MALTA:{MALTA:"Europe/Malta"},MONACO:{MONACO:"Europe/Monaco"},NETHERLANDS:{AMSTERDAM:"Europe/Amsterdam",ARUBA:"America/Aruba",CURACAO:"America/Curacao",KRALENDIJK:"America/Kralendijk",LOWER_PRINCES:"America/Lower_Princes"},NORWAY:{OSLO:"Europe/Oslo",JAN_MAYEN:"Atlantic/Jan_Mayen",LONGYEARBYEN:"Arctic/Longyearbyen"},POLAND:{WARSAW:"Europe/Warsaw"},PORTUGAL:{LISBON:"Europe/Lisbon",AZORES:"Atlantic/Azores",MADEIRA:"Atlantic/Madeira"},ROMANIA:{BUCHAREST:"Europe/Bucharest"},SAN_MARINO:{SAN_MARINO:"Europe/San_Marino"},SLOVAKIA:{BRATISLAVA:"Europe/Bratislava"},SLOVENIA:{LJUBLJANA:"Europe/Ljubljana"},SPAIN:{MADRID:"Europe/Madrid",CANARY:"Atlantic/Canary",CEUTA:"Africa/Ceuta"},SWEDEN:{STOCKHOLM:"Europe/Stockholm"},SWITZERLAND:{ZURICH:"Europe/Zurich"},VATICAN:{VATICAN:"Europe/Vatican"}},Oa=[I.AUSTRIA.VIENNA,I.BELGIUM.BRUSSELS,I.BULGARIA.SOFIA,I.CROATIA.ZAGREB,I.CYPRUS.NICOSIA_EUROPE,I.CYPRUS.NICOSIA_ASIA,I.CYPRUS.FAMAGUSTA,I.CZECHIA.PRAGUE,I.DENMARK.COPENHAGEN,I.ESTONIA.TALLINN,I.FINLAND.HELSINKI,I.FINLAND.MARIEHAMN,I.FRANCE.PARIS,I.GERMANY.BERLIN,I.GREECE.ATHENS,I.HUNGARY.BUDAPEST,I.IRELAND.DUBLIN,I.ITALY.ROME,I.LATVIA.RIGA,I.LITHUANIA.VILNIUS,I.LUXEMBOURG.LUXEMBOURG,I.MALTA.MALTA,I.NETHERLANDS.AMSTERDAM,I.POLAND.WARSAW,I.PORTUGAL.LISBON,I.ROMANIA.BUCHAREST,I.SLOVAKIA.BRATISLAVA,I.SLOVENIA.LJUBLJANA,I.SPAIN.MADRID,I.SWEDEN.STOCKHOLM,I.FRANCE.CAYENNE,I.FRANCE.GUADELOUPE,I.FRANCE.MARIGOT,I.FRANCE.MARTINIQUE,I.FRANCE.MAYOTTE,I.FRANCE.REUNION,I.PORTUGAL.AZORES,I.PORTUGAL.MADEIRA,I.SPAIN.CANARY],fr=[I.ICELAND.REYKJAVIK,I.LIECHTENSTEIN.VADUZ,I.NORWAY.OSLO,I.NORWAY.JAN_MAYEN],qd=[...Oa,...fr],Xd=[I.SWITZERLAND.ZURICH,...fr],Jd=[I.AUSTRIA.VIENNA,I.BELGIUM.BRUSSELS,I.BULGARIA.SOFIA,I.CROATIA.ZAGREB,I.CZECHIA.PRAGUE,I.DENMARK.COPENHAGEN,I.ESTONIA.TALLINN,I.FINLAND.HELSINKI,I.FINLAND.MARIEHAMN,I.FRANCE.PARIS,I.GERMANY.BERLIN,I.GREECE.ATHENS,I.HUNGARY.BUDAPEST,I.ITALY.ROME,I.LATVIA.RIGA,I.LITHUANIA.VILNIUS,I.LUXEMBOURG.LUXEMBOURG,I.MALTA.MALTA,I.NETHERLANDS.AMSTERDAM,I.POLAND.WARSAW,I.PORTUGAL.LISBON,I.PORTUGAL.AZORES,I.PORTUGAL.MADEIRA,I.ROMANIA.BUCHAREST,I.SLOVAKIA.BRATISLAVA,I.SLOVENIA.LJUBLJANA,I.SPAIN.MADRID,I.SPAIN.CANARY,I.SWEDEN.STOCKHOLM,I.ANDORRA.ANDORRA,I.GERMANY.BUSINGEN,I.ICELAND.REYKJAVIK,I.LIECHTENSTEIN.VADUZ,I.MONACO.MONACO,I.NORWAY.OSLO,I.SAN_MARINO.SAN_MARINO,I.SPAIN.CEUTA,I.SWITZERLAND.ZURICH,I.VATICAN.VATICAN];function Ti(){var t;return typeof window!="undefined"&&((window==null?void 0:window.matchMedia("(display-mode: standalone)").matches)||((t=window.navigator)===null||t===void 0?void 0:t.standalone)||document.referrer.startsWith("android-app://")||(window==null?void 0:window.Windows)||/trident.+(msapphost|webview)\//i.test(navigator.userAgent)||document.referrer.startsWith("app-info://platform/microsoft-store"))}var{Crawler:uf}=sr.BrowserName,yi=(t,e,n)=>typeof t=="string"?ee(t,e,n):t;var pr=t=>{let e=yi(t);if(e.os.is(rr.MACOS)){if(e.cpu.is(ir.ARM))return!0;if(typeof t!="string"&&typeof window!="undefined")try{let n=document.createElement("canvas"),i=n.getContext("webgl2")||n.getContext("webgl")||n.getContext("experimental-webgl"),o=i.getExtension("WEBGL_debug_renderer_info");if(i.getParameter(o.UNMASKED_RENDERER_WEBGL).match(/apple m\d/i))return!0}catch(n){return!1}}return!1};var gr=t=>[Bt.CLI,Bt.CRAWLER,Bt.FETCHER,Bt.LIBRARY].includes(yi(t,dr).browser.type),mr=t=>yi(t).engine.is(or.BLINK);function Ra(){return{width:window.screen.width,height:window.screen.height}}function va(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return console.error("Failed to get timezone:",t),"UTC"}}function hr(){try{return navigator.language||"en-US"}catch(t){return console.error("Failed to get browser locale:",t),"en-US"}}function Er(){if(typeof window=="undefined")return{userAgent:{name:"",browser:{major:"",name:"",version:""},os:{name:"",version:""},device:void 0,engine:{name:"",version:""},cpu:{architecture:""}},screenResolution:{width:0,height:0},timeZone:"UTC",flags:{isBot:!1,isChromeFamily:!1,isStandalonePWA:!1,isAppleSilicon:!1}};let e=new ee().getResult(),n;try{n={isBot:gr(e),isChromeFamily:mr(e),isStandalonePWA:Ti(),isAppleSilicon:pr(e)}}catch(i){console.error("Failed to compute device flags:",i),n={isBot:!1,isChromeFamily:!1,isStandalonePWA:!1,isAppleSilicon:!1}}return{userAgent:{name:e.ua,browser:{major:e.browser.major||"",name:e.browser.name||"",version:e.browser.version||"",type:e.browser.type},os:{name:e.os.name||"",version:e.os.version||""},device:e.device.model||e.device.type||e.device.vendor?{model:e.device.model,type:e.device.type,vendor:e.device.vendor}:void 0,engine:{name:e.engine.name||"",version:e.engine.version||""},cpu:{architecture:e.cpu.architecture||""}},screenResolution:Ra(),timeZone:va(),flags:n}}function Ar(){if(typeof window=="undefined")return{};let t=new URLSearchParams(window.location.search);return{locale:t.get("locale")||void 0,currency:t.get("currency")||void 0,utmSource:t.get("utm_source")||void 0,utmMedium:t.get("utm_medium")||void 0,utmCampaign:t.get("utm_campaign")||void 0}}var In=class{constructor(){this.listeners=new Map}on(e,n){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(n),()=>this.off(e,n)}off(e,n){this.listeners.has(e)&&this.listeners.get(e).delete(n)}async emit(e,n){if(this.listeners.has(e)){let i=Array.from(this.listeners.get(e));await Promise.all(i.map(o=>{try{return Promise.resolve(o(n))}catch(r){return console.error('[EventBus] Error in listener for event "'.concat(e,'":'),r),Promise.resolve()}}))}}clear(){this.listeners.clear()}};Pn();function Ut(t){try{let e=t.split(".");if(e.length!==3)return console.error("Invalid JWT token format"),null;let n=e[1],i=n+"=".repeat((4-n.length%4)%4),o=atob(i),r=JSON.parse(o);return r.exp&&Date.now()>=r.exp*1e3?(console.warn("JWT token is expired"),null):{sessionId:r.sessionId,storeId:r.storeId,accountId:r.accountId,customerId:r.customerId,role:r.role,isValid:!0,isLoading:!1}}catch(e){return console.error("Failed to decode JWT token:",e),null}}function br(t){try{let e=t.split(".");if(e.length!==3)return!0;let n=e[1],i=n+"=".repeat((4-n.length%4)%4),o=atob(i),r=JSON.parse(o);return r.exp?Date.now()>=r.exp*1e3:!1}catch(e){return console.error("Failed to check token expiration:",e),!0}}Vt();var tt={},Pa=["","VITE_","REACT_APP_","NEXT_PUBLIC_"];function he(t,e=Pa){var n,i,o;for(let r of e){let s=r?"".concat(r).concat(t):t;if(typeof process!="undefined"&&((n=process==null?void 0:process.env)!=null&&n[s]))return console.log("process.env[".concat(s,"]"),process.env[s]),process.env[s];if(typeof tt!="undefined"&&((i=tt==null?void 0:tt.env)!=null&&i[s]))return console.log("import.meta.env[".concat(s,"]"),tt.env[s]),tt.env[s];if(typeof window!="undefined"&&((o=window==null?void 0:window.__TAGADA_ENV__)!=null&&o[s]))return console.log("window.__TAGADA_ENV__[".concat(s,"]"),window.__TAGADA_ENV__[s]),window.__TAGADA_ENV__[s]}}var Na=async(t="default")=>{try{if((he("TAGADA_ENV")||he("TAGADA_ENVIRONMENT"))==="production"||!rt(!0))return null;let n=await fetch("/.local.json");if(!n.ok)return null;let i=await n.json(),o={},r=!1;try{let a=await fetch("/config/".concat(t,".tgd.json"));a.ok||(a=await fetch("/config/".concat(t,".json"))),a.ok&&(o=await a.json(),r=!0)}catch(a){}if(!r&&t!=="default"){console.warn("\u26A0\uFE0F Config variant '".concat(t,"' not found, falling back to 'default'"));try{let a=await fetch("/config/default.tgd.json");a.ok||(a=await fetch("/config/default.json")),a.ok&&(o=await a.json(),r=!0,console.log("\u2705 Fallback to 'default' config successful"))}catch(a){}}r||console.warn(t==="default"?"\u26A0\uFE0F No 'default' config found. Create /config/default.tgd.json":"\u26A0\uFE0F Neither '".concat(t,"' nor 'default' config found. Create /config/default.tgd.json"));let s={storeId:i.storeId,accountId:i.accountId,basePath:i.basePath,config:o};return console.log("\u{1F6E0}\uFE0F Using local development plugin config:",s),s}catch(e){return null}},xa=async()=>{try{if((he("TAGADA_ENV")||he("TAGADA_ENVIRONMENT"))==="production"||!rt(!0))return null;try{console.log("\u{1F6E0}\uFE0F [V2] Attempting to load /config/funnel.local.json...");let i=await fetch("/config/funnel.local.json");if(i.ok){let o=await i.json();console.log("\u{1F6E0}\uFE0F [V2] \u2705 Loaded local funnel config (NEW format):",o);let{loadLocalFunnelConfig:r}=await Promise.resolve().then(()=>(Bn(),Qi));if(await r(),o.staticResources){let s={};for(let[a,l]of Object.entries(o.staticResources))s[a]={id:l};return s}return null}}catch(i){console.log("\u{1F6E0}\uFE0F [V2] funnel.local.json not found, trying legacy format...")}console.log("\u{1F6E0}\uFE0F [V2] Attempting to load /config/resources.static.json (legacy)...");let e=await fetch("/config/resources.static.json");if(!e.ok)return console.log("\u{1F6E0}\uFE0F [V2] No local static resources found"),null;let n=await e.json();return console.log("\u{1F6E0}\uFE0F [V2] \u2705 Loaded legacy static resources:",n),n}catch(t){return console.error("\u{1F6E0}\uFE0F [V2] \u274C Error loading static resources:",t),null}},Sn=t=>{if(typeof document=="undefined")return;let e=document.querySelector('meta[name="'.concat(t,'"]'));return(e==null?void 0:e.getAttribute("content"))||void 0};var ka=async()=>{try{if(typeof document=="undefined")return null;let t=Sn("x-plugin-store-id"),e=Sn("x-plugin-account-id");if(!t)return null;let n=Sn("x-plugin-base-path")||"/",i={};try{let r=Sn("x-plugin-config");if(r){let s=decodeURIComponent(r);i=JSON.parse(s)}}catch(r){console.warn("\u26A0\uFE0F Failed to parse plugin config from meta tag:",r)}e||console.warn("\u26A0\uFE0F Plugin config: Account ID not found in meta tags");let o={storeId:t,accountId:e,basePath:n,config:i};return console.log("\u{1F680} [HIGHEST PRIORITY] Plugin config loaded from meta tags (runtime injected config):",{storeId:t,accountId:e,basePath:n,configKeys:Object.keys(i),configSize:JSON.stringify(i).length}),o}catch(t){return console.warn("\u26A0\uFE0F Error loading production config from meta tags:",t),null}},wr=async(t="default",e)=>{var s,a;console.log("\u{1F527} [V2] loadPluginConfig called with variant:",t);let n=await xa(),i=await ka();if(i){let l=z(v({},i),{staticResources:n!=null?n:void 0});return console.log("\u2705 [V2] Using INJECTED config from meta tags (HIGHEST PRIORITY)"),l}if(e){let l={storeId:e.storeId,accountId:e.accountId,basePath:(s=e.basePath)!=null?s:"/",config:(a=e.config)!=null?a:{},staticResources:n!=null?n:void 0};return console.log("\u2705 [V2] Using raw config parameter (PRIORITY 2)"),l}let o=await _a();if(o){let l=z(v({},o),{staticResources:n!=null?n:void 0});return console.log("\u2705 [V2] Using environment variables config (PRIORITY 3 - build time)"),l}let r=await Na(t);if(r){let l=z(v({},r),{staticResources:n!=null?n:void 0});return console.log("\u2705 [V2] Using local dev config files (PRIORITY 4)"),l}return console.warn("\u26A0\uFE0F [V2] No plugin config found - using defaults"),{basePath:"/",config:{},staticResources:n!=null?n:void 0}};async function La(t="default",e){try{if(!rt())return null;if(e)return e;let n=["/config/".concat(t,".config.json"),"/config/".concat(t,".tgd.json"),"/config/".concat(t,".json")];for(let i of n)try{let o=await fetch(i);if(o.ok)return await o.json()}catch(o){continue}return console.warn("\u26A0\uFE0F [loadLocalConfig] No config found for '".concat(t,"'")),null}catch(n){return console.error("[loadLocalConfig] Error loading config:",n),null}}async function _a(){try{if(!rt())return;let t=he("TAGADA_STORE_ID"),e=he("TAGADA_ACCOUNT_ID"),n=he("TAGADA_BASE_PATH"),i=he("TAGADA_CONFIG_NAME");if(!t||!e)return;let o=await La(i);if(!o)return;let r={storeId:t,accountId:e,basePath:n||"/",config:o};return console.log("\u{1F6E0}\uFE0F [createRawPluginConfig] Using environment variables (build-time config):",{hasStoreId:!!r.storeId,hasAccountId:!!r.accountId,basePath:r.basePath,hasConfig:!!r.config}),r}catch(t){console.error("[createRawPluginConfig] Error creating config:",t);return}}jt();Ue();Ue();var Oi=new Map,Ri=new Set;function Da(){return typeof window=="undefined"?null:new URLSearchParams(window.location.search).get("authCode")}async function Ir(t,e,n,i=!1){if(Ri.has(t))throw i&&console.log("[AuthHandoff] Code already resolved, skipping duplicate request"),new Error("Auth code already resolved");let o=Oi.get(t);if(o)return i&&console.log("[AuthHandoff] Resolution already in progress, waiting for existing request"),o;i&&console.log("[AuthHandoff] Resolving authCode:",t.substring(0,15)+"...");let r=(async()=>{try{let s=await fetch("".concat(n,"/api/v1/cms/auth/resolve-handoff"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t,storeId:e})});if(!s.ok){let l=await s.json().catch(()=>({message:"Unknown error"}));throw new Error(l.message||"Failed to resolve auth handoff: ".concat(s.status))}let a=await s.json();return i&&console.log("[AuthHandoff] \u2705 Resolved successfully:",{customerId:a.customer.id,role:a.customer.role,hasContext:Object.keys(a.context).length>0}),i&&console.log("[AuthHandoff] Storing new token (overriding existing)"),ne(a.token),Ba(i),Ri.add(t),a}catch(s){throw console.error("[AuthHandoff] \u274C Failed to resolve:",s),s}finally{Oi.delete(t)}})();return Oi.set(t,r),r}function Ba(t=!1){if(typeof window=="undefined")return;let e=new URL(window.location.href);e.searchParams.has("authCode")&&(e.searchParams.delete("authCode"),window.history.replaceState({},"",e.pathname+e.search+e.hash),t&&console.log("[AuthHandoff] Cleaned authCode from URL"))}function Sr(){let t=Da();return!(!t||!t.startsWith("ah_")||Ri.has(t))}var Cn=class{constructor(e={}){this.bus=new In;this.eventDispatcher=new Be;this.tokenPromise=null;this.tokenResolver=null;this.isInitializingSession=!1;this.lastSessionInitError=null;this.sessionInitRetryCount=0;this.MAX_SESSION_INIT_RETRIES=3;var a,l,u,d;this.config=e,this.instanceId=Math.random().toString(36).substr(2,9),this.boundHandleStorageChange=this.handleStorageChange.bind(this),this.boundHandlePageshow=p=>{if(p.persisted)if(this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Page restored from BFcache (back button), re-initializing funnel...")),this.funnel&&this.state.session&&this.state.store){this.funnel.resetInitialization();let S=this.getAccountId(),f=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("funnelId")||void 0;this.funnel.autoInitialize({customerId:this.state.session.customerId,sessionId:this.state.session.sessionId},{id:this.state.store.id,accountId:S},f).catch(C=>{console.error("[TagadaClient] Funnel re-initialization failed:",C)})}else this.sessionInitRetryCount=0,this.initialize()},console.log("[TagadaClient ".concat(this.instanceId,"] Initializing...")),console.log("[TagadaClient ".concat(this.instanceId,"] Config:"),{debugMode:e.debugMode,hasRawPluginConfig:!!e.rawPluginConfig,rawPluginConfig:e.rawPluginConfig,features:e.features}),Wi(this.config.debugMode)&&this.config.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Preview mode active - state cleared"));let i=this.resolveEnvironment(),o=Fi(i);e.customApiConfig&&(o=z(v(v({},o),e.customApiConfig),{apiConfig:v(v({},o.apiConfig),e.customApiConfig.apiConfig)}),this.config.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Applied custom API config:"),o.apiConfig.baseUrl)),this.state={auth:{isAuthenticated:!1,isLoading:!1,customer:null,session:null},session:null,customer:null,locale:{locale:"en-US",language:"en",region:"US",messages:{}},currency:{code:"USD",symbol:"$",name:"US Dollar"},store:null,environment:o,isLoading:!0,isInitialized:!1,isSessionInitialized:!1,pluginConfig:{basePath:"/",config:{}},pluginConfigLoading:!0,debugMode:(a=e.debugMode)!=null?a:i!=="production",token:null},console.log("[TagadaClient ".concat(this.instanceId,"] Initial state:"),{pluginConfigLoading:this.state.pluginConfigLoading,hasRawPluginConfig:!!e.rawPluginConfig}),this.apiClient=new yt({baseURL:o.apiConfig.baseUrl});let r=(l=e.features)==null?void 0:l.funnel;if(r!==!1){let p=typeof r=="object"?r:{};this.funnel=new dt({apiClient:this.apiClient,debugMode:this.state.debugMode,pluginConfig:this.state.pluginConfig,environment:this.state.environment,autoRedirect:p.autoRedirect,funnelId:(u=e.rawPluginConfig)==null?void 0:u.funnelId,stepId:(d=e.rawPluginConfig)==null?void 0:d.stepId})}this.apiClient.setTokenProvider(this.waitForToken.bind(this)),typeof window!="undefined"&&(window.addEventListener("storage",this.boundHandleStorageChange),window.addEventListener("pageshow",this.boundHandlePageshow)),this.setupConfigHotReload(),this.initialize()}destroy(){typeof window!="undefined"&&(window.removeEventListener("storage",this.boundHandleStorageChange),window.removeEventListener("pageshow",this.boundHandlePageshow)),this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Destroyed")),this.eventDispatcher.clear(),this.bus.clear()}handleStorageChange(){if(st()===this.state.token){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Token unchanged (ignoring event)"));return}if(this.isInitializingSession){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Session initialization in progress, skipping storage change"));return}if(this.sessionInitRetryCount>=this.MAX_SESSION_INIT_RETRIES&&this.lastSessionInitError){this.state.debugMode&&console.error("[TagadaClient ".concat(this.instanceId,"] Max session init retries reached, giving up"),this.lastSessionInitError);return}this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Storage changed, re-initializing token...")),this.initializeToken()}subscribe(e){return this.eventDispatcher.subscribe(e)}getState(){return this.state}updateState(e){this.state=v(v({},this.state),e),this.eventDispatcher.notify(this.state)}resolveEnvironment(){return this.config.environment?this.config.environment:ot()}async initialize(){try{await this.initializePluginConfig(),this.state.pluginConfig.storeId?await this.initializeToken():(console.warn("[TagadaClient] No store ID found in plugin config. Skipping token initialization."),this.updateState({isLoading:!1,isInitialized:!0}))}catch(e){console.error("[TagadaClient] Initialization failed:",e),this.updateState({isLoading:!1,isInitialized:!0})}}async initializePluginConfig(){if(console.log("[TagadaClient ".concat(this.instanceId,"] initializePluginConfig called"),{pluginConfigLoading:this.state.pluginConfigLoading,hasRawPluginConfig:!!this.config.rawPluginConfig}),!this.state.pluginConfigLoading){console.log("[TagadaClient ".concat(this.instanceId,"] Plugin config already loading or loaded, skipping..."));return}try{let e=this.config.localConfig||"default";console.log("[TagadaClient ".concat(this.instanceId,"] Loading plugin config with variant: ").concat(e));let n=await wr(e,this.config.rawPluginConfig);console.log("[TagadaClient ".concat(this.instanceId,"] Plugin config loaded:"),n),this.updateState({pluginConfig:n,pluginConfigLoading:!1}),this.funnel&&this.funnel.setConfig({pluginConfig:n,environment:this.state.environment})}catch(e){console.error("[TagadaClient] Failed to load plugin config:",e),this.updateState({pluginConfig:{basePath:"/",config:{}},pluginConfigLoading:!1})}}async initializeToken(){var e;if(Sr()){let n=this.state.pluginConfig.storeId;if(!n)return console.error("[TagadaClient] Cannot resolve authCode: storeId not found in config"),this.fallbackToNormalFlow();console.log("[TagadaClient ".concat(this.instanceId,"] \u{1F510} Cross-domain auth detected, resolving..."));try{let i=new URLSearchParams(window.location.search).get("authCode");if(!i)return this.fallbackToNormalFlow();let o=await Ir(i,n,this.state.environment.apiConfig.baseUrl,this.state.debugMode);console.log("[TagadaClient ".concat(this.instanceId,"] \u2705 Auth handoff resolved:"),{customerId:o.customer.id,role:o.customer.role,hasContext:Object.keys(o.context).length>0}),this.setToken(o.token);let r=Ut(o.token);r?(this.updateState({session:r}),await this.initializeSession(r),(e=o.context)!=null&&e.funnelSessionId&&this.funnel&&this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Restoring funnel session from handoff context:"),o.context.funnelSessionId)):(console.error("[TagadaClient] Failed to decode token from handoff"),this.updateState({isInitialized:!0,isLoading:!1}));return}catch(i){console.error("[TagadaClient ".concat(this.instanceId,"] \u274C Auth handoff failed, falling back to normal flow:"),i)}}await this.fallbackToNormalFlow()}async fallbackToNormalFlow(){let n=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("token");n&&(this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] \u{1F512} URL token detected, setting immediately to prevent race condition")),this.apiClient.updateToken(n),ne(n));let i=st();console.log("[TagadaClient ".concat(this.instanceId,"] Initializing token (normal flow)..."),{hasExistingToken:!!i,hasQueryToken:!!n,storeId:this.state.pluginConfig.storeId});let o=null,r=!1;if(n?(o=n,r=!0):i&&!br(i)&&(o=i),o){this.setToken(o),r&&(this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Persisting query token to storage...")),ne(o));let s=Ut(o);s?(this.updateState({session:s}),await this.initializeSession(s)):(console.error("[TagadaClient] Failed to decode token"),this.updateState({isInitialized:!0,isLoading:!1}))}else{let s=this.state.pluginConfig.storeId;console.log("[TagadaClient ".concat(this.instanceId,"] No existing token, creating anonymous token..."),{hasStoreId:!!s,storeId:s}),s?await this.createAnonymousToken(s):(console.warn("[TagadaClient ".concat(this.instanceId,"] No storeId in plugin config, skipping anonymous token creation")),this.updateState({isInitialized:!0,isLoading:!1}))}}setToken(e){this.apiClient.updateToken(e),this.updateState({token:e}),this.tokenResolver&&(this.tokenResolver(e),this.tokenPromise=null,this.tokenResolver=null)}waitForToken(){return this.apiClient.getCurrentToken()?Promise.resolve(this.apiClient.getCurrentToken()):(this.tokenPromise||(this.tokenPromise=new Promise(e=>{this.tokenResolver=e})),this.tokenPromise)}async createAnonymousToken(e){if(typeof window!="undefined"){let i=new URLSearchParams(window.location.search).get("token");if(i){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] \u{1F512} URL has token, skipping anonymous token creation")),this.setToken(i),ne(i);let o=Ut(i);o&&(this.updateState({session:o}),await this.initializeSession(o));return}}if(this.isInitializingSession){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Session initialization in progress, skipping anonymous token creation"));return}try{let n=ct();this.state.debugMode&&console.log("[TagadaClient] Creating anonymous token for store:",e,{draft:n});let i=await this.apiClient.post("/api/v1/cms/session/anonymous",{storeId:e,role:"anonymous",draft:n},{skipAuth:!0});this.setToken(i.token),ne(i.token);let o=Ut(i.token);o&&(this.updateState({session:o}),await this.initializeSession(o)),this.updateState({isSessionInitialized:!0})}catch(n){console.error("[TagadaClient] Failed to create anonymous token:",n),this.updateState({isInitialized:!0,isLoading:!1})}}async initializeSession(e){var n,i,o,r,s,a,l,u,d,p,S;if(this.isInitializingSession){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Session initialization already in progress, skipping"));return}this.isInitializingSession=!0;try{this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Initializing session..."),{sessionId:e.sessionId});let w=Er(),f=Ar(),C=hr(),b=ct(),R=new URLSearchParams(window.location.search).get("draft");R!==null&&kn(R==="true");let L={storeId:e.storeId,accountId:e.accountId,customerId:e.customerId,role:e.role,browserLocale:C,queryLocale:f.locale,queryCurrency:f.currency,utmSource:f.utmSource,utmMedium:f.utmMedium,utmCampaign:f.utmCampaign,browser:w.userAgent.browser.name,browserVersion:w.userAgent.browser.version,os:w.userAgent.os.name,osVersion:w.userAgent.os.version,deviceType:(n=w.userAgent.device)==null?void 0:n.type,deviceModel:(i=w.userAgent.device)==null?void 0:i.model,deviceVendor:(o=w.userAgent.device)==null?void 0:o.vendor,userAgent:w.userAgent.name,engineName:w.userAgent.engine.name,engineVersion:w.userAgent.engine.version,cpuArchitecture:w.userAgent.cpu.architecture,isBot:(s=(r=w.flags)==null?void 0:r.isBot)!=null?s:!1,isChromeFamily:(l=(a=w.flags)==null?void 0:a.isChromeFamily)!=null?l:!1,isStandalonePWA:(d=(u=w.flags)==null?void 0:u.isStandalonePWA)!=null?d:!1,isAppleSilicon:(S=(p=w.flags)==null?void 0:p.isAppleSilicon)!=null?S:!1,screenWidth:w.screenResolution.width,screenHeight:w.screenResolution.height,timeZone:w.timeZone,draft:b,fetchMessages:!1},y=await this.apiClient.post("/api/v1/cms/session/v2/init",L);this.lastSessionInitError=null,this.sessionInitRetryCount=0,this.updateSessionState(y,e),this.updateState({isInitialized:!0,isSessionInitialized:!0,isLoading:!1}),this.state.debugMode&&console.log("[TagadaClient] Session initialized successfully")}catch(w){this.lastSessionInitError=w,this.sessionInitRetryCount++,console.error("[TagadaClient] Error initializing session (attempt ".concat(this.sessionInitRetryCount,"/").concat(this.MAX_SESSION_INIT_RETRIES,"):"),w),this.updateState({isInitialized:!0,isLoading:!1})}finally{this.isInitializingSession=!1}}updateSessionState(e,n){var o,r,s,a,l,u,d,p,S;if(e.store){let w=e.store,f=z(v({},e.store),{accountId:w.accountId||((o=this.state.pluginConfig)==null?void 0:o.accountId)||n.accountId||"",presentmentCurrencies:w.presentmentCurrencies||[e.store.currency||"USD"],chargeCurrencies:w.chargeCurrencies||[e.store.currency||"USD"]});this.updateState({store:f})}if(e.locale){let w={locale:e.locale,language:e.locale.split("-")[0],region:(r=e.locale.split("-")[1])!=null?r:"US",messages:(s=e.messages)!=null?s:{}};this.updateState({locale:w})}if(e.store){let w={code:e.store.currency,symbol:this.getCurrencySymbol(e.store.currency),name:this.getCurrencyName(e.store.currency)};this.updateState({currency:w})}let i={isAuthenticated:(l=(a=e.customer)==null?void 0:a.isAuthenticated)!=null?l:!1,isLoading:!1,customer:(u=e.customer)!=null?u:null,session:n};if(this.updateState({customer:(d=e.customer)!=null?d:null,auth:i}),this.funnel&&n.customerId&&((p=e.store)!=null&&p.id)){let w=e.store.accountId||((S=this.state.pluginConfig)==null?void 0:S.accountId)||n.accountId||"";if(w){let C=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("funnelId")||void 0;this.state.debugMode&&console.log("[TagadaClient] Auto-initializing funnel...",{customerId:n.customerId,storeId:e.store.id,accountId:w,funnelId:C||"auto-detect"}),this.funnel.autoInitialize({customerId:n.customerId,sessionId:n.sessionId},{id:e.store.id,accountId:w},C).catch(b=>{console.error("[TagadaClient] Funnel auto-initialization failed:",b)})}else console.warn("[TagadaClient] Cannot auto-initialize funnel: accountId is missing")}}getCurrencySymbol(e){return{USD:"$",EUR:"\u20AC",GBP:"\xA3",JPY:"\xA5",CAD:"C$",AUD:"A$"}[e]||e}getCurrencyName(e){return{USD:"US Dollar",EUR:"Euro",GBP:"British Pound",JPY:"Japanese Yen",CAD:"Canadian Dollar",AUD:"Australian Dollar"}[e]||e}getAccountId(){var e,n,i;return((e=this.state.store)==null?void 0:e.accountId)||((n=this.state.pluginConfig)==null?void 0:n.accountId)||((i=this.state.session)==null?void 0:i.accountId)||""}updatePluginConfig(e){this.state.debugMode&&console.log("[TagadaClient] Hot-reloading config:",e);let n=v(v({},this.state.pluginConfig.config),e);this.updateState({pluginConfig:z(v({},this.state.pluginConfig),{config:n})}),this.bus.emit("CONFIG_UPDATED",n),this.state.debugMode&&console.log("[TagadaClient] Config updated successfully")}setupConfigHotReload(){if(typeof window=="undefined")return;let e=n=>{var i,o;if(((i=n.data)==null?void 0:i.type)==="TAGADAPAY_CONFIG_UPDATE"){let{config:r}=n.data;this.state.debugMode&&console.log("[TagadaClient] Received config update from parent:",r),this.updatePluginConfig(r)}else if(((o=n.data)==null?void 0:o.type)==="APPLY_STYLES_TO_ELEMENT"){let{elementId:r,styles:s}=n.data;this.state.debugMode&&console.log("[TagadaClient] Received style application request:",{elementId:r,styles:s}),this.applyStylesToElement(r,s)}};window.addEventListener("message",e),this.state.debugMode&&console.log("[TagadaClient] Config hot-reload and style manipulation listeners enabled")}applyStylesToElement(e,n){if(typeof document=="undefined")return;let i="tagada-editor-highlight",o=document.getElementById(i);o&&o.remove();let r=p=>{var y;let w=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(p.tagName.toLowerCase()),f=p;if(w){let N=p.parentElement;if((N==null?void 0:N.getAttribute("data-tagada-highlight-wrapper"))==="true"&&N instanceof HTMLElement)f=N;else{let _=document.createElement("div");_.setAttribute("data-tagada-highlight-wrapper","true");let W=window.getComputedStyle(p),ae=W.display;if(ae==="inline"?_.style.display="inline-block":_.style.display=ae,_.style.position="relative",ae==="inline"||ae.includes("inline")){let te=W.verticalAlign;te&&te!=="baseline"&&(_.style.verticalAlign=te)}["width","height","minWidth","minHeight","maxWidth","maxHeight","flex","flexGrow","flexShrink","flexBasis","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","alignSelf","justifySelf","boxSizing","gap","rowGap","columnGap","order","aspectRatio"].forEach(te=>{let Ae=te.replace(/([A-Z])/g,"-$1").toLowerCase(),j=W.getPropertyValue(Ae);j&&j.trim()!==""&&(te==="flex"&&j!=="none"&&j!=="0 1 auto"?_.style.flex=j:te==="boxSizing"?_.style.boxSizing=j:_.style.setProperty(Ae,j))}),p.style&&["width","height","min-width","min-height","max-width","max-height","flex","flex-grow","flex-shrink","flex-basis","grid-column","grid-row","grid-column-start","grid-column-end","grid-row-start","grid-row-end","grid-area","align-self","justify-self","box-sizing","gap","row-gap","column-gap","order","aspect-ratio"].forEach(Ae=>{let j=p.style.getPropertyValue(Ae);j&&_.style.setProperty(Ae,j)}),(y=p.parentNode)==null||y.insertBefore(_,p),_.appendChild(p),f=_}}let C=getComputedStyle(w?p:f);(f.style.position==="static"||!f.style.position)&&(f.style.position="relative");let b=document.createElement("div");b.id=i,b.style.position="absolute",b.style.inset="0",b.style.pointerEvents="none",b.style.zIndex="9999",b.style.boxSizing="border-box",b.style.background="none",b.style.border="none",b.style.outline="none",b.style.margin="0",b.style.padding="0";let R=C.borderRadius;R&&(b.style.borderRadius=R),f.appendChild(b);let L=n||{boxShadow:"0 0 0 2px rgb(239 68 68)"};if(Object.entries(L).forEach(([N,K])=>{let _=N.includes("-")?N.replace(/-([a-z])/g,(W,ae)=>ae.toUpperCase()):N;N.includes("-")?b.style.setProperty(N,K):b.style[_]=K}),p.scrollIntoView({behavior:"smooth",block:"center"}),this.state.debugMode){let N=Object.entries(L).map(([K,_])=>"".concat(K,": ").concat(_)).join("; ");console.log("[TagadaClient] Applied styles to highlight div of element #".concat(e,":"),N)}},s=5,a=1e3,l=0,u=p=>{let S=window.getComputedStyle(p);return S.display==="none"||S.visibility==="hidden"||S.opacity==="0"||p.hidden||p.offsetWidth===0||p.offsetHeight===0},d=()=>{let p=document.querySelectorAll('[editor-id~="'.concat(e,'"]'));if(p.length===0){if(l+=1,l>=s){this.state.debugMode&&console.warn('[TagadaClient] Element with editor-id containing "'.concat(e,'" not found after ').concat(s," attempts"));return}this.state.debugMode&&console.warn('[TagadaClient] Element with editor-id containing "'.concat(e,'" not found (attempt ').concat(l,"/").concat(s,"), retrying in ").concat(a/1e3,"s")),setTimeout(d,a);return}let S=null;if(p.length===1)S=p[0];else{for(let w=0;w<p.length;w++)if(!u(p[w])){S=p[w];break}S||(S=p[0])}S&&r(S)};d()}};vn();at();function Cr(t={}){return new Cn(t)}Ue();function Tr(t){return typeof window=="undefined"?null:new URLSearchParams(window.location.search).get(t)}function Ee(t,...e){t&&console.log("[TagadaTracker]",...e)}var Ft=class{constructor(){this.config=null;this.client=null;this.initialized=!1;this.initializing=!1}async init(e){var n,i,o,r;if(this.initialized||this.initializing)return Ee(e.debug||!1,"Already initialized or initializing"),this.getSession();this.initializing=!0,this.config=v({debug:!1},e),Ee(this.config.debug,"\u{1F680} Initializing external tracker with SDK...",e);try{let s=Tr("token");s&&(ne(s),Ee(this.config.debug,"\u{1F511} Bootstrapped token from URL")),this.client=Cr({debugMode:this.config.debug,features:{funnel:!0}}),await this.waitForClientReady();let a=await this.initializeFunnel();Ee(this.config.debug,"\u2705 Session initialized (tracking handled by orchestrator):",a),this.initialized=!0;let l=this.getSession();return l&&((i=(n=this.config).onReady)==null||i.call(n,l)),l}catch(s){let a=s instanceof Error?s:new Error(String(s));throw Ee(this.config.debug,"\u274C Initialization failed:",a),(r=(o=this.config).onError)==null||r.call(o,a),a}finally{this.initializing=!1}}getSession(){var n,i;if(!((i=(n=this.client)==null?void 0:n.funnel)!=null&&i.state.context))return null;let e=this.client.funnel.state.context;return{sessionId:e.sessionId,customerId:e.customerId,storeId:e.storeId,funnelId:e.funnelId,currentStepId:e.currentStepId,cmsToken:this.client.state.token||void 0}}isReady(){var e,n;return this.initialized&&!!((n=(e=this.client)==null?void 0:e.funnel)!=null&&n.state.context)}async navigate(e){if(!this.isReady())throw new Error("Tracker not initialized. Call init() first.");Ee(this.config.debug,"\u{1F680} Navigating:",e);let n=e.autoRedirect!==!1;try{let i=await this.client.funnel.navigate({type:e.eventType,data:e.eventData||{}},{autoRedirect:!1});return i!=null&&i.url?(Ee(this.config.debug,"\u2705 Navigation result:",i.url),n&&typeof window!="undefined"&&(window.location.href=e.returnUrl||i.url),{url:i.url}):null}catch(i){throw Ee(this.config.debug,"\u274C Navigation failed:",i),i}}getCustomerId(){var e,n,i,o,r;return((n=(e=this.client)==null?void 0:e.state.auth.customer)==null?void 0:n.id)||((r=(o=(i=this.client)==null?void 0:i.funnel)==null?void 0:o.state.context)==null?void 0:r.customerId)||null}getFunnelSessionId(){var e,n,i;return((i=(n=(e=this.client)==null?void 0:e.funnel)==null?void 0:n.state.context)==null?void 0:i.sessionId)||null}buildUrl(e,n){let i=this.getSession();if(!i)return e;let o=new URL(e,typeof window!="undefined"?window.location.origin:void 0);return o.searchParams.set("funnelSessionId",i.sessionId),i.cmsToken&&o.searchParams.set("token",i.cmsToken),i.funnelId&&o.searchParams.set("funnelId",i.funnelId),o.searchParams.set("storeId",i.storeId),n&&Object.entries(n).forEach(([r,s])=>{o.searchParams.set(r,s)}),o.toString()}getClient(){return this.client}async waitForClientReady(){if(this.client)return new Promise(e=>{let n=0,i=()=>{var o,r;(o=this.client)!=null&&o.state.isInitialized||(r=this.client)!=null&&r.state.token||n>40?e():(n++,setTimeout(i,50))};i()})}async initializeFunnel(){var o,r,s;if(!((o=this.client)!=null&&o.funnel))return null;let e={customerId:((r=this.client.state.auth.customer)==null?void 0:r.id)||"anon_placeholder",sessionId:((s=this.client.state.auth.session)==null?void 0:s.sessionId)||"sess_placeholder"},n={id:this.config.storeId,accountId:this.config.accountId||""},i=this.config.stepId;if(!i)throw new Error("stepId is required for external page tracking (URL mapping does not work for external pages)");return Ee(this.config.debug,"\u{1F50D} Initializing external page at step:",i),this.client.funnel.initialize(e,n,this.config.funnelId||Tr("funnelId")||void 0,i)}},vi=new Ft;typeof window!="undefined"&&(window.TagadaTracker=vi);return Lr(Ma);})();
|
|
6
|
+
"use strict";var TagadaTrackerBundle=(()=>{var Gt=Object.defineProperty,Or=Object.defineProperties,Rr=Object.getOwnPropertyDescriptor,vr=Object.getOwnPropertyDescriptors,Pr=Object.getOwnPropertyNames,ki=Object.getOwnPropertySymbols;var Di=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable;var De=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),xr=t=>{throw TypeError(t)};var _i=(t,e,n)=>e in t?Gt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,v=(t,e)=>{for(var n in e||(e={}))Di.call(e,n)&&_i(t,n,e[n]);if(ki)for(var n of ki(e))Nr.call(e,n)&&_i(t,n,e[n]);return t},z=(t,e)=>Or(t,vr(e));var Ie=(t,e)=>()=>(t&&(e=t(t=0)),e);var yn=(t,e)=>{for(var n in e)Gt(t,n,{get:e[n],enumerable:!0})},Lr=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Pr(e))!Di.call(t,o)&&o!==n&&Gt(t,o,{get:()=>e[o],enumerable:!(i=Rr(e,o))||i.enumerable});return t};var kr=t=>Lr(Gt({},"__esModule",{value:!0}),t);var ve=function(t,e){this[0]=t,this[1]=e},On=(t,e,n)=>{var i=(s,a,l,u)=>{try{var d=n[s](a),p=(a=d.value)instanceof ve,S=d.done;Promise.resolve(p?a[0]:a).then(w=>p?i(s==="return"?s:"next",a[1]?{done:w.done,value:w.value}:w,l,u):l({value:w,done:S})).catch(w=>i("throw",w,l,u))}catch(w){u(w)}},o=s=>r[s]=a=>new Promise((l,u)=>i(s,a,l,u)),r={};return n=n.apply(t,e),r[De("asyncIterator")]=()=>r,o("next"),o("throw"),o("return"),r},Rn=t=>{var e=t[De("asyncIterator")],n=!1,i,o={};return e==null?(e=t[De("iterator")](),i=r=>o[r]=s=>e[r](s)):(e=e.call(t),i=r=>o[r]=s=>{if(n){if(n=!1,r==="throw")throw s;return s}return n=!0,{done:!1,value:new ve(new Promise(a=>{var l=e[r](s);l instanceof Object||xr("Object expected"),a(l)}),1)}}),o[De("iterator")]=()=>o,i("next"),"throw"in e?i("throw"):o.throw=r=>{throw r},"return"in e&&i("return"),o},Bi=(t,e,n)=>(e=t[De("asyncIterator")])?e.call(t):(t=t[De("iterator")](),e={},n=(i,o)=>(o=t[i])&&(e[i]=r=>new Promise((s,a,l)=>(r=o.call(t,r),l=r.done,Promise.resolve(r.value).then(u=>s({value:u,done:l}),a)))),n("next"),n("return"),e);function Ui(t){var i;if(typeof document=="undefined")return null;let n="; ".concat(document.cookie).split("; ".concat(t,"="));return n.length===2&&((i=n.pop())==null?void 0:i.split(";").shift())||null}function Fi(t="local"){let e=Mi[t];if(!e)return console.warn("Unknown environment: ".concat(t,". Falling back to local.")),{environment:"local",apiConfig:Mi.local};let n=null;if(typeof window!="undefined"&&(n=new URLSearchParams(window.location.search).get("tagadaClientBaseUrl"),!n))try{n=localStorage.getItem("tgd_client_base_url")||Ui("tgd_client_base_url")}catch(o){}return n?(console.log("[SDK] Using custom API base URL override: ".concat(n)),{environment:t,apiConfig:z(v({},e),{baseUrl:n})}):{environment:t,apiConfig:e}}function ot(){var o;if(console.log("[SDK] detectEnvironment() called"),typeof window=="undefined")return"local";let e=new URLSearchParams(window.location.search).get("tagadaClientEnv");if(e&&(e==="production"||e==="development"||e==="local"))return console.log("[SDK] Using explicit environment override: ".concat(e)),e;try{let r=localStorage.getItem("tgd_client_env")||Ui("tgd_client_env");if(r&&(r==="production"||r==="development"||r==="local"))return console.log("[SDK] Using persisted environment override: ".concat(r)),r}catch(r){}let n=window.location.hostname,i=window.location.href;if(console.log('[SDK] detectEnvironment() - hostname: "'.concat(n,'"')),n==="localhost"||n.startsWith("127.")||n.startsWith("192.168.")||n.startsWith("10.")||n.includes(".local")||n===""||n==="0.0.0.0"||n.includes("ngrok-free.dev")||n.includes("ngrok-free.app")||n.includes("ngrok.io")||n.includes("ngrok.app")){if(console.log("[SDK] detectEnvironment() - returning LOCAL"),typeof window!="undefined"&&((o=window==null?void 0:window.__TAGADA_ENV__)!=null&&o.TAGADA_ENVIRONMENT)){let r=window.__TAGADA_ENV__.TAGADA_ENVIRONMENT.toLowerCase();if(r==="production"||r==="development"||r==="local")return console.log("[SDK] Local override detected: ".concat(r)),r}return"local"}return n==="app.tagadapay.com"||n.includes("tagadapay.com")||n.includes("yourproductiondomain.com")?"production":n==="app.tagadapay.dev"||n.includes("tagadapay.dev")||n.includes("vercel.app")||n.includes("netlify.app")||n.includes("surge.sh")||n.includes("github.io")||n.includes("herokuapp.com")||n.includes("railway.app")||i.includes("?env=dev")||i.includes("?dev=true")||i.includes("#dev")?"development":(console.warn("[SDK] Unknown domain: ".concat(n,", defaulting to production")),"production")}function rt(t=!1){return ot()!=="local"?!1:t&&typeof window!="undefined"?!window.location.hostname.includes(".cdn."):!0}var Mi,Vt=Ie(()=>{"use strict";Mi={production:{baseUrl:"https://app.tagadapay.com",endpoints:{checkout:{sessionInit:"/api/v1/checkout/session/init",sessionInitAsync:"/api/v1/checkout/session/init-async",sessionStatus:"/api/v1/checkout/session/status",asyncStatus:"/api/public/v1/checkout/async-status"},customer:{profile:"/api/v1/customer/profile",session:"/api/v1/customer/session"},store:{config:"/api/v1/store/config"}}},development:{baseUrl:"https://app.tagadapay.dev",endpoints:{checkout:{sessionInit:"/api/v1/checkout/session/init",sessionInitAsync:"/api/v1/checkout/session/init-async",sessionStatus:"/api/v1/checkout/session/status",asyncStatus:"/api/public/v1/checkout/async-status"},customer:{profile:"/api/v1/customer/profile",session:"/api/v1/customer/session"},store:{config:"/api/v1/store/config"}}},local:{baseUrl:"http://app.localhost:3000",endpoints:{checkout:{sessionInit:"/api/v1/checkout/session/init",sessionInitAsync:"/api/v1/checkout/session/init-async",sessionStatus:"/api/v1/checkout/session/status",asyncStatus:"/api/public/v1/checkout/async-status"},customer:{profile:"/api/v1/customer/profile",session:"/api/v1/customer/session"},store:{config:"/api/v1/store/config"}}}}});var Kt,vn=Ie(()=>{"use strict";Kt=class{constructor(e){this.apiClient=e}async initialize(e){return this.apiClient.post("/api/v1/funnel/initialize",e)}async navigate(e){return this.apiClient.post("/api/v1/funnel/navigate",e)}async updateContext(e,n){return this.apiClient.patch("/api/v1/funnel/context/".concat(e),n)}async endSession(e){return this.apiClient.delete("/api/v1/funnel/session/".concat(e))}async getSession(e,n,i){let o=new URLSearchParams;n&&o.append("currentUrl",n),i&&o.append("includeDebugData","true");let r="/api/v1/funnel/session/".concat(e).concat(o.toString()?"?".concat(o):"");return this.apiClient.get(r)}}});var Be,Pn=Ie(()=>{"use strict";Be=class{constructor(){this.listeners=new Set}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){this.listeners.forEach(n=>{try{n(e)}catch(i){console.error("Error in event listener:",i)}})}clear(){this.listeners.clear()}}});function ne(t){if(typeof window!="undefined")try{let n=localStorage.getItem(Wt)!==t;localStorage.setItem(Wt,t),n&&window.dispatchEvent(new Event("storage"))}catch(e){console.error("Failed to save token to localStorage:",e)}}function st(){if(typeof window!="undefined")try{return localStorage.getItem(Wt)}catch(t){return console.error("Failed to get token from localStorage:",t),null}return null}function Me(){if(typeof window!="undefined")try{localStorage.removeItem(Wt)}catch(t){console.error("Failed to clear token from localStorage:",t)}}var Wt,Ue=Ie(()=>{"use strict";Wt="cms_token"});function Hi(t){typeof document!="undefined"&&(document.cookie="".concat(Nn,"=").concat(t,"; path=/; max-age=2592000; SameSite=Lax"))}function Gi(){if(typeof document=="undefined")return;let t=document.cookie.split("; ").find(e=>e.startsWith("".concat(Nn,"=")));return t?t.split("=")[1]:void 0}function zt(){typeof document!="undefined"&&(document.cookie="".concat(Nn,"=; path=/; max-age=0"))}var Nn,at=Ie(()=>{"use strict";Nn="tgd-funnel-session-id"});function Fe(t){if(typeof window=="undefined")return null;try{return localStorage.getItem(t)}catch(e){return null}}function Yt(t,e){if(typeof window!="undefined")try{localStorage.setItem(t,e)}catch(n){}}function lt(t){var i;if(typeof document=="undefined")return null;let n=document.cookie.split(";").find(o=>o.trim().startsWith("".concat(t,"=")));return n?(i=n.split("=")[1])==null?void 0:i.trim():null}function xn(t,e,n=86400){if(typeof document!="undefined"){if(t==="tgd_draft"||t==="tgd-draft"){console.warn("\u{1F6E1}\uFE0F [SDK] Blocked attempt to set ".concat(t," as cookie - this should only be in localStorage"));return}document.cookie="".concat(t,"=").concat(e,"; path=/; max-age=").concat(n)}}function Ki(t){typeof document!="undefined"&&(document.cookie="".concat(t,"=; path=/; max-age=0"))}function Pe(){if(typeof window=="undefined")return{};let t=new URLSearchParams(window.location.search),e,n=t.get("draft");if(n!==null)e=n==="true";else{let y=Fe(B.DRAFT);y!==null&&(e=y==="true")}let i,o=t.get("funnelTracking");if(o!==null)i=o!=="false";else{let y=Fe(B.FUNNEL_TRACKING)||lt(B.FUNNEL_TRACKING);y!==null&&(i=y!=="false")}let r=t.get("token")||st()||null,s=t.get("funnelSessionId")||null,a=t.get("funnelId")||null,l,u=t.get("funnelEnv");u&&(u==="staging"||u==="production")&&(l=u);let d=t.get("forceReset")==="true",p,S=t.get("tagadaClientEnv");if(S&&(S==="production"||S==="development"||S==="local"))p=S;else{let y=Fe(B.CLIENT_ENV)||lt(B.CLIENT_ENV);y&&(y==="production"||y==="development"||y==="local")&&(p=y)}let w,f=t.get("tagadaClientBaseUrl");if(f)w=f;else{let y=Fe(B.CLIENT_BASE_URL)||lt(B.CLIENT_BASE_URL);y&&(w=y)}let C,b=t.get("currency");if(b)C=b;else{let y=Fe(B.CURRENCY)||lt(B.CURRENCY);y&&(C=y)}let R,k=t.get("locale");if(k)R=k;else{let y=Fe(B.LOCALE)||lt(B.LOCALE);y&&(R=y)}return{forceReset:d,token:r,funnelSessionId:s,funnelId:a,draft:e,funnelTracking:i,funnelEnv:l,tagadaClientEnv:p,tagadaClientBaseUrl:w,currency:C,locale:R}}function ct(){var e;return(e=Pe().draft)!=null?e:!1}function Ln(t){if(typeof window!="undefined")if(t)Yt(B.DRAFT,"true");else try{localStorage.removeItem(B.DRAFT)}catch(e){}}function Wi(t=!1){let e=null;typeof window!="undefined"&&(e=new URLSearchParams(window.location.search).get("token"));let n=Pe(),i=n.forceReset||!1;if(!i&&!n.token)return Vi(),!1;t&&(console.log("[SDK] Detected params:",n),console.log("[SDK] URL token (direct read):",e?e.substring(0,20)+"...":"none")),i&&(t&&console.log("[SDK] Force reset: Clearing all stored state"),Me(),zt(),typeof window!="undefined"&&window.localStorage&&Object.keys(localStorage).forEach(s=>{(s.startsWith("tagadapay_")||s.startsWith("tgd_"))&&(t&&console.log("[SDK] Clearing localStorage: ".concat(s)),localStorage.removeItem(s))}));let o=e||n.token;return o!=null?(t&&console.log("[SDK] Setting token from URL:",o.substring(0,20)+"..."),o===""||o==="null"?Me():(ne(o),t&&console.log("[SDK] \u2705 Token set in localStorage immediately after clear"))):i&&(t&&console.log("[SDK] Force reset mode (no token in URL)"),Me()),Vi(),n.funnelSessionId&&t&&console.log("[SDK] Using funnelSessionId from URL:",n.funnelSessionId),i}function Vi(){if(typeof window=="undefined")return;let t=new URLSearchParams(window.location.search),e=t.get("draft");e!==null&&Ln(e==="true");let n=t.get("funnelTracking");n!==null&&_r(n!=="false");let i=t.get("tagadaClientEnv");i&&(i==="production"||i==="development"||i==="local")&&Dr(i);let o=t.get("tagadaClientBaseUrl");o&&Br(o)}function _r(t){if(typeof window=="undefined")return;let e=t?"true":"false";Yt(B.FUNNEL_TRACKING,e),xn(B.FUNNEL_TRACKING,e,86400)}function Dr(t){typeof window!="undefined"&&(Yt(B.CLIENT_ENV,t),xn(B.CLIENT_ENV,t,86400))}function zi(){if(typeof window!="undefined")try{localStorage.removeItem(B.CLIENT_ENV),Ki(B.CLIENT_ENV)}catch(t){}}function Br(t){typeof window!="undefined"&&(Yt(B.CLIENT_BASE_URL,t),xn(B.CLIENT_BASE_URL,t,86400))}function Yi(){if(typeof window!="undefined")try{localStorage.removeItem(B.CLIENT_BASE_URL),Ki(B.CLIENT_BASE_URL)}catch(t){}}function ji(){var e;return(e=Pe().funnelTracking)!=null?e:!0}var B,jt=Ie(()=>{"use strict";Ue();at();B={DRAFT:"tgd_draft",FUNNEL_TRACKING:"tgd_funnel_tracking",FORCE_RESET:"tgd_force_reset",CLIENT_ENV:"tgd_client_env",CLIENT_BASE_URL:"tgd_client_base_url",CURRENCY:"tgd_currency",LOCALE:"tgd_locale"}});function kn(t){if(typeof window=="undefined"||typeof document=="undefined")return;let e=window.location.hostname,n=e.split("."),i=["",e,"."+e];for(let a=1;a<n.length;a++){let l=n.slice(a).join(".");i.push(l),i.push("."+l)}let o=window.location.pathname.split("/").filter(a=>a),r=["/"],s="";o.forEach(a=>{s+="/"+a,r.push(s)}),i.forEach(a=>{r.forEach(l=>{let u="".concat(t,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=").concat(l),d=a?"; domain=".concat(a):"";document.cookie=u+d,document.cookie=u+d+"; secure",document.cookie=u+d+"; SameSite=None; secure",document.cookie=u+d+"; SameSite=Lax",document.cookie=u+d+"; SameSite=Strict"})})}function Ur(){if(typeof window=="undefined"||!confirm("\u{1F6AA} Leave Preview Mode?\n\nThis will clear ALL cookies and localStorage (including Shopify session, cart, and preview settings) and reload the page.\n\nAre you sure?"))return;let e=new URL(window.location.href);["draft","funnelEnv","funnelTracking","tagadaClientEnv","tagadaClientBaseUrl","forceReset","funnelId","funnelSessionId","token"].forEach(r=>e.searchParams.delete(r)),window.history.replaceState({},"",e.href);try{let r=Object.getOwnPropertyDescriptor(Document.prototype,"cookie")||Object.getOwnPropertyDescriptor(HTMLDocument.prototype,"cookie");r&&r.set&&Object.defineProperty(document,"cookie",{configurable:!0,enumerable:!0,get:function(){return r.get?r.get.call(this):""},set:function(s){if(typeof s=="string"){let a=s.toLowerCase();if(a.includes("tgd_draft")||a.includes("tgd-draft")||a.includes("tgd.draft")||a.includes("tgddraft")){if(a.includes("max-age=0")||a.includes("expires=thu, 01 jan 1970")){r.set&&r.set.call(this,s);return}console.warn("\u{1F6E1}\uFE0F [TagadaPay] BLOCKED: tgd_draft should never be a cookie");return}}r.set&&r.set.call(this,s)}})}catch(r){console.warn("[TagadaPay] Could not install cookie blocker:",r)}if(window.localStorage)try{localStorage.removeItem("tgd_draft"),localStorage.removeItem("tgd_funnel_tracking"),localStorage.removeItem("tgd_client_env"),localStorage.removeItem("tgd_client_base_url"),localStorage.removeItem("cms_token")}catch(r){console.warn("[TagadaPay] Failed to clear some localStorage keys:",r)}Me(),zt(),zi(),Yi(),window.localStorage&&localStorage.clear(),window.sessionStorage&&sessionStorage.clear(),["tgd-funnel-session-id","tgd_draft","tgd_funnel_tracking","tgd_client_env","tgd_client_base_url","cms_token","tagadapay_session"].forEach(r=>kn(r)),["tgd-draft","tgd_draft","tgd.draft","tgddraft"].forEach(r=>kn(r)),document.cookie&&document.cookie.split(";").forEach(s=>{let a=s.split("=")[0].trim();if(!a)return;let l=window.location.hostname,u=l.split("."),d=["",l,"."+l];for(let f=1;f<u.length;f++){let C=u.slice(f).join(".");d.push(C),d.push("."+C)}let p=window.location.pathname.split("/").filter(f=>f),S=["/"],w="";p.forEach(f=>{w+="/"+f,S.push(w)}),d.forEach(f=>{S.forEach(C=>{let b="".concat(a,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=").concat(C),R=f?"; domain=".concat(f):"";document.cookie=b+R,document.cookie=b+R+"; secure",document.cookie=b+R+"; SameSite=None; secure",document.cookie=b+R+"; SameSite=Lax",document.cookie=b+R+"; SameSite=Strict",document.cookie=b+R+"; secure; SameSite=None",document.cookie=b+R+"; secure; SameSite=Lax",document.cookie=b+R+"; secure; SameSite=Strict"})})}),setTimeout(()=>{window.localStorage&&localStorage.length>0&&localStorage.clear(),kn("tgd_draft"),typeof window.stop=="function"&&window.stop(),window.location.replace(e.href)},10)}function _n(){if($i||typeof window=="undefined"||typeof document=="undefined")return;let t=Pe(),e=ct(),n=!ji(),i=!!(t.tagadaClientEnv||t.tagadaClientBaseUrl);if(!e&&!n&&!i)return;let o=document.createElement("div");o.id="tgd-preview-indicator",o.style.cssText='\n position: fixed;\n bottom: 16px;\n right: 16px;\n z-index: 999999;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n ';let r=document.createElement("div");r.style.cssText="\n background: ".concat(e?"#ff9500":"#007aff",";\n color: white;\n padding: 8px 12px;\n border-radius: 8px;\n font-size: 13px;\n font-weight: 600;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n transition: all 0.2s ease;\n display: flex;\n align-items: center;\n gap: 6px;\n "),r.innerHTML='\n <span style="font-size: 16px;">\u{1F50D}</span>\n <span>'.concat(e?"Preview Mode":"Dev Mode","</span>\n ");let s=document.createElement("div");s.style.cssText="\n position: absolute;\n bottom: calc(100% + 8px);\n right: 0;\n background: white;\n border: 1px solid #e5e5e5;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n padding: 12px;\n min-width: 250px;\n font-size: 12px;\n line-height: 1.5;\n display: none;\n ",s.style.paddingTop="20px";let a=document.createElement("div");a.style.cssText="\n position: absolute;\n bottom: 100%;\n left: 0;\n right: 0;\n height: 8px;\n display: none;\n ";let l='<div style="margin-bottom: 8px; font-weight: 600; color: #1d1d1f;">Current Environment</div>';l+='<div style="display: flex; flex-direction: column; gap: 6px;">',e&&(l+='\n <div style="display: flex; justify-content: space-between; color: #86868b;">\n <span>Draft Mode:</span>\n <span style="color: #ff9500; font-weight: 600;">ON</span>\n </div>\n '),n&&(l+='\n <div style="display: flex; justify-content: space-between; color: #86868b;">\n <span>Tracking:</span>\n <span style="color: #ff3b30; font-weight: 600;">DISABLED</span>\n </div>\n '),t.funnelEnv&&(l+='\n <div style="display: flex; justify-content: space-between; color: #86868b;">\n <span>Funnel Env:</span>\n <span style="color: #1d1d1f; font-weight: 600; font-family: monospace; font-size: 11px;">\n '.concat(t.funnelEnv,"\n </span>\n </div>\n ")),t.tagadaClientEnv&&(l+='\n <div style="display: flex; justify-content: space-between; color: #86868b;">\n <span>API Env:</span>\n <span style="color: #1d1d1f; font-weight: 600; font-family: monospace; font-size: 11px;">\n '.concat(t.tagadaClientEnv,"\n </span>\n </div>\n ")),t.tagadaClientBaseUrl&&(l+='\n <div style="color: #86868b;">\n <div style="margin-bottom: 4px;">API URL:</div>\n <div style="color: #1d1d1f; font-weight: 600; font-family: monospace; font-size: 10px; word-break: break-all; background: #f5f5f7; padding: 4px 6px; border-radius: 4px;">\n '.concat(t.tagadaClientBaseUrl,"\n </div>\n </div>\n ")),t.funnelId&&(l+='\n <div style="color: #86868b; margin-top: 4px; padding-top: 8px; border-top: 1px solid #e5e5e5;">\n <div style="margin-bottom: 4px;">Funnel ID:</div>\n <div style="color: #1d1d1f; font-family: monospace; font-size: 10px; word-break: break-all; background: #f5f5f7; padding: 4px 6px; border-radius: 4px;">\n '.concat(t.funnelId,"\n </div>\n </div>\n ")),l+="</div>",l+='\n <div style="margin-top: 12px; padding-top: 8px; border-top: 1px solid #e5e5e5; font-size: 11px; color: #86868b; text-align: center;">\n Add <code style="background: #f5f5f7; padding: 2px 4px; border-radius: 3px;">?forceReset=true</code> to reset\n </div>\n ',l+='\n <div style="margin-top: 12px; padding-top: 8px; border-top: 1px solid #e5e5e5;">\n <button id="tgd-leave-preview" style="\n background: #ff3b30;\n color: white;\n border: none;\n border-radius: 6px;\n padding: 10px 12px;\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n transition: opacity 0.2s;\n width: 100%;\n ">\n \u{1F6AA} Leave Preview Mode\n </button>\n </div>\n ',s.innerHTML=l;let u=!1,d=()=>{u=!0,s.style.display="block",a.style.display="block"},p=()=>{u=!1,setTimeout(()=>{u||(s.style.display="none",a.style.display="none")},100)};r.addEventListener("mouseenter",d),r.addEventListener("mouseleave",p),a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",p),s.addEventListener("mouseenter",d),s.addEventListener("mouseleave",p);let S=s.querySelector("#tgd-leave-preview");S&&(S.addEventListener("mouseenter",()=>{S.style.opacity="0.8"}),S.addEventListener("mouseleave",()=>{S.style.opacity="1"}),S.addEventListener("click",w=>{w.stopPropagation(),Ur()})),o.appendChild(r),o.appendChild(a),o.appendChild(s),document.body.appendChild(o),Mr=o,$i=!0}var Mr,$i,Xi=Ie(()=>{"use strict";jt();Ue();at();Mr=null,$i=!1});var Qi={};yn(Qi,{FunnelClient:()=>dt,TrackingProvider:()=>Ji,getAssignedPaymentFlowId:()=>Wr,getAssignedPixels:()=>jr,getAssignedScripts:()=>Yr,getAssignedStaticResources:()=>zr,getAssignedStepConfig:()=>ft,getLocalFunnelConfig:()=>Zi,loadLocalFunnelConfig:()=>Vr});function Hr(){if(typeof window!="undefined"){if(window.__TGD_FUNNEL_ID__)return window.__TGD_FUNNEL_ID__;if(typeof document!="undefined"){let t=document.querySelector('meta[name="x-funnel-id"]');return(t==null?void 0:t.getAttribute("content"))||void 0}}}function $t(){if(typeof window!="undefined"){if(window.__TGD_FUNNEL_VARIANT_ID__)return window.__TGD_FUNNEL_VARIANT_ID__;if(typeof document!="undefined"){let t=document.querySelector('meta[name="x-funnel-variant-id"]');return(t==null?void 0:t.getAttribute("content"))||void 0}}}function ut(){if(typeof window!="undefined"){if(window.__TGD_FUNNEL_STEP_ID__)return window.__TGD_FUNNEL_STEP_ID__;if(typeof document!="undefined"){let t=document.querySelector('meta[name="x-funnel-step-id"]');return(t==null?void 0:t.getAttribute("content"))||void 0}}}function qi(t){if(!t||typeof t!="string")return;let e=t.trim();if(!e)return;let n=[()=>JSON.parse(e),()=>JSON.parse(decodeURIComponent(e)),()=>JSON.parse(decodeURIComponent(decodeURIComponent(e)))];for(let i of n)try{let o=i();if(o&&typeof o=="object")return o}catch(o){}typeof console!="undefined"&&console.warn("[SDK] Failed to parse stepConfig:",e.substring(0,100))}function Gr(){if(typeof window=="undefined")return!1;let t=window.location.hostname;return t==="localhost"||t==="127.0.0.1"||t.endsWith(".localhost")&&!t.includes(".cdn.")}async function Vr(){if(!Gr())return null;if(ie!==void 0)return ie;if(Dn)return await new Promise(t=>setTimeout(t,100)),ie!=null?ie:null;Dn=!0;try{console.log("\u{1F6E0}\uFE0F [SDK] Loading local funnel config from /config/funnel.local.json...");let t=await fetch("/config/funnel.local.json");if(!t.ok)return console.log("\u{1F6E0}\uFE0F [SDK] funnel.local.json not found (this is fine in production)"),ie=null,null;let e=await t.json();return console.log("\u{1F6E0}\uFE0F [SDK] \u2705 Loaded local funnel config:",e),ie=e,e}catch(t){return console.log("\u{1F6E0}\uFE0F [SDK] funnel.local.json not available:",t),ie=null,null}finally{Dn=!1}}function Zi(){return ie!=null?ie:null}function Kr(t){return{payment:t.paymentFlowId?{paymentFlowId:t.paymentFlowId}:void 0,staticResources:t.staticResources,scripts:t.scripts,pixels:t.pixels}}function ft(){if(typeof window=="undefined")return;let t=Zi();if(t)return console.log("\u{1F6E0}\uFE0F [SDK] Using local funnel.local.json (overrides injected)"),Kr(t);let e=window.__TGD_STEP_CONFIG__;if(e){let n=qi(e);if(n)return n}if(typeof document!="undefined"){let n=document.querySelector('meta[name="x-step-config"]'),i=n==null?void 0:n.getAttribute("content");if(i){let o=qi(i);if(o)return o}}}function Wr(){var e;let t=ft();if((e=t==null?void 0:t.payment)!=null&&e.paymentFlowId)return t.payment.paymentFlowId;if(typeof window!="undefined"){if(window.__TGD_PAYMENT_FLOW_ID__)return window.__TGD_PAYMENT_FLOW_ID__;if(typeof document!="undefined"){let n=document.querySelector('meta[name="x-payment-flow-id"]');return(n==null?void 0:n.getAttribute("content"))||void 0}}}function zr(){let t=ft();return t==null?void 0:t.staticResources}function Yr(t){let e=ft();if(!(e!=null&&e.scripts))return;let n=e.scripts.filter(i=>i.enabled);return t&&(n=n.filter(i=>i.position===t||!i.position&&t==="head-end")),n.length>0?n:void 0}function jr(){let t=ft(),e=t==null?void 0:t.pixels;if(!e||typeof e!="object")return;let n={};for(let[i,o]of Object.entries(e))o&&(Array.isArray(o)?n[i]=o:typeof o=="object"&&(n[i]=[o]));return Object.keys(n).length>0?n:void 0}var Ji,ie,Dn,dt,Bn=Ie(()=>{"use strict";Vt();vn();Pn();jt();Xi();at();Ji=(r=>(r.FACEBOOK="facebook",r.TIKTOK="tiktok",r.SNAPCHAT="snapchat",r.PINTEREST="pinterest",r.GTM="gtm",r))(Ji||{});Dn=!1;dt=class{constructor(e){this.eventDispatcher=new Be;this.isInitializing=!1;this.initializationAttempted=!1;this.config=e,this.resource=new Kt(e.apiClient),this.state={context:null,isLoading:!1,isInitialized:!1,isNavigating:!1,error:null,sessionError:null}}setConfig(e){this.config=v(v({},this.config),e)}subscribe(e){return this.eventDispatcher.subscribe(e)}getState(){return this.state}getDetectedSessionId(){var i;if((i=this.state.context)!=null&&i.sessionId)return this.state.context.sessionId;if(typeof window=="undefined")return null;let n=new URLSearchParams(window.location.search).get("funnelSessionId");return n||Gi()||null}resetInitialization(){this.initializationAttempted=!1,this.isInitializing=!1,this.updateState({context:null,isInitialized:!1})}async autoInitialize(e,n,i){if(this.state.context)return this.state.context;if(this.isInitializing||this.initializationAttempted)return null;this.initializationAttempted=!0,this.isInitializing=!0,this.updateState({isLoading:!0,error:null});try{let o=this.getDetectedSessionId(),a=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("funnelId")||i,l=Hr(),u=$t(),d=ut(),p=Pe(),S=this.config.funnelId||l||a,w=this.config.stepId||d,f=typeof window!="undefined"?new URLSearchParams(window.location.search):null,C=f==null?void 0:f.get("funnelEnv");this.config.debugMode&&console.log("\u{1F680} [FunnelClient] Auto-initializing...",{existingSessionId:o,effectiveFunnelId:S,funnelVariantId:u,funnelStepId:w,draft:p.draft,funnelTracking:p.funnelTracking,funnelEnv:C,tagadaClientEnv:p.tagadaClientEnv,tagadaClientBaseUrl:p.tagadaClientBaseUrl,source:{funnelId:this.config.funnelId?"config":l?"injected":a?"url/prop":"none",stepId:this.config.stepId?"config":d?"injected":"none"}});let b=await this.resource.initialize({cmsSession:{customerId:e.customerId,sessionId:e.sessionId,storeId:n.id,accountId:n.accountId},funnelId:S,existingSessionId:o||void 0,currentUrl:typeof window!="undefined"?window.location.href:void 0,funnelVariantId:u,funnelStepId:w,draft:p.draft,funnelTracking:p.funnelTracking,funnelEnv:C||void 0,tagadaClientEnv:p.tagadaClientEnv,tagadaClientBaseUrl:p.tagadaClientBaseUrl,currency:p.currency,locale:p.locale});if(b.success&&b.context){let R=this.enrichContext(b.context);return this.handleSessionSuccess(R),_n(),R}else throw new Error(b.error||"Failed to initialize funnel session")}catch(o){let r=o instanceof Error?o:new Error(String(o));throw this.updateState({error:r,isLoading:!1}),this.config.debugMode&&console.error("\u274C [FunnelClient] Init failed:",r),r}finally{this.isInitializing=!1}}async initialize(e,n,i,o){this.updateState({isLoading:!0,error:null});try{let r=$t(),s=ut();this.config.debugMode&&(r&&console.log("\u{1F3AF} [FunnelClient] Detected A/B test variant:",r),s&&console.log("\u{1F3AF} [FunnelClient] Detected step ID:",s));let a=await this.resource.initialize({cmsSession:{customerId:e.customerId,sessionId:e.sessionId,storeId:n.id,accountId:n.accountId},funnelId:i,entryStepId:o,currentUrl:typeof window!="undefined"?window.location.href:void 0,funnelVariantId:r,funnelStepId:s});if(a.success&&a.context){let l=this.enrichContext(a.context);return this.handleSessionSuccess(l),_n(),l}else throw new Error(a.error||"Failed to initialize")}catch(r){let s=r instanceof Error?r:new Error(String(r));throw this.updateState({error:s,isLoading:!1}),s}}async navigate(e,n){var i,o,r,s,a,l;if(n!=null&&n.waitForSession&&!((i=this.state.context)!=null&&i.sessionId)){this.config.debugMode&&console.log("\u23F3 [FunnelClient] Waiting for session before navigation...");let u=5e3,d=Date.now();for(;!((o=this.state.context)!=null&&o.sessionId)&&Date.now()-d<u;)await new Promise(p=>setTimeout(p,100));(r=this.state.context)!=null&&r.sessionId&&this.config.debugMode&&console.log("\u2705 [FunnelClient] Session ready, proceeding with navigation")}if(!((s=this.state.context)!=null&&s.sessionId))throw new Error("No active session");this.updateState({isNavigating:!0,isLoading:!0});try{let u=$t(),d=ut(),p=typeof window!="undefined"?window.location.href:void 0;!d&&this.config.stepId&&(d=this.config.stepId,this.config.debugMode&&console.log("\u{1F50D} [FunnelClient.navigate] Using stepId from config (no injection):",d)),!u&&this.config.variantId&&(u=this.config.variantId,this.config.debugMode&&console.log("\u{1F50D} [FunnelClient.navigate] Using variantId from config (no injection):",u)),this.config.debugMode&&console.log("\u{1F50D} [FunnelClient.navigate] Sending to backend:",{sessionId:this.state.context.sessionId,currentUrl:p,funnelStepId:d||"(not found)",funnelVariantId:u||"(not found)",hasInjectedStepId:!!ut(),hasInjectedVariantId:!!$t(),usedConfigFallback:!ut()&&!!this.config.stepId,customerTags:(n==null?void 0:n.customerTags)||"(none)",deviceId:(n==null?void 0:n.deviceId)||"(none)"});let S=(n==null?void 0:n.fireAndForget)||!1,w=await this.resource.navigate({sessionId:this.state.context.sessionId,event:e,currentUrl:p,funnelStepId:d,funnelVariantId:u,fireAndForget:S,customerTags:n==null?void 0:n.customerTags,deviceId:n==null?void 0:n.deviceId});if(!w.success||!w.result)throw new Error(w.error||"Navigation failed");let f=w.result;if(f.queued)return this.updateState({isNavigating:!1,isLoading:!1}),f.sessionId&&f.sessionId!==((a=this.state.context)==null?void 0:a.sessionId)&&(this.config.debugMode&&console.log("\u{1F525} [FunnelClient] Session ID updated: ".concat((l=this.state.context)==null?void 0:l.sessionId," \u2192 ").concat(f.sessionId)),this.state.context&&(this.state.context.sessionId=f.sessionId)),this.config.debugMode&&console.log("\u{1F525} [FunnelClient] Navigation queued (fire-and-forget mode)"),f;let C=(n==null?void 0:n.autoRedirect)!==void 0?n.autoRedirect:this.config.autoRedirect!==!1;return C||(this.config.debugMode&&console.log("\u{1F504} [FunnelClient] Refreshing session (no auto-redirect)"),await this.refreshSession()),this.updateState({isNavigating:!1,isLoading:!1}),C&&(f!=null&&f.url)&&typeof window!="undefined"&&(this.config.debugMode&&console.log("\u{1F680} [FunnelClient] Auto-redirecting to:",f.url,"(skipped session refresh - next page will initialize)"),window.location.href=f.url),f}catch(u){let d=u instanceof Error?u:new Error(String(u));throw this.updateState({error:d,isNavigating:!1,isLoading:!1}),d}}async goToStep(e,n){return this.navigate({type:"direct_navigation",data:{targetStepId:e}},n)}async refreshSession(){var e;if((e=this.state.context)!=null&&e.sessionId)try{let n=await this.resource.getSession(this.state.context.sessionId);if(n.success&&n.context){let i=this.enrichContext(n.context);return this.updateState({context:i,sessionError:null}),i}}catch(n){this.updateState({sessionError:n instanceof Error?n:new Error(String(n))})}}async updateContext(e){var n;if(!((n=this.state.context)!=null&&n.sessionId))throw new Error("No active session");this.updateState({isLoading:!0});try{let i=await this.resource.updateContext(this.state.context.sessionId,{contextUpdates:e});if(i.success)await this.refreshSession();else throw new Error(i.error||"Failed to update context")}finally{this.updateState({isLoading:!1})}}async endSession(){var e;if((e=this.state.context)!=null&&e.sessionId)try{await this.resource.endSession(this.state.context.sessionId)}finally{this.state.context=null,this.updateState({context:null,isInitialized:!1})}}updateState(e){this.state=v(v({},this.state),e),this.eventDispatcher.notify(this.state)}handleSessionSuccess(e){Hi(e.sessionId),this.updateState({context:e,isLoading:!1,isInitialized:!0,error:null,sessionError:null})}enrichContext(e){var s,a;if((((s=this.config.environment)==null?void 0:s.environment)||ot())!=="local")return e;let i=((a=this.config.pluginConfig)==null?void 0:a.staticResources)||{};if(Object.keys(i).length===0)return e;let o=e.static||{};return Object.keys(i).every(l=>o[l]===i[l])&&Object.keys(o).length===Object.keys(i).length?e:z(v({},e),{static:v(v({},i),o)})}}});var Ma={};yn(Ma,{TagadaExternalTracker:()=>Ft,TagadaTracker:()=>vi});Vt();Bn();function pt(t,e){return function(){return t.apply(e,arguments)}}var{toString:$r}=Object.prototype,{getPrototypeOf:Un}=Object,{iterator:qt,toStringTag:to}=Symbol,Jt=(t=>e=>{let n=$r.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),oe=t=>(t=t.toLowerCase(),e=>Jt(e)===t),Zt=t=>e=>typeof e===t,{isArray:Ge}=Array,He=Zt("undefined");function gt(t){return t!==null&&!He(t)&&t.constructor!==null&&!He(t.constructor)&&q(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var no=oe("ArrayBuffer");function Xr(t){let e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&no(t.buffer),e}var qr=Zt("string"),q=Zt("function"),io=Zt("number"),mt=t=>t!==null&&typeof t=="object",Jr=t=>t===!0||t===!1,Xt=t=>{if(Jt(t)!=="object")return!1;let e=Un(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(to in t)&&!(qt in t)},Zr=t=>{if(!mt(t)||gt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch(e){return!1}},Qr=oe("Date"),es=oe("File"),ts=oe("Blob"),ns=oe("FileList"),is=t=>mt(t)&&q(t.pipe),os=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||q(t.append)&&((e=Jt(t))==="formdata"||e==="object"&&q(t.toString)&&t.toString()==="[object FormData]"))},rs=oe("URLSearchParams"),[ss,as,ls,cs]=["ReadableStream","Request","Response","Headers"].map(oe),us=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ht(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t=="undefined")return;let i,o;if(typeof t!="object"&&(t=[t]),Ge(t))for(i=0,o=t.length;i<o;i++)e.call(null,t[i],i,t);else{if(gt(t))return;let r=n?Object.getOwnPropertyNames(t):Object.keys(t),s=r.length,a;for(i=0;i<s;i++)a=r[i],e.call(null,t[a],a,t)}}function oo(t,e){if(gt(t))return null;e=e.toLowerCase();let n=Object.keys(t),i=n.length,o;for(;i-- >0;)if(o=n[i],e===o.toLowerCase())return o;return null}var Ne=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,ro=t=>!He(t)&&t!==Ne;function Mn(){let{caseless:t,skipUndefined:e}=ro(this)&&this||{},n={},i=(o,r)=>{let s=t&&oo(n,r)||r;Xt(n[s])&&Xt(o)?n[s]=Mn(n[s],o):Xt(o)?n[s]=Mn({},o):Ge(o)?n[s]=o.slice():(!e||!He(o))&&(n[s]=o)};for(let o=0,r=arguments.length;o<r;o++)arguments[o]&&ht(arguments[o],i);return n}var ds=(t,e,n,{allOwnKeys:i}={})=>(ht(e,(o,r)=>{n&&q(o)?t[r]=pt(o,n):t[r]=o},{allOwnKeys:i}),t),fs=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ps=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},gs=(t,e,n,i)=>{let o,r,s,a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),r=o.length;r-- >0;)s=o[r],(!i||i(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&Un(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},ms=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;let i=t.indexOf(e,n);return i!==-1&&i===n},hs=t=>{if(!t)return null;if(Ge(t))return t;let e=t.length;if(!io(e))return null;let n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Es=(t=>e=>t&&e instanceof t)(typeof Uint8Array!="undefined"&&Un(Uint8Array)),As=(t,e)=>{let i=(t&&t[qt]).call(t),o;for(;(o=i.next())&&!o.done;){let r=o.value;e.call(t,r[0],r[1])}},bs=(t,e)=>{let n,i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},ws=oe("HTMLFormElement"),Is=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,o){return i.toUpperCase()+o}),eo=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Ss=oe("RegExp"),so=(t,e)=>{let n=Object.getOwnPropertyDescriptors(t),i={};ht(n,(o,r)=>{let s;(s=e(o,r,t))!==!1&&(i[r]=s||o)}),Object.defineProperties(t,i)},Cs=t=>{so(t,(e,n)=>{if(q(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let i=t[n];if(q(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ts=(t,e)=>{let n={},i=o=>{o.forEach(r=>{n[r]=!0})};return Ge(t)?i(t):i(String(t).split(e)),n},ys=()=>{},Os=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Rs(t){return!!(t&&q(t.append)&&t[to]==="FormData"&&t[qt])}var vs=t=>{let e=new Array(10),n=(i,o)=>{if(mt(i)){if(e.indexOf(i)>=0)return;if(gt(i))return i;if(!("toJSON"in i)){e[o]=i;let r=Ge(i)?[]:{};return ht(i,(s,a)=>{let l=n(s,o+1);!He(l)&&(r[a]=l)}),e[o]=void 0,r}}return i};return n(t,0)},Ps=oe("AsyncFunction"),Ns=t=>t&&(mt(t)||q(t))&&q(t.then)&&q(t.catch),ao=((t,e)=>t?setImmediate:e?((n,i)=>(Ne.addEventListener("message",({source:o,data:r})=>{o===Ne&&r===n&&i.length&&i.shift()()},!1),o=>{i.push(o),Ne.postMessage(n,"*")}))("axios@".concat(Math.random()),[]):n=>setTimeout(n))(typeof setImmediate=="function",q(Ne.postMessage)),xs=typeof queueMicrotask!="undefined"?queueMicrotask.bind(Ne):typeof process!="undefined"&&process.nextTick||ao,Ls=t=>t!=null&&q(t[qt]),c={isArray:Ge,isArrayBuffer:no,isBuffer:gt,isFormData:os,isArrayBufferView:Xr,isString:qr,isNumber:io,isBoolean:Jr,isObject:mt,isPlainObject:Xt,isEmptyObject:Zr,isReadableStream:ss,isRequest:as,isResponse:ls,isHeaders:cs,isUndefined:He,isDate:Qr,isFile:es,isBlob:ts,isRegExp:Ss,isFunction:q,isStream:is,isURLSearchParams:rs,isTypedArray:Es,isFileList:ns,forEach:ht,merge:Mn,extend:ds,trim:us,stripBOM:fs,inherits:ps,toFlatObject:gs,kindOf:Jt,kindOfTest:oe,endsWith:ms,toArray:hs,forEachEntry:As,matchAll:bs,isHTMLForm:ws,hasOwnProperty:eo,hasOwnProp:eo,reduceDescriptors:so,freezeMethods:Cs,toObjectSet:Ts,toCamelCase:Is,noop:ys,toFiniteNumber:Os,findKey:oo,global:Ne,isContextDefined:ro,isSpecCompliantForm:Rs,toJSONObject:vs,isAsyncFn:Ps,isThenable:Ns,setImmediate:ao,asap:xs,isIterable:Ls};function Ve(t,e,n,i,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),i&&(this.request=i),o&&(this.response=o,this.status=o.status?o.status:null)}c.inherits(Ve,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});var lo=Ve.prototype,co={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{co[t]={value:t}});Object.defineProperties(Ve,co);Object.defineProperty(lo,"isAxiosError",{value:!0});Ve.from=(t,e,n,i,o,r)=>{let s=Object.create(lo);c.toFlatObject(t,s,function(d){return d!==Error.prototype},u=>u!=="isAxiosError");let a=t&&t.message?t.message:"Error",l=e==null&&t?t.code:e;return Ve.call(s,a,l,n,i,o),t&&s.cause==null&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",r&&Object.assign(s,r),s};var T=Ve;var Qt=null;function Fn(t){return c.isPlainObject(t)||c.isArray(t)}function fo(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function uo(t,e,n){return t?t.concat(e).map(function(o,r){return o=fo(o),!n&&r?"["+o+"]":o}).join(n?".":""):e}function ks(t){return c.isArray(t)&&!t.some(Fn)}var _s=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function Ds(t,e,n){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new(Qt||FormData),n=c.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,b){return!c.isUndefined(b[C])});let i=n.metaTokens,o=n.visitor||d,r=n.dots,s=n.indexes,l=(n.Blob||typeof Blob!="undefined"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(o))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(c.isDate(f))return f.toISOString();if(c.isBoolean(f))return f.toString();if(!l&&c.isBlob(f))throw new T("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(f)||c.isTypedArray(f)?l&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function d(f,C,b){let R=f;if(f&&!b&&typeof f=="object"){if(c.endsWith(C,"{}"))C=i?C:C.slice(0,-2),f=JSON.stringify(f);else if(c.isArray(f)&&ks(f)||(c.isFileList(f)||c.endsWith(C,"[]"))&&(R=c.toArray(f)))return C=fo(C),R.forEach(function(y,N){!(c.isUndefined(y)||y===null)&&e.append(s===!0?uo([C],N,r):s===null?C:C+"[]",u(y))}),!1}return Fn(f)?!0:(e.append(uo(b,C,r),u(f)),!1)}let p=[],S=Object.assign(_s,{defaultVisitor:d,convertValue:u,isVisitable:Fn});function w(f,C){if(!c.isUndefined(f)){if(p.indexOf(f)!==-1)throw Error("Circular reference detected in "+C.join("."));p.push(f),c.forEach(f,function(R,k){(!(c.isUndefined(R)||R===null)&&o.call(e,R,c.isString(k)?k.trim():k,C,S))===!0&&w(R,C?C.concat(k):[k])}),p.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return w(t),e}var Se=Ds;function po(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function go(t,e){this._pairs=[],t&&Se(t,this,e)}var mo=go.prototype;mo.append=function(e,n){this._pairs.push([e,n])};mo.toString=function(e){let n=e?function(i){return e.call(this,i,po)}:po;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};var en=go;function Bs(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Et(t,e,n){if(!e)return t;let i=n&&n.encode||Bs;c.isFunction(n)&&(n={serialize:n});let o=n&&n.serialize,r;if(o?r=o(e,n):r=c.isURLSearchParams(e)?e.toString():new en(e,n).toString(i),r){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+r}return t}var Hn=class{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(i){i!==null&&e(i)})}},Gn=Hn;var tn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var ho=typeof URLSearchParams!="undefined"?URLSearchParams:en;var Eo=typeof FormData!="undefined"?FormData:null;var Ao=typeof Blob!="undefined"?Blob:null;var bo={isBrowser:!0,classes:{URLSearchParams:ho,FormData:Eo,Blob:Ao},protocols:["http","https","file","blob","url","data"]};var Wn={};yn(Wn,{hasBrowserEnv:()=>Kn,hasStandardBrowserEnv:()=>Ms,hasStandardBrowserWebWorkerEnv:()=>Us,navigator:()=>Vn,origin:()=>Fs});var Kn=typeof window!="undefined"&&typeof document!="undefined",Vn=typeof navigator=="object"&&navigator||void 0,Ms=Kn&&(!Vn||["ReactNative","NativeScript","NS"].indexOf(Vn.product)<0),Us=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Fs=Kn&&window.location.href||"http://localhost";var M=v(v({},Wn),bo);function zn(t,e){return Se(t,new M.classes.URLSearchParams,v({visitor:function(n,i,o,r){return M.isNode&&c.isBuffer(n)?(this.append(i,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}function Hs(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Gs(t){let e={},n=Object.keys(t),i,o=n.length,r;for(i=0;i<o;i++)r=n[i],e[r]=t[r];return e}function Vs(t){function e(n,i,o,r){let s=n[r++];if(s==="__proto__")return!0;let a=Number.isFinite(+s),l=r>=n.length;return s=!s&&c.isArray(o)?o.length:s,l?(c.hasOwnProp(o,s)?o[s]=[o[s],i]:o[s]=i,!a):((!o[s]||!c.isObject(o[s]))&&(o[s]=[]),e(n,i,o[s],r)&&c.isArray(o[s])&&(o[s]=Gs(o[s])),!a)}if(c.isFormData(t)&&c.isFunction(t.entries)){let n={};return c.forEachEntry(t,(i,o)=>{e(Hs(i),o,n,0)}),n}return null}var nn=Vs;function Ks(t,e,n){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(t)}var Yn={transitional:tn,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){let i=n.getContentType()||"",o=i.indexOf("application/json")>-1,r=c.isObject(e);if(r&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return o?JSON.stringify(nn(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(r){if(i.indexOf("application/x-www-form-urlencoded")>-1)return zn(e,this.formSerializer).toString();if((a=c.isFileList(e))||i.indexOf("multipart/form-data")>-1){let l=this.env&&this.env.FormData;return Se(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return r||o?(n.setContentType("application/json",!1),Ks(e)):e}],transformResponse:[function(e){let n=this.transitional||Yn.transitional,i=n&&n.forcedJSONParsing,o=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(i&&!this.responseType||o)){let s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e,this.parseReviver)}catch(a){if(s)throw a.name==="SyntaxError"?T.from(a,T.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:M.classes.FormData,Blob:M.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{Yn.headers[t]={}});var Ke=Yn;var Ws=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),wo=t=>{let e={},n,i,o;return t&&t.split("\n").forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),i=s.substring(o+1).trim(),!(!n||e[n]&&Ws[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e};var Io=Symbol("internals");function At(t){return t&&String(t).trim().toLowerCase()}function on(t){return t===!1||t==null?t:c.isArray(t)?t.map(on):String(t)}function zs(t){let e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}var Ys=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function jn(t,e,n,i,o){if(c.isFunction(i))return i.call(this,e,n);if(o&&(e=n),!!c.isString(e)){if(c.isString(i))return e.indexOf(i)!==-1;if(c.isRegExp(i))return i.test(e)}}function js(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function $s(t,e){let n=c.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(o,r,s){return this[i].call(this,e,o,r,s)},configurable:!0})})}var We=class{constructor(e){e&&this.set(e)}set(e,n,i){let o=this;function r(a,l,u){let d=At(l);if(!d)throw new Error("header name must be a non-empty string");let p=c.findKey(o,d);(!p||o[p]===void 0||u===!0||u===void 0&&o[p]!==!1)&&(o[p||l]=on(a))}let s=(a,l)=>c.forEach(a,(u,d)=>r(u,d,l));if(c.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(c.isString(e)&&(e=e.trim())&&!Ys(e))s(wo(e),n);else if(c.isObject(e)&&c.isIterable(e)){let a={},l,u;for(let d of e){if(!c.isArray(d))throw TypeError("Object iterator must return a key-value pair");a[u=d[0]]=(l=a[u])?c.isArray(l)?[...l,d[1]]:[l,d[1]]:d[1]}s(a,n)}else e!=null&&r(n,e,i);return this}get(e,n){if(e=At(e),e){let i=c.findKey(this,e);if(i){let o=this[i];if(!n)return o;if(n===!0)return zs(o);if(c.isFunction(n))return n.call(this,o,i);if(c.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=At(e),e){let i=c.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||jn(this,this[i],i,n)))}return!1}delete(e,n){let i=this,o=!1;function r(s){if(s=At(s),s){let a=c.findKey(i,s);a&&(!n||jn(i,i[a],a,n))&&(delete i[a],o=!0)}}return c.isArray(e)?e.forEach(r):r(e),o}clear(e){let n=Object.keys(this),i=n.length,o=!1;for(;i--;){let r=n[i];(!e||jn(this,this[r],r,e,!0))&&(delete this[r],o=!0)}return o}normalize(e){let n=this,i={};return c.forEach(this,(o,r)=>{let s=c.findKey(i,r);if(s){n[s]=on(o),delete n[r];return}let a=e?js(r):String(r).trim();a!==r&&delete n[r],n[a]=on(o),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let n=Object.create(null);return c.forEach(this,(i,o)=>{i!=null&&i!==!1&&(n[o]=e&&c.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){let i=new this(e);return n.forEach(o=>i.set(o)),i}static accessor(e){let i=(this[Io]=this[Io]={accessors:{}}).accessors,o=this.prototype;function r(s){let a=At(s);i[a]||($s(o,s),i[a]=!0)}return c.isArray(e)?e.forEach(r):r(e),this}};We.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(We.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}});c.freezeMethods(We);var V=We;function bt(t,e){let n=this||Ke,i=e||n,o=V.from(i.headers),r=i.data;return c.forEach(t,function(a){r=a.call(n,r,o.normalize(),e?e.status:void 0)}),o.normalize(),r}function wt(t){return!!(t&&t.__CANCEL__)}function So(t,e,n){T.call(this,t==null?"canceled":t,T.ERR_CANCELED,e,n),this.name="CanceledError"}c.inherits(So,T,{__CANCEL__:!0});var ce=So;function It(t,e,n){let i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new T("Request failed with status code "+n.status,[T.ERR_BAD_REQUEST,T.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function $n(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Xs(t,e){t=t||10;let n=new Array(t),i=new Array(t),o=0,r=0,s;return e=e!==void 0?e:1e3,function(l){let u=Date.now(),d=i[r];s||(s=u),n[o]=l,i[o]=u;let p=r,S=0;for(;p!==o;)S+=n[p++],p=p%t;if(o=(o+1)%t,o===r&&(r=(r+1)%t),u-s<e)return;let w=d&&u-d;return w?Math.round(S*1e3/w):void 0}}var Co=Xs;function qs(t,e){let n=0,i=1e3/e,o,r,s=(u,d=Date.now())=>{n=d,o=null,r&&(clearTimeout(r),r=null),t(...u)};return[(...u)=>{let d=Date.now(),p=d-n;p>=i?s(u,d):(o=u,r||(r=setTimeout(()=>{r=null,s(o)},i-p)))},()=>o&&s(o)]}var To=qs;var ze=(t,e,n=3)=>{let i=0,o=Co(50,250);return To(r=>{let s=r.loaded,a=r.lengthComputable?r.total:void 0,l=s-i,u=o(l),d=s<=a;i=s;let p={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&d?(a-s)/u:void 0,event:r,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(p)},n)},Xn=(t,e)=>{let n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},qn=t=>(...e)=>c.asap(()=>t(...e));var yo=M.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,M.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(M.origin),M.navigator&&/(msie|trident)/i.test(M.navigator.userAgent)):()=>!0;var Oo=M.hasStandardBrowserEnv?{write(t,e,n,i,o,r,s){if(typeof document=="undefined")return;let a=["".concat(t,"=").concat(encodeURIComponent(e))];c.isNumber(n)&&a.push("expires=".concat(new Date(n).toUTCString())),c.isString(i)&&a.push("path=".concat(i)),c.isString(o)&&a.push("domain=".concat(o)),r===!0&&a.push("secure"),c.isString(s)&&a.push("SameSite=".concat(s)),document.cookie=a.join("; ")},read(t){if(typeof document=="undefined")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Jn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Zn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function St(t,e,n){let i=!Jn(e);return t&&(i||n==!1)?Zn(t,e):e}var Ro=t=>t instanceof V?v({},t):t;function re(t,e){e=e||{};let n={};function i(u,d,p,S){return c.isPlainObject(u)&&c.isPlainObject(d)?c.merge.call({caseless:S},u,d):c.isPlainObject(d)?c.merge({},d):c.isArray(d)?d.slice():d}function o(u,d,p,S){if(c.isUndefined(d)){if(!c.isUndefined(u))return i(void 0,u,p,S)}else return i(u,d,p,S)}function r(u,d){if(!c.isUndefined(d))return i(void 0,d)}function s(u,d){if(c.isUndefined(d)){if(!c.isUndefined(u))return i(void 0,u)}else return i(void 0,d)}function a(u,d,p){if(p in e)return i(u,d);if(p in t)return i(void 0,u)}let l={url:r,method:r,data:r,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,d,p)=>o(Ro(u),Ro(d),p,!0)};return c.forEach(Object.keys(v(v({},t),e)),function(d){let p=l[d]||o,S=p(t[d],e[d],d);c.isUndefined(S)&&p!==a||(n[d]=S)}),n}var rn=t=>{let e=re({},t),{data:n,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:r,headers:s,auth:a}=e;if(e.headers=s=V.from(s),e.url=Et(St(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(n)){if(M.hasStandardBrowserEnv||M.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(c.isFunction(n.getHeaders)){let l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([d,p])=>{u.includes(d.toLowerCase())&&s.set(d,p)})}}if(M.hasStandardBrowserEnv&&(i&&c.isFunction(i)&&(i=i(e)),i||i!==!1&&yo(e.url))){let l=o&&r&&Oo.read(r);l&&s.set(o,l)}return e};var Js=typeof XMLHttpRequest!="undefined",vo=Js&&function(t){return new Promise(function(n,i){let o=rn(t),r=o.data,s=V.from(o.headers).normalize(),{responseType:a,onUploadProgress:l,onDownloadProgress:u}=o,d,p,S,w,f;function C(){w&&w(),f&&f(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function R(){if(!b)return;let y=V.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),K={data:!a||a==="text"||a==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:y,config:t,request:b};It(function(W){n(W),C()},function(W){i(W),C()},K),b=null}"onloadend"in b?b.onloadend=R:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(R)},b.onabort=function(){b&&(i(new T("Request aborted",T.ECONNABORTED,t,b)),b=null)},b.onerror=function(N){let K=N&&N.message?N.message:"Network Error",_=new T(K,T.ERR_NETWORK,t,b);_.event=N||null,i(_),b=null},b.ontimeout=function(){let N=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",K=o.transitional||tn;o.timeoutErrorMessage&&(N=o.timeoutErrorMessage),i(new T(N,K.clarifyTimeoutError?T.ETIMEDOUT:T.ECONNABORTED,t,b)),b=null},r===void 0&&s.setContentType(null),"setRequestHeader"in b&&c.forEach(s.toJSON(),function(N,K){b.setRequestHeader(K,N)}),c.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),a&&a!=="json"&&(b.responseType=o.responseType),u&&([S,f]=ze(u,!0),b.addEventListener("progress",S)),l&&b.upload&&([p,w]=ze(l),b.upload.addEventListener("progress",p),b.upload.addEventListener("loadend",w)),(o.cancelToken||o.signal)&&(d=y=>{b&&(i(!y||y.type?new ce(null,t,b):y),b.abort(),b=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));let k=$n(o.url);if(k&&M.protocols.indexOf(k)===-1){i(new T("Unsupported protocol "+k+":",T.ERR_BAD_REQUEST,t));return}b.send(r||null)})};var Zs=(t,e)=>{let{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,o,r=function(u){if(!o){o=!0,a();let d=u instanceof Error?u:this.reason;i.abort(d instanceof T?d:new ce(d instanceof Error?d.message:d))}},s=e&&setTimeout(()=>{s=null,r(new T("timeout ".concat(e," of ms exceeded"),T.ETIMEDOUT))},e),a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(r):u.removeEventListener("abort",r)}),t=null)};t.forEach(u=>u.addEventListener("abort",r));let{signal:l}=i;return l.unsubscribe=()=>c.asap(a),l}},Po=Zs;var Qs=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let i=0,o;for(;i<n;)o=i+e,yield t.slice(i,o),i=o},ea=function(t,e){return On(this,null,function*(){try{for(var n=Bi(ta(t)),i,o,r;i=!(o=yield new ve(n.next())).done;i=!1){let s=o.value;yield*Rn(Qs(s,e))}}catch(o){r=[o]}finally{try{i&&(o=n.return)&&(yield new ve(o.call(n)))}finally{if(r)throw r[0]}}})},ta=function(t){return On(this,null,function*(){if(t[Symbol.asyncIterator]){yield*Rn(t);return}let e=t.getReader();try{for(;;){let{done:n,value:i}=yield new ve(e.read());if(n)break;yield i}}finally{yield new ve(e.cancel())}})},Qn=(t,e,n,i)=>{let o=ea(t,e),r=0,s,a=l=>{s||(s=!0,i&&i(l))};return new ReadableStream({async pull(l){try{let{done:u,value:d}=await o.next();if(u){a(),l.close();return}let p=d.byteLength;if(n){let S=r+=p;n(S)}l.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(l){return a(l),o.return()}},{highWaterMark:2})};var No=64*1024,{isFunction:sn}=c,na=(({Request:t,Response:e})=>({Request:t,Response:e}))(c.global),{ReadableStream:xo,TextEncoder:Lo}=c.global,ko=(t,...e)=>{try{return!!t(...e)}catch(n){return!1}},ia=t=>{t=c.merge.call({skipUndefined:!0},na,t);let{fetch:e,Request:n,Response:i}=t,o=e?sn(e):typeof fetch=="function",r=sn(n),s=sn(i);if(!o)return!1;let a=o&&sn(xo),l=o&&(typeof Lo=="function"?(f=>C=>f.encode(C))(new Lo):async f=>new Uint8Array(await new n(f).arrayBuffer())),u=r&&a&&ko(()=>{let f=!1,C=new n(M.origin,{body:new xo,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!C}),d=s&&a&&ko(()=>c.isReadableStream(new i("").body)),p={stream:d&&(f=>f.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!p[f]&&(p[f]=(C,b)=>{let R=C&&C[f];if(R)return R.call(C);throw new T("Response type '".concat(f,"' is not supported"),T.ERR_NOT_SUPPORT,b)})});let S=async f=>{if(f==null)return 0;if(c.isBlob(f))return f.size;if(c.isSpecCompliantForm(f))return(await new n(M.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(c.isArrayBufferView(f)||c.isArrayBuffer(f))return f.byteLength;if(c.isURLSearchParams(f)&&(f=f+""),c.isString(f))return(await l(f)).byteLength},w=async(f,C)=>{let b=c.toFiniteNumber(f.getContentLength());return b==null?S(C):b};return async f=>{let{url:C,method:b,data:R,signal:k,cancelToken:y,timeout:N,onDownloadProgress:K,onUploadProgress:_,responseType:W,headers:ae,withCredentials:nt="same-origin",fetchOptions:te}=rn(f),Ae=e||fetch;W=W?(W+"").toLowerCase():"text";let j=Po([k,y&&y.toAbortSignal()],N),it=null,Re=j&&j.unsubscribe&&(()=>{j.unsubscribe()}),Pi;try{if(_&&u&&b!=="get"&&b!=="head"&&(Pi=await w(ae,R))!==0){let we=new n(C,{method:"POST",body:R,duplex:"half"}),_e;if(c.isFormData(R)&&(_e=we.headers.get("content-type"))&&ae.setContentType(_e),we.body){let[Tn,Ht]=Xn(Pi,ze(qn(_)));R=Qn(we.body,No,Tn,Ht)}}c.isString(nt)||(nt=nt?"include":"omit");let le=r&&"credentials"in n.prototype,Ni=z(v({},te),{signal:j,method:b.toUpperCase(),headers:ae.normalize().toJSON(),body:R,duplex:"half",credentials:le?nt:void 0});it=r&&new n(C,Ni);let be=await(r?Ae(it,te):Ae(C,Ni)),xi=d&&(W==="stream"||W==="response");if(d&&(K||xi&&Re)){let we={};["status","statusText","headers"].forEach(Li=>{we[Li]=be[Li]});let _e=c.toFiniteNumber(be.headers.get("content-length")),[Tn,Ht]=K&&Xn(_e,ze(qn(K),!0))||[];be=new i(Qn(be.body,No,Tn,()=>{Ht&&Ht(),Re&&Re()}),we)}W=W||"text";let yr=await p[c.findKey(p,W)||"text"](be,f);return!xi&&Re&&Re(),await new Promise((we,_e)=>{It(we,_e,{data:yr,headers:V.from(be.headers),status:be.status,statusText:be.statusText,config:f,request:it})})}catch(le){throw Re&&Re(),le&&le.name==="TypeError"&&/Load failed|fetch/i.test(le.message)?Object.assign(new T("Network Error",T.ERR_NETWORK,f,it),{cause:le.cause||le}):T.from(le,le&&le.code,f,it)}}},oa=new Map,ei=t=>{let e=t&&t.env||{},{fetch:n,Request:i,Response:o}=e,r=[i,o,n],s=r.length,a=s,l,u,d=oa;for(;a--;)l=r[a],u=d.get(l),u===void 0&&d.set(l,u=a?new Map:ia(e)),d=u;return u},Eu=ei();var ti={http:Qt,xhr:vo,fetch:{get:ei}};c.forEach(ti,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(n){}Object.defineProperty(t,"adapterName",{value:e})}});var _o=t=>"- ".concat(t),sa=t=>c.isFunction(t)||t===null||t===!1;function aa(t,e){t=c.isArray(t)?t:[t];let{length:n}=t,i,o,r={};for(let s=0;s<n;s++){i=t[s];let a;if(o=i,!sa(i)&&(o=ti[(a=String(i)).toLowerCase()],o===void 0))throw new T("Unknown adapter '".concat(a,"'"));if(o&&(c.isFunction(o)||(o=o.get(e))))break;r[a||"#"+s]=o}if(!o){let s=Object.entries(r).map(([l,u])=>"adapter ".concat(l," ")+(u===!1?"is not supported by the environment":"is not available in the build")),a=n?s.length>1?"since :\n"+s.map(_o).join("\n"):" "+_o(s[0]):"as no adapter specified";throw new T("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}var an={getAdapter:aa,adapters:ti};function ni(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ce(null,t)}function ln(t){return ni(t),t.headers=V.from(t.headers),t.data=bt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),an.getAdapter(t.adapter||Ke.adapter,t)(t).then(function(i){return ni(t),i.data=bt.call(t,t.transformResponse,i),i.headers=V.from(i.headers),i},function(i){return wt(i)||(ni(t),i&&i.response&&(i.response.data=bt.call(t,t.transformResponse,i.response),i.response.headers=V.from(i.response.headers))),Promise.reject(i)})}var cn="1.13.2";var un={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{un[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});var Do={};un.transitional=function(e,n,i){function o(r,s){return"[Axios v"+cn+"] Transitional option '"+r+"'"+s+(i?". "+i:"")}return(r,s,a)=>{if(e===!1)throw new T(o(s," has been removed"+(n?" in "+n:"")),T.ERR_DEPRECATED);return n&&!Do[s]&&(Do[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(r,s,a):!0}};un.spelling=function(e){return(n,i)=>(console.warn("".concat(i," is likely a misspelling of ").concat(e)),!0)};function la(t,e,n){if(typeof t!="object")throw new T("options must be an object",T.ERR_BAD_OPTION_VALUE);let i=Object.keys(t),o=i.length;for(;o-- >0;){let r=i[o],s=e[r];if(s){let a=t[r],l=a===void 0||s(a,r,t);if(l!==!0)throw new T("option "+r+" must be "+l,T.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new T("Unknown option "+r,T.ERR_BAD_OPTION)}}var Ct={assertOptions:la,validators:un};var ue=Ct.validators,Ye=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Gn,response:new Gn}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;let r=o.stack?o.stack.replace(/^.+\n/,""):"";try{i.stack?r&&!String(i.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(i.stack+="\n"+r):i.stack=r}catch(s){}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=re(this.defaults,n);let{transitional:i,paramsSerializer:o,headers:r}=n;i!==void 0&&Ct.assertOptions(i,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean)},!1),o!=null&&(c.isFunction(o)?n.paramsSerializer={serialize:o}:Ct.assertOptions(o,{encode:ue.function,serialize:ue.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Ct.assertOptions(n,{baseUrl:ue.spelling("baseURL"),withXsrfToken:ue.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=r&&c.merge(r.common,r[n.method]);r&&c.forEach(["delete","get","head","post","put","patch","common"],f=>{delete r[f]}),n.headers=V.concat(s,r);let a=[],l=!0;this.interceptors.request.forEach(function(C){typeof C.runWhen=="function"&&C.runWhen(n)===!1||(l=l&&C.synchronous,a.unshift(C.fulfilled,C.rejected))});let u=[];this.interceptors.response.forEach(function(C){u.push(C.fulfilled,C.rejected)});let d,p=0,S;if(!l){let f=[ln.bind(this),void 0];for(f.unshift(...a),f.push(...u),S=f.length,d=Promise.resolve(n);p<S;)d=d.then(f[p++],f[p++]);return d}S=a.length;let w=n;for(;p<S;){let f=a[p++],C=a[p++];try{w=f(w)}catch(b){C.call(this,b);break}}try{d=ln.call(this,w)}catch(f){return Promise.reject(f)}for(p=0,S=u.length;p<S;)d=d.then(u[p++],u[p++]);return d}getUri(e){e=re(this.defaults,e);let n=St(e.baseURL,e.url,e.allowAbsoluteUrls);return Et(n,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){Ye.prototype[e]=function(n,i){return this.request(re(i||{},{method:e,url:n,data:(i||{}).data}))}});c.forEach(["post","put","patch"],function(e){function n(i){return function(r,s,a){return this.request(re(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:r,data:s}))}}Ye.prototype[e]=n(),Ye.prototype[e+"Form"]=n(!0)});var Tt=Ye;var ii=class t{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});let i=this;this.promise.then(o=>{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](o);i._listeners=null}),this.promise.then=o=>{let r,s=new Promise(a=>{i.subscribe(a),r=a}).then(o);return s.cancel=function(){i.unsubscribe(r)},s},e(function(r,s,a){i.reason||(i.reason=new ce(r,s,a),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){let e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new t(function(o){e=o}),cancel:e}}},Bo=ii;function oi(t){return function(n){return t.apply(null,n)}}function ri(t){return c.isObject(t)&&t.isAxiosError===!0}var si={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(si).forEach(([t,e])=>{si[e]=t});var Mo=si;function Uo(t){let e=new Tt(t),n=pt(Tt.prototype.request,e);return c.extend(n,Tt.prototype,e,{allOwnKeys:!0}),c.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return Uo(re(t,o))},n}var H=Uo(Ke);H.Axios=Tt;H.CanceledError=ce;H.CancelToken=Bo;H.isCancel=wt;H.VERSION=cn;H.toFormData=Se;H.AxiosError=T;H.Cancel=H.CanceledError;H.all=function(e){return Promise.all(e)};H.spread=oi;H.isAxiosError=ri;H.mergeConfig=re;H.AxiosHeaders=V;H.formToJSON=t=>nn(c.isHTMLForm(t)?new FormData(t):t);H.getAdapter=an.getAdapter;H.HttpStatusCode=Mo;H.default=H;var dn=H;var{Axios:md,AxiosError:hd,CanceledError:Ed,isCancel:Ad,CancelToken:bd,VERSION:wd,all:Id,Cancel:Sd,isAxiosError:Cd,spread:Td,toFormData:yd,AxiosHeaders:Od,HttpStatusCode:Rd,formToJSON:vd,getAdapter:Pd,mergeConfig:Nd}=dn;var yt=class{constructor(e){this.currentToken=null;this.tokenProvider=null;this.requestHistory=new Map;this.WINDOW_MS=5e3;this.MAX_REQUESTS=30;this.axios=dn.create({baseURL:e.baseURL,timeout:e.timeout||6e4,headers:v({"Content-Type":"application/json"},e.headers)}),typeof setInterval!="undefined"&&setInterval(()=>this.cleanupHistory(),1e4),this.axios.interceptors.request.use(async n=>{var i,o;if(n.url)try{this.checkRequestLimit("".concat((i=n.method)==null?void 0:i.toUpperCase(),":").concat(n.url))}catch(r){return console.error("[SDK] \u{1F6D1} Request blocked by Circuit Breaker:",r),Promise.reject(r)}if(!n.skipAuth&&!this.currentToken&&this.tokenProvider)try{console.log("[SDK] Waiting for token...");let r=await this.tokenProvider();r&&(this.updateToken(r),n.headers["x-cms-token"]=r)}catch(r){console.error("[SDK] Failed to get token from provider:",r)}return!n.skipAuth&&this.currentToken&&(n.headers["x-cms-token"]=this.currentToken),console.log("[SDK] Making ".concat((o=n.method)==null?void 0:o.toUpperCase()," request to: ").concat(n.baseURL||"").concat(n.url)),n},n=>(console.error("[SDK] Request error:",n),Promise.reject(n instanceof Error?n:new Error(String(n))))),this.axios.interceptors.response.use(n=>n,n=>(console.error("[SDK] Response error:",n.message),Promise.reject(n instanceof Error?n:new Error(String(n)))))}setTokenProvider(e){this.tokenProvider=e}async get(e,n){return(await this.axios.get(e,n)).data}async post(e,n,i){return(await this.axios.post(e,n,i)).data}async put(e,n,i){return(await this.axios.put(e,n,i)).data}async patch(e,n,i){return(await this.axios.patch(e,n,i)).data}async delete(e,n){return(await this.axios.delete(e,n)).data}setHeader(e,n){this.axios.defaults.headers.common[e]=n}removeHeader(e){delete this.axios.defaults.headers.common[e]}updateToken(e){this.currentToken=e,e?this.setHeader("x-cms-token",e):(this.removeHeader("x-cms-token"),console.log("[SDK] Token removed from ApiClient"))}getCurrentToken(){return this.currentToken}updateConfig(e){e.baseURL&&(this.axios.defaults.baseURL=e.baseURL),e.timeout&&(this.axios.defaults.timeout=e.timeout),e.headers&&Object.assign(this.axios.defaults.headers.common,e.headers),console.log("[SDK] ApiClient configuration updated")}checkRequestLimit(e){let n=Date.now(),i=this.requestHistory.get(e);if(!i){this.requestHistory.set(e,{count:1,firstRequestTime:n});return}if(n-i.firstRequestTime>this.WINDOW_MS){this.requestHistory.set(e,{count:1,firstRequestTime:n});return}if(i.count++,i.count>this.MAX_REQUESTS){let o=new Error("Circuit Breaker: Too many requests to ".concat(e," (").concat(i.count," in ").concat(this.WINDOW_MS,"ms)"));throw o.isCircuitBreaker=!0,o}}cleanupHistory(){let e=Date.now();for(let[n,i]of this.requestHistory.entries())e-i.firstRequestTime>this.WINDOW_MS&&this.requestHistory.delete(n)}};var ca="2.0.6",ua=500,Fo="user-agent",Ze="",Ho="?",U={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},J="browser",ge="cpu",pe="device",se="engine",Q="os",qe="result",h="name",g="type",E="vendor",A="version",$="architecture",_t="major",m="model",Lt="console",O="mobile",x="tablet",G="smarttv",de="wearable",fn="xr",kt="embedded",je="inapp",wi="brands",Le="formFactors",Ii="fullVersionList",Je="platform",Si="platformVersion",bn="bitness",Oe="sec-ch-ua",da=Oe+"-full-version-list",fa=Oe+"-arch",pa=Oe+"-"+bn,ga=Oe+"-form-factors",ma=Oe+"-"+O,ha=Oe+"-"+m,er=Oe+"-"+Je,Ea=er+"-version",tr=[wi,Ii,O,m,Je,Si,$,Le,bn],pn="Amazon",$e="Apple",Go="ASUS",Vo="BlackBerry",xe="Google",Ko="Huawei",ai="Lenovo",Wo="Honor",gn="LG",li="Microsoft",ci="Motorola",ui="Nvidia",zo="OnePlus",di="OPPO",Ot="Samsung",Yo="Sharp",Rt="Sony",fi="Xiaomi",pi="Zebra",jo="Chrome",$o="Chromium",Ce="Chromecast",hn="Edge",vt="Firefox",Pt="Opera",gi="Facebook",Xo="Sogou",Xe="Mobile ",Nt=" Browser",Ai="Windows",Aa=typeof window!==U.UNDEFINED,Z=Aa&&window.navigator?window.navigator:void 0,Te=Z&&Z.userAgentData?Z.userAgentData:void 0,ba=function(t,e){var n={},i=e;if(!En(e)){i={};for(var o in e)for(var r in e[o])i[r]=e[o][r].concat(i[r]?i[r]:[])}for(var s in t)n[s]=i[s]&&i[s].length%2===0?i[s].concat(t[s]):t[s];return n},wn=function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e},bi=function(t,e){if(typeof t===U.OBJECT&&t.length>0){for(var n in t)if(ye(e)==ye(t[n]))return!0;return!1}return Dt(t)?ye(e)==ye(t):!1},En=function(t,e){for(var n in t)return/^(browser|cpu|device|engine|os)$/.test(n)||(e?En(t[n]):!1)},Dt=function(t){return typeof t===U.STRING},mi=function(t){if(t){for(var e=[],n=Qe(/\\?\"/g,t).split(","),i=0;i<n.length;i++)if(n[i].indexOf(";")>-1){var o=An(n[i]).split(";v=");e[i]={brand:o[0],version:o[1]}}else e[i]=An(n[i]);return e}},ye=function(t){return Dt(t)?t.toLowerCase():t},hi=function(t){return Dt(t)?Qe(/[^\d\.]/g,t).split(".")[0]:void 0},me=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];typeof n==U.OBJECT&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},Qe=function(t,e){return Dt(e)?e.replace(t,Ze):e},xt=function(t){return Qe(/\\?\"/g,t)},An=function(t,e){return t=Qe(/^\s\s*/,String(t)),typeof e===U.UNDEFINED?t:t.substring(0,e)},Ei=function(t,e){if(!(!t||!e))for(var n=0,i,o,r,s,a,l;n<e.length&&!a;){var u=e[n],d=e[n+1];for(i=o=0;i<u.length&&!a&&u[i];)if(a=u[i++].exec(t),a)for(r=0;r<d.length;r++)l=a[++o],s=d[r],typeof s===U.OBJECT&&s.length>0?s.length===2?typeof s[1]==U.FUNCTION?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===U.FUNCTION&&!(s[1].exec&&s[1].test)?s.length>3?this[s[0]]=l?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=l?s[1].call(this,l,s[2]):void 0:s.length==3?this[s[0]]=l?l.replace(s[1],s[2]):void 0:s.length==4?this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=l?s[3].apply(this,[l.replace(s[1],s[2])].concat(s.slice(4))):void 0)):this[s]=l||void 0;n+=2}},fe=function(t,e){for(var n in e)if(typeof e[n]===U.OBJECT&&e[n].length>0){for(var i=0;i<e[n].length;i++)if(bi(e[n][i],t))return n===Ho?void 0:n}else if(bi(e[n],t))return n===Ho?void 0:n;return e.hasOwnProperty("*")?e["*"]:t},qo={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},Jo={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},wa={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Zo={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[A,[h,Xe+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[A,[h,hn+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[A,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,A],[/opios[\/ ]+([\w\.]+)/i],[A,[h,Pt+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[A,[h,Pt+" GX"]],[/\bopr\/([\w\.]+)/i],[A,[h,Pt]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[A,[h,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[A,[h,"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|otter|dooble|(?:lg |qute)browser|palemoon)\/([-\w\.]+)/i,/(heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[h,A],[/quark(?:pc)?\/([-\w\.]+)/i],[A,[h,"Quark"]],[/\bddg\/([\w\.]+)/i],[A,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[A,[h,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[A,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[A,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[A,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[A,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[A,[h,"Smart "+ai+Nt]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure"+Nt],A],[/\bfocus\/([\w\.]+)/i],[A,[h,vt+" Focus"]],[/\bopt\/([\w\.]+)/i],[A,[h,Pt+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[A,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[A,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[A,[h,Pt+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[A,[h,"MIUI"+Nt]],[/fxios\/([\w\.-]+)/i],[A,[h,Xe+vt]],[/\bqihoobrowser\/?([\w\.]*)/i],[A,[h,"360"]],[/\b(qq)\/([\w\.]+)/i],[[h,/(.+)/,"$1Browser"],A],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1"+Nt],A],[/samsungbrowser\/([\w\.]+)/i],[A,[h,Ot+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[A,[h,Xo+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,Xo+" Mobile"],A],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[h,A],[/(lbbrowser|rekonq)/i],[h],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[A,h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,gi],A,[g,je]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[h,A,[g,je]],[/\bgsa\/([\w\.]+) .*safari\//i],[A,[h,"GSA"],[g,je]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[A,[h,"TikTok"],[g,je]],[/\[(linkedin)app\]/i],[h,[g,je]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[h,/(.+)/,"Zalo"],A,[g,je]],[/(chromium)[\/ ]([-\w\.]+)/i],[h,A],[/headlesschrome(?:\/([\w\.]+)| )/i],[A,[h,jo+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[A,[h,hn+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,jo+" WebView"],A],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[A,[h,"Android"+Nt]],[/chrome\/([\w\.]+) mobile/i],[A,[h,Xe+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,A],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[A,[h,Xe+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[h,Xe+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[A,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[A,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[h,A],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[h,Xe+vt],A],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],A],[/(wolvic|librewolf)\/([\w\.]+)/i],[h,A],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[A,[h,vt+" 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|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[h,[A,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[h,[A,/[^\d\.]+./,Ze]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[$,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[$,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[$,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[$,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[$,"arm"]],[/ sun4\w[;\)]/i],[[$,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[$,/ower/,Ze,ye]],[/mc680.0/i],[[$,"68k"]],[/winnt.+\[axp/i],[[$,"alpha"]]],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],[m,[E,Ot],[g,x]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[m,[E,Ot],[g,O]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[m,[E,$e],[g,O]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[m,[E,$e],[g,x]],[/(macintosh);/i],[m,[E,$e]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[m,[E,Yo],[g,O]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[m,[E,Wo],[g,x]],[/honor([-\w ]+)[;\)]/i],[m,[E,Wo],[g,O]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[m,[E,Ko],[g,x]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[m,[E,Ko],[g,O]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[m,/_/g," "],[E,fi],[g,x]],[/\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|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[m,/_/g," "],[E,fi],[g,O]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[m,[E,zo],[g,O]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[m,[E,di],[g,O]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[m,[E,fe,{OnePlus:["203","304","403","404","413","415"],"*":di}],[g,x]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[m,[E,"BLU"],[g,O]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[m,[E,"Vivo"],[g,O]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[m,[E,"Realme"],[g,O]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[m,[E,ai],[g,x]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[m,[E,ai],[g,O]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[m,[E,ci],[g,O]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[m,[E,ci],[g,x]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[m,[E,gn],[g,x]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[m,[E,gn],[g,O]],[/(nokia) (t[12][01])/i],[E,m,[g,x]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[m,/_/g," "],[g,O],[E,"Nokia"]],[/(pixel (c|tablet))\b/i],[m,[E,xe],[g,x]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[m,[E,xe],[g,O]],[/(google) (pixelbook( go)?)/i],[E,m],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[m,[E,Rt],[g,O]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[m,"Xperia Tablet"],[E,Rt],[g,x]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[m,[E,pn],[g,x]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[m,/(.+)/g,"Fire Phone $1"],[E,pn],[g,O]],[/(playbook);[-\w\),; ]+(rim)/i],[m,E,[g,x]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[m,[E,Vo],[g,O]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[m,[E,Go],[g,x]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[m,[E,Go],[g,O]],[/(nexus 9)/i],[m,[E,"HTC"],[g,x]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[E,[m,/_/g," "],[g,O]],[/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],[m,[E,"TCL"],[g,x]],[/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],[m,[E,"TCL"],[g,O]],[/(itel) ((\w+))/i],[[E,ye],m,[g,fe,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[m,[E,"Acer"],[g,x]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[m,[E,"Meizu"],[g,O]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[m,[E,"Ulefone"],[g,O]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[m,[E,"Energizer"],[g,O]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[m,[E,"Cat"],[g,O]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[m,[E,"Smartfren"],[g,O]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[m,[E,"Nothing"],[g,O]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[m,[E,"Archos"],[g,x]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[m,[E,"Archos"],[g,O]],[/; (n159v)/i],[m,[E,"HMD"],[g,O]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[E,m,[g,x]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[E,m,[g,O]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[E,m,[g,x]],[/(surface duo)/i],[m,[E,li],[g,x]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[m,[E,"Fairphone"],[g,O]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[m,[E,ui],[g,x]],[/(sprint) (\w+)/i],[E,m,[g,O]],[/(kin\.[onetw]{3})/i],[[m,/\./g," "],[E,li],[g,O]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[m,[E,pi],[g,x]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[m,[E,pi],[g,O]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[E,[g,G]],[/hbbtv.+maple;(\d+)/i],[[m,/^/,"SmartTV"],[E,Ot],[g,G]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[E,m,[g,G]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[E,gn],[g,G]],[/(apple) ?tv/i],[E,[m,$e+" TV"],[g,G]],[/crkey.*devicetype\/chromecast/i],[[m,Ce+" Third Generation"],[E,xe],[g,G]],[/crkey.*devicetype\/([^/]*)/i],[[m,/^/,"Chromecast "],[E,xe],[g,G]],[/fuchsia.*crkey/i],[[m,Ce+" Nest Hub"],[E,xe],[g,G]],[/crkey/i],[[m,Ce],[E,xe],[g,G]],[/(portaltv)/i],[m,[E,gi],[g,G]],[/droid.+aft(\w+)( bui|\))/i],[m,[E,pn],[g,G]],[/(shield \w+ tv)/i],[m,[E,ui],[g,G]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[m,[E,Yo],[g,G]],[/(bravia[\w ]+)( bui|\))/i],[m,[E,Rt],[g,G]],[/(mi(tv|box)-?\w+) bui/i],[m,[E,fi],[g,G]],[/Hbbtv.*(technisat) (.*);/i],[E,m,[g,G]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[E,/.+\/(\w+)/,"$1",fe,{LG:"lge"}],[m,An],[g,G]],[/(playstation \w+)/i],[m,[E,Rt],[g,Lt]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[m,[E,li],[g,Lt]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[E,m,[g,Lt]],[/droid.+; (shield)( bui|\))/i],[m,[E,ui],[g,Lt]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[m,[E,Ot],[g,de]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[E,m,[g,de]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[m,[E,di],[g,de]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[m,[E,$e],[g,de]],[/(opwwe\d{3})/i],[m,[E,zo],[g,de]],[/(moto 360)/i],[m,[E,ci],[g,de]],[/(smartwatch 3)/i],[m,[E,Rt],[g,de]],[/(g watch r)/i],[m,[E,gn],[g,de]],[/droid.+; (wt63?0{2,3})\)/i],[m,[E,pi],[g,de]],[/droid.+; (glass) \d/i],[m,[E,xe],[g,fn]],[/(pico) ([\w ]+) os\d/i],[E,m,[g,fn]],[/(quest( \d| pro)?s?).+vr/i],[m,[E,gi],[g,fn]],[/mobile vr; rv.+firefox/i],[[g,fn]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[E,[g,kt]],[/(aeobc)\b/i],[m,[E,pn],[g,kt]],[/(homepod).+mac os/i],[m,[E,$e],[g,kt]],[/windows iot/i],[[g,kt]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[m,[g,G]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[g,G]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[m,[g,fe,{mobile:"Mobile",xr:"VR","*":x}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[g,x]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[g,O]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[m,[E,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[A,[h,hn+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[h,A],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[A,[h,"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],[h,A],[/ladybird\//i],[[h,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[A,h]],os:[[/(windows nt) (6\.[23]); arm/i],[[h,/N/,"R"],[A,fe,qo]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[h,A],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[A,/(;|\))/g,"",fe,qo],[h,Ai]],[/(windows ce)\/?([\d\.]*)/i],[h,A],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[A,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[h,"macOS"],[A,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[A,[h,Ce+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[A,[h,Ce+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[A,[h,Ce+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[A,[h,Ce+" Linux"]],[/crkey\/([\d\.]+)/i],[A,[h,Ce]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[A,h],[/(ubuntu) ([\w\.]+) like android/i],[[h,/(.+)/,"$1 Touch"],A],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[h,A],[/\(bb(10);/i],[A,[h,Vo]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[A,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[A,[h,vt+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[A,[h,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[A,fe,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[A,[h,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,"Chrome OS"],A],[/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,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[h,A],[/(sunos) ?([\d\.]*)/i],[[h,"Solaris"],A],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,A]]},mn=function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return me.call(t.init,[[J,[h,A,_t,g]],[ge,[$]],[pe,[g,m,E]],[se,[h,A]],[Q,[h,A]]]),me.call(t.isIgnore,[[J,[A,_t]],[se,[A]],[Q,[A]]]),me.call(t.isIgnoreRgx,[[J,/ ?browser$/i],[Q,/ ?os$/i]]),me.call(t.toString,[[J,[h,A]],[ge,[$]],[pe,[E,m]],[se,[h,A]],[Q,[h,A]]]),t}(),Ia=function(t,e){var n=mn.init[e],i=mn.isIgnore[e]||0,o=mn.isIgnoreRgx[e]||0,r=mn.toString[e]||0;function s(){me.call(this,n)}return s.prototype.getItem=function(){return t},s.prototype.withClientHints=function(){return Te?Te.getHighEntropyValues(tr).then(function(a){return t.setCH(new nr(a,!1)).parseCH().get()}):t.parseCH().get()},s.prototype.withFeatureCheck=function(){return t.detectFeature().get()},e!=qe&&(s.prototype.is=function(a){var l=!1;for(var u in this)if(this.hasOwnProperty(u)&&!bi(i,u)&&ye(o?Qe(o,this[u]):this[u])==ye(o?Qe(o,a):a)){if(l=!0,a!=U.UNDEFINED)break}else if(a==U.UNDEFINED&&l){l=!l;break}return l},s.prototype.toString=function(){var a=Ze;for(var l in r)typeof this[r[l]]!==U.UNDEFINED&&(a+=(a?" ":Ze)+this[r[l]]);return a||U.UNDEFINED}),Te||(s.prototype.then=function(a){var l=this,u=function(){for(var p in l)l.hasOwnProperty(p)&&(this[p]=l[p])};u.prototype={is:s.prototype.is,toString:s.prototype.toString};var d=new u;return a(d),d}),new s};function nr(t,e){if(t=t||{},me.call(this,tr),e)me.call(this,[[wi,mi(t[Oe])],[Ii,mi(t[da])],[O,/\?1/.test(t[ma])],[m,xt(t[ha])],[Je,xt(t[er])],[Si,xt(t[Ea])],[$,xt(t[fa])],[Le,mi(t[ga])],[bn,xt(t[pa])]]);else for(var n in t)this.hasOwnProperty(n)&&typeof t[n]!==U.UNDEFINED&&(this[n]=t[n])}function Qo(t,e,n,i){return this.get=function(o){return o?this.data.hasOwnProperty(o)?this.data[o]:void 0:this.data},this.set=function(o,r){return this.data[o]=r,this},this.setCH=function(o){return this.uaCH=o,this},this.detectFeature=function(){if(Z&&Z.userAgent==this.ua)switch(this.itemType){case J:Z.brave&&typeof Z.brave.isBrave==U.FUNCTION&&this.set(h,"Brave");break;case pe:!this.get(g)&&Te&&Te[O]&&this.set(g,O),this.get(m)=="Macintosh"&&Z&&typeof Z.standalone!==U.UNDEFINED&&Z.maxTouchPoints&&Z.maxTouchPoints>2&&this.set(m,"iPad").set(g,x);break;case Q:!this.get(h)&&Te&&Te[Je]&&this.set(h,Te[Je]);break;case qe:var o=this.data,r=function(s){return o[s].getItem().detectFeature().get()};this.set(J,r(J)).set(ge,r(ge)).set(pe,r(pe)).set(se,r(se)).set(Q,r(Q))}return this},this.parseUA=function(){switch(this.itemType!=qe&&Ei.call(this.data,this.ua,this.rgxMap),this.itemType){case J:this.set(_t,hi(this.get(A)));break;case Q:if(this.get(h)=="iOS"&&this.get(A)=="18.6"){var o=/\) Version\/([\d\.]+)/.exec(this.ua);o&&parseInt(o[1].substring(0,2),10)>=26&&this.set(A,o[1])}break}return this},this.parseCH=function(){var o=this.uaCH,r=this.rgxMap;switch(this.itemType){case J:case se:var s=o[Ii]||o[wi],a;if(s)for(var l=0;l<s.length;l++){var u=s[l].brand||s[l],d=s[l].version;this.itemType==J&&!/not.a.brand/i.test(u)&&(!a||/Chrom/.test(a)&&u!=$o||a==hn&&/WebView2/.test(u))&&(u=fe(u,wa),a=this.get(h),a&&!/Chrom/.test(a)&&/Chrom/.test(u)||this.set(h,u).set(A,d).set(_t,hi(d)),a=u),this.itemType==se&&u==$o&&this.set(A,d)}break;case ge:var p=o[$];p&&(p&&o[bn]=="64"&&(p+="64"),Ei.call(this.data,p+";",r));break;case pe:if(o[O]&&this.set(g,O),o[m]&&(this.set(m,o[m]),!this.get(g)||!this.get(E))){var S={};Ei.call(S,"droid 9; "+o[m]+")",r),!this.get(g)&&S.type&&this.set(g,S.type),!this.get(E)&&S.vendor&&this.set(E,S.vendor)}if(o[Le]){var w;if(typeof o[Le]!="string")for(var f=0;!w&&f<o[Le].length;)w=fe(o[Le][f++],Jo);else w=fe(o[Le],Jo);this.set(g,w)}break;case Q:var C=o[Je];if(C){var b=o[Si];C==Ai&&(b=parseInt(hi(b),10)>=13?"11":"10"),this.set(h,C).set(A,b)}this.get(h)==Ai&&o[m]=="Xbox"&&this.set(h,"Xbox").set(A,void 0);break;case qe:var R=this.data,k=function(y){return R[y].getItem().setCH(o).parseCH().get()};this.set(J,k(J)).set(ge,k(ge)).set(pe,k(pe)).set(se,k(se)).set(Q,k(Q))}return this},me.call(this,[["itemType",t],["ua",e],["uaCH",i],["rgxMap",n],["data",Ia(this,t)]]),this}function ee(t,e,n){if(typeof t===U.OBJECT?(En(t,!0)?(typeof e===U.OBJECT&&(n=e),e=t):(n=t,e=void 0),t=void 0):typeof t===U.STRING&&!En(e,!0)&&(n=e,e=void 0),n)if(typeof n.append===U.FUNCTION){var i={};n.forEach(function(d,p){i[String(p).toLowerCase()]=d}),n=i}else{var o={};for(var r in n)n.hasOwnProperty(r)&&(o[String(r).toLowerCase()]=n[r]);n=o}if(!(this instanceof ee))return new ee(t,e,n).getResult();var s=typeof t===U.STRING?t:n&&n[Fo]?n[Fo]:Z&&Z.userAgent?Z.userAgent:Ze,a=new nr(n,!0),l=e?ba(Zo,e):Zo,u=function(d){return d==qe?function(){return new Qo(d,s,l,a).set("ua",s).set(J,this.getBrowser()).set(ge,this.getCPU()).set(pe,this.getDevice()).set(se,this.getEngine()).set(Q,this.getOS()).get()}:function(){return new Qo(d,s,l[d],a).parseUA().get()}};return me.call(this,[["getBrowser",u(J)],["getCPU",u(ge)],["getDevice",u(pe)],["getEngine",u(se)],["getOS",u(Q)],["getResult",u(qe)],["getUA",function(){return s}],["setUA",function(d){return Dt(d)&&(s=An(d,ua)),this}]]).setUA(s),this}ee.VERSION=ca;ee.BROWSER=wn([h,A,_t,g]);ee.CPU=wn([$]);ee.DEVICE=wn([m,E,g,Lt,O,G,x,de,kt]);ee.ENGINE=ee.OS=wn([h,A]);var Fd=Object.freeze({115:"115",2345:"2345",360:"360",ALIPAY:"Alipay",AMAYA:"Amaya",ANDROID:"Android Browser",ARORA:"Arora",AVANT:"Avant",AVAST:"Avast Secure Browser",AVG:"AVG Secure Browser",BAIDU:"Baidu Browser",BASILISK:"Basilisk",BING:"Bing",BLAZER:"Blazer",BOLT:"Bolt",BOWSER:"Bowser",BRAVE:"Brave",CAMINO:"Camino",CHIMERA:"Chimera",CHROME:"Chrome",CHROME_HEADLESS:"Chrome Headless",CHROME_MOBILE:"Mobile Chrome",CHROME_WEBVIEW:"Chrome WebView",CHROMIUM:"Chromium",COBALT:"Cobalt",COC_COC:"Coc Coc",CONKEROR:"Conkeror",DAUM:"Daum",DILLO:"Dillo",DOLPHIN:"Dolphin",DOOBLE:"Dooble",DORIS:"Doris",DRAGON:"Dragon",DUCKDUCKGO:"DuckDuckGo",ECOSIA:"Ecosia",EDGE:"Edge",EDGE_WEBVIEW:"Edge WebView",EDGE_WEBVIEW2:"Edge WebView2",EPIPHANY:"Epiphany",FACEBOOK:"Facebook",FALKON:"Falkon",FIREBIRD:"Firebird",FIREFOX:"Firefox",FIREFOX_FOCUS:"Firefox Focus",FIREFOX_MOBILE:"Mobile Firefox",FIREFOX_REALITY:"Firefox Reality",FENNEC:"Fennec",FLOCK:"Flock",FLOW:"Flow",GO:"GoBrowser",GOOGLE_SEARCH:"GSA",HELIO:"Helio",HEYTAP:"HeyTap",HONOR:"Honor",HUAWEI:"Huawei Browser",ICAB:"iCab",ICE:"ICE Browser",ICEAPE:"IceApe",ICECAT:"IceCat",ICEDRAGON:"IceDragon",ICEWEASEL:"IceWeasel",IE:"IE",INSTAGRAM:"Instagram",IRIDIUM:"Iridium",IRON:"Iron",JASMINE:"Jasmine",KONQUEROR:"Konqueror",KAKAO:"KakaoTalk",KHTML:"KHTML",K_MELEON:"K-Meleon",KLAR:"Klar",KLARNA:"Klarna",KINDLE:"Kindle",LENOVO:"Smart Lenovo Browser",LADYBIRD:"Ladybird",LG:"LG Browser",LIBREWOLF:"LibreWolf",LIEBAO:"LBBROWSER",LINE:"Line",LINKEDIN:"LinkedIn",LINKS:"Links",LUNASCAPE:"Lunascape",LYNX:"Lynx",MAEMO:"Maemo Browser",MAXTHON:"Maxthon",MIDORI:"Midori",MINIMO:"Minimo",MIUI:"MIUI Browser",MOZILLA:"Mozilla",MOSAIC:"Mosaic",NAVER:"Naver",NETFRONT:"NetFront",NETSCAPE:"Netscape",NETSURF:"Netsurf",NOKIA:"Nokia Browser",OBIGO:"Obigo",OCULUS:"Oculus Browser",OMNIWEB:"OmniWeb",OPERA:"Opera",OPERA_COAST:"Opera Coast",OPERA_GX:"Opera GX",OPERA_MINI:"Opera Mini",OPERA_MOBI:"Opera Mobi",OPERA_TABLET:"Opera Tablet",OPERA_TOUCH:"Opera Touch",OTTER:"Otter",OVI:"OviBrowser",PALEMOON:"PaleMoon",PHANTOMJS:"PhantomJS",PHOENIX:"Phoenix",PICOBROWSER:"Pico Browser",POLARIS:"Polaris",PUFFIN:"Puffin",QQ:"QQBrowser",QQ_LITE:"QQBrowserLite",QUARK:"Quark",QUPZILLA:"QupZilla",QUTEBROWSER:"qutebrowser",QWANT:"Qwant",REKONQ:"rekonq",ROCKMELT:"Rockmelt",SAFARI:"Safari",SAFARI_MOBILE:"Mobile Safari",SAILFISH:"Sailfish Browser",SAMSUNG:"Samsung Internet",SEAMONKEY:"SeaMonkey",SILK:"Silk",SKYFIRE:"Skyfire",SLEIPNIR:"Sleipnir",SLIMBOAT:"SlimBoat",SLIMBROWSER:"SlimBrowser",SLIMJET:"Slimjet",SNAPCHAT:"Snapchat",SOGOU_EXPLORER:"Sogou Explorer",SOGOU_MOBILE:"Sogou Mobile",SURF:"Surf",SWIFTFOX:"Swiftfox",TESLA:"Tesla",TIKTOK:"TikTok",TIZEN:"Tizen Browser",TWITTER:"Twitter",UC:"UCBrowser",UP:"UP.Browser",VIVALDI:"Vivaldi",VIVO:"Vivo Browser",W3M:"w3m",WATERFOX:"Waterfox",WEBKIT:"WebKit",WECHAT:"WeChat",WEIBO:"Weibo",WHALE:"Whale",WOLVIC:"Wolvic",YANDEX:"Yandex",ZALO:"Zalo"});var Bt=Object.freeze({CRAWLER:"crawler",CLI:"cli",EMAIL:"email",FETCHER:"fetcher",INAPP:"inapp",MEDIAPLAYER:"mediaplayer",LIBRARY:"library"}),ir=Object.freeze({"68K":"68k",ALPHA:"alpha",ARM:"arm",ARM_64:"arm64",ARM_HF:"armhf",AVR:"avr",AVR_32:"avr32",IA64:"ia64",IRIX:"irix",IRIX_64:"irix64",MIPS:"mips",MIPS_64:"mips64",PA_RISC:"pa-risc",PPC:"ppc",SPARC:"sparc",SPARC_64:"sparc64",X86:"ia32",X86_64:"amd64"});var Hd=Object.freeze({CONSOLE:"console",DESKTOP:"desktop",EMBEDDED:"embedded",MOBILE:"mobile",SMARTTV:"smarttv",TABLET:"tablet",WEARABLE:"wearable",XR:"xr"});var Gd=Object.freeze({ACER:"Acer",ADVAN:"Advan",ALCATEL:"Alcatel",APPLE:"Apple",AMAZON:"Amazon",ARCHOS:"Archos",ASUS:"ASUS",ATT:"AT&T",BENQ:"BenQ",BLACKBERRY:"BlackBerry",BLU:"BLU",CAT:"Cat",DELL:"Dell",ENERGIZER:"Energizer",ESSENTIAL:"Essential",FACEBOOK:"Facebook",FAIRPHONE:"Fairphone",GEEKSPHONE:"GeeksPhone",GENERIC:"Generic",GOOGLE:"Google",HISENSE:"Hisense",HMD:"HMD",HP:"HP",HTC:"HTC",HUAWEI:"Huawei",IMO:"IMO",INFINIX:"Infinix",ITEL:"itel",JOLLA:"Jolla",KOBO:"Kobo",LAVA:"Lava",LENOVO:"Lenovo",LG:"LG",MEIZU:"Meizu",MICROMAX:"Micromax",MICROSOFT:"Microsoft",MOTOROLA:"Motorola",NEXIAN:"Nexian",NINTENDO:"Nintendo",NOKIA:"Nokia",NOTHING:"Nothing",NVIDIA:"Nvidia",ONEPLUS:"OnePlus",OPPO:"OPPO",OUYA:"Ouya",PALM:"Palm",PANASONIC:"Panasonic",PEBBLE:"Pebble",PHILIPS:"Philips",PICO:"Pico",POLYTRON:"Polytron",REALME:"Realme",RETROID:"Retroid",RIM:"RIM",ROKU:"Roku",SAMSUNG:"Samsung",SHARP:"Sharp",SIEMENS:"Siemens",SMARTFREN:"Smartfren",SONY:"Sony",SPRINT:"Sprint",TCL:"TCL",TECHNISAT:"TechniSAT",TECNO:"TECNO",TESLA:"Tesla",ULEFONE:"Ulefone",VIVO:"Vivo",VIZIO:"Vizio",VODAFONE:"Vodafone",WIKO:"Wiko",XBOX:"Xbox",XIAOMI:"Xiaomi",ZEBRA:"Zebra",ZTE:"ZTE"});var or=Object.freeze({AMAYA:"Amaya",ARKWEB:"ArkWeb",BLINK:"Blink",EDGEHTML:"EdgeHTML",FLOW:"Flow",GECKO:"Gecko",GOANNA:"Goanna",ICAB:"iCab",KHTML:"KHTML",LIBWEB:"LibWeb",LINKS:"Links",LYNX:"Lynx",NETFRONT:"NetFront",NETSURF:"NetSurf",PRESTO:"Presto",SERVO:"Servo",TASMAN:"Tasman",TRIDENT:"Trident",W3M:"w3m",WEBKIT:"WebKit"});var rr=Object.freeze({AIX:"AIX",AMIGA_OS:"Amiga OS",ANDROID:"Android",ANDROID_X86:"Android-x86",ARCAOS:"ArcaOS",ARCH:"Arch",BADA:"Bada",BEOS:"BeOS",BLACKBERRY:"BlackBerry",CENTOS:"CentOS",CHROME_OS:"Chrome OS",CHROMECAST:"Chromecast",CHROMECAST_ANDROID:"Chromecast Android",CHROMECAST_FUCHSIA:"Chromecast Fuchsia",CHROMECAST_LINUX:"Chromecast Linux",CHROMECAST_SMARTSPEAKER:"Chromecast SmartSpeaker",CONTIKI:"Contiki",DEBIAN:"Debian",DEEPIN:"Deepin",DRAGONFLY:"DragonFly",ELEMENTARY_OS:"elementary OS",FEDORA:"Fedora",FIREFOX_OS:"Firefox OS",FREEBSD:"FreeBSD",FUCHSIA:"Fuchsia",GENTOO:"Gentoo",GHOSTBSD:"GhostBSD",GNU:"GNU",HAIKU:"Haiku",HARMONYOS:"HarmonyOS",HP_UX:"HP-UX",HURD:"Hurd",IOS:"iOS",JOLI:"Joli",KAIOS:"KaiOS",KNOPPIX:"Knoppix",KUBUNTU:"Kubuntu",LINPUS:"Linpus",LINSPIRE:"Linspire",LINUX:"Linux",MACOS:"macOS",MAEMO:"Maemo",MAGEIA:"Mageia",MANDRIVA:"Mandriva",MANJARO:"Manjaro",MEEGO:"MeeGo",MINIX:"Minix",MINT:"Mint",MORPH_OS:"Morph OS",NETBSD:"NetBSD",NETRANGE:"NetRange",NETTV:"NetTV",NINTENDO:"Nintendo",OPENHARMONY:"OpenHarmony",OPENBSD:"OpenBSD",OPENVMS:"OpenVMS",OS2:"OS/2",PALM:"Palm",PC_BSD:"PC-BSD",PCLINUXOS:"PCLinuxOS",PICO:"Pico",PLAN9:"Plan9",PLAYSTATION:"PlayStation",QNX:"QNX",RASPBIAN:"Raspbian",REDHAT:"RedHat",RIM_TABLET_OS:"RIM Tablet OS",RISC_OS:"RISC OS",SABAYON:"Sabayon",SAILFISH:"Sailfish",SERENITYOS:"SerenityOS",SERIES40:"Series40",SLACKWARE:"Slackware",SOLARIS:"Solaris",SUSE:"SUSE",SYMBIAN:"Symbian",TIZEN:"Tizen",UBUNTU:"Ubuntu",UBUNTU_TOUCH:"Ubuntu Touch",UNIX:"Unix",VECTORLINUX:"VectorLinux",WATCHOS:"watchOS",WEBOS:"WebOS",WINDOWS:"Windows",WINDOWS_CE:"Windows CE",WINDOWS_IOT:"Windows IoT",WINDOWS_MOBILE:"Windows Mobile",WINDOWS_PHONE:"Windows Phone",WINDOWS_RT:"Windows RT",XBOX:"Xbox",XUBUNTU:"Xubuntu",ZENWALK:"Zenwalk"});var sr=Object.freeze({BrowserName:{CLI:{CURL:"curl",ELINKS:"ELinks",HTTPIE:"HTTPie",LYNX:"Lynx",WGET:"Wget"},Crawler:{AHREFS_BOT:"AhrefsBot",AI2_BOT:"AI2Bot",AIHIT_BOT:"aiHitBot",ALGOLIA_CRAWLER:"Algolia Crawler",APPLE_BOT:"Applebot",APPLE_BOT_EXTENDED:"Applebot-Extended",ASK_TEOMA:"Teoma",AMAZON_BOT:"Amazonbot",AMAZON_CONTXBOT:"contxbot",ANTHROPIC_AI:"anthropic-ai",ANTHROPIC_CLAUDE_BOT:"ClaudeBot",ANTHROPIC_CLAUDE_SEARCHBOT:"Claude-SearchBot",ANTHROPIC_CLAUDE_WEB:"Claude-Web",ARCHIVEORG_BOT:"archive.org_bot",BAIDU_ADS:"Baidu-ADS",BAIDU_SPIDER:"Baiduspider",BAIDU_SPIDER_ADS:"Baiduspider-ads",BAIDU_SPIDER_CPRO:"Baiduspider-cpro",BAIDU_SPIDER_FAVO:"Baiduspider-favo",BAIDU_SPIDER_IMAGE:"Baiduspider-image",BAIDU_SPIDER_NEWS:"Baiduspider-news",BAIDU_SPIDER_RENDER:"Baiduspider-render",BAIDU_SPIDER_VIDEO:"Baiduspider-video",BLEX_BOT:"BLEXBot",BOTIFY:"botify",BRAVE_BOT:"Bravebot",BYTEDANCE_BYTESPIDER:"Bytespider",BYTEDANCE_TIKTOKSPIDER:"TikTokSpider",COMMON_CRAWL_CCBOT:"CCBot",COCCOC_BOT_WEB:"coccocbot-web",COCCOC_BOT_IMAGE:"coccocbot-image",COHERE_TRAINING_DATA_CRAWLER:"cohere-training-data-crawler",COTOYOGI:"Cotoyogi",COVEO_BOT:"Coveobot",CRITEO_BOT:"CriteoBot",DATAFORSEO_BOT:"DataForSeoBot",DAUM:"Daum",DAUM_DAUMOA:"Daumoa",DAUM_DAUMOA_IMAGE:"Daumoa-image",DEEPSEEK_BOT:"DeepSeekBot",DIFFBOT:"Diffbot",DUCKDUCKGO_BOT:"DuckDuckBot",DUCKDUCKGO_FAVICONS_BOT:"DuckDuckGo-Favicons-Bot",ELASTIC:"Elastic",ELASTIC_SWIFTYPE_BOT:"Swiftbot",EXALEAD_EXABOT:"Exabot",FIRECRAWL_AGENT:"FirecrawlAgent",FREESPOKE:"Freespoke",GOOGLE_ADSBOT:"AdsBot-Google",GOOGLE_ADSBOT_MOBILE:"Adsbot-Google-Mobile",GOOGLE_ADSENSE:"AdSense",GOOGLE_APIS:"APIs-Google",GOOGLE_BOT:"Googlebot",GOOGLE_BOT_IMAGE:"Googlebot-Image",GOOGLE_BOT_NEWS:"Googlebot-News",GOOGLE_BOT_VIDEO:"Googlebot-Video",GOOGLE_CLOUDVERTEXBOT:"Google-CloudVertexBot",GOOGLE_EXTENDED:"Google-Extended",GOOGLE_INSPECTIONTOOL:"Google-InspectionTool",GOOGLE_OTHER:"GoogleOther",GOOGLE_OTHER_IMAGE:"GoogleOther-Image",GOOGLE_OTHER_VIDEO:"GoogleOther-Video",GOOGLE_SAFETY:"Google-Safety",GOOGLE_STOREBOT:"Storebot-Google",HIVE_IMAGESIFTBOT:"ImagesiftBot",HUAWEI_PANGUBOT:"PanguBot",HUAWEI_PETALBOT:"PetalBot",HUGGINGFACE_BOT:"HuggingFace-Bot",HUNTER_VELENPUBLICWEBCRAWLER:"VelenPublicWebCrawler",IA_ARCHIVER:"ia_archiver",IASK_BOT:"iAskBot",KAGI_BOT:"Kagibot",KANGAROO_BOT:"Kangaroo Bot",LINE_SPIDER:"Linespider",LINKEDIN_BOT:"LinkedInBot",MAGPIE_CRAWLER:"magpie-crawler",MARGINALIA:"marginalia",META_EXTERNALAGENT:"meta-externalagent",META_FACEBOOKBOT:"FacebookBot",META_FACEBOOKCATALOG:"facebookcatalog",META_FACEBOOKEXTERNALHIT:"facebookexternalhit",MAJESTIC_MJ12BOT:"MJ12bot",MICROSOFT_BINGBOT:"Bingbot",MICROSOFT_MSNBOT:"msnbot",MICROSOFT_ADIDXBOT:"adidxbot",MOJEEK_BOT:"MojeekBot",MOZ_DOTBOT:"DotBot",ONCRAWL:"OnCrawl",ONESPOT_SCRAPERBOT:"Onespot-ScraperBot",OPENAI_GPTBOT:"GPTBot",OPENAI_SEARCH_BOT:"OAI-SearchBot",PERPLEXITY_BOT:"PerplexityBot",QIHOO_360_SPIDER:"360Spider",QWANT_BOT:"Qwantbot",QWANT_BOT_NEWS:"Qwantbot-news",REPLICATE_BOT:"Replicate-Bot",RUNPOD_BOT:"RunPod-Bot",SB_INTUITIONS_BOT:"SBIntuitionsBot",SEEKPORT_BOT:"SeekportBot",SEMRUSH_BOT:"SemrushBot",SEMRUSH_BOT_BACKLINK:"SemrushBot-BA",SEMRUSH_BOT_CONTENTSHAKE:"SemrushBot-OCOB",SEMRUSH_BOT_SEO_CHECKER:"SemrushBot-SI",SEZNAM_BOT:"SeznamBot",SITEIMPROVE:"Siteimprove",SOGOU_PIC_SPIDER:"Sogou Pic Spider",SOGOU_WEB_SPIDER:"Sogou web spider",STARTPAGE:"Startpage",SURLY_BOT:"SurdotlyBot",TIMPI_BOT:"Timpibot",TOGETHER_BOT:"Together-Bot",TURNITIN_BOT:"TurnitinBot",TWIN_AGENT:"TwinAgent",VERCEL_V0BOT:"v0bot",WEBZIO:"webzio",WEBZIO_EXTENDED:"Webzio-Extended",WEBZIO_OMGILI:"omgili",WEBZIO_OMGILI_BOT:"omgilibot",XAI_BOT:"xAI-Bot",YAHOO_JAPAN:"Y!J-BRW",YAHOO_SLURP:"Yahoo! Slurp",YANDEX_ACCESSIBILITY_BOT:"YandexAccessibilityBot",YANDEX_ADDITIONAL_BOT:"YandexAdditionalBot",YANDEX_ADNET:"YandexAdNet",YANDEX_BLOGS:"YandexBlogs",YANDEX_BOT:"YandexBot",YANDEX_BOT_MIRRORDETECTOR:"YandexBot MirrorDetector",YANDEX_COMBOT:"YandexComBot",YANDEX_FAVICONS:"YandexFavicons",YANDEX_IMAGE_RESIZER:"YandexImageResizer",YANDEX_IMAGES:"YandexImages",YANDEX_MARKET:"YandexMarket",YANDEX_MEDIA:"YandexMedia",YANDEX_METRIKA:"YandexMetrika",YANDEX_MOBILE_BOT:"YandexMobileBot",YANDEX_MOBILE_SCREENSHOT_BOT:"YandexMobileScreenShotBot",YANDEX_NEWS:"YandexNews",YANDEX_ONTODB:"YandexOntoDB",YANDEX_ONTODB_API:"YandexOntoDBAPI",YANDEX_PARTNER:"YandexPartner",YANDEX_RCA:"YandexRCA",YANDEX_RENDERRESOURCES_BOT:"YandexRenderResourcesBot",YANDEX_SCREENSHOT_BOT:"YandexScreenshotBot",YANDEX_SPRAV_BOT:"YandexSpravBot",YANDEX_TRACKER:"YandexTracker",YANDEX_VERTICALS:"YandexVerticals",YANDEX_VERTIS:"YandexVertis",YANDEX_VIDEO:"YandexVideo",YANDEX_VIDEO_PARSER:"YandexVideoParser",YANDEX_WEBMASTER:"YandexWebmaster",YEP_BOT:"YepBot",YETI:"Yeti",YISOU_SPIDER:"YisouSpider",YOU_BOT:"YouBot",ZHIPU_CHATGLM_SPIDER:"ChatGLM-Spider",ZUM_BOT:"ZumBot"},Email:{AIRMAIL:"Airmail",APPLE_MAIL:"Mail",BLUEMAIL:"BlueMail",DAUM_MAIL:"DaumMail",EVOLUTION:"Evolution",EM_CLIENT:"eM Client",FOXMAIL:"Foxmail",KMAIL:"KMail",KMAIL2:"kmail2",KONTACT:"Kontact",MICROSOFT_OUTLOOK:"Microsoft Outlook",MICROSOFT_OUTLOOK_MAC:"MacOutlook",NAVER_MAILAPP:"NaverMailApp",POLYMAIL:"Polymail",PROTON_MAIL:"ProtonMail",SPARK_MAIL:"SparkDesktop",SPARROW:"Sparrow",THUNDERBIRD:"Thunderbird",YAHOO_MAIL:"Yahoo",ZIMBRA:"Zimbra",ZOHO_MAIL:"ZohoMail-Desktop"},Fetcher:{AHREFS_SITEAUDIT:"AhrefsSiteAudit",ANTHROPIC_CLAUDE_USER:"Claude-User",ASANA:"Asana",BETTER_UPTIME_BOT:"Better Uptime Bot",BITLY_BOT:"bitlybot",BLUESKY:"Bluesky",BUFFER_LINKPREVIEWBOT:"BufferLinkPreviewBot",COHERE_AI:"Cohere-AI",DISCORD_BOT:"Discordbot",DUCKDUCKGO_ASSISTBOT:"DuckAssistBot",GOOGLE_CHROME_LIGHTHOUSE:"Chrome-Lighthouse",GOOGLE_FEEDFETCHER:"FeedFetcher-Google",GOOGLE_GEMINI_DEEP_RESEARCH:"Gemini-Deep-Research",GOOGLE_IMAGEPROXY:"GoogleImageProxy",GOOGLE_PAGERENDERER:"Google-PageRenderer",GOOGLE_READ_ALOUD:"Google-Read-Aloud",GOOGLE_PRODUCER:"GoogleProducer",GOOGLE_SITE_VERIFICATION:"Google-Site-Verification",HUBSPOT_PAGE_FETCHER:"HubSpot Page Fetcher",IFRAMELY:"Iframely",KAKAOTALK_SCRAP:"kakaotalk-scrap",KEYBASE_BOT:"KeybaseBot",META_EXTERNALFETCHER:"meta-externalfetcher",META_WHATSAPP:"WhatsApp",MICROSOFT_BINGPREVIEW:"BingPreview",MICROSOFT_PREVIEW:"MicrosoftPreview",MISTRALAI_USER:"MistralAI-User",NAVER_BLUENO:"Blueno",ONCRAWL_ROGERBOT:"rogerbot",OPENAI_CHATGPT_USER:"ChatGPT-User",PERPLEXITY_USER:"Perplexity-User",PINTEREST_BOT:"Pinterestbot",SEMRUSH_SITEAUDITBOT:"SiteAuditBot",SLACK_BOT:"Slackbot",SLACK_BOT_LINKEXPANDING:"Slackbot-LinkExpanding",SLACK_IMGPROXY:"Slack-ImgProxy",SNAP_URL_PREVIEW:"Snap URL Preview",SKYPE_URIPREVIEW:"SkypeUriPreview",TELEGRAM_BOT:"TelegramBot",UPTIMEROBOT:"UptimeRobot",VERCEL_FAVICON_BOT:"vercel-favicon-bot",VERCEL_SCREENSHOT_BOT:"vercel-screenshot-bot",VERCEL_BOT:"Vercelbot",VERCEL_FLAGS:"vercelflags",VERCEL_TRACING:"verceltracing",X_TWITTERBOT:"Twitterbot",YANDEX_CALENDAR:"YandexCalendar",YANDEX_DIRECT:"YandexDirect",YANDEX_DIRECTDYN:"YandexDirectDyn",YANDEX_DIRECTFETCHER:"YaDirectFetcher",YANDEX_FORDOMAIN:"YandexForDomain",YANDEX_PAGECHECKER:"YandexPagechecker",YANDEX_SEARCHSHOP:"YandexSearchShop",YANDEX_SITELINKS:"YandexSitelinks",YANDEX_USERPROXY:"YandexUserproxy",ZOOMINFO_BOT:"Zoombot"},InApp:{DISCORD:"Discord",EVERNOTE:"Evernote",FIGMA:"Figma",FLIPBOARD:"Flipboard",MATTERMOST:"Mattermost",TEAMS:"Teams",NOTION:"Notion",POSTMAN:"Postman",RAMBOX:"Rambox",ROCKETCHAT:"Rocket.Chat",SLACK:"Slack",TIKTOK_LITE:"TikTok Lite",VSCODE:"VS Code",YAHOO_JAPAN:"Yahoo! Japan"},Library:{ADOBE_AIR:"AdobeAIR",AIOHTTP:"aiohttp",APACHE_HTTPCLIENT:"Apache-HttpClient",AXIOS:"axios",GO_HTTP_CLIENT:"go-http-client",GOT:"got",GUZZLEHTTP:"GuzzleHttp",JAVA:"Java",JAVA_HTTPCLIENT:"Java-http-client",JSDOM:"jsdom",LIBWWW_PERL:"libwww-perl",LUA_RESTY_HTTP:"lua-resty-http",NEEDLE:"Needle",NUTCH:"Nutch",OKHTTP:"OkHttp",NODE_FETCH:"node-fetch",NODE_SUPERAGENT:"node-superagent",PHP_SOAP:"PHP-SOAP",POSTMAN_RUNTIME:"PostmanRuntime",PYTHON_HTTPX:"python-httpx",PYTHON_URLLIB:"python-urllib",PYTHON_URLLIB3:"python-urllib3",PYTHON_REQUESTS:"python-requests",SCRAPY:"Scrapy"}},DeviceVendor:{Vehicle:{BMW:"BMW",BYD:"BYD",JEEP:"Jeep",RIVIAN:"Rivian",TESLA:"Tesla",VOLVO:"Volvo"}}});var D="model",F="name",P="type",L="vendor",Y="version",ke="mobile",X="tablet",Ci="crawler",Sa="cli",ar="email",lr="fetcher",et="inapp",Mt="mediaplayer",Ca="library",Ta=Object.freeze({browser:[[/(wget|curl|lynx|elinks|httpie)[\/ ]\(?([\w\.-]+)/i],[F,Y,[P,Sa]]]}),ur=Object.freeze({browser:[[/((?:adidx|ahrefs|amazon|bing|brave|cc|contx|coveo|criteo|dot|duckduck(?:go-favicons-)?|exa|facebook|gpt|iask|kagi|kangaroo |linkedin|mj12|mojeek|oai-search|onespot-scraper|perplexity|sbintuitions|semrush|seznam|surdotly|swift|yep)bot)\/([\w\.-]+)/i,/(algolia crawler(?: renderscript)?)\/?([\w\.]*)/i,/(applebot(?:-extended)?)\/?([\w\.]*)/i,/(baiduspider[-imagevdonwsfcpr]{0,7})\/?([\w\.]*)/i,/(claude(?:bot|-searchbot|-web)|anthropic-ai)\/?([\w\.]*)/i,/(coccocbot-(?:image|web))\/([\w\.]+)/i,/(daum(?:oa)?(?:-image)?)[ \/]([\w\.]+)/i,/(facebook(?:externalhit|catalog)|meta-externalagent)\/([\w\.]+)/i,/(google(?:bot|other|-inspectiontool)(?:-image|-video|-news)?|storebot-google)\/?([\w\.]*)/i,/(ia_archiver|archive\.org_bot)\/?([\w\.]*)/i,/(oncrawl) mobile\/([\w\.]+)/i,/(qwantbot(?:-news)?)[-\w]*\/?([\w\.]*)/i,/((?:semrush|splitsignal)bot[-abcfimostw]*)\/?([\w\.-]*)/i,/(sogou (?:pic|head|web|orion|news) spider)\/([\w\.]+)/i,/(y!?j-(?:asr|br[uw]|dscv|mmp|vsidx|wsc))\/([\w\.]+)/i,/(yandex(?:(?:mobile)?(?:accessibility|additional|com|renderresources|screenshot|sprav)?bot(?!.+mirror)|image(?:s|resizer)|adnet|blogs|favicons|market|media|metrika|news|ontodb(?:api)?|partner|rca|tracker|turbo|verti(?:cal)?s|webmaster|video(?:parser)?))\/([\w\.]+)/i,/(yeti)\/([\w\.]+)/i,/((?:aihit|blex|diff|huggingface-|msn|pangu|replicate-|runpod-|timpi|together-|xai-|you|zum)bot|(?:magpie-|velenpublicweb)crawler|(?:chatglm-|line|screaming frog seo |yisou)spider|cotoyogi|firecrawlagent|freespoke|omgili(?:bot)?|openai image downloader|startpageprivateimageproxy|twinagent|webzio-extended)\/?([\w\.]*)/i],[F,Y,[P,Ci]],[/(yandexbot\/([\w\.]+); mirrordetector)/i],[[F,/\/.+;/ig,""],Y,[P,Ci]],[/((?:adsbot|apis|mediapartners)-google(?:-mobile)?|google-?(?:other|cloudvertexbot|extended|safety))/i,/\b((ai2|aspiegel|dataforseo|deepseek|imagesift|petal|seekport|turnitin|v0)bot|360spider-?(image|video)?|baidu-ads|botify|(byte|tiktok)spider|cohere-training-data-crawler|elastic(?=\/s)|marginalia|siteimprove(?=bot|\.com)|teoma|webzio|yahoo! slurp)/i],[F,[P,Ci]]]}),Kd=Object.freeze({device:[[/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[L,D,[P,X]],[/(u304aa)/i],[D,[L,"AT&T"],[P,ke]],[/\bsie-(\w*)/i],[D,[L,"Siemens"],[P,ke]],[/\b(rct\w+) b/i],[D,[L,"RCA"],[P,X]],[/\b(venue[\d ]{2,7}) b/i],[D,[L,"Dell"],[P,X]],[/\b(q(?:mv|ta)\w+) b/i],[D,[L,"Verizon"],[P,X]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[D,[L,"Barnes & Noble"],[P,X]],[/\b(tm\d{3}\w+) b/i],[D,[L,"NuVision"],[P,X]],[/\b(k88) b/i],[D,[L,"ZTE"],[P,X]],[/\b(nx\d{3}j) b/i],[D,[L,"ZTE"],[P,ke]],[/\b(gen\d{3}) b.+49h/i],[D,[L,"Swiss"],[P,ke]],[/\b(zur\d{3}) b/i],[D,[L,"Swiss"],[P,X]],[/^((zeki)?tb.*\b) b/i],[D,[L,"Zeki"],[P,X]],[/\b([yr]\d{2}) b/i,/\b(?:dragon[- ]+touch |dt)(\w{5}) b/i],[D,[L,"Dragon Touch"],[P,X]],[/\b(ns-?\w{0,9}) b/i],[D,[L,"Insignia"],[P,X]],[/\b((nxa|next)-?\w{0,9}) b/i],[D,[L,"NextBook"],[P,X]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[L,"Voice"],D,[P,ke]],[/\b(lvtel\-)?(v1[12]) b/i],[[L,"LvTel"],D,[P,ke]],[/\b(ph-1) /i],[D,[L,"Essential"],[P,ke]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[D,[L,"Envizen"],[P,X]],[/\b(trio[-\w\. ]+) b/i],[D,[L,"MachSpeed"],[P,X]],[/\btu_(1491) b/i],[D,[L,"Rotor"],[P,X]]]}),Wd=Object.freeze({browser:[[/((?:air|blue|daum|fox|poly|proton)mail|emclient|evolution|kmail2?|kontact|(?:microsoft |mac)?outlook(?:-express)?|navermailapp|(?!chrom.+)sparrow|sparkdesktop|thunderbird|yahoo|zohomail-desktop)(?:m.+ail; |[\/ ])([\w\.]+)/i,/(mail)\/([\w\.]+) cf/i],[F,Y,[P,ar]],[/zdesktop\/([\w\.]+)/i],[Y,[F,"Zimbra"],[P,ar]]]}),cr=Object.freeze({browser:[[/(asana|ahrefssiteaudit|(?:bing|microsoft)preview|blueno|(?:chatgpt|claude|mistralai|perplexity)-user|cohere-ai|hubspot page fetcher|mastodon|(?:bitly|bufferlinkpreview|discord|duckassist|linkedin|pinterest|reddit|roger|siteaudit|twitter|uptimero|zoom)bot|google-site-verification|iframely|kakaotalk-scrap|meta-externalfetcher|y!?j-dlc|yandex(?:calendar|direct(?:dyn)?|fordomain|pagechecker|searchshop)|yadirectfetcher)\/([\w\.]+)/i,/(bluesky) cardyb\/([\w\.]+)/i,/(skypeuripreview) preview\/([\w\.]+)/i,/(slack(?:bot)?(?:-imgproxy|-linkexpanding)?) ([\w\.]+)/i,/(whatsapp)\/([\w\.]+)/i],[F,Y,[P,lr]],[/((?:better uptime |keybase|telegram|vercel)bot|chrome-lighthouse|feedfetcher-google|gemini-deep-research|google(?:imageproxy|-read-aloud|-pagerenderer|producer)|snap url preview|vercel(flags|tracing|-(favicon|screenshot)-bot)|yandex(?:sitelinks|userproxy))/i],[F,[P,lr]]],os:[[/whatsapp\/[\d\.]+ (a|i)/i],[[F,t=>t=="A"?"Android":"iOS"]]]}),zd=Object.freeze({browser:[[/\b(discord|figma|mattermost|notion|postman|rambox|rocket.chat|slack|teams)\/([\w\.]+).+(electron\/|; ios)/i,/(flipboard)\/([\w\.]+)/i],[F,Y,[P,et]],[/(evernote) win/i,/(teams)mobile-(ios|and)/i],[F,[P,et]],[/chatlyio\/([\d\.]+)/i],[Y,[F,"Slack"],[P,et]],[/ultralite app_version\/([\w\.]+)/i],[Y,[F,"TikTok Lite"],[P,et]],[/\) code\/([\d\.]+).+electron\//i],[Y,[F,"VS Code"],[P,et]],[/jp\.co\.yahoo\.(?:android\.yjtop|ipn\.appli)\/([\d\.]+)/i],[Y,[F,"Yahoo! Japan"],[P,et]]]}),Yd=Object.freeze({browser:[[/(apple(?:coremedia|tv))\/([\w\._]+)/i,/(coremedia) v([\w\._]+)/i,/(ares|clementine|music player daemon|nexplayer|ossproxy) ([\w\.-]+)/i,/^(aqualung|audacious|audimusicstream|amarok|bass|bsplayer|core|gnomemplayer|gvfs|irapp|lyssna|music on console|nero (?:home|scout)|nokia\d+|nsplayer|psp-internetradioplayer|quicktime|rma|radioapp|radioclientapplication|soundtap|stagefright|streamium|totem|videos|xbmc|xine|xmms)\/([\w\.-]+)/i,/(lg player|nexplayer) ([\d\.]+)/i,/player\/(nexplayer|lg player) ([\w\.-]+)/i,/(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i,/(htc streaming player) [\w_]+ \/ ([\d\.]+)/i,/(lavf)([\d\.]+)/i,/(mplayer)(?: |\/)(?:(?:sherpya-){0,1}svn)(?:-| )(r\d+(?:-\d+[\w\.-]+))/i,/ (songbird)\/([\w\.-]+)/i,/(winamp)(?:3 version|mpeg| ) ([\w\.-]+)/i,/(vlc)(?:\/| media player - version )([\w\.-]+)/i,/^(foobar2000|itunes|smp)\/([\d\.]+)/i,/com\.(riseupradioalarm)\/([\d\.]*)/i,/(mplayer)(?:\s|\/| unknown-)([\w\.\-]+)/i,/(windows)\/([\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ home media server/i],[F,Y,[P,Mt]],[/(flrp)\/([\w\.-]+)/i],[[F,"Flip Player"],Y,[P,Mt]],[/(fstream|media player classic|inlight radio|mplayer|nativehost|nero showtime|ocms-bot|queryseekspider|tapinradio|tunein radio|winamp|yourmuze)/i],[F,[P,Mt]],[/(htc_one_s|windows-media-player|wmplayer)\/([\w\.-]+)/i],[[F,/[_-]/g," "],Y,[P,Mt]],[/(rad.io|radio.(?:de|at|fr)) ([\d\.]+)/i],[[F,"rad.io"],Y,[P,Mt]]]}),ya=Object.freeze({browser:[[/^(apache-httpclient|axios|(?:go|java)-http-client|got|guzzlehttp|java|libwww-perl|lua-resty-http|needle|node-(?:fetch|superagent)|okhttp|php-soap|postmanruntime|python-(?:httpx|urllib[23]?|requests)|scrapy)\/([\w\.]+)/i,/(adobeair|aiohttp|jsdom)\/([\w\.]+)/i,/(nutch)-([\w\.-]+)(\(|$)/i,/\((java)\/([\w\.]+)/i],[F,Y,[P,Ca]]]}),jd=Object.freeze({device:[[/aftlbt962e2/i],[[L,"BMW"]],[/dilink.+(byd) auto/i],[L],[/aftlft962x3/i],[[L,"Jeep"],[D,"Wagooner"]],[/(rivian) (r1t)/i],[L,D],[/vcc.+netfront/i],[[L,"Volvo"]]]}),dr=Object.freeze({browser:[...Ta.browser,...cr.browser,...ur.browser,...ya.browser],os:[...cr.os]});var I={ANDORRA:{ANDORRA:"Europe/Andorra"},AUSTRIA:{VIENNA:"Europe/Vienna"},BELGIUM:{BRUSSELS:"Europe/Brussels"},BULGARIA:{SOFIA:"Europe/Sofia"},CROATIA:{ZAGREB:"Europe/Zagreb"},CYPRUS:{NICOSIA_EUROPE:"Europe/Nicosia",NICOSIA_ASIA:"Asia/Nicosia",FAMAGUSTA:"Asia/Famagusta"},CZECHIA:{PRAGUE:"Europe/Prague"},DENMARK:{COPENHAGEN:"Europe/Copenhagen",FAROE:"Atlantic/Faroe"},ESTONIA:{TALLINN:"Europe/Tallinn"},FINLAND:{HELSINKI:"Europe/Helsinki",MARIEHAMN:"Europe/Mariehamn"},FRANCE:{PARIS:"Europe/Paris",CAYENNE:"America/Cayenne",GUADELOUPE:"America/Guadeloupe",MARIGOT:"America/Marigot",MARTINIQUE:"America/Martinique",MAYOTTE:"Indian/Mayotte",REUNION:"Indian/Reunion"},GERMANY:{BERLIN:"Europe/Berlin",BUSINGEN:"Europe/Busingen"},GREECE:{ATHENS:"Europe/Athens"},HUNGARY:{BUDAPEST:"Europe/Budapest"},ICELAND:{REYKJAVIK:"Atlantic/Reykjavik"},IRELAND:{DUBLIN:"Europe/Dublin"},ITALY:{ROME:"Europe/Rome"},LATVIA:{RIGA:"Europe/Riga"},LIECHTENSTEIN:{VADUZ:"Europe/Vaduz"},LITHUANIA:{VILNIUS:"Europe/Vilnius"},LUXEMBOURG:{LUXEMBOURG:"Europe/Luxembourg"},MALTA:{MALTA:"Europe/Malta"},MONACO:{MONACO:"Europe/Monaco"},NETHERLANDS:{AMSTERDAM:"Europe/Amsterdam",ARUBA:"America/Aruba",CURACAO:"America/Curacao",KRALENDIJK:"America/Kralendijk",LOWER_PRINCES:"America/Lower_Princes"},NORWAY:{OSLO:"Europe/Oslo",JAN_MAYEN:"Atlantic/Jan_Mayen",LONGYEARBYEN:"Arctic/Longyearbyen"},POLAND:{WARSAW:"Europe/Warsaw"},PORTUGAL:{LISBON:"Europe/Lisbon",AZORES:"Atlantic/Azores",MADEIRA:"Atlantic/Madeira"},ROMANIA:{BUCHAREST:"Europe/Bucharest"},SAN_MARINO:{SAN_MARINO:"Europe/San_Marino"},SLOVAKIA:{BRATISLAVA:"Europe/Bratislava"},SLOVENIA:{LJUBLJANA:"Europe/Ljubljana"},SPAIN:{MADRID:"Europe/Madrid",CANARY:"Atlantic/Canary",CEUTA:"Africa/Ceuta"},SWEDEN:{STOCKHOLM:"Europe/Stockholm"},SWITZERLAND:{ZURICH:"Europe/Zurich"},VATICAN:{VATICAN:"Europe/Vatican"}},Oa=[I.AUSTRIA.VIENNA,I.BELGIUM.BRUSSELS,I.BULGARIA.SOFIA,I.CROATIA.ZAGREB,I.CYPRUS.NICOSIA_EUROPE,I.CYPRUS.NICOSIA_ASIA,I.CYPRUS.FAMAGUSTA,I.CZECHIA.PRAGUE,I.DENMARK.COPENHAGEN,I.ESTONIA.TALLINN,I.FINLAND.HELSINKI,I.FINLAND.MARIEHAMN,I.FRANCE.PARIS,I.GERMANY.BERLIN,I.GREECE.ATHENS,I.HUNGARY.BUDAPEST,I.IRELAND.DUBLIN,I.ITALY.ROME,I.LATVIA.RIGA,I.LITHUANIA.VILNIUS,I.LUXEMBOURG.LUXEMBOURG,I.MALTA.MALTA,I.NETHERLANDS.AMSTERDAM,I.POLAND.WARSAW,I.PORTUGAL.LISBON,I.ROMANIA.BUCHAREST,I.SLOVAKIA.BRATISLAVA,I.SLOVENIA.LJUBLJANA,I.SPAIN.MADRID,I.SWEDEN.STOCKHOLM,I.FRANCE.CAYENNE,I.FRANCE.GUADELOUPE,I.FRANCE.MARIGOT,I.FRANCE.MARTINIQUE,I.FRANCE.MAYOTTE,I.FRANCE.REUNION,I.PORTUGAL.AZORES,I.PORTUGAL.MADEIRA,I.SPAIN.CANARY],fr=[I.ICELAND.REYKJAVIK,I.LIECHTENSTEIN.VADUZ,I.NORWAY.OSLO,I.NORWAY.JAN_MAYEN],Xd=[...Oa,...fr],qd=[I.SWITZERLAND.ZURICH,...fr],Jd=[I.AUSTRIA.VIENNA,I.BELGIUM.BRUSSELS,I.BULGARIA.SOFIA,I.CROATIA.ZAGREB,I.CZECHIA.PRAGUE,I.DENMARK.COPENHAGEN,I.ESTONIA.TALLINN,I.FINLAND.HELSINKI,I.FINLAND.MARIEHAMN,I.FRANCE.PARIS,I.GERMANY.BERLIN,I.GREECE.ATHENS,I.HUNGARY.BUDAPEST,I.ITALY.ROME,I.LATVIA.RIGA,I.LITHUANIA.VILNIUS,I.LUXEMBOURG.LUXEMBOURG,I.MALTA.MALTA,I.NETHERLANDS.AMSTERDAM,I.POLAND.WARSAW,I.PORTUGAL.LISBON,I.PORTUGAL.AZORES,I.PORTUGAL.MADEIRA,I.ROMANIA.BUCHAREST,I.SLOVAKIA.BRATISLAVA,I.SLOVENIA.LJUBLJANA,I.SPAIN.MADRID,I.SPAIN.CANARY,I.SWEDEN.STOCKHOLM,I.ANDORRA.ANDORRA,I.GERMANY.BUSINGEN,I.ICELAND.REYKJAVIK,I.LIECHTENSTEIN.VADUZ,I.MONACO.MONACO,I.NORWAY.OSLO,I.SAN_MARINO.SAN_MARINO,I.SPAIN.CEUTA,I.SWITZERLAND.ZURICH,I.VATICAN.VATICAN];function Ti(){var t;return typeof window!="undefined"&&((window==null?void 0:window.matchMedia("(display-mode: standalone)").matches)||((t=window.navigator)===null||t===void 0?void 0:t.standalone)||document.referrer.startsWith("android-app://")||(window==null?void 0:window.Windows)||/trident.+(msapphost|webview)\//i.test(navigator.userAgent)||document.referrer.startsWith("app-info://platform/microsoft-store"))}var{Crawler:uf}=sr.BrowserName,yi=(t,e,n)=>typeof t=="string"?ee(t,e,n):t;var pr=t=>{let e=yi(t);if(e.os.is(rr.MACOS)){if(e.cpu.is(ir.ARM))return!0;if(typeof t!="string"&&typeof window!="undefined")try{let n=document.createElement("canvas"),i=n.getContext("webgl2")||n.getContext("webgl")||n.getContext("experimental-webgl"),o=i.getExtension("WEBGL_debug_renderer_info");if(i.getParameter(o.UNMASKED_RENDERER_WEBGL).match(/apple m\d/i))return!0}catch(n){return!1}}return!1};var gr=t=>[Bt.CLI,Bt.CRAWLER,Bt.FETCHER,Bt.LIBRARY].includes(yi(t,dr).browser.type),mr=t=>yi(t).engine.is(or.BLINK);function Ra(){return{width:window.screen.width,height:window.screen.height}}function va(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return console.error("Failed to get timezone:",t),"UTC"}}function hr(){try{return navigator.language||"en-US"}catch(t){return console.error("Failed to get browser locale:",t),"en-US"}}function Er(){if(typeof window=="undefined")return{userAgent:{name:"",browser:{major:"",name:"",version:""},os:{name:"",version:""},device:void 0,engine:{name:"",version:""},cpu:{architecture:""}},screenResolution:{width:0,height:0},timeZone:"UTC",flags:{isBot:!1,isChromeFamily:!1,isStandalonePWA:!1,isAppleSilicon:!1}};let e=new ee().getResult(),n;try{n={isBot:gr(e),isChromeFamily:mr(e),isStandalonePWA:Ti(),isAppleSilicon:pr(e)}}catch(i){console.error("Failed to compute device flags:",i),n={isBot:!1,isChromeFamily:!1,isStandalonePWA:!1,isAppleSilicon:!1}}return{userAgent:{name:e.ua,browser:{major:e.browser.major||"",name:e.browser.name||"",version:e.browser.version||"",type:e.browser.type},os:{name:e.os.name||"",version:e.os.version||""},device:e.device.model||e.device.type||e.device.vendor?{model:e.device.model,type:e.device.type,vendor:e.device.vendor}:void 0,engine:{name:e.engine.name||"",version:e.engine.version||""},cpu:{architecture:e.cpu.architecture||""}},screenResolution:Ra(),timeZone:va(),flags:n}}function Ar(){if(typeof window=="undefined")return{};let t=new URLSearchParams(window.location.search);return{locale:t.get("locale")||void 0,currency:t.get("currency")||void 0,utmSource:t.get("utm_source")||void 0,utmMedium:t.get("utm_medium")||void 0,utmCampaign:t.get("utm_campaign")||void 0}}var In=class{constructor(){this.listeners=new Map}on(e,n){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(n),()=>this.off(e,n)}off(e,n){this.listeners.has(e)&&this.listeners.get(e).delete(n)}async emit(e,n){if(this.listeners.has(e)){let i=Array.from(this.listeners.get(e));await Promise.all(i.map(o=>{try{return Promise.resolve(o(n))}catch(r){return console.error('[EventBus] Error in listener for event "'.concat(e,'":'),r),Promise.resolve()}}))}}clear(){this.listeners.clear()}};Pn();function Ut(t){try{let e=t.split(".");if(e.length!==3)return console.error("Invalid JWT token format"),null;let n=e[1],i=n+"=".repeat((4-n.length%4)%4),o=atob(i),r=JSON.parse(o);return r.exp&&Date.now()>=r.exp*1e3?(console.warn("JWT token is expired"),null):{sessionId:r.sessionId,storeId:r.storeId,accountId:r.accountId,customerId:r.customerId,role:r.role,isValid:!0,isLoading:!1}}catch(e){return console.error("Failed to decode JWT token:",e),null}}function br(t){try{let e=t.split(".");if(e.length!==3)return!0;let n=e[1],i=n+"=".repeat((4-n.length%4)%4),o=atob(i),r=JSON.parse(o);return r.exp?Date.now()>=r.exp*1e3:!1}catch(e){return console.error("Failed to check token expiration:",e),!0}}Vt();var tt={},Pa=["","VITE_","REACT_APP_","NEXT_PUBLIC_"];function he(t,e=Pa){var n,i,o;for(let r of e){let s=r?"".concat(r).concat(t):t;if(typeof process!="undefined"&&((n=process==null?void 0:process.env)!=null&&n[s]))return console.log("process.env[".concat(s,"]"),process.env[s]),process.env[s];if(typeof tt!="undefined"&&((i=tt==null?void 0:tt.env)!=null&&i[s]))return console.log("import.meta.env[".concat(s,"]"),tt.env[s]),tt.env[s];if(typeof window!="undefined"&&((o=window==null?void 0:window.__TAGADA_ENV__)!=null&&o[s]))return console.log("window.__TAGADA_ENV__[".concat(s,"]"),window.__TAGADA_ENV__[s]),window.__TAGADA_ENV__[s]}}var Na=async(t="default")=>{try{if((he("TAGADA_ENV")||he("TAGADA_ENVIRONMENT"))==="production"||!rt(!0))return null;let n=await fetch("/.local.json");if(!n.ok)return null;let i=await n.json(),o={},r=!1;try{let a=await fetch("/config/".concat(t,".tgd.json"));a.ok||(a=await fetch("/config/".concat(t,".json"))),a.ok&&(o=await a.json(),r=!0)}catch(a){}if(!r&&t!=="default"){console.warn("\u26A0\uFE0F Config variant '".concat(t,"' not found, falling back to 'default'"));try{let a=await fetch("/config/default.tgd.json");a.ok||(a=await fetch("/config/default.json")),a.ok&&(o=await a.json(),r=!0,console.log("\u2705 Fallback to 'default' config successful"))}catch(a){}}r||console.warn(t==="default"?"\u26A0\uFE0F No 'default' config found. Create /config/default.tgd.json":"\u26A0\uFE0F Neither '".concat(t,"' nor 'default' config found. Create /config/default.tgd.json"));let s={storeId:i.storeId,accountId:i.accountId,basePath:i.basePath,config:o};return console.log("\u{1F6E0}\uFE0F Using local development plugin config:",s),s}catch(e){return null}},xa=async()=>{try{if((he("TAGADA_ENV")||he("TAGADA_ENVIRONMENT"))==="production"||!rt(!0))return null;try{console.log("\u{1F6E0}\uFE0F [V2] Attempting to load /config/funnel.local.json...");let i=await fetch("/config/funnel.local.json");if(i.ok){let o=await i.json();console.log("\u{1F6E0}\uFE0F [V2] \u2705 Loaded local funnel config (NEW format):",o);let{loadLocalFunnelConfig:r}=await Promise.resolve().then(()=>(Bn(),Qi));if(await r(),o.staticResources){let s={};for(let[a,l]of Object.entries(o.staticResources))s[a]={id:l};return s}return null}}catch(i){console.log("\u{1F6E0}\uFE0F [V2] funnel.local.json not found, trying legacy format...")}console.log("\u{1F6E0}\uFE0F [V2] Attempting to load /config/resources.static.json (legacy)...");let e=await fetch("/config/resources.static.json");if(!e.ok)return console.log("\u{1F6E0}\uFE0F [V2] No local static resources found"),null;let n=await e.json();return console.log("\u{1F6E0}\uFE0F [V2] \u2705 Loaded legacy static resources:",n),n}catch(t){return console.error("\u{1F6E0}\uFE0F [V2] \u274C Error loading static resources:",t),null}},Sn=t=>{let e=document.querySelector('meta[name="'.concat(t,'"]'));return(e==null?void 0:e.getAttribute("content"))||void 0},La=async()=>{try{if(typeof document=="undefined")return null;let t=Sn("x-plugin-store-id"),e=Sn("x-plugin-account-id");if(!t)return null;let n=Sn("x-plugin-base-path")||"/",i={};try{let r=Sn("x-plugin-config");if(r){let s=decodeURIComponent(r);i=JSON.parse(s)}}catch(r){console.warn("\u26A0\uFE0F Failed to parse plugin config from meta tag:",r)}e||console.warn("\u26A0\uFE0F Plugin config: Account ID not found in meta tags");let o={storeId:t,accountId:e,basePath:n,config:i};return console.log("\u{1F680} [HIGHEST PRIORITY] Plugin config loaded from meta tags (runtime injected config):",{storeId:t,accountId:e,basePath:n,configKeys:Object.keys(i),configSize:JSON.stringify(i).length}),o}catch(t){return console.warn("\u26A0\uFE0F Error loading production config from meta tags:",t),null}},wr=async(t="default",e)=>{var s,a;console.log("\u{1F527} [V2] loadPluginConfig called with variant:",t);let n=await xa(),i=await La();if(i){let l=z(v({},i),{staticResources:n!=null?n:void 0});return console.log("\u2705 [V2] Using INJECTED config from meta tags (HIGHEST PRIORITY)"),l}if(e){let l={storeId:e.storeId,accountId:e.accountId,basePath:(s=e.basePath)!=null?s:"/",config:(a=e.config)!=null?a:{},staticResources:n!=null?n:void 0};return console.log("\u2705 [V2] Using raw config parameter (PRIORITY 2)"),l}let o=await _a();if(o){let l=z(v({},o),{staticResources:n!=null?n:void 0});return console.log("\u2705 [V2] Using environment variables config (PRIORITY 3 - build time)"),l}let r=await Na(t);if(r){let l=z(v({},r),{staticResources:n!=null?n:void 0});return console.log("\u2705 [V2] Using local dev config files (PRIORITY 4)"),l}return console.warn("\u26A0\uFE0F [V2] No plugin config found - using defaults"),{basePath:"/",config:{},staticResources:n!=null?n:void 0}};async function ka(t="default",e){try{if(!rt())return null;if(e)return e;let n=["/config/".concat(t,".config.json"),"/config/".concat(t,".tgd.json"),"/config/".concat(t,".json")];for(let i of n)try{let o=await fetch(i);if(o.ok)return await o.json()}catch(o){continue}return console.warn("\u26A0\uFE0F [loadLocalConfig] No config found for '".concat(t,"'")),null}catch(n){return console.error("[loadLocalConfig] Error loading config:",n),null}}async function _a(){try{if(!rt())return;let t=he("TAGADA_STORE_ID"),e=he("TAGADA_ACCOUNT_ID"),n=he("TAGADA_BASE_PATH"),i=he("TAGADA_CONFIG_NAME");if(!t||!e)return;let o=await ka(i);if(!o)return;let r={storeId:t,accountId:e,basePath:n||"/",config:o};return console.log("\u{1F6E0}\uFE0F [createRawPluginConfig] Using environment variables (build-time config):",{hasStoreId:!!r.storeId,hasAccountId:!!r.accountId,basePath:r.basePath,hasConfig:!!r.config}),r}catch(t){console.error("[createRawPluginConfig] Error creating config:",t);return}}jt();Ue();Ue();var Oi=new Map,Ri=new Set;function Da(){return typeof window=="undefined"?null:new URLSearchParams(window.location.search).get("authCode")}async function Ir(t,e,n,i=!1){if(Ri.has(t))throw i&&console.log("[AuthHandoff] Code already resolved, skipping duplicate request"),new Error("Auth code already resolved");let o=Oi.get(t);if(o)return i&&console.log("[AuthHandoff] Resolution already in progress, waiting for existing request"),o;i&&console.log("[AuthHandoff] Resolving authCode:",t.substring(0,15)+"...");let r=(async()=>{try{let s=await fetch("".concat(n,"/api/v1/cms/auth/resolve-handoff"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t,storeId:e})});if(!s.ok){let l=await s.json().catch(()=>({message:"Unknown error"}));throw new Error(l.message||"Failed to resolve auth handoff: ".concat(s.status))}let a=await s.json();return i&&console.log("[AuthHandoff] \u2705 Resolved successfully:",{customerId:a.customer.id,role:a.customer.role,hasContext:Object.keys(a.context).length>0}),i&&console.log("[AuthHandoff] Storing new token (overriding existing)"),ne(a.token),Ba(i),Ri.add(t),a}catch(s){throw console.error("[AuthHandoff] \u274C Failed to resolve:",s),s}finally{Oi.delete(t)}})();return Oi.set(t,r),r}function Ba(t=!1){if(typeof window=="undefined")return;let e=new URL(window.location.href);e.searchParams.has("authCode")&&(e.searchParams.delete("authCode"),window.history.replaceState({},"",e.pathname+e.search+e.hash),t&&console.log("[AuthHandoff] Cleaned authCode from URL"))}function Sr(){let t=Da();return!(!t||!t.startsWith("ah_")||Ri.has(t))}var Cn=class{constructor(e={}){this.bus=new In;this.eventDispatcher=new Be;this.tokenPromise=null;this.tokenResolver=null;this.isInitializingSession=!1;this.lastSessionInitError=null;this.sessionInitRetryCount=0;this.MAX_SESSION_INIT_RETRIES=3;var a,l,u,d;this.config=e,this.instanceId=Math.random().toString(36).substr(2,9),this.boundHandleStorageChange=this.handleStorageChange.bind(this),this.boundHandlePageshow=p=>{if(p.persisted)if(this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Page restored from BFcache (back button), re-initializing funnel...")),this.funnel&&this.state.session&&this.state.store){this.funnel.resetInitialization();let S=this.getAccountId(),f=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("funnelId")||void 0;this.funnel.autoInitialize({customerId:this.state.session.customerId,sessionId:this.state.session.sessionId},{id:this.state.store.id,accountId:S},f).catch(C=>{console.error("[TagadaClient] Funnel re-initialization failed:",C)})}else this.sessionInitRetryCount=0,this.initialize()},console.log("[TagadaClient ".concat(this.instanceId,"] Initializing...")),console.log("[TagadaClient ".concat(this.instanceId,"] Config:"),{debugMode:e.debugMode,hasRawPluginConfig:!!e.rawPluginConfig,rawPluginConfig:e.rawPluginConfig,features:e.features}),Wi(this.config.debugMode)&&this.config.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Preview mode active - state cleared"));let i=this.resolveEnvironment(),o=Fi(i);e.customApiConfig&&(o=z(v(v({},o),e.customApiConfig),{apiConfig:v(v({},o.apiConfig),e.customApiConfig.apiConfig)}),this.config.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Applied custom API config:"),o.apiConfig.baseUrl)),this.state={auth:{isAuthenticated:!1,isLoading:!1,customer:null,session:null},session:null,customer:null,locale:{locale:"en-US",language:"en",region:"US",messages:{}},currency:{code:"USD",symbol:"$",name:"US Dollar"},store:null,environment:o,isLoading:!0,isInitialized:!1,isSessionInitialized:!1,pluginConfig:{basePath:"/",config:{}},pluginConfigLoading:!0,debugMode:(a=e.debugMode)!=null?a:i!=="production",token:null},console.log("[TagadaClient ".concat(this.instanceId,"] Initial state:"),{pluginConfigLoading:this.state.pluginConfigLoading,hasRawPluginConfig:!!e.rawPluginConfig}),this.apiClient=new yt({baseURL:o.apiConfig.baseUrl});let r=(l=e.features)==null?void 0:l.funnel;if(r!==!1){let p=typeof r=="object"?r:{};this.funnel=new dt({apiClient:this.apiClient,debugMode:this.state.debugMode,pluginConfig:this.state.pluginConfig,environment:this.state.environment,autoRedirect:p.autoRedirect,funnelId:(u=e.rawPluginConfig)==null?void 0:u.funnelId,stepId:(d=e.rawPluginConfig)==null?void 0:d.stepId})}this.apiClient.setTokenProvider(this.waitForToken.bind(this)),typeof window!="undefined"&&(window.addEventListener("storage",this.boundHandleStorageChange),window.addEventListener("pageshow",this.boundHandlePageshow)),this.setupConfigHotReload(),this.initialize()}destroy(){typeof window!="undefined"&&(window.removeEventListener("storage",this.boundHandleStorageChange),window.removeEventListener("pageshow",this.boundHandlePageshow)),this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Destroyed")),this.eventDispatcher.clear(),this.bus.clear()}handleStorageChange(){if(st()===this.state.token){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Token unchanged (ignoring event)"));return}if(this.isInitializingSession){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Session initialization in progress, skipping storage change"));return}if(this.sessionInitRetryCount>=this.MAX_SESSION_INIT_RETRIES&&this.lastSessionInitError){this.state.debugMode&&console.error("[TagadaClient ".concat(this.instanceId,"] Max session init retries reached, giving up"),this.lastSessionInitError);return}this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Storage changed, re-initializing token...")),this.initializeToken()}subscribe(e){return this.eventDispatcher.subscribe(e)}getState(){return this.state}updateState(e){this.state=v(v({},this.state),e),this.eventDispatcher.notify(this.state)}resolveEnvironment(){return this.config.environment?this.config.environment:ot()}async initialize(){try{await this.initializePluginConfig(),this.state.pluginConfig.storeId?await this.initializeToken():(console.warn("[TagadaClient] No store ID found in plugin config. Skipping token initialization."),this.updateState({isLoading:!1,isInitialized:!0}))}catch(e){console.error("[TagadaClient] Initialization failed:",e),this.updateState({isLoading:!1,isInitialized:!0})}}async initializePluginConfig(){if(console.log("[TagadaClient ".concat(this.instanceId,"] initializePluginConfig called"),{pluginConfigLoading:this.state.pluginConfigLoading,hasRawPluginConfig:!!this.config.rawPluginConfig}),!this.state.pluginConfigLoading){console.log("[TagadaClient ".concat(this.instanceId,"] Plugin config already loading or loaded, skipping..."));return}try{let e=this.config.localConfig||"default";console.log("[TagadaClient ".concat(this.instanceId,"] Loading plugin config with variant: ").concat(e));let n=await wr(e,this.config.rawPluginConfig);console.log("[TagadaClient ".concat(this.instanceId,"] Plugin config loaded:"),n),this.updateState({pluginConfig:n,pluginConfigLoading:!1}),this.funnel&&this.funnel.setConfig({pluginConfig:n,environment:this.state.environment})}catch(e){console.error("[TagadaClient] Failed to load plugin config:",e),this.updateState({pluginConfig:{basePath:"/",config:{}},pluginConfigLoading:!1})}}async initializeToken(){var e;if(Sr()){let n=this.state.pluginConfig.storeId;if(!n)return console.error("[TagadaClient] Cannot resolve authCode: storeId not found in config"),this.fallbackToNormalFlow();console.log("[TagadaClient ".concat(this.instanceId,"] \u{1F510} Cross-domain auth detected, resolving..."));try{let i=new URLSearchParams(window.location.search).get("authCode");if(!i)return this.fallbackToNormalFlow();let o=await Ir(i,n,this.state.environment.apiConfig.baseUrl,this.state.debugMode);console.log("[TagadaClient ".concat(this.instanceId,"] \u2705 Auth handoff resolved:"),{customerId:o.customer.id,role:o.customer.role,hasContext:Object.keys(o.context).length>0}),this.setToken(o.token);let r=Ut(o.token);r?(this.updateState({session:r}),await this.initializeSession(r),(e=o.context)!=null&&e.funnelSessionId&&this.funnel&&this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Restoring funnel session from handoff context:"),o.context.funnelSessionId)):(console.error("[TagadaClient] Failed to decode token from handoff"),this.updateState({isInitialized:!0,isLoading:!1}));return}catch(i){console.error("[TagadaClient ".concat(this.instanceId,"] \u274C Auth handoff failed, falling back to normal flow:"),i)}}await this.fallbackToNormalFlow()}async fallbackToNormalFlow(){let n=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("token");n&&(this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] \u{1F512} URL token detected, setting immediately to prevent race condition")),this.apiClient.updateToken(n),ne(n));let i=st();console.log("[TagadaClient ".concat(this.instanceId,"] Initializing token (normal flow)..."),{hasExistingToken:!!i,hasQueryToken:!!n,storeId:this.state.pluginConfig.storeId});let o=null,r=!1;if(n?(o=n,r=!0):i&&!br(i)&&(o=i),o){this.setToken(o),r&&(this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Persisting query token to storage...")),ne(o));let s=Ut(o);s?(this.updateState({session:s}),await this.initializeSession(s)):(console.error("[TagadaClient] Failed to decode token"),this.updateState({isInitialized:!0,isLoading:!1}))}else{let s=this.state.pluginConfig.storeId;console.log("[TagadaClient ".concat(this.instanceId,"] No existing token, creating anonymous token..."),{hasStoreId:!!s,storeId:s}),s?await this.createAnonymousToken(s):(console.warn("[TagadaClient ".concat(this.instanceId,"] No storeId in plugin config, skipping anonymous token creation")),this.updateState({isInitialized:!0,isLoading:!1}))}}setToken(e){this.apiClient.updateToken(e),this.updateState({token:e}),this.tokenResolver&&(this.tokenResolver(e),this.tokenPromise=null,this.tokenResolver=null)}waitForToken(){return this.apiClient.getCurrentToken()?Promise.resolve(this.apiClient.getCurrentToken()):(this.tokenPromise||(this.tokenPromise=new Promise(e=>{this.tokenResolver=e})),this.tokenPromise)}async createAnonymousToken(e){if(typeof window!="undefined"){let i=new URLSearchParams(window.location.search).get("token");if(i){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] \u{1F512} URL has token, skipping anonymous token creation")),this.setToken(i),ne(i);let o=Ut(i);o&&(this.updateState({session:o}),await this.initializeSession(o));return}}if(this.isInitializingSession){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Session initialization in progress, skipping anonymous token creation"));return}try{let n=ct();this.state.debugMode&&console.log("[TagadaClient] Creating anonymous token for store:",e,{draft:n});let i=await this.apiClient.post("/api/v1/cms/session/anonymous",{storeId:e,role:"anonymous",draft:n},{skipAuth:!0});this.setToken(i.token),ne(i.token);let o=Ut(i.token);o&&(this.updateState({session:o}),await this.initializeSession(o)),this.updateState({isSessionInitialized:!0})}catch(n){console.error("[TagadaClient] Failed to create anonymous token:",n),this.updateState({isInitialized:!0,isLoading:!1})}}async initializeSession(e){var n,i,o,r,s,a,l,u,d,p,S;if(this.isInitializingSession){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Session initialization already in progress, skipping"));return}this.isInitializingSession=!0;try{this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Initializing session..."),{sessionId:e.sessionId});let w=Er(),f=Ar(),C=hr(),b=ct(),R=new URLSearchParams(window.location.search).get("draft");R!==null&&Ln(R==="true");let k={storeId:e.storeId,accountId:e.accountId,customerId:e.customerId,role:e.role,browserLocale:C,queryLocale:f.locale,queryCurrency:f.currency,utmSource:f.utmSource,utmMedium:f.utmMedium,utmCampaign:f.utmCampaign,browser:w.userAgent.browser.name,browserVersion:w.userAgent.browser.version,os:w.userAgent.os.name,osVersion:w.userAgent.os.version,deviceType:(n=w.userAgent.device)==null?void 0:n.type,deviceModel:(i=w.userAgent.device)==null?void 0:i.model,deviceVendor:(o=w.userAgent.device)==null?void 0:o.vendor,userAgent:w.userAgent.name,engineName:w.userAgent.engine.name,engineVersion:w.userAgent.engine.version,cpuArchitecture:w.userAgent.cpu.architecture,isBot:(s=(r=w.flags)==null?void 0:r.isBot)!=null?s:!1,isChromeFamily:(l=(a=w.flags)==null?void 0:a.isChromeFamily)!=null?l:!1,isStandalonePWA:(d=(u=w.flags)==null?void 0:u.isStandalonePWA)!=null?d:!1,isAppleSilicon:(S=(p=w.flags)==null?void 0:p.isAppleSilicon)!=null?S:!1,screenWidth:w.screenResolution.width,screenHeight:w.screenResolution.height,timeZone:w.timeZone,draft:b,fetchMessages:!1},y=await this.apiClient.post("/api/v1/cms/session/v2/init",k);this.lastSessionInitError=null,this.sessionInitRetryCount=0,this.updateSessionState(y,e),this.updateState({isInitialized:!0,isSessionInitialized:!0,isLoading:!1}),this.state.debugMode&&console.log("[TagadaClient] Session initialized successfully")}catch(w){this.lastSessionInitError=w,this.sessionInitRetryCount++,console.error("[TagadaClient] Error initializing session (attempt ".concat(this.sessionInitRetryCount,"/").concat(this.MAX_SESSION_INIT_RETRIES,"):"),w),this.updateState({isInitialized:!0,isLoading:!1})}finally{this.isInitializingSession=!1}}updateSessionState(e,n){var o,r,s,a,l,u,d,p,S;if(e.store){let w=e.store,f=z(v({},e.store),{accountId:w.accountId||((o=this.state.pluginConfig)==null?void 0:o.accountId)||n.accountId||"",presentmentCurrencies:w.presentmentCurrencies||[e.store.currency||"USD"],chargeCurrencies:w.chargeCurrencies||[e.store.currency||"USD"]});this.updateState({store:f})}if(e.locale){let w={locale:e.locale,language:e.locale.split("-")[0],region:(r=e.locale.split("-")[1])!=null?r:"US",messages:(s=e.messages)!=null?s:{}};this.updateState({locale:w})}if(e.store){let w={code:e.store.currency,symbol:this.getCurrencySymbol(e.store.currency),name:this.getCurrencyName(e.store.currency)};this.updateState({currency:w})}let i={isAuthenticated:(l=(a=e.customer)==null?void 0:a.isAuthenticated)!=null?l:!1,isLoading:!1,customer:(u=e.customer)!=null?u:null,session:n};if(this.updateState({customer:(d=e.customer)!=null?d:null,auth:i}),this.funnel&&n.customerId&&((p=e.store)!=null&&p.id)){let w=e.store.accountId||((S=this.state.pluginConfig)==null?void 0:S.accountId)||n.accountId||"";if(w){let C=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("funnelId")||void 0;this.state.debugMode&&console.log("[TagadaClient] Auto-initializing funnel...",{customerId:n.customerId,storeId:e.store.id,accountId:w,funnelId:C||"auto-detect"}),this.funnel.autoInitialize({customerId:n.customerId,sessionId:n.sessionId},{id:e.store.id,accountId:w},C).catch(b=>{console.error("[TagadaClient] Funnel auto-initialization failed:",b)})}else console.warn("[TagadaClient] Cannot auto-initialize funnel: accountId is missing")}}getCurrencySymbol(e){return{USD:"$",EUR:"\u20AC",GBP:"\xA3",JPY:"\xA5",CAD:"C$",AUD:"A$"}[e]||e}getCurrencyName(e){return{USD:"US Dollar",EUR:"Euro",GBP:"British Pound",JPY:"Japanese Yen",CAD:"Canadian Dollar",AUD:"Australian Dollar"}[e]||e}getAccountId(){var e,n,i;return((e=this.state.store)==null?void 0:e.accountId)||((n=this.state.pluginConfig)==null?void 0:n.accountId)||((i=this.state.session)==null?void 0:i.accountId)||""}updatePluginConfig(e){this.state.debugMode&&console.log("[TagadaClient] Hot-reloading config:",e);let n=v(v({},this.state.pluginConfig.config),e);this.updateState({pluginConfig:z(v({},this.state.pluginConfig),{config:n})}),this.bus.emit("CONFIG_UPDATED",n),this.state.debugMode&&console.log("[TagadaClient] Config updated successfully")}setupConfigHotReload(){if(typeof window=="undefined")return;let e=n=>{var i,o;if(((i=n.data)==null?void 0:i.type)==="TAGADAPAY_CONFIG_UPDATE"){let{config:r}=n.data;this.state.debugMode&&console.log("[TagadaClient] Received config update from parent:",r),this.updatePluginConfig(r)}else if(((o=n.data)==null?void 0:o.type)==="APPLY_STYLES_TO_ELEMENT"){let{elementId:r,styles:s}=n.data;this.state.debugMode&&console.log("[TagadaClient] Received style application request:",{elementId:r,styles:s}),this.applyStylesToElement(r,s)}};window.addEventListener("message",e),this.state.debugMode&&console.log("[TagadaClient] Config hot-reload and style manipulation listeners enabled")}applyStylesToElement(e,n){if(typeof document=="undefined")return;let i="tagada-editor-highlight",o=document.getElementById(i);o&&o.remove();let r=p=>{var y;let w=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(p.tagName.toLowerCase()),f=p;if(w){let N=p.parentElement;if((N==null?void 0:N.getAttribute("data-tagada-highlight-wrapper"))==="true"&&N instanceof HTMLElement)f=N;else{let _=document.createElement("div");_.setAttribute("data-tagada-highlight-wrapper","true");let W=window.getComputedStyle(p),ae=W.display;if(ae==="inline"?_.style.display="inline-block":_.style.display=ae,_.style.position="relative",ae==="inline"||ae.includes("inline")){let te=W.verticalAlign;te&&te!=="baseline"&&(_.style.verticalAlign=te)}["width","height","minWidth","minHeight","maxWidth","maxHeight","flex","flexGrow","flexShrink","flexBasis","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","alignSelf","justifySelf","boxSizing","gap","rowGap","columnGap","order","aspectRatio"].forEach(te=>{let Ae=te.replace(/([A-Z])/g,"-$1").toLowerCase(),j=W.getPropertyValue(Ae);j&&j.trim()!==""&&(te==="flex"&&j!=="none"&&j!=="0 1 auto"?_.style.flex=j:te==="boxSizing"?_.style.boxSizing=j:_.style.setProperty(Ae,j))}),p.style&&["width","height","min-width","min-height","max-width","max-height","flex","flex-grow","flex-shrink","flex-basis","grid-column","grid-row","grid-column-start","grid-column-end","grid-row-start","grid-row-end","grid-area","align-self","justify-self","box-sizing","gap","row-gap","column-gap","order","aspect-ratio"].forEach(Ae=>{let j=p.style.getPropertyValue(Ae);j&&_.style.setProperty(Ae,j)}),(y=p.parentNode)==null||y.insertBefore(_,p),_.appendChild(p),f=_}}let C=getComputedStyle(w?p:f);(f.style.position==="static"||!f.style.position)&&(f.style.position="relative");let b=document.createElement("div");b.id=i,b.style.position="absolute",b.style.inset="0",b.style.pointerEvents="none",b.style.zIndex="9999",b.style.boxSizing="border-box",b.style.background="none",b.style.border="none",b.style.outline="none",b.style.margin="0",b.style.padding="0";let R=C.borderRadius;R&&(b.style.borderRadius=R),f.appendChild(b);let k=n||{boxShadow:"0 0 0 2px rgb(239 68 68)"};if(Object.entries(k).forEach(([N,K])=>{let _=N.includes("-")?N.replace(/-([a-z])/g,(W,ae)=>ae.toUpperCase()):N;N.includes("-")?b.style.setProperty(N,K):b.style[_]=K}),p.scrollIntoView({behavior:"smooth",block:"center"}),this.state.debugMode){let N=Object.entries(k).map(([K,_])=>"".concat(K,": ").concat(_)).join("; ");console.log("[TagadaClient] Applied styles to highlight div of element #".concat(e,":"),N)}},s=5,a=1e3,l=0,u=p=>{let S=window.getComputedStyle(p);return S.display==="none"||S.visibility==="hidden"||S.opacity==="0"||p.hidden||p.offsetWidth===0||p.offsetHeight===0},d=()=>{let p=document.querySelectorAll('[editor-id~="'.concat(e,'"]'));if(p.length===0){if(l+=1,l>=s){this.state.debugMode&&console.warn('[TagadaClient] Element with editor-id containing "'.concat(e,'" not found after ').concat(s," attempts"));return}this.state.debugMode&&console.warn('[TagadaClient] Element with editor-id containing "'.concat(e,'" not found (attempt ').concat(l,"/").concat(s,"), retrying in ").concat(a/1e3,"s")),setTimeout(d,a);return}let S=null;if(p.length===1)S=p[0];else{for(let w=0;w<p.length;w++)if(!u(p[w])){S=p[w];break}S||(S=p[0])}S&&r(S)};d()}};vn();at();function Cr(t={}){return new Cn(t)}Ue();function Tr(t){return typeof window=="undefined"?null:new URLSearchParams(window.location.search).get(t)}function Ee(t,...e){t&&console.log("[TagadaTracker]",...e)}var Ft=class{constructor(){this.config=null;this.client=null;this.initialized=!1;this.initializing=!1}async init(e){var n,i,o,r;if(this.initialized||this.initializing)return Ee(e.debug||!1,"Already initialized or initializing"),this.getSession();this.initializing=!0,this.config=v({debug:!1},e),Ee(this.config.debug,"\u{1F680} Initializing external tracker with SDK...",e);try{let s=Tr("token");s&&(ne(s),Ee(this.config.debug,"\u{1F511} Bootstrapped token from URL")),this.client=Cr({debugMode:this.config.debug,features:{funnel:!0}}),await this.waitForClientReady();let a=await this.initializeFunnel();Ee(this.config.debug,"\u2705 Session initialized (tracking handled by orchestrator):",a),this.initialized=!0;let l=this.getSession();return l&&((i=(n=this.config).onReady)==null||i.call(n,l)),l}catch(s){let a=s instanceof Error?s:new Error(String(s));throw Ee(this.config.debug,"\u274C Initialization failed:",a),(r=(o=this.config).onError)==null||r.call(o,a),a}finally{this.initializing=!1}}getSession(){var n,i;if(!((i=(n=this.client)==null?void 0:n.funnel)!=null&&i.state.context))return null;let e=this.client.funnel.state.context;return{sessionId:e.sessionId,customerId:e.customerId,storeId:e.storeId,funnelId:e.funnelId,currentStepId:e.currentStepId,cmsToken:this.client.state.token||void 0}}isReady(){var e,n;return this.initialized&&!!((n=(e=this.client)==null?void 0:e.funnel)!=null&&n.state.context)}async navigate(e){if(!this.isReady())throw new Error("Tracker not initialized. Call init() first.");Ee(this.config.debug,"\u{1F680} Navigating:",e);let n=e.autoRedirect!==!1;try{let i=await this.client.funnel.navigate({type:e.eventType,data:e.eventData||{}},{autoRedirect:!1});return i!=null&&i.url?(Ee(this.config.debug,"\u2705 Navigation result:",i.url),n&&typeof window!="undefined"&&(window.location.href=e.returnUrl||i.url),{url:i.url}):null}catch(i){throw Ee(this.config.debug,"\u274C Navigation failed:",i),i}}getCustomerId(){var e,n,i,o,r;return((n=(e=this.client)==null?void 0:e.state.auth.customer)==null?void 0:n.id)||((r=(o=(i=this.client)==null?void 0:i.funnel)==null?void 0:o.state.context)==null?void 0:r.customerId)||null}getFunnelSessionId(){var e,n,i;return((i=(n=(e=this.client)==null?void 0:e.funnel)==null?void 0:n.state.context)==null?void 0:i.sessionId)||null}buildUrl(e,n){let i=this.getSession();if(!i)return e;let o=new URL(e,typeof window!="undefined"?window.location.origin:void 0);return o.searchParams.set("funnelSessionId",i.sessionId),i.cmsToken&&o.searchParams.set("token",i.cmsToken),i.funnelId&&o.searchParams.set("funnelId",i.funnelId),o.searchParams.set("storeId",i.storeId),n&&Object.entries(n).forEach(([r,s])=>{o.searchParams.set(r,s)}),o.toString()}getClient(){return this.client}async waitForClientReady(){if(this.client)return new Promise(e=>{let n=0,i=()=>{var o,r;(o=this.client)!=null&&o.state.isInitialized||(r=this.client)!=null&&r.state.token||n>40?e():(n++,setTimeout(i,50))};i()})}async initializeFunnel(){var o,r,s;if(!((o=this.client)!=null&&o.funnel))return null;let e={customerId:((r=this.client.state.auth.customer)==null?void 0:r.id)||"anon_placeholder",sessionId:((s=this.client.state.auth.session)==null?void 0:s.sessionId)||"sess_placeholder"},n={id:this.config.storeId,accountId:this.config.accountId||""},i=this.config.stepId;if(!i)throw new Error("stepId is required for external page tracking (URL mapping does not work for external pages)");return Ee(this.config.debug,"\u{1F50D} Initializing external page at step:",i),this.client.funnel.initialize(e,n,this.config.funnelId||Tr("funnelId")||void 0,i)}},vi=new Ft;typeof window!="undefined"&&(window.TagadaTracker=vi);return kr(Ma);})();
|
|
7
7
|
/*! Bundled license information:
|
|
8
8
|
|
|
9
9
|
detect-europe-js/dist/esm/index.js:
|